[PATCH libinput 09/14] tablet: rename TOOL_TIP to TABLET_TOOL_TIP

Peter Hutterer peter.hutterer at who-t.net
Tue Nov 17 20:17:56 PST 2015


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev-tablet.c  |  8 ++++----
 src/libinput.h      |  4 ++--
 test/tablet.c       | 38 +++++++++++++++++++-------------------
 tools/event-debug.c |  2 +-
 tools/event-gui.c   |  2 +-
 5 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c
index 871e10e..c1d69de 100644
--- a/src/evdev-tablet.c
+++ b/src/evdev-tablet.c
@@ -410,7 +410,7 @@ tablet_check_notify_axes(struct tablet_dispatch *tablet,
 			enum libinput_tablet_tool_tip_state tip_state;
 
 			tip_state = tablet_has_status(tablet, TABLET_TOOL_IN_CONTACT) ?
-				LIBINPUT_TOOL_TIP_DOWN : LIBINPUT_TOOL_TIP_UP;
+				LIBINPUT_TABLET_TOOL_TIP_DOWN : LIBINPUT_TABLET_TOOL_TIP_UP;
 			tablet_notify_axis(base,
 					   time,
 					   tool,
@@ -795,7 +795,7 @@ tablet_notify_button_mask(struct tablet_dispatch *tablet,
 	enum libinput_tablet_tool_tip_state tip_state;
 
 	tip_state = tablet_has_status(tablet, TABLET_TOOL_IN_CONTACT) ?
-			LIBINPUT_TOOL_TIP_DOWN : LIBINPUT_TOOL_TIP_UP;
+			LIBINPUT_TABLET_TOOL_TIP_DOWN : LIBINPUT_TABLET_TOOL_TIP_UP;
 
 	for (i = 0; i < nbits; i++) {
 		if (!bit_is_set(buttons, i))
@@ -906,7 +906,7 @@ tablet_flush(struct tablet_dispatch *tablet,
 		tablet_notify_tip(&device->base,
 				  time,
 				  tool,
-				  LIBINPUT_TOOL_TIP_DOWN,
+				  LIBINPUT_TABLET_TOOL_TIP_DOWN,
 				  tablet->axes);
 		tablet_unset_status(tablet, TABLET_TOOL_ENTERING_CONTACT);
 		tablet_set_status(tablet, TABLET_TOOL_IN_CONTACT);
@@ -934,7 +934,7 @@ tablet_flush(struct tablet_dispatch *tablet,
 		tablet_notify_tip(&device->base,
 				  time,
 				  tool,
-				  LIBINPUT_TOOL_TIP_UP,
+				  LIBINPUT_TABLET_TOOL_TIP_UP,
 				  tablet->axes);
 		tablet_unset_status(tablet, TABLET_TOOL_LEAVING_CONTACT);
 		tablet_unset_status(tablet, TABLET_TOOL_IN_CONTACT);
diff --git a/src/libinput.h b/src/libinput.h
index a13700f..ff1eaa6 100644
--- a/src/libinput.h
+++ b/src/libinput.h
@@ -226,8 +226,8 @@ enum libinput_tablet_tool_proximity_state {
  * touching the surface of the tablet device.
  */
 enum libinput_tablet_tool_tip_state {
-	LIBINPUT_TOOL_TIP_UP = 0,
-	LIBINPUT_TOOL_TIP_DOWN = 1,
+	LIBINPUT_TABLET_TOOL_TIP_UP = 0,
+	LIBINPUT_TABLET_TOOL_TIP_DOWN = 1,
 };
 
 /**
diff --git a/test/tablet.c b/test/tablet.c
index 50188d5..7aa76b2 100644
--- a/test/tablet.c
+++ b/test/tablet.c
@@ -56,7 +56,7 @@ START_TEST(tip_down_up)
 	tablet_event = litest_is_tablet_event(event,
 					      LIBINPUT_EVENT_TABLET_TIP);
 	ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
-			 LIBINPUT_TOOL_TIP_DOWN);
+			 LIBINPUT_TABLET_TOOL_TIP_DOWN);
 	libinput_event_destroy(event);
 	litest_assert_empty_queue(li);
 
@@ -68,7 +68,7 @@ START_TEST(tip_down_up)
 	tablet_event = litest_is_tablet_event(event,
 					      LIBINPUT_EVENT_TABLET_TIP);
 	ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
-			 LIBINPUT_TOOL_TIP_UP);
+			 LIBINPUT_TABLET_TOOL_TIP_UP);
 	libinput_event_destroy(event);
 	litest_assert_empty_queue(li);
 
@@ -108,7 +108,7 @@ START_TEST(tip_down_prox_in)
 	tablet_event = litest_is_tablet_event(event,
 					      LIBINPUT_EVENT_TABLET_TIP);
 	ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
-			 LIBINPUT_TOOL_TIP_DOWN);
+			 LIBINPUT_TABLET_TOOL_TIP_DOWN);
 	libinput_event_destroy(event);
 
 	litest_assert_empty_queue(li);
@@ -142,7 +142,7 @@ START_TEST(tip_up_prox_out)
 	tablet_event = litest_is_tablet_event(event,
 					      LIBINPUT_EVENT_TABLET_TIP);
 	ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
-			 LIBINPUT_TOOL_TIP_UP);
+			 LIBINPUT_TABLET_TOOL_TIP_UP);
 	libinput_event_destroy(event);
 
 	libinput_dispatch(li);
@@ -193,7 +193,7 @@ START_TEST(tip_up_btn_change)
 	tablet_event = litest_is_tablet_event(event,
 					      LIBINPUT_EVENT_TABLET_TIP);
 	ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
-			 LIBINPUT_TOOL_TIP_UP);
+			 LIBINPUT_TABLET_TOOL_TIP_UP);
 	libinput_event_destroy(event);
 
 	litest_assert_empty_queue(li);
@@ -222,7 +222,7 @@ START_TEST(tip_up_btn_change)
 	tablet_event = litest_is_tablet_event(event,
 					      LIBINPUT_EVENT_TABLET_TIP);
 	ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
-			 LIBINPUT_TOOL_TIP_UP);
+			 LIBINPUT_TABLET_TOOL_TIP_UP);
 	libinput_event_destroy(event);
 
 	litest_assert_empty_queue(li);
@@ -252,7 +252,7 @@ START_TEST(tip_down_btn_change)
 	tablet_event = litest_is_tablet_event(event,
 					      LIBINPUT_EVENT_TABLET_TIP);
 	ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
-			 LIBINPUT_TOOL_TIP_DOWN);
+			 LIBINPUT_TABLET_TOOL_TIP_DOWN);
 	libinput_event_destroy(event);
 
 	libinput_dispatch(li);
@@ -281,7 +281,7 @@ START_TEST(tip_down_btn_change)
 	tablet_event = litest_is_tablet_event(event,
 					      LIBINPUT_EVENT_TABLET_TIP);
 	ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
-			 LIBINPUT_TOOL_TIP_DOWN);
+			 LIBINPUT_TABLET_TOOL_TIP_DOWN);
 	libinput_event_destroy(event);
 
 	libinput_dispatch(li);
@@ -334,7 +334,7 @@ START_TEST(tip_down_motion)
 	tablet_event = litest_is_tablet_event(event,
 					      LIBINPUT_EVENT_TABLET_TIP);
 	ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
-			 LIBINPUT_TOOL_TIP_DOWN);
+			 LIBINPUT_TABLET_TOOL_TIP_DOWN);
 	x = libinput_event_tablet_get_axis_value(tablet_event,
 						 LIBINPUT_TABLET_TOOL_AXIS_X);
 	y = libinput_event_tablet_get_axis_value(tablet_event,
@@ -385,7 +385,7 @@ START_TEST(tip_up_motion)
 	tablet_event = litest_is_tablet_event(event,
 					      LIBINPUT_EVENT_TABLET_TIP);
 	ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
-			 LIBINPUT_TOOL_TIP_UP);
+			 LIBINPUT_TABLET_TOOL_TIP_UP);
 	x = libinput_event_tablet_get_axis_value(tablet_event,
 						 LIBINPUT_TABLET_TOOL_AXIS_X);
 	y = libinput_event_tablet_get_axis_value(tablet_event,
@@ -418,7 +418,7 @@ START_TEST(tip_state_proximity)
 	tablet_event = litest_is_tablet_event(event,
 					      LIBINPUT_EVENT_TABLET_PROXIMITY);
 	ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
-			 LIBINPUT_TOOL_TIP_UP);
+			 LIBINPUT_TABLET_TOOL_TIP_UP);
 	libinput_event_destroy(event);
 
 	litest_event(dev, EV_KEY, BTN_TOUCH, 1);
@@ -434,7 +434,7 @@ START_TEST(tip_state_proximity)
 	tablet_event = litest_is_tablet_event(event,
 					      LIBINPUT_EVENT_TABLET_PROXIMITY);
 	ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
-			 LIBINPUT_TOOL_TIP_UP);
+			 LIBINPUT_TABLET_TOOL_TIP_UP);
 	libinput_event_destroy(event);
 }
 END_TEST
@@ -460,7 +460,7 @@ START_TEST(tip_state_axis)
 	tablet_event = litest_is_tablet_event(event,
 					      LIBINPUT_EVENT_TABLET_AXIS);
 	ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
-			 LIBINPUT_TOOL_TIP_UP);
+			 LIBINPUT_TABLET_TOOL_TIP_UP);
 	libinput_event_destroy(event);
 
 	litest_event(dev, EV_KEY, BTN_TOUCH, 1);
@@ -474,7 +474,7 @@ START_TEST(tip_state_axis)
 	tablet_event = litest_is_tablet_event(event,
 					      LIBINPUT_EVENT_TABLET_AXIS);
 	ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
-			 LIBINPUT_TOOL_TIP_DOWN);
+			 LIBINPUT_TABLET_TOOL_TIP_DOWN);
 	libinput_event_destroy(event);
 
 	litest_event(dev, EV_KEY, BTN_TOUCH, 0);
@@ -488,7 +488,7 @@ START_TEST(tip_state_axis)
 	tablet_event = litest_is_tablet_event(event,
 					      LIBINPUT_EVENT_TABLET_AXIS);
 	ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
-			 LIBINPUT_TOOL_TIP_UP);
+			 LIBINPUT_TABLET_TOOL_TIP_UP);
 	libinput_event_destroy(event);
 
 	litest_assert_empty_queue(li);
@@ -517,7 +517,7 @@ START_TEST(tip_state_button)
 	tablet_event = litest_is_tablet_event(event,
 					      LIBINPUT_EVENT_TABLET_BUTTON);
 	ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
-			 LIBINPUT_TOOL_TIP_UP);
+			 LIBINPUT_TABLET_TOOL_TIP_UP);
 	libinput_event_destroy(event);
 
 	litest_event(dev, EV_KEY, BTN_TOUCH, 1);
@@ -532,7 +532,7 @@ START_TEST(tip_state_button)
 	tablet_event = litest_is_tablet_event(event,
 					      LIBINPUT_EVENT_TABLET_BUTTON);
 	ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
-			 LIBINPUT_TOOL_TIP_DOWN);
+			 LIBINPUT_TABLET_TOOL_TIP_DOWN);
 	libinput_event_destroy(event);
 
 	litest_event(dev, EV_KEY, BTN_TOUCH, 0);
@@ -547,7 +547,7 @@ START_TEST(tip_state_button)
 	tablet_event = litest_is_tablet_event(event,
 					      LIBINPUT_EVENT_TABLET_BUTTON);
 	ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
-			 LIBINPUT_TOOL_TIP_UP);
+			 LIBINPUT_TABLET_TOOL_TIP_UP);
 	libinput_event_destroy(event);
 
 	litest_event(dev, EV_KEY, BTN_STYLUS, 0);
@@ -558,7 +558,7 @@ START_TEST(tip_state_button)
 	tablet_event = litest_is_tablet_event(event,
 					      LIBINPUT_EVENT_TABLET_BUTTON);
 	ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
-			 LIBINPUT_TOOL_TIP_UP);
+			 LIBINPUT_TABLET_TOOL_TIP_UP);
 	libinput_event_destroy(event);
 
 	litest_assert_empty_queue(li);
diff --git a/tools/event-debug.c b/tools/event-debug.c
index 75d8162..c123917 100644
--- a/tools/event-debug.c
+++ b/tools/event-debug.c
@@ -290,7 +290,7 @@ print_tablet_tip_event(struct libinput_event *ev)
 	print_event_time(libinput_event_tablet_get_time(p));
 
 	state = libinput_event_tablet_get_tip_state(p);
-	printf("%s\n", state == LIBINPUT_TOOL_TIP_DOWN ? "down" : "up");
+	printf("%s\n", state == LIBINPUT_TABLET_TOOL_TIP_DOWN ? "down" : "up");
 }
 
 static void
diff --git a/tools/event-gui.c b/tools/event-gui.c
index f4f22db..4199373 100644
--- a/tools/event-gui.c
+++ b/tools/event-gui.c
@@ -637,7 +637,7 @@ handle_event_tablet(struct libinput_event *ev, struct window *w)
 		x = libinput_event_tablet_get_x_transformed(t, w->width);
 		y = libinput_event_tablet_get_y_transformed(t, w->height);
 		if (libinput_event_tablet_get_tip_state(t) ==
-		    LIBINPUT_TOOL_TIP_DOWN) {
+		    LIBINPUT_TABLET_TOOL_TIP_DOWN) {
 			w->tool.x_down = x;
 			w->tool.y_down = y;
 		} else {
-- 
2.5.0



More information about the wayland-devel mailing list