Enlightenment CVS committal Author : pfritz Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_widget.h ewl_widget.c ewl_enums.h Log Message: use a flag for unmanaged and toplayered =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_widget.h,v retrieving revision 1.75 retrieving revision 1.76 diff -u -3 -r1.75 -r1.76 --- ewl_widget.h 26 Jul 2008 22:11:22 -0000 1.75 +++ ewl_widget.h 4 Aug 2008 22:45:44 -0000 1.76 @@ -154,14 +154,9 @@ const char *inheritance; /**< Inheritance of path widget */ int layer; /**< the layer relative to the parent */ - Ecore_Hash *theme; /**< Overriding theme settings */ - Ewl_Pair_List theme_text; /**< Overriding text in theme */ - unsigned int flags; /**< the widget flags */ - - unsigned char toplayered:1; /**< Indicates if the widget should - be on the top of the layer stack */ - unsigned char unmanaged:1; - + Ecore_Hash *theme; /**< Overriding theme settings */ + Ewl_Pair_List theme_text; /**< Overriding text in theme */ + unsigned int flags; /**< the widget flags */ }; Ewl_Widget *ewl_widget_new(void); @@ -505,7 +500,8 @@ -#define UNMANAGED(w) (((const Ewl_Widget *)(w))->unmanaged) +#define UNMANAGED(w) (EWL_WIDGET(w)->flags & EWL_FLAG_PROPERTY_UNMANAGED) +#define TOPLAYERED(w) (EWL_WIDGET(w)->flags & EWL_FLAG_PROPERTY_TOPLAYERED) /* * Internally used callbacks, override at your own risk. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_widget.c,v retrieving revision 1.168 retrieving revision 1.169 diff -u -3 -r1.168 -r1.169 --- ewl_widget.c 26 Jul 2008 22:11:22 -0000 1.168 +++ ewl_widget.c 4 Aug 2008 22:45:51 -0000 1.169 @@ -1197,10 +1197,15 @@ DCHECK_PARAM_PTR(w); DCHECK_TYPE(w, EWL_WIDGET_TYPE); - if (w->toplayered == top) + if (!!TOPLAYERED(w) == !!top) DRETURN(DLEVEL_STABLE); - w->toplayered = top; + if (top) + ewl_widget_flags_add(w, EWL_FLAG_PROPERTY_TOPLAYERED, + EWL_FLAGS_PROPERTY_MASK); + else + ewl_widget_flags_remove(w, EWL_FLAG_PROPERTY_TOPLAYERED, + EWL_FLAGS_PROPERTY_MASK); if (REALIZED(w)) { ewl_widget_layer_stack_add(w); @@ -1223,7 +1228,7 @@ DCHECK_PARAM_PTR_RET(w, FALSE); DCHECK_TYPE_RET(w, EWL_WIDGET_TYPE, 0); - DRETURN_INT(w->toplayered, DLEVEL_STABLE); + DRETURN_INT(TOPLAYERED(w), DLEVEL_STABLE); } /** @@ -1642,7 +1647,13 @@ "of a widget that has already a parent!\n"); DRETURN(DLEVEL_STABLE); } - w->unmanaged = !!val; + + if (val) + ewl_widget_flags_add(w, EWL_FLAG_PROPERTY_UNMANAGED, + EWL_FLAGS_PROPERTY_MASK); + else + ewl_widget_flags_remove(w, EWL_FLAG_PROPERTY_UNMANAGED, + EWL_FLAGS_PROPERTY_MASK); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -2129,7 +2140,7 @@ if (w->parent && !REVEALED(w->parent)) DRETURN(DLEVEL_STABLE); - if (w->parent && !w->toplayered) + if (w->parent && !TOPLAYERED(w)) smart_parent = w->parent->smart_object; else { Ewl_Embed *emb; @@ -2166,7 +2177,7 @@ DRETURN(DLEVEL_STABLE); /* check first if the widget should be on the top */ - if (w->toplayered) + if (TOPLAYERED(w)) { evas_object_raise(w->smart_object); DRETURN(DLEVEL_STABLE); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_enums.h,v retrieving revision 1.92 retrieving revision 1.93 diff -u -3 -r1.92 -r1.93 --- ewl_enums.h 3 Jul 2008 08:35:59 -0000 1.92 +++ ewl_enums.h 4 Aug 2008 22:45:51 -0000 1.93 @@ -159,36 +159,38 @@ /* * Behavior modifying properties. */ - EWL_FLAG_PROPERTY_RECURSIVE = 0x10, /**< Widget is recursive */ - EWL_FLAG_PROPERTY_TOPLEVEL = 0x20, /**< Widget is a top level widget */ - EWL_FLAG_PROPERTY_INTERNAL = 0x40, /**< Widget is internal */ - EWL_FLAG_PROPERTY_BLOCK_TAB_FOCUS = 0x80, /**< Widget will block tab focus changes */ - EWL_FLAG_PROPERTY_FOCUSABLE = 0x100, /**< Widget is focusable */ - EWL_FLAG_PROPERTY_IN_TAB_LIST = 0x200, /**< Widget is in the tab order */ - EWL_FLAG_PROPERTY_DND_TARGET = 0x400, /**< Widget is DND aware */ - EWL_FLAG_PROPERTY_DND_SOURCE = 0x800, /**< Widget is dragable */ + EWL_FLAG_PROPERTY_RECURSIVE = 0x10, /**< Widget is recursive */ + EWL_FLAG_PROPERTY_TOPLEVEL = 0x20, /**< Widget is a top level widget */ + EWL_FLAG_PROPERTY_INTERNAL = 0x40, /**< Widget is internal */ + EWL_FLAG_PROPERTY_UNMANAGED = 0x80, /**< Widget is unmanaged */ + EWL_FLAG_PROPERTY_BLOCK_TAB_FOCUS = 0x100, /**< Widget will block tab focus changes */ + EWL_FLAG_PROPERTY_FOCUSABLE = 0x200, /**< Widget is focusable */ + EWL_FLAG_PROPERTY_IN_TAB_LIST = 0x400, /**< Widget is in the tab order */ + EWL_FLAG_PROPERTY_DND_TARGET = 0x800, /**< Widget is DND aware */ + EWL_FLAG_PROPERTY_DND_SOURCE = 0x1000, /**< Widget is dragable */ + EWL_FLAG_PROPERTY_TOPLAYERED = 0x2000, /**< Widget is toplayered */ /* * Flags to indicate queues this object is on. */ - EWL_FLAG_QUEUED_SCHEDULED_CONFIGURE = 0x1000, /**< Configure scheduled */ - EWL_FLAG_QUEUED_SCHEDULED_REVEAL = 0x2000, /**< Reveal scheduled */ - EWL_FLAG_QUEUED_SCHEDULED_DESTROY = 0x4000, /**< Delete scheduled */ - - EWL_FLAG_QUEUED_PROCESS_CONFIGURE = 0x8000, /**< Configure in progress */ - EWL_FLAG_QUEUED_PROCESS_REVEAL = 0x10000, /**< Reveal in progress */ - EWL_FLAG_QUEUED_PROCESS_DESTROY = 0x20000, /**< Delete in progress */ + EWL_FLAG_QUEUED_SCHEDULED_CONFIGURE = 0x4000, /**< Configure scheduled */ + EWL_FLAG_QUEUED_SCHEDULED_REVEAL = 0x8000, /**< Reveal scheduled */ + EWL_FLAG_QUEUED_SCHEDULED_DESTROY = 0x10000, /**< Delete scheduled */ + + EWL_FLAG_QUEUED_PROCESS_CONFIGURE = 0x20000, /**< Configure in progress */ + EWL_FLAG_QUEUED_PROCESS_REVEAL = 0x40000, /**< Reveal in progress */ + EWL_FLAG_QUEUED_PROCESS_DESTROY = 0x80000, /**< Delete in progress */ /* * 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, /**< Widget state normal */ - EWL_FLAG_STATE_MOUSE_IN = 0x40000, /**< Mouse is in the widget */ - EWL_FLAG_STATE_PRESSED = 0x80000, /**< Widget is pressed */ - EWL_FLAG_STATE_FOCUSED = 0x100000, /**< Widget has focus */ - EWL_FLAG_STATE_DISABLED = 0x200000, /**< Widget is disabled */ - EWL_FLAG_STATE_DND = 0x400000, /**< Widget is engaged in DND */ + EWL_FLAG_STATE_MOUSE_IN = 0x100000, /**< Mouse is in the widget */ + EWL_FLAG_STATE_PRESSED = 0x200000, /**< Widget is pressed */ + EWL_FLAG_STATE_FOCUSED = 0x400000, /**< Widget has focus */ + EWL_FLAG_STATE_DISABLED = 0x800000, /**< Widget is disabled */ + EWL_FLAG_STATE_DND = 0x1000000, /**< Widget is engaged in DND */ }; @@ -204,11 +206,16 @@ * @def EWL_FLAGS_PROPERTY_MASK * The property mask */ -#define EWL_FLAGS_PROPERTY_MASK (EWL_FLAG_PROPERTY_RECURSIVE | \ - EWL_FLAG_PROPERTY_TOPLEVEL | EWL_FLAG_PROPERTY_INTERNAL | \ - EWL_FLAG_PROPERTY_BLOCK_TAB_FOCUS | EWL_FLAG_PROPERTY_FOCUSABLE | \ - EWL_FLAG_PROPERTY_DND_TARGET | EWL_FLAG_PROPERTY_DND_SOURCE | \ - EWL_FLAG_PROPERTY_IN_TAB_LIST) +#define EWL_FLAGS_PROPERTY_MASK (EWL_FLAG_PROPERTY_RECURSIVE \ + | EWL_FLAG_PROPERTY_TOPLEVEL \ + | EWL_FLAG_PROPERTY_INTERNAL \ + | EWL_FLAG_PROPERTY_UNMANAGED \ + | EWL_FLAG_PROPERTY_BLOCK_TAB_FOCUS \ + | EWL_FLAG_PROPERTY_FOCUSABLE \ + | EWL_FLAG_PROPERTY_DND_TARGET \ + | EWL_FLAG_PROPERTY_DND_SOURCE \ + | EWL_FLAG_PROPERTY_IN_TAB_LIST \ + | EWL_FLAG_PROPERTY_TOPLAYERED) /** * @def EWL_FLAGS_QUEUED_MASK ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs