Functions
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. More...
 
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. More...
 
EAPI void ecore_wl2_dnd_set_actions (Ecore_Wl2_Input *input)
 Call wl_data_source.set_actions on an existing source. More...
 
EAPI void ecore_wl2_dnd_drag_end (Ecore_Wl2_Input *input)
 End a drag started by a call to ecore_wl2_dnd_drag_start. More...
 
EAPI Ecore_Wl2_Offer * ecore_wl2_dnd_selection_get (Ecore_Wl2_Input *input)
 Get the offer which is currently resposible for the clipboard. More...
 
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. More...
 
EAPI uint32_t ecore_wl2_dnd_selection_clear (Ecore_Wl2_Input *input)
 Clear the selection currently setted on this input. More...
 
EAPI Ecore_Wl2_Drag_Action ecore_wl2_offer_actions_get (Ecore_Wl2_Offer *offer)
 Get the actions available from the data source. More...
 
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. More...
 
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. More...
 
EAPI Eina_Arrayecore_wl2_offer_mimes_get (Ecore_Wl2_Offer *offer)
 Get the mime types which are given by the source. More...
 
EAPI void ecore_wl2_offer_mimes_set (Ecore_Wl2_Offer *offer, Eina_Array *mimes)
 Set mimetypes you are accepting under this offer. More...
 
EAPI void ecore_wl2_offer_accept (Ecore_Wl2_Offer *offer, const char *mime_type)
 Accept a single mime type for an offer. More...
 
EAPI void ecore_wl2_offer_receive (Ecore_Wl2_Offer *offer, char *mime)
 Request the data from this offer. More...
 
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. More...
 
EAPI void ecore_wl2_offer_proxy_receive_end (Ecore_Wl2_Offer *offer)
 End the use of a proxy received offer. More...
 
EAPI Eina_Bool ecore_wl2_offer_supports_mime (Ecore_Wl2_Offer *offer, const char *mime)
 Check if the given offer supports the given mimetype. More...
 
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. More...
 

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 EINA_SAFETY_ON_NULL_RETURN, and ERR.

◆ 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_input_cursor_from_name_set(), ecore_wl2_window_surface_get(), and EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ 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 EINA_SAFETY_ON_NULL_RETURN.

◆ 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_EVENT_DND_END, and EINA_SAFETY_ON_NULL_RETURN.

◆ 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 EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ 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 EINA_SAFETY_ON_NULL_RETURN_VAL, and ERR.

◆ 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 EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ 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

◆ 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 EINA_SAFETY_ON_NULL_RETURN.

◆ 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 EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ 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 EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ 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 eina_array_foreach(), and EINA_SAFETY_ON_NULL_RETURN.

◆ 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 EINA_SAFETY_ON_NULL_RETURN.

◆ 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(), eina_list_append(), EINA_SAFETY_ON_NULL_RETURN, and ERR.

◆ 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 EINA_SAFETY_ON_NULL_RETURN.

◆ 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 EINA_SAFETY_ON_NULL_RETURN.

◆ 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 eina_array_foreach(), EINA_FALSE, and EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ 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 EINA_SAFETY_ON_NULL_RETURN.