summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_widget.h
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-08-09 16:22:48 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-08-09 18:09:32 +0900
commite2fca6c454c182d4666c2f081697ed6f917ff645 (patch)
tree6c59ecb204378f01a37f72b81ba3bbeffef3d901 /src/lib/elementary/elm_widget.h
parent5d1e959f92e14f1aa45f3c225d8351041125039b (diff)
elm: Prevent style/theme set after finalize (EO)
This is only for EO obviously. style_set and theme_set should only be called when the object is being created, not after. On-the-fly style changes are complex to handle and in most cases it should be easy to simply repopulate the object after creating a new one with a new style. There are only a few cases where style_set is used long after creation of an object, like changing how a label slides, or in the evas 3d map examples. Menu seems to change the hover style a lot, so rewriting it in pure EO would need some extra work, maybe. Ref T5307 Ref T5363
Diffstat (limited to 'src/lib/elementary/elm_widget.h')
-rw-r--r--src/lib/elementary/elm_widget.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_widget.h b/src/lib/elementary/elm_widget.h
index 8c7382fd5b..86d5b6f4a5 100644
--- a/src/lib/elementary/elm_widget.h
+++ b/src/lib/elementary/elm_widget.h
@@ -468,6 +468,7 @@ typedef struct _Elm_Widget_Smart_Data
468 Eina_Bool on_create : 1; /**< This is true when the widget is on creation(general widget constructor). */ 468 Eina_Bool on_create : 1; /**< This is true when the widget is on creation(general widget constructor). */
469 Eina_Bool on_destroy: 1; /**< This is true when the widget is on destruction(general widget destructor). */ 469 Eina_Bool on_destroy: 1; /**< This is true when the widget is on destruction(general widget destructor). */
470 Eina_Bool provider_lookup : 1; /**< This is true when efl_provider_find is currently walking the tree */ 470 Eina_Bool provider_lookup : 1; /**< This is true when efl_provider_find is currently walking the tree */
471 Eina_Bool legacy : 1; /**< Widget was created with a legacy API, not efl_add() */
471} Elm_Widget_Smart_Data; 472} Elm_Widget_Smart_Data;
472 473
473/** 474/**
@@ -851,6 +852,14 @@ _elm_widget_sub_object_redirect_to_top(Evas_Object *obj, Evas_Object *sobj)
851 return ret; 852 return ret;
852} 853}
853 854
855static inline Eina_Bool
856elm_widget_is_legacy(const Eo *obj)
857{
858 Elm_Widget_Smart_Data *sd = (Elm_Widget_Smart_Data *)
859 efl_data_scope_safe_get(obj, ELM_WIDGET_CLASS);
860 return sd ? sd->legacy : EINA_FALSE;
861}
862
854/* to be used by INTERNAL classes on Elementary, so that the widgets 863/* to be used by INTERNAL classes on Elementary, so that the widgets
855 * parsing script skips it */ 864 * parsing script skips it */
856#define ELM_INTERNAL_SMART_SUBCLASS_NEW EVAS_SMART_SUBCLASS_NEW 865#define ELM_INTERNAL_SMART_SUBCLASS_NEW EVAS_SMART_SUBCLASS_NEW