SDL  2.0
The wl_data_device_manager interface

The wl_data_device_manager is a singleton global object that provides access to inter-client data transfer mechanisms such as copy-and-paste and drag-and-drop. These mechanisms are tied to a wl_seat and this interface lets a client get a wl_data_device corresponding to a wl_seat. More...

Macros

#define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE_SINCE_VERSION   1
 
#define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE_SINCE_VERSION   1
 

Enumerations

enum  wl_data_device_manager_dnd_action {
  WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE = 0,
  WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY = 1,
  WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE = 2,
  WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK = 4
}
 

Functions

static void wl_data_device_manager_set_user_data (struct wl_data_device_manager *wl_data_device_manager, void *user_data)
 
static voidwl_data_device_manager_get_user_data (struct wl_data_device_manager *wl_data_device_manager)
 
static void wl_data_device_manager_destroy (struct wl_data_device_manager *wl_data_device_manager)
 
static struct wl_data_source * wl_data_device_manager_create_data_source (struct wl_data_device_manager *wl_data_device_manager)
 
static struct wl_data_device * wl_data_device_manager_get_data_device (struct wl_data_device_manager *wl_data_device_manager, struct wl_seat *seat)
 

Detailed Description

The wl_data_device_manager is a singleton global object that provides access to inter-client data transfer mechanisms such as copy-and-paste and drag-and-drop. These mechanisms are tied to a wl_seat and this interface lets a client get a wl_data_device corresponding to a wl_seat.

Depending on the version bound, the objects created from the bound wl_data_device_manager object will have different requirements for functioning properly. See wl_data_source.set_actions, wl_data_offer.accept and wl_data_offer.finish for details.

Macro Definition Documentation

◆ WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE_SINCE_VERSION

#define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE_SINCE_VERSION   1

Definition at line 2697 of file wayland-client-protocol.h.

◆ WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE_SINCE_VERSION

#define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE_SINCE_VERSION   1

Definition at line 2701 of file wayland-client-protocol.h.

Enumeration Type Documentation

◆ wl_data_device_manager_dnd_action

drag and drop actions

This is a bitmask of the available/preferred actions in a drag-and-drop operation.

In the compositor, the selected action is a result of matching the actions offered by the source and destination sides. "action" events with a "none" action will be sent to both source and destination if there is no match. All further checks will effectively happen on (source actions ∩ destination actions).

In addition, compositors may also pick different actions in reaction to key modifiers being pressed. One common design that is used in major toolkits (and the behavior recommended for compositors) is:

  • If no modifiers are pressed, the first match (in bit order) will be used.
  • Pressing Shift selects "move", if enabled in the mask.
  • Pressing Control selects "copy", if enabled in the mask.

Behavior beyond that is considered implementation-dependent. Compositors may for example bind other modifiers (like Alt/Meta) or drags initiated with other buttons than BTN_LEFT to specific actions (e.g. "ask").

Enumerator
WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE 

no action

WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY 

copy action

WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE 

move action

WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK 

ask action

Definition at line 2670 of file wayland-client-protocol.h.

2670  {
2671  /**
2672  * no action
2673  */
2675  /**
2676  * copy action
2677  */
2679  /**
2680  * move action
2681  */
2683  /**
2684  * ask action
2685  */
2687 };

Function Documentation

◆ wl_data_device_manager_create_data_source()

static struct wl_data_source* wl_data_device_manager_create_data_source ( struct wl_data_device_manager *  wl_data_device_manager)
inlinestatic

Create a new data source.

Definition at line 2736 of file wayland-client-protocol.h.

2737 {
2738  struct wl_proxy *id;
2739 
2740  id = wl_proxy_marshal_flags((struct wl_proxy *) wl_data_device_manager,
2741  WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE, &wl_data_source_interface, wl_proxy_get_version((struct wl_proxy *) wl_data_device_manager), 0, NULL);
2742 
2743  return (struct wl_data_source *) id;
2744 }

References NULL, WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE, and wl_data_source_interface.

◆ wl_data_device_manager_destroy()

static void wl_data_device_manager_destroy ( struct wl_data_device_manager *  wl_data_device_manager)
inlinestatic

Definition at line 2725 of file wayland-client-protocol.h.

2726 {
2727  wl_proxy_destroy((struct wl_proxy *) wl_data_device_manager);
2728 }

◆ wl_data_device_manager_get_data_device()

static struct wl_data_device* wl_data_device_manager_get_data_device ( struct wl_data_device_manager *  wl_data_device_manager,
struct wl_seat *  seat 
)
inlinestatic

Create a new data device for a given seat.

Definition at line 2752 of file wayland-client-protocol.h.

2753 {
2754  struct wl_proxy *id;
2755 
2756  id = wl_proxy_marshal_flags((struct wl_proxy *) wl_data_device_manager,
2757  WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE, &wl_data_device_interface, wl_proxy_get_version((struct wl_proxy *) wl_data_device_manager), 0, NULL, seat);
2758 
2759  return (struct wl_data_device *) id;
2760 }

References NULL, wl_data_device_interface, and WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE.

◆ wl_data_device_manager_get_user_data()

static void* wl_data_device_manager_get_user_data ( struct wl_data_device_manager *  wl_data_device_manager)
inlinestatic

Definition at line 2712 of file wayland-client-protocol.h.

2713 {
2714  return wl_proxy_get_user_data((struct wl_proxy *) wl_data_device_manager);
2715 }

◆ wl_data_device_manager_set_user_data()

static void wl_data_device_manager_set_user_data ( struct wl_data_device_manager *  wl_data_device_manager,
void user_data 
)
inlinestatic

Definition at line 2705 of file wayland-client-protocol.h.

2706 {
2707  wl_proxy_set_user_data((struct wl_proxy *) wl_data_device_manager, user_data);
2708 }
wl_data_device_interface
const struct wl_interface wl_data_device_interface
Definition: wayland-protocol.c:297
NULL
#define NULL
Definition: begin_code.h:167
WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE
#define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE
Definition: wayland-client-protocol.h:2690
WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK
@ WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK
Definition: wayland-client-protocol.h:2686
WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE
@ WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE
Definition: wayland-client-protocol.h:2682
WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE
@ WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE
Definition: wayland-client-protocol.h:2674
WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE
#define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE
Definition: wayland-client-protocol.h:2691
id
GLuint id
Definition: SDL_opengl_glext.h:528
WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY
@ WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY
Definition: wayland-client-protocol.h:2678
wl_data_source_interface
const struct wl_interface wl_data_source_interface
Definition: wayland-protocol.c:276