3 * (c) 2010 Alexander Warg <warg@os.inf.tu-dresden.de>
4 * economic rights: Technische Universität Dresden (Germany)
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.
12 #include <l4/mag/server/object>
13 #include <l4/re/video/goos>
15 namespace Mag_server {
23 friend class Core_api;
24 Input_source *_next_active;
30 explicit Input_source(Core_api *core = 0) : _core(core) {}
31 virtual void poll_events() = 0;
32 Input_source *next() const { return _next_active; }
41 L4::Cap<void> _rcv_cap;
42 L4::Cap<L4Re::Video::Goos> _fb;
45 Core_api(Core_api const &);
46 void operator = (Core_api const &);
49 Core_api(Registry *r, User_state *u, L4::Cap<void> rcvc,
50 L4::Cap<L4Re::Video::Goos> fb)
51 : _reg(r), _ust(u), _rcv_cap(rcvc), _fb(fb)
54 Registry *registry() const { return _reg; }
55 User_state *user_state() const { return _ust; }
56 Input_source *input_sources() const { return _input; }
57 L4::Cap<L4Re::Video::Goos> backend_fb() const { return _fb; }
58 void add_input_source(Input_source *i)
60 i->_next_active = _input;
64 L4::Cap<void> rcv_cap() const { return _rcv_cap; }
70 friend class Plugin_manager;
72 char const *const _name;
76 static Plugin *_first;
78 Plugin(Plugin const &);
79 void operator = (Plugin const &);
82 unsigned &get_flags() { return _flags; }
83 Plugin(char const *name) : _name(name), _flags(0), _next(_first)
92 virtual char const *type() const { return "generic"; }
93 char const *name() const { return _name; }
95 bool started() const { return _flags & F_started; }
97 virtual void start(Core_api *) = 0;
98 virtual void stop() {}