SDL  2.0
The wl_data_source interface

Data Structures

struct  wl_data_source_listener
 

Macros

#define WL_DATA_SOURCE_TARGET_SINCE_VERSION   1
 
#define WL_DATA_SOURCE_SEND_SINCE_VERSION   1
 
#define WL_DATA_SOURCE_CANCELLED_SINCE_VERSION   1
 
#define WL_DATA_SOURCE_DND_DROP_PERFORMED_SINCE_VERSION   3
 
#define WL_DATA_SOURCE_DND_FINISHED_SINCE_VERSION   3
 
#define WL_DATA_SOURCE_ACTION_SINCE_VERSION   3
 
#define WL_DATA_SOURCE_OFFER_SINCE_VERSION   1
 
#define WL_DATA_SOURCE_DESTROY_SINCE_VERSION   1
 
#define WL_DATA_SOURCE_SET_ACTIONS_SINCE_VERSION   3
 

Functions

static int wl_data_source_add_listener (struct wl_data_source *wl_data_source, const struct wl_data_source_listener *listener, void *data)
 
static void wl_data_source_set_user_data (struct wl_data_source *wl_data_source, void *user_data)
 
static voidwl_data_source_get_user_data (struct wl_data_source *wl_data_source)
 
static void wl_data_source_offer (struct wl_data_source *wl_data_source, const char *mime_type)
 
static void wl_data_source_destroy (struct wl_data_source *wl_data_source)
 
static void wl_data_source_set_actions (struct wl_data_source *wl_data_source, uint32_t dnd_actions)
 

Detailed Description

The wl_data_source object is the source side of a wl_data_offer. It is created by the source client in a data transfer and provides a way to describe the offered data and a way to respond to requests to transfer the data.

Macro Definition Documentation

◆ WL_DATA_SOURCE_ACTION_SINCE_VERSION

#define WL_DATA_SOURCE_ACTION_SINCE_VERSION   3

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

◆ WL_DATA_SOURCE_CANCELLED_SINCE_VERSION

#define WL_DATA_SOURCE_CANCELLED_SINCE_VERSION   1

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

◆ WL_DATA_SOURCE_DESTROY_SINCE_VERSION

#define WL_DATA_SOURCE_DESTROY_SINCE_VERSION   1

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

◆ WL_DATA_SOURCE_DND_DROP_PERFORMED_SINCE_VERSION

#define WL_DATA_SOURCE_DND_DROP_PERFORMED_SINCE_VERSION   3

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

◆ WL_DATA_SOURCE_DND_FINISHED_SINCE_VERSION

#define WL_DATA_SOURCE_DND_FINISHED_SINCE_VERSION   3

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

◆ WL_DATA_SOURCE_OFFER_SINCE_VERSION

#define WL_DATA_SOURCE_OFFER_SINCE_VERSION   1

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

◆ WL_DATA_SOURCE_SEND_SINCE_VERSION

#define WL_DATA_SOURCE_SEND_SINCE_VERSION   1

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

◆ WL_DATA_SOURCE_SET_ACTIONS_SINCE_VERSION

#define WL_DATA_SOURCE_SET_ACTIONS_SINCE_VERSION   3

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

◆ WL_DATA_SOURCE_TARGET_SINCE_VERSION

#define WL_DATA_SOURCE_TARGET_SINCE_VERSION   1

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

Function Documentation

◆ wl_data_source_add_listener()

static int wl_data_source_add_listener ( struct wl_data_source *  wl_data_source,
const struct wl_data_source_listener listener,
void data 
)
inlinestatic

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

2216 {
2217  return wl_proxy_add_listener((struct wl_proxy *) wl_data_source,
2218  (void (**)(void)) listener, data);
2219 }
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974

◆ wl_data_source_destroy()

static void wl_data_source_destroy ( struct wl_data_source *  wl_data_source)
inlinestatic

Destroy the data source.

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

References WL_DATA_SOURCE_DESTROY.

2304 {
2305  wl_proxy_marshal((struct wl_proxy *) wl_data_source,
2307 
2308  wl_proxy_destroy((struct wl_proxy *) wl_data_source);
2309 }
#define WL_DATA_SOURCE_DESTROY

◆ wl_data_source_get_user_data()

static void* wl_data_source_get_user_data ( struct wl_data_source *  wl_data_source)
inlinestatic

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

2273 {
2274  return wl_proxy_get_user_data((struct wl_proxy *) wl_data_source);
2275 }

◆ wl_data_source_offer()

static void wl_data_source_offer ( struct wl_data_source *  wl_data_source,
const char *  mime_type 
)
inlinestatic

This request adds a mime type to the set of mime types advertised to targets. Can be called several times to offer multiple types.

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

References WL_DATA_SOURCE_OFFER.

2292 {
2293  wl_proxy_marshal((struct wl_proxy *) wl_data_source,
2294  WL_DATA_SOURCE_OFFER, mime_type);
2295 }
#define WL_DATA_SOURCE_OFFER

◆ wl_data_source_set_actions()

static void wl_data_source_set_actions ( struct wl_data_source *  wl_data_source,
uint32_t  dnd_actions 
)
inlinestatic

Sets the actions that the source side client supports for this operation. This request may trigger wl_data_source.action and wl_data_offer.action events if the compositor needs to change the selected action.

The dnd_actions argument must contain only values expressed in the wl_data_device_manager.dnd_actions enum, otherwise it will result in a protocol error.

This request must be made once only, and can only be made on sources used in drag-and-drop, so it must be performed before wl_data_device.start_drag. Attempting to use the source other than for drag-and-drop will raise a protocol error.

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

References WL_DATA_SOURCE_SET_ACTIONS.

2330 {
2331  wl_proxy_marshal((struct wl_proxy *) wl_data_source,
2332  WL_DATA_SOURCE_SET_ACTIONS, dnd_actions);
2333 }
#define WL_DATA_SOURCE_SET_ACTIONS

◆ wl_data_source_set_user_data()

static void wl_data_source_set_user_data ( struct wl_data_source *  wl_data_source,
void user_data 
)
inlinestatic

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

2266 {
2267  wl_proxy_set_user_data((struct wl_proxy *) wl_data_source, user_data);
2268 }