summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2017-05-12 12:08:32 -0400
committerMike Blumenkrantz <zmike@osg.samsung.com>2017-05-12 12:08:25 -0400
commit8afdbaba48ceaf2605d9034ea732da918ac3d496 (patch)
treec6e347163e1c0f31c56270dfd5ef0c082e6671f4
parentf6964f50e3ed0da6ee853a57ca7e82181021112b (diff)
downloadefl-8afdbaba48ceaf2605d9034ea732da918ac3d496.tar.gz
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
-rw-r--r--src/lib/ecore_wl2/Ecore_Wl2.h10
-rw-r--r--src/lib/ecore_wl2/ecore_wl2_dnd.c11
2 files changed, 21 insertions, 0 deletions
diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h
index 79cd8e5f67..e791ef85c3 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 e64fb21242..e7c8da8661 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;