Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_embed.c ewl_events.c 


Log Message:
Trigger mouse up on window focus out.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_embed.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- ewl_embed.c 5 Jan 2006 23:07:36 -0000       1.39
+++ ewl_embed.c 7 Jan 2006 05:26:49 -0000       1.40
@@ -105,6 +105,8 @@
                             ewl_embed_destroy_cb, NULL);
        ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_CONFIGURE,
                             ewl_embed_configure_cb, NULL);
+       ewl_callback_prepend(EWL_WIDGET(w), EWL_CALLBACK_FOCUS_OUT,
+                            ewl_embed_focus_out_cb, NULL);
 
        w->max_layer = LAYER(w) = -1000;
 
@@ -1542,6 +1544,28 @@
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
+void
+ewl_embed_focus_out_cb(Ewl_Widget *w, void *ev_data __UNUSED__,
+                                       void *user_data __UNUSED__)
+{
+       Ewl_Embed *emb;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("w", w);
+       DCHECK_TYPE("w", w, "widget");
+
+       emb = EWL_EMBED(w);
+       if (!emb->last.focused)
+               DRETURN(DLEVEL_STABLE);
+
+       if (ewl_object_state_has(EWL_OBJECT(emb->last.focused),
+                               EWL_FLAG_STATE_PRESSED)) {
+               ewl_embed_mouse_up_feed(emb, 1, 0, 0, ewl_ev_modifiers_get());
+       }
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
 void ewl_embed_destroy_cb(Ewl_Widget *w, void *ev_data __UNUSED__, 
                                        void *user_data __UNUSED__)
 {
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_events.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- ewl_events.c        29 Dec 2005 19:37:43 -0000      1.16
+++ ewl_events.c        7 Jan 2006 05:26:49 -0000       1.17
@@ -18,6 +18,8 @@
 int ewl_ev_x_mouse_up(void *data, int type, void *_ev);
 int ewl_ev_x_mouse_move(void *data, int type, void *_ev);
 int ewl_ev_x_mouse_out(void *data, int type, void *_ev);
+int ewl_ev_x_focus_in(void *data, int type, void *_ev);
+int ewl_ev_x_focus_out(void *data, int type, void *_ev);
 int ewl_ev_x_paste(void *data, int type, void *_ev);
 
 int ewl_ev_dnd_position(void *data, int type, void *_ev);
@@ -95,6 +97,10 @@
                                        ewl_ev_x_mouse_wheel, NULL);
                ecore_event_handler_add(ECORE_X_EVENT_MOUSE_OUT,
                                        ewl_ev_x_mouse_out, NULL);
+               ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_IN,
+                                       ewl_ev_x_focus_in, NULL);
+               ecore_event_handler_add(ECORE_X_EVENT_WINDOW_FOCUS_OUT,
+                                       ewl_ev_x_focus_out, NULL);
 
                /*
                 * Selection callbacks to allow for pasting.
@@ -506,6 +512,58 @@
 /**
  * @param data: user specified data passed to the function
  * @param type: the type of event triggering the function call
+ * @param e: the focus in event information
+ * @return Returns no value.
+ * @brief Handles the focus in events in windows
+ *
+ * Dispatches the focus in event to the appropriate ewl window.
+ */
+int
+ewl_ev_x_focus_in(void *data __UNUSED__, int type __UNUSED__, void *e)
+{
+       Ewl_Embed *embed;
+       Ecore_X_Event_Window_Focus_In *ev = e;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+
+       embed = ewl_embed_evas_window_find((void *)ev->win);
+       if (!embed)
+               DRETURN_INT(TRUE, DLEVEL_STABLE);
+
+       ewl_callback_call(EWL_WIDGET(embed), EWL_CALLBACK_FOCUS_OUT);
+
+       DRETURN_INT(TRUE, DLEVEL_STABLE);
+}
+
+/**
+ * @param data: user specified data passed to the function
+ * @param type: the type of event triggering the function call
+ * @param e: the focus out event information
+ * @return Returns no value.
+ * @brief Handles the focus out events in windows
+ *
+ * Dispatches the focus out event to the appropriate ewl window.
+ */
+int
+ewl_ev_x_focus_out(void *data __UNUSED__, int type __UNUSED__, void *e)
+{
+       Ewl_Embed *embed;
+       Ecore_X_Event_Window_Focus_Out *ev = e;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+
+       embed = ewl_embed_evas_window_find((void *)ev->win);
+       if (!embed)
+               DRETURN_INT(TRUE, DLEVEL_STABLE);
+
+       ewl_callback_call(EWL_WIDGET(embed), EWL_CALLBACK_FOCUS_OUT);
+
+       DRETURN_INT(TRUE, DLEVEL_STABLE);
+}
+
+/**
+ * @param data: user specified data passed to the function
+ * @param type: the type of event triggering the function call
  * @param e: the mouse out event information
  * @return Returns no value.
  * @brief Handles the data for a paste becoming available in windows




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to