Objects may carry hints, so that another object that acts as a manager (see Smart Object Functions) may know how to properly position and resize its subordinate objects. More...
Functions | |
void | evas_object_size_hint_min_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) |
Retrieves the hints for an object's minimum size. | |
void | evas_object_size_hint_min_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) |
Sets the hints for an object's minimum size. | |
void | evas_object_size_hint_max_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) |
Retrieves the hints for an object's maximum size. | |
void | evas_object_size_hint_max_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) |
Sets the hints for an object's maximum size. | |
void | evas_object_size_hint_request_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) |
Retrieves the hints for an object's optimum size. | |
void | evas_object_size_hint_request_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) |
Sets the hints for an object's optimum size. | |
void | evas_object_size_hint_aspect_get (const Evas_Object *obj, Evas_Aspect_Control *aspect, Evas_Coord *w, Evas_Coord *h) |
Retrieves the hints for an object's aspect ratio. | |
void | evas_object_size_hint_aspect_set (Evas_Object *obj, Evas_Aspect_Control aspect, Evas_Coord w, Evas_Coord h) |
Sets the hints for an object's aspect ratio. | |
void | evas_object_size_hint_align_get (const Evas_Object *obj, double *x, double *y) |
Retrieves the hints for on object's alignment. | |
void | evas_object_size_hint_align_set (Evas_Object *obj, double x, double y) |
Sets the hints for an object's alignment. | |
void | evas_object_size_hint_weight_get (const Evas_Object *obj, double *x, double *y) |
Retrieves the hints for an object's weight. | |
void | evas_object_size_hint_weight_set (Evas_Object *obj, double x, double y) |
Sets the hints for an object's weight. | |
void | evas_object_size_hint_padding_get (const Evas_Object *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b) |
Retrieves the hints for an object's padding space. | |
void | evas_object_size_hint_padding_set (Evas_Object *obj, Evas_Coord l, Evas_Coord r, Evas_Coord t, Evas_Coord b) |
Sets the hints for an object's padding space. |
Detailed Description
Objects may carry hints, so that another object that acts as a manager (see Smart Object Functions) may know how to properly position and resize its subordinate objects.
The Size Hints provide a common interface that is recommended as the protocol for such information.
For example, box objects use alignment hints to align its lines/columns inside its container, padding hints to set the padding between each individual child, etc.
Examples on their usage:
- evas-hints.c
- evas-aspect-hints.c
Function Documentation
void evas_object_size_hint_align_get | ( | const Evas_Object * | obj, |
double * | x, | ||
double * | y | ||
) |
Retrieves the hints for on object's alignment.
- Parameters:
-
obj The given Evas object to query hints from. x Pointer to a double in which to store the horizontal alignment hint. y Pointer to a double in which to store the vertical alignment hint.
This is not a size enforcement in any way, it's just a hint that should be used whenever appropriate.
- Note:
- Use
NULL
pointers on the hint components you're not interested in: they'll be ignored by the function.
- See also:
- evas_object_size_hint_align_set() for more information
Referenced by evas_object_box_layout_flow_horizontal(), evas_object_box_layout_flow_vertical(), evas_object_box_layout_homogeneous_horizontal(), evas_object_box_layout_homogeneous_max_size_horizontal(), evas_object_box_layout_homogeneous_max_size_vertical(), evas_object_box_layout_homogeneous_vertical(), evas_object_box_layout_horizontal(), evas_object_box_layout_stack(), and evas_object_box_layout_vertical().
void evas_object_size_hint_align_set | ( | Evas_Object * | obj, |
double | x, | ||
double | y | ||
) |
Sets the hints for an object's alignment.
- Parameters:
-
obj The given Evas object to query hints from. x Double, ranging from 0.0
to1.0
or with the special value EVAS_HINT_FILL, to use as horizontal alignment hint.y Double, ranging from 0.0
to1.0
or with the special value EVAS_HINT_FILL, to use as vertical alignment hint.
These are hints on how to align an object inside the boundaries of a container/manager. Accepted values are in the 0.0
to 1.0
range, with the special value EVAS_HINT_FILL used to specify "justify" or "fill" by some users. In this case, maximum size hints should be enforced with higher priority, if they are set. Also, any padding hint set on objects should add up to the alignment space on the final scene composition.
See documentation of possible users: in Evas, they are the box and table smart objects.
For the horizontal component, 0.0
means to the left, 1.0
means to the right. Analogously, for the vertical component, 0.0
to the top, 1.0
means to the bottom.
See the following figure:

