discomfitor pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=8afdbaba48ceaf2605d9034ea732da918ac3d496

commit 8afdbaba48ceaf2605d9034ea732da918ac3d496
Author: Mike Blumenkrantz <zm...@osg.samsung.com>
Date:   Fri May 12 12:08:32 2017 -0400

    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
---
 src/lib/ecore_wl2/Ecore_Wl2.h     | 10 ++++++++++
 src/lib/ecore_wl2/ecore_wl2_dnd.c | 11 +++++++++++
 2 files changed, 21 insertions(+)

diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index 79cd8e5..e791ef8 100644
--- a/src/lib/ecore_wl2/Ecore_Wl2.h
+++ b/src/lib/ecore_wl2/Ecore_Wl2.h
@@ -1087,6 +1087,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
  *
  * @param input the input object on which the drag was started
diff --git a/src/lib/ecore_wl2/ecore_wl2_dnd.c 
b/src/lib/ecore_wl2/ecore_wl2_dnd.c
index e64fb21..e7c8da8 100644
--- a/src/lib/ecore_wl2/ecore_wl2_dnd.c
+++ b/src/lib/ecore_wl2/ecore_wl2_dnd.c
@@ -491,6 +491,17 @@ ecore_wl2_dnd_drag_start(Ecore_Wl2_Input *input, 
Ecore_Wl2_Window *window, Ecore
 }
 
 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)
 {
    Ecore_Wl2_Event_Dnd_End *ev;

-- 


Reply via email to