File: wlr_data_device.h

package info (click to toggle)
wlroots 0.19.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,592 kB
  • sloc: ansic: 75,766; xml: 2,739; sh: 33; makefile: 23
file content (43 lines) | stat: -rw-r--r-- 1,641 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef TYPES_WLR_DATA_DEVICE_H
#define TYPES_WLR_DATA_DEVICE_H

#include <wayland-server-core.h>
#include <wlr/types/wlr_data_device.h>

#define DATA_DEVICE_ALL_ACTIONS (WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY | \
	WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE | \
	WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK)

struct wlr_client_data_source {
	struct wlr_data_source source;
	struct wlr_data_source_impl impl;
	struct wl_resource *resource;
	bool finalized;
};

extern const struct wlr_surface_role drag_icon_surface_role;

struct wlr_data_offer *data_offer_create(struct wl_resource *device_resource,
	struct wlr_data_source *source, enum wlr_data_offer_type type);
void data_offer_update_action(struct wlr_data_offer *offer);
void data_offer_destroy(struct wlr_data_offer *offer);

struct wlr_client_data_source *client_data_source_create(
	struct wl_client *client, uint32_t version, uint32_t id,
	struct wl_list *resource_list);
struct wlr_client_data_source *client_data_source_from_resource(
	struct wl_resource *resource);
void data_source_notify_finish(struct wlr_data_source *source);

struct wlr_seat_client *seat_client_from_data_device_resource(
	struct wl_resource *resource);
/**
 * Creates a new wl_data_offer if there is a wl_data_source currently set as
 * the seat selection and sends it to the seat client, followed by the
 * wl_data_device.selection() event.  If there is no current selection, the
 * wl_data_device.selection() event will carry a NULL wl_data_offer.  If the
 * client does not have a wl_data_device for the seat nothing will be done.
 */
void seat_client_send_selection(struct wlr_seat_client *seat_client);

#endif