From: Peter Hutterer Date: Thu, 9 Jan 2014 03:12:23 +0000 (+1000) Subject: Drop capability events X-Git-Tag: 0.1.0~91 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ab9260c5c70b95779f39069b31646ff5cf8970ad;p=platform%2Fupstream%2Flibinput.git Drop capability events We don't really support devices changing capabilities at runtime. The kernel has no ability to tell us when this happens on an already-opened device and the few devices that can literally change physical capabilities (e.g. the wiimote) open up extra kernel devices instead of modifying the existing one. Thus, we don't need to notify about devices changing capabilities. Signed-off-by: Peter Hutterer --- diff --git a/src/evdev.c b/src/evdev.c index 8ee8a168..43e6a107 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -574,23 +574,6 @@ evdev_configure_device(struct evdev_device *device) return 0; } -static void -register_device_capabilities(struct evdev_device *device) -{ - if (device->seat_caps & EVDEV_DEVICE_POINTER) { - device_register_capability(&device->base, - LIBINPUT_DEVICE_CAP_POINTER); - } - if (device->seat_caps & EVDEV_DEVICE_KEYBOARD) { - device_register_capability(&device->base, - LIBINPUT_DEVICE_CAP_KEYBOARD); - } - if (device->seat_caps & EVDEV_DEVICE_TOUCH) { - device_register_capability(&device->base, - LIBINPUT_DEVICE_CAP_TOUCH); - } -} - struct evdev_device * evdev_device_create(struct libinput_seat *seat, const char *devnode, @@ -644,7 +627,6 @@ evdev_device_create(struct libinput_seat *seat, list_insert(seat->devices_list.prev, &device->base.link); notify_added_device(&device->base); - register_device_capabilities(device); return device; @@ -698,19 +680,6 @@ evdev_device_has_capability(struct evdev_device *device, void evdev_device_remove(struct evdev_device *device) { - if (device->seat_caps & EVDEV_DEVICE_POINTER) { - device_unregister_capability(&device->base, - LIBINPUT_DEVICE_CAP_POINTER); - } - if (device->seat_caps & EVDEV_DEVICE_KEYBOARD) { - device_unregister_capability(&device->base, - LIBINPUT_DEVICE_CAP_KEYBOARD); - } - if (device->seat_caps & EVDEV_DEVICE_TOUCH) { - device_unregister_capability(&device->base, - LIBINPUT_DEVICE_CAP_TOUCH); - } - if (device->source) libinput_remove_source(device->base.seat->libinput, device->source); diff --git a/src/libinput-private.h b/src/libinput-private.h index 5e11bb96..3414388f 100644 --- a/src/libinput-private.h +++ b/src/libinput-private.h @@ -118,14 +118,6 @@ notify_added_device(struct libinput_device *device); void notify_removed_device(struct libinput_device *device); -void -device_register_capability(struct libinput_device *device, - enum libinput_device_capability capability); - -void -device_unregister_capability(struct libinput_device *device, - enum libinput_device_capability capability); - void keyboard_notify_key(struct libinput_device *device, uint32_t time, diff --git a/src/libinput.c b/src/libinput.c index 7d564278..d3aca8b9 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -72,16 +72,6 @@ struct libinput_event_removed_device { struct libinput_device *device; }; -struct libinput_event_device_register_capability { - struct libinput_event base; - enum libinput_device_capability capability; -}; - -struct libinput_event_device_unregister_capability { - struct libinput_event base; - enum libinput_device_capability capability; -}; - struct libinput_event_keyboard_key { struct libinput_event base; uint32_t time; @@ -168,20 +158,6 @@ libinput_event_removed_device_get_device( return event->device; } -LIBINPUT_EXPORT enum libinput_device_capability -libinput_event_device_register_capability_get_capability( - struct libinput_event_device_register_capability *event) -{ - return event->capability; -} - -LIBINPUT_EXPORT enum libinput_device_capability -libinput_event_device_unregister_capability_get_capability( - struct libinput_event_device_unregister_capability *event) -{ - return event->capability; -} - LIBINPUT_EXPORT uint32_t libinput_event_keyboard_key_get_time( struct libinput_event_keyboard_key *event) @@ -448,8 +424,6 @@ libinput_event_get_class(struct libinput_event *event) case LIBINPUT_EVENT_REMOVED_DEVICE: return LIBINPUT_EVENT_CLASS_BASE; - case LIBINPUT_EVENT_DEVICE_REGISTER_CAPABILITY: - case LIBINPUT_EVENT_DEVICE_UNREGISTER_CAPABILITY: case LIBINPUT_EVENT_KEYBOARD_KEY: case LIBINPUT_EVENT_POINTER_MOTION: case LIBINPUT_EVENT_POINTER_MOTION_ABSOLUTE: @@ -720,40 +694,6 @@ notify_removed_device(struct libinput_device *device) &removed_device_event->base); } -void -device_register_capability(struct libinput_device *device, - enum libinput_device_capability capability) -{ - struct libinput_event_device_register_capability *capability_event; - - capability_event = malloc(sizeof *capability_event); - - *capability_event = (struct libinput_event_device_register_capability) { - .capability = capability, - }; - - post_device_event(device, - LIBINPUT_EVENT_DEVICE_REGISTER_CAPABILITY, - &capability_event->base); -} - -void -device_unregister_capability(struct libinput_device *device, - enum libinput_device_capability capability) -{ - struct libinput_event_device_unregister_capability *capability_event; - - capability_event = malloc(sizeof *capability_event); - - *capability_event = (struct libinput_event_device_unregister_capability) { - .capability = capability, - }; - - post_device_event(device, - LIBINPUT_EVENT_DEVICE_UNREGISTER_CAPABILITY, - &capability_event->base); -} - void keyboard_notify_key(struct libinput_device *device, uint32_t time, diff --git a/src/libinput.h b/src/libinput.h index d1c6746a..bb4f950c 100644 --- a/src/libinput.h +++ b/src/libinput.h @@ -128,9 +128,6 @@ enum libinput_event_type { LIBINPUT_EVENT_ADDED_DEVICE, LIBINPUT_EVENT_REMOVED_DEVICE, - LIBINPUT_EVENT_DEVICE_REGISTER_CAPABILITY = 200, - LIBINPUT_EVENT_DEVICE_UNREGISTER_CAPABILITY, - LIBINPUT_EVENT_KEYBOARD_KEY = 300, LIBINPUT_EVENT_POINTER_MOTION = 400, @@ -156,8 +153,6 @@ struct libinput_event_added_seat; struct libinput_event_removed_seat; struct libinput_event_added_device; struct libinput_event_removed_device; -struct libinput_event_device_register_capability; -struct libinput_event_device_unregister_capability; struct libinput_event_keyboard_key; struct libinput_event_pointer_motion; struct libinput_event_pointer_motion_absolute; @@ -274,22 +269,6 @@ struct libinput_device * libinput_event_removed_device_get_device( struct libinput_event_removed_device *event); -/** - * @defgroup event_device_register_capability Register device capability event - */ - -enum libinput_device_capability -libinput_event_device_register_capability_get_capability( - struct libinput_event_device_register_capability *event); - -/** - * @defgroup event_device_unregister_capability Register device capability event - */ - -enum libinput_device_capability -libinput_event_device_unregister_capability_get_capability( - struct libinput_event_device_unregister_capability *event); - /** * @defgroup event_keyboard_key Keyboard key event */