]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/mag/include/server/input_source
update
[l4.git] / l4 / pkg / mag / include / server / input_source
1 // vi:ft=cpp
2 /*
3  * (c) 2010 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
4  *          Alexander Warg <warg@os.inf.tu-dresden.de>
5  *     economic rights: Technische Universität Dresden (Germany)
6  *
7  * This file is part of TUD:OS and distributed under the terms of the
8  * GNU General Public License 2.
9  * Please see the COPYING-GPL-2 file for details.
10  */
11 #pragma once
12
13 #include <l4/re/event>
14
15 struct lua_State;
16
17 namespace Mag_server {
18
19 class Core_api;
20
21 class Input_source
22 {
23 public:
24   Input_source *_next_active;
25   void add_lua_input_source(lua_State *l, int ref_table);
26
27 protected:
28   Core_api *_core;
29   int _ref;
30
31 public:
32   explicit Input_source(Core_api *core = 0) : _core(core) {}
33   virtual void poll_events() = 0;
34   void post_event(L4Re::Event_buffer::Event const *e);
35   Input_source *next() const { return _next_active; }
36   virtual int get_stream_info(l4_umword_t stream_id, L4Re::Event_stream_info *info) = 0;
37   virtual int get_axis_info(l4_umword_t stream_id, unsigned naxes, unsigned *axes, L4Re::Event_absinfo *info) = 0;
38 };
39
40
41 }