mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-11 13:29:45 -05:00
Merge pull request #542 from emersion/abstract-data-source
Abstract data sources
This commit is contained in:
commit
ce3a48c316
7 changed files with 300 additions and 236 deletions
|
|
@ -23,33 +23,39 @@ struct wlr_data_offer {
|
|||
struct wl_resource *resource;
|
||||
struct wlr_data_source *source;
|
||||
|
||||
uint32_t dnd_actions;
|
||||
enum wl_data_device_manager_dnd_action preferred_dnd_action;
|
||||
uint32_t actions;
|
||||
enum wl_data_device_manager_dnd_action preferred_action;
|
||||
bool in_ask;
|
||||
|
||||
struct wl_listener source_destroy;
|
||||
};
|
||||
|
||||
struct wlr_data_source {
|
||||
struct wl_resource *resource;
|
||||
// source metadata
|
||||
struct wl_array mime_types;
|
||||
int32_t actions;
|
||||
|
||||
// source implementation
|
||||
void (*send)(struct wlr_data_source *source, const char *mime_type,
|
||||
int32_t fd);
|
||||
void (*accept)(struct wlr_data_source *source, uint32_t serial,
|
||||
const char *mime_type);
|
||||
void (*cancel)(struct wlr_data_source *source);
|
||||
|
||||
// drag'n'drop implementation
|
||||
void (*dnd_drop)(struct wlr_data_source *source);
|
||||
void (*dnd_finish)(struct wlr_data_source *source);
|
||||
void (*dnd_action)(struct wlr_data_source *source,
|
||||
enum wl_data_device_manager_dnd_action action);
|
||||
|
||||
// source status
|
||||
bool accepted;
|
||||
struct wlr_data_offer *offer;
|
||||
struct wlr_seat_client *seat_client;
|
||||
|
||||
struct wl_array mime_types;
|
||||
|
||||
bool accepted;
|
||||
|
||||
// drag and drop
|
||||
// drag'n'drop status
|
||||
enum wl_data_device_manager_dnd_action current_dnd_action;
|
||||
uint32_t dnd_actions;
|
||||
uint32_t compositor_action;
|
||||
bool actions_set;
|
||||
|
||||
void (*accept)(struct wlr_data_source *source, uint32_t serial,
|
||||
const char *mime_type);
|
||||
void (*send)(struct wlr_data_source *source, const char *mime_type,
|
||||
int32_t fd);
|
||||
void (*cancel)(struct wlr_data_source *source);
|
||||
|
||||
struct {
|
||||
struct wl_signal destroy;
|
||||
|
|
|
|||
|
|
@ -15,16 +15,18 @@ struct wlr_primary_selection_device_manager {
|
|||
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;
|
||||
|
||||
// source metadata
|
||||
struct wl_array mime_types;
|
||||
|
||||
// source implementation
|
||||
void (*send)(struct wlr_primary_selection_source *source,
|
||||
const char *mime_type, int32_t fd);
|
||||
void (*cancel)(struct wlr_primary_selection_source *source);
|
||||
|
||||
// source status
|
||||
struct wlr_primary_selection_offer *offer;
|
||||
struct wlr_seat_client *seat_client;
|
||||
|
||||
struct {
|
||||
struct wl_signal destroy;
|
||||
} events;
|
||||
|
|
|
|||
|
|
@ -178,8 +178,7 @@ struct wlr_seat {
|
|||
uint32_t capabilities;
|
||||
struct timespec last_event;
|
||||
|
||||
struct wlr_data_device *data_device; // TODO needed?
|
||||
struct wlr_data_source *selection_source;
|
||||
struct wlr_data_source *selection_data_source;
|
||||
uint32_t selection_serial;
|
||||
|
||||
struct wlr_primary_selection_source *primary_selection_source;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue