Tizen Native API
5.0
|
A box is a convenience smart object that packs children inside it in sequence, using a layouting function specified by the user. There are a couple of pre-made layouting functions built-in in Evas, all of them using children size hints to define their size and alignment inside their cell space.
Examples on this smart object's usage:
Functions | |
void | evas_object_box_smart_set (Evas_Object_Box_Api *api) |
const Evas_Object_Box_Api * | evas_object_box_smart_class_get (void) |
Typedefs | |
typedef struct _Evas_Object_Box_Api | Evas_Object_Box_Api |
typedef struct _Evas_Object_Box_Data | Evas_Object_Box_Data |
typedef struct _Evas_Object_Box_Option | Evas_Object_Box_Option |
typedef void(* | Evas_Object_Box_Layout )(Evas_Object *o, Evas_Object_Box_Data *priv, void *user_data) |
Defines | |
#define | EVAS_OBJECT_BOX_API_VERSION 1 |
#define | EVAS_OBJECT_BOX_API_INIT(smart_class_init) {smart_class_init, EVAS_OBJECT_BOX_API_VERSION, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL} |
#define | EVAS_OBJECT_BOX_API_INIT_NULL EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NULL) |
#define | EVAS_OBJECT_BOX_API_INIT_VERSION EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_VERSION) |
#define | EVAS_OBJECT_BOX_API_INIT_NAME_VERSION(name) EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name)) |
#define EVAS_OBJECT_BOX_API_INIT | ( | smart_class_init | ) | {smart_class_init, EVAS_OBJECT_BOX_API_VERSION, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL} |
Initializer for a whole Evas_Object_Box_Api structure, with NULL
values on its specific fields.
smart_class_init | initializer to use for the "base" field (Evas_Smart_Class). |
#define EVAS_OBJECT_BOX_API_INIT_NAME_VERSION | ( | name | ) | EVAS_OBJECT_BOX_API_INIT(EVAS_SMART_CLASS_INIT_NAME_VERSION(name)) |
Initializer to zero out a whole Evas_Object_Box_Api structure and set its name and version.
This is similar to EVAS_OBJECT_BOX_API_INIT_NULL, but it will also set the version field of Evas_Smart_Class (base field) to the latest EVAS_SMART_CLASS_VERSION and name it to the specific value.
It will keep a reference to the name field as a "const char *"
, i.e., the name must be available while the structure is used (hint: static or global variable!) and must not be modified.
Initializer to zero out a whole Evas_Object_Box_Api structure.
Initializer to zero out a whole Evas_Object_Box_Api structure and set a specific version on it.
This is similar to EVAS_OBJECT_BOX_API_INIT_NULL, but it will set the version field of Evas_Smart_Class (base field) to the latest EVAS_SMART_CLASS_VERSION.
#define EVAS_OBJECT_BOX_API_VERSION 1 |
Current version for Evas box object smart class, a value which goes to _Evas_Object_Box_Api::version.
Smart class extension, providing extra box object requirements.
Smart object instance data, providing box object requirements.
Function signature for an Evas box object layouting routine. By o it will be passed the box object in question, by priv it will be passed the box's internal data and, by user_data, it will be passed any custom data one could have set to a given box layouting function, with evas_object_box_layout_set().
The base structure for a box option. Box options are a way of extending box items properties, which will be taken into account for layouting decisions. The box layouting functions provided by Evas will only rely on objects' canonical size hints to layout them, so the basic box option has no (custom) property set.
Users creating their own layouts, but not depending on extra child items' properties, would be fine just using evas_object_box_layout_set(). But if one desires a layout depending on extra child properties, he/she has to subclass the box smart object. Thus, by using evas_object_box_smart_class_get() and evas_object_box_smart_set(), the option_new()
and option_free()
smart class functions should be properly redefined/extended.
Object properties are bound to an integer identifier and must have a name string. Their values are open to any data. See the API on option properties for more details.
Evas_Object* evas_object_box_add | ( | Evas * | evas | ) |
Add a new box object on the provided canvas.
evas | The canvas to create the box object on. |
NULL
on error, a pointer to a new box object on success.After instantiation, if a box object hasn't its layout function set, via evas_object_box_layout_set(), it will have it by default set to evas_object_box_layout_horizontal(). The remaining properties of the box must be set/retrieved via evas_object_box_{h,v}_{align,padding}_{get,set)()
.
Eina_List* evas_object_box_children_get | ( | const Evas_Object * | o | ) |
Get the list of children objects in a given box object.
o | The box to retrieve an items list from |
o's
child objects, on success, or NULL
, on errors (or if it has no child objects)The returned list should be freed with eina_list_free()
when you no longer need it.
Eina_Bool evas_object_box_option_property_get | ( | const Evas_Object * | o, |
Evas_Object_Box_Option * | opt, | ||
int | property, | ||
... | |||
) |
Get a property's value (by its given numerical identifier), on a given box child element
o | The box parenting the child element |
opt | The box option structure bound to the child box element to get a property from |
property | The numerical ID of the given property |
... | (List of) pointer(s) where to store the value(s) set for this property. It (they) must point to variable(s) of the same type the user has defined for it (them). |
EINA_TRUE
on success, EINA_FALSE
on failure.NULL
.property
, and call evas_object_box_option_property_vget() with this list and the same previous arguments.Eina_Bool evas_object_box_option_property_set | ( | Evas_Object * | o, |
Evas_Object_Box_Option * | opt, | ||
int | property, | ||
... | |||
) |
Set a property value (by its given numerical identifier), on a given box child element
o | The box parenting the child element |
opt | The box option structure bound to the child box element to set a property on |
property | The numerical ID of the given property |
... | (List of) actual value(s) to be set for this property. It (they) must be of the same type the user has defined for it (them). |
EINA_TRUE
on success, EINA_FALSE
on failure.NULL
.property
, and call evas_object_box_option_property_vset() with this list and the same previous arguments.Eina_Bool evas_object_box_option_property_vget | ( | const Evas_Object * | o, |
Evas_Object_Box_Option * | opt, | ||
int | property, | ||
va_list | args | ||
) |
Get a property's value (by its given numerical identifier), on a given box child element -- by a variable argument list
o | The box parenting the child element |
opt | The box option structure bound to the child box element to get a property from |
property | The numerical ID of the given property |
args | The variable argument list with pointers to where to store the values of this property. They must point to variables of the same type the user has defined for them. |
EINA_TRUE
on success, EINA_FALSE
on failure.This is a variable argument list variant of the evas_object_box_option_property_get(). See its documentation for more details.
Eina_Bool evas_object_box_option_property_vset | ( | Evas_Object * | o, |
Evas_Object_Box_Option * | opt, | ||
int | property, | ||
va_list | args | ||
) |
Set a property value (by its given numerical identifier), on a given box child element -- by a variable argument list
o | The box parenting the child element |
opt | The box option structure bound to the child box element to set a property on |
property | The numerical ID of the given property |
args | The variable argument list implementing the value to be set for this property. It must be of the same type the user has defined for it. |
EINA_TRUE
on success, EINA_FALSE
on failure.This is a variable argument list variant of the evas_object_box_option_property_set(). See its documentation for more details.
const Evas_Object_Box_Api* evas_object_box_smart_class_get | ( | void | ) |
Get the Evas box smart class, for inheritance purposes.
The returned value is not to be modified, just use it as your parent class.
void evas_object_box_smart_set | ( | Evas_Object_Box_Api * | api | ) |
Set the default box api struct (Evas_Object_Box_Api) with the default values. May be used to extend that API.
api | The box API struct to set back, most probably with overridden fields (on class extensions scenarios) |