From: Peter Hutterer Date: Mon, 16 Jun 2014 21:55:35 +0000 (+1000) Subject: Rename KEYBOARD_KEY_STATE to KEY_STATE X-Git-Tag: 0.4.0~17 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=967911791f9988be63b8a2c1ffb608eb2871889b;hp=82e81e8790956cb531c9ae5a225e4425b40a1f50;p=platform%2Fupstream%2Flibinput.git Rename KEYBOARD_KEY_STATE to KEY_STATE e912d620d0f20f415b4d3dde967648e4b9c317b9 changed from POINTER_BUTTON_STATE to simply BUTTON_STATE, replicate that for key events too. Signed-off-by: Peter Hutterer --- diff --git a/src/evdev.c b/src/evdev.c index b6412d0..63eaa4d 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -310,8 +310,8 @@ evdev_process_key(struct evdev_device *device, &device->base, time, e->code, - e->value ? LIBINPUT_KEYBOARD_KEY_STATE_PRESSED : - LIBINPUT_KEYBOARD_KEY_STATE_RELEASED); + e->value ? LIBINPUT_KEY_STATE_PRESSED : + LIBINPUT_KEY_STATE_RELEASED); break; } } diff --git a/src/libinput-private.h b/src/libinput-private.h index f0bda1f..4a92fb9 100644 --- a/src/libinput-private.h +++ b/src/libinput-private.h @@ -146,7 +146,7 @@ void keyboard_notify_key(struct libinput_device *device, uint32_t time, uint32_t key, - enum libinput_keyboard_key_state state); + enum libinput_key_state state); void pointer_notify_motion(struct libinput_device *device, diff --git a/src/libinput.c b/src/libinput.c index c4f7fe1..b468aa7 100644 --- a/src/libinput.c +++ b/src/libinput.c @@ -56,7 +56,7 @@ struct libinput_event_keyboard { uint32_t time; uint32_t key; uint32_t seat_key_count; - enum libinput_keyboard_key_state state; + enum libinput_key_state state; }; struct libinput_event_pointer { @@ -285,7 +285,7 @@ libinput_event_keyboard_get_key(struct libinput_event_keyboard *event) return event->key; } -LIBINPUT_EXPORT enum libinput_keyboard_key_state +LIBINPUT_EXPORT enum libinput_key_state libinput_event_keyboard_get_key_state(struct libinput_event_keyboard *event) { return event->state; @@ -717,14 +717,14 @@ libinput_dispatch(struct libinput *libinput) static uint32_t update_seat_key_count(struct libinput_seat *seat, int32_t key, - enum libinput_keyboard_key_state state) + enum libinput_key_state state) { assert(key >= 0 && key <= KEY_MAX); switch (state) { - case LIBINPUT_KEYBOARD_KEY_STATE_PRESSED: + case LIBINPUT_KEY_STATE_PRESSED: return ++seat->button_count[key]; - case LIBINPUT_KEYBOARD_KEY_STATE_RELEASED: + case LIBINPUT_KEY_STATE_RELEASED: /* We might not have received the first PRESSED event. */ if (seat->button_count[key] == 0) return 0; @@ -816,7 +816,7 @@ void keyboard_notify_key(struct libinput_device *device, uint32_t time, uint32_t key, - enum libinput_keyboard_key_state state) + enum libinput_key_state state) { struct libinput_event_keyboard *key_event; uint32_t seat_key_count; diff --git a/src/libinput.h b/src/libinput.h index b1b1124..fb2e490 100644 --- a/src/libinput.h +++ b/src/libinput.h @@ -130,9 +130,9 @@ enum libinput_device_capability { * Logical state of a key. Note that the logical state may not represent * the physical state of the key. */ -enum libinput_keyboard_key_state { - LIBINPUT_KEYBOARD_KEY_STATE_RELEASED = 0, - LIBINPUT_KEYBOARD_KEY_STATE_PRESSED = 1 +enum libinput_key_state { + LIBINPUT_KEY_STATE_RELEASED = 0, + LIBINPUT_KEY_STATE_PRESSED = 1 }; /** @@ -382,7 +382,7 @@ libinput_event_keyboard_get_key(struct libinput_event_keyboard *event); * * @return The state change of the key */ -enum libinput_keyboard_key_state +enum libinput_key_state libinput_event_keyboard_get_key_state(struct libinput_event_keyboard *event); diff --git a/test/keyboard.c b/test/keyboard.c index a518b66..e1af05f 100644 --- a/test/keyboard.c +++ b/test/keyboard.c @@ -64,7 +64,7 @@ START_TEST(keyboard_seat_key_count) ck_assert_notnull(kev); ck_assert_int_eq(libinput_event_keyboard_get_key(kev), KEY_A); ck_assert_int_eq(libinput_event_keyboard_get_key_state(kev), - LIBINPUT_KEYBOARD_KEY_STATE_PRESSED); + LIBINPUT_KEY_STATE_PRESSED); ++expected_key_button_count; seat_key_count = @@ -93,7 +93,7 @@ START_TEST(keyboard_seat_key_count) ck_assert_notnull(kev); ck_assert_int_eq(libinput_event_keyboard_get_key(kev), KEY_A); ck_assert_int_eq(libinput_event_keyboard_get_key_state(kev), - LIBINPUT_KEYBOARD_KEY_STATE_RELEASED); + LIBINPUT_KEY_STATE_RELEASED); --expected_key_button_count; seat_key_count = diff --git a/tools/event-debug.c b/tools/event-debug.c index 34acfce..eb43e05 100644 --- a/tools/event-debug.c +++ b/tools/event-debug.c @@ -247,13 +247,13 @@ static void print_key_event(struct libinput_event *ev) { struct libinput_event_keyboard *k = libinput_event_get_keyboard_event(ev); - enum libinput_keyboard_key_state state; + enum libinput_key_state state; print_event_time(libinput_event_keyboard_get_time(k)); state = libinput_event_keyboard_get_key_state(k); printf("%d %s\n", libinput_event_keyboard_get_key(k), - state == LIBINPUT_KEYBOARD_KEY_STATE_PRESSED ? "pressed" : "released"); + state == LIBINPUT_KEY_STATE_PRESSED ? "pressed" : "released"); } static void