2017-12-22 19:20:12 +01:00
|
|
|
#ifndef WLR_TYPES_WLR_PRIMARY_SELECTION_H
|
|
|
|
#define WLR_TYPES_WLR_PRIMARY_SELECTION_H
|
|
|
|
|
|
|
|
#include <wayland-server.h>
|
2018-02-12 21:29:23 +01:00
|
|
|
#include <wlr/types/wlr_seat.h>
|
2017-12-22 19:20:12 +01:00
|
|
|
|
|
|
|
struct wlr_primary_selection_device_manager {
|
|
|
|
struct wl_global *global;
|
|
|
|
|
|
|
|
struct wl_listener display_destroy;
|
|
|
|
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
2017-12-22 22:22:29 +01:00
|
|
|
struct wlr_primary_selection_offer;
|
|
|
|
|
2017-12-22 19:20:12 +01:00
|
|
|
struct wlr_primary_selection_source {
|
2017-12-29 23:23:00 +01:00
|
|
|
// source metadata
|
2017-12-22 19:20:12 +01:00
|
|
|
struct wl_array mime_types;
|
2017-12-22 22:22:29 +01:00
|
|
|
|
2017-12-29 23:23:00 +01:00
|
|
|
// source implementation
|
2017-12-22 22:22:29 +01:00
|
|
|
void (*send)(struct wlr_primary_selection_source *source,
|
|
|
|
const char *mime_type, int32_t fd);
|
|
|
|
void (*cancel)(struct wlr_primary_selection_source *source);
|
2017-12-22 19:20:12 +01:00
|
|
|
|
2017-12-29 23:23:00 +01:00
|
|
|
// source status
|
|
|
|
struct wlr_primary_selection_offer *offer;
|
|
|
|
struct wlr_seat_client *seat_client;
|
|
|
|
|
2017-12-22 19:20:12 +01:00
|
|
|
struct {
|
|
|
|
struct wl_signal destroy;
|
|
|
|
} events;
|
|
|
|
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
2017-12-22 22:22:29 +01:00
|
|
|
struct wlr_primary_selection_offer {
|
|
|
|
struct wl_resource *resource;
|
|
|
|
struct wlr_primary_selection_source *source;
|
|
|
|
|
|
|
|
struct wl_listener source_destroy;
|
2017-12-22 23:45:07 +01:00
|
|
|
|
|
|
|
void *data;
|
2017-12-22 22:22:29 +01:00
|
|
|
};
|
|
|
|
|
2017-12-22 19:20:12 +01:00
|
|
|
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);
|
|
|
|
|
2017-12-22 22:22:29 +01:00
|
|
|
void wlr_seat_client_send_primary_selection(struct wlr_seat_client *seat_client);
|
|
|
|
void wlr_seat_set_primary_selection(struct wlr_seat *seat,
|
2017-12-25 16:10:16 +01:00
|
|
|
struct wlr_primary_selection_source *source, uint32_t serial);
|
|
|
|
|
|
|
|
void wlr_primary_selection_source_init(
|
|
|
|
struct wlr_primary_selection_source *source);
|
2017-12-25 18:18:26 +01:00
|
|
|
void wlr_primary_selection_source_finish(
|
|
|
|
struct wlr_primary_selection_source *source);
|
2017-12-22 22:22:29 +01:00
|
|
|
|
2017-12-22 19:20:12 +01:00
|
|
|
#endif
|