wlr-data-device interface

This commit is contained in:
Tony Crisci 2017-10-11 15:48:40 -04:00
parent 2b09105bde
commit 6a7560fae0
11 changed files with 268 additions and 418 deletions

View file

@ -3,7 +3,7 @@
#include <wayland-server.h>
#include <wlr/backend.h>
#include <wlr/backend/session.h>
#include <wlr/types/wlr_data_device_manager.h>
#include <wlr/types/wlr_data_device.h>
#include <wlr/render.h>
#ifdef HAS_XWAYLAND
#include <wlr/xwayland.h>

View file

@ -1,16 +0,0 @@
#ifndef WLR_INTERFACES_WLR_DATA_SOURCE_H
#define WLR_INTERFACES_WLR_DATA_SOURCE_H
#include <wlr/types/wlr_data_source.h>
struct wlr_data_source_impl {
void (*send)(struct wlr_data_source *data_source, const char *type, int fd);
void (*accepted)(struct wlr_data_source *data_source, const char *type);
void (*cancelled)(struct wlr_data_source *data_source);
};
bool wlr_data_source_init(struct wlr_data_source *source,
struct wlr_data_source_impl *impl);
void wlr_data_source_finish(struct wlr_data_source *source);
#endif

View file

@ -0,0 +1,31 @@
#ifndef WLR_TYPES_WLR_DATA_DEVICE_H
#define WLR_TYPES_WLR_DATA_DEVICE_H
#include <wayland-server.h>
struct wlr_data_device_manager {
struct wl_global *global;
};
struct wlr_data_offer {
struct wl_resource *resource;
};
struct wlr_data_source {
struct wl_resource *resource;
struct wlr_data_offer *offer;
struct wlr_seat_handle *seat;
struct wl_array mime_types;
struct {
struct wl_signal destroy;
} events;
};
/**
* Create a wl data device manager global for this display.
*/
struct wlr_data_device_manager *wlr_data_device_manager_create(
struct wl_display *display);
#endif

View file

@ -1,26 +0,0 @@
#ifndef WLR_TYPES_WLR_DATA_DEVICE_MANAGER_H
#define WLR_TYPES_WLR_DATA_DEVICE_MANAGER_H
#include <wayland-server.h>
struct wlr_data_device_manager {
struct wl_global *global;
};
struct wlr_data_device_manager *wlr_data_device_manager_create(struct wl_display *dpy);
void wlr_data_device_manager_destroy(struct wlr_data_device_manager *manager);
struct wlr_data_device {
struct wlr_seat *seat;
struct wlr_data_source *selection;
struct wl_listener selection_destroyed;
struct {
struct wl_signal selection_change;
} events;
};
void wlr_data_device_set_selection(struct wlr_data_device *manager,
struct wlr_data_source *source);
#endif

View file

@ -1,32 +0,0 @@
#ifndef WLR_TYPES_WLR_DATA_SOURCE_H
#define WLR_TYPES_WLR_DATA_SOURCE_H
#include <wayland-server.h>
#include <wlr/util/list.h>
struct wlr_data_source_impl;
struct wlr_data_source {
struct wlr_data_source_impl *impl;
list_t *types;
void *data;
struct {
struct wl_signal destroy;
} events;
};
void wlr_data_source_send(struct wlr_data_source *src, const char *type, int fd);
void wlr_data_source_accepted(struct wlr_data_source *src, const char *type);
void wlr_data_source_cancelled(struct wlr_data_source *src);
struct wlr_wl_data_source {
struct wlr_data_source base;
struct wl_resource *resource;
};
struct wlr_wl_data_source *wlr_wl_data_source_create(
struct wl_client *client,
uint32_t version, uint32_t id);
#endif

View file

@ -111,7 +111,10 @@ struct wlr_seat {
struct wl_list keyboards;
char *name;
uint32_t capabilities;
struct wlr_data_device *data_device;
struct wlr_data_device *data_device; // TODO needed?
struct wlr_data_source *selection_source;
uint32_t selection_serial;
struct wlr_seat_pointer_state pointer_state;
struct wlr_seat_keyboard_state keyboard_state;