summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2017-02-06 16:28:59 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2017-02-06 16:28:59 +1000
commit7b6338d56da8218c5e66feac06735caeb8388ab9 (patch)
treef962efafef32833b0d6e25ff280497f1653b1746
parent60d1e558275ef501e7b15d1cceb3154eebbb6783 (diff)
start with the tool bitswip/xwayland-tablet
-rw-r--r--hw/xwayland/xwayland-input.c175
-rw-r--r--hw/xwayland/xwayland.h8
2 files changed, 183 insertions, 0 deletions
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index f71af9938..6e0040d20 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -1530,12 +1530,172 @@ static const struct zwp_tablet_pad_v2_listener tablet_pad_listener = {
tablet_pad_removed,
};
+static void
+tablet_tool_type(void *data,
+ struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2,
+ uint32_t tool_type)
+{
+}
+
+static void
+tablet_tool_hardware_serial(void *data,
+ struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2,
+ uint32_t hardware_serial_hi,
+ uint32_t hardware_serial_lo)
+{
+}
+
+static void
+tablet_tool_hardware_id_wacom(void *data,
+ struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2,
+ uint32_t hardware_id_hi,
+ uint32_t hardware_id_lo)
+{
+}
+
+static void
+tablet_tool_capability(void *data,
+ struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2,
+ uint32_t capability)
+{
+}
+
+static void
+tablet_tool_done(void *data,
+ struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2)
+{
+}
+
+static void
+tablet_tool_removed(void *data,
+ struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2)
+{
+}
+
+static void
+tablet_tool_proximity_in(void *data,
+ struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2,
+ uint32_t serial,
+ struct zwp_tablet_v2 *tablet,
+ struct wl_surface *surface)
+{
+}
+
+static void
+tablet_tool_proximity_out(void *data,
+ struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2)
+{
+}
+
+static void
+tablet_tool_down(void *data,
+ struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2,
+ uint32_t serial)
+{
+}
+
+static void
+tablet_tool_up(void *data,
+ struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2)
+{
+}
+
+static void
+tablet_tool_motion(void *data,
+ struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2,
+ wl_fixed_t x,
+ wl_fixed_t y)
+{
+}
+
+static void
+tablet_tool_pressure(void *data,
+ struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2,
+ uint32_t pressure)
+{
+}
+
+static void
+tablet_tool_distance(void *data,
+ struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2,
+ uint32_t distance)
+{
+}
+
+static void
+tablet_tool_tilt(void *data,
+ struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2,
+ wl_fixed_t tilt_x,
+ wl_fixed_t tilt_y)
+{
+}
+
+static void
+tablet_tool_rotation(void *data,
+ struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2,
+ wl_fixed_t degrees)
+{
+}
+
+static void
+tablet_tool_slider(void *data,
+ struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2,
+ int32_t position)
+{
+}
+
+static void
+tablet_tool_wheel(void *data,
+ struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2,
+ wl_fixed_t degrees,
+ int32_t clicks)
+{
+}
+
+static void
+tablet_tool_button(void *data,
+ struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2,
+ uint32_t serial,
+ uint32_t button,
+ uint32_t state)
+{
+}
+
+static void
+tablet_tool_frame(void *data,
+ struct zwp_tablet_tool_v2 *zwp_tablet_tool_v2,
+ uint32_t time)
+{
+}
+
+static const struct zwp_tablet_tool_v2_listener tablet_tool_listener = {
+ tablet_tool_type,
+ tablet_tool_hardware_serial,
+ tablet_tool_hardware_id_wacom,
+ tablet_tool_capability,
+ tablet_tool_done,
+ tablet_tool_removed,
+ tablet_tool_proximity_in,
+ tablet_tool_proximity_out,
+ tablet_tool_down,
+ tablet_tool_up,
+ tablet_tool_motion,
+ tablet_tool_pressure,
+ tablet_tool_distance,
+ tablet_tool_tilt,
+ tablet_tool_rotation,
+ tablet_tool_slider,
+ tablet_tool_wheel,
+ tablet_tool_button,
+ tablet_tool_frame,
+};
static void
tablet_added(void *data,
struct zwp_tablet_seat_v2 *zwp_tablet_seat_v2,
struct zwp_tablet_v2 *id)
{
+
}
static void
@@ -1543,6 +1703,21 @@ tablet_tool_added(void *data,
struct zwp_tablet_seat_v2 *zwp_tablet_seat_v2,
struct zwp_tablet_tool_v2 *id)
{
+ struct xwl_seat *xwl_seat = data;
+ struct xwl_tablet_tool *tool;
+
+ tool = calloc(1, sizeof *tool);
+ if (tool == NULL) {
+ ErrorF("tablet_add_added ENOMEM\n");
+ return;
+ }
+
+ tool->xwl_seat = xwl_seat;
+ tool->tool = id;
+ xorg_list_add(&tool->link_tool, &xwl_seat->tablet_tool_list);
+
+ zwp_tablet_tool_v2_add_listener(id, &tablet_tool_listener, tool);
+
}
static void
diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h
index 6505252c2..0b5a5e1eb 100644
--- a/hw/xwayland/xwayland.h
+++ b/hw/xwayland/xwayland.h
@@ -162,6 +162,13 @@ struct xwl_tablet_pad {
struct zwp_tablet_pad_v2 *pad;
};
+struct xwl_tablet_tool {
+ struct xorg_list link_tool;
+ DeviceIntPtr xdevice;
+ struct xwl_seat *xwl_seat;
+ struct zwp_tablet_tool_v2 *tool;
+};
+
struct xwl_seat {
DeviceIntPtr pointer;
DeviceIntPtr relative_pointer;
@@ -211,6 +218,7 @@ struct xwl_seat {
struct zwp_tablet_seat_v2 *tablet_seat;
struct xorg_list tablet_pad_list;
+ struct xorg_list tablet_tool_list;
};
struct xwl_output {