[PATCH libinput 12/14] tablet: rename libinput_event_tablet to libinput_event_tablet_tool
Peter Hutterer
peter.hutterer at who-t.net
Tue Nov 17 20:17:59 PST 2015
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
src/libinput.c | 56 +++----
src/libinput.h | 66 ++++----
src/libinput.sym | 32 ++--
test/litest.c | 30 ++--
test/litest.h | 2 +-
test/misc.c | 16 +-
test/tablet.c | 438 ++++++++++++++++++++++++++--------------------------
tools/event-debug.c | 72 ++++-----
tools/event-gui.c | 26 ++--
9 files changed, 369 insertions(+), 369 deletions(-)
diff --git a/src/libinput.c b/src/libinput.c
index 79e3832..338255d 100644
--- a/src/libinput.c
+++ b/src/libinput.c
@@ -125,7 +125,7 @@ struct libinput_event_gesture {
double angle;
};
-struct libinput_event_tablet {
+struct libinput_event_tablet_tool {
struct libinput_event base;
uint32_t button;
enum libinput_button_state state;
@@ -306,8 +306,8 @@ libinput_event_get_gesture_event(struct libinput_event *event)
return (struct libinput_event_gesture *) event;
}
-LIBINPUT_EXPORT struct libinput_event_tablet *
-libinput_event_get_tablet_event(struct libinput_event *event)
+LIBINPUT_EXPORT struct libinput_event_tablet_tool *
+libinput_event_get_tablet_tool_event(struct libinput_event *event)
{
require_event_type(libinput_event_get_context(event),
event->type,
@@ -317,7 +317,7 @@ libinput_event_get_tablet_event(struct libinput_event *event)
LIBINPUT_EVENT_TABLET_TOOL_TIP,
LIBINPUT_EVENT_TABLET_TOOL_BUTTON);
- return (struct libinput_event_tablet *) event;
+ return (struct libinput_event_tablet_tool *) event;
}
LIBINPUT_EXPORT struct libinput_event_device_notify *
@@ -913,7 +913,7 @@ libinput_event_gesture_get_angle_delta(struct libinput_event_gesture *event)
}
LIBINPUT_EXPORT int
-libinput_event_tablet_axis_has_changed(struct libinput_event_tablet *event,
+libinput_event_tablet_tool_axis_has_changed(struct libinput_event_tablet_tool *event,
enum libinput_tablet_tool_axis axis)
{
require_event_type(libinput_event_get_context(&event->base),
@@ -928,7 +928,7 @@ libinput_event_tablet_axis_has_changed(struct libinput_event_tablet *event,
}
LIBINPUT_EXPORT double
-libinput_event_tablet_get_axis_value(struct libinput_event_tablet *event,
+libinput_event_tablet_tool_get_axis_value(struct libinput_event_tablet_tool *event,
enum libinput_tablet_tool_axis axis)
{
struct evdev_device *device =
@@ -962,7 +962,7 @@ libinput_event_tablet_get_axis_value(struct libinput_event_tablet *event,
}
LIBINPUT_EXPORT double
-libinput_event_tablet_get_axis_delta(struct libinput_event_tablet *event,
+libinput_event_tablet_tool_get_axis_delta(struct libinput_event_tablet_tool *event,
enum libinput_tablet_tool_axis axis)
{
struct evdev_device *device =
@@ -996,8 +996,8 @@ libinput_event_tablet_get_axis_delta(struct libinput_event_tablet *event,
}
LIBINPUT_EXPORT double
-libinput_event_tablet_get_axis_delta_discrete(
- struct libinput_event_tablet *event,
+libinput_event_tablet_tool_get_axis_delta_discrete(
+ struct libinput_event_tablet_tool *event,
enum libinput_tablet_tool_axis axis)
{
require_event_type(libinput_event_get_context(&event->base),
@@ -1024,7 +1024,7 @@ libinput_event_tablet_get_axis_delta_discrete(
}
LIBINPUT_EXPORT double
-libinput_event_tablet_get_x_transformed(struct libinput_event_tablet *event,
+libinput_event_tablet_tool_get_x_transformed(struct libinput_event_tablet_tool *event,
uint32_t width)
{
struct evdev_device *device =
@@ -1043,7 +1043,7 @@ libinput_event_tablet_get_x_transformed(struct libinput_event_tablet *event,
}
LIBINPUT_EXPORT double
-libinput_event_tablet_get_y_transformed(struct libinput_event_tablet *event,
+libinput_event_tablet_tool_get_y_transformed(struct libinput_event_tablet_tool *event,
uint32_t height)
{
struct evdev_device *device =
@@ -1062,7 +1062,7 @@ libinput_event_tablet_get_y_transformed(struct libinput_event_tablet *event,
}
LIBINPUT_EXPORT struct libinput_tablet_tool *
-libinput_event_tablet_get_tool(struct libinput_event_tablet *event)
+libinput_event_tablet_tool_get_tool(struct libinput_event_tablet_tool *event)
{
require_event_type(libinput_event_get_context(&event->base),
event->base.type,
@@ -1076,7 +1076,7 @@ libinput_event_tablet_get_tool(struct libinput_event_tablet *event)
}
LIBINPUT_EXPORT enum libinput_tablet_tool_proximity_state
-libinput_event_tablet_get_proximity_state(struct libinput_event_tablet *event)
+libinput_event_tablet_tool_get_proximity_state(struct libinput_event_tablet_tool *event)
{
require_event_type(libinput_event_get_context(&event->base),
event->base.type,
@@ -1090,7 +1090,7 @@ libinput_event_tablet_get_proximity_state(struct libinput_event_tablet *event)
}
LIBINPUT_EXPORT enum libinput_tablet_tool_tip_state
-libinput_event_tablet_get_tip_state(struct libinput_event_tablet *event)
+libinput_event_tablet_tool_get_tip_state(struct libinput_event_tablet_tool *event)
{
require_event_type(libinput_event_get_context(&event->base),
event->base.type,
@@ -1104,7 +1104,7 @@ libinput_event_tablet_get_tip_state(struct libinput_event_tablet *event)
}
LIBINPUT_EXPORT uint32_t
-libinput_event_tablet_get_time(struct libinput_event_tablet *event)
+libinput_event_tablet_tool_get_time(struct libinput_event_tablet_tool *event)
{
require_event_type(libinput_event_get_context(&event->base),
event->base.type,
@@ -1118,7 +1118,7 @@ libinput_event_tablet_get_time(struct libinput_event_tablet *event)
}
LIBINPUT_EXPORT uint64_t
-libinput_event_tablet_get_time_usec(struct libinput_event_tablet *event)
+libinput_event_tablet_tool_get_time_usec(struct libinput_event_tablet_tool *event)
{
require_event_type(libinput_event_get_context(&event->base),
event->base.type,
@@ -1132,7 +1132,7 @@ libinput_event_tablet_get_time_usec(struct libinput_event_tablet *event)
}
LIBINPUT_EXPORT uint32_t
-libinput_event_tablet_get_button(struct libinput_event_tablet *event)
+libinput_event_tablet_tool_get_button(struct libinput_event_tablet_tool *event)
{
require_event_type(libinput_event_get_context(&event->base),
event->base.type,
@@ -1143,7 +1143,7 @@ libinput_event_tablet_get_button(struct libinput_event_tablet *event)
}
LIBINPUT_EXPORT enum libinput_button_state
-libinput_event_tablet_get_button_state(struct libinput_event_tablet *event)
+libinput_event_tablet_tool_get_button_state(struct libinput_event_tablet_tool *event)
{
require_event_type(libinput_event_get_context(&event->base),
event->base.type,
@@ -1154,7 +1154,7 @@ libinput_event_tablet_get_button_state(struct libinput_event_tablet *event)
}
LIBINPUT_EXPORT uint32_t
-libinput_event_tablet_get_seat_button_count(struct libinput_event_tablet *event)
+libinput_event_tablet_tool_get_seat_button_count(struct libinput_event_tablet_tool *event)
{
require_event_type(libinput_event_get_context(&event->base),
event->base.type,
@@ -1979,13 +1979,13 @@ tablet_notify_axis(struct libinput_device *device,
double *deltas,
double *deltas_discrete)
{
- struct libinput_event_tablet *axis_event;
+ struct libinput_event_tablet_tool *axis_event;
axis_event = zalloc(sizeof *axis_event);
if (!axis_event)
return;
- *axis_event = (struct libinput_event_tablet) {
+ *axis_event = (struct libinput_event_tablet_tool) {
.time = time,
.tool = tool,
.proximity_state = LIBINPUT_TABLET_TOOL_PROXIMITY_IN,
@@ -2015,13 +2015,13 @@ tablet_notify_proximity(struct libinput_device *device,
unsigned char *changed_axes,
double *axes)
{
- struct libinput_event_tablet *proximity_event;
+ struct libinput_event_tablet_tool *proximity_event;
proximity_event = zalloc(sizeof *proximity_event);
if (!proximity_event)
return;
- *proximity_event = (struct libinput_event_tablet) {
+ *proximity_event = (struct libinput_event_tablet_tool) {
.time = time,
.tool = tool,
.proximity_state = proximity_state,
@@ -2048,13 +2048,13 @@ tablet_notify_tip(struct libinput_device *device,
enum libinput_tablet_tool_tip_state tip_state,
double *axes)
{
- struct libinput_event_tablet *tip_event;
+ struct libinput_event_tablet_tool *tip_event;
tip_event = zalloc(sizeof *tip_event);
if (!tip_event)
return;
- *tip_event = (struct libinput_event_tablet) {
+ *tip_event = (struct libinput_event_tablet_tool) {
.time = time,
.tool = tool,
.tip_state = tip_state,
@@ -2079,7 +2079,7 @@ tablet_notify_button(struct libinput_device *device,
int32_t button,
enum libinput_button_state state)
{
- struct libinput_event_tablet *button_event;
+ struct libinput_event_tablet_tool *button_event;
int32_t seat_button_count;
button_event = zalloc(sizeof *button_event);
@@ -2090,7 +2090,7 @@ tablet_notify_button(struct libinput_device *device,
button,
state);
- *button_event = (struct libinput_event_tablet) {
+ *button_event = (struct libinput_event_tablet_tool) {
.time = time,
.tool = tool,
.button = button,
@@ -2463,7 +2463,7 @@ libinput_event_gesture_get_base_event(struct libinput_event_gesture *event)
}
LIBINPUT_EXPORT struct libinput_event *
-libinput_event_tablet_get_base_event(struct libinput_event_tablet *event)
+libinput_event_tablet_tool_get_base_event(struct libinput_event_tablet_tool *event)
{
require_event_type(libinput_event_get_context(&event->base),
event->base.type,
diff --git a/src/libinput.h b/src/libinput.h
index 77bf260..9884cdc 100644
--- a/src/libinput.h
+++ b/src/libinput.h
@@ -426,13 +426,13 @@ struct libinput_event_touch;
/**
* @ingroup event_tablet
- * @struct libinput_event_tablet
+ * @struct libinput_event_tablet_tool
*
* Tablet event representing an axis update, button press, or tool update. Valid
* event types for this event are @ref LIBINPUT_EVENT_TABLET_TOOL_AXIS, @ref
* LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY and @ref LIBINPUT_EVENT_TABLET_TOOL_BUTTON.
*/
-struct libinput_event_tablet;
+struct libinput_event_tablet_tool;
/**
* @defgroup event Accessing and destruction of events
@@ -546,12 +546,12 @@ libinput_event_get_gesture_event(struct libinput_event *event);
* Return the tablet event that is this input event. If the event type does not
* match the tablet event types, this function returns NULL.
*
- * The inverse of this function is libinput_event_tablet_get_base_event().
+ * The inverse of this function is libinput_event_tablet_tool_get_base_event().
*
* @return A tablet event, or NULL for other events
*/
-struct libinput_event_tablet *
-libinput_event_get_tablet_event(struct libinput_event *event);
+struct libinput_event_tablet_tool *
+libinput_event_get_tablet_tool_event(struct libinput_event *event);
/**
* @ingroup event
@@ -1353,7 +1353,7 @@ libinput_event_gesture_get_angle_delta(struct libinput_event_gesture *event);
* @return The generic libinput_event of this event
*/
struct libinput_event *
-libinput_event_tablet_get_base_event(struct libinput_event_tablet *event);
+libinput_event_tablet_tool_get_base_event(struct libinput_event_tablet_tool *event);
/**
* @ingroup event_tablet
@@ -1370,8 +1370,8 @@ libinput_event_tablet_get_base_event(struct libinput_event_tablet *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_tool_axis axis);
+libinput_event_tablet_tool_axis_has_changed(struct libinput_event_tablet_tool *event,
+ enum libinput_tablet_tool_axis axis);
/**
* @ingroup event_tablet
@@ -1380,8 +1380,8 @@ libinput_event_tablet_axis_has_changed(struct libinput_event_tablet *event,
* value is dependent on the axis:
* - @ref LIBINPUT_TABLET_TOOL_AXIS_X and @ref LIBINPUT_TABLET_TOOL_AXIS_Y - the X and
* Y coordinates of the tablet tool, in mm from the top left corner of the
- * tablet. Use libinput_event_tablet_get_x_transformed() and
- * libinput_event_tablet_get_y_transformed() for transforming each
+ * tablet. Use libinput_event_tablet_tool_get_x_transformed() and
+ * libinput_event_tablet_tool_get_y_transformed() for transforming each
* respective axis value into a different coordinate space.
* - @ref LIBINPUT_TABLET_TOOL_AXIS_DISTANCE - The distance from the tablet's
* sensor, normalized from 0 to 1
@@ -1400,10 +1400,10 @@ libinput_event_tablet_axis_has_changed(struct libinput_event_tablet *event,
* from 0 to 1. e.g. the wheel-like tool on the Wacom Airbrush.
* - @ref LIBINPUT_TABLET_TOOL_AXIS_REL_WHEEL - A relative wheel on the tool,
* similar or equivalent to a mouse wheel. The value is always 0, use
- * libinput_event_tablet_get_axis_delta() instead.
+ * libinput_event_tablet_tool_get_axis_delta() instead.
*
* @note This function may be called for a specific axis even if
- * libinput_event_tablet_axis_has_changed() returns 0 for that axis.
+ * libinput_event_tablet_tool_axis_has_changed() returns 0 for that axis.
* libinput always includes all device axes in the event.
*
* If the event is of type @ref LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY and the
@@ -1415,8 +1415,8 @@ libinput_event_tablet_axis_has_changed(struct libinput_event_tablet *event,
* @return The current value of the the axis
*/
double
-libinput_event_tablet_get_axis_value(struct libinput_event_tablet *event,
- enum libinput_tablet_tool_axis axis);
+libinput_event_tablet_tool_get_axis_value(struct libinput_event_tablet_tool *event,
+ enum libinput_tablet_tool_axis axis);
/**
* @ingroup event_tablet
@@ -1426,7 +1426,7 @@ libinput_event_tablet_get_axis_value(struct libinput_event_tablet *event,
* - @ref LIBINPUT_TABLET_TOOL_AXIS_REL_WHEEL - A relative wheel on the tool,
* similar or equivalent to a mouse wheel. The value is a delta from the
* device's previous position, in degrees.
- * For all other axes, see libinput_event_tablet_get_axis_value() for
+ * For all other axes, see libinput_event_tablet_tool_get_axis_value() for
* details.
*
* @param event The libinput tablet event
@@ -1434,8 +1434,8 @@ libinput_event_tablet_get_axis_value(struct libinput_event_tablet *event,
* @return The delta to the previous axis value
*/
double
-libinput_event_tablet_get_axis_delta(struct libinput_event_tablet *event,
- enum libinput_tablet_tool_axis axis);
+libinput_event_tablet_tool_get_axis_delta(struct libinput_event_tablet_tool *event,
+ enum libinput_tablet_tool_axis axis);
/**
* @ingroup event_tablet
@@ -1451,8 +1451,8 @@ libinput_event_tablet_get_axis_delta(struct libinput_event_tablet *event,
* @return The delta to the previous axis value in discrete steps
*/
double
-libinput_event_tablet_get_axis_delta_discrete(
- struct libinput_event_tablet *event,
+libinput_event_tablet_tool_get_axis_delta_discrete(
+ struct libinput_event_tablet_tool *event,
enum libinput_tablet_tool_axis axis);
/**
@@ -1462,7 +1462,7 @@ libinput_event_tablet_get_axis_delta_discrete(
* screen coordinates.
*
* @note This function may be called for a specific axis even if
- * libinput_event_tablet_axis_has_changed() returns 0 for that axis.
+ * libinput_event_tablet_tool_axis_has_changed() returns 0 for that axis.
* libinput always includes all device axes in the event.
*
* @param event The libinput tablet event
@@ -1470,8 +1470,8 @@ libinput_event_tablet_get_axis_delta_discrete(
* @return the current absolute x coordinate transformed to a screen coordinate
*/
double
-libinput_event_tablet_get_x_transformed(struct libinput_event_tablet *event,
- uint32_t width);
+libinput_event_tablet_tool_get_x_transformed(struct libinput_event_tablet_tool *event,
+ uint32_t width);
/**
* @ingroup event_tablet
@@ -1480,7 +1480,7 @@ libinput_event_tablet_get_x_transformed(struct libinput_event_tablet *event,
* screen coordinates.
*
* @note This function may be called for a specific axis even if
- * libinput_event_tablet_axis_has_changed() returns 0 for that axis.
+ * libinput_event_tablet_tool_axis_has_changed() returns 0 for that axis.
* libinput always includes all device axes in the event.
*
* @param event The libinput tablet event
@@ -1488,8 +1488,8 @@ libinput_event_tablet_get_x_transformed(struct libinput_event_tablet *event,
* @return the current absolute y coordinate transformed to a screen coordinate
*/
double
-libinput_event_tablet_get_y_transformed(struct libinput_event_tablet *event,
- uint32_t height);
+libinput_event_tablet_tool_get_y_transformed(struct libinput_event_tablet_tool *event,
+ uint32_t height);
/**
* @ingroup event_tablet
@@ -1509,7 +1509,7 @@ libinput_event_tablet_get_y_transformed(struct libinput_event_tablet *event,
* @return The new tool triggering this event
*/
struct libinput_tablet_tool *
-libinput_event_tablet_get_tool(struct libinput_event_tablet *event);
+libinput_event_tablet_tool_get_tool(struct libinput_event_tablet_tool *event);
/**
* @ingroup event_tablet
@@ -1524,7 +1524,7 @@ libinput_event_tablet_get_tool(struct libinput_event_tablet *event);
* @return The new proximity state of the tool from the event.
*/
enum libinput_tablet_tool_proximity_state
-libinput_event_tablet_get_proximity_state(struct libinput_event_tablet *event);
+libinput_event_tablet_tool_get_proximity_state(struct libinput_event_tablet_tool *event);
/**
* @ingroup event_tablet
@@ -1538,7 +1538,7 @@ libinput_event_tablet_get_proximity_state(struct libinput_event_tablet *event);
* @return The new tip state of the tool from the event.
*/
enum libinput_tablet_tool_tip_state
-libinput_event_tablet_get_tip_state(struct libinput_event_tablet *event);
+libinput_event_tablet_tool_get_tip_state(struct libinput_event_tablet_tool *event);
/**
* @ingroup event_tablet
@@ -1554,7 +1554,7 @@ libinput_event_tablet_get_tip_state(struct libinput_event_tablet *event);
* @return the button triggering this event
*/
uint32_t
-libinput_event_tablet_get_button(struct libinput_event_tablet *event);
+libinput_event_tablet_tool_get_button(struct libinput_event_tablet_tool *event);
/**
* @ingroup event_tablet
@@ -1568,7 +1568,7 @@ libinput_event_tablet_get_button(struct libinput_event_tablet *event);
* @return the button state triggering this event
*/
enum libinput_button_state
-libinput_event_tablet_get_button_state(struct libinput_event_tablet *event);
+libinput_event_tablet_tool_get_button_state(struct libinput_event_tablet_tool *event);
/**
* @ingroup event_tablet
@@ -1583,7 +1583,7 @@ libinput_event_tablet_get_button_state(struct libinput_event_tablet *event);
* @return the seat wide pressed button count for the key of this event
*/
uint32_t
-libinput_event_tablet_get_seat_button_count(struct libinput_event_tablet *event);
+libinput_event_tablet_tool_get_seat_button_count(struct libinput_event_tablet_tool *event);
/**
* @ingroup event_tablet
@@ -1592,7 +1592,7 @@ libinput_event_tablet_get_seat_button_count(struct libinput_event_tablet *event)
* @return The event time for this event
*/
uint32_t
-libinput_event_tablet_get_time(struct libinput_event_tablet *event);
+libinput_event_tablet_tool_get_time(struct libinput_event_tablet_tool *event);
/**
* @ingroup event_tablet
@@ -1601,7 +1601,7 @@ libinput_event_tablet_get_time(struct libinput_event_tablet *event);
* @return The event time for this event in microseconds
*/
uint64_t
-libinput_event_tablet_get_time_usec(struct libinput_event_tablet *event);
+libinput_event_tablet_tool_get_time_usec(struct libinput_event_tablet_tool *event);
/**
* @ingroup event_tablet
diff --git a/src/libinput.sym b/src/libinput.sym
index 33d5b33..5f9cbef 100644
--- a/src/libinput.sym
+++ b/src/libinput.sym
@@ -184,22 +184,22 @@ LIBINPUT_1.1 {
/* tablet APIs, they are not part of any stable API promise yet.
* keep them separate */
LIBINPUT_TABLET_SUPPORT {
- libinput_event_get_tablet_event;
- libinput_event_tablet_axis_has_changed;
- libinput_event_tablet_get_axis_delta;
- libinput_event_tablet_get_axis_delta_discrete;
- libinput_event_tablet_get_axis_value;
- libinput_event_tablet_get_base_event;
- libinput_event_tablet_get_button;
- libinput_event_tablet_get_button_state;
- libinput_event_tablet_get_proximity_state;
- libinput_event_tablet_get_seat_button_count;
- libinput_event_tablet_get_time;
- libinput_event_tablet_get_tip_state;
- libinput_event_tablet_get_tool;
- libinput_event_tablet_get_x_transformed;
- libinput_event_tablet_get_y_transformed;
- libinput_event_tablet_get_time_usec;
+ libinput_event_get_tablet_tool_event;
+ libinput_event_tablet_tool_axis_has_changed;
+ libinput_event_tablet_tool_get_axis_delta;
+ libinput_event_tablet_tool_get_axis_delta_discrete;
+ libinput_event_tablet_tool_get_axis_value;
+ libinput_event_tablet_tool_get_base_event;
+ libinput_event_tablet_tool_get_button;
+ libinput_event_tablet_tool_get_button_state;
+ libinput_event_tablet_tool_get_proximity_state;
+ libinput_event_tablet_tool_get_seat_button_count;
+ libinput_event_tablet_tool_get_time;
+ libinput_event_tablet_tool_get_tip_state;
+ libinput_event_tablet_tool_get_tool;
+ libinput_event_tablet_tool_get_x_transformed;
+ libinput_event_tablet_tool_get_y_transformed;
+ libinput_event_tablet_tool_get_time_usec;
libinput_tool_get_serial;
libinput_tool_get_tool_id;
libinput_tool_get_type;
diff --git a/test/litest.c b/test/litest.c
index d9fa32b..2dd4555 100644
--- a/test/litest.c
+++ b/test/litest.c
@@ -1901,7 +1901,7 @@ static void
litest_print_event(struct libinput_event *event)
{
struct libinput_event_pointer *p;
- struct libinput_event_tablet *t;
+ struct libinput_event_tablet_tool *t;
struct libinput_device *dev;
enum libinput_event_type type;
double x, y;
@@ -1948,20 +1948,20 @@ litest_print_event(struct libinput_event *event)
fprintf(stderr, "vert %.f horiz %.2f", y, x);
break;
case LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY:
- t = libinput_event_get_tablet_event(event);
+ t = libinput_event_get_tablet_tool_event(event);
fprintf(stderr, "proximity %d\n",
- libinput_event_tablet_get_proximity_state(t));
+ libinput_event_tablet_tool_get_proximity_state(t));
break;
case LIBINPUT_EVENT_TABLET_TOOL_TIP:
- t = libinput_event_get_tablet_event(event);
+ t = libinput_event_get_tablet_tool_event(event);
fprintf(stderr, "tip %d\n",
- libinput_event_tablet_get_tip_state(t));
+ libinput_event_tablet_tool_get_tip_state(t));
break;
case LIBINPUT_EVENT_TABLET_TOOL_BUTTON:
- t = libinput_event_get_tablet_event(event);
+ t = libinput_event_get_tablet_tool_event(event);
fprintf(stderr, "button %d state %d\n",
- libinput_event_tablet_get_button(t),
- libinput_event_tablet_get_button_state(t));
+ libinput_event_tablet_tool_get_button(t),
+ libinput_event_tablet_tool_get_button_state(t));
break;
default:
break;
@@ -2330,16 +2330,16 @@ litest_is_gesture_event(struct libinput_event *event,
return gevent;
}
-struct libinput_event_tablet * litest_is_tablet_event(
+struct libinput_event_tablet_tool * litest_is_tablet_event(
struct libinput_event *event,
enum libinput_event_type type)
{
- struct libinput_event_tablet *tevent;
+ struct libinput_event_tablet_tool *tevent;
litest_assert(event != NULL);
litest_assert_int_eq(libinput_event_get_type(event), type);
- tevent = libinput_event_get_tablet_event(event);
+ tevent = libinput_event_get_tablet_tool_event(event);
litest_assert(tevent != NULL);
return tevent;
@@ -2350,7 +2350,7 @@ litest_assert_tablet_button_event(struct libinput *li, unsigned int button,
enum libinput_button_state state)
{
struct libinput_event *event;
- struct libinput_event_tablet *tev;
+ struct libinput_event_tablet_tool *tev;
enum libinput_event_type type = LIBINPUT_EVENT_TABLET_TOOL_BUTTON;
litest_wait_for_event(li);
@@ -2358,10 +2358,10 @@ litest_assert_tablet_button_event(struct libinput *li, unsigned int button,
litest_assert_notnull(event);
litest_assert_int_eq(libinput_event_get_type(event), type);
- tev = libinput_event_get_tablet_event(event);
- litest_assert_int_eq(libinput_event_tablet_get_button(tev),
+ tev = libinput_event_get_tablet_tool_event(event);
+ litest_assert_int_eq(libinput_event_tablet_tool_get_button(tev),
button);
- litest_assert_int_eq(libinput_event_tablet_get_button_state(tev),
+ litest_assert_int_eq(libinput_event_tablet_tool_get_button_state(tev),
state);
libinput_event_destroy(event);
}
diff --git a/test/litest.h b/test/litest.h
index a7a447e..6216ac7 100644
--- a/test/litest.h
+++ b/test/litest.h
@@ -402,7 +402,7 @@ struct libinput_event_gesture * litest_is_gesture_event(
struct libinput_event *event,
enum libinput_event_type type,
int nfingers);
-struct libinput_event_tablet * litest_is_tablet_event(
+struct libinput_event_tablet_tool * litest_is_tablet_event(
struct libinput_event *event,
enum libinput_event_type type);
diff --git a/test/misc.c b/test/misc.c
index 7ba6f9c..d880496 100644
--- a/test/misc.c
+++ b/test/misc.c
@@ -133,7 +133,7 @@ START_TEST(event_conversion_device_notify)
ck_assert(libinput_event_get_keyboard_event(event) == NULL);
ck_assert(libinput_event_get_touch_event(event) == NULL);
ck_assert(libinput_event_get_gesture_event(event) == NULL);
- ck_assert(libinput_event_get_tablet_event(event) == NULL);
+ ck_assert(libinput_event_get_tablet_tool_event(event) == NULL);
litest_restore_log_handler(li);
}
@@ -189,7 +189,7 @@ START_TEST(event_conversion_pointer)
ck_assert(libinput_event_get_keyboard_event(event) == NULL);
ck_assert(libinput_event_get_touch_event(event) == NULL);
ck_assert(libinput_event_get_gesture_event(event) == NULL);
- ck_assert(libinput_event_get_tablet_event(event) == NULL);
+ ck_assert(libinput_event_get_tablet_tool_event(event) == NULL);
litest_restore_log_handler(li);
}
libinput_event_destroy(event);
@@ -239,7 +239,7 @@ START_TEST(event_conversion_pointer_abs)
ck_assert(libinput_event_get_keyboard_event(event) == NULL);
ck_assert(libinput_event_get_touch_event(event) == NULL);
ck_assert(libinput_event_get_gesture_event(event) == NULL);
- ck_assert(libinput_event_get_tablet_event(event) == NULL);
+ ck_assert(libinput_event_get_tablet_tool_event(event) == NULL);
litest_restore_log_handler(li);
}
libinput_event_destroy(event);
@@ -282,7 +282,7 @@ START_TEST(event_conversion_key)
ck_assert(libinput_event_get_pointer_event(event) == NULL);
ck_assert(libinput_event_get_touch_event(event) == NULL);
ck_assert(libinput_event_get_gesture_event(event) == NULL);
- ck_assert(libinput_event_get_tablet_event(event) == NULL);
+ ck_assert(libinput_event_get_tablet_tool_event(event) == NULL);
litest_restore_log_handler(li);
}
libinput_event_destroy(event);
@@ -332,7 +332,7 @@ START_TEST(event_conversion_touch)
ck_assert(libinput_event_get_pointer_event(event) == NULL);
ck_assert(libinput_event_get_keyboard_event(event) == NULL);
ck_assert(libinput_event_get_gesture_event(event) == NULL);
- ck_assert(libinput_event_get_tablet_event(event) == NULL);
+ ck_assert(libinput_event_get_tablet_tool_event(event) == NULL);
litest_restore_log_handler(li);
}
libinput_event_destroy(event);
@@ -414,10 +414,10 @@ START_TEST(event_conversion_tablet)
if (type >= LIBINPUT_EVENT_TABLET_TOOL_AXIS &&
type <= LIBINPUT_EVENT_TABLET_TOOL_BUTTON) {
- struct libinput_event_tablet *t;
+ struct libinput_event_tablet_tool *t;
struct libinput_event *base;
- t = libinput_event_get_tablet_event(event);
- base = libinput_event_tablet_get_base_event(t);
+ t = libinput_event_get_tablet_tool_event(event);
+ base = libinput_event_tablet_tool_get_base_event(t);
ck_assert(event == base);
events++;
diff --git a/test/tablet.c b/test/tablet.c
index 383a7b1..8c6a273 100644
--- a/test/tablet.c
+++ b/test/tablet.c
@@ -39,7 +39,7 @@ START_TEST(tip_down_up)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct axis_replacement axes[] = {
{ ABS_DISTANCE, 10 },
{ -1, -1 }
@@ -55,7 +55,7 @@ START_TEST(tip_down_up)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_TIP);
- ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event),
LIBINPUT_TABLET_TOOL_TIP_DOWN);
libinput_event_destroy(event);
litest_assert_empty_queue(li);
@@ -67,7 +67,7 @@ START_TEST(tip_down_up)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_TIP);
- ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event),
LIBINPUT_TABLET_TOOL_TIP_UP);
libinput_event_destroy(event);
litest_assert_empty_queue(li);
@@ -82,7 +82,7 @@ START_TEST(tip_down_prox_in)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct axis_replacement axes[] = {
{ ABS_DISTANCE, 10 },
{ -1, -1 }
@@ -99,7 +99,7 @@ START_TEST(tip_down_prox_in)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
- ck_assert_int_eq(libinput_event_tablet_get_proximity_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_proximity_state(tablet_event),
LIBINPUT_TABLET_TOOL_PROXIMITY_IN);
libinput_event_destroy(event);
@@ -107,7 +107,7 @@ START_TEST(tip_down_prox_in)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_TIP);
- ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event),
LIBINPUT_TABLET_TOOL_TIP_DOWN);
libinput_event_destroy(event);
@@ -121,7 +121,7 @@ START_TEST(tip_up_prox_out)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct axis_replacement axes[] = {
{ ABS_DISTANCE, 10 },
{ -1, -1 }
@@ -141,7 +141,7 @@ START_TEST(tip_up_prox_out)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_TIP);
- ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event),
LIBINPUT_TABLET_TOOL_TIP_UP);
libinput_event_destroy(event);
@@ -149,7 +149,7 @@ START_TEST(tip_up_prox_out)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
- ck_assert_int_eq(libinput_event_tablet_get_proximity_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_proximity_state(tablet_event),
LIBINPUT_TABLET_TOOL_PROXIMITY_OUT);
libinput_event_destroy(event);
@@ -163,7 +163,7 @@ START_TEST(tip_up_btn_change)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct axis_replacement axes[] = {
{ ABS_DISTANCE, 10 },
{ -1, -1 }
@@ -182,9 +182,9 @@ START_TEST(tip_up_btn_change)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_BUTTON);
- ck_assert_int_eq(libinput_event_tablet_get_button(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_button(tablet_event),
BTN_STYLUS);
- ck_assert_int_eq(libinput_event_tablet_get_button_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_button_state(tablet_event),
LIBINPUT_BUTTON_STATE_PRESSED);
libinput_event_destroy(event);
@@ -192,7 +192,7 @@ START_TEST(tip_up_btn_change)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_TIP);
- ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event),
LIBINPUT_TABLET_TOOL_TIP_UP);
libinput_event_destroy(event);
@@ -211,9 +211,9 @@ START_TEST(tip_up_btn_change)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_BUTTON);
- ck_assert_int_eq(libinput_event_tablet_get_button(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_button(tablet_event),
BTN_STYLUS);
- ck_assert_int_eq(libinput_event_tablet_get_button_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_button_state(tablet_event),
LIBINPUT_BUTTON_STATE_RELEASED);
libinput_event_destroy(event);
@@ -221,7 +221,7 @@ START_TEST(tip_up_btn_change)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_TIP);
- ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event),
LIBINPUT_TABLET_TOOL_TIP_UP);
libinput_event_destroy(event);
@@ -234,7 +234,7 @@ START_TEST(tip_down_btn_change)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct axis_replacement axes[] = {
{ ABS_DISTANCE, 10 },
{ -1, -1 }
@@ -251,7 +251,7 @@ START_TEST(tip_down_btn_change)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_TIP);
- ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event),
LIBINPUT_TABLET_TOOL_TIP_DOWN);
libinput_event_destroy(event);
@@ -259,9 +259,9 @@ START_TEST(tip_down_btn_change)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_BUTTON);
- ck_assert_int_eq(libinput_event_tablet_get_button(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_button(tablet_event),
BTN_STYLUS);
- ck_assert_int_eq(libinput_event_tablet_get_button_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_button_state(tablet_event),
LIBINPUT_BUTTON_STATE_PRESSED);
libinput_event_destroy(event);
@@ -280,7 +280,7 @@ START_TEST(tip_down_btn_change)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_TIP);
- ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event),
LIBINPUT_TABLET_TOOL_TIP_DOWN);
libinput_event_destroy(event);
@@ -288,9 +288,9 @@ START_TEST(tip_down_btn_change)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_BUTTON);
- ck_assert_int_eq(libinput_event_tablet_get_button(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_button(tablet_event),
BTN_STYLUS);
- ck_assert_int_eq(libinput_event_tablet_get_button_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_button_state(tablet_event),
LIBINPUT_BUTTON_STATE_RELEASED);
libinput_event_destroy(event);
@@ -303,7 +303,7 @@ START_TEST(tip_down_motion)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct axis_replacement axes[] = {
{ ABS_DISTANCE, 10 },
{ -1, -1 }
@@ -323,9 +323,9 @@ START_TEST(tip_down_motion)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_AXIS);
- last_x = libinput_event_tablet_get_axis_value(tablet_event,
+ last_x = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_X);
- last_y = libinput_event_tablet_get_axis_value(tablet_event,
+ last_y = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_Y);
libinput_event_destroy(event);
@@ -333,11 +333,11 @@ START_TEST(tip_down_motion)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_TIP);
- ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event),
LIBINPUT_TABLET_TOOL_TIP_DOWN);
- x = libinput_event_tablet_get_axis_value(tablet_event,
+ x = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_X);
- y = libinput_event_tablet_get_axis_value(tablet_event,
+ y = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_Y);
ck_assert_double_eq(last_x, x);
ck_assert_double_eq(last_y, y);
@@ -352,7 +352,7 @@ START_TEST(tip_up_motion)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct axis_replacement axes[] = {
{ ABS_DISTANCE, 10 },
{ -1, -1 }
@@ -374,9 +374,9 @@ START_TEST(tip_up_motion)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_AXIS);
- last_x = libinput_event_tablet_get_axis_value(tablet_event,
+ last_x = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_X);
- last_y = libinput_event_tablet_get_axis_value(tablet_event,
+ last_y = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_Y);
libinput_event_destroy(event);
@@ -384,11 +384,11 @@ START_TEST(tip_up_motion)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_TIP);
- ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event),
LIBINPUT_TABLET_TOOL_TIP_UP);
- x = libinput_event_tablet_get_axis_value(tablet_event,
+ x = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_X);
- y = libinput_event_tablet_get_axis_value(tablet_event,
+ y = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_Y);
ck_assert_double_eq(last_x, x);
ck_assert_double_eq(last_y, y);
@@ -403,7 +403,7 @@ START_TEST(tip_state_proximity)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct axis_replacement axes[] = {
{ ABS_DISTANCE, 10 },
{ -1, -1 }
@@ -417,7 +417,7 @@ START_TEST(tip_state_proximity)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
- ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event),
LIBINPUT_TABLET_TOOL_TIP_UP);
libinput_event_destroy(event);
@@ -433,7 +433,7 @@ START_TEST(tip_state_proximity)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
- ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event),
LIBINPUT_TABLET_TOOL_TIP_UP);
libinput_event_destroy(event);
}
@@ -444,7 +444,7 @@ START_TEST(tip_state_axis)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct axis_replacement axes[] = {
{ ABS_DISTANCE, 10 },
{ -1, -1 }
@@ -459,7 +459,7 @@ START_TEST(tip_state_axis)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_AXIS);
- ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event),
LIBINPUT_TABLET_TOOL_TIP_UP);
libinput_event_destroy(event);
@@ -473,7 +473,7 @@ START_TEST(tip_state_axis)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_AXIS);
- ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event),
LIBINPUT_TABLET_TOOL_TIP_DOWN);
libinput_event_destroy(event);
@@ -487,7 +487,7 @@ START_TEST(tip_state_axis)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_AXIS);
- ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event),
LIBINPUT_TABLET_TOOL_TIP_UP);
libinput_event_destroy(event);
@@ -500,7 +500,7 @@ START_TEST(tip_state_button)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct axis_replacement axes[] = {
{ ABS_DISTANCE, 10 },
{ -1, -1 }
@@ -516,7 +516,7 @@ START_TEST(tip_state_button)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_BUTTON);
- ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event),
LIBINPUT_TABLET_TOOL_TIP_UP);
libinput_event_destroy(event);
@@ -531,7 +531,7 @@ START_TEST(tip_state_button)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_BUTTON);
- ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event),
LIBINPUT_TABLET_TOOL_TIP_DOWN);
libinput_event_destroy(event);
@@ -546,7 +546,7 @@ START_TEST(tip_state_button)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_BUTTON);
- ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event),
LIBINPUT_TABLET_TOOL_TIP_UP);
libinput_event_destroy(event);
@@ -557,7 +557,7 @@ START_TEST(tip_state_button)
event = libinput_get_event(li);
tablet_event = litest_is_tablet_event(event,
LIBINPUT_EVENT_TABLET_TOOL_BUTTON);
- ck_assert_int_eq(libinput_event_tablet_get_tip_state(tablet_event),
+ ck_assert_int_eq(libinput_event_tablet_tool_get_tip_state(tablet_event),
LIBINPUT_TABLET_TOOL_TIP_UP);
libinput_event_destroy(event);
@@ -569,7 +569,7 @@ START_TEST(proximity_in_out)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct libinput_event *event;
bool have_tool_update = false,
have_proximity_out = false;
@@ -590,8 +590,8 @@ START_TEST(proximity_in_out)
struct libinput_tablet_tool * tool;
have_tool_update++;
- tablet_event = libinput_event_get_tablet_event(event);
- tool = libinput_event_tablet_get_tool(tablet_event);
+ tablet_event = libinput_event_get_tablet_tool_event(event);
+ tool = libinput_event_tablet_tool_get_tool(tablet_event);
ck_assert_int_eq(libinput_tool_get_type(tool),
LIBINPUT_TABLET_TOOL_TYPE_PEN);
}
@@ -605,10 +605,10 @@ START_TEST(proximity_in_out)
while ((event = libinput_get_event(li))) {
if (libinput_event_get_type(event) ==
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY) {
- struct libinput_event_tablet *t =
- libinput_event_get_tablet_event(event);
+ struct libinput_event_tablet_tool *t =
+ libinput_event_get_tablet_tool_event(event);
- if (libinput_event_tablet_get_proximity_state(t) ==
+ if (libinput_event_tablet_tool_get_proximity_state(t) ==
LIBINPUT_TABLET_TOOL_PROXIMITY_OUT)
have_proximity_out = true;
}
@@ -635,7 +635,7 @@ START_TEST(proximity_out_clear_buttons)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct libinput_event *event;
uint32_t button;
@@ -665,13 +665,13 @@ START_TEST(proximity_out_clear_buttons)
libinput_dispatch(li);
while ((event = libinput_get_event(li))) {
- tablet_event = libinput_event_get_tablet_event(event);
+ tablet_event = libinput_event_get_tablet_tool_event(event);
if (libinput_event_get_type(event) ==
LIBINPUT_EVENT_TABLET_TOOL_BUTTON) {
- event_button = libinput_event_tablet_get_button(tablet_event);
- state = libinput_event_tablet_get_button_state(tablet_event);
+ event_button = libinput_event_tablet_tool_get_button(tablet_event);
+ state = libinput_event_tablet_tool_get_button_state(tablet_event);
if (event_button == button &&
state == LIBINPUT_BUTTON_STATE_RELEASED)
@@ -695,7 +695,7 @@ START_TEST(proximity_has_axes)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct libinput_event *event;
struct libinput_tablet_tool *tool;
double x, y,
@@ -718,28 +718,28 @@ START_TEST(proximity_has_axes)
event = libinput_get_event(li);
- tablet_event = libinput_event_get_tablet_event(event);
- tool = libinput_event_tablet_get_tool(tablet_event);
+ tablet_event = libinput_event_get_tablet_tool_event(event);
+ tool = libinput_event_tablet_tool_get_tool(tablet_event);
- ck_assert(libinput_event_tablet_axis_has_changed(
+ ck_assert(libinput_event_tablet_tool_axis_has_changed(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_X));
- ck_assert(libinput_event_tablet_axis_has_changed(
+ ck_assert(libinput_event_tablet_tool_axis_has_changed(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_Y));
- x = libinput_event_tablet_get_axis_value(tablet_event,
+ x = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_X);
- y = libinput_event_tablet_get_axis_value(tablet_event,
+ y = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_Y);
litest_assert_double_ne(x, 0);
litest_assert_double_ne(y, 0);
if (libinput_tool_has_axis(tool, LIBINPUT_TABLET_TOOL_AXIS_DISTANCE)) {
- ck_assert(libinput_event_tablet_axis_has_changed(
+ ck_assert(libinput_event_tablet_tool_axis_has_changed(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_DISTANCE));
- distance = libinput_event_tablet_get_axis_value(
+ distance = libinput_event_tablet_tool_get_axis_value(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_DISTANCE);
litest_assert_double_ne(distance, 0);
@@ -747,17 +747,17 @@ START_TEST(proximity_has_axes)
if (libinput_tool_has_axis(tool, LIBINPUT_TABLET_TOOL_AXIS_TILT_X) &&
libinput_tool_has_axis(tool, LIBINPUT_TABLET_TOOL_AXIS_TILT_Y)) {
- ck_assert(libinput_event_tablet_axis_has_changed(
+ ck_assert(libinput_event_tablet_tool_axis_has_changed(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_TILT_X));
- ck_assert(libinput_event_tablet_axis_has_changed(
+ ck_assert(libinput_event_tablet_tool_axis_has_changed(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_TILT_Y));
- x = libinput_event_tablet_get_axis_value(
+ x = libinput_event_tablet_tool_get_axis_value(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_TILT_X);
- y = libinput_event_tablet_get_axis_value(
+ y = libinput_event_tablet_tool_get_axis_value(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_TILT_Y);
@@ -775,22 +775,22 @@ START_TEST(proximity_has_axes)
libinput_dispatch(li);
litest_wait_for_event_of_type(li, LIBINPUT_EVENT_TABLET_TOOL_AXIS, -1);
event = libinput_get_event(li);
- tablet_event = libinput_event_get_tablet_event(event);
+ tablet_event = libinput_event_get_tablet_tool_event(event);
- last_x = libinput_event_tablet_get_axis_value(tablet_event,
+ last_x = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_X);
- last_y = libinput_event_tablet_get_axis_value(tablet_event,
+ last_y = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_Y);
if (libinput_tool_has_axis(tool, LIBINPUT_TABLET_TOOL_AXIS_DISTANCE))
- last_distance = libinput_event_tablet_get_axis_value(
+ last_distance = libinput_event_tablet_tool_get_axis_value(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_DISTANCE);
if (libinput_tool_has_axis(tool, LIBINPUT_TABLET_TOOL_AXIS_TILT_X) &&
libinput_tool_has_axis(tool, LIBINPUT_TABLET_TOOL_AXIS_TILT_Y)) {
- last_tx = libinput_event_tablet_get_axis_value(
+ last_tx = libinput_event_tablet_tool_get_axis_value(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_TILT_X);
- last_ty = libinput_event_tablet_get_axis_value(
+ last_ty = libinput_event_tablet_tool_get_axis_value(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_TILT_Y);
}
@@ -803,27 +803,27 @@ START_TEST(proximity_has_axes)
litest_wait_for_event_of_type(li, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, -1);
event = libinput_get_event(li);
- tablet_event = libinput_event_get_tablet_event(event);
- tool = libinput_event_tablet_get_tool(tablet_event);
+ tablet_event = libinput_event_get_tablet_tool_event(event);
+ tool = libinput_event_tablet_tool_get_tool(tablet_event);
- ck_assert(!libinput_event_tablet_axis_has_changed(
+ ck_assert(!libinput_event_tablet_tool_axis_has_changed(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_X));
- ck_assert(!libinput_event_tablet_axis_has_changed(
+ ck_assert(!libinput_event_tablet_tool_axis_has_changed(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_Y));
- x = libinput_event_tablet_get_axis_value(tablet_event,
+ x = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_X);
- y = libinput_event_tablet_get_axis_value(tablet_event,
+ y = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_Y);
litest_assert_double_eq(x, last_x);
litest_assert_double_eq(y, last_y);
if (libinput_tool_has_axis(tool, LIBINPUT_TABLET_TOOL_AXIS_DISTANCE)) {
- ck_assert(!libinput_event_tablet_axis_has_changed(
+ ck_assert(!libinput_event_tablet_tool_axis_has_changed(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_DISTANCE));
- distance = libinput_event_tablet_get_axis_value(
+ distance = libinput_event_tablet_tool_get_axis_value(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_DISTANCE);
litest_assert_double_eq(distance, last_distance);
@@ -831,17 +831,17 @@ START_TEST(proximity_has_axes)
if (libinput_tool_has_axis(tool, LIBINPUT_TABLET_TOOL_AXIS_TILT_X) &&
libinput_tool_has_axis(tool, LIBINPUT_TABLET_TOOL_AXIS_TILT_Y)) {
- ck_assert(!libinput_event_tablet_axis_has_changed(
+ ck_assert(!libinput_event_tablet_tool_axis_has_changed(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_TILT_X));
- ck_assert(!libinput_event_tablet_axis_has_changed(
+ ck_assert(!libinput_event_tablet_tool_axis_has_changed(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_TILT_Y));
- x = libinput_event_tablet_get_axis_value(
+ x = libinput_event_tablet_tool_get_axis_value(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_TILT_X);
- y = libinput_event_tablet_get_axis_value(
+ y = libinput_event_tablet_tool_get_axis_value(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_TILT_Y);
@@ -858,7 +858,7 @@ START_TEST(motion)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct libinput_event *event;
int test_x, test_y;
double last_reported_x = 0, last_reported_y = 0;
@@ -881,21 +881,21 @@ START_TEST(motion)
bool x_changed, y_changed;
double reported_x, reported_y;
- tablet_event = libinput_event_get_tablet_event(event);
+ tablet_event = libinput_event_get_tablet_tool_event(event);
ck_assert_int_eq(libinput_event_get_type(event),
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY);
- x_changed = libinput_event_tablet_axis_has_changed(
+ x_changed = libinput_event_tablet_tool_axis_has_changed(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_X);
- y_changed = libinput_event_tablet_axis_has_changed(
+ y_changed = libinput_event_tablet_tool_axis_has_changed(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_Y);
ck_assert(x_changed);
ck_assert(y_changed);
- reported_x = libinput_event_tablet_get_axis_value(
+ reported_x = libinput_event_tablet_tool_get_axis_value(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_X);
- reported_y = libinput_event_tablet_get_axis_value(
+ reported_y = libinput_event_tablet_tool_get_axis_value(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_Y);
litest_assert_double_lt(reported_x, reported_y);
@@ -916,21 +916,21 @@ START_TEST(motion)
libinput_dispatch(li);
while ((event = libinput_get_event(li))) {
- tablet_event = libinput_event_get_tablet_event(event);
+ tablet_event = libinput_event_get_tablet_tool_event(event);
type = libinput_event_get_type(event);
if (type == LIBINPUT_EVENT_TABLET_TOOL_AXIS) {
- x_changed = libinput_event_tablet_axis_has_changed(
+ x_changed = libinput_event_tablet_tool_axis_has_changed(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_X);
- y_changed = libinput_event_tablet_axis_has_changed(
+ y_changed = libinput_event_tablet_tool_axis_has_changed(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_Y);
ck_assert(x_changed);
ck_assert(y_changed);
- reported_x = libinput_event_tablet_get_axis_value(
+ reported_x = libinput_event_tablet_tool_get_axis_value(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_X);
- reported_y = libinput_event_tablet_get_axis_value(
+ reported_y = libinput_event_tablet_tool_get_axis_value(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_Y);
litest_assert_double_gt(reported_x,
@@ -952,7 +952,7 @@ START_TEST(motion_delta)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct libinput_event *event;
double x1, y1, x2, y2, dist1, dist2;
double delta;
@@ -971,12 +971,12 @@ START_TEST(motion_delta)
-1);
event = libinput_get_event(li);
- tablet_event = libinput_event_get_tablet_event(event);
- x1 = libinput_event_tablet_get_axis_value(tablet_event,
+ tablet_event = libinput_event_get_tablet_tool_event(event);
+ x1 = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_X);
- y1 = libinput_event_tablet_get_axis_value(tablet_event,
+ y1 = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_Y);
- dist1 = libinput_event_tablet_get_axis_value(tablet_event,
+ dist1 = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_DISTANCE);
libinput_event_destroy(event);
@@ -987,21 +987,21 @@ START_TEST(motion_delta)
LIBINPUT_EVENT_TABLET_TOOL_AXIS,
-1);
event = libinput_get_event(li);
- tablet_event = libinput_event_get_tablet_event(event);
- x2 = libinput_event_tablet_get_axis_value(tablet_event,
+ tablet_event = libinput_event_get_tablet_tool_event(event);
+ x2 = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_X);
- y2 = libinput_event_tablet_get_axis_value(tablet_event,
+ y2 = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_Y);
- dist2 = libinput_event_tablet_get_axis_value(tablet_event,
+ dist2 = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_DISTANCE);
- delta = libinput_event_tablet_get_axis_delta(tablet_event,
+ delta = libinput_event_tablet_tool_get_axis_delta(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_X);
litest_assert_double_eq(delta, x2 - x1);
- delta = libinput_event_tablet_get_axis_delta(tablet_event,
+ delta = libinput_event_tablet_tool_get_axis_delta(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_Y);
litest_assert_double_eq(delta, y2 - y1);
- delta = libinput_event_tablet_get_axis_delta(tablet_event,
+ delta = libinput_event_tablet_tool_get_axis_delta(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_DISTANCE);
litest_assert_double_eq(delta, dist2 - dist1);
@@ -1013,7 +1013,7 @@ START_TEST(motion_delta_partial)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct libinput_event *event;
double dx, dy, ddist;
struct axis_replacement axes[] = {
@@ -1034,23 +1034,23 @@ START_TEST(motion_delta_partial)
LIBINPUT_EVENT_TABLET_TOOL_AXIS,
-1);
event = libinput_get_event(li);
- tablet_event = libinput_event_get_tablet_event(event);
+ tablet_event = libinput_event_get_tablet_tool_event(event);
- ck_assert(!libinput_event_tablet_axis_has_changed(tablet_event,
+ ck_assert(!libinput_event_tablet_tool_axis_has_changed(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_X));
- dx = libinput_event_tablet_get_axis_delta(tablet_event,
+ dx = libinput_event_tablet_tool_get_axis_delta(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_X);
litest_assert_double_eq(dx, 0.0);
- ck_assert(!libinput_event_tablet_axis_has_changed(tablet_event,
+ ck_assert(!libinput_event_tablet_tool_axis_has_changed(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_X));
- dy = libinput_event_tablet_get_axis_delta(tablet_event,
+ dy = libinput_event_tablet_tool_get_axis_delta(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_Y);
litest_assert_double_eq(dy, 0.0);
- ck_assert(libinput_event_tablet_axis_has_changed(tablet_event,
+ ck_assert(libinput_event_tablet_tool_axis_has_changed(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_DISTANCE));
- ddist = libinput_event_tablet_get_axis_delta(tablet_event,
+ ddist = libinput_event_tablet_tool_get_axis_delta(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_DISTANCE);
ck_assert_double_gt(ddist, 0);
@@ -1064,7 +1064,7 @@ START_TEST(left_handed)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
double libinput_max_x, libinput_max_y;
double last_x = -1.0, last_y = -1.0;
struct axis_replacement axes[] = {
@@ -1090,11 +1090,11 @@ START_TEST(left_handed)
litest_wait_for_event_of_type(li, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, -1);
while ((event = libinput_get_event(li))) {
- tablet_event = libinput_event_get_tablet_event(event);
+ tablet_event = libinput_event_get_tablet_tool_event(event);
- last_x = libinput_event_tablet_get_axis_value(
+ last_x = libinput_event_tablet_tool_get_axis_value(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_X);
- last_y = libinput_event_tablet_get_axis_value(
+ last_y = libinput_event_tablet_tool_get_axis_value(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_Y);
litest_assert_double_eq(last_x, 0);
@@ -1108,11 +1108,11 @@ START_TEST(left_handed)
while ((event = libinput_get_event(li))) {
double x, y;
- tablet_event = libinput_event_get_tablet_event(event);
+ tablet_event = libinput_event_get_tablet_tool_event(event);
- x = libinput_event_tablet_get_axis_value(
+ x = libinput_event_tablet_tool_get_axis_value(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_X);
- y = libinput_event_tablet_get_axis_value(
+ y = libinput_event_tablet_tool_get_axis_value(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_Y);
litest_assert_double_eq(x, libinput_max_x);
@@ -1136,11 +1136,11 @@ START_TEST(left_handed)
litest_wait_for_event_of_type(li, LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY, -1);
while ((event = libinput_get_event(li))) {
- tablet_event = libinput_event_get_tablet_event(event);
+ tablet_event = libinput_event_get_tablet_tool_event(event);
- last_x = libinput_event_tablet_get_axis_value(
+ last_x = libinput_event_tablet_tool_get_axis_value(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_X);
- last_y = libinput_event_tablet_get_axis_value(
+ last_y = libinput_event_tablet_tool_get_axis_value(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_Y);
litest_assert_double_eq(last_x, libinput_max_x);
@@ -1154,11 +1154,11 @@ START_TEST(left_handed)
while ((event = libinput_get_event(li))) {
double x, y;
- tablet_event = libinput_event_get_tablet_event(event);
+ tablet_event = libinput_event_get_tablet_tool_event(event);
- x = libinput_event_tablet_get_axis_value(
+ x = libinput_event_tablet_tool_get_axis_value(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_X);
- y = libinput_event_tablet_get_axis_value(
+ y = libinput_event_tablet_tool_get_axis_value(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_Y);
litest_assert_double_eq(x, 0);
@@ -1186,7 +1186,7 @@ START_TEST(motion_event_state)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
int test_x, test_y;
double last_x, last_y;
@@ -1213,12 +1213,12 @@ START_TEST(motion_event_state)
/* pop the first event off */
ck_assert_notnull(event);
- tablet_event = libinput_event_get_tablet_event(event);
+ tablet_event = libinput_event_get_tablet_tool_event(event);
ck_assert_notnull(tablet_event);
- last_x = libinput_event_tablet_get_axis_value(tablet_event,
+ last_x = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_X);
- last_y = libinput_event_tablet_get_axis_value(tablet_event,
+ last_y = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_Y);
/* mark with a button event, then go back to bottom/left */
@@ -1241,12 +1241,12 @@ START_TEST(motion_event_state)
if (libinput_event_get_type(event) != LIBINPUT_EVENT_TABLET_TOOL_AXIS)
break;
- tablet_event = libinput_event_get_tablet_event(event);
+ tablet_event = libinput_event_get_tablet_tool_event(event);
ck_assert_notnull(tablet_event);
- x = libinput_event_tablet_get_axis_value(tablet_event,
+ x = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_X);
- y = libinput_event_tablet_get_axis_value(tablet_event,
+ y = libinput_event_tablet_tool_get_axis_value(tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_Y);
ck_assert(x > last_x);
@@ -1292,7 +1292,7 @@ START_TEST(normalization)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct libinput_event *event;
double pressure,
tilt_vertical,
@@ -1332,33 +1332,33 @@ START_TEST(normalization)
while ((event = libinput_get_event(li))) {
if (libinput_event_get_type(event) == LIBINPUT_EVENT_TABLET_TOOL_AXIS) {
- tablet_event = libinput_event_get_tablet_event(event);
+ tablet_event = libinput_event_get_tablet_tool_event(event);
- if (libinput_event_tablet_axis_has_changed(
+ if (libinput_event_tablet_tool_axis_has_changed(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_PRESSURE)) {
- pressure = libinput_event_tablet_get_axis_value(
+ pressure = libinput_event_tablet_tool_get_axis_value(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_PRESSURE);
litest_assert_double_eq(pressure, 0);
}
- if (libinput_event_tablet_axis_has_changed(
+ if (libinput_event_tablet_tool_axis_has_changed(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_TILT_X)) {
tilt_vertical =
- libinput_event_tablet_get_axis_value(
+ libinput_event_tablet_tool_get_axis_value(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_TILT_X);
litest_assert_double_eq(tilt_vertical, -1);
}
- if (libinput_event_tablet_axis_has_changed(
+ if (libinput_event_tablet_tool_axis_has_changed(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_TILT_Y)) {
tilt_horizontal =
- libinput_event_tablet_get_axis_value(
+ libinput_event_tablet_tool_get_axis_value(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_TILT_Y);
@@ -1394,33 +1394,33 @@ START_TEST(normalization)
while ((event = libinput_get_event(li))) {
if (libinput_event_get_type(event) == LIBINPUT_EVENT_TABLET_TOOL_AXIS) {
- tablet_event = libinput_event_get_tablet_event(event);
+ tablet_event = libinput_event_get_tablet_tool_event(event);
- if (libinput_event_tablet_axis_has_changed(
+ if (libinput_event_tablet_tool_axis_has_changed(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_PRESSURE)) {
- pressure = libinput_event_tablet_get_axis_value(
+ pressure = libinput_event_tablet_tool_get_axis_value(
tablet_event, LIBINPUT_TABLET_TOOL_AXIS_PRESSURE);
litest_assert_double_eq(pressure, 1);
}
- if (libinput_event_tablet_axis_has_changed(
+ if (libinput_event_tablet_tool_axis_has_changed(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_TILT_X)) {
tilt_vertical =
- libinput_event_tablet_get_axis_value(
+ libinput_event_tablet_tool_get_axis_value(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_TILT_X);
litest_assert_double_eq(tilt_vertical, 1);
}
- if (libinput_event_tablet_axis_has_changed(
+ if (libinput_event_tablet_tool_axis_has_changed(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_TILT_Y)) {
tilt_horizontal =
- libinput_event_tablet_get_axis_value(
+ libinput_event_tablet_tool_get_axis_value(
tablet_event,
LIBINPUT_TABLET_TOOL_AXIS_TILT_Y);
@@ -1438,7 +1438,7 @@ START_TEST(tool_serial)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct libinput_event *event;
struct libinput_tablet_tool *tool;
@@ -1452,8 +1452,8 @@ START_TEST(tool_serial)
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY,
-1);
event = libinput_get_event(li);
- tablet_event = libinput_event_get_tablet_event(event);
- tool = libinput_event_tablet_get_tool(tablet_event);
+ tablet_event = libinput_event_get_tablet_tool_event(event);
+ tool = libinput_event_tablet_tool_get_tool(tablet_event);
ck_assert_uint_eq(libinput_tool_get_serial(tool), 1000);
libinput_event_destroy(event);
}
@@ -1463,7 +1463,7 @@ START_TEST(serial_changes_tool)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct libinput_event *event;
struct libinput_tablet_tool *tool;
@@ -1484,8 +1484,8 @@ START_TEST(serial_changes_tool)
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY,
-1);
event = libinput_get_event(li);
- tablet_event = libinput_event_get_tablet_event(event);
- tool = libinput_event_tablet_get_tool(tablet_event);
+ tablet_event = libinput_event_get_tablet_tool_event(event);
+ tool = libinput_event_tablet_tool_get_tool(tablet_event);
ck_assert_uint_eq(libinput_tool_get_serial(tool), 2000);
libinput_event_destroy(event);
@@ -1497,7 +1497,7 @@ START_TEST(invalid_serials)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct libinput_tablet_tool *tool;
litest_drain_events(li);
@@ -1517,8 +1517,8 @@ START_TEST(invalid_serials)
while ((event = libinput_get_event(li))) {
if (libinput_event_get_type(event) ==
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY) {
- tablet_event = libinput_event_get_tablet_event(event);
- tool = libinput_event_tablet_get_tool(tablet_event);
+ tablet_event = libinput_event_get_tablet_tool_event(event);
+ tool = libinput_event_tablet_tool_get_tool(tablet_event);
ck_assert_uint_eq(libinput_tool_get_serial(tool), 1000);
}
@@ -1532,7 +1532,7 @@ START_TEST(tool_ref)
{
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
- struct libinput_event_tablet *tablet_event;
+ struct libinput_event_tablet_tool *tablet_event;
struct libinput_event *event;
struct libinput_tablet_tool *tool;
@@ -1546,8 +1546,8 @@ START_TEST(tool_ref)
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY,
-1);
event = libinput_get_event(li);
- tablet_event = libinput_event_get_tablet_event(event);
- tool = libinput_event_tablet_get_tool(tablet_event);
+ tablet_event = libinput_event_get_tablet_tool_event(event);
+ tool = libinput_event_tablet_tool_get_tool(tablet_event);
ck_assert_notnull(tool);
ck_assert(tool == libinput_tool_ref(tool));
@@ -1635,10 +1635,10 @@ START_TEST(tools_with_serials)
while ((event = libinput_get_event(li))) {
if (libinput_event_get_type(event) ==
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY) {
- struct libinput_event_tablet *t =
- libinput_event_get_tablet_event(event);
+ struct libinput_event_tablet_tool *t =
+ libinput_event_get_tablet_tool_event(event);
- tool[i] = libinput_event_tablet_get_tool(t);
+ tool[i] = libinput_event_tablet_tool_get_tool(t);
}
libinput_event_destroy(event);
@@ -1684,10 +1684,10 @@ START_TEST(tools_without_serials)
while ((event = libinput_get_event(li))) {
if (libinput_event_get_type(event) ==
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY) {
- struct libinput_event_tablet *t =
- libinput_event_get_tablet_event(event);
+ struct libinput_event_tablet_tool *t =
+ libinput_event_get_tablet_tool_event(event);
- tool[i] = libinput_event_tablet_get_tool(t);
+ tool[i] = libinput_event_tablet_tool_get_tool(t);
}
libinput_event_destroy(event);
@@ -1711,7 +1711,7 @@ START_TEST(tool_capabilities)
struct litest_device *intuos;
struct litest_device *bamboo;
struct libinput_event *event;
- struct libinput_event_tablet *t;
+ struct libinput_event_tablet_tool *t;
struct libinput_tablet_tool *tool;
/* The axis capabilities of a tool can differ depending on the type of
@@ -1729,8 +1729,8 @@ START_TEST(tool_capabilities)
-1);
event = libinput_get_event(li);
- t = libinput_event_get_tablet_event(event);
- tool = libinput_event_tablet_get_tool(t);
+ t = libinput_event_get_tablet_tool_event(event);
+ tool = libinput_event_tablet_tool_get_tool(t);
ck_assert(libinput_tool_has_axis(tool,
LIBINPUT_TABLET_TOOL_AXIS_PRESSURE));
@@ -1752,8 +1752,8 @@ START_TEST(tool_capabilities)
-1);
event = libinput_get_event(li);
- t = libinput_event_get_tablet_event(event);
- tool = libinput_event_tablet_get_tool(t);
+ t = libinput_event_get_tablet_tool_event(event);
+ tool = libinput_event_tablet_tool_get_tool(t);
ck_assert(libinput_tool_has_axis(tool,
LIBINPUT_TABLET_TOOL_AXIS_PRESSURE));
@@ -1830,7 +1830,7 @@ START_TEST(mouse_tool)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tev;
+ struct libinput_event_tablet_tool *tev;
struct libinput_tablet_tool *tool;
if (!libevdev_has_event_code(dev->evdev,
@@ -1848,8 +1848,8 @@ START_TEST(mouse_tool)
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY,
-1);
event = libinput_get_event(li);
- tev = libinput_event_get_tablet_event(event);
- tool = libinput_event_tablet_get_tool(tev);
+ tev = libinput_event_get_tablet_tool_event(event);
+ tool = libinput_event_tablet_tool_get_tool(tev);
ck_assert_notnull(tool);
ck_assert_int_eq(libinput_tool_get_type(tool),
LIBINPUT_TABLET_TOOL_TYPE_MOUSE);
@@ -1863,7 +1863,7 @@ START_TEST(mouse_buttons)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tev;
+ struct libinput_event_tablet_tool *tev;
struct libinput_tablet_tool *tool;
int code;
@@ -1883,8 +1883,8 @@ START_TEST(mouse_buttons)
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY,
-1);
event = libinput_get_event(li);
- tev = libinput_event_get_tablet_event(event);
- tool = libinput_event_tablet_get_tool(tev);
+ tev = libinput_event_get_tablet_tool_event(event);
+ tool = libinput_event_tablet_tool_get_tool(tev);
ck_assert_notnull(tool);
libinput_tool_ref(tool);
@@ -1924,7 +1924,7 @@ START_TEST(mouse_rotation)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tev;
+ struct libinput_event_tablet_tool *tev;
int angle;
int tilt_center_x, tilt_center_y;
const struct input_absinfo *abs;
@@ -1976,10 +1976,10 @@ START_TEST(mouse_rotation)
LIBINPUT_EVENT_TABLET_TOOL_AXIS,
-1);
event = libinput_get_event(li);
- tev = libinput_event_get_tablet_event(event);
- ck_assert(libinput_event_tablet_axis_has_changed(tev,
+ tev = libinput_event_get_tablet_tool_event(event);
+ ck_assert(libinput_event_tablet_tool_axis_has_changed(tev,
LIBINPUT_TABLET_TOOL_AXIS_ROTATION_Z));
- val = libinput_event_tablet_get_axis_value(tev,
+ val = libinput_event_tablet_tool_get_axis_value(tev,
LIBINPUT_TABLET_TOOL_AXIS_ROTATION_Z);
/* rounding error galore, we can't test for anything more
@@ -2000,7 +2000,7 @@ START_TEST(mouse_wheel)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tev;
+ struct libinput_event_tablet_tool *tev;
struct libinput_tablet_tool *tool;
const struct input_absinfo *abs;
double val;
@@ -2022,8 +2022,8 @@ START_TEST(mouse_wheel)
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY,
-1);
event = libinput_get_event(li);
- tev = libinput_event_get_tablet_event(event);
- tool = libinput_event_tablet_get_tool(tev);
+ tev = libinput_event_get_tablet_tool_event(event);
+ tool = libinput_event_tablet_tool_get_tool(tev);
ck_assert_notnull(tool);
libinput_tool_ref(tool);
@@ -2039,18 +2039,18 @@ START_TEST(mouse_wheel)
litest_wait_for_event_of_type(li, LIBINPUT_EVENT_TABLET_TOOL_AXIS, -1);
event = libinput_get_event(li);
- tev = libinput_event_get_tablet_event(event);
- ck_assert(libinput_event_tablet_axis_has_changed(tev,
+ tev = libinput_event_get_tablet_tool_event(event);
+ ck_assert(libinput_event_tablet_tool_axis_has_changed(tev,
LIBINPUT_TABLET_TOOL_AXIS_REL_WHEEL));
- val = libinput_event_tablet_get_axis_value(tev,
+ val = libinput_event_tablet_tool_get_axis_value(tev,
LIBINPUT_TABLET_TOOL_AXIS_REL_WHEEL);
ck_assert_int_eq(val, 0);
- val = libinput_event_tablet_get_axis_delta(tev,
+ val = libinput_event_tablet_tool_get_axis_delta(tev,
LIBINPUT_TABLET_TOOL_AXIS_REL_WHEEL);
ck_assert_int_eq(val, 15);
- val = libinput_event_tablet_get_axis_delta_discrete(tev,
+ val = libinput_event_tablet_tool_get_axis_delta_discrete(tev,
LIBINPUT_TABLET_TOOL_AXIS_REL_WHEEL);
ck_assert_int_eq(val, 1);
@@ -2070,18 +2070,18 @@ START_TEST(mouse_wheel)
litest_wait_for_event_of_type(li, LIBINPUT_EVENT_TABLET_TOOL_AXIS, -1);
event = libinput_get_event(li);
- tev = libinput_event_get_tablet_event(event);
- ck_assert(!libinput_event_tablet_axis_has_changed(tev,
+ tev = libinput_event_get_tablet_tool_event(event);
+ ck_assert(!libinput_event_tablet_tool_axis_has_changed(tev,
LIBINPUT_TABLET_TOOL_AXIS_REL_WHEEL));
- val = libinput_event_tablet_get_axis_value(tev,
+ val = libinput_event_tablet_tool_get_axis_value(tev,
LIBINPUT_TABLET_TOOL_AXIS_REL_WHEEL);
ck_assert_int_eq(val, 0);
- val = libinput_event_tablet_get_axis_delta(tev,
+ val = libinput_event_tablet_tool_get_axis_delta(tev,
LIBINPUT_TABLET_TOOL_AXIS_REL_WHEEL);
ck_assert_int_eq(val, 0);
- val = libinput_event_tablet_get_axis_delta_discrete(tev,
+ val = libinput_event_tablet_tool_get_axis_delta_discrete(tev,
LIBINPUT_TABLET_TOOL_AXIS_ROTATION_Z);
ck_assert_int_eq(val, 0);
@@ -2099,7 +2099,7 @@ START_TEST(airbrush_tool)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tev;
+ struct libinput_event_tablet_tool *tev;
struct libinput_tablet_tool *tool;
if (!libevdev_has_event_code(dev->evdev,
@@ -2117,8 +2117,8 @@ START_TEST(airbrush_tool)
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY,
-1);
event = libinput_get_event(li);
- tev = libinput_event_get_tablet_event(event);
- tool = libinput_event_tablet_get_tool(tev);
+ tev = libinput_event_get_tablet_tool_event(event);
+ tool = libinput_event_tablet_tool_get_tool(tev);
ck_assert_notnull(tool);
ck_assert_int_eq(libinput_tool_get_type(tool),
LIBINPUT_TABLET_TOOL_TYPE_AIRBRUSH);
@@ -2132,7 +2132,7 @@ START_TEST(airbrush_wheel)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tev;
+ struct libinput_event_tablet_tool *tev;
const struct input_absinfo *abs;
double val;
double scale;
@@ -2167,10 +2167,10 @@ START_TEST(airbrush_wheel)
LIBINPUT_EVENT_TABLET_TOOL_AXIS,
-1);
event = libinput_get_event(li);
- tev = libinput_event_get_tablet_event(event);
- ck_assert(libinput_event_tablet_axis_has_changed(tev,
+ tev = libinput_event_get_tablet_tool_event(event);
+ ck_assert(libinput_event_tablet_tool_axis_has_changed(tev,
LIBINPUT_TABLET_TOOL_AXIS_SLIDER));
- val = libinput_event_tablet_get_axis_value(tev,
+ val = libinput_event_tablet_tool_get_axis_value(tev,
LIBINPUT_TABLET_TOOL_AXIS_SLIDER);
ck_assert_int_eq(val, (v - abs->minimum)/scale);
@@ -2185,7 +2185,7 @@ START_TEST(artpen_tool)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tev;
+ struct libinput_event_tablet_tool *tev;
struct libinput_tablet_tool *tool;
if (!libevdev_has_event_code(dev->evdev,
@@ -2204,8 +2204,8 @@ START_TEST(artpen_tool)
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY,
-1);
event = libinput_get_event(li);
- tev = libinput_event_get_tablet_event(event);
- tool = libinput_event_tablet_get_tool(tev);
+ tev = libinput_event_get_tablet_tool_event(event);
+ tool = libinput_event_tablet_tool_get_tool(tev);
ck_assert_notnull(tool);
ck_assert_int_eq(libinput_tool_get_type(tool),
LIBINPUT_TABLET_TOOL_TYPE_PEN);
@@ -2221,7 +2221,7 @@ START_TEST(artpen_rotation)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tev;
+ struct libinput_event_tablet_tool *tev;
const struct input_absinfo *abs;
double val;
double scale;
@@ -2258,16 +2258,16 @@ START_TEST(artpen_rotation)
LIBINPUT_EVENT_TABLET_TOOL_AXIS,
-1);
event = libinput_get_event(li);
- tev = libinput_event_get_tablet_event(event);
- ck_assert(libinput_event_tablet_axis_has_changed(tev,
+ tev = libinput_event_get_tablet_tool_event(event);
+ ck_assert(libinput_event_tablet_tool_axis_has_changed(tev,
LIBINPUT_TABLET_TOOL_AXIS_ROTATION_Z));
- val = libinput_event_tablet_get_axis_value(tev,
+ val = libinput_event_tablet_tool_get_axis_value(tev,
LIBINPUT_TABLET_TOOL_AXIS_ROTATION_Z);
/* artpen has a 90 deg offset cw */
ck_assert_int_eq(round(val), (angle + 90) % 360);
- val = libinput_event_tablet_get_axis_delta(tev,
+ val = libinput_event_tablet_tool_get_axis_delta(tev,
LIBINPUT_TABLET_TOOL_AXIS_ROTATION_Z);
ck_assert_int_eq(val, 8);
@@ -2283,7 +2283,7 @@ START_TEST(tablet_time_usec)
struct litest_device *dev = litest_current_device();
struct libinput *li = dev->libinput;
struct libinput_event *event;
- struct libinput_event_tablet *tev;
+ struct libinput_event_tablet_tool *tev;
struct axis_replacement axes[] = {
{ ABS_DISTANCE, 10 },
{ -1, -1 }
@@ -2298,9 +2298,9 @@ START_TEST(tablet_time_usec)
LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY,
-1);
event = libinput_get_event(li);
- tev = libinput_event_get_tablet_event(event);
- ck_assert_int_eq(libinput_event_tablet_get_time(tev),
- libinput_event_tablet_get_time_usec(tev) / 1000);
+ tev = libinput_event_get_tablet_tool_event(event);
+ ck_assert_int_eq(libinput_event_tablet_tool_get_time(tev),
+ libinput_event_tablet_tool_get_time_usec(tev) / 1000);
libinput_event_destroy(event);
}
END_TEST
diff --git a/tools/event-debug.c b/tools/event-debug.c
index a16bd01..3b853c2 100644
--- a/tools/event-debug.c
+++ b/tools/event-debug.c
@@ -284,28 +284,28 @@ print_pointer_button_event(struct libinput_event *ev)
static void
print_tablet_tip_event(struct libinput_event *ev)
{
- struct libinput_event_tablet *p = libinput_event_get_tablet_event(ev);
+ struct libinput_event_tablet_tool *p = libinput_event_get_tablet_tool_event(ev);
enum libinput_tablet_tool_tip_state state;
- print_event_time(libinput_event_tablet_get_time(p));
+ print_event_time(libinput_event_tablet_tool_get_time(p));
- state = libinput_event_tablet_get_tip_state(p);
+ state = libinput_event_tablet_tool_get_tip_state(p);
printf("%s\n", state == LIBINPUT_TABLET_TOOL_TIP_DOWN ? "down" : "up");
}
static void
print_tablet_button_event(struct libinput_event *ev)
{
- struct libinput_event_tablet *p = libinput_event_get_tablet_event(ev);
+ struct libinput_event_tablet_tool *p = libinput_event_get_tablet_tool_event(ev);
enum libinput_button_state state;
- print_event_time(libinput_event_tablet_get_time(p));
+ print_event_time(libinput_event_tablet_tool_get_time(p));
- state = libinput_event_tablet_get_button_state(p);
+ state = libinput_event_tablet_tool_get_button_state(p);
printf("%3d %s, seat count: %u\n",
- libinput_event_tablet_get_button(p),
+ libinput_event_tablet_tool_get_button(p),
state == LIBINPUT_BUTTON_STATE_PRESSED ? "pressed" : "released",
- libinput_event_tablet_get_seat_button_count(p));
+ libinput_event_tablet_tool_get_seat_button_count(p));
}
static void
@@ -327,28 +327,28 @@ print_pointer_axis_event(struct libinput_event *ev)
}
static const char*
-tablet_axis_changed_sym(struct libinput_event_tablet *t,
+tablet_axis_changed_sym(struct libinput_event_tablet_tool *t,
enum libinput_tablet_tool_axis axis)
{
- if (libinput_event_tablet_axis_has_changed(t, axis))
+ if (libinput_event_tablet_tool_axis_has_changed(t, axis))
return "*";
else
return "";
}
static void
-print_tablet_axes(struct libinput_event_tablet *t)
+print_tablet_axes(struct libinput_event_tablet_tool *t)
{
- struct libinput_tablet_tool *tool = libinput_event_tablet_get_tool(t);
+ struct libinput_tablet_tool *tool = libinput_event_tablet_tool_get_tool(t);
double x, y, dx, dy;
double dist, pressure;
double rotation, slider, wheel;
double delta;
- x = libinput_event_tablet_get_axis_value(t, LIBINPUT_TABLET_TOOL_AXIS_X);
- y = libinput_event_tablet_get_axis_value(t, LIBINPUT_TABLET_TOOL_AXIS_Y);
- dx = libinput_event_tablet_get_axis_delta(t, LIBINPUT_TABLET_TOOL_AXIS_X);
- dy = libinput_event_tablet_get_axis_delta(t, LIBINPUT_TABLET_TOOL_AXIS_Y);
+ x = libinput_event_tablet_tool_get_axis_value(t, LIBINPUT_TABLET_TOOL_AXIS_X);
+ y = libinput_event_tablet_tool_get_axis_value(t, LIBINPUT_TABLET_TOOL_AXIS_Y);
+ dx = libinput_event_tablet_tool_get_axis_delta(t, LIBINPUT_TABLET_TOOL_AXIS_X);
+ dy = libinput_event_tablet_tool_get_axis_delta(t, LIBINPUT_TABLET_TOOL_AXIS_Y);
printf("\t%.2f%s/%.2f%s (%.2f/%.2f)",
x, tablet_axis_changed_sym(t, LIBINPUT_TABLET_TOOL_AXIS_X),
y, tablet_axis_changed_sym(t, LIBINPUT_TABLET_TOOL_AXIS_Y),
@@ -356,13 +356,13 @@ print_tablet_axes(struct libinput_event_tablet *t)
if (libinput_tool_has_axis(tool, LIBINPUT_TABLET_TOOL_AXIS_TILT_X) ||
libinput_tool_has_axis(tool, LIBINPUT_TABLET_TOOL_AXIS_TILT_Y)) {
- x = libinput_event_tablet_get_axis_value(t,
+ x = libinput_event_tablet_tool_get_axis_value(t,
LIBINPUT_TABLET_TOOL_AXIS_TILT_X);
- y = libinput_event_tablet_get_axis_value(t,
+ y = libinput_event_tablet_tool_get_axis_value(t,
LIBINPUT_TABLET_TOOL_AXIS_TILT_Y);
- dx = libinput_event_tablet_get_axis_delta(t,
+ dx = libinput_event_tablet_tool_get_axis_delta(t,
LIBINPUT_TABLET_TOOL_AXIS_TILT_X);
- dy = libinput_event_tablet_get_axis_delta(t,
+ dy = libinput_event_tablet_tool_get_axis_delta(t,
LIBINPUT_TABLET_TOOL_AXIS_TILT_Y);
printf("\ttilt: %.2f%s/%.2f%s (%.2f/%.2f)",
x, tablet_axis_changed_sym(t,
@@ -374,12 +374,12 @@ print_tablet_axes(struct libinput_event_tablet *t)
if (libinput_tool_has_axis(tool, LIBINPUT_TABLET_TOOL_AXIS_DISTANCE) ||
libinput_tool_has_axis(tool, LIBINPUT_TABLET_TOOL_AXIS_PRESSURE)) {
- dist = libinput_event_tablet_get_axis_value(t,
+ dist = libinput_event_tablet_tool_get_axis_value(t,
LIBINPUT_TABLET_TOOL_AXIS_DISTANCE);
- pressure = libinput_event_tablet_get_axis_value(t,
+ pressure = libinput_event_tablet_tool_get_axis_value(t,
LIBINPUT_TABLET_TOOL_AXIS_PRESSURE);
if (dist) {
- delta = libinput_event_tablet_get_axis_delta(t,
+ delta = libinput_event_tablet_tool_get_axis_delta(t,
LIBINPUT_TABLET_TOOL_AXIS_DISTANCE);
printf("\tdistance: %.2f%s (%.2f)",
dist,
@@ -387,7 +387,7 @@ print_tablet_axes(struct libinput_event_tablet *t)
LIBINPUT_TABLET_TOOL_AXIS_DISTANCE),
delta);
} else {
- delta = libinput_event_tablet_get_axis_delta(t,
+ delta = libinput_event_tablet_tool_get_axis_delta(t,
LIBINPUT_TABLET_TOOL_AXIS_PRESSURE);
printf("\tpressure: %.2f%s (%.2f)",
pressure,
@@ -398,9 +398,9 @@ print_tablet_axes(struct libinput_event_tablet *t)
}
if (libinput_tool_has_axis(tool, LIBINPUT_TABLET_TOOL_AXIS_ROTATION_Z)) {
- rotation = libinput_event_tablet_get_axis_value(t,
+ rotation = libinput_event_tablet_tool_get_axis_value(t,
LIBINPUT_TABLET_TOOL_AXIS_ROTATION_Z);
- delta = libinput_event_tablet_get_axis_delta(t,
+ delta = libinput_event_tablet_tool_get_axis_delta(t,
LIBINPUT_TABLET_TOOL_AXIS_ROTATION_Z);
printf("\trotation: %.2f%s (%.2f)",
rotation,
@@ -410,9 +410,9 @@ print_tablet_axes(struct libinput_event_tablet *t)
}
if (libinput_tool_has_axis(tool, LIBINPUT_TABLET_TOOL_AXIS_SLIDER)) {
- slider = libinput_event_tablet_get_axis_value(t,
+ slider = libinput_event_tablet_tool_get_axis_value(t,
LIBINPUT_TABLET_TOOL_AXIS_SLIDER);
- delta = libinput_event_tablet_get_axis_delta(t,
+ delta = libinput_event_tablet_tool_get_axis_delta(t,
LIBINPUT_TABLET_TOOL_AXIS_SLIDER);
printf("\tslider: %.2f%s (%.2f)",
slider,
@@ -422,9 +422,9 @@ print_tablet_axes(struct libinput_event_tablet *t)
}
if (libinput_tool_has_axis(tool, LIBINPUT_TABLET_TOOL_AXIS_REL_WHEEL)) {
- wheel = libinput_event_tablet_get_axis_value(t,
+ wheel = libinput_event_tablet_tool_get_axis_value(t,
LIBINPUT_TABLET_TOOL_AXIS_REL_WHEEL);
- delta = libinput_event_tablet_get_axis_delta_discrete(t,
+ delta = libinput_event_tablet_tool_get_axis_delta_discrete(t,
LIBINPUT_TABLET_TOOL_AXIS_REL_WHEEL);
printf("\twheel: %.2f%s (%d)",
wheel,
@@ -437,9 +437,9 @@ print_tablet_axes(struct libinput_event_tablet *t)
static void
print_tablet_axis_event(struct libinput_event *ev)
{
- struct libinput_event_tablet *t = libinput_event_get_tablet_event(ev);
+ struct libinput_event_tablet_tool *t = libinput_event_get_tablet_tool_event(ev);
- print_event_time(libinput_event_tablet_get_time(t));
+ print_event_time(libinput_event_tablet_tool_get_time(t));
print_tablet_axes(t);
printf("\n");
}
@@ -456,8 +456,8 @@ print_touch_event_without_coords(struct libinput_event *ev)
static void
print_proximity_event(struct libinput_event *ev)
{
- struct libinput_event_tablet *t = libinput_event_get_tablet_event(ev);
- struct libinput_tablet_tool *tool = libinput_event_tablet_get_tool(t);
+ struct libinput_event_tablet_tool *t = libinput_event_get_tablet_tool_event(ev);
+ struct libinput_tablet_tool *tool = libinput_event_tablet_tool_get_tool(t);
enum libinput_tablet_tool_proximity_state state;
const char *tool_str,
*state_str;
@@ -491,9 +491,9 @@ print_proximity_event(struct libinput_event *ev)
abort();
}
- state = libinput_event_tablet_get_proximity_state(t);
+ state = libinput_event_tablet_tool_get_proximity_state(t);
- print_event_time(libinput_event_tablet_get_time(t));
+ print_event_time(libinput_event_tablet_tool_get_time(t));
if (state == LIBINPUT_TABLET_TOOL_PROXIMITY_IN) {
print_tablet_axes(t);
diff --git a/tools/event-gui.c b/tools/event-gui.c
index 4818a40..996842e 100644
--- a/tools/event-gui.c
+++ b/tools/event-gui.c
@@ -599,12 +599,12 @@ handle_event_pinch(struct libinput_event *ev, struct window *w)
static void
handle_event_tablet(struct libinput_event *ev, struct window *w)
{
- struct libinput_event_tablet *t = libinput_event_get_tablet_event(ev);
+ struct libinput_event_tablet_tool *t = libinput_event_get_tablet_tool_event(ev);
double x, y;
switch (libinput_event_get_type(ev)) {
case LIBINPUT_EVENT_TABLET_TOOL_PROXIMITY:
- if (libinput_event_tablet_get_proximity_state(t) ==
+ if (libinput_event_tablet_tool_get_proximity_state(t) ==
LIBINPUT_TABLET_TOOL_PROXIMITY_OUT) {
w->tool.x_in = 0;
w->tool.y_in = 0;
@@ -613,30 +613,30 @@ handle_event_tablet(struct libinput_event *ev, struct window *w)
w->tool.x_up = 0;
w->tool.y_up = 0;
} else {
- w->tool.x_in = libinput_event_tablet_get_x_transformed(t,
+ w->tool.x_in = libinput_event_tablet_tool_get_x_transformed(t,
w->width);
- w->tool.y_in = libinput_event_tablet_get_y_transformed(t,
+ w->tool.y_in = libinput_event_tablet_tool_get_y_transformed(t,
w->height);
}
break;
case LIBINPUT_EVENT_TABLET_TOOL_AXIS:
- w->tool.x = libinput_event_tablet_get_x_transformed(t,
+ w->tool.x = libinput_event_tablet_tool_get_x_transformed(t,
w->width);
- w->tool.y = libinput_event_tablet_get_y_transformed(t,
+ w->tool.y = libinput_event_tablet_tool_get_y_transformed(t,
w->height);
- w->tool.pressure = libinput_event_tablet_get_axis_value(t,
+ w->tool.pressure = libinput_event_tablet_tool_get_axis_value(t,
LIBINPUT_TABLET_TOOL_AXIS_PRESSURE);
- w->tool.distance = libinput_event_tablet_get_axis_value(t,
+ w->tool.distance = libinput_event_tablet_tool_get_axis_value(t,
LIBINPUT_TABLET_TOOL_AXIS_DISTANCE);
- w->tool.tilt_x = libinput_event_tablet_get_axis_value(t,
+ w->tool.tilt_x = libinput_event_tablet_tool_get_axis_value(t,
LIBINPUT_TABLET_TOOL_AXIS_TILT_X);
- w->tool.tilt_y = libinput_event_tablet_get_axis_value(t,
+ w->tool.tilt_y = libinput_event_tablet_tool_get_axis_value(t,
LIBINPUT_TABLET_TOOL_AXIS_TILT_Y);
break;
case LIBINPUT_EVENT_TABLET_TOOL_TIP:
- 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) ==
+ x = libinput_event_tablet_tool_get_x_transformed(t, w->width);
+ y = libinput_event_tablet_tool_get_y_transformed(t, w->height);
+ if (libinput_event_tablet_tool_get_tip_state(t) ==
LIBINPUT_TABLET_TOOL_TIP_DOWN) {
w->tool.x_down = x;
w->tool.y_down = y;
--
2.5.0
More information about the wayland-devel
mailing list