diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-02-19 08:59:20 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-19 08:59:20 -0500 |
commit | ea28887a23600d1155cb2b7ac0412a841244d9e5 (patch) | |
tree | c1b8afb47bc88d39369fbadcc664f956105d5d49 /include | |
parent | fc9838b15e8d4f0d5a80749902b1d190978caf9f (diff) | |
parent | 8163f7e1e21d9b039319cc3e38993811bfbeea4f (diff) |
Merge pull request #1493 from emersion/primary-selection-v1
primary-selection-v1: copy from gtk-primary-selection
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/types/meson.build | 1 | ||||
-rw-r--r-- | include/wlr/types/wlr_primary_selection_v1.h | 52 |
2 files changed, 53 insertions, 0 deletions
diff --git a/include/wlr/types/meson.build b/include/wlr/types/meson.build index 82715ad1..fe39db36 100644 --- a/include/wlr/types/meson.build +++ b/include/wlr/types/meson.build @@ -28,6 +28,7 @@ install_headers( 'wlr_pointer_gestures_v1.h', 'wlr_pointer.h', 'wlr_presentation_time.h', + 'wlr_primary_selection_v1.h', 'wlr_primary_selection.h', 'wlr_region.h', 'wlr_relative_pointer_v1.h', diff --git a/include/wlr/types/wlr_primary_selection_v1.h b/include/wlr/types/wlr_primary_selection_v1.h new file mode 100644 index 00000000..e6bde8a3 --- /dev/null +++ b/include/wlr/types/wlr_primary_selection_v1.h @@ -0,0 +1,52 @@ +/* + * This an unstable interface of wlroots. No guarantees are made regarding the + * future consistency of this API. + */ +#ifndef WLR_USE_UNSTABLE +#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features" +#endif + +#ifndef WLR_TYPES_WLR_PRIMARY_SELECTION_V1_H +#define WLR_TYPES_WLR_PRIMARY_SELECTION_V1_H + +#include <wayland-server.h> +#include <wlr/types/wlr_seat.h> + +struct wlr_primary_selection_v1_device_manager { + struct wl_global *global; + struct wl_list resources; // wl_resource_get_link + struct wl_list devices; // wlr_primary_selection_v1_device::link + + struct wl_listener display_destroy; + + struct { + struct wl_signal destroy; + } events; + + void *data; +}; + +/** + * A device is a per-seat object used to set and get the current selection. + */ +struct wlr_primary_selection_v1_device { + struct wlr_primary_selection_v1_device_manager *manager; + struct wlr_seat *seat; + struct wl_list link; // wlr_primary_selection_v1_device_manager::devices + struct wl_list resources; // wl_resource_get_link + + struct wl_list offers; // wl_resource_get_link + + struct wl_listener seat_destroy; + struct wl_listener seat_focus_change; + struct wl_listener seat_set_primary_selection; + + void *data; +}; + +struct wlr_primary_selection_v1_device_manager * + wlr_primary_selection_v1_device_manager_create(struct wl_display *display); +void wlr_primary_selection_v1_device_manager_destroy( + struct wlr_primary_selection_v1_device_manager *manager); + +#endif |