Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src


Modified Files:
        ewl_button.c ewl_check.c ewl_events.c ewl_row.c ewl_tree.c 
        ewl_widget.c ewl_widget.h 


Log Message:
Renamed an appearance related function to more accurately reflect how the
themes work. Made the event handling more robust for parent notification, and
added a pulsing button.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_button.c,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -3 -r1.44 -r1.45
--- ewl_button.c        15 Jul 2003 22:03:25 -0000      1.44
+++ ewl_button.c        16 Jul 2003 20:31:19 -0000      1.45
@@ -50,8 +50,6 @@
        ewl_container_notify_callback(EWL_CONTAINER(b),
                        EWL_CALLBACK_MOUSE_UP);
        ewl_container_notify_callback(EWL_CONTAINER(b),
-                       EWL_CALLBACK_MOUSE_MOVE);
-       ewl_container_notify_callback(EWL_CONTAINER(b),
                        EWL_CALLBACK_CLICKED);
 
        /*
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_check.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ewl_check.c 14 Jan 2003 21:44:58 -0000      1.4
+++ ewl_check.c 16 Jul 2003 20:31:20 -0000      1.5
@@ -126,9 +126,9 @@
        cb = EWL_CHECK(w);
 
        if (cb->checked)
-               ewl_widget_update_appearance(w, "checked");
+               ewl_widget_set_state(w, "checked");
        else
-               ewl_widget_update_appearance(w, "normal");
+               ewl_widget_set_state(w, "normal");
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_events.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -3 -r1.35 -r1.36
--- ewl_events.c        15 Jul 2003 22:00:17 -0000      1.35
+++ ewl_events.c        16 Jul 2003 20:31:20 -0000      1.36
@@ -232,6 +232,7 @@
 int ewl_ev_mouse_down(void *data, int type, void *_ev)
 {
        Ewl_Widget     *widget = NULL;
+       Ewl_Widget     *temp = NULL;
        Ewl_Embed      *embed;
        Ecore_X_Event_Mouse_Button_Down *ev;
 
@@ -265,12 +266,16 @@
 
        /*
         * While the mouse is down the widget has a pressed state, the widget
-        * is notified in this change of state.
+        * and its parents are notified in this change of state.
         */
