Wayland Library Drag-n-Drop Functions

Functions
Wayland Library Drag-n-Drop Functions
Ecore » Ecore_Wl2 - Wayland integration

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_Array * | ecore_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

  input | the input where to add on the data source
  types | a 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

  input | the input to use
  window | the window which is the origin of the drag operation
  drag_window | the 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

  input | the 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

  input | the 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

  input | the 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

  input | the input to provice this types on
  types | a 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

  input | the 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

  offer | Offer 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

  offer | Offer object to use
  actions | A or´ed value of mutliple Ecore_Wl2_Drag_Action values
  action | the 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

  offer | Offer 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

  offer | the 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

  offer | the 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

  offer | the offer to use
  mime_type | the 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

  offer | the offer to use
  mime | the 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

  offer | the offer to use
  mime | the mimetype to receive
  fd | the 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

  offer | the 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

  offer | the offer to use
  mime | the 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

  offer | the offer to use

Since
  1.19

References EINA_SAFETY_ON_NULL_RETURN.