devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=59710fadbdca435a822dd5638cb963aa6a57330b

commit 59710fadbdca435a822dd5638cb963aa6a57330b
Author: vivek <[email protected]>
Date:   Fri Sep 19 09:04:49 2014 -0400

    Ecore_Wayland: Raise a event when data source target accepts events
    
    Summary:
       1) Added data source target struct for target event
       2) Raise a event when data source target accepts pointer focus or
          motion events
    
    Signed-off-by: vivek <[email protected]>
    
    Reviewers: devilhorns
    
    Subscribers: cedric
    
    Differential Revision: https://phab.enlightenment.org/D1466
---
 src/lib/ecore_wayland/Ecore_Wayland.h |  7 +++++++
 src/lib/ecore_wayland/ecore_wl_dnd.c  | 23 ++++++++++++++++++++++-
 2 files changed, 29 insertions(+), 1 deletion(-)

diff --git a/src/lib/ecore_wayland/Ecore_Wayland.h 
b/src/lib/ecore_wayland/Ecore_Wayland.h
index 455f0a7..7e87a14 100644
--- a/src/lib/ecore_wayland/Ecore_Wayland.h
+++ b/src/lib/ecore_wayland/Ecore_Wayland.h
@@ -61,6 +61,7 @@ typedef struct _Ecore_Wl_Event_Dnd_Drop 
Ecore_Wl_Event_Dnd_Drop;
 typedef struct _Ecore_Wl_Event_Dnd_End Ecore_Wl_Event_Dnd_End;
 typedef struct _Ecore_Wl_Event_Data_Source_Cancelled 
Ecore_Wl_Event_Data_Source_Cancelled; /** @since 1.12 */
 typedef struct _Ecore_Wl_Event_Data_Source_Send 
Ecore_Wl_Event_Data_Source_Send; /** @since 1.7 */
+typedef struct _Ecore_Wl_Event_Data_Source_Target  
Ecore_Wl_Event_Data_Source_Target; /** @since 1.12 */
 typedef struct _Ecore_Wl_Event_Selection_Data_Ready 
Ecore_Wl_Event_Selection_Data_Ready; /** @since 1.7 */
 typedef struct _Ecore_Wl_Event_Interfaces_Bound 
Ecore_Wl_Event_Interfaces_Bound;
 
@@ -197,6 +198,12 @@ struct _Ecore_Wl_Event_Data_Source_Send
    int fd;
 };
 
+/** @since 1.12 */
+struct _Ecore_Wl_Event_Data_Source_Target
+{
+   char *type;
+};
+
 /** @since 1.7 */
 struct _Ecore_Wl_Event_Selection_Data_Ready
 {
diff --git a/src/lib/ecore_wayland/ecore_wl_dnd.c 
b/src/lib/ecore_wayland/ecore_wl_dnd.c
index c816e9d..ad28e7c 100644
--- a/src/lib/ecore_wayland/ecore_wl_dnd.c
+++ b/src/lib/ecore_wayland/ecore_wl_dnd.c
@@ -26,6 +26,7 @@ static void _ecore_wl_dnd_selection_data_ready_cb_free(void 
*data EINA_UNUSED, v
 static Eina_Bool _ecore_wl_dnd_selection_cb_idle(void *data);
 
 static void _ecore_wl_dnd_source_cb_target(void *data, struct wl_data_source 
*source EINA_UNUSED, const char *mime_type EINA_UNUSED);
+static void _ecore_wl_dnd_source_cb_target_free(void *data EINA_UNUSED, void 
*event);
 static void _ecore_wl_dnd_source_cb_send(void *data, struct wl_data_source 
*source EINA_UNUSED, const char *mime_type, int32_t fd);
 static void _ecore_wl_dnd_source_cb_send_free(void *data EINA_UNUSED, void 
*event);
 static void _ecore_wl_dnd_source_cb_cancelled(void *data EINA_UNUSED, struct 
wl_data_source *source);
@@ -724,11 +725,31 @@ _ecore_wl_dnd_selection_cb_idle(void *data)
 static void 
 _ecore_wl_dnd_source_cb_target(void *data, struct wl_data_source *source 
EINA_UNUSED, const char *mime_type EINA_UNUSED)
 {
+   Ecore_Wl_Event_Data_Source_Target *event;
    Ecore_Wl_Input *input;
 
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
    if (!(input = data)) return;
 
-   printf("Dnd Source Target\n");
+   if (!(event = calloc(1, sizeof(Ecore_Wl_Event_Data_Source_Target)))) return;
+
+   event->type = strdup(mime_type);
+
+   ecore_event_add(ECORE_WL_EVENT_DATA_SOURCE_TARGET, event,
+                   _ecore_wl_dnd_source_cb_target_free, NULL);
+}
+
+static void
+_ecore_wl_dnd_source_cb_target_free(void *data EINA_UNUSED, void *event)
+{
+   Ecore_Wl_Event_Data_Source_Target *ev;
+
+   LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+   if (!(ev = event)) return;
+
+   free(ev->type);
+   free(ev);
 }
 
 static void 

-- 


Reply via email to