#include "compositor.h"
struct clipboard_source {
- struct wl_data_source base;
+ struct weston_data_source base;
struct wl_array contents;
struct clipboard *clipboard;
struct wl_event_source *event_source;
}
static void
-clipboard_source_accept(struct wl_data_source *source,
+clipboard_source_accept(struct weston_data_source *source,
uint32_t time, const char *mime_type)
{
}
static void
-clipboard_source_send(struct wl_data_source *base,
+clipboard_source_send(struct weston_data_source *base,
const char *mime_type, int32_t fd)
{
struct clipboard_source *source =
}
static void
-clipboard_source_cancel(struct wl_data_source *source)
+clipboard_source_cancel(struct weston_data_source *source)
{
}
struct clipboard *clipboard =
container_of(listener, struct clipboard, selection_listener);
struct weston_seat *seat = data;
- struct wl_data_source *source = seat->selection_data_source;
+ struct weston_data_source *source = seat->selection_data_source;
const char **mime_types;
int p[2];
struct wl_data_offer {
struct wl_resource *resource;
- struct wl_data_source *source;
+ struct weston_data_source *source;
struct wl_listener source_destroy_listener;
};
-struct wl_data_source {
+struct weston_data_source {
struct wl_resource *resource;
struct wl_signal destroy_signal;
struct wl_array mime_types;
- void (*accept)(struct wl_data_source *source,
+ void (*accept)(struct weston_data_source *source,
uint32_t serial, const char *mime_type);
- void (*send)(struct wl_data_source *source,
+ void (*send)(struct weston_data_source *source,
const char *mime_type, int32_t fd);
- void (*cancel)(struct wl_data_source *source);
+ void (*cancel)(struct weston_data_source *source);
};
struct weston_pointer {
void
weston_seat_set_selection(struct weston_seat *seat,
- struct wl_data_source *source, uint32_t serial);
+ struct weston_data_source *source, uint32_t serial);
struct weston_xkb_info {
struct xkb_keymap *keymap;
struct wl_list drag_resource_list;
uint32_t selection_serial;
- struct wl_data_source *selection_data_source;
+ struct weston_data_source *selection_data_source;
struct wl_listener selection_data_source_listener;
struct wl_signal selection_signal;
struct weston_drag {
struct wl_client *client;
- struct wl_data_source *data_source;
+ struct weston_data_source *data_source;
struct wl_listener data_source_listener;
struct weston_surface *focus;
struct wl_resource *focus_resource;
}
static struct wl_resource *
-wl_data_source_send_offer(struct wl_data_source *source,
- struct wl_resource *target)
+weston_data_source_send_offer(struct weston_data_source *source,
+ struct wl_resource *target)
{
struct wl_data_offer *offer;
char **p;
struct wl_resource *resource,
const char *type)
{
- struct wl_data_source *source = wl_resource_get_user_data(resource);
+ struct weston_data_source *source =
+ wl_resource_get_user_data(resource);
char **p;
p = wl_array_add(&source->mime_types, sizeof *p);
serial = wl_display_next_serial(display);
if (drag->data_source)
- offer = wl_data_source_send_offer(drag->data_source, resource);
+ offer = weston_data_source_send_offer(drag->data_source,
+ resource);
wl_data_device_send_enter(resource, serial, surface->resource,
sx, sy, offer);
WL_EXPORT void
weston_seat_set_selection(struct weston_seat *seat,
- struct wl_data_source *source, uint32_t serial)
+ struct weston_data_source *source, uint32_t serial)
{
struct wl_resource *data_device, *offer;
struct wl_resource *focus = NULL;
data_device = wl_resource_find_for_client(&seat->drag_resource_list,
wl_resource_get_client(focus));
if (data_device && source) {
- offer = wl_data_source_send_offer(seat->selection_data_source,
- data_device);
+ offer = weston_data_source_send_offer(seat->selection_data_source,
+ data_device);
wl_data_device_send_selection(data_device, offer);
} else if (data_device) {
wl_data_device_send_selection(data_device, NULL);
static void
destroy_data_source(struct wl_resource *resource)
{
- struct wl_data_source *source = wl_resource_get_user_data(resource);
+ struct weston_data_source *source =
+ wl_resource_get_user_data(resource);
char **p;
wl_signal_emit(&source->destroy_signal, source);
}
static void
-client_source_accept(struct wl_data_source *source,
+client_source_accept(struct weston_data_source *source,
uint32_t time, const char *mime_type)
{
wl_data_source_send_target(source->resource, mime_type);
}
static void
-client_source_send(struct wl_data_source *source,
+client_source_send(struct weston_data_source *source,
const char *mime_type, int32_t fd)
{
wl_data_source_send_send(source->resource, mime_type, fd);
}
static void
-client_source_cancel(struct wl_data_source *source)
+client_source_cancel(struct weston_data_source *source)
{
wl_data_source_send_cancelled(source->resource);
}
create_data_source(struct wl_client *client,
struct wl_resource *resource, uint32_t id)
{
- struct wl_data_source *source;
+ struct weston_data_source *source;
source = malloc(sizeof *source);
if (source == NULL) {
wl_data_device_set_keyboard_focus(struct weston_seat *seat)
{
struct wl_resource *data_device, *focus, *offer;
- struct wl_data_source *source;
+ struct weston_data_source *source;
if (!seat->keyboard)
return;
source = seat->selection_data_source;
if (source) {
- offer = wl_data_source_send_offer(source, data_device);
+ offer = weston_data_source_send_offer(source, data_device);
wl_data_device_send_selection(data_device, offer);
}
}
}
struct x11_data_source {
- struct wl_data_source base;
+ struct weston_data_source base;
struct weston_wm *wm;
};
static void
-data_source_accept(struct wl_data_source *source,
+data_source_accept(struct weston_data_source *source,
uint32_t time, const char *mime_type)
{
}
static void
-data_source_send(struct wl_data_source *base,
+data_source_send(struct weston_data_source *base,
const char *mime_type, int32_t fd)
{
struct x11_data_source *source = (struct x11_data_source *) base;
}
static void
-data_source_cancel(struct wl_data_source *source)
+data_source_cancel(struct weston_data_source *source)
{
}
static void
weston_wm_send_data(struct weston_wm *wm, xcb_atom_t target, const char *mime_type)
{
- struct wl_data_source *source;
+ struct weston_data_source *source;
struct weston_seat *seat = weston_wm_pick_seat(wm);
int p[2];
struct weston_seat *seat = data;
struct weston_wm *wm =
container_of(listener, struct weston_wm, selection_listener);
- struct wl_data_source *source = seat->selection_data_source;
+ struct weston_data_source *source = seat->selection_data_source;
const char **p, **end;
int has_text_plain = 0;