Wayland Library Drag-n-Drop Functions

Functions that deal with creating, destroying, or interacting with Wayland Drag-n-Drop. More...

Functions

EAPI void ecore_wl2_dnd_drag_types_set (Ecore_Wl2_Input *input, const char **types)
 Set the types which are supported by a possible drag and drop operation.
EAPI uint32_t ecore_wl2_dnd_drag_start (Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, Ecore_Wl2_Window *drag_window)
 Start a drag on the given input.
EAPI void ecore_wl2_dnd_set_actions (Ecore_Wl2_Input *input)
 Call wl_data_source.set_actions on an existing source.
EAPI void ecore_wl2_dnd_drag_end (Ecore_Wl2_Input *input)
 End a drag started by a call to ecore_wl2_dnd_drag_start.
EAPI Ecore_Wl2_Offer * ecore_wl2_dnd_selection_get (Ecore_Wl2_Input *input)
 Get the offer which is currently resposible for the clipboard.
EAPI uint32_t ecore_wl2_dnd_selection_set (Ecore_Wl2_Input *input, const char **types)
 Set the types which are available from this client Later the event ECORE_WL2_EVENT_DATA_SOURCE_SEND is emitted, where the caller of this api must write the data (encoded in the given mimetype) to the fd.
EAPI uint32_t ecore_wl2_dnd_selection_clear (Ecore_Wl2_Input *input)
 Clear the selection currently setted on this input.
EAPI Ecore_Wl2_Drag_Action ecore_wl2_offer_actions_get (Ecore_Wl2_Offer *offer)
 Get the actions available from the data source.
EAPI void ecore_wl2_offer_actions_set (Ecore_Wl2_Offer *offer, Ecore_Wl2_Drag_Action actions, Ecore_Wl2_Drag_Action action)
 Set the actions which are supported by you.
EAPI Ecore_Wl2_Drag_Action ecore_wl2_offer_action_get (Ecore_Wl2_Offer *offer)
 Get action which is set by either the data source or in the last call of actions_set.
EAPI Eina_Array * ecore_wl2_offer_mimes_get (Ecore_Wl2_Offer *offer)
 Get the mime types which are given by the source.
EAPI void ecore_wl2_offer_mimes_set (Ecore_Wl2_Offer *offer, Eina_Array *mimes)
 Set mimetypes you are accepting under this offer.
EAPI void ecore_wl2_offer_accept (Ecore_Wl2_Offer *offer, const char *mime_type)
 Accept a single mime type for an offer.
EAPI void ecore_wl2_offer_receive (Ecore_Wl2_Offer *offer, char *mime)
 Request the data from this offer.
EAPI void ecore_wl2_offer_proxy_receive (Ecore_Wl2_Offer *offer, const char *mime, int fd)
 Request the data from this offer on an externally managed fd.
EAPI void ecore_wl2_offer_proxy_receive_end (Ecore_Wl2_Offer *offer)
 End the use of a proxy received offer.
EAPI Eina_Bool ecore_wl2_offer_supports_mime (Ecore_Wl2_Offer *offer, const char *mime)
 Check if the given offer supports the given mimetype.
EAPI void ecore_wl2_offer_finish (Ecore_Wl2_Offer *offer)
 Mark this offer as finished This will call the dnd_finished event on the source of the sender.

Detailed Description

Functions that deal with creating, destroying, or interacting with Wayland Drag-n-Drop.

Function Documentation

◆ ecore_wl2_dnd_drag_types_set()

EAPI void ecore_wl2_dnd_drag_types_set ( Ecore_Wl2_Input * input,
const char ** types )

Set the types which are supported by a possible drag and drop operation.

This call initializes a data source and offeres the given mimetypes

Parameters
inputthe input where to add on the data source
typesa null-terminated array of mimetypes
Since
1.17

References ecore_wl2_dnd_drag_types_set(), and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ecore_wl2_dnd_drag_types_set().

◆ ecore_wl2_dnd_drag_start()

