]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/mag/server/src/core_api.cc
update
[l4.git] / l4 / pkg / mag / server / src / core_api.cc
1 // vi:ft=cpp
2 /*
3  * (c) 2010 Alexander Warg <warg@os.inf.tu-dresden.de>
4  *     economic rights: Technische Universität Dresden (Germany)
5  *
6  * This file is part of TUD:OS and distributed under the terms of the
7  * GNU General Public License 2.
8  * Please see the COPYING-GPL-2 file for details.
9  */
10
11 #include "core_api"
12 #include <lua.h>
13
14 namespace Mag_server {
15
16 void
17 Core_api_impl::add_input_source(Input_source *i)
18 {
19   i->_next_active = _input;
20   _input = i;
21   get_refs_table();
22   i->add_lua_input_source(lua_state(), -1);
23   lua_pop(lua_state(), 1);
24 }
25
26 void
27 Core_api_impl::register_session(Session *s) const
28 {
29   _sessions.add_tail(s);
30   s->set_notifier(&_session_ntfy);
31   _session_ntfy.notify();
32 }
33
34 void
35 Core_api_impl::get_ticks(cxx::Observer *o) const
36 {
37   _tick_ntfy.add(o);
38 }
39
40 void
41 Core_api_impl::add_session_observer(cxx::Observer *o) const
42 {
43   _session_ntfy.add(o);
44 }
45
46 }