Convenience smart object that packs children under a regular grid layout, using their virtual grid location and size to determine children's positions inside the grid object's area. More...

Macros

#define EVAS_OBJ_GRID_CLASS   evas_object_grid_class_get()
 
#define EVAS_OBJ_GRID_ID(sub_id)   (EVAS_OBJ_GRID_BASE_ID + sub_id)
 
#define evas_obj_grid_add(ret)   EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_ADD), EO_TYPECHECK(Evas_Object **, ret)
 
#define evas_obj_grid_add_to(ret)   EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_ADD_TO), EO_TYPECHECK(Evas_Object **, ret)
 
#define evas_obj_grid_size_set(w, h)   EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_SIZE_SET), EO_TYPECHECK(int, w), EO_TYPECHECK(int, h)
 
#define evas_obj_grid_size_get(w, h)   EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_SIZE_GET), EO_TYPECHECK(int *, w), EO_TYPECHECK(int *, h)
 
#define evas_obj_grid_pack(child, x, y, w, h, ret)   EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_PACK), EO_TYPECHECK(Evas_Object *, child), EO_TYPECHECK(int, x), EO_TYPECHECK(int, y), EO_TYPECHECK(int, w), EO_TYPECHECK(int, h), EO_TYPECHECK(Eina_Bool *, ret)
 
#define evas_obj_grid_unpack(child, ret)   EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_UNPACK), EO_TYPECHECK(Evas_Object *, child), EO_TYPECHECK(Eina_Bool *, ret)
 
#define evas_obj_grid_clear(clear)   EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_CLEAR), EO_TYPECHECK(Eina_Bool, clear)
 
#define evas_obj_grid_pack_get(child, x, y, w, h, ret)   EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_PACK_GET), EO_TYPECHECK(Evas_Object *, child), EO_TYPECHECK(int *, x), EO_TYPECHECK(int *, y), EO_TYPECHECK(int *, w), EO_TYPECHECK(int *, h), EO_TYPECHECK(Eina_Bool *, ret)
 
#define evas_obj_grid_iterator_new(ret)   EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_ITERATOR_NEW), EO_TYPECHECK(Eina_Iterator **, ret)
 
#define evas_obj_grid_accessor_new(ret)   EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_ACCESSOR_NEW), EO_TYPECHECK(Eina_Accessor **, ret)
 
#define evas_obj_grid_children_get(ret)   EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_CHILDREN_GET), EO_TYPECHECK(Eina_List **, ret)
 
#define evas_obj_grid_mirrored_get(ret)   EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_MIRRORED_GET), EO_TYPECHECK(Eina_Bool *, ret)
 
#define evas_obj_grid_mirrored_set(mirrored)   EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_MIRRORED_SET), EO_TYPECHECK(Eina_Bool, mirrored)
 

Enumerations

enum  {
  EVAS_OBJ_GRID_SUB_ID_ADD_TO,
  EVAS_OBJ_GRID_SUB_ID_SIZE_SET,
  EVAS_OBJ_GRID_SUB_ID_SIZE_GET,
  EVAS_OBJ_GRID_SUB_ID_PACK,
  EVAS_OBJ_GRID_SUB_ID_UNPACK,
  EVAS_OBJ_GRID_SUB_ID_CLEAR,
  EVAS_OBJ_GRID_SUB_ID_PACK_GET,
  EVAS_OBJ_GRID_SUB_ID_ITERATOR_NEW,
  EVAS_OBJ_GRID_SUB_ID_ACCESSOR_NEW,
  EVAS_OBJ_GRID_SUB_ID_CHILDREN_GET,
  EVAS_OBJ_GRID_SUB_ID_MIRRORED_GET,
  EVAS_OBJ_GRID_SUB_ID_MIRRORED_SET,
  EVAS_OBJ_GRID_SUB_ID_LAST
}
 

Functions

const Eo_Classevas_object_grid_class_get (void)
 
Evas_Objectevas_object_grid_add (Evas *evas)
 Create a new grid.
 
Evas_Objectevas_object_grid_add_to (Evas_Object *parent)
 Create a grid that is child of a given element parent.
 
void evas_object_grid_size_set (Evas_Object *o, int w, int h)
 Set the virtual resolution for the grid.
 
void evas_object_grid_size_get (const Evas_Object *o, int *w, int *h)
 Get the current virtual resolution.
 
void evas_object_grid_mirrored_set (Evas_Object *o, Eina_Bool mirrored)
 Sets the mirrored mode of the grid.
 
Eina_Bool evas_object_grid_mirrored_get (const Evas_Object *o)
 Gets the mirrored mode of the grid.
 
Eina_Bool evas_object_grid_pack (Evas_Object *o, Evas_Object *child, int x, int y, int w, int h)
 Add a new child to a grid object.
 
Eina_Bool evas_object_grid_unpack (Evas_Object *o, Evas_Object *child)
 Remove child from grid.
 
void evas_object_grid_clear (Evas_Object *o, Eina_Bool clear)
 Faster way to remove all child objects from a grid object.
 
Eina_Bool evas_object_grid_pack_get (const Evas_Object *o, Evas_Object *child, int *x, int *y, int *w, int *h)
 Get the pack options for a grid child.
 
Eina_Iteratorevas_object_grid_iterator_new (const Evas_Object *o)
 Get an iterator to walk the list of children for the grid.
 
Eina_Accessorevas_object_grid_accessor_new (const Evas_Object *o)
 Get an accessor to get random access to the list of children for the grid.
 
Eina_Listevas_object_grid_children_get (const Evas_Object *o)
 Get the list of children for the grid.
 

Variables

Eo_Op EVAS_OBJ_GRID_BASE_ID
 

Detailed Description

Convenience smart object that packs children under a regular grid layout, using their virtual grid location and size to determine children's positions inside the grid object's area.

Since
1.1

Macro Definition Documentation

#define evas_obj_grid_add (   ret)    EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_ADD), EO_TYPECHECK(Evas_Object **, ret)
Since
1.8

Create a new grid.

Parameters
[out]ret
See Also
evas_object_grid_add
#define evas_obj_grid_add_to (   ret)    EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_ADD_TO), EO_TYPECHECK(Evas_Object **, ret)
Since
1.8

Create a grid that is child of a given element parent.

Parameters
[out]ret
See Also
evas_object_grid_add_to

Referenced by evas_object_grid_add_to().

#define evas_obj_grid_size_set (   w,
 
)    EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_SIZE_SET), EO_TYPECHECK(int, w), EO_TYPECHECK(int, h)
Since
1.8

Set the virtual resolution for the grid

Parameters
[in]w
[in]h
See Also
evas_object_grid_size_set

Referenced by evas_object_grid_size_set().

#define evas_obj_grid_size_get (   w,
 
)    EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_SIZE_GET), EO_TYPECHECK(int *, w), EO_TYPECHECK(int *, h)
Since
1.8

Get the current virtual resolution

Parameters
[out]w
[out]h
See Also
evas_object_grid_size_get

Referenced by evas_object_grid_size_get().

#define evas_obj_grid_pack (   child,
  x,
  y,
  w,
  h,
  ret 
)    EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_PACK), EO_TYPECHECK(Evas_Object *, child), EO_TYPECHECK(int, x), EO_TYPECHECK(int, y), EO_TYPECHECK(int, w), EO_TYPECHECK(int, h), EO_TYPECHECK(Eina_Bool *, ret)
Since
1.8

Add a new child to a grid object.

Parameters
[in]child
[in]x
[in]y
[in]w
[in]h
[out]ret
See Also
evas_object_grid_pack

Referenced by evas_object_grid_pack().

#define evas_obj_grid_unpack (   child,
  ret 
)    EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_UNPACK), EO_TYPECHECK(Evas_Object *, child), EO_TYPECHECK(Eina_Bool *, ret)
Since
1.8

Remove child from grid.

Parameters
[in]child
[out]ret
See Also
evas_object_grid_unpack

Referenced by evas_object_grid_unpack().

#define evas_obj_grid_clear (   clear)    EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_CLEAR), EO_TYPECHECK(Eina_Bool, clear)
Since
1.8

Faster way to remove all child objects from a grid object.

Parameters
[in]clear
See Also
evas_object_grid_clear

Referenced by evas_object_grid_clear().

#define evas_obj_grid_pack_get (   child,
  x,
  y,
  w,
  h,
  ret 
)    EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_PACK_GET), EO_TYPECHECK(Evas_Object *, child), EO_TYPECHECK(int *, x), EO_TYPECHECK(int *, y), EO_TYPECHECK(int *, w), EO_TYPECHECK(int *, h), EO_TYPECHECK(Eina_Bool *, ret)
Since
1.8

Get the pack options for a grid child

Parameters
[in]child
[out]x
[out]y
[out]w
[out]h
[out]ret
See Also
evas_object_grid_pack_get

Referenced by evas_object_grid_pack_get().

#define evas_obj_grid_iterator_new (   ret)    EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_ITERATOR_NEW), EO_TYPECHECK(Eina_Iterator **, ret)
Since
1.8

Get an iterator to walk the list of children for the grid.

Parameters
[out]ret
See Also
evas_object_grid_iterator_new

Referenced by evas_object_grid_iterator_new().

#define evas_obj_grid_accessor_new (   ret)    EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_ACCESSOR_NEW), EO_TYPECHECK(Eina_Accessor **, ret)
Since
1.8

Get an accessor to get random access to the list of children for the grid.

Parameters
[out]ret
See Also
evas_object_grid_accessor_new

Referenced by evas_object_grid_accessor_new().

#define evas_obj_grid_children_get (   ret)    EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_CHILDREN_GET), EO_TYPECHECK(Eina_List **, ret)
Since
1.8

Get the list of children for the grid.

Parameters
[out]ret
See Also
evas_object_grid_children_get

Referenced by evas_object_grid_children_get().

#define evas_obj_grid_mirrored_get (   ret)    EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_MIRRORED_GET), EO_TYPECHECK(Eina_Bool *, ret)
Since
1.8

Gets the mirrored mode of the grid.

Parameters
[out]ret
See Also
evas_object_grid_mirrored_get

Referenced by evas_object_grid_mirrored_get().

#define evas_obj_grid_mirrored_set (   mirrored)    EVAS_OBJ_GRID_ID(EVAS_OBJ_GRID_SUB_ID_MIRRORED_SET), EO_TYPECHECK(Eina_Bool, mirrored)
Since
1.8

Sets the mirrored mode of the grid. In mirrored mode the grid items go

Parameters
[in]mirrored
See Also
evas_object_grid_mirrored_set

Referenced by evas_object_grid_mirrored_set().

Function Documentation

Evas_Object* evas_object_grid_add ( Evas evas)

Create a new grid.

It's set to a virtual size of 1x1 by default and add children with evas_object_grid_pack().

Since
1.1

References eo_add, and eo_unref().

Evas_Object* evas_object_grid_add_to ( Evas_Object parent)

Create a grid that is child of a given element parent.

See Also
evas_object_grid_add()
Since
1.1

References eo_do, and evas_obj_grid_add_to.

void evas_object_grid_size_set ( Evas_Object o,
int  w,
int  h 
)

Set the virtual resolution for the grid.

Parameters
oThe grid object to modify
wThe virtual horizontal size (resolution) in integer units
hThe virtual vertical size (resolution) in integer units
Since
1.1

References eo_do, and evas_obj_grid_size_set.

void evas_object_grid_size_get ( const Evas_Object o,
int *  w,
int *  h 
)

Get the current virtual resolution.

Parameters
oThe grid object to query
wA pointer to an integer to store the virtual width
hA pointer to an integer to store the virtual height
See Also
evas_object_grid_size_set()
Since
1.1

References eo_do, and evas_obj_grid_size_get.

void evas_object_grid_mirrored_set ( Evas_Object o,
Eina_Bool  mirrored 
)

Sets the mirrored mode of the grid.

In mirrored mode the grid items go from right to left instead of left to right. That is, 0,0 is top right, not to left.

Parameters
oThe grid object.
mirroredthe mirrored mode to set
Since
1.1

References eo_do, and evas_obj_grid_mirrored_set.

Eina_Bool evas_object_grid_mirrored_get ( const Evas_Object o)

Gets the mirrored mode of the grid.

Parameters
oThe grid object.
Returns
EINA_TRUE if it's a mirrored grid, EINA_FALSE otherwise.
See Also
evas_object_grid_mirrored_set()
Since
1.1

References EINA_FALSE, eo_do, and evas_obj_grid_mirrored_get.

Eina_Bool evas_object_grid_pack ( Evas_Object o,
Evas_Object child,
int  x,
int  y,
int  w,
int  h 
)

Add a new child to a grid object.

Parameters
oThe given grid object.
childThe child object to add.
xThe virtual x coordinate of the child
yThe virtual y coordinate of the child
wThe virtual width of the child
hThe virtual height of the child
Returns
1 on success, 0 on failure.
Since
1.1

References EINA_FALSE, eo_do, and evas_obj_grid_pack.

Eina_Bool evas_object_grid_unpack ( Evas_Object o,
Evas_Object child 
)

Remove child from grid.

Note
removing a child will immediately call a walk over children in order to recalculate numbers of columns and rows. If you plan to remove all children, use evas_object_grid_clear() instead.
Returns
1 on success, 0 on failure.
Since
1.1

References EINA_FALSE, eo_do, and evas_obj_grid_unpack.

void evas_object_grid_clear ( Evas_Object o,
Eina_Bool  clear 
)

Faster way to remove all child objects from a grid object.

Parameters
oThe given grid object.
clearif true, it will delete just removed children.
Since
1.1

References eo_do, and evas_obj_grid_clear.

Eina_Bool evas_object_grid_pack_get ( const Evas_Object o,
Evas_Object child,
int *  x,
int *  y,
int *  w,
int *  h 
)

Get the pack options for a grid child.

Get the pack x, y, width and height in virtual coordinates set by evas_object_grid_pack()

Parameters
oThe grid object
childThe grid child to query for coordinates
xThe pointer to where the x coordinate will be returned
yThe pointer to where the y coordinate will be returned
wThe pointer to where the width will be returned
hThe pointer to where the height will be returned
Returns
1 on success, 0 on failure.
Since
1.1

References EINA_FALSE, eo_do, and evas_obj_grid_pack_get.

Eina_Iterator* evas_object_grid_iterator_new ( const Evas_Object o)

Get an iterator to walk the list of children for the grid.

Note
Do not remove or delete objects while walking the list.
Since
1.1

References eo_do, and evas_obj_grid_iterator_new.

Eina_Accessor* evas_object_grid_accessor_new ( const Evas_Object o)

Get an accessor to get random access to the list of children for the grid.

Note
Do not remove or delete objects while walking the list.
Since
1.1

References eo_do, and evas_obj_grid_accessor_new.

Eina_List* evas_object_grid_children_get ( const Evas_Object o)

Get the list of children for the grid.

Note
This is a duplicate of the list kept by the grid internally. It's up to the user to destroy it when it no longer needs it. It's possible to remove objects from the grid when walking this list, but these removals won't be reflected on it.
Since
1.1

References eo_do, and evas_obj_grid_children_get.