diff options
author | Drew DeVault <sir@cmpwn.com> | 2019-01-06 22:41:35 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-06 22:41:35 -0500 |
commit | e61ea7706b36435836f341bc371124902d5fb412 (patch) | |
tree | 96bb1ff88dc68f8367d169c1447dd4eb3a36982d /include | |
parent | e1eceddecff801c7bd7b113704b74df4c6a63ca6 (diff) | |
parent | 69e7fd61b7824ce683137b44beff02899d6ce78b (diff) |
Merge pull request #1423 from emersion/data-control
Implement data-control-unstable-v1
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/types/meson.build | 3 | ||||
-rw-r--r-- | include/wlr/types/wlr_data_control_v1.h | 48 |
2 files changed, 50 insertions, 1 deletions
diff --git a/include/wlr/types/meson.build b/include/wlr/types/meson.build index dfb55ec9..e245dc4e 100644 --- a/include/wlr/types/meson.build +++ b/include/wlr/types/meson.build @@ -3,6 +3,7 @@ install_headers( 'wlr_buffer.h', 'wlr_compositor.h', 'wlr_cursor.h', + 'wlr_data_control_v1.h', 'wlr_data_device.h', 'wlr_export_dmabuf_v1.h', 'wlr_foreign_toplevel_management_v1.h', @@ -22,8 +23,8 @@ install_headers( 'wlr_output_damage.h', 'wlr_output_layout.h', 'wlr_output.h', - 'wlr_pointer.h', 'wlr_pointer_constraints_v1.h', + 'wlr_pointer.h', 'wlr_presentation_time.h', 'wlr_primary_selection.h', 'wlr_region.h', diff --git a/include/wlr/types/wlr_data_control_v1.h b/include/wlr/types/wlr_data_control_v1.h new file mode 100644 index 00000000..50c96736 --- /dev/null +++ b/include/wlr/types/wlr_data_control_v1.h @@ -0,0 +1,48 @@ +/* + * 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_DATA_CONTROL_V1_H +#define WLR_TYPES_WLR_DATA_CONTROL_V1_H + +#include <wayland-server.h> +#include <wlr/types/wlr_seat.h> + +struct wlr_data_control_manager_v1 { + struct wl_global *global; + struct wl_list resources; // wl_resource_get_link + struct wl_list devices; // wlr_data_control_device_v1::link + + struct { + struct wl_signal destroy; + struct wl_signal new_device; // wlr_data_control_device_v1 + } events; + + struct wl_listener display_destroy; +}; + +struct wlr_data_control_device_v1 { + struct wl_resource *resource; + struct wlr_data_control_manager_v1 *manager; + struct wl_list link; // wlr_data_control_manager_v1::devices + + struct wlr_seat *seat; + struct wl_resource *selection_offer_resource; // current selection offer + + struct wl_listener seat_destroy; + struct wl_listener seat_selection; +}; + +struct wlr_data_control_manager_v1 *wlr_data_control_manager_v1_create( + struct wl_display *display); +void wlr_data_control_manager_v1_destroy( + struct wlr_data_control_manager_v1 *manager); + +void wlr_data_control_device_v1_destroy( + struct wlr_data_control_device_v1 *device); + +#endif |