forked from enlightenment/efl
[elm] New elm_widget_add() usage spread.
SVN revision: 74148
This commit is contained in:
parent
5a44c924e4
commit
584c53c1be
|
@ -985,15 +985,12 @@ _elm_fileselector_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_fileselector_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_fileselector_smart_class_new());
|
||||
obj = elm_widget_add(_elm_fileselector_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -250,15 +250,12 @@ _elm_fileselector_button_smart_set_user(Elm_Button_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_fileselector_button_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_fileselector_button_smart_class_new());
|
||||
obj = elm_widget_add(_elm_fileselector_button_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -292,12 +292,20 @@ _elm_hoversel_smart_del(Evas_Object *obj)
|
|||
ELM_WIDGET_CLASS(_elm_hoversel_parent_sc)->base.del(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_hoversel_smart_parent_set(Evas_Object *obj,
|
||||
Evas_Object *parent)
|
||||
{
|
||||
elm_hoversel_hover_parent_set(obj, parent);
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_hoversel_smart_set_user(Elm_Button_Smart_Class *sc)
|
||||
{
|
||||
ELM_WIDGET_CLASS(sc)->base.add = _elm_hoversel_smart_add;
|
||||
ELM_WIDGET_CLASS(sc)->base.del = _elm_hoversel_smart_del;
|
||||
|
||||
ELM_WIDGET_CLASS(sc)->parent_set = _elm_hoversel_smart_parent_set;
|
||||
ELM_WIDGET_CLASS(sc)->theme = _elm_hoversel_smart_theme;
|
||||
|
||||
sc->admits_autorepeat = EINA_FALSE;
|
||||
|
@ -306,21 +314,16 @@ _elm_hoversel_smart_set_user(Elm_Button_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_hoversel_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_hoversel_smart_class_new());
|
||||
obj = elm_widget_add(_elm_hoversel_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
||||
elm_hoversel_hover_parent_set(obj, parent);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
|
|
@ -919,15 +919,12 @@ _elm_naviframe_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_naviframe_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_naviframe_smart_class_new());
|
||||
obj = elm_widget_add(_elm_naviframe_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -561,15 +561,12 @@ EAPI Evas_Object *
|
|||
elm_player_add(Evas_Object *parent)
|
||||
{
|
||||
#ifdef HAVE_EMOTION
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_player_smart_class_new());
|
||||
obj = elm_widget_add(_elm_player_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -705,15 +705,12 @@ _elm_access_2nd_click_timeout(Evas_Object *obj)
|
|||
static Evas_Object *
|
||||
_elm_access_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_access_smart_class_new());
|
||||
obj = elm_widget_add(_elm_access_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -464,15 +464,12 @@ _elm_actionslider_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_actionslider_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_actionslider_smart_class_new());
|
||||
obj = elm_widget_add(_elm_actionslider_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -173,15 +173,12 @@ _elm_bg_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_bg_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_bg_smart_class_new());
|
||||
obj = elm_widget_add(_elm_bg_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -494,15 +494,12 @@ _elm_box_smart_set_user(Elm_Widget_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_box_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_box_smart_class_new());
|
||||
obj = elm_widget_add(_elm_box_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -195,15 +195,12 @@ _elm_bubble_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_bubble_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_bubble_smart_class_new());
|
||||
obj = elm_widget_add(_elm_bubble_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -370,15 +370,12 @@ _elm_button_widget_smart_set_user(Elm_Button_Smart_Class *sc __UNUSED__)
|
|||
EAPI Evas_Object *
|
||||
elm_button_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_button_widget_smart_class_new());
|
||||
obj = elm_widget_add(_elm_button_widget_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -854,15 +854,12 @@ _elm_calendar_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_calendar_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_calendar_smart_class_new());
|
||||
obj = elm_widget_add(_elm_calendar_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -363,15 +363,12 @@ _elm_check_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_check_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_check_smart_class_new());
|
||||
obj = elm_widget_add(_elm_check_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -545,15 +545,12 @@ _elm_clock_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_clock_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_clock_smart_class_new());
|
||||
obj = elm_widget_add(_elm_clock_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -1297,15 +1297,12 @@ _elm_colorselector_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_colorselector_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_colorselector_smart_class_new());
|
||||
obj = elm_widget_add(_elm_colorselector_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -575,12 +575,33 @@ _elm_conformant_smart_del(Evas_Object *obj)
|
|||
ELM_WIDGET_CLASS(_elm_conformant_parent_sc)->base.del(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_conformant_smart_parent_set(Evas_Object *obj,
|
||||
Evas_Object *parent)
|
||||
{
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
Evas_Object *top = elm_widget_top_get(parent);
|
||||
Ecore_X_Window xwin = elm_win_xwindow_get(parent);
|
||||
|
||||
if ((xwin) && (!elm_win_inlined_image_object_get(top)))
|
||||
{
|
||||
ELM_CONFORMANT_DATA_GET(obj, sd);
|
||||
|
||||
sd->prop_hdl = ecore_event_handler_add
|
||||
(ECORE_X_EVENT_WINDOW_PROPERTY, _on_prop_change, obj);
|
||||
sd->vkb_state = ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF;
|
||||
}
|
||||
// FIXME: get kbd region prop
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_conformant_smart_set_user(Elm_Layout_Smart_Class *sc)
|
||||
{
|
||||
ELM_WIDGET_CLASS(sc)->base.add = _elm_conformant_smart_add;
|
||||
ELM_WIDGET_CLASS(sc)->base.del = _elm_conformant_smart_del;
|
||||
|
||||
ELM_WIDGET_CLASS(sc)->parent_set = _elm_conformant_smart_parent_set;
|
||||
ELM_WIDGET_CLASS(sc)->theme = _elm_conformant_smart_theme;
|
||||
|
||||
/* not a 'focus chain manager' */
|
||||
|
@ -593,34 +614,15 @@ _elm_conformant_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_conformant_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
obj = elm_widget_add(_elm_conformant_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_conformant_smart_class_new());
|
||||
|
||||
/* NB: we got to sub-object-add before we probe for the top widget */
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
||||
#ifdef HAVE_ELEMENTARY_X
|
||||
Evas_Object *top = elm_widget_top_get(obj);
|
||||
Ecore_X_Window xwin = elm_win_xwindow_get(top);
|
||||
|
||||
if ((xwin) && (!elm_win_inlined_image_object_get(top)))
|
||||
{
|
||||
ELM_CONFORMANT_DATA_GET(obj, sd);
|
||||
|
||||
sd->prop_hdl = ecore_event_handler_add
|
||||
(ECORE_X_EVENT_WINDOW_PROPERTY, _on_prop_change, obj);
|
||||
sd->vkb_state = ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF;
|
||||
}
|
||||
// FIXME: get kbd region prop
|
||||
#endif
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
|
|
@ -854,15 +854,12 @@ _elm_datetime_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_datetime_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_datetime_smart_class_new());
|
||||
obj = elm_widget_add(_elm_datetime_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -523,15 +523,12 @@ _elm_dayselector_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_dayselector_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_dayselector_smart_class_new());
|
||||
obj = elm_widget_add(_elm_dayselector_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -1288,18 +1288,16 @@ _elm_diskselector_smart_set_user(Elm_Widget_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_diskselector_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_diskselector_smart_class_new());
|
||||
obj = elm_widget_add(_elm_diskselector_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
|
|
@ -1906,15 +1906,12 @@ _elm_flip_smart_set_user(Elm_Container_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_flip_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_flip_smart_class_new());
|
||||
obj = elm_widget_add(_elm_flip_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -661,15 +661,12 @@ _elm_flipselector_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_flipselector_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_flipselector_smart_class_new());
|
||||
obj = elm_widget_add(_elm_flipselector_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -208,15 +208,12 @@ _elm_frame_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_frame_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_frame_smart_class_new());
|
||||
obj = elm_widget_add(_elm_frame_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -2432,18 +2432,16 @@ _elm_gengrid_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_gengrid_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_gengrid_smart_class_new());
|
||||
obj = elm_widget_add(_elm_gengrid_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
|
|
@ -4679,6 +4679,9 @@ _decorate_item_unset(Elm_Genlist_Smart_Data *sd)
|
|||
static void
|
||||
_elm_genlist_smart_add(Evas_Object *obj)
|
||||
{
|
||||
Evas_Coord minw, minh;
|
||||
Elm_Genlist_Pan_Smart_Data *pan_data;
|
||||
|
||||
EVAS_SMART_DATA_ALLOC(obj, Elm_Genlist_Smart_Data);
|
||||
|
||||
ELM_WIDGET_CLASS(_elm_genlist_parent_sc)->base.add(obj);
|
||||
|
@ -4687,11 +4690,57 @@ _elm_genlist_smart_add(Evas_Object *obj)
|
|||
evas_object_smart_member_add(priv->hit_rect, obj);
|
||||
elm_widget_sub_object_add(obj, priv->hit_rect);
|
||||
|
||||
/* common scroller hit rectangle setup -- it has to take place
|
||||
* AFTER smart_member_add() */
|
||||
/* common scroller hit rectangle setup */
|
||||
evas_object_color_set(priv->hit_rect, 0, 0, 0, 0);
|
||||
evas_object_show(priv->hit_rect);
|
||||
evas_object_repeat_events_set(priv->hit_rect, EINA_TRUE);
|
||||
|
||||
elm_widget_can_focus_set(obj, EINA_TRUE);
|
||||
elm_widget_on_show_region_hook_set(obj, _show_region_hook, obj);
|
||||
|
||||
priv->generation = 1;
|
||||
|
||||
elm_layout_theme_set(obj, "genlist", "base", elm_widget_style_get(obj));
|
||||
|
||||
/* interface's add() routine issued AFTER the object's smart_add() */
|
||||
priv->s_iface = evas_object_smart_interface_get
|
||||
(obj, ELM_SCROLLABLE_IFACE_NAME);
|
||||
|
||||
priv->s_iface->objects_set
|
||||
(obj, ELM_WIDGET_DATA(priv)->resize_obj, priv->hit_rect);
|
||||
|
||||
priv->s_iface->bounce_allow_set
|
||||
(obj, EINA_FALSE, _elm_config->thumbscroll_bounce_enable);
|
||||
priv->v_bounce = _elm_config->thumbscroll_bounce_enable;
|
||||
|
||||
priv->s_iface->animate_start_cb_set(obj, _scroll_animate_start_cb);
|
||||
priv->s_iface->animate_stop_cb_set(obj, _scroll_animate_stop_cb);
|
||||
priv->s_iface->drag_start_cb_set(obj, _scroll_drag_start_cb);
|
||||
priv->s_iface->drag_stop_cb_set(obj, _scroll_drag_stop_cb);
|
||||
priv->s_iface->edge_left_cb_set(obj, _edge_left_cb);
|
||||
priv->s_iface->edge_right_cb_set(obj, _edge_right_cb);
|
||||
priv->s_iface->edge_top_cb_set(obj, _edge_top_cb);
|
||||
priv->s_iface->edge_bottom_cb_set(obj, _edge_bottom_cb);
|
||||
|
||||
priv->mode = ELM_LIST_SCROLL;
|
||||
priv->max_items_per_block = MAX_ITEMS_PER_BLOCK;
|
||||
priv->item_cache_max = priv->max_items_per_block * 2;
|
||||
priv->longpress_timeout = _elm_config->longpress_timeout;
|
||||
priv->highlight = EINA_TRUE;
|
||||
|
||||
priv->pan_obj = evas_object_smart_add
|
||||
(evas_object_evas_get(obj), _elm_genlist_pan_smart_class_new());
|
||||
pan_data = evas_object_smart_data_get(priv->pan_obj);
|
||||
pan_data->wsd = priv;
|
||||
|
||||
priv->s_iface->extern_pan_set(obj, priv->pan_obj);
|
||||
|
||||
edje_object_size_min_calc(ELM_WIDGET_DATA(priv)->resize_obj, &minw, &minh);
|
||||
evas_object_size_hint_min_set(obj, minw, minh);
|
||||
|
||||
_mirrored_set(obj, elm_widget_mirrored_get(obj));
|
||||
|
||||
elm_layout_sizing_eval(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -4776,70 +4825,16 @@ _elm_genlist_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_genlist_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
Evas_Coord minw, minh;
|
||||
Elm_Genlist_Pan_Smart_Data *pan_data;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_genlist_smart_class_new());
|
||||
obj = elm_widget_add(_elm_genlist_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
||||
ELM_GENLIST_DATA_GET(obj, sd);
|
||||
|
||||
elm_widget_can_focus_set(obj, EINA_TRUE);
|
||||
elm_widget_on_show_region_hook_set(obj, _show_region_hook, obj);
|
||||
|
||||
sd->generation = 1;
|
||||
|
||||
elm_layout_theme_set(obj, "genlist", "base", elm_widget_style_get(obj));
|
||||
|
||||
/* interface's add() routine issued AFTER the object's smart_add() */
|
||||
sd->s_iface = evas_object_smart_interface_get
|
||||
(obj, ELM_SCROLLABLE_IFACE_NAME);
|
||||
|
||||
sd->s_iface->objects_set
|
||||
(obj, ELM_WIDGET_DATA(sd)->resize_obj, sd->hit_rect);
|
||||
|
||||
sd->s_iface->bounce_allow_set
|
||||
(obj, EINA_FALSE, _elm_config->thumbscroll_bounce_enable);
|
||||
sd->v_bounce = _elm_config->thumbscroll_bounce_enable;
|
||||
|
||||
sd->s_iface->animate_start_cb_set(obj, _scroll_animate_start_cb);
|
||||
sd->s_iface->animate_stop_cb_set(obj, _scroll_animate_stop_cb);
|
||||
sd->s_iface->drag_start_cb_set(obj, _scroll_drag_start_cb);
|
||||
sd->s_iface->drag_stop_cb_set(obj, _scroll_drag_stop_cb);
|
||||
sd->s_iface->edge_left_cb_set(obj, _edge_left_cb);
|
||||
sd->s_iface->edge_right_cb_set(obj, _edge_right_cb);
|
||||
sd->s_iface->edge_top_cb_set(obj, _edge_top_cb);
|
||||
sd->s_iface->edge_bottom_cb_set(obj, _edge_bottom_cb);
|
||||
|
||||
sd->mode = ELM_LIST_SCROLL;
|
||||
sd->max_items_per_block = MAX_ITEMS_PER_BLOCK;
|
||||
sd->item_cache_max = sd->max_items_per_block * 2;
|
||||
sd->longpress_timeout = _elm_config->longpress_timeout;
|
||||
sd->highlight = EINA_TRUE;
|
||||
|
||||
sd->pan_obj = evas_object_smart_add
|
||||
(evas_object_evas_get(obj), _elm_genlist_pan_smart_class_new());
|
||||
pan_data = evas_object_smart_data_get(sd->pan_obj);
|
||||
pan_data->wsd = sd;
|
||||
|
||||
sd->s_iface->extern_pan_set(obj, sd->pan_obj);
|
||||
|
||||
edje_object_size_min_calc(ELM_WIDGET_DATA(sd)->resize_obj, &minw, &minh);
|
||||
evas_object_size_hint_min_set(obj, minw, minh);
|
||||
|
||||
_mirrored_set(obj, elm_widget_mirrored_get(obj));
|
||||
|
||||
elm_layout_sizing_eval(obj);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
|
|
@ -3655,15 +3655,12 @@ _elm_gesture_layer_smart_set_user(Elm_Widget_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_gesture_layer_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_gesture_layer_smart_class_new());
|
||||
obj = elm_widget_add(_elm_gesture_layer_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -332,17 +332,15 @@ _elm_glview_smart_set_user(Elm_Widget_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_glview_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_glview_smart_class_new());
|
||||
obj = elm_widget_add(_elm_glview_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
ELM_GLVIEW_DATA_GET(obj, sd);
|
||||
|
||||
if (!sd->evasgl)
|
||||
return NULL;
|
||||
|
||||
|
|
|
@ -176,15 +176,12 @@ _elm_grid_smart_set_user(Elm_Widget_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_grid_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_grid_smart_class_new());
|
||||
obj = elm_widget_add(_elm_grid_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -658,6 +658,15 @@ _elm_hover_smart_hide(Evas_Object *obj)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_hover_smart_parent_set(Evas_Object *obj,
|
||||
Evas_Object *parent)
|
||||
{
|
||||
elm_hover_parent_set(obj, parent);
|
||||
|
||||
elm_layout_sizing_eval(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_hover_smart_set_user(Elm_Layout_Smart_Class *sc)
|
||||
{
|
||||
|
@ -668,6 +677,7 @@ _elm_hover_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
ELM_WIDGET_CLASS(sc)->base.show = _elm_hover_smart_show;
|
||||
ELM_WIDGET_CLASS(sc)->base.hide = _elm_hover_smart_hide;
|
||||
|
||||
ELM_WIDGET_CLASS(sc)->parent_set = _elm_hover_smart_parent_set;
|
||||
ELM_WIDGET_CLASS(sc)->sub_object_add = _elm_hover_smart_sub_object_add;
|
||||
ELM_WIDGET_CLASS(sc)->sub_object_del = _elm_hover_smart_sub_object_del;
|
||||
ELM_WIDGET_CLASS(sc)->theme = _elm_hover_smart_theme;
|
||||
|
@ -688,22 +698,16 @@ _elm_hover_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_hover_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_hover_smart_class_new());
|
||||
obj = elm_widget_add(_elm_hover_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
||||
elm_hover_parent_set(obj, parent);
|
||||
elm_layout_sizing_eval(obj);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
|
|
@ -807,15 +807,12 @@ _elm_icon_smart_set_user(Elm_Image_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_icon_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_icon_smart_class_new());
|
||||
obj = elm_widget_add(_elm_icon_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -1077,15 +1077,12 @@ elm_image_smart_class_get(void)
|
|||
EAPI Evas_Object *
|
||||
elm_image_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_image_smart_class_new());
|
||||
obj = elm_widget_add(_elm_image_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -713,15 +713,12 @@ _elm_index_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_index_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_index_smart_class_new());
|
||||
obj = elm_widget_add(_elm_index_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -90,6 +90,19 @@ _elm_inwin_smart_add(Evas_Object *obj)
|
|||
|
||||
elm_widget_can_focus_set(obj, EINA_FALSE);
|
||||
elm_widget_highlight_ignore_set(obj, EINA_TRUE);
|
||||
|
||||
evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_layout_theme_set(obj, "win", "inwin", elm_object_style_get(obj));
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_inwin_smart_parent_set(Evas_Object *obj,
|
||||
Evas_Object *parent)
|
||||
{
|
||||
elm_win_resize_object_add(parent, obj);
|
||||
|
||||
elm_layout_sizing_eval(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -98,6 +111,7 @@ _elm_inwin_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
ELM_WIDGET_CLASS(sc)->base.add = _elm_inwin_smart_add;
|
||||
|
||||
ELM_WIDGET_CLASS(sc)->focus_next = _elm_inwin_smart_focus_next;
|
||||
ELM_WIDGET_CLASS(sc)->parent_set = _elm_inwin_smart_parent_set;
|
||||
|
||||
sc->sizing_eval = _elm_inwin_smart_sizing_eval;
|
||||
|
||||
|
@ -107,28 +121,17 @@ _elm_inwin_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_win_inwin_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
if (!parent || !elm_widget_type_check((parent), "elm_win", __func__))
|
||||
return NULL; /* *has* to have a parent window */
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_inwin_smart_class_new());
|
||||
obj = elm_widget_add(_elm_inwin_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
||||
evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||
evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||
elm_win_resize_object_add(parent, obj);
|
||||
|
||||
elm_layout_theme_set(obj, "win", "inwin", elm_object_style_get(obj));
|
||||
|
||||
elm_layout_sizing_eval(obj);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
|
|
@ -398,15 +398,12 @@ _elm_label_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_label_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_label_smart_class_new());
|
||||
obj = elm_widget_add(_elm_label_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -1802,15 +1802,12 @@ elm_layout_edje_object_can_access_get(Evas_Object *obj)
|
|||
EAPI Evas_Object *
|
||||
elm_layout_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_layout_widget_smart_class_new());
|
||||
obj = elm_widget_add(_elm_layout_widget_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -1740,15 +1740,12 @@ _elm_list_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_list_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_list_smart_class_new());
|
||||
obj = elm_widget_add(_elm_list_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -289,15 +289,12 @@ _elm_mapbuf_smart_set_user(Elm_Container_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_mapbuf_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_mapbuf_smart_class_new());
|
||||
obj = elm_widget_add(_elm_mapbuf_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -631,6 +631,21 @@ _elm_menu_smart_del(Evas_Object *obj)
|
|||
_elm_menu_parent_sc->base.del(obj); /* handles freeing sd */
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_menu_smart_parent_set(Evas_Object *obj,
|
||||
Evas_Object *parent)
|
||||
{
|
||||
ELM_MENU_DATA_GET(obj, sd);
|
||||
|
||||
elm_menu_parent_set(obj, parent);
|
||||
elm_hover_target_set(sd->hv, sd->location);
|
||||
elm_layout_content_set
|
||||
(sd->hv, elm_hover_best_content_location_get
|
||||
(sd->hv, ELM_HOVER_AXIS_VERTICAL), sd->bx);
|
||||
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_menu_smart_set_user(Elm_Widget_Smart_Class *sc)
|
||||
{
|
||||
|
@ -642,35 +657,23 @@ _elm_menu_smart_set_user(Elm_Widget_Smart_Class *sc)
|
|||
sc->focus_next = NULL;
|
||||
sc->focus_direction = NULL;
|
||||
|
||||
sc->parent_set = _elm_menu_smart_parent_set;
|
||||
sc->theme = _elm_menu_smart_theme;
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_menu_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_menu_smart_class_new());
|
||||
obj = elm_widget_add(_elm_menu_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
||||
ELM_MENU_DATA_GET(obj, sd);
|
||||
|
||||
elm_menu_parent_set(obj, parent);
|
||||
elm_hover_target_set(sd->hv, sd->location);
|
||||
elm_layout_content_set
|
||||
(sd->hv, elm_hover_best_content_location_get
|
||||
(sd->hv, ELM_HOVER_AXIS_VERTICAL), sd->bx);
|
||||
|
||||
_sizing_eval(obj);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
|
|
@ -578,6 +578,7 @@ _elm_notify_smart_add(Evas_Object *obj)
|
|||
(obj, EVAS_CALLBACK_RESTACK, _restack_cb, obj);
|
||||
|
||||
elm_widget_can_focus_set(obj, EINA_FALSE);
|
||||
elm_notify_orient_set(obj, ELM_NOTIFY_ORIENT_TOP);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -596,6 +597,15 @@ _elm_notify_smart_del(Evas_Object *obj)
|
|||
ELM_WIDGET_CLASS(_elm_notify_parent_sc)->base.del(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_notify_smart_parent_set(Evas_Object *obj,
|
||||
Evas_Object *parent)
|
||||
{
|
||||
elm_notify_parent_set(obj, parent);
|
||||
|
||||
_sizing_eval(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_notify_smart_set_user(Elm_Container_Smart_Class *sc)
|
||||
{
|
||||
|
@ -607,6 +617,7 @@ _elm_notify_smart_set_user(Elm_Container_Smart_Class *sc)
|
|||
ELM_WIDGET_CLASS(sc)->base.show = _elm_notify_smart_show;
|
||||
ELM_WIDGET_CLASS(sc)->base.hide = _elm_notify_smart_hide;
|
||||
|
||||
ELM_WIDGET_CLASS(sc)->parent_set = _elm_notify_smart_parent_set;
|
||||
ELM_WIDGET_CLASS(sc)->theme = _elm_notify_smart_theme;
|
||||
ELM_WIDGET_CLASS(sc)->focus_next = _elm_notify_smart_focus_next;
|
||||
ELM_WIDGET_CLASS(sc)->focus_direction = _elm_notify_smart_focus_direction;
|
||||
|
@ -621,24 +632,16 @@ _elm_notify_smart_set_user(Elm_Container_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_notify_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_notify_smart_class_new());
|
||||
obj = elm_widget_add(_elm_notify_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
||||
elm_notify_orient_set(obj, ELM_NOTIFY_ORIENT_TOP);
|
||||
elm_notify_parent_set(obj, parent);
|
||||
|
||||
_sizing_eval(obj);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
|
|
@ -242,15 +242,12 @@ _elm_panes_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_panes_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_panes_smart_class_new());
|
||||
obj = elm_widget_add(_elm_panes_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -349,15 +349,12 @@ _elm_photo_smart_set_user(Elm_Widget_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_photo_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_photo_smart_class_new());
|
||||
obj = elm_widget_add(_elm_photo_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -1569,18 +1569,16 @@ _elm_photocam_smart_set_user(Elm_Widget_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_photocam_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_photocam_smart_class_new());
|
||||
obj = elm_widget_add(_elm_photocam_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
|
|
@ -114,15 +114,12 @@ _elm_plug_smart_set_user(Elm_Widget_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_plug_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_plug_smart_class_new());
|
||||
obj = elm_widget_add(_elm_plug_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
ELM_PLUG_DATA_GET(obj, sd);
|
||||
if (!ELM_WIDGET_DATA(sd)->resize_obj) return NULL;
|
||||
|
|
|
@ -300,15 +300,12 @@ _elm_progressbar_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_progressbar_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_progressbar_smart_class_new());
|
||||
obj = elm_widget_add(_elm_progressbar_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -359,15 +359,12 @@ _elm_radio_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_radio_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_radio_smart_class_new());
|
||||
obj = elm_widget_add(_elm_radio_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -244,15 +244,12 @@ _elm_route_smart_set_user(Elm_Widget_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_route_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_route_smart_class_new());
|
||||
obj = elm_widget_add(_elm_route_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -596,15 +596,12 @@ _elm_segment_control_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_segment_control_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_segment_control_smart_class_new());
|
||||
obj = elm_widget_add(_elm_segment_control_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -106,15 +106,12 @@ _elm_separator_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_separator_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_separator_smart_class_new());
|
||||
obj = elm_widget_add(_elm_separator_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -801,15 +801,12 @@ _elm_slider_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_slider_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_slider_smart_class_new());
|
||||
obj = elm_widget_add(_elm_slider_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -446,15 +446,12 @@ _elm_slideshow_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_slideshow_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_slideshow_smart_class_new());
|
||||
obj = elm_widget_add(_elm_slideshow_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -602,15 +602,12 @@ _elm_spinner_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_spinner_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_spinner_smart_class_new());
|
||||
obj = elm_widget_add(_elm_spinner_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -224,15 +224,12 @@ _elm_table_smart_set_user(Elm_Widget_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_table_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_table_smart_class_new());
|
||||
obj = elm_widget_add(_elm_table_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -660,15 +660,12 @@ _elm_thumb_smart_set_user(Elm_Widget_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_thumb_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_thumb_smart_class_new());
|
||||
obj = elm_widget_add(_elm_thumb_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -266,6 +266,8 @@ _elm_video_smart_add(Evas_Object *obj)
|
|||
{
|
||||
EVAS_SMART_DATA_ALLOC(obj, Elm_Video_Smart_Data);
|
||||
|
||||
_elm_emotion_init();
|
||||
|
||||
ELM_WIDGET_CLASS(_elm_video_parent_sc)->base.add(obj);
|
||||
|
||||
elm_widget_can_focus_set(obj, EINA_TRUE);
|
||||
|
@ -327,7 +329,6 @@ _elm_video_smart_set_user(Elm_Layout_Smart_Class *sc)
|
|||
ELM_WIDGET_CLASS(sc)->focus_next = NULL;
|
||||
ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
|
||||
|
||||
|
||||
sc->sizing_eval = _elm_video_smart_sizing_eval;
|
||||
}
|
||||
|
||||
|
@ -335,17 +336,12 @@ EAPI Evas_Object *
|
|||
elm_video_add(Evas_Object *parent)
|
||||
{
|
||||
#ifdef HAVE_EMOTION
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
_elm_emotion_init();
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_video_smart_class_new());
|
||||
obj = elm_widget_add(_elm_video_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
|
@ -1316,15 +1316,12 @@ _elm_web_smart_set_user(Elm_Widget_Smart_Class *sc)
|
|||
EAPI Evas_Object *
|
||||
elm_web_add(Evas_Object *parent)
|
||||
{
|
||||
Evas *e;
|
||||
Evas_Object *obj;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL);
|
||||
|
||||
e = evas_object_evas_get(parent);
|
||||
if (!e) return NULL;
|
||||
|
||||
obj = evas_object_smart_add(e, _elm_web_smart_class_new());
|
||||
obj = elm_widget_add(_elm_web_smart_class_new(), parent);
|
||||
if (!obj) return NULL;
|
||||
|
||||
if (!elm_widget_sub_object_add(parent, obj))
|
||||
ERR("could not add %p as sub object of %p", obj, parent);
|
||||
|
|
Loading…
Reference in New Issue