Hello Tom, Thanks for you fix. I have one question here. I think this macro has no big benefit.
+#define BASE(it) (&(it)->base) There is no much difference between "BASE(it)" and "it->base". But there are two macros for base.view and base.widget in elm_widget.h #define VIEW(X) X->base.view #define WIDGET(X) X->base.widget If BASE macro is necessary, the best place is elm_widget.h. Thank you. Daniel Juyung Seo (SeoZ) On Wed, Dec 7, 2011 at 9:56 PM, Enlightenment SVN <no-re...@enlightenment.org> wrote: > Log: > Elm toolbar: Fix brokeness introduced by commit 65708. > > Disabled is a property of Elm_Object_Item and was a property of > Elm_Toolbar_Item as well. The aforementioned commit didn't remove the > property from the latter and then used both properties in an > inconsistent manner which caused data not to be up to date. > > Author: tasn > Date: 2011-12-07 04:56:34 -0800 (Wed, 07 Dec 2011) > New Revision: 65989 > Trac: http://trac.enlightenment.org/e/changeset/65989 > > Modified: > trunk/elementary/src/lib/elm_toolbar.c > > Modified: trunk/elementary/src/lib/elm_toolbar.c > =================================================================== > --- trunk/elementary/src/lib/elm_toolbar.c 2011-12-07 12:07:44 UTC (rev > 65988) > +++ trunk/elementary/src/lib/elm_toolbar.c 2011-12-07 12:56:34 UTC (rev > 65989) > @@ -4,6 +4,10 @@ > #include "els_box.h" > #include "els_icon.h" > > +/* FIXME: I couldn't find a macro for it, this should be fixed. > + * Just doing this commit to fix the brokeness that was introduced. */ > +#define BASE(it) (&(it)->base) > + > typedef struct _Widget_Data Widget_Data; > typedef struct _Elm_Toolbar_Item Elm_Toolbar_Item; > > @@ -40,7 +44,6 @@ > Eina_Bool visible : 1; > } prio; > Eina_Bool selected : 1; > - Eina_Bool disabled : 1; > Eina_Bool separator : 1; > Eina_Bool menu : 1; > Eina_List *states; > @@ -150,7 +153,7 @@ > Eina_Bool sel; > > if (!wd) return; > - if ((it->disabled) || (it->separator)) return; > + if ((BASE(it)->disabled) || (it->separator)) return; > sel = it->selected; > > if (!wd->no_select) > @@ -223,9 +226,9 @@ > Widget_Data *wd = elm_widget_data_get(WIDGET(it)); > > if (!wd) return; > - if (it->disabled == disabled) return; > - it->disabled = !!disabled; > - if (it->disabled) > + if (BASE(it)->disabled == disabled) return; > + BASE(it)->disabled = !!disabled; > + if (BASE(it)->disabled) > { > edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm"); > elm_widget_signal_emit(it->icon, "elm,state,disabled", "elm"); > @@ -317,7 +320,7 @@ > edje_object_signal_emit(view, "elm,state,selected", "elm"); > elm_widget_signal_emit(it->icon, "elm,state,selected", "elm"); > } > - if (it->disabled) > + if (BASE(it)->disabled) > { > edje_object_signal_emit(view, "elm,state,disabled", "elm"); > elm_widget_signal_emit(it->icon, "elm,state,disabled", "elm"); > @@ -540,7 +543,7 @@ > menu_it = elm_menu_item_add(menu, NULL, > it->icon_str, it->label, > _elm_toolbar_item_menu_cb, > it); > - elm_object_item_disabled_set(menu_it, > it->disabled); > + elm_object_item_disabled_set(menu_it, > BASE(it)->disabled); > if (it->o_menu) > elm_menu_clone(it->o_menu, menu, menu_it); > } > @@ -732,7 +735,7 @@ > Elm_Toolbar_Item *it = (Elm_Toolbar_Item *)item; > if (it->separator) > return strdup(E_("Separator")); > - else if (it->disabled) > + else if (BASE(it)->disabled) > return strdup(E_("State: Disabled")); > else if (it->selected) > return strdup(E_("State: Selected")); > @@ -1763,7 +1766,7 @@ > wd->icon_size, > "elm,state,icon_set,backward"); > } > - if (item->disabled) > + if (BASE(item)->disabled) > elm_widget_signal_emit(item->icon, "elm,state,disabled", "elm"); > else > elm_widget_signal_emit(item->icon, "elm,state,enabled", "elm"); > > > ------------------------------------------------------------------------------ > Cloud Services Checklist: Pricing and Packaging Optimization > This white paper is intended to serve as a reference, checklist and point of > discussion for anyone considering optimizing the pricing and packaging model > of a cloud services business. Read Now! > http://www.accelacomm.com/jaw/sfnl/114/51491232/ > _______________________________________________ > enlightenment-svn mailing list > enlightenment-...@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/enlightenment-svn ------------------------------------------------------------------------------ Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now! http://www.accelacomm.com/jaw/sfnl/114/51491232/ _______________________________________________ enlightenment-devel mailing list enlightenment-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-devel