Tizen Native API
Edje Swallow Part

This group discusses functions that deal with parts of type swallow and swallowed objects.

Remarks:
An important feature of Edje is to be able to create Evas_Objects in the code and place them in a layout. And that is what swallowing is all about.
Swallow parts are place holders defined in the EDC file for objects that one may want to include in the layout later, or for objects that are not natives of Edje. In this last case, Edje only only treat the Evas_Object properties of the swallowed objects.

Functions

void edje_extern_object_min_size_set (Evas_Object *obj, Evas_Coord minw, Evas_Coord minh)
 Sets the object's minimum size.
void edje_extern_object_max_size_set (Evas_Object *obj, Evas_Coord maxw, Evas_Coord maxh)
 Sets the object's maximum size.
void edje_extern_object_aspect_set (Evas_Object *obj, Edje_Aspect_Control aspect, Evas_Coord aw, Evas_Coord ah)
 Sets the object's aspect size.
Eina_Bool edje_object_part_swallow (Evas_Object *obj, const char *part, Evas_Object *obj_swallow)
 "Swallows" an object into one of the edje object SWALLOW parts.
void edje_object_part_unswallow (Evas_Object *obj, Evas_Object *obj_swallow)
 Unswallows an object.
Evas_Objectedje_object_part_swallow_get (const Evas_Object *obj, const char *part)
 Gets the object currently swallowed by a part.

Function Documentation

void edje_extern_object_aspect_set ( Evas_Object obj,
Edje_Aspect_Control  aspect,
Evas_Coord  aw,
Evas_Coord  ah 
)

Sets the object's aspect size.

This sets the desired aspect ratio to keep for an object that is swallowed by Edje. The width and height defines a preferred size ASPECT and the object may be scaled to be larger or smaller, but retaining the relative scale of both the aspect width and height.

Since :
2.3.1
Parameters:
[in]objA valid Evas_Object handle
[in]aspectThe aspect control axes
[in]awThe aspect radio width
[in]ahThe aspect ratio height

Sets the object's maximum size.

This sets the maximum size restriction for the object.

Since :
2.3.1
Parameters:
[in]objA valid Evas_Object handle
[in]maxwThe maximum width
[in]maxhThe maximum height

Sets the object's minimum size.

This sets the minimum size restriction for the object.

Since :
2.3.1
Parameters:
[in]objA valid Evas_Object handle
[in]minwThe minimum width
[in]minhThe minimum height
Eina_Bool edje_object_part_swallow ( Evas_Object obj,
const char *  part,
Evas_Object obj_swallow 
)

"Swallows" an object into one of the edje object SWALLOW parts.

Since :
2.3.1
Remarks:
Swallowing an object into an edje object is, for a given part of type SWALLOW in the EDC group, which gave life to obj, to set an external object to be controlled by obj, being displayed exactly over that part's region inside the whole edje object's viewport.

From this point on, obj has total control over obj_swallow's geometry and visibility. For instance, if obj is visible, as in evas_object_show(), the swallowed object is visible too, if the given SWALLOW part it's in is also visible. Other actions on obj also reflect on the swallowed object (e.g. resizing, moving, raising/lowering, and so on).

Finally, all internal changes to part, specifically, reflect on the displaying of obj_swallow, for example state changes leading to different visibility states, geometries, positions, and so on.

Remarks:
If an object has already been swallowed into this part, then it is first unswallowed (as in edje_object_part_unswallow()) before the new object is swallowed.

obj won't delete the swallowed object once it is deleted, obj_swallow gets to an unparented state again.

For more details on EDC SWALLOW parts, see syntax reference".

Parameters:
[in]objA valid edje object handle
[in]partThe swallow part's name
[in]obj_swallowThe object to occupy that part
Returns:
EINA_TRUE if success, otherwise EINA_FALSE
Evas_Object* edje_object_part_swallow_get ( const Evas_Object obj,
const char *  part 
)

Gets the object currently swallowed by a part.

Since :
2.3.1
Parameters:
[in]objA valid Evas_Object handle
[in]partThe part name
Returns:
The swallowed object, otherwise NULL if there are none
void edje_object_part_unswallow ( Evas_Object obj,
Evas_Object obj_swallow 
)

Unswallows an object.

It causes the Edje to regurgitate a previously swallowed object.

Since :
2.3.1
Remarks:
obj_swallow is not deleted or hidden. obj_swallow may appear on the evas depending on the state in which it got unswallowed. Make sure you delete it or hide it if you do not want it.
Parameters:
[in]objA valid Evas_Object handle
[in]obj_swallowThe swallowed object