ecore-wl2: add function for setting a drag source's actions without a drag

in some cases it may be desired to have a drag data source without ever
initiating a drag, so ensure that it's possible to set the actions of the
source which will be passed for drag operations in this case

@feature
This commit is contained in:
Mike Blumenkrantz 2017-05-12 12:08:32 -04:00
parent f6964f50e3
commit 8afdbaba48
2 changed files with 21 additions and 0 deletions

View File

@ -1086,6 +1086,16 @@ EAPI void ecore_wl2_dnd_drag_types_set(Ecore_Wl2_Input *input, const char **type
*/
EAPI uint32_t ecore_wl2_dnd_drag_start(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, Ecore_Wl2_Window *drag_window);
/**
* Call wl_data_source.set_actions on an existing source
*
* @param input the input to use
*
* @see ecore_wl2_dnd_drag_start for a more useful function.
*
* @since 1.20
*/
EAPI EAPI void ecore_wl2_dnd_set_actions(Ecore_Wl2_Input *input);
/**
* End a drag started by a call to ecore_wl2_dnd_drag_start
*

View File

@ -490,6 +490,17 @@ ecore_wl2_dnd_drag_start(Ecore_Wl2_Input *input, Ecore_Wl2_Window *window, Ecore
return input->data.drag.serial;
}
EAPI void
ecore_wl2_dnd_set_actions(Ecore_Wl2_Input *input)
{
EINA_SAFETY_ON_NULL_RETURN(input);
EINA_SAFETY_ON_NULL_RETURN(input->data.drag.source);
EINA_SAFETY_ON_NULL_RETURN(input->data.drag.types.data);
if (input->display->wl.data_device_manager_version >= WL_DATA_SOURCE_SET_ACTIONS_SINCE_VERSION)
wl_data_source_set_actions(input->data.drag.source,
WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE | WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY);
}
EAPI void
ecore_wl2_dnd_drag_end(Ecore_Wl2_Input *input)
{