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);
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);
}
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;
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;
}
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
}
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' */
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 = evas_object_smart_add(e, _elm_conformant_smart_class_new());
+ obj = elm_widget_add(_elm_conformant_smart_class_new(), parent);
+ if (!obj) return NULL;
- /* 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;
}
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);
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);
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;
}
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);
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);
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);
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;
}
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);
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
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;
}
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);
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;
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);
}
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)
{
ELM_WIDGET_CLASS(sc)->base.add = _elm_hover_smart_add;
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;
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;
}
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);
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);
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);
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
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;
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;
}
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);
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);
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);
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);
}
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)
{
sc->base.add = _elm_menu_smart_add;
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;
}
(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
}
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)
{
ELM_WIDGET_CLASS(sc)->base.add = _elm_notify_smart_add;
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;
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;
}
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);
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);
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;
}
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;
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);
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);
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);
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);
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);
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);
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);
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);
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);
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);
{
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);
ELM_WIDGET_CLASS(sc)->focus_next = NULL;
ELM_WIDGET_CLASS(sc)->focus_direction = NULL;
-
sc->sizing_eval = _elm_video_smart_sizing_eval;
}
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);
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);