EAPI uint32_t ecore_wl2_dnd_drag_start ( Ecore_Wl2_Input * input,
Ecore_Wl2_Window * window,
Ecore_Wl2_Window * drag_window )

Start a drag on the given input.

Parameters
inputthe input to use
windowthe window which is the origin of the drag operation
drag_windowthe window which is used as window of the visible hint.
Returns
The serial for the start_drag request
Since
1.17

References ecore_wl2_dnd_drag_start(), ecore_wl2_input_cursor_from_name_set(), ecore_wl2_window_surface_get(), and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ecore_wl2_dnd_drag_start().

◆ ecore_wl2_dnd_set_actions()

EAPI void ecore_wl2_dnd_set_actions ( Ecore_Wl2_Input * input)

Call wl_data_source.set_actions on an existing source.

Parameters
inputthe input to use
See also
ecore_wl2_dnd_drag_start for a more useful function.
Since
1.20

References ecore_wl2_dnd_set_actions(), and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ecore_wl2_dnd_set_actions().

◆ ecore_wl2_dnd_drag_end()

EAPI void ecore_wl2_dnd_drag_end ( Ecore_Wl2_Input * input)

End a drag started by a call to ecore_wl2_dnd_drag_start.

Parameters
inputthe input object on which the drag was started
Since
1.17

References ecore_event_add(), ecore_wl2_dnd_drag_end(), and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ecore_wl2_dnd_drag_end().

◆ ecore_wl2_dnd_selection_get()

EAPI Ecore_Wl2_Offer * ecore_wl2_dnd_selection_get ( Ecore_Wl2_Input * input)

Get the offer which is currently resposible for the clipboard.

Parameters
inputthe input object to use
Since
1.19

References ecore_wl2_dnd_selection_get(), and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ecore_wl2_dnd_selection_get().

◆ ecore_wl2_dnd_selection_set()

EAPI uint32_t ecore_wl2_dnd_selection_set ( Ecore_Wl2_Input * input,
const char ** types )

Set the types which are available from this client Later the event ECORE_WL2_EVENT_DATA_SOURCE_SEND is emitted, where the caller of this api must write the data (encoded in the given mimetype) to the fd.

Parameters
inputthe input to provice this types on
typesa null-terminated array of mimetypes supported by the client
Returns
serial of request on success, 0 on failure
Since
1.17

References ecore_wl2_dnd_selection_set(), and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ecore_wl2_dnd_selection_set().

◆ ecore_wl2_dnd_selection_clear()

EAPI uint32_t ecore_wl2_dnd_selection_clear ( Ecore_Wl2_Input * input)

Clear the selection currently setted on this input.

Parameters
inputthe input to clear
Returns
serial of request on success, 0 on failure
Since
1.17

References ecore_wl2_dnd_selection_clear(), and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ecore_wl2_dnd_selection_clear().

◆ ecore_wl2_offer_actions_get()

EAPI Ecore_Wl2_Drag_Action ecore_wl2_offer_actions_get ( Ecore_Wl2_Offer * offer)

Get the actions available from the data source.

Parameters
offerOffer object to use
Returns
or´ed values from Ecore_Wl2_Drag_Action which are describing the available actions
Since
1.19

References ecore_wl2_offer_actions_get().

Referenced by ecore_wl2_offer_actions_get().

◆ ecore_wl2_offer_actions_set()

EAPI void ecore_wl2_offer_actions_set ( Ecore_Wl2_Offer * offer,
Ecore_Wl2_Drag_Action actions,
Ecore_Wl2_Drag_Action action )

Set the actions which are supported by you.

Parameters
offerOffer object to use
actionsA or´ed value of mutliple Ecore_Wl2_Drag_Action values
actionthe preferred action out of the actions
Since
1.19

References ecore_wl2_offer_actions_set(), and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ecore_wl2_offer_actions_set().

◆ ecore_wl2_offer_action_get()

EAPI Ecore_Wl2_Drag_Action ecore_wl2_offer_action_get ( Ecore_Wl2_Offer * offer)

