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 2296 of file wayland-client-protocol.h.

◆ WL_DATA_SOURCE_CANCELLED_SINCE_VERSION

#define WL_DATA_SOURCE_CANCELLED_SINCE_VERSION   1

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

◆ WL_DATA_SOURCE_DESTROY_SINCE_VERSION

#define WL_DATA_SOURCE_DESTROY_SINCE_VERSION   1

Definition at line 2305 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 2288 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 2292 of file wayland-client-protocol.h.

◆ WL_DATA_SOURCE_OFFER_SINCE_VERSION

#define WL_DATA_SOURCE_OFFER_SINCE_VERSION   1

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

◆ WL_DATA_SOURCE_SEND_SINCE_VERSION

#define WL_DATA_SOURCE_SEND_SINCE_VERSION   1

Definition at line 2280 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 2309 of file wayland-client-protocol.h.

◆ WL_DATA_SOURCE_TARGET_SINCE_VERSION

#define WL_DATA_SOURCE_TARGET_SINCE_VERSION   1

Definition at line 2276 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 2262 of file wayland-client-protocol.h.

2264{
2265 return wl_proxy_add_listener((struct wl_proxy *) wl_data_source,
2266 (void (**)(void)) listener, data);
2267}
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 2351 of file wayland-client-protocol.h.

2352{
2353 wl_proxy_marshal_flags((struct wl_proxy *) wl_data_source,
2354 WL_DATA_SOURCE_DESTROY, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_source), WL_MARSHAL_FLAG_DESTROY);
2355}
#define NULL
Definition: begin_code.h:167
#define WL_DATA_SOURCE_DESTROY

References NULL, and 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 2320 of file wayland-client-protocol.h.

2321{
2322 return wl_proxy_get_user_data((struct wl_proxy *) wl_data_source);
2323}

◆ 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 2339 of file wayland-client-protocol.h.

2340{
2341 wl_proxy_marshal_flags((struct wl_proxy *) wl_data_source,
2342 WL_DATA_SOURCE_OFFER, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_source), 0, mime_type);
2343}
#define WL_DATA_SOURCE_OFFER

References NULL, and 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 2375 of file wayland-client-protocol.h.

2376{
2377 wl_proxy_marshal_flags((struct wl_proxy *) wl_data_source,
2378 WL_DATA_SOURCE_SET_ACTIONS, NULL, wl_proxy_get_version((struct wl_proxy *) wl_data_source), 0, dnd_actions);
2379}
#define WL_DATA_SOURCE_SET_ACTIONS

References NULL, and 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 2313 of file wayland-client-protocol.h.

2314{
2315 wl_proxy_set_user_data((struct wl_proxy *) wl_data_source, user_data);
2316}