Summary: Add one more argument, 'Eina_Bool sub_object' to elm_widget_resize_object_set. If the argument, 'sub_object' is set as EINA_TRUE, the new resize object is added to the sub object and the previous resize object is deleted from the sub object.
Reviewers: Hermet, seoz
CC: Jaehyun_Cho, seoz, raster
Differential Revision: https://phab.enlightenment.org/D265
//Recover previous smart members.
if (prev_it)
{
- elm_widget_resize_object_set(obj, NULL);
+ elm_widget_resize_object_set(obj, NULL, EINA_TRUE);
elm_widget_sub_object_add(obj, VIEW(prev_it));
evas_object_smart_member_add(VIEW(prev_it), obj);
}
if (it)
{
- elm_widget_resize_object_set(obj, VIEW(it));
+ elm_widget_resize_object_set(obj, VIEW(it), EINA_TRUE);
evas_object_raise(VIEW(it));
}
}
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
elm_widget_resize_object_set(obj,
- evas_object_box_add(evas_object_evas_get(obj)));
+ evas_object_box_add(evas_object_evas_get(obj)),
+ EINA_TRUE);
evas_object_box_layout_set(wd->resize_obj, _elm_box_custom_layout,
obj, NULL);
evas_event_freeze(evas);
edje = edje_object_add(evas);
- elm_widget_resize_object_set(obj, edje);
+ elm_widget_resize_object_set(obj, edje, EINA_TRUE);
eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
/* we now must re-theme ourselves to a scroller decoration
* and move the entry looking object to be the content of the
* scrollable view */
- elm_widget_resize_object_set(obj, NULL);
+ elm_widget_resize_object_set(obj, NULL, EINA_TRUE);
elm_widget_sub_object_add(obj, sd->entry_edje);
if (!sd->scr_edje)
evas_object_propagate_events_set(sd->scr_edje, EINA_TRUE);
}
- elm_widget_resize_object_set(obj, sd->scr_edje);
+ elm_widget_resize_object_set(obj, sd->scr_edje, EINA_TRUE);
eo_do(obj, elm_scrollable_interface_objects_set(sd->scr_edje, sd->hit_rect));
eo_do(obj, elm_scrollable_interface_content_set(NULL));
evas_object_hide(sd->scr_edje);
}
- elm_widget_resize_object_set(obj, sd->entry_edje);
+ elm_widget_resize_object_set(obj, sd->entry_edje, EINA_TRUE);
if (sd->scr_edje)
elm_widget_sub_object_add(obj, sd->scr_edje);
wd->content = content;
if (!content) return;
- elm_widget_resize_object_set(obj, content);
+ elm_widget_resize_object_set(obj, content, EINA_TRUE);
evas_object_event_callback_add(content, EVAS_CALLBACK_DEL, _child_del, obj);
evas_object_event_callback_add(content, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_child_change, obj);
// Create image to render Evas_GL Surface
img = evas_object_image_filled_add(evas_object_evas_get(obj));
- elm_widget_resize_object_set(obj, img);
+ elm_widget_resize_object_set(obj, img, EINA_TRUE);
evas_object_image_size_set(img, 1, 1);
eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
elm_widget_sub_object_parent_add(obj);
grid = evas_object_grid_add(evas_object_evas_get(obj));
- elm_widget_resize_object_set(obj, grid);
+ elm_widget_resize_object_set(obj, grid, EINA_TRUE);
evas_object_grid_size_set(wd->resize_obj, 100, 100);
eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
/* has to be there *before* parent's smart_add() */
edje = edje_object_add(evas_object_evas_get(obj));
- elm_widget_resize_object_set(obj, edje);
+ elm_widget_resize_object_set(obj, edje, EINA_TRUE);
eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
elm_widget_sub_object_parent_add(obj);
edje = edje_object_add(evas_object_evas_get(obj));
- elm_widget_resize_object_set(obj, edje);
+ elm_widget_resize_object_set(obj, edje, EINA_TRUE);
eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
{
Elm_Mapbuf_Smart_Data *priv = _pd;
Evas_Object *rect = evas_object_rectangle_add(evas_object_evas_get(obj));
- elm_widget_resize_object_set(obj, rect);
+ elm_widget_resize_object_set(obj, rect, EINA_TRUE);
eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
elm_widget_sub_object_parent_add(obj);
{
sd->block_events = elm_layout_add(obj);
_block_events_theme_apply(obj);
- elm_widget_resize_object_set(obj, sd->block_events);
+ elm_widget_resize_object_set(obj, sd->block_events, EINA_TRUE);
elm_layout_signal_callback_add
(sd->block_events, "elm,action,click", "elm",
_block_area_clicked_cb, obj);
_sizing_eval(obj);
elm_widget_resize_object_set
- (obj, edje_object_add(evas_object_evas_get(obj)));
+ (obj, edje_object_add(evas_object_evas_get(obj)), EINA_TRUE);
elm_widget_theme_object_set
(obj, wd->resize_obj, "photo", "base", "default");
elm_widget_sub_object_parent_add(obj);
edje = edje_object_add(evas_object_evas_get(obj));
- elm_widget_resize_object_set(obj, edje);
+ elm_widget_resize_object_set(obj, edje, EINA_TRUE);
eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
p_obj = ecore_evas_extn_plug_new(ee);
if (!p_obj) return;
- elm_widget_resize_object_set(obj, p_obj);
+ elm_widget_resize_object_set(obj, p_obj, EINA_TRUE);
evas_object_event_callback_add
(wd->resize_obj, EVAS_CALLBACK_MOUSE_UP, _on_mouse_up,
return;
}
- elm_widget_resize_object_set(obj, sd->root->w_obj);
+ elm_widget_resize_object_set(obj, sd->root->w_obj, EINA_TRUE);
_elm_prefs_values_get_default(sd->root, EINA_FALSE);
elm_widget_sub_object_parent_add(obj);
table = evas_object_table_add(evas_object_evas_get(obj));
- elm_widget_resize_object_set(obj, table);
+ elm_widget_resize_object_set(obj, table, EINA_TRUE);
evas_object_event_callback_add
(table, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_size_hints_changed, obj);
eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
elm_widget_sub_object_parent_add(obj);
- elm_widget_resize_object_set(obj, elm_layout_add(obj));
+ elm_widget_resize_object_set(obj, elm_layout_add(obj), EINA_TRUE);
if (!elm_layout_theme_set(wd->resize_obj, "thumb", "base",
elm_widget_style_get(obj)))
elm_widget_sub_object_parent_add(obj);
edje = edje_object_add(evas_object_evas_get(obj));
- elm_widget_resize_object_set(obj, edje);
+ elm_widget_resize_object_set(obj, edje, EINA_TRUE);
eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
elm_object_text_set(resize_obj, "WebKit not supported!");
#endif
- elm_widget_resize_object_set(obj, resize_obj);
+ elm_widget_resize_object_set(obj, resize_obj, EINA_TRUE);
eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
Evas_Object *resize_obj;
resize_obj = _view_add(obj);
- elm_widget_resize_object_set(obj, resize_obj);
+ elm_widget_resize_object_set(obj, resize_obj, EINA_TRUE);
eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
if (obj == sd->resize_obj)
{
/* already dels sub object */
- elm_widget_resize_object_set(sd->obj, NULL);
+ elm_widget_resize_object_set(sd->obj, NULL, EINA_TRUE);
return;
}
else if (obj == sd->hover_obj)
Evas_Object *r_obj = priv->resize_obj;
priv->resize_obj = NULL;
- elm_widget_resize_object_set(obj, r_obj);
+ elm_widget_resize_object_set(obj, r_obj, EINA_TRUE);
}
}
/*
* @internal
*
- * a resize object is a sub object with some more callbacks on it and
- * a smart member of the parent
+ * a resize object is a smart member of the parent.
+ * a resize object is added to and deleted from the sub object of the parent
+ * if the third argument, Eina_Bool sub_obj, is set as EINA_TRUE.
*/
EAPI void
elm_widget_resize_object_set(Evas_Object *obj,
- Evas_Object *sobj)
+ Evas_Object *sobj,
+ Eina_Bool sub_obj)
{
ELM_WIDGET_CHECK(obj);
- eo_do(obj, elm_wdg_resize_object_set(sobj));
+ eo_do(obj, elm_wdg_resize_object_set(sobj, sub_obj));
}
static void
_elm_widget_resize_object_set(Eo *obj, void *_pd, va_list *list)
{
Evas_Object *sobj = va_arg(*list, Evas_Object *);
+ Eina_Bool sub_obj = va_arg(*list, int);
Evas_Object *parent;
Elm_Widget_Smart_Data *sd = _pd;
if (elm_widget_focus_get(sd->resize_obj)) _parents_unfocus(obj);
}
- elm_widget_sub_object_del(obj, sd->resize_obj);
+ if (sub_obj) elm_widget_sub_object_del(obj, sd->resize_obj);
}
sd->resize_obj = sobj;
if (sdp)
{
if (sdp->resize_obj == sobj)
- elm_widget_resize_object_set(parent, NULL);
- else
+ elm_widget_resize_object_set(parent, NULL, sub_obj);
+ else if (sub_obj)
elm_widget_sub_object_del(parent, sobj);
}
}
- elm_widget_sub_object_add(obj, sobj);
+ if (sub_obj) elm_widget_sub_object_add(obj, sobj);
+
evas_object_smart_member_add(sobj, obj);
_smart_reconfigure(sd);
* (priv->sub, "elm,action,click", "", _clicked_signal_cb, obj);
* // set this sub object as the "resize object". widgets get 1 resize
* // object that is resized along with the object wrapper.
- * elm_widget_resize_object_set(obj, priv->sub);
+ * elm_widget_resize_object_set(obj, priv->sub, EINA_TRUE);
* }
*
* static void
EAPI Eina_Bool elm_widget_sub_object_parent_add(Evas_Object *sobj);
EAPI Eina_Bool elm_widget_sub_object_add(Evas_Object *obj, Evas_Object *sobj);
EAPI Eina_Bool elm_widget_sub_object_del(Evas_Object *obj, Evas_Object *sobj);
-EAPI void elm_widget_resize_object_set(Evas_Object *obj, Evas_Object *sobj);
+EAPI void elm_widget_resize_object_set(Evas_Object *obj, Evas_Object *sobj, Eina_Bool sub_obj);
EAPI void elm_widget_hover_object_set(Evas_Object *obj, Evas_Object *sobj);
EAPI void elm_widget_signal_emit(Evas_Object *obj, const char *emission, const char *source);
EAPI void elm_widget_signal_callback_add(Evas_Object *obj, const char *emission, const char *source, Edje_Signal_Cb func, void *data);
* No description supplied by the EAPI.
*
* @param[in] sobj
+ * @param[in] sub_object
*
*/
-#define elm_wdg_resize_object_set(sobj) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_RESIZE_OBJECT_SET), EO_TYPECHECK(Evas_Object *, sobj)
+#define elm_wdg_resize_object_set(sobj, sub_obj) ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_RESIZE_OBJECT_SET), EO_TYPECHECK(Evas_Object *, sobj), EO_TYPECHECK(Eina_Bool, sub_obj)
/**
* @def elm_wdg_hover_object_set