This is not a size enforcement in any way, it's just a hint that should be used whenever appropriate.
Example:
evas_object_size_hint_align_set( rect, r_data->align_ptr->x, r_data->align_ptr->y); fprintf(stdout, "Changing align hints for %s rect. to (%f, %f)\n", name, r_data->align_ptr->x, r_data->align_ptr->y); return;
In this example the alignment hints change the behavior of an Evas box when layouting its children. See the full example.
void evas_object_size_hint_aspect_get | ( | const Evas_Object * | obj, |
Evas_Aspect_Control * | aspect, | ||
Evas_Coord * | w, | ||
Evas_Coord * | h | ||
) |
Retrieves the hints for an object's aspect ratio.
- Parameters:
-
obj The given Evas object to query hints from. aspect Returns the policy/type of aspect ratio applied to obj
.w Pointer to an integer in which to store the aspect's width ratio term. h Pointer to an integer in which to store the aspect's height ratio term.
The different aspect ratio policies are documented in the Evas_Aspect_Control type. A container respecting these size hints would resize its children accordingly to those policies.
For any policy, if any of the given aspect ratio terms are 0
, the object's container should ignore the aspect and scale obj
to occupy the whole available area. If they are both positive integers, that proportion will be respected, under each scaling policy.
These images illustrate some of the Evas_Aspect_Control policies:




