commit 983b4b7
Michael Forney
·
2013-11-26 02:32:27 +0000 UTC
parent 610fc7f
Remove handler parameter from evdev_handler callbacks
3 files changed,
+12,
-22
+4,
-5
1@@ -30,14 +30,13 @@ static void handle_key_event(struct swc_evdev_device * device,
2 {
3 state = input_event->value ? WL_POINTER_BUTTON_STATE_PRESSED
4 : WL_POINTER_BUTTON_STATE_RELEASED;
5- device->handler->button(device->handler, time,
6- input_event->code, state);
7+ device->handler->button(time, input_event->code, state);
8 }
9 else
10 {
11 state = input_event->value ? WL_KEYBOARD_KEY_STATE_PRESSED
12 : WL_KEYBOARD_KEY_STATE_RELEASED;
13- device->handler->key(device->handler, time, input_event->code, state);
14+ device->handler->key(time, input_event->code, state);
15 }
16 }
17
18@@ -67,7 +66,7 @@ static void handle_rel_event(struct swc_evdev_device * device,
19 break;
20 }
21
22- device->handler->axis(device->handler, time, axis, amount);
23+ device->handler->axis(time, axis, amount);
24 }
25
26 static void handle_abs_event(struct swc_evdev_device * device,
27@@ -97,7 +96,7 @@ static void handle_motion_events(struct swc_evdev_device * device,
28 wl_fixed_t dx = wl_fixed_from_int(device->motion.rel.dx);
29 wl_fixed_t dy = wl_fixed_from_int(device->motion.rel.dy);
30
31- device->handler->relative_motion(device->handler, time, dx, dy);
32+ device->handler->relative_motion(time, dx, dy);
33
34 device->motion.rel.pending = false;
35 device->motion.rel.dx = 0;
+4,
-8
1@@ -10,14 +10,10 @@ struct wl_event_loop;
2
3 struct swc_evdev_device_handler
4 {
5- void (* key)(const struct swc_evdev_device_handler * handler,
6- uint32_t time, uint32_t key, uint32_t state);
7- void (* button)(const struct swc_evdev_device_handler * handler,
8- uint32_t time, uint32_t key, uint32_t state);
9- void (* axis)(const struct swc_evdev_device_handler * handler,
10- uint32_t time, uint32_t axis, wl_fixed_t amount);
11- void (* relative_motion)(const struct swc_evdev_device_handler * handler,
12- uint32_t time, wl_fixed_t dx, wl_fixed_t dy);
13+ void (* key)(uint32_t time, uint32_t key, uint32_t state);
14+ void (* button)(uint32_t time, uint32_t key, uint32_t state);
15+ void (* axis)(uint32_t time, uint32_t axis, wl_fixed_t amount);
16+ void (* relative_motion)(uint32_t time, wl_fixed_t dx, wl_fixed_t dy);
17 };
18
19 struct swc_evdev_device
+4,
-9
1@@ -34,27 +34,22 @@ const struct swc_seat_global swc_seat_global = {
2 .data_device = &seat.data_device
3 };
4
5-static void handle_key(const struct swc_evdev_device_handler * handler,
6- uint32_t time, uint32_t key, uint32_t state)
7+static void handle_key(uint32_t time, uint32_t key, uint32_t state)
8 {
9 swc_keyboard_handle_key(&seat.keyboard, time, key, state);
10 }
11
12-static void handle_button(const struct swc_evdev_device_handler * handler,
13- uint32_t time, uint32_t button, uint32_t state)
14+static void handle_button(uint32_t time, uint32_t button, uint32_t state)
15 {
16 swc_pointer_handle_button(&seat.pointer, time, button, state);
17 }
18
19-static void handle_axis(const struct swc_evdev_device_handler * handler,
20- uint32_t time, uint32_t axis, wl_fixed_t amount)
21+static void handle_axis(uint32_t time, uint32_t axis, wl_fixed_t amount)
22 {
23 swc_pointer_handle_axis(&seat.pointer, time, axis, amount);
24 }
25
26-static void handle_relative_motion
27- (const struct swc_evdev_device_handler * handler,
28- uint32_t time, wl_fixed_t dx, wl_fixed_t dy)
29+static void handle_relative_motion(uint32_t time, wl_fixed_t dx, wl_fixed_t dy)
30 {
31 swc_pointer_handle_relative_motion(&seat.pointer, time, dx, dy);
32 }