Add missing gtk-primary-selection interfaces

This commit is contained in:
emersion 2017-12-22 22:22:29 +01:00
parent 0a171d3ace
commit a95d09d561
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
6 changed files with 279 additions and 8 deletions

View file

@ -9,6 +9,7 @@
#include <wlr/types/wlr_xdg_shell_v6.h>
#include <wlr/types/wlr_xcursor_manager.h>
#include <wlr/types/wlr_gamma_control.h>
#include <wlr/types/wlr_primary_selection.h>
#include <wlr/types/wlr_screenshooter.h>
#include <wlr/types/wlr_list.h>
#include "rootston/view.h"
@ -41,6 +42,7 @@ struct roots_desktop {
struct wlr_gamma_control_manager *gamma_control_manager;
struct wlr_screenshooter *screenshooter;
struct wlr_server_decoration_manager *server_decoration_manager;
struct wlr_primary_selection_device_manager *primary_selection_device_manager;
struct wl_listener output_add;
struct wl_listener output_remove;

View file

@ -1,6 +1,7 @@
#ifndef WLR_TYPES_WLR_PRIMARY_SELECTION_H
#define WLR_TYPES_WLR_PRIMARY_SELECTION_H
#include <wlr/types/wlr_seat.h>
#include <wayland-server.h>
struct wlr_primary_selection_device_manager {
@ -11,10 +12,21 @@ struct wlr_primary_selection_device_manager {
void *data;
};
struct wlr_primary_selection_offer;
struct wlr_primary_selection_source {
struct wl_resource *resource;
struct wlr_primary_selection_offer *offer;
struct wlr_seat_client *seat_client;
struct wl_array mime_types;
bool accepted;
void (*accept)(struct wlr_primary_selection_source *source, uint32_t serial,
const char *mime_type);
void (*send)(struct wlr_primary_selection_source *source,
const char *mime_type, int32_t fd);
void (*cancel)(struct wlr_primary_selection_source *source);
struct {
struct wl_signal destroy;
@ -23,9 +35,20 @@ struct wlr_primary_selection_source {
void *data;
};
struct wlr_primary_selection_offer {
struct wl_resource *resource;
struct wlr_primary_selection_source *source;
struct wl_listener source_destroy;
};
struct wlr_primary_selection_device_manager *
wlr_primary_selection_device_manager_create(struct wl_display *display);
void wlr_primary_selection_device_manager_destroy(
struct wlr_primary_selection_device_manager *manager);
void wlr_seat_client_send_primary_selection(struct wlr_seat_client *seat_client);
void wlr_seat_set_primary_selection(struct wlr_seat *seat,
struct wlr_primary_selection_source *source, uint32_t serial);
#endif

View file

@ -21,6 +21,7 @@ struct wlr_seat_client {
struct wl_list keyboards;
struct wl_list touches;
struct wl_list data_devices;
struct wl_list primary_selection_devices;
struct {
struct wl_signal destroy;
@ -181,12 +182,16 @@ struct wlr_seat {
struct wlr_data_source *selection_source;
uint32_t selection_serial;
struct wlr_primary_selection_source *primary_selection_source;
uint32_t primary_selection_serial;
struct wlr_seat_pointer_state pointer_state;
struct wlr_seat_keyboard_state keyboard_state;
struct wlr_seat_touch_state touch_state;
struct wl_listener display_destroy;
struct wl_listener selection_data_source_destroy;
struct wl_listener primary_selection_source_destroy;
struct {
struct wl_signal pointer_grab_begin;
@ -201,6 +206,7 @@ struct wlr_seat {
struct wl_signal request_set_cursor;
struct wl_signal selection;
struct wl_signal primary_selection;
} events;
void *data;