1.1 --- a/pkg/devices/input/include/input-event-loop.h Fri May 18 22:34:51 2018 +0200
1.2 +++ b/pkg/devices/input/include/input-event-loop.h Fri May 18 23:41:51 2018 +0200
1.3 @@ -29,20 +29,10 @@
1.4 #include <l4/sys/capability>
1.5 #include <l4/sys/icu>
1.6
1.7 -typedef L4Re::Event_buffer::Event Event_type;
1.8 -
1.9 /* Input event loop abstraction. */
1.10
1.11 -class Input_event_loop : public Event_loop
1.12 +class Input_event_loop : public Event_handler_loop<L4Re::Event_buffer::Event>
1.13 {
1.14 - /* Handler function type. */
1.15 -
1.16 - typedef void (*Event_handler)(Event_type &, void *);
1.17 -
1.18 - /* External handler function. */
1.19 -
1.20 - Event_handler _handler;
1.21 -
1.22 /* Event buffer and notification interrupt capability. */
1.23
1.24 L4Re::Event_buffer _event_buffer;
1.25 @@ -52,22 +42,21 @@
1.26 L4::Cap<L4::Irq> _irq;
1.27
1.28 public:
1.29 - /* Initialise the event loop with an event handler function and private data,
1.30 - an event buffer, a notification interrupt, and a thread priority. */
1.31 + /* Initialise the event loop with an event buffer, a notification interrupt,
1.32 + and a thread priority. */
1.33
1.34 - explicit Input_event_loop(Event_handler handler, void *priv,
1.35 - L4Re::Event_buffer event_buffer,
1.36 + explicit Input_event_loop(L4Re::Event_buffer event_buffer,
1.37 L4::Cap<L4::Irq> irq,
1.38 int priority=0x20)
1.39 - : _handler(handler), Event_loop(priv, priority), _event_buffer(event_buffer), _irq(irq)
1.40 + : Event_handler_loop(priority), _event_buffer(event_buffer), _irq(irq)
1.41 {
1.42 }
1.43
1.44 - /* Event handler method. */
1.45 + /* Event handler method, dispatching to the provided handler. */
1.46
1.47 virtual void handle();
1.48
1.49 - /* Initiation function. */
1.50 + /* Start the loop, dispatching to the handle method. */
1.51
1.52 virtual void start(l4_umword_t label=0xDF00);
1.53 };