devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e44f85cc3c8487e883397ec049d6ed244b08cc97
commit e44f85cc3c8487e883397ec049d6ed244b08cc97 Author: Chris Michael <cp.mich...@samsung.com> Date: Tue Sep 29 12:16:58 2015 -0400 ecore-wl2: Add API function to return if a dnd selection exists Signed-off-by: Chris Michael <cp.mich...@samsung.com> --- src/lib/ecore_wl2/Ecore_Wl2.h | 3 +++ src/lib/ecore_wl2/ecore_wl2_dnd.c | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/lib/ecore_wl2/Ecore_Wl2.h b/src/lib/ecore_wl2/Ecore_Wl2.h index f2ca6e8..e5895fc 100644 --- a/src/lib/ecore_wl2/Ecore_Wl2.h +++ b/src/lib/ecore_wl2/Ecore_Wl2.h @@ -499,6 +499,9 @@ EAPI Eina_Bool ecore_wl2_dnd_selection_owner_has(Ecore_Wl2_Input *input); /* TODO: doxy */ EAPI Eina_Bool ecore_wl2_dnd_selection_set(Ecore_Wl2_Input *input, const char **types); +/* TODO: doxy */ +EAPI Eina_Bool ecore_wl2_dnd_selection_get(Ecore_Wl2_Input *input, const char *type); + /* # ifdef __cplusplus */ /* } */ /* # endif */ diff --git a/src/lib/ecore_wl2/ecore_wl2_dnd.c b/src/lib/ecore_wl2/ecore_wl2_dnd.c index 7855bd5..59481ae 100644 --- a/src/lib/ecore_wl2/ecore_wl2_dnd.c +++ b/src/lib/ecore_wl2/ecore_wl2_dnd.c @@ -366,3 +366,21 @@ ecore_wl2_dnd_selection_set(Ecore_Wl2_Input *input, const char **types) return EINA_TRUE; } + +EAPI Eina_Bool +ecore_wl2_dnd_selection_get(Ecore_Wl2_Input *input, const char *type) +{ + char **t; + + EINA_SAFETY_ON_NULL_RETURN_VAL(input, EINA_FALSE); + EINA_SAFETY_ON_NULL_RETURN_VAL(input->selection.source, EINA_FALSE); + + for (t = input->selection.source->types.data; *t; t++) + if (!strcmp(type, *t)) break; + + if (!*t) return EINA_FALSE; + + /* TODO: selection_data_receive */ + + return EINA_TRUE; +} --