Add tool buttons

This commit is contained in:
Markus Ongyerth 2018-05-04 11:46:32 +02:00
parent 391eef6ea9
commit 5c7a37f309
5 changed files with 91 additions and 8 deletions

View file

@ -41,6 +41,7 @@ struct roots_cursor {
struct wl_listener tool_axis;
struct wl_listener tool_tip;
struct wl_listener tool_proximity;
struct wl_listener tool_button;
struct wl_listener request_set_cursor;
};

View file

@ -7,6 +7,9 @@
#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;
@ -43,6 +46,10 @@ struct wlr_tablet_v2_tablet_tool {
struct wlr_surface *focused_surface;
struct wl_listener surface_destroy;
struct wl_listener client_destroy;
uint32_t button_serial;
size_t num_buttons;
uint32_t pressed_buttons[WLR_TABLEt_V2_TOOL_BUTTONS_CAP];
};
struct wlr_tablet_v2_tablet_pad {
@ -94,6 +101,10 @@ void wlr_send_tablet_v2_tablet_tool_wheel(
void wlr_send_tablet_v2_tablet_tool_proximity_out(
struct wlr_tablet_v2_tablet_tool *tool);
uint32_t 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,