Get action which is set by either the data source or in the last call of actions_set.

Parameters
offerOffer object to use
Returns
the preferred action
Since
1.19

References ecore_wl2_offer_action_get(), and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ecore_wl2_offer_action_get().

◆ ecore_wl2_offer_mimes_get()

EAPI Eina_Array * ecore_wl2_offer_mimes_get ( Ecore_Wl2_Offer * offer)

Get the mime types which are given by the source.

Parameters
offerthe offer to query
Returns
a eina array of strdup´ed strings, this array must NOT be changed or freed
Since
1.19

References ecore_wl2_offer_mimes_get(), and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ecore_wl2_offer_mimes_get().

◆ ecore_wl2_offer_mimes_set()

EAPI void ecore_wl2_offer_mimes_set ( Ecore_Wl2_Offer * offer,
Eina_Array * mimes )

Set mimetypes you are accepting under this offer.

Parameters
offerthe offer to use
Since
1.19

References ecore_wl2_offer_mimes_set(), and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ecore_wl2_offer_mimes_set().

◆ ecore_wl2_offer_accept()

EAPI void ecore_wl2_offer_accept ( Ecore_Wl2_Offer * offer,
const char * mime_type )

Accept a single mime type for an offer.

Parameters
offerthe offer to use
mime_typethe mime type
Since
1.20

References ecore_wl2_offer_accept(), and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ecore_wl2_offer_accept().

◆ ecore_wl2_offer_receive()

EAPI void ecore_wl2_offer_receive ( Ecore_Wl2_Offer * offer,
char * mime )

Request the data from this offer.

The event ECORE_WL2_EVENT_OFFER_DATA_READY is called when the data is available. There offer will be not destroyed as long as requested data is not emitted by the event.

Parameters
offerthe offer to use
mimethe mimetype to receive
Since
1.19

References ECORE_FD_ERROR, ECORE_FD_READ, ecore_main_fd_handler_file_add(), ecore_wl2_offer_receive(), eina_list_append(), and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ecore_wl2_offer_receive().

◆ ecore_wl2_offer_proxy_receive()

EAPI void ecore_wl2_offer_proxy_receive ( Ecore_Wl2_Offer * offer,
const char * mime,
int fd )

Request the data from this offer on an externally managed fd.

The event ECORE_WL2_EVENT_OFFER_DATA_READY is called when the data is available. There offer will be not destroyed as long as requested data is not emitted by the event.

Parameters
offerthe offer to use
mimethe mimetype to receive
fdthe fd to pass for receiving
Since
1.20

References ecore_wl2_offer_proxy_receive(), and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ecore_wl2_offer_proxy_receive().

◆ ecore_wl2_offer_proxy_receive_end()

EAPI void ecore_wl2_offer_proxy_receive_end ( Ecore_Wl2_Offer * offer)

End the use of a proxy received offer.

This may invalidate the offer object

Parameters
offerthe offer
Since
1.20

References ecore_wl2_offer_proxy_receive_end(), and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ecore_wl2_offer_proxy_receive_end().

◆ ecore_wl2_offer_supports_mime()

EAPI Eina_Bool ecore_wl2_offer_supports_mime ( Ecore_Wl2_Offer * offer,
const char * mime )

Check if the given offer supports the given mimetype.

Parameters
offerthe offer to use
mimethe mimetype to check
Returns
Returns true if the mimetype is supported by this offer, false if not
Since
1.19

References ecore_wl2_offer_supports_mime(), EINA_FALSE, and EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ecore_wl2_offer_supports_mime().

◆ ecore_wl2_offer_finish()

EAPI void ecore_wl2_offer_finish ( Ecore_Wl2_Offer * offer)

Mark this offer as finished This will call the dnd_finished event on the source of the sender.

Parameters
offerthe offer to use
Since
1.19

References ecore_wl2_offer_finish(), and EINA_SAFETY_ON_NULL_RETURN.

Referenced by ecore_wl2_offer_finish().