Edje Swallow Part

Functions that deal with parts of type swallow and swallowed objects. More...

Typedefs

typedef enum _Edje_Aspect_Control Edje_Aspect_Control
 

Enumerations

enum  _Edje_Aspect_Control {
  EDJE_ASPECT_CONTROL_NONE = 0,
  EDJE_ASPECT_CONTROL_NEITHER = 1,
  EDJE_ASPECT_CONTROL_HORIZONTAL = 2,
  EDJE_ASPECT_CONTROL_VERTICAL = 3,
  EDJE_ASPECT_CONTROL_BOTH = 4
}
 
#define edje_obj_part_swallow(part, obj_swallow, ret)   EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_SWALLOW), EO_TYPECHECK(const char *, part), EO_TYPECHECK(Evas_Object *, obj_swallow), EO_TYPECHECK(Eina_Bool *, ret)
 "Swallows" an object into one of the Edje object SWALLOW More...
 
#define edje_obj_part_unswallow(obj_swallow)   EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_UNSWALLOW), EO_TYPECHECK(Evas_Object *, obj_swallow)
 Unswallow an object. More...
 
#define edje_obj_part_swallow_get(part, ret)   EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_SWALLOW_GET), EO_TYPECHECK(const char *, part), EO_TYPECHECK(Evas_Object **, ret)
 Get the object currently swallowed by a part. More...
 
void edje_extern_object_min_size_set (Evas_Object *obj, Evas_Coord minw, Evas_Coord minh)
 Set the object minimum size. More...
 
void edje_extern_object_max_size_set (Evas_Object *obj, Evas_Coord maxw, Evas_Coord maxh)
 Set the object maximum size. More...
 
void edje_extern_object_aspect_set (Evas_Object *obj, Edje_Aspect_Control aspect, Evas_Coord aw, Evas_Coord ah)
 Set the object aspect size. More...
 
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. More...
 
void edje_object_part_unswallow (Evas_Object *obj, Evas_Object *obj_swallow)
 Unswallow an object. More...
 
Evas_Objectedje_object_part_swallow_get (const Evas_Object *obj, const char *part)
 Get the object currently swallowed by a part. More...
 

Detailed Description

Functions that deal with parts of type swallow and swallowed objects.

A important feature of Edje is to be able to create Evas_Objects in 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 native of Edje. In this last case, Edje will only treat the Evas_Object properties of the swallowed objects.

Macro Definition Documentation

#define edje_obj_part_swallow (   part,
  obj_swallow,
  ret 
)    EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_SWALLOW), EO_TYPECHECK(const char *, part), EO_TYPECHECK(Evas_Object *, obj_swallow), EO_TYPECHECK(Eina_Bool *, ret)

"Swallows" an object into one of the Edje object SWALLOW

Since
1.8
Parameters
[in]part
[in]obj_swallow
[out]ret
See Also
edje_object_part_swallow

Referenced by edje_object_part_swallow().

#define edje_obj_part_unswallow (   obj_swallow)    EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_UNSWALLOW), EO_TYPECHECK(Evas_Object *, obj_swallow)

Unswallow an object.

Since
1.8
Parameters
[in]obj_swallow
See Also
edje_object_part_unswallow

Referenced by edje_object_part_unswallow().

#define edje_obj_part_swallow_get (   part,
  ret 
)    EDJE_OBJ_ID(EDJE_OBJ_SUB_ID_PART_SWALLOW_GET), EO_TYPECHECK(const char *, part), EO_TYPECHECK(Evas_Object **, ret)

Get the object currently swallowed by a part.

Since
1.8
Parameters
[in]part
[out]ret
See Also
edje_object_part_swallow_get

Referenced by edje_object_part_swallow_get().

Function Documentation

void edje_extern_object_min_size_set ( Evas_Object obj,
Evas_Coord  minw,
Evas_Coord  minh 
)

Set the object minimum size.

Parameters
objA valid Evas_Object handle
minwThe minimum width
minhThe minimum height

This sets the minimum size restriction for the object.

References evas_object_data_get(), and evas_object_size_hint_min_set().

void edje_extern_object_max_size_set ( Evas_Object obj,
Evas_Coord  maxw,
Evas_Coord  maxh 
)

Set the object maximum size.

Parameters
objA valid Evas_Object handle
maxwThe maximum width
maxhThe maximum height

This sets the maximum size restriction for the object.

References evas_object_data_get(), and evas_object_size_hint_max_set().

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

Set the object aspect size.

Parameters
objA valid Evas_Object handle
aspectThe aspect control axes
awThe aspect radio width
ahThe aspect ratio height

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

References EVAS_ASPECT_CONTROL_BOTH, EVAS_ASPECT_CONTROL_HORIZONTAL, EVAS_ASPECT_CONTROL_NEITHER, EVAS_ASPECT_CONTROL_NONE, EVAS_ASPECT_CONTROL_VERTICAL, evas_object_data_get(), and evas_object_size_hint_aspect_set().

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.

Parameters
objA valid Edje object handle
partThe swallow part's name
obj_swallowThe object to occupy that part

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 will have total control over obj_swallow's geometry and visibility. For instance, if obj is visible, as in evas_object_show(), the swallowed object will be visible too – if the given SWALLOW part it's in is also visible. Other actions on obj will also reflect on the swallowed object as well (e.g. resizing, moving, raising/lowering, etc.).

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

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

Note
obj won't delete the swallowed object once it is deleted – obj_swallow will get to an unparented state again.

For more details on EDC SWALLOW parts, see syntaxreference".

Examples:
edje-swallow.c, and evas-aspect-hints.c.

References edje_obj_part_swallow, and EINA_FALSE.

void edje_object_part_unswallow ( Evas_Object obj,
Evas_Object obj_swallow 
)

Unswallow an object.

Parameters
objA valid Evas_Object handle
obj_swallowThe swallowed object

Causes the edje to regurgitate a previously swallowed object. :)

Note
obj_swallow will not be deleted or hidden.
obj_swallow may appear shown on the evas depending on its state when it got unswallowed. Make sure you delete it or hide it if you do not want it to.

References edje_obj_part_unswallow.

Evas_Object* edje_object_part_swallow_get ( const Evas_Object obj,
const char *  part 
)

Get the object currently swallowed by a part.

Parameters
objA valid Evas_Object handle
partThe part name
Returns
The swallowed object, or NULL if there is none.
Examples:
edje-swallow.c.

References edje_obj_part_swallow_get.