[PATCH libinput] Rename a tablet function to ...has_axis to match the pointer axis function

Peter Hutterer peter.hutterer at who-t.net
Mon Jan 19 19:19:03 PST 2015


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
For the tablet-support branch, provides some consistency.

 src/libinput.c      |  2 +-
 src/libinput.h      |  4 ++--
 src/libinput.sym    |  2 +-
 test/tablet.c       | 20 ++++++++++----------
 tools/event-debug.c |  2 +-
 5 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/libinput.c b/src/libinput.c
index 2469c86..4bb9e1c 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -559,7 +559,7 @@ libinput_event_touch_get_y(struct libinput_event_touch *event)
 }
 
 LIBINPUT_EXPORT int
-libinput_event_tablet_axis_has_changed(struct libinput_event_tablet *event,
+libinput_event_tablet_has_axis(struct libinput_event_tablet *event,
 				       enum libinput_tablet_axis axis)
 {
 	return (NCHARS(axis) <= sizeof(event->changed_axes)) ?
diff --git a/src/libinput.h b/src/libinput.h
index 649484d..e21e934 100644
--- a/src/libinput.h
+++ b/src/libinput.h
@@ -989,8 +989,8 @@ libinput_event_touch_get_base_event(struct libinput_event_touch *event);
  * @return 1 if the axis was updated or 0 otherwise
  */
 int
-libinput_event_tablet_axis_has_changed(struct libinput_event_tablet *event,
-				       enum libinput_tablet_axis axis);
+libinput_event_tablet_has_axis(struct libinput_event_tablet *event,
+			       enum libinput_tablet_axis axis);
 
 /**
  * @ingroup event_tablet
diff --git a/src/libinput.sym b/src/libinput.sym
index 8f4672d..716e5d7 100644
--- a/src/libinput.sym
+++ b/src/libinput.sym
@@ -120,7 +120,7 @@ global:
 	/* tablet APIs, they are not part of any stable API promise yet.
 	 * keep them separate */
 	libinput_event_get_tablet_event;
-	libinput_event_tablet_axis_has_changed;
+	libinput_event_tablet_has_axis;
 	libinput_event_tablet_get_axis_value;
 	libinput_event_tablet_get_button;
 	libinput_event_tablet_get_button_state;
diff --git a/test/tablet.c b/test/tablet.c
index 367c4db..927ef5c 100644
--- a/test/tablet.c
+++ b/test/tablet.c
@@ -175,9 +175,9 @@ START_TEST(motion)
 			bool x_changed, y_changed;
 			double reported_x, reported_y;
 
-			x_changed = libinput_event_tablet_axis_has_changed(
+			x_changed = libinput_event_tablet_has_axis(
 			    tablet_event, LIBINPUT_TABLET_AXIS_X);
-			y_changed = libinput_event_tablet_axis_has_changed(
+			y_changed = libinput_event_tablet_has_axis(
 			    tablet_event, LIBINPUT_TABLET_AXIS_Y);
 
 			ck_assert(x_changed);
@@ -211,9 +211,9 @@ START_TEST(motion)
 			type = libinput_event_get_type(event);
 
 			if (type == LIBINPUT_EVENT_TABLET_AXIS) {
-				x_changed = libinput_event_tablet_axis_has_changed(
+				x_changed = libinput_event_tablet_has_axis(
 				    tablet_event, LIBINPUT_TABLET_AXIS_X);
-				y_changed = libinput_event_tablet_axis_has_changed(
+				y_changed = libinput_event_tablet_has_axis(
 				    tablet_event, LIBINPUT_TABLET_AXIS_Y);
 
 				ck_assert(x_changed);
@@ -392,7 +392,7 @@ START_TEST(normalization)
 		if (libinput_event_get_type(event) == LIBINPUT_EVENT_TABLET_AXIS) {
 			tablet_event = libinput_event_get_tablet_event(event);
 
-			if (libinput_event_tablet_axis_has_changed(
+			if (libinput_event_tablet_has_axis(
 				tablet_event,
 				LIBINPUT_TABLET_AXIS_PRESSURE)) {
 				pressure = libinput_event_tablet_get_axis_value(
@@ -401,7 +401,7 @@ START_TEST(normalization)
 				litest_assert_double_eq(pressure, 0);
 			}
 
-			if (libinput_event_tablet_axis_has_changed(
+			if (libinput_event_tablet_has_axis(
 				tablet_event,
 				LIBINPUT_TABLET_AXIS_TILT_X)) {
 				tilt_vertical =
@@ -412,7 +412,7 @@ START_TEST(normalization)
 				litest_assert_double_eq(tilt_vertical, -1);
 			}
 
-			if (libinput_event_tablet_axis_has_changed(
+			if (libinput_event_tablet_has_axis(
 				tablet_event,
 				LIBINPUT_TABLET_AXIS_TILT_Y)) {
 				tilt_horizontal =
@@ -454,7 +454,7 @@ START_TEST(normalization)
 		if (libinput_event_get_type(event) == LIBINPUT_EVENT_TABLET_AXIS) {
 			tablet_event = libinput_event_get_tablet_event(event);
 
-			if (libinput_event_tablet_axis_has_changed(
+			if (libinput_event_tablet_has_axis(
 				tablet_event,
 				LIBINPUT_TABLET_AXIS_PRESSURE)) {
 				pressure = libinput_event_tablet_get_axis_value(
@@ -463,7 +463,7 @@ START_TEST(normalization)
 				litest_assert_double_eq(pressure, 1);
 			}
 
-			if (libinput_event_tablet_axis_has_changed(
+			if (libinput_event_tablet_has_axis(
 				tablet_event,
 				LIBINPUT_TABLET_AXIS_TILT_X)) {
 				tilt_vertical =
@@ -474,7 +474,7 @@ START_TEST(normalization)
 				litest_assert_double_eq(tilt_vertical, 1);
 			}
 
-			if (libinput_event_tablet_axis_has_changed(
+			if (libinput_event_tablet_has_axis(
 				tablet_event,
 				LIBINPUT_TABLET_AXIS_TILT_Y)) {
 				tilt_horizontal =
diff --git a/tools/event-debug.c b/tools/event-debug.c
index ad64f4b..1baceb5 100644
--- a/tools/event-debug.c
+++ b/tools/event-debug.c
@@ -270,7 +270,7 @@ static const char*
 tablet_axis_changed_sym(struct libinput_event_tablet *t,
 			enum libinput_tablet_axis axis)
 {
-	if (libinput_event_tablet_axis_has_changed(t, axis))
+	if (libinput_event_tablet_has_axis(t, axis))
 		return "*";
 	else
 		return "";
-- 
2.1.0



More information about the wayland-devel mailing list