aboutsummaryrefslogtreecommitdiff
path: root/include/wlr
diff options
context:
space:
mode:
Diffstat (limited to 'include/wlr')
-rw-r--r--include/wlr/interfaces/wlr_tablet_tool.h10
-rw-r--r--include/wlr/types/wlr_input_device.h2
-rw-r--r--include/wlr/types/wlr_linux_dmabuf_v1.h (renamed from include/wlr/types/wlr_linux_dmabuf.h)16
-rw-r--r--include/wlr/types/wlr_output.h2
-rw-r--r--include/wlr/types/wlr_seat.h2
-rw-r--r--include/wlr/types/wlr_tablet_pad.h25
-rw-r--r--include/wlr/types/wlr_tablet_tool.h50
-rw-r--r--include/wlr/types/wlr_tablet_v2.h171
-rw-r--r--include/wlr/types/wlr_xdg_shell.h2
-rw-r--r--include/wlr/types/wlr_xdg_shell_v6.h2
-rw-r--r--include/wlr/xwayland.h5
11 files changed, 265 insertions, 22 deletions
diff --git a/include/wlr/interfaces/wlr_tablet_tool.h b/include/wlr/interfaces/wlr_tablet_tool.h
index 347a0003..12b2e32e 100644
--- a/include/wlr/interfaces/wlr_tablet_tool.h
+++ b/include/wlr/interfaces/wlr_tablet_tool.h
@@ -3,12 +3,12 @@
#include <wlr/types/wlr_tablet_tool.h>
-struct wlr_tablet_tool_impl {
- void (*destroy)(struct wlr_tablet_tool *tool);
+struct wlr_tablet_impl {
+ void (*destroy)(struct wlr_tablet *tablet);
};
-void wlr_tablet_tool_init(struct wlr_tablet_tool *tool,
- struct wlr_tablet_tool_impl *impl);
-void wlr_tablet_tool_destroy(struct wlr_tablet_tool *tool);
+void wlr_tablet_init(struct wlr_tablet *tablet,
+ struct wlr_tablet_impl *impl);
+void wlr_tablet_destroy(struct wlr_tablet *tablet);
#endif
diff --git a/include/wlr/types/wlr_input_device.h b/include/wlr/types/wlr_input_device.h
index 5cf26b65..cce15d90 100644
--- a/include/wlr/types/wlr_input_device.h
+++ b/include/wlr/types/wlr_input_device.h
@@ -39,7 +39,7 @@ struct wlr_input_device {
struct wlr_keyboard *keyboard;
struct wlr_pointer *pointer;
struct wlr_touch *touch;
- struct wlr_tablet_tool *tablet_tool;
+ struct wlr_tablet *tablet;
struct wlr_tablet_pad *tablet_pad;
};
diff --git a/include/wlr/types/wlr_linux_dmabuf.h b/include/wlr/types/wlr_linux_dmabuf_v1.h
index 4a03170c..43bc8385 100644
--- a/include/wlr/types/wlr_linux_dmabuf.h
+++ b/include/wlr/types/wlr_linux_dmabuf_v1.h
@@ -5,7 +5,7 @@
#include <wayland-server-protocol.h>
#include <wlr/render/dmabuf.h>
-struct wlr_dmabuf_buffer {
+struct wlr_dmabuf_v1_buffer {
struct wlr_renderer *renderer;
struct wl_resource *buffer_resource;
struct wl_resource *params_resource;
@@ -17,24 +17,24 @@ struct wlr_dmabuf_buffer {
* Returns true if the given resource was created via the linux-dmabuf
* buffer protocol, false otherwise
*/
-bool wlr_dmabuf_resource_is_buffer(struct wl_resource *buffer_resource);
+bool wlr_dmabuf_v1_resource_is_buffer(struct wl_resource *buffer_resource);
/**
* Returns the wlr_dmabuf_buffer if the given resource was created
* via the linux-dmabuf buffer protocol
*/
-struct wlr_dmabuf_buffer *wlr_dmabuf_buffer_from_buffer_resource(
+struct wlr_dmabuf_v1_buffer *wlr_dmabuf_v1_buffer_from_buffer_resource(
struct wl_resource *buffer_resource);
/**
* Returns the wlr_dmabuf_buffer if the given resource was created
* via the linux-dmabuf params protocol
*/
-struct wlr_dmabuf_buffer *wlr_dmabuf_buffer_from_params_resource(
+struct wlr_dmabuf_v1_buffer *wlr_dmabuf_v1_buffer_from_params_resource(
struct wl_resource *params_resource);
/* the protocol interface */
-struct wlr_linux_dmabuf {
+struct wlr_linux_dmabuf_v1 {
struct wl_global *global;
struct wlr_renderer *renderer;
struct wl_list resources;
@@ -50,18 +50,18 @@ struct wlr_linux_dmabuf {
/**
* Create linux-dmabuf interface
*/
-struct wlr_linux_dmabuf *wlr_linux_dmabuf_create(struct wl_display *display,
+struct wlr_linux_dmabuf_v1 *wlr_linux_dmabuf_v1_create(struct wl_display *display,
struct wlr_renderer *renderer);
/**
* Destroy the linux-dmabuf interface
*/
-void wlr_linux_dmabuf_destroy(struct wlr_linux_dmabuf *linux_dmabuf);
+void wlr_linux_dmabuf_v1_destroy(struct wlr_linux_dmabuf_v1 *linux_dmabuf);
/**
* Returns the wlr_linux_dmabuf if the given resource was created
* via the linux_dmabuf protocol
*/
-struct wlr_linux_dmabuf *wlr_linux_dmabuf_from_resource(
+struct wlr_linux_dmabuf_v1 *wlr_linux_dmabuf_v1_from_resource(
struct wl_resource *resource);
#endif
diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h
index 5084eb5a..c93ed2eb 100644
--- a/include/wlr/types/wlr_output.h
+++ b/include/wlr/types/wlr_output.h
@@ -6,7 +6,7 @@
#include <time.h>
#include <wayland-server.h>
#include <wayland-util.h>
-#include <wlr/types/wlr_linux_dmabuf.h>
+#include <wlr/render/dmabuf.h>
struct wlr_output_mode {
uint32_t flags; // enum wl_output_mode
diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h
index 1c7a1472..92d0a233 100644
--- a/include/wlr/types/wlr_seat.h
+++ b/include/wlr/types/wlr_seat.h
@@ -540,6 +540,4 @@ bool wlr_seat_validate_grab_serial(struct wlr_seat *seat, uint32_t serial);
struct wlr_seat_client *wlr_seat_client_from_resource(
struct wl_resource *resource);
-bool wlr_surface_is_pointer_cursor(struct wlr_surface *surface);
-
#endif
diff --git a/include/wlr/types/wlr_tablet_pad.h b/include/wlr/types/wlr_tablet_pad.h
index 73082c56..23ac464d 100644
--- a/include/wlr/types/wlr_tablet_pad.h
+++ b/include/wlr/types/wlr_tablet_pad.h
@@ -4,6 +4,7 @@
#include <stdint.h>
#include <wayland-server.h>
#include <wlr/types/wlr_input_device.h>
+#include <wlr/types/wlr_list.h>
/*
* NOTE: the wlr tablet pad implementation does not currently support tablets
@@ -20,16 +21,40 @@ struct wlr_tablet_pad {
struct wl_signal button;
struct wl_signal ring;
struct wl_signal strip;
+ struct wl_signal attach_tablet; //struct wlr_tablet_tool
} events;
+ size_t button_count;
+ size_t ring_count;
+ size_t strip_count;
+
+ struct wl_list groups; // wlr_tablet_pad_group::link
+ struct wlr_list paths; // char *
+
void *data;
};
+struct wlr_tablet_pad_group {
+ struct wl_list link;
+
+ size_t button_count;
+ unsigned int *buttons;
+
+ size_t strip_count;
+ unsigned int *strips;
+
+ size_t ring_count;
+ unsigned int *rings;
+
+ unsigned int mode_count;
+};
+
struct wlr_event_tablet_pad_button {
uint32_t time_msec;
uint32_t button;
enum wlr_button_state state;
unsigned int mode;
+ unsigned int group;
};
enum wlr_tablet_pad_ring_source {
diff --git a/include/wlr/types/wlr_tablet_tool.h b/include/wlr/types/wlr_tablet_tool.h
index 22bf2649..bfa2e1f7 100644
--- a/include/wlr/types/wlr_tablet_tool.h
+++ b/include/wlr/types/wlr_tablet_tool.h
@@ -4,11 +4,47 @@
#include <stdint.h>
#include <wayland-server.h>
#include <wlr/types/wlr_input_device.h>
+#include <wlr/types/wlr_list.h>
-struct wlr_tablet_tool_impl;
+/*
+ * Copy+Paste from libinput, but this should neither use libinput, nor
+ * tablet-unstable-v2 headers, so we can't include them
+ */
+enum wlr_tablet_tool_type {
+ WLR_TABLET_TOOL_TYPE_PEN = 1, /**< A generic pen */
+ WLR_TABLET_TOOL_TYPE_ERASER, /**< Eraser */
+ WLR_TABLET_TOOL_TYPE_BRUSH, /**< A paintbrush-like tool */
+ WLR_TABLET_TOOL_TYPE_PENCIL, /**< Physical drawing tool, e.g.
+ Wacom Inking Pen */
+ WLR_TABLET_TOOL_TYPE_AIRBRUSH, /**< An airbrush-like tool */
+ WLR_TABLET_TOOL_TYPE_MOUSE, /**< A mouse bound to the tablet */
+ WLR_TABLET_TOOL_TYPE_LENS, /**< A mouse tool with a lens */
+};
struct wlr_tablet_tool {
- struct wlr_tablet_tool_impl *impl;
+ enum wlr_tablet_tool_type type;
+ uint64_t hardware_serial;
+ uint64_t hardware_wacom;
+
+ // Capabilities
+ bool tilt;
+ bool pressure;
+ bool distance;
+ bool rotation;
+ bool slider;
+ bool wheel;
+
+ struct {
+ struct wl_signal destroy;
+ } events;
+
+ void *data;
+};
+
+struct wlr_tablet_impl;
+
+struct wlr_tablet {
+ struct wlr_tablet_impl *impl;
struct {
struct wl_signal axis;
@@ -17,6 +53,9 @@ struct wlr_tablet_tool {
struct wl_signal button;
} events;
+ const char *name;
+ struct wlr_list paths; // char *
+
void *data;
};
@@ -34,10 +73,14 @@ enum wlr_tablet_tool_axes {
struct wlr_event_tablet_tool_axis {
struct wlr_input_device *device;
+ struct wlr_tablet_tool *tool;
+
uint32_t time_msec;
uint32_t updated_axes;
// From 0..1
double x, y;
+ // Relative to last event
+ double dx, dy;
double pressure;
double distance;
double tilt_x, tilt_y;
@@ -53,6 +96,7 @@ enum wlr_tablet_tool_proximity_state {
struct wlr_event_tablet_tool_proximity {
struct wlr_input_device *device;
+ struct wlr_tablet_tool *tool;
uint32_t time_msec;
// From 0..1
double x, y;
@@ -66,6 +110,7 @@ enum wlr_tablet_tool_tip_state {
struct wlr_event_tablet_tool_tip {
struct wlr_input_device *device;
+ struct wlr_tablet_tool *tool;
uint32_t time_msec;
// From 0..1
double x, y;
@@ -74,6 +119,7 @@ struct wlr_event_tablet_tool_tip {
struct wlr_event_tablet_tool_button {
struct wlr_input_device *device;
+ struct wlr_tablet_tool *tool;
uint32_t time_msec;
uint32_t button;
enum wlr_button_state state;
diff --git a/include/wlr/types/wlr_tablet_v2.h b/include/wlr/types/wlr_tablet_v2.h
new file mode 100644
index 00000000..afa74d05
--- /dev/null
+++ b/include/wlr/types/wlr_tablet_v2.h
@@ -0,0 +1,171 @@
+#ifndef WLR_TYPES_WLR_TABLET_V2_H
+#define WLR_TYPES_WLR_TABLET_V2_H
+
+#include <wayland-server.h>
+#include <wlr/types/wlr_seat.h>
+#include <wlr/types/wlr_input_device.h>
+
+#include "tablet-unstable-v2-protocol.h"
+
+/* This can probably be even lower,the tools don't have a lot of buttons */
+#define WLR_TABLET_V2_TOOL_BUTTONS_CAP 16
+
+struct wlr_tablet_client_v2;
+struct wlr_tablet_tool_client_v2;
+struct wlr_tablet_pad_client_v2;
+
+struct wlr_tablet_manager_v2 {
+ struct wl_global *wl_global;
+ struct wl_list clients; // wlr_tablet_manager_client_v2::link
+ struct wl_list seats; // wlr_tablet_seat_v2::link
+
+ struct wl_listener display_destroy;
+
+ void *data;
+};
+
+struct wlr_tablet_v2_tablet {
+ struct wl_list link; // wlr_tablet_seat_v2::tablets
+ struct wlr_tablet *wlr_tablet;
+ struct wlr_input_device *wlr_device;
+ struct wl_list clients; // wlr_tablet_client_v2::tablet_link
+
+ struct wl_listener tool_destroy;
+
+ struct wlr_tablet_client_v2 *current_client;
+};
+
+struct wlr_tablet_v2_tablet_tool {
+ struct wl_list link; // wlr_tablet_seat_v2::tablets
+ struct wlr_tablet_tool *wlr_tool;
+ struct wl_list clients; // wlr_tablet_tool_client_v2::tool_link
+
+ struct wl_listener tool_destroy;
+
+ struct wlr_tablet_tool_client_v2 *current_client;
+ struct wlr_surface *focused_surface;
+ struct wl_listener surface_destroy;
+
+ uint32_t proximity_serial;
+ bool is_down;
+ uint32_t down_serial;
+ size_t num_buttons;
+ uint32_t pressed_buttons[WLR_TABLET_V2_TOOL_BUTTONS_CAP];
+ uint32_t pressed_serials[WLR_TABLET_V2_TOOL_BUTTONS_CAP];
+
+ struct {
+ struct wl_signal set_cursor; // struct wlr_tablet_v2_event_cursor
+ } events;
+};
+
+struct wlr_tablet_v2_tablet_pad {
+ struct wl_list link; // wlr_tablet_seat_v2::pads
+ struct wlr_tablet_pad *wlr_pad;
+ struct wlr_input_device *wlr_device;
+ struct wl_list clients; // wlr_tablet_pad_client_v2::pad_link
+
+ size_t group_count;
+ uint32_t *groups;
+
+ struct wl_listener pad_destroy;
+
+ struct wlr_tablet_pad_client_v2 *current_client;
+
+ struct {
+ struct wl_signal button_feedback; // struct wlr_tablet_v2_event_feedback
+ struct wl_signal strip_feedback; // struct wlr_tablet_v2_event_feedback
+ struct wl_signal ring_feedback; // struct wlr_tablet_v2_event_feedback
+ } events;
+};
+
+struct wlr_tablet_v2_event_cursor {
+ struct wlr_surface *surface;
+ uint32_t serial;
+ int32_t hotspot_x;
+ int32_t hotspot_y;
+ struct wlr_seat_client *seat_client;
+};
+
+struct wlr_tablet_v2_event_feedback {
+ const char *description;
+ size_t index;
+ uint32_t serial;
+};
+
+struct wlr_tablet_v2_tablet *wlr_tablet_create(
+ struct wlr_tablet_manager_v2 *manager,
+ struct wlr_seat *wlr_seat,
+ struct wlr_input_device *wlr_device);
+
+struct wlr_tablet_v2_tablet_pad *wlr_tablet_pad_create(
+ struct wlr_tablet_manager_v2 *manager,
+ struct wlr_seat *wlr_seat,
+ struct wlr_input_device *wlr_device);
+
+struct wlr_tablet_v2_tablet_tool *wlr_tablet_tool_create(
+ struct wlr_tablet_manager_v2 *manager,
+ struct wlr_seat *wlr_seat,
+ struct wlr_tablet_tool *wlr_tool);
+
+struct wlr_tablet_manager_v2 *wlr_tablet_v2_create(struct wl_display *display);
+void wlr_tablet_v2_destroy(struct wlr_tablet_manager_v2 *manager);
+
+void wlr_send_tablet_v2_tablet_tool_proximity_in(
+ struct wlr_tablet_v2_tablet_tool *tool,
+ struct wlr_tablet_v2_tablet *tablet,
+ struct wlr_surface *surface);
+
+void wlr_send_tablet_v2_tablet_tool_down(struct wlr_tablet_v2_tablet_tool *tool);
+void wlr_send_tablet_v2_tablet_tool_up(struct wlr_tablet_v2_tablet_tool *tool);
+
+void wlr_send_tablet_v2_tablet_tool_motion(
+ struct wlr_tablet_v2_tablet_tool *tool, double x, double y);
+
+void wlr_send_tablet_v2_tablet_tool_pressure(
+ struct wlr_tablet_v2_tablet_tool *tool, double pressure);
+
+void wlr_send_tablet_v2_tablet_tool_distance(
+ struct wlr_tablet_v2_tablet_tool *tool, double distance);
+
+void wlr_send_tablet_v2_tablet_tool_tilt(
+ struct wlr_tablet_v2_tablet_tool *tool, double x, double y);
+
+void wlr_send_tablet_v2_tablet_tool_rotation(
+ struct wlr_tablet_v2_tablet_tool *tool, double degrees);
+
+void wlr_send_tablet_v2_tablet_tool_slider(
+ struct wlr_tablet_v2_tablet_tool *tool, double position);
+
+void wlr_send_tablet_v2_tablet_tool_wheel(
+ struct wlr_tablet_v2_tablet_tool *tool, double degrees, int32_t clicks);
+
+void wlr_send_tablet_v2_tablet_tool_proximity_out(
+ struct wlr_tablet_v2_tablet_tool *tool);
+
+void wlr_send_tablet_v2_tablet_tool_button(
+ struct wlr_tablet_v2_tablet_tool *tool, uint32_t button,
+ enum zwp_tablet_pad_v2_button_state state);
+
+uint32_t wlr_send_tablet_v2_tablet_pad_enter(
+ struct wlr_tablet_v2_tablet_pad *pad,
+ struct wlr_tablet_v2_tablet *tablet,
+ struct wlr_surface *surface);
+
+void wlr_send_tablet_v2_tablet_pad_button(
+ struct wlr_tablet_v2_tablet_pad *pad, size_t button,
+ uint32_t time, enum zwp_tablet_pad_v2_button_state state);
+
+void wlr_send_tablet_v2_tablet_pad_strip( struct wlr_tablet_v2_tablet_pad *pad,
+ uint32_t strip, double position, bool finger, uint32_t time);
+void wlr_send_tablet_v2_tablet_pad_ring(struct wlr_tablet_v2_tablet_pad *pad,
+ uint32_t ring, double position, bool finger, uint32_t time);
+
+uint32_t wlr_send_tablet_v2_tablet_pad_leave(struct wlr_tablet_v2_tablet_pad *pad,
+ struct wlr_surface *surface);
+
+uint32_t wlr_send_tablet_v2_tablet_pad_mode(struct wlr_tablet_v2_tablet_pad *pad,
+ size_t group, uint32_t mode, uint32_t time);
+
+bool wlr_surface_accepts_tablet_v2(struct wlr_tablet_v2_tablet *tablet,
+ struct wlr_surface *surface);
+#endif /* WLR_TYPES_WLR_TABLET_V2_H */
diff --git a/include/wlr/types/wlr_xdg_shell.h b/include/wlr/types/wlr_xdg_shell.h
index 9c0e6adc..5aa6b374 100644
--- a/include/wlr/types/wlr_xdg_shell.h
+++ b/include/wlr/types/wlr_xdg_shell.h
@@ -119,6 +119,8 @@ struct wlr_xdg_toplevel {
struct wl_signal request_resize;
struct wl_signal request_show_window_menu;
struct wl_signal set_parent;
+ struct wl_signal set_title;
+ struct wl_signal set_app_id;
} events;
};
diff --git a/include/wlr/types/wlr_xdg_shell_v6.h b/include/wlr/types/wlr_xdg_shell_v6.h
index 2e1b6f11..2357d945 100644
--- a/include/wlr/types/wlr_xdg_shell_v6.h
+++ b/include/wlr/types/wlr_xdg_shell_v6.h
@@ -127,6 +127,8 @@ struct wlr_xdg_toplevel_v6 {
struct wl_signal request_resize;
struct wl_signal request_show_window_menu;
struct wl_signal set_parent;
+ struct wl_signal set_title;
+ struct wl_signal set_app_id;
} events;
};
diff --git a/include/wlr/xwayland.h b/include/wlr/xwayland.h
index 7471bbc6..2b643ec9 100644
--- a/include/wlr/xwayland.h
+++ b/include/wlr/xwayland.h
@@ -150,6 +150,8 @@ struct wlr_xwayland_surface {
struct wl_signal set_parent;
struct wl_signal set_pid;
struct wl_signal set_window_type;
+ struct wl_signal set_hints;
+ struct wl_signal set_override_redirect;
struct wl_signal ping_timeout;
} events;
@@ -200,9 +202,6 @@ void wlr_xwayland_surface_set_fullscreen(struct wlr_xwayland_surface *surface,
void wlr_xwayland_set_seat(struct wlr_xwayland *xwayland,
struct wlr_seat *seat);
-bool wlr_xwayland_surface_is_unmanaged(
- const struct wlr_xwayland_surface *surface);
-
bool wlr_surface_is_xwayland_surface(struct wlr_surface *surface);
struct wlr_xwayland_surface *wlr_xwayland_surface_from_wlr_surface(