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 void * | wl_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 2236 of file wayland-client-protocol.h.

## WL_DATA_SOURCE_CANCELLED_SINCE_VERSION

#define WL_DATA_SOURCE_CANCELLED_SINCE_VERSION 1

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

## WL_DATA_SOURCE_DESTROY_SINCE_VERSION

#define WL_DATA_SOURCE_DESTROY_SINCE_VERSION 1

Definition at line 2245 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 2228 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 2232 of file wayland-client-protocol.h.

## WL_DATA_SOURCE_OFFER_SINCE_VERSION

#define WL_DATA_SOURCE_OFFER_SINCE_VERSION 1

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

## WL_DATA_SOURCE_SEND_SINCE_VERSION

#define WL_DATA_SOURCE_SEND_SINCE_VERSION 1

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

## WL_DATA_SOURCE_TARGET_SINCE_VERSION

#define WL_DATA_SOURCE_TARGET_SINCE_VERSION 1

Definition at line 2216 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
| ) |  |

inline static

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

{
return wl_proxy_add_listener((struct wl_proxy *) wl_data_source,
(void (**)(void)) listener, data);
}
data
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 | ) |

inline static

Destroy the data source.

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

References WL_DATA_SOURCE_DESTROY.

{
wl_proxy_marshal((struct wl_proxy *) wl_data_source,
WL_DATA_SOURCE_DESTROY);
wl_proxy_destroy((struct wl_proxy *) wl_data_source);
}
WL_DATA_SOURCE_DESTROY
#define WL_DATA_SOURCE_DESTROY
Definition: wayland-client-protocol.h:2210

## wl_data_source_get_user_data()

static void* wl_data_source_get_user_data | ( | struct wl_data_source * | wl_data_source | ) |

inline static

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

{
return wl_proxy_get_user_data((struct wl_proxy *) wl_data_source);
}

## wl_data_source_offer()

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

inline static

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

References WL_DATA_SOURCE_OFFER.

{
wl_proxy_marshal((struct wl_proxy *) wl_data_source,
WL_DATA_SOURCE_OFFER, mime_type);
}
WL_DATA_SOURCE_OFFER
#define WL_DATA_SOURCE_OFFER
Definition: wayland-client-protocol.h:2209

## wl_data_source_set_actions()

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

inline static

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

References WL_DATA_SOURCE_SET_ACTIONS.

{
wl_proxy_marshal((struct wl_proxy *) wl_data_source,
WL_DATA_SOURCE_SET_ACTIONS, dnd_actions);
}
WL_DATA_SOURCE_SET_ACTIONS
#define WL_DATA_SOURCE_SET_ACTIONS
Definition: wayland-client-protocol.h:2211

## wl_data_source_set_user_data()

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

inline static

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

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