layout sizing eval call - plus generic singal

SVN revision: 44272
This commit is contained in:
Carsten Haitzler 2009-12-08 04:41:02 +00:00
parent 5e7c1eb4db
commit 58df307651
2 changed files with 36 additions and 2 deletions

View File

@ -462,7 +462,8 @@ extern "C" {
EAPI Eina_Bool elm_layout_file_set(Evas_Object *obj, const char *file, const char *group);
EAPI void elm_layout_content_set(Evas_Object *obj, const char *swallow, Evas_Object *content);
EAPI Evas_Object *elm_layout_edje_get(const Evas_Object *obj);
/* smart callbacks called:
EAPI void elm_layout_sizing_eval(const Evas_Object *obj);
/* smart callbacks called:
*/
typedef enum _Elm_Notify_Orient

View File

@ -117,6 +117,12 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
}
}
static void
_signal_size_eval(void *data, Evas_Object *obj, const char *emission, const char *source)
{
_request_sizing_eval(data);
}
/**
* Add a new layout to the parent
*
@ -144,7 +150,9 @@ elm_layout_add(Evas_Object *parent)
wd->lay = edje_object_add(e);
elm_widget_resize_object_set(obj, wd->lay);
edje_object_signal_callback_add(wd->lay, "size,eval", "elm",
_signal_size_eval, obj);
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
_request_sizing_eval(obj);
@ -216,6 +224,12 @@ elm_layout_content_set(Evas_Object *obj, const char *swallow, Evas_Object *conte
* Get the edje layout
*
* @param obj The layout object
*
* This returns the edje object. It is not expected to be used to then swallow
* objects via edje_object_part_swallow() for example. Use
* elm_layout_content_set() instead so child object handling and sizing is
* done properly. This is more intended for setting text, emitting signals,
* hooking to singal callbacks etc.
*
* @return A Evas_Object with the edje layout settings loaded
* with function elm_layout_file_set
@ -229,3 +243,22 @@ elm_layout_edje_get(const Evas_Object *obj)
return wd->lay;
}
/**
* Get the edje layout
*
* Manually fors a sizing re-evaluation when contents changed state so that
* minimum size might have changed and needs re-evaluation. Also note that
* a standard signal of "size,eval" "elm" emitted by the edje object will
* cause this to happen too
*
* @param obj The layout object
*
* @ingroup Layout
*/
EAPI void
elm_layout_sizing_eval(const Evas_Object *obj)
{
Widget_Data *wd = elm_widget_data_get(obj);
_request_sizing_eval(obj);
}