Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_embed.c ewl_enums.h ewl_widget.c ewl_widget.h 


Log Message:
- send a unfocused/focused signal as focus changes on widgets
- add the ability for a widget to make itself as consuming the focus keys

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_embed.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- ewl_embed.c 17 Oct 2005 04:21:15 -0000      1.11
+++ ewl_embed.c 20 Oct 2005 04:33:47 -0000      1.12
@@ -945,8 +945,14 @@
        DCHECK_PARAM_PTR("embed", embed);
        DCHECK_PARAM_PTR("w", w);
 
+       if (embed->last.focused)
+               ewl_widget_state_set(embed->last.focused, "unfocused");
+
        embed->last.focused = w;
 
+       if (embed->last.focused)
+               ewl_widget_state_set(embed->last.focused, "focused");
+
        DLEAVE_FUNCTION(DLEVEL_STABLE);
 }
 
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_enums.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- ewl_enums.h 14 Oct 2005 03:18:19 -0000      1.15
+++ ewl_enums.h 20 Oct 2005 04:33:47 -0000      1.16
@@ -125,30 +125,29 @@
        EWL_FLAG_PROPERTY_RECURSIVE = 0x1000,
        EWL_FLAG_PROPERTY_TOPLEVEL = 0x2000,
        EWL_FLAG_PROPERTY_INTERNAL = 0x4000,
+       EWL_FLAG_PROPERTY_BLOCK_TAB_FOCUS = 0x8000,
 
        /*
         * Flags to indicate queues this object is on.
         */
-       EWL_FLAG_QUEUED_CSCHEDULED = 0x8000,
-       EWL_FLAG_QUEUED_RSCHEDULED = 0x10000,
-       EWL_FLAG_QUEUED_DSCHEDULED = 0x20000,
-
-       EWL_FLAG_QUEUED_CPROCESS = 0x40000,
-       EWL_FLAG_QUEUED_RPROCESS = 0x80000,
-       EWL_FLAG_QUEUED_DPROCESS = 0x100000,
+       EWL_FLAG_QUEUED_CSCHEDULED = 0x10000,
+       EWL_FLAG_QUEUED_RSCHEDULED = 0x20000,
+       EWL_FLAG_QUEUED_DSCHEDULED = 0x40000,
+
+       EWL_FLAG_QUEUED_CPROCESS = 0x80000,
+       EWL_FLAG_QUEUED_RPROCESS = 0x100000,
+       EWL_FLAG_QUEUED_DPROCESS = 0x200000,
 
        /*
         * The state enum specifies the current state of a widget, ie. has it
         * been clicked, does it have the keyboard focus, etc.
         */
        EWL_FLAG_STATE_NORMAL = 0,
-       EWL_FLAG_STATE_HILITED = 0x200000,
-       EWL_FLAG_STATE_PRESSED = 0x400000,
-       EWL_FLAG_STATE_SELECTED = 0x8000000,
-       EWL_FLAG_STATE_DND = 0x1000000,
-       EWL_FLAG_STATE_DISABLED = 0x2000000,
-
-       EWL_FLAG_STOP_TAB_FOCUS_CHANGE = 0x4000000 
+       EWL_FLAG_STATE_HILITED = 0x400000,
+       EWL_FLAG_STATE_PRESSED = 0x800000,
+       EWL_FLAG_STATE_SELECTED = 0x10000000,
+       EWL_FLAG_STATE_DND = 0x2000000,
+       EWL_FLAG_STATE_DISABLED = 0x4000000,
 };
 
 #define EWL_FLAG_FILL_NORMAL (EWL_FLAG_FILL_FILL)
@@ -165,7 +164,8 @@
                EWL_FLAG_VISIBLE_OBSCURED | EWL_FLAG_VISIBLE_NOCLIP)
 
 #define  EWL_FLAGS_PROPERTY_MASK (EWL_FLAG_PROPERTY_RECURSIVE | \
-               EWL_FLAG_PROPERTY_TOPLEVEL | EWL_FLAG_PROPERTY_INTERNAL)
+               EWL_FLAG_PROPERTY_TOPLEVEL | EWL_FLAG_PROPERTY_INTERNAL | \
+               EWL_FLAG_PROPERTY_BLOCK_TAB_FOCUS)
 
 #define  EWL_FLAGS_QUEUED_MASK (EWL_FLAG_QUEUED_CSCHEDULED | \
                EWL_FLAG_QUEUED_RSCHEDULED | EWL_FLAG_QUEUED_DSCHEDULED | \
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_widget.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -3 -r1.26 -r1.27
--- ewl_widget.c        17 Oct 2005 15:29:35 -0000      1.26
+++ ewl_widget.c        20 Oct 2005 04:33:47 -0000      1.27
@@ -983,6 +983,65 @@
 }
 
 /**
+ * @param w: The widget to remove from the tab order
+ * @return Returns no value.
+ */
+void ewl_widget_tab_order_remove(Ewl_Widget *w)
+{
+       Ewl_Embed *emb;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("w", w);
+
+       emb = ewl_embed_widget_find(w);
+       ewl_embed_tab_order_remove(emb, w);
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @param w: The widget to set if it accepts or blocks focus changes
+ * @param val: TRUE or FALSE on if this widget blocks tabbing off
+ * @return Returns no value.
+ */
+void
+ewl_widget_ignore_focus_change_set(Ewl_Widget *w, unsigned int val)
+{
+       unsigned int f;
+
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR("w", w);
+
+       if (val)
+               ewl_object_flags_add(EWL_OBJECT(w), 
+                               EWL_FLAG_PROPERTY_BLOCK_TAB_FOCUS,
+                               EWL_FLAGS_PROPERTY_MASK);
+       else
+               ewl_object_flags_remove(EWL_OBJECT(w),
+                               EWL_FLAG_PROPERTY_BLOCK_TAB_FOCUS,
+                               EWL_FLAGS_PROPERTY_MASK);
+
+       DLEAVE_FUNCTION(DLEVEL_STABLE);
+}
+
+/**
+ * @param w: The widget to check if it blocks tab focus
+ * @return Returns TRUE if the widget blocks tab focus, FALSE otherwise.
+ */
+unsigned int
+ewl_widget_ignore_focus_change_get(Ewl_Widget *w)
+{
+       DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR_RET("w", w, FALSE);
+
+       if (ewl_object_flags_has(EWL_OBJECT(w), 
+                                       EWL_FLAG_PROPERTY_BLOCK_TAB_FOCUS,
+                                       EWL_FLAGS_PROPERTY_MASK))
+               DRETURN_INT(TRUE, DLEVEL_STABLE);
+       DRETURN_INT(FALSE, DLEVEL_STABLE);
+}
+
+/**
  * @param w: the widget to display ancestry tree
  * @return Returns no value.
  * @brief Prints to stdout the tree of widgets that are parents of a widget.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_widget.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- ewl_widget.h        17 Oct 2005 15:29:35 -0000      1.17
+++ ewl_widget.h        20 Oct 2005 04:33:47 -0000      1.18
@@ -244,6 +244,9 @@
 void           ewl_widget_tab_order_insert_after(Ewl_Widget *w, Ewl_Widget 
*after);
 void           ewl_widget_tab_order_remove(Ewl_Widget *w);
 
+void           ewl_widget_ignore_focus_change_set(Ewl_Widget *w, unsigned int 
val);
+unsigned int   ewl_widget_ignore_focus_change_get(Ewl_Widget *w);
+
 void            ewl_widget_color_set(Ewl_Widget *w, int r, int g, 
                                                int b, int a);
 void            ewl_widget_color_get(Ewl_Widget *w, int *r, int *g, 




-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to