Improve namespacing of event types

Now that the target of an event isn't exposed to the caller anymore, the
namespacing can be associated with a more intuitive one.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2013-12-19 12:04:24 +10:00 committed by Jonas Ådahl
parent f98d427713
commit 54db6527ae
4 changed files with 11 additions and 11 deletions

View file

@ -387,8 +387,8 @@ libinput_event_get_class(struct libinput_event *event)
case LIBINPUT_EVENT_NONE:
return LIBINPUT_EVENT_CLASS_NONE;
case LIBINPUT_EVENT_ADDED_DEVICE:
case LIBINPUT_EVENT_REMOVED_DEVICE:
case LIBINPUT_EVENT_DEVICE_ADDED:
case LIBINPUT_EVENT_DEVICE_REMOVED:
return LIBINPUT_EVENT_CLASS_BASE;
case LIBINPUT_EVENT_KEYBOARD_KEY:
@ -604,7 +604,7 @@ notify_added_device(struct libinput_device *device)
};
post_base_event(device,
LIBINPUT_EVENT_ADDED_DEVICE,
LIBINPUT_EVENT_DEVICE_ADDED,
&added_device_event->base);
}
@ -622,7 +622,7 @@ notify_removed_device(struct libinput_device *device)
};
post_base_event(device,
LIBINPUT_EVENT_REMOVED_DEVICE,
LIBINPUT_EVENT_DEVICE_REMOVED,
&removed_device_event->base);
}

View file

@ -124,8 +124,8 @@ enum libinput_touch_type {
*/
enum libinput_event_type {
LIBINPUT_EVENT_NONE = 0,
LIBINPUT_EVENT_ADDED_DEVICE,
LIBINPUT_EVENT_REMOVED_DEVICE,
LIBINPUT_EVENT_DEVICE_ADDED,
LIBINPUT_EVENT_DEVICE_REMOVED,
LIBINPUT_EVENT_KEYBOARD_KEY = 300,

View file

@ -145,7 +145,7 @@ START_TEST(path_added_seat)
ck_assert(event != NULL);
type = libinput_event_get_type(event);
ck_assert_int_eq(type, LIBINPUT_EVENT_ADDED_DEVICE);
ck_assert_int_eq(type, LIBINPUT_EVENT_DEVICE_ADDED);
device = libinput_event_get_device(event);
seat = libinput_device_get_seat(device);
@ -171,7 +171,7 @@ START_TEST(path_added_device)
enum libinput_event_type type;
type = libinput_event_get_type(event);
if (type == LIBINPUT_EVENT_ADDED_DEVICE) {
if (type == LIBINPUT_EVENT_DEVICE_ADDED) {
break;
}

View file

@ -153,7 +153,7 @@ START_TEST(udev_added_seat_default)
while (!default_seat_found && (event = libinput_get_event(li))) {
type = libinput_event_get_type(event);
if (type != LIBINPUT_EVENT_ADDED_DEVICE) {
if (type != LIBINPUT_EVENT_DEVICE_ADDED) {
libinput_event_destroy(event);
continue;
}
@ -243,10 +243,10 @@ process_events_count_devices(struct libinput *li, int *device_count)
while ((event = libinput_get_event(li))) {
switch (libinput_event_get_type(event)) {
case LIBINPUT_EVENT_ADDED_DEVICE:
case LIBINPUT_EVENT_DEVICE_ADDED:
(*device_count)++;
break;
case LIBINPUT_EVENT_REMOVED_DEVICE:
case LIBINPUT_EVENT_DEVICE_REMOVED:
(*device_count)--;
break;
default: