mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
Implement basic tablet_pad handling (bound to keyboard focus)
This commit is contained in:
parent
f696e980f1
commit
f375246657
7 changed files with 506 additions and 6 deletions
|
|
@ -31,6 +31,7 @@ struct roots_seat {
|
|||
struct wl_list pointers;
|
||||
struct wl_list touch;
|
||||
struct wl_list tablet_tools;
|
||||
struct wl_list tablet_pads;
|
||||
|
||||
struct wl_listener new_drag_icon;
|
||||
struct wl_listener destroy;
|
||||
|
|
@ -80,12 +81,34 @@ struct roots_touch {
|
|||
struct roots_tablet_tool {
|
||||
struct roots_seat *seat;
|
||||
struct wlr_input_device *device;
|
||||
struct wlr_tablet_v2_tablet *tablet_v2;
|
||||
|
||||
struct wl_listener device_destroy;
|
||||
struct wl_listener axis;
|
||||
struct wl_listener proximity;
|
||||
struct wl_listener tip;
|
||||
struct wl_listener button;
|
||||
struct wl_list link;
|
||||
|
||||
struct wl_list pads; // struct roots_tablet_pad::tablet_link
|
||||
};
|
||||
|
||||
struct roots_tablet_pad {
|
||||
struct wl_list link;
|
||||
struct wl_list tablet_link;
|
||||
struct wlr_tablet_v2_tablet_pad *tablet_v2_pad;
|
||||
|
||||
struct roots_seat *seat;
|
||||
struct wlr_input_device *device;
|
||||
|
||||
struct wl_listener device_destroy;
|
||||
struct wl_listener attach;
|
||||
struct wl_listener button;
|
||||
struct wl_listener ring;
|
||||
struct wl_listener strip;
|
||||
|
||||
struct roots_tablet_tool *tablet;
|
||||
struct wl_listener tablet_destroy;
|
||||
};
|
||||
|
||||
struct roots_seat *roots_seat_create(struct roots_input *input, char *name);
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ 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;
|
||||
|
|
@ -52,6 +53,7 @@ struct wlr_event_tablet_pad_button {
|
|||
uint32_t button;
|
||||
enum wlr_button_state state;
|
||||
unsigned int mode;
|
||||
unsigned int group;
|
||||
};
|
||||
|
||||
enum wlr_tablet_pad_ring_source {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,11 @@
|
|||
#include <wlr/types/wlr_seat.h>
|
||||
#include <wlr/types/wlr_input_device.h>
|
||||
|
||||
#include "tablet-unstable-v2-protocol.h"
|
||||
|
||||
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
|
||||
|
|
@ -30,6 +35,8 @@ struct wlr_tablet_v2_tablet_tool {
|
|||
struct wl_list clients; // wlr_tablet_tool_client_v2::tablet_link
|
||||
|
||||
struct wl_listener tool_destroy;
|
||||
|
||||
struct wlr_tablet_tool_client_v2 *current_client;
|
||||
};
|
||||
|
||||
struct wlr_tablet_v2_tablet_pad {
|
||||
|
|
@ -38,7 +45,12 @@ struct wlr_tablet_v2_tablet_pad {
|
|||
struct wlr_input_device *wlr_device;
|
||||
struct wl_list clients; // wlr_tablet_pad_client_v2::tablet_link
|
||||
|
||||
size_t group_count;
|
||||
uint32_t *groups;
|
||||
|
||||
struct wl_listener pad_destroy;
|
||||
|
||||
struct wlr_tablet_pad_client_v2 *current_client;
|
||||
};
|
||||
|
||||
struct wlr_tablet_v2_tablet *wlr_make_tablet(
|
||||
|
|
@ -59,4 +71,34 @@ struct wlr_tablet_v2_tablet_tool *wlr_make_tablet_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);
|
||||
|
||||
uint32_t 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_motion(
|
||||
struct wlr_tablet_v2_tablet_tool *tool, double x, double y);
|
||||
|
||||
void wlr_send_tablet_v2_tablet_tool_proximity_out(
|
||||
struct wlr_tablet_v2_tablet_tool *tool);
|
||||
|
||||
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);
|
||||
#endif /* WLR_TYPES_WLR_TABLET_V2_H */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue