Enumerations | Functions
Table Smart Object.

Convenience smart object that packs children using a tabular layout using children size hints to define their size and alignment inside their cell space. More...

Enumerations

enum  Evas_Object_Table_Homogeneous_Mode {
  EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE = 0 ,
  EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE = 1 ,
  EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM = 2 ,
  EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE = 0 ,
  EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE = 1 ,
  EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM = 2
}
 How to pack items into cells in a table. More...
 

Functions

EVAS_API void evas_object_table_homogeneous_set (Evas_Table *obj, Evas_Object_Table_Homogeneous_Mode homogeneous)
 Set how this table should layout children. More...
 
EVAS_API Evas_Object_Table_Homogeneous_Mode evas_object_table_homogeneous_get (const Evas_Table *obj)
 Set how this table should layout children. More...
 
EVAS_API void evas_object_table_align_set (Evas_Table *obj, double horizontal, double vertical)
 Control the alignment of the whole bounding box of contents. More...
 
EVAS_API void evas_object_table_align_get (const Evas_Table *obj, double *horizontal, double *vertical)
 Control the alignment of the whole bounding box of contents. More...
 
EVAS_API void evas_object_table_padding_set (Evas_Table *obj, int horizontal, int vertical)
 Control the padding between cells. More...
 
EVAS_API void evas_object_table_padding_get (const Evas_Table *obj, int *horizontal, int *vertical)
 Control the padding between cells. More...
 
EVAS_API void evas_object_table_col_row_size_get (const Evas_Table *obj, int *cols, int *rows)
 Get the number of columns and rows this table takes. More...
 
EVAS_API Eina_Listevas_object_table_children_get (const Evas_Table *obj)
 Get the list of children for the table. More...
 
EVAS_API Efl_Canvas_Objectevas_object_table_child_get (const Evas_Table *obj, unsigned short col, unsigned short row)
 Get the child of the table at the given coordinates. More...
 
EVAS_API void evas_object_table_clear (Evas_Table *obj, Eina_Bool clear)
 Faster way to remove all child objects from a table object. More...
 
EVAS_API Eina_Accessorevas_object_table_accessor_new (const Evas_Table *obj)
 Get an accessor to get random access to the list of children for the table. More...
 
EVAS_API Eina_Iteratorevas_object_table_iterator_new (const Evas_Table *obj)
 Get an iterator to walk the list of children for the table. More...
 
EVAS_API Efl_Canvas_Objectevas_object_table_add_to (Evas_Table *obj)
 Create a table that is child of a given element parent. More...
 
EVAS_API Eina_Bool evas_object_table_pack_get (const Evas_Table *obj, Efl_Canvas_Object *child, unsigned short *col, unsigned short *row, unsigned short *colspan, unsigned short *rowspan)
 Get packing location of a child of table. More...
 
EVAS_API Eina_Bool evas_object_table_pack (Evas_Table *obj, Efl_Canvas_Object *child, unsigned short col, unsigned short row, unsigned short colspan, unsigned short rowspan)
 Add a new child to a table object or set its current packing. More...
 
EVAS_API Eina_Bool evas_object_table_unpack (Evas_Table *obj, Efl_Canvas_Object *child)
 Remove child from table. More...
 
EVAS_API Evas_Objectevas_object_table_add (Evas *evas)
 Create a new table. More...
 
EVAS_API void evas_object_table_mirrored_set (Eo *obj, Eina_Bool mirrored)
 Control the mirrored mode of the table. More...
 
EVAS_API Eina_Bool evas_object_table_mirrored_get (const Eo *obj)
 Control the mirrored mode of the table. More...
 

Detailed Description

Convenience smart object that packs children using a tabular layout using children size hints to define their size and alignment inside their cell space.

Table Smart Object example shows how to use this Evas_Object.

See also
Size Hints

Enumeration Type Documentation

◆ Evas_Object_Table_Homogeneous_Mode

How to pack items into cells in a table.

See evas_obj_table_homogeneous_get for an explanation of the function of each one.

Enumerator
EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE 

No mode specified.

EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE 

Table mode.

EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM 

Item mode.

EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE 

No mode specified.

EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE 

Table mode.

EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM 

Item mode.

Function Documentation

◆ evas_object_table_homogeneous_set()

EVAS_API void evas_object_table_homogeneous_set ( Evas_Table *  obj,
Evas_Object_Table_Homogeneous_Mode  homogeneous 
)

Set how this table should layout children.

Todo: consider aspect hint and respect it.

EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE If table does not use homogeneous mode then columns and rows will be calculated based on hints of individual cells. This operation mode is more flexible, but more complex and heavy to calculate as well. Weight properties are handled as a boolean expand. Negative alignment will be considered as 0.5. This is the default.

Todo: EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE should balance weight.

EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE When homogeneous is relative to table the own table size is divided equally among children, filling the whole table area. That is, if table has WIDTH and COLUMNS, each cell will get WIDTH / COLUMNS pixels. If children have minimum size that is larger than this amount (including padding), then it will overflow and be aligned respecting the alignment hint, possible overlapping sibling cells. Weight hint is used as a boolean, if greater than zero it will make the child expand in that axis, taking as much space as possible (bounded to maximum size hint). Negative alignment will be considered as 0.5.

EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM When homogeneous is relative to item it means the greatest minimum cell size will be used. That is, if no element is set to expand, the table will have its contents to a minimum size, the bounding box of all these children will be aligned relatively to the table object using evas_object_table_align_get(). If the table area is too small to hold this minimum bounding box, then the objects will keep their size and the bounding box will overflow the box area, still respecting the alignment. Weight hint is used as a boolean, if greater than zero it will make that cell expand in that axis, toggling the expand mode, which makes the table behave much like EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE, except that the bounding box will overflow and items will not overlap siblings. If no minimum size is provided at all then the table will fallback to expand mode as well.

Parameters
[in]objThe object.
[in]homogeneousTable homogeneous mode

◆ evas_object_table_homogeneous_get()

EVAS_API Evas_Object_Table_Homogeneous_Mode evas_object_table_homogeneous_get ( const Evas_Table *  obj)

Set how this table should layout children.

Todo: consider aspect hint and respect it.

EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE If table does not use homogeneous mode then columns and rows will be calculated based on hints of individual cells. This operation mode is more flexible, but more complex and heavy to calculate as well. Weight properties are handled as a boolean expand. Negative alignment will be considered as 0.5. This is the default.

Todo: EVAS_OBJECT_TABLE_HOMOGENEOUS_NONE should balance weight.

EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE When homogeneous is relative to table the own table size is divided equally among children, filling the whole table area. That is, if table has WIDTH and COLUMNS, each cell will get WIDTH / COLUMNS pixels. If children have minimum size that is larger than this amount (including padding), then it will overflow and be aligned respecting the alignment hint, possible overlapping sibling cells. Weight hint is used as a boolean, if greater than zero it will make the child expand in that axis, taking as much space as possible (bounded to maximum size hint). Negative alignment will be considered as 0.5.

EVAS_OBJECT_TABLE_HOMOGENEOUS_ITEM When homogeneous is relative to item it means the greatest minimum cell size will be used. That is, if no element is set to expand, the table will have its contents to a minimum size, the bounding box of all these children will be aligned relatively to the table object using evas_object_table_align_get(). If the table area is too small to hold this minimum bounding box, then the objects will keep their size and the bounding box will overflow the box area, still respecting the alignment. Weight hint is used as a boolean, if greater than zero it will make that cell expand in that axis, toggling the expand mode, which makes the table behave much like EVAS_OBJECT_TABLE_HOMOGENEOUS_TABLE, except that the bounding box will overflow and items will not overlap siblings. If no minimum size is provided at all then the table will fallback to expand mode as well.

Parameters
[in]objThe object.
Returns
Table homogeneous mode

◆ evas_object_table_align_set()

EVAS_API void evas_object_table_align_set ( Evas_Table *  obj,
double  horizontal,
double  vertical 
)

Control the alignment of the whole bounding box of contents.

Parameters
[in]objThe object.
[in]horizontalHorizontal alignment
[in]verticalVertical alignment

◆ evas_object_table_align_get()

EVAS_API void evas_object_table_align_get ( const Evas_Table *  obj,
double *  horizontal,
double *  vertical 
)

Control the alignment of the whole bounding box of contents.

Parameters
[in]objThe object.
[out]horizontalHorizontal alignment
[out]verticalVertical alignment

◆ evas_object_table_padding_set()

EVAS_API void evas_object_table_padding_set ( Evas_Table *  obj,
int  horizontal,
int  vertical 
)

Control the padding between cells.

Parameters
[in]objThe object.
[in]horizontalHorizontal padding
[in]verticalVertical padding

◆ evas_object_table_padding_get()

EVAS_API void evas_object_table_padding_get ( const Evas_Table *  obj,
int *  horizontal,
int *  vertical 
)

Control the padding between cells.

Parameters
[in]objThe object.
[out]horizontalHorizontal padding
[out]verticalVertical padding

◆ evas_object_table_col_row_size_get()

EVAS_API void evas_object_table_col_row_size_get ( const Evas_Table *  obj,
int *  cols,
int *  rows 
)

Get the number of columns and rows this table takes.

Note
columns and rows are virtual entities, one can specify a table with a single object that takes 4 columns and 5 rows. The only difference for a single cell table is that paddings will be accounted proportionally.
Parameters
[in]objThe object.
[out]colsColumns in table
[out]rowsRows in table

◆ evas_object_table_children_get()

EVAS_API Eina_List * evas_object_table_children_get ( const Evas_Table *  obj)

Get the list of children for the table.

Note
This is a duplicate of the list kept by the table internally. It's up to the user to destroy it when it no longer needs it. It's possible to remove objects from the table when walking this list, but these removals won't be reflected on it.
Parameters
[in]objThe object.
Returns
Children list

◆ evas_object_table_child_get()

EVAS_API Efl_Canvas_Object * evas_object_table_child_get ( const Evas_Table *  obj,
unsigned short  col,
unsigned short  row 
)

Get the child of the table at the given coordinates.

Note
This does not take into account col/row spanning
Parameters
[in]objThe object.
[in]colChild column
[in]rowChild row
Returns
Child object

◆ evas_object_table_clear()

EVAS_API void evas_object_table_clear ( Evas_Table *  obj,
Eina_Bool  clear 
)

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

Parameters
[in]objThe object.
[in]clearIf true, it will delete just removed children.

◆ evas_object_table_accessor_new()

EVAS_API Eina_Accessor * evas_object_table_accessor_new ( const Evas_Table *  obj)

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

Note
Do not remove or delete objects while walking the list.
Parameters
[in]objThe object.
Returns
Accessor to children list

◆ evas_object_table_iterator_new()

EVAS_API Eina_Iterator * evas_object_table_iterator_new ( const Evas_Table *  obj)

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

Note
Do not remove or delete objects while walking the list.
Parameters
[in]objThe object.
Returns
Iterator to children

◆ evas_object_table_add_to()

EVAS_API Efl_Canvas_Object * evas_object_table_add_to ( Evas_Table *  obj)

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

Parameters
[in]objThe object.
Returns
Children table

◆ evas_object_table_pack_get()

EVAS_API Eina_Bool evas_object_table_pack_get ( const Evas_Table *  obj,
Efl_Canvas_Object child,
unsigned short *  col,
unsigned short *  row,
unsigned short *  colspan,
unsigned short *  rowspan 
)

Get packing location of a child of table.

Parameters
[in]objThe object.
[in]childThe child object to add.
[out]colPointer to store relative-horizontal position to place child.
[out]rowPointer to store relative-vertical position to place child.
[out]colspanPointer to store how many relative-horizontal positions to use for this child.
[out]rowspanPointer to store how many relative-vertical positions to use for this child.
Returns
true on success, false on failure.
Since
1.1

◆ evas_object_table_pack()

EVAS_API Eina_Bool evas_object_table_pack ( Evas_Table *  obj,
Efl_Canvas_Object child,
unsigned short  col,
unsigned short  row,
unsigned short  colspan,
unsigned short  rowspan 
)

Add a new child to a table object or set its current packing.

Note that columns and rows only guarantee 16bit unsigned values at best. That means that col + colspan AND row + rowspan must fit inside 16bit unsigned values cleanly. You will be warned once values exceed 15bit storage, and attempting to use values not able to fit in 16bits will result in failure.

Parameters
[in]objThe object.
[in]childThe child object to add.
[in]colRelative-horizontal position to place child.
[in]rowRelative-vertical position to place child.
[in]colspanHow many relative-horizontal positions to use for this child.
[in]rowspanHow many relative-vertical positions to use for this child.
Returns
true on success, false on failure.

◆ evas_object_table_unpack()

EVAS_API Eina_Bool evas_object_table_unpack ( Evas_Table *  obj,
Efl_Canvas_Object child 
)

Remove child from table.

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_table_clear instead.
Parameters
[in]objThe object.
[in]childChild to be removed
Returns
true on success, false on failure.

◆ evas_object_table_add()

EVAS_API Evas_Object * evas_object_table_add ( Evas evas)

Create a new table.

Parameters
evasCanvas in which table will be added.

References EINA_SAFETY_ON_FALSE_RETURN_VAL, and EVAS_CANVAS_CLASS.

◆ evas_object_table_mirrored_set()

EVAS_API void evas_object_table_mirrored_set ( Eo *  obj,
Eina_Bool  mirrored 
)

Control the mirrored mode of the table.

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

Parameters
[in]objThe object.
[in]mirroredtrue if mirrored, false otherwise
Since
1.1

◆ evas_object_table_mirrored_get()

EVAS_API Eina_Bool evas_object_table_mirrored_get ( const Eo *  obj)

Control the mirrored mode of the table.

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

Parameters
[in]objThe object.
Returns
true if mirrored, false otherwise
Since
1.1