This is not a size enforcement in any way, it's just a hint that should be used whenever appropriate.
- Note:
- Use
NULL
pointers on the hint components you're not interested in: they'll be ignored by the function.
Example:
if (strcmp(ev->keyname, "c") == 0) /* cycle aspect control on obj */ { Evas_Coord w, h; Evas_Aspect_Control aspect; evas_object_size_hint_aspect_get(d.rect, &aspect, &w, &h); aspect = (aspect + 1) % 5; evas_object_size_hint_aspect_set(d.rect, aspect, w, h); fprintf(stdout, "Changing aspect control to %s\n", _get_aspect_name(aspect)); return; }
See the full example.
- See also:
- evas_object_size_hint_aspect_set()
References EVAS_ASPECT_CONTROL_NONE.
void evas_object_size_hint_aspect_set | ( | Evas_Object * | obj, |
Evas_Aspect_Control | aspect, | ||
Evas_Coord | w, | ||
Evas_Coord | h | ||
) |
Sets the hints for an object's aspect ratio.
- Parameters:
-
obj The given Evas object to query hints from. aspect The policy/type of aspect ratio to apply to obj
.w Integer to use as aspect width ratio term. h Integer to use as aspect height ratio term.
This is not a size enforcement in any way, it's just a hint that should be used whenever appropriate.
If any of the given aspect ratio terms are 0
, the object's container will ignore the aspect and scale obj
to occupy the whole available area, for any given policy.
- See also:
- evas_object_size_hint_aspect_get() for more information.
void evas_object_size_hint_max_get | ( | const Evas_Object * | obj, |
Evas_Coord * | w, | ||
Evas_Coord * | h | ||
) |
Retrieves the hints for an object's maximum size.
- Parameters:
-
obj The given Evas object to query hints from. w Pointer to an integer in which to store the maximum width. h Pointer to an integer in which to store the maximum height.
These are hints on the maximum sizes obj
should have. This is not a size enforcement in any way, it's just a hint that should be used whenever appropriate.
- Note:
- Use
NULL
pointers on the hint components you're not interested in: they'll be ignored by the function.
- See also:
- evas_object_size_hint_max_set()
Referenced by evas_object_box_layout_homogeneous_horizontal(), evas_object_box_layout_homogeneous_max_size_horizontal(), evas_object_box_layout_homogeneous_max_size_vertical(), evas_object_box_layout_homogeneous_vertical(), evas_object_box_layout_horizontal(), evas_object_box_layout_stack(), and evas_object_box_layout_vertical().
void evas_object_size_hint_max_set | ( | Evas_Object * | obj, |
Evas_Coord | w, | ||
Evas_Coord | h | ||
) |
Sets the hints for an object's maximum size.
- Parameters:
-
obj The given Evas object to query hints from. w Integer to use as the maximum width hint. h Integer to use as the maximum height hint.
This is not a size enforcement in any way, it's just a hint that should be used whenever appropriate.
Values -1
will be treated as unset hint components, when queried by managers.
Example:
evas_object_size_hint_max_set( rect, r_data->max_ptr->w, r_data->max_ptr->h); fprintf(stdout, "Changing max. size hints for %s rect. to (%d, %d)\n", name, r_data->max_ptr->w, r_data->max_ptr->h); return;
In this example the maximum size hints change the behavior of an Evas box when layouting its children. See the full example.
- See also:
- evas_object_size_hint_max_get()
void evas_object_size_hint_min_get | ( | const Evas_Object * | obj, |
Evas_Coord * | w, | ||
Evas_Coord * | h | ||
) |
Retrieves the hints for an object's minimum size.
- Parameters:
-
obj The given Evas object to query hints from. w Pointer to an integer in which to store the minimum width. h Pointer to an integer in which to store the minimum height.
These are hints on the minimim sizes obj
should have. This is not a size enforcement in any way, it's just a hint that should be used whenever appropriate.
- Note:
- Use
NULL
pointers on the hint components you're not interested in: they'll be ignored by the function.
- See also:
- evas_object_size_hint_min_set() for an example
Referenced by evas_object_box_layout_homogeneous_horizontal(), evas_object_box_layout_homogeneous_max_size_horizontal(), evas_object_box_layout_homogeneous_max_size_vertical(), evas_object_box_layout_homogeneous_vertical(), and evas_object_box_layout_stack().
void evas_object_size_hint_min_set | ( | Evas_Object * | obj, |
Evas_Coord | w, | ||
Evas_Coord | h | ||
) |
Sets the hints for an object's minimum size.
- Parameters:
-
obj The given Evas object to query hints from. w Integer to use as the minimum width hint. h Integer to use as the minimum height hint.
This is not a size enforcement in any way, it's just a hint that should be used whenever appropriate.
Values 0
will be treated as unset hint components, when queried by managers.
Example:
evas_object_size_hint_min_set( rect, r_data->min_ptr->w, r_data->min_ptr->h); fprintf(stdout, "Changing min. size hints for %s rect. to (%d, %d)\n", name, r_data->min_ptr->w, r_data->min_ptr->h); return;
In this example the minimum size hints change the behavior of an Evas box when layouting its children. See the full example.
- See also:
- evas_object_size_hint_min_get()
Referenced by evas_object_box_layout_flow_horizontal(), evas_object_box_layout_flow_vertical(), evas_object_box_layout_homogeneous_horizontal(), evas_object_box_layout_homogeneous_max_size_horizontal(), evas_object_box_layout_homogeneous_max_size_vertical(), evas_object_box_layout_homogeneous_vertical(), evas_object_box_layout_horizontal(), evas_object_box_layout_stack(), and evas_object_box_layout_vertical().
void evas_object_size_hint_padding_get | ( | const Evas_Object * | obj, |
Evas_Coord * | l, | ||
Evas_Coord * | r, | ||
Evas_Coord * | t, | ||
Evas_Coord * | b | ||
) |
Retrieves the hints for an object's padding space.
- Parameters:
-
obj The given Evas object to query hints from. l Pointer to an integer in which to store left padding. r Pointer to an integer in which to store right padding. t Pointer to an integer in which to store top padding. b Pointer to an integer in which to store bottom padding.
Padding is extra space an object takes on each of its delimiting rectangle sides, in canvas units. This space will be rendered transparent, naturally, as in the following figure:

This is not a size enforcement in any way, it's just a hint that should be used whenever appropriate.
- Note:
- Use
NULL
pointers on the hint components you're not interested in: they'll be ignored by the function.
Example:
evas_object_size_hint_padding_set( rect, r_data->padding_ptr->l, r_data->padding_ptr->r, r_data->padding_ptr->t, r_data->padding_ptr->b); fprintf(stdout, "Changing padding size hints for %s rect." " to (%d, %d, %d, %d)\n", name, r_data->padding_ptr->l, r_data->padding_ptr->r, r_data->padding_ptr->t, r_data->padding_ptr->b); return;
In this example the padding hints change the behavior of an Evas box when layouting its children. See the full example.
- See also:
- evas_object_size_hint_padding_set()
Referenced by evas_object_box_layout_flow_horizontal(), evas_object_box_layout_flow_vertical(), evas_object_box_layout_homogeneous_horizontal(), evas_object_box_layout_homogeneous_max_size_horizontal(), evas_object_box_layout_homogeneous_max_size_vertical(), evas_object_box_layout_homogeneous_vertical(), evas_object_box_layout_horizontal(), evas_object_box_layout_stack(), and evas_object_box_layout_vertical().
void evas_object_size_hint_padding_set | ( | Evas_Object * | obj, |
Evas_Coord | l, | ||
Evas_Coord | r, | ||
Evas_Coord | t, | ||
Evas_Coord | b | ||
) |
Sets the hints for an object's padding space.
- Parameters:
-
obj The given Evas object to query hints from. l Integer to specify left padding. r Integer to specify right padding. t Integer to specify top padding. b Integer to specify bottom padding.
This is not a size enforcement in any way, it's just a hint that should be used whenever appropriate.
- See also:
- evas_object_size_hint_padding_get() for more information
void evas_object_size_hint_request_get | ( | const Evas_Object * | obj, |
Evas_Coord * | w, | ||
Evas_Coord * | h | ||
) |
Retrieves the hints for an object's optimum size.
- Parameters:
-
obj The given Evas object to query hints from. w Pointer to an integer in which to store the requested width. h Pointer to an integer in which to store the requested height.
These are hints on the optimum sizes obj
should have. This is not a size enforcement in any way, it's just a hint that should be used whenever appropriate.
- Note:
- Use
NULL
pointers on the hint components you're not interested in: they'll be ignored by the function.
- See also:
- evas_object_size_hint_request_set()
void evas_object_size_hint_request_set | ( | Evas_Object * | obj, |
Evas_Coord | w, | ||
Evas_Coord | h | ||
) |
Sets the hints for an object's optimum size.
- Parameters:
-
obj The given Evas object to query hints from. w Integer to use as the preferred width hint. h Integer to use as the preferred height hint.
This is not a size enforcement in any way, it's just a hint that should be used whenever appropriate.
Values 0
will be treated as unset hint components, when queried by managers.
- See also:
- evas_object_size_hint_request_get()
void evas_object_size_hint_weight_get | ( | const Evas_Object * | obj, |
double * | x, | ||
double * | y | ||
) |
Retrieves the hints for an object's weight.
- Parameters:
-
obj The given Evas object to query hints from. x Pointer to a double in which to store the horizontal weight. y Pointer to a double in which to store the vertical weight.
Accepted values are zero or positive values. Some users might use this hint as a boolean, but some might consider it as a proportion, see documentation of possible users, which in Evas are the box and table smart objects.
This is not a size enforcement in any way, it's just a hint that should be used whenever appropriate.
- Note:
- Use
NULL
pointers on the hint components you're not interested in: they'll be ignored by the function.
- See also:
- evas_object_size_hint_weight_set() for an example
Referenced by evas_object_box_layout_horizontal(), and evas_object_box_layout_vertical().
void evas_object_size_hint_weight_set | ( | Evas_Object * | obj, |
double | x, | ||
double | y | ||
) |
Sets the hints for an object's weight.
- Parameters:
-
obj The given Evas object to query hints from. x Nonnegative double value to use as horizontal weight hint. y Nonnegative double value to use as vertical weight hint.
This is not a size enforcement in any way, it's just a hint that should be used whenever appropriate.
This is a hint on how a container object should resize a given child within its area. Containers may adhere to the simpler logic of just expanding the child object's dimensions to fit its own (see the EVAS_HINT_EXPAND helper weight macro) or the complete one of taking each child's weight hint as real weights to how much of its size to allocate for them in each axis. A container is supposed to, after normalizing the weights of its children (with weight hints), distribute the space it has to layout them by those factors -- most weighted children get larger in this process than the least ones.
Example:
evas_object_size_hint_weight_set( rect, r_data->weight_ptr->x, r_data->weight_ptr->y); fprintf(stdout, "Changing weight hints for %s rect. to (%f, %f)\n", name, r_data->weight_ptr->x, r_data->weight_ptr->y); return;
In this example the weight hints change the behavior of an Evas box when layouting its children. See the full example.
- See also:
- evas_object_size_hint_weight_get() for more information