Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src


Modified Files:
        ewl_button.c ewl_events.c 


Log Message:
Move the last of the events to the model of bottom-up notification. This also
allows for catching key events of children, so keybindings should be easier.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_button.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -3 -r1.45 -r1.46
--- ewl_button.c        16 Jul 2003 20:31:19 -0000      1.45
+++ ewl_button.c        16 Jul 2003 21:05:22 -0000      1.46
@@ -42,17 +42,6 @@
        ewl_widget_set_appearance(w, "button");
 
        /*
-        * FIXME: Should we really do this? Might be better to just trigger
-        * mouse down for all enclosing containers.
-        */
-       ewl_container_notify_callback(EWL_CONTAINER(b),
-                       EWL_CALLBACK_MOUSE_DOWN);
-       ewl_container_notify_callback(EWL_CONTAINER(b),
-                       EWL_CALLBACK_MOUSE_UP);
-       ewl_container_notify_callback(EWL_CONTAINER(b),
-                       EWL_CALLBACK_CLICKED);
-
-       /*
         * Create and setup the label for the button if it's desired.
         */
        if (label) {
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_events.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- ewl_events.c        16 Jul 2003 20:31:20 -0000      1.36
+++ ewl_events.c        16 Jul 2003 21:05:22 -0000      1.37
@@ -154,10 +154,7 @@
  */
 int ewl_ev_key_down(void *data, int type, void *_ev)
 {
-       /*
-        * Dispatcher of key down events, these get sent to the last widget
-        * selected.
-        */
+       Ewl_Widget     *temp;
        Ewl_Embed      *embed;
        Ecore_X_Event_Key_Down *ev;
 
@@ -174,14 +171,21 @@
         * If a widget has been selected then we send the keystroke to the
         * appropriate widget.
         */
-       if (last_selected) {
-               ewl_callback_call_with_event_data(last_selected,
-                                                 EWL_CALLBACK_KEY_DOWN, ev);
+       if (last_selected)
                last_key = last_selected;
-       } else {
-               ewl_callback_call_with_event_data(EWL_WIDGET(embed),
-                                                 EWL_CALLBACK_KEY_DOWN, ev);
+       else
                last_key = EWL_WIDGET(embed);
+
+       /*
+        * Dispatcher of key down events, these get sent to the last widget
+        * selected, and every parent above it.
+        */
+       temp = last_key;
+       while (temp) {
+               if (!(temp->state & EWL_STATE_DISABLED))
+                       ewl_callback_call_with_event_data(temp,
+                                       EWL_CALLBACK_KEY_DOWN, ev);
+               temp = temp->parent;
        }
 
        DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -412,9 +416,9 @@
 {
        DENTER_FUNCTION(DLEVEL_STABLE);
 
-       if (last_focused) {
+       while (last_focused) {
                ewl_callback_call(last_focused, EWL_CALLBACK_FOCUS_OUT);
-               last_focused = NULL;
+               last_focused = last_focused->parent;
        }
 
        DRETURN_INT(TRUE, DLEVEL_STABLE);




-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to