-       if (widget && !(widget->state & EWL_STATE_DISABLED)) {
-               widget->state |= EWL_STATE_PRESSED;
-               ewl_callback_call_with_event_data(widget,
-                                                 EWL_CALLBACK_MOUSE_DOWN, ev);
+       temp = widget;
+       while (temp) {
+               if (!(widget->state & EWL_STATE_DISABLED)) {
+                       temp->state |= EWL_STATE_PRESSED;
+                       ewl_callback_call_with_event_data(temp,
+                                       EWL_CALLBACK_MOUSE_DOWN, ev);
+               }
+               temp = temp->parent;
        }
 
        /*
@@ -291,6 +296,7 @@
  */
 int ewl_ev_mouse_up(void *data, int type, void *_ev)
 {
+       Ewl_Widget     *temp;
        Ewl_Embed      *embed;
        Ecore_X_Event_Mouse_Button_Up *ev;
 
@@ -302,10 +308,19 @@
        if (!embed)
                DRETURN_INT(TRUE, DLEVEL_STABLE);
 
-       if (last_selected && !(last_selected->state & EWL_STATE_DISABLED)) {
-               last_selected->state &= ~EWL_STATE_PRESSED;
-               ewl_callback_call_with_event_data(last_selected,
-                                                 EWL_CALLBACK_MOUSE_UP, ev);
+       /*
+        * When the mouse is released the widget no longer has a pressed state,
+        * the widget and its parents are notified in this change of state.
+        */
+       temp = last_selected;
+       while (temp) {
+               if (!(last_selected->state & EWL_STATE_DISABLED)) {
+                       temp->state &= ~EWL_STATE_PRESSED;
+                       ewl_callback_call_with_event_data(temp,
+                                       EWL_CALLBACK_MOUSE_UP, ev);
+               }
+
+               temp = temp->parent;
        }
 
        DRETURN_INT(TRUE, DLEVEL_STABLE);
@@ -347,14 +362,31 @@
                last_focused = last_focused->parent;
        }
 
-       if (widget && !(widget->state & (EWL_STATE_DISABLED | EWL_STATE_HILITED))) {
-               widget->state |= EWL_STATE_HILITED;
-               ewl_callback_call(widget, EWL_CALLBACK_FOCUS_IN);
-
-               ewl_callback_call_with_event_data(widget,
-                                                 EWL_CALLBACK_MOUSE_MOVE, ev);
-               last_focused = widget;
+       /*
+        * Pass out the movement event up the chain, allows parents to
+        * react to mouse movement in their children.
+        */
+       last_focused = widget;
+       while (last_focused) {
+
+               if (!(last_focused->state & EWL_STATE_DISABLED)) {
+
+                       /*
+                        * First mouse move event in a widget marks it focused.
+                        */
+                       if (!(last_focused->state & EWL_STATE_HILITED)) {
+                               last_focused->state |= EWL_STATE_HILITED;
+                               ewl_callback_call(last_focused,
+                                               EWL_CALLBACK_FOCUS_IN);
+                       }
+
+                       ewl_callback_call_with_event_data(last_focused,
+                                       EWL_CALLBACK_MOUSE_MOVE, ev);
+               }
+               last_focused = last_focused->parent;
        }
+
+       last_focused = widget;
 
        if (dnd_widget && dnd_widget->state & EWL_STATE_DND)
                ewl_callback_call_with_event_data(dnd_widget,
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_row.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- ewl_row.c   28 Jun 2003 06:50:32 -0000      1.11
+++ ewl_row.c   16 Jul 2003 20:31:20 -0000      1.12
@@ -100,11 +100,15 @@
 Ewl_Widget *
 ewl_row_get_column(Ewl_Row *row, short n)
 {
+       Ewl_Widget *found;
+
        DENTER_FUNCTION(DLEVEL_STABLE);
 
        DCHECK_PARAM_PTR_RET("row", row, NULL);
 
-       DLEAVE_FUNCTION(DLEVEL_STABLE);
+       found = ewd_list_goto_index(EWL_CONTAINER(row)->children, n + 1);
+
+       DRETURN_PTR(found, DLEVEL_STABLE);
 }
 
 static void
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_tree.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- ewl_tree.c  28 Jun 2003 06:50:32 -0000      1.14
+++ ewl_tree.c  16 Jul 2003 20:31:20 -0000      1.15
@@ -605,9 +605,9 @@
 
        node = EWL_TREE_NODE(w);
        if (node->expanded)
-               ewl_widget_update_appearance(w, "expanded");
+               ewl_widget_set_state(w, "expanded");
        else
-               ewl_widget_update_appearance(w, "collapsed");
+               ewl_widget_set_state(w, "collapsed");
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_widget.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -3 -r1.61 -r1.62
--- ewl_widget.c        15 Jul 2003 16:46:42 -0000      1.61
+++ ewl_widget.c        16 Jul 2003 20:31:20 -0000      1.62
@@ -414,14 +414,14 @@
 }
 
 /**
- * ewl_widget_update_appearance - update the appearance of the widget to a state
+ * ewl_widget_set_state - update the appearance of the widget to a state
  * @w: the widget to update the appearance
  * @state: the new state of the widget
  *
  * Returns no value. Changes the appearance of the widget @w depending on the
  * state string passed by @state.
  */
-void ewl_widget_update_appearance(Ewl_Widget * w, char *state)
+void ewl_widget_set_state(Ewl_Widget * w, char *state)
 {
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("w", w);
@@ -889,7 +889,7 @@
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("w", w);
 
-       ewl_widget_update_appearance(w, "normal");
+       ewl_widget_set_state(w, "normal");
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
@@ -899,7 +899,7 @@
        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR("w", w);
 
-       ewl_widget_update_appearance(w, "disabled");
+       ewl_widget_set_state(w, "disabled");
 
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
@@ -911,9 +911,9 @@
                DRETURN(DLEVEL_STABLE);
 
        if (w->state & EWL_STATE_PRESSED)
-               ewl_widget_update_appearance(w, "clicked");
+               ewl_widget_set_state(w, "clicked");
        else
-               ewl_widget_update_appearance(w, "hilited");
+               ewl_widget_set_state(w, "hilited");
 }
 
 static void
@@ -922,7 +922,7 @@
        if (w->state & EWL_STATE_DISABLED)
                DRETURN(DLEVEL_STABLE);
 
-       ewl_widget_update_appearance(w, "normal");
+       ewl_widget_set_state(w, "normal");
 }
 
 static void
@@ -931,7 +931,7 @@
        if (w->state & EWL_STATE_DISABLED)
                DRETURN(DLEVEL_STABLE);
 
-       ewl_widget_update_appearance(w, "clicked");
+       ewl_widget_set_state(w, "clicked");
 }
 
 static void
@@ -941,10 +941,10 @@
                DRETURN(DLEVEL_STABLE);
 
        if (w->state & EWL_STATE_HILITED) {
-               ewl_widget_update_appearance(w, "hilited");
+               ewl_widget_set_state(w, "hilited");
                ewl_callback_call(w, EWL_CALLBACK_CLICKED);
        } else
-               ewl_widget_update_appearance(w, "normal");
+               ewl_widget_set_state(w, "normal");
 }
 
 static inline void __ewl_widget_theme_destroy(Ewl_Widget *w)
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_widget.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- ewl_widget.h        13 Jul 2003 05:52:49 -0000      1.28
+++ ewl_widget.h        16 Jul 2003 20:31:20 -0000      1.29
@@ -109,7 +109,7 @@
 /*
  * Change the appearance of a widget based on a state string.
  */
-void            ewl_widget_update_appearance(Ewl_Widget * w, char *state);
+void            ewl_widget_set_state(Ewl_Widget * w, char *state);
 
 /*
  * Change the appearance string used for determining the correct theme data.




-------------------------------------------------------
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