Tizen Native API  4.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.

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.

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.
If obj is invalid, then the hint components will be set with 0.5
Since :
2.3.1
Parameters:
[in]objThe object.
[out]xDouble, ranging from 0.0 to 1.0 or with the special value #EVAS_HINT_FILL, to use as horizontal alignment hint.
[out]yDouble, ranging from 0.0 to 1.0 or with the special value #EVAS_HINT_FILL, to use as vertical alignment hint.
Examples:
evas-hints.c.
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.

Note:
Default alignment hint values are 0.5, for both axis.
Since :
2.3.1
Parameters:
[in]objThe object.
[in]xDouble, ranging from 0.0 to 1.0 or with the special value #EVAS_HINT_FILL, to use as horizontal alignment hint.
[in]yDouble, ranging from 0.0 to 1.0 or with the special value #EVAS_HINT_FILL, to use as vertical alignment hint.
Examples:
evas-hints.c.
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.

Note:
Use null pointers on the hint components you're not interested in: they'll be ignored by the function.
Since :
2.3.1
Parameters:
[in]objThe object.
[out]aspectThe policy/type of aspect ratio to apply to obj.
[out]wInteger to use as aspect width ratio term.
[out]hInteger to use as aspect height ratio term.
Examples:
evas-aspect-hints.c.

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.

Note:
Smart objects(such as elementary) can have their own size hint policy. So calling this API may or may not affect the size of smart objects.
Since :
2.3.1
Parameters:
[in]objThe object.
[in]aspectThe policy/type of aspect ratio to apply to obj.
[in]wInteger to use as aspect width ratio term.
[in]hInteger to use as aspect height ratio term.
Examples:
evas-aspect-hints.c.
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.

Since :
2.3.1
Parameters:
[in]objThe object.
Returns:
Display mode hint.
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.

Since :
2.3.1
Parameters:
[in]objThe object.
[in]dispmodeDisplay 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.

Note:
Use null pointers on the hint components you're not interested in: they'll be ignored by the function.
Since :
2.3.1
Parameters:
[in]objThe object.
[out]wInteger to use as the maximum width hint.
[out]hInteger to use as the maximum height hint.
Examples:
evas-hints.c.

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.

Note:
Smart objects (such as elementary) can have their own size hint policy. So calling this API may or may not affect the size of smart objects.
Since :
2.3.1
Parameters:
[in]objThe object.
[in]wInteger to use as the maximum width hint.
[in]hInteger to use as the maximum height hint.
Examples:
evas-hints.c.
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.

Note:
Use null pointers on the hint components you're not interested in: they'll be ignored by the function.
Since :
2.3.1
Parameters:
[in]objThe object.
[out]wInteger to use as the minimum width hint.
[out]hInteger to use as the minimum height hint.
Examples:
evas-hints.c.

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.

Note:
Smart objects(such as elementary) can have their own size hint policy. So calling this API may or may not affect the size of smart objects.
Since :
2.3.1
Parameters:
[in]objThe object.
[in]wInteger to use as the minimum width hint.
[in]hInteger to use as the minimum height hint.
Examples:
edje-box2.c, edje-table.c, evas-box.c, evas-hints.c, and evas-table.c.
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.

Note:
Use null pointers on the hint components you're not interested in: they'll be ignored by the function.
Since :
2.3.1
Parameters:
[in]objThe object.
[out]lInteger to specify left padding.
[out]rInteger to specify right padding.
[out]tInteger to specify top padding.
[out]bInteger to specify bottom padding.
Examples:
evas-hints.c.

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.

Note:
Smart objects(such as elementary) can have their own size hint policy. So calling this API may or may not affect the size of smart objects.
Since :
2.3.1
Parameters:
[in]objThe object.
[in]lInteger to specify left padding.
[in]rInteger to specify right padding.
[in]tInteger to specify top padding.
[in]bInteger to specify bottom padding.
Examples:
evas-hints.c.
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.

Note:
Use null pointers on the hint components you're not interested in: they'll be ignored by the function.
Since :
3.0
Parameters:
[in]objThe object.
[out]wInteger to use as the preferred width hint.
[out]hInteger to use as the preferred height hint.

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.

Note:
Smart objects(such as elementary) can have their own size hint policy. So calling this API may or may not affect the size of smart objects.
Since :
3.0
Parameters:
[in]objThe object.
[in]wInteger to use as the preferred width hint.
[in]hInteger 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.

Note:
Use null pointers on the hint components you're not interested in: they'll be ignored by the function.
If obj is invalid, then the hint components will be set with 0.0.
Since :
2.3.1
Parameters:
[in]objThe object.
[out]xNon-negative double value to use as horizontal weight hint.
[out]yNon-negative double value to use as vertical weight hint.
Examples:
evas-hints.c.
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.

Note:
Default weight hint values are 0.0, for both axis.
Since :
2.3.1
Parameters:
[in]objThe object.
[in]xNon-negative double value to use as horizontal weight hint.
[in]yNon-negative double value to use as vertical weight hint.
Examples:
edje-table.c, and evas-hints.c.