Tizen Native API
5.0
|
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:
Functions | |
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_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_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_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_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_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_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_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_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. | |
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_weight_set (Evas_Object *obj, double x, double y) |
Sets the hints for an object's weight. | |
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_align_set (Evas_Object *obj, double x, double y) |
Sets the hints for an object's alignment. | |
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_display_mode_set (Evas_Object *obj, Evas_Display_Mode dispmode) |
Sets the hints for an object's disply mode,. | |
Evas_Display_Mode | evas_object_size_hint_display_mode_get (const Evas_Object *obj) |
Retrieves the hints for an object's display mode. |
void evas_object_size_hint_align_get | ( | const Evas_Object * | obj, |
double * | x, | ||
double * | y | ||
) |
Retrieves the hints for on object's alignment.
This is not a size enforcement in any way, it's just a hint that should be used whenever appropriate.
null
pointers on the hint components you're not interested in: they'll be ignored by the function.obj
is invalid, then the hint components will be set with 0.5[in] | obj | The object. |
[out] | x | Double, ranging from 0.0 to 1.0 or with the special value #EVAS_HINT_FILL, to use as horizontal alignment hint. |
[out] | y | Double, ranging from 0.0 to 1.0 or with the special value #EVAS_HINT_FILL, to use as vertical alignment hint. |
void evas_object_size_hint_align_set | ( | Evas_Object * | obj, |
double | x, | ||
double | y | ||
) |
Sets the hints for an object's alignment.
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.
This is not a size enforcement in any way, it's just a hint that should be used whenever appropriate.
[in] | obj | The object. |
[in] | x | Double, ranging from 0.0 to 1.0 or with the special value #EVAS_HINT_FILL, to use as horizontal alignment hint. |
[in] | y | Double, ranging from 0.0 to 1.0 or with the special value #EVAS_HINT_FILL, to use as vertical alignment hint. |
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.
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.
null
pointers on the hint components you're not interested in: they'll be ignored by the function.[in] | obj | The object. |
[out] | aspect | The policy/type of aspect ratio to apply to obj . |
[out] | w | Integer to use as aspect width ratio term. |
[out] | h | Integer to use as aspect height ratio term. |
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.
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.
[in] | obj | The object. |
[in] | aspect | The policy/type of aspect ratio to apply to obj . |
[in] | w | Integer to use as aspect width ratio term. |
[in] | h | Integer to use as aspect height ratio term. |
Evas_Display_Mode evas_object_size_hint_display_mode_get | ( | const Evas_Object * | obj | ) |
Retrieves the hints for an object's display mode.
These are hints on the display mode obj
. This is not a size enforcement in any way, it's just a hint that can be used whenever appropriate. This mode can be used object's display mode like commpress or expand.
[in] | obj | The object. |
void evas_object_size_hint_display_mode_set | ( | Evas_Object * | obj, |
Evas_Display_Mode | dispmode | ||
) |
Sets the hints for an object's disply mode,.
This is not a size enforcement in any way, it's just a hint that can be used whenever appropriate.
[in] | obj | The object. |
[in] | dispmode | Display mode hint. |
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.
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.
null
pointers on the hint components you're not interested in: they'll be ignored by the function.[in] | obj | The object. |
[out] | w | Integer to use as the maximum width hint. |
[out] | h | Integer to use as the maximum height hint. |
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.
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.
[in] | obj | The object. |
[in] | w | Integer to use as the maximum width hint. |
[in] | h | Integer to use as the maximum height hint. |
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.
These are hints on the minimum sizes obj
should have. This is not a size enforcement in any way, it's just a hint that should be used whenever appropriate.
null
pointers on the hint components you're not interested in: they'll be ignored by the function.[in] | obj | The object. |
[out] | w | Integer to use as the minimum width hint. |
[out] | h | Integer to use as the minimum height hint. |
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.
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.
[in] | obj | The object. |
[in] | w | Integer to use as the minimum width hint. |
[in] | h | Integer to use as the minimum height hint. |
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.
Padding is extra space an object takes on each of its delimiting rectangle sides, in canvas units.
This is not a size enforcement in any way, it's just a hint that should be used whenever appropriate.
null
pointers on the hint components you're not interested in: they'll be ignored by the function.[in] | obj | The object. |
[out] | l | Integer to specify left padding. |
[out] | r | Integer to specify right padding. |
[out] | t | Integer to specify top padding. |
[out] | b | Integer to specify bottom padding. |
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.
This is not a size enforcement in any way, it's just a hint that should be used whenever appropriate.
[in] | obj | The object. |
[in] | l | Integer to specify left padding. |
[in] | r | Integer to specify right padding. |
[in] | t | Integer to specify top padding. |
[in] | b | Integer to specify bottom padding. |
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.
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.
null
pointers on the hint components you're not interested in: they'll be ignored by the function.[in] | obj | The object. |
[out] | w | Integer to use as the preferred width hint. |
[out] | h | Integer to use as the preferred height hint. |
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.
This is not a size enforcement in any way, it's just a hint that hould be used whenever appropriate.
Values 0 will be treated as unset hint components, when queried by managers.
[in] | obj | The object. |
[in] | w | Integer to use as the preferred width hint. |
[in] | h | Integer to use as the preferred height hint. |
void evas_object_size_hint_weight_get | ( | const Evas_Object * | obj, |
double * | x, | ||
double * | y | ||
) |
Retrieves the hints for an object's 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.
null
pointers on the hint components you're not interested in: they'll be ignored by the function.obj
is invalid, then the hint components will be set with 0.0.[in] | obj | The object. |
[out] | x | Non-negative double value to use as horizontal weight hint. |
[out] | y | Non-negative double value to use as vertical weight hint. |
void evas_object_size_hint_weight_set | ( | Evas_Object * | obj, |
double | x, | ||
double | y | ||
) |
Sets the hints for an object's weight.
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), distribut the space it has to layout them by those factors -- most weighted children get larger in this process than the least ones.
[in] | obj | The object. |
[in] | x | Non-negative double value to use as horizontal weight hint. |
[in] | y | Non-negative double value to use as vertical weight hint. |