commit 983b4b7597df0c54f88c5c98d91644a568ddb0df
parent 610fc7f52dc716802bf99c2d5b0f393d5139d9a0
Author: Michael Forney <mforney@mforney.org>
Date: Mon, 25 Nov 2013 18:32:27 -0800
Remove handler parameter from evdev_handler callbacks
Diffstat:
3 files changed, 12 insertions(+), 22 deletions(-)
diff --git a/libswc/evdev_device.c b/libswc/evdev_device.c
@@ -30,14 +30,13 @@ static void handle_key_event(struct swc_evdev_device * device,
{
state = input_event->value ? WL_POINTER_BUTTON_STATE_PRESSED
: WL_POINTER_BUTTON_STATE_RELEASED;
- device->handler->button(device->handler, time,
- input_event->code, state);
+ device->handler->button(time, input_event->code, state);
}
else
{
state = input_event->value ? WL_KEYBOARD_KEY_STATE_PRESSED
: WL_KEYBOARD_KEY_STATE_RELEASED;
- device->handler->key(device->handler, time, input_event->code, state);
+ device->handler->key(time, input_event->code, state);
}
}
@@ -67,7 +66,7 @@ static void handle_rel_event(struct swc_evdev_device * device,
break;
}
- device->handler->axis(device->handler, time, axis, amount);
+ device->handler->axis(time, axis, amount);
}
static void handle_abs_event(struct swc_evdev_device * device,
@@ -97,7 +96,7 @@ static void handle_motion_events(struct swc_evdev_device * device,
wl_fixed_t dx = wl_fixed_from_int(device->motion.rel.dx);
wl_fixed_t dy = wl_fixed_from_int(device->motion.rel.dy);
- device->handler->relative_motion(device->handler, time, dx, dy);
+ device->handler->relative_motion(time, dx, dy);
device->motion.rel.pending = false;
device->motion.rel.dx = 0;
diff --git a/libswc/evdev_device.h b/libswc/evdev_device.h
@@ -10,14 +10,10 @@ struct wl_event_loop;
struct swc_evdev_device_handler
{
- void (* key)(const struct swc_evdev_device_handler * handler,
- uint32_t time, uint32_t key, uint32_t state);
- void (* button)(const struct swc_evdev_device_handler * handler,
- uint32_t time, uint32_t key, uint32_t state);
- void (* axis)(const struct swc_evdev_device_handler * handler,
- uint32_t time, uint32_t axis, wl_fixed_t amount);
- void (* relative_motion)(const struct swc_evdev_device_handler * handler,
- uint32_t time, wl_fixed_t dx, wl_fixed_t dy);
+ void (* key)(uint32_t time, uint32_t key, uint32_t state);
+ void (* button)(uint32_t time, uint32_t key, uint32_t state);
+ void (* axis)(uint32_t time, uint32_t axis, wl_fixed_t amount);
+ void (* relative_motion)(uint32_t time, wl_fixed_t dx, wl_fixed_t dy);
};
struct swc_evdev_device
diff --git a/libswc/seat.c b/libswc/seat.c
@@ -34,27 +34,22 @@ const struct swc_seat_global swc_seat_global = {
.data_device = &seat.data_device
};
-static void handle_key(const struct swc_evdev_device_handler * handler,
- uint32_t time, uint32_t key, uint32_t state)
+static void handle_key(uint32_t time, uint32_t key, uint32_t state)
{
swc_keyboard_handle_key(&seat.keyboard, time, key, state);
}
-static void handle_button(const struct swc_evdev_device_handler * handler,
- uint32_t time, uint32_t button, uint32_t state)
+static void handle_button(uint32_t time, uint32_t button, uint32_t state)
{
swc_pointer_handle_button(&seat.pointer, time, button, state);
}
-static void handle_axis(const struct swc_evdev_device_handler * handler,
- uint32_t time, uint32_t axis, wl_fixed_t amount)
+static void handle_axis(uint32_t time, uint32_t axis, wl_fixed_t amount)
{
swc_pointer_handle_axis(&seat.pointer, time, axis, amount);
}
-static void handle_relative_motion
- (const struct swc_evdev_device_handler * handler,
- uint32_t time, wl_fixed_t dx, wl_fixed_t dy)
+static void handle_relative_motion(uint32_t time, wl_fixed_t dx, wl_fixed_t dy)
{
swc_pointer_handle_relative_motion(&seat.pointer, time, dx, dy);
}