[evas] Documenting our dear size hints.

Examples coming in sequence.



SVN revision: 60459
This commit is contained in:
Gustavo Lima Chaves 2011-06-17 21:16:49 +00:00
parent 665837d7df
commit b3b4adabdf
11 changed files with 28732 additions and 119 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -554,12 +554,12 @@ struct _Evas_Precision_Position
typedef enum _Evas_Aspect_Control typedef enum _Evas_Aspect_Control
{ {
EVAS_ASPECT_CONTROL_NONE = 0, EVAS_ASPECT_CONTROL_NONE = 0, /**< Preference on scaling unset */
EVAS_ASPECT_CONTROL_NEITHER = 1, EVAS_ASPECT_CONTROL_NEITHER = 1, /**< Same effect as unset preference on scaling */
EVAS_ASPECT_CONTROL_HORIZONTAL = 2, EVAS_ASPECT_CONTROL_HORIZONTAL = 2, /**< Use all horizontal container space to place an object, using the given aspect */
EVAS_ASPECT_CONTROL_VERTICAL = 3, EVAS_ASPECT_CONTROL_VERTICAL = 3, /**< Use all vertical container space to place an object, using the given aspect */
EVAS_ASPECT_CONTROL_BOTH = 4 EVAS_ASPECT_CONTROL_BOTH = 4 /**< Use all horizontal @b and vertical container spaces to place an object (never growing it out of those bounds), using the given aspect */
} Evas_Aspect_Control; } Evas_Aspect_Control; /**< Aspect types/policies for scaling size hints, used for evas_object_size_hint_aspect_set() */
typedef struct _Evas_Pixel_Import_Source Evas_Pixel_Import_Source; /**< A source description of pixels for importing pixels */ typedef struct _Evas_Pixel_Import_Source Evas_Pixel_Import_Source; /**< A source description of pixels for importing pixels */
typedef struct _Evas_Engine_Info Evas_Engine_Info; /**< A generic Evas Engine information structure */ typedef struct _Evas_Engine_Info Evas_Engine_Info; /**< A generic Evas Engine information structure */
@ -4173,223 +4173,327 @@ EAPI void evas_map_point_color_get (const Evas_Map *m, int
/** /**
* @defgroup Evas_Object_Group_Size_Hints Size Hints * @defgroup Evas_Object_Group_Size_Hints Size Hints
* *
* Objects may carry hints so another object that acts as a manager * Objects may carry hints, so that another object that acts as a
* (see @ref Evas_Smart_Object_Group) may know how to properly position * manager (see @ref Evas_Smart_Object_Group) may know how to properly
* and resize the object. The Size Hints provide a common interface * position and resize its subordinate objects. The Size Hints provide
* that is recommended as the protocol for such information. * 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.
* *
* @ingroup Evas_Object_Group * @ingroup Evas_Object_Group
*/ */
/** /**
* Retrieves the size hint for the minimum size. * @addtogroup Evas_Object_Group_Size_Hints
* @{
*/
/**
* Retrieves the hints for an object's minimum size.
* *
* This is not a size enforcement in any way, it's just a hint that should * @param obj The given Evas object to query hints from.
* be used whenever appropriate. * @param w Pointer to an integer in which to store the minimum width.
* @param h Pointer to an integer in which to store the minimum height.
* *
* Note that if any of @p w or @p h are @c NULL, the @c NULL * These are hints on the minimim sizes @p obj should have. This is
* parameters are ignored. * not a size enforcement in any way, it's just a hint that should be
* used whenever appropriate.
* *
* @param obj The given Evas object. * @note Use @c NULL pointers on the hint components you're not
* @param w Pointer to an integer in which to store the minimum width. * interested in: they'll be ignored by the function.
* @param h Pointer to an integer in which to store the minimum height. *
* @see evas_object_size_hint_min_set()
*/ */
EAPI void evas_object_size_hint_min_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1); EAPI void evas_object_size_hint_min_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
/** /**
* Sets the size hint for the minimum size. * 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 * @param obj The given Evas object to query hints from.
* be used whenever appropriate. * @param w Integer to use as the minimum width hint.
* @param h Integer to use as the minimum height hint.
* *
* Value 0 is considered unset. * This is not a size enforcement in any way, it's just a hint that
* should be used whenever appropriate.
* *
* @param obj The given Evas object. * Values @c 0 will be treated as unset hint components, when queried
* @param w Integer to use as the minimum width hint. * by managers.
* @param h Integer to use as the minimum height hint. *
* @see evas_object_size_hint_min_get()
*/ */
EAPI void evas_object_size_hint_min_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1); EAPI void evas_object_size_hint_min_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
/** /**
* Retrieves the size hint for the maximum size. * Retrieves the hints for an object's maximum size.
* *
* This is not a size enforcement in any way, it's just a hint that should * @param obj The given Evas object to query hints from.
* be used whenever appropriate. * @param w Pointer to an integer in which to store the maximum width.
* @param h Pointer to an integer in which to store the maximum height.
* *
* Note that if any of @p w or @p h are @c NULL, the @c NULL * These are hints on the maximum sizes @p obj should have. This is
* parameters are ignored. * not a size enforcement in any way, it's just a hint that should be
* used whenever appropriate.
* *
* @param obj The given Evas object. * @note Use @c NULL pointers on the hint components you're not
* @param w Pointer to an integer in which to store the maximum width. * interested in: they'll be ignored by the function.
* @param h Pointer to an integer in which to store the maximum height. *
* @see evas_object_size_hint_max_set()
*/ */
EAPI void evas_object_size_hint_max_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1); EAPI void evas_object_size_hint_max_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
/** /**
* Sets the size hint for the maximum size. * 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 * @param obj The given Evas object to query hints from.
* be used whenever appropriate. * @param w Integer to use as the maximum width hint.
* @param h Integer to use as the maximum height hint.
* *
* Value -1 is considered unset. * This is not a size enforcement in any way, it's just a hint that
* should be used whenever appropriate.
* *
* @param obj The given Evas object. * Values @c -1 will be treated as unset hint components, when queried
* @param w Integer to use as the maximum width hint. * by managers.
* @param h Integer to use as the maximum height hint. *
* @see evas_object_size_hint_max_get()
*/ */
EAPI void evas_object_size_hint_max_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1); EAPI void evas_object_size_hint_max_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
/** /**
* Retrieves the size request hint. * Retrieves the hints for an object's optimum size.
* *
* This is not a size enforcement in any way, it's just a hint that should * @param obj The given Evas object to query hints from.
* be used whenever appropriate. * @param w Pointer to an integer in which to store the requested width.
* @param h Pointer to an integer in which to store the requested height.
* *
* Note that if any of @p w or @p h are @c NULL, the @c NULL * These are hints on the optimum sizes @p obj should have. This is
* parameters are ignored. * not a size enforcement in any way, it's just a hint that should be
* used whenever appropriate.
* *
* @param obj The given Evas object. * @note Use @c NULL pointers on the hint components you're not
* @param w Pointer to an integer in which to store the requested width. * interested in: they'll be ignored by the function.
* @param h Pointer to an integer in which to store the requested height. *
* @see evas_object_size_hint_request_set()
*/ */
EAPI void evas_object_size_hint_request_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1); EAPI void evas_object_size_hint_request_get (const Evas_Object *obj, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
/** /**
* Sets the requested size 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 should * @param obj The given Evas object to query hints from.
* be used whenever appropriate. * @param w Integer to use as the preferred width hint.
* @param h Integer to use as the preferred height hint.
* *
* Value 0 is considered unset. * This is not a size enforcement in any way, it's just a hint that
* should be used whenever appropriate.
* *
* @param obj The given Evas object. * Values @c 0 will be treated as unset hint components, when queried
* @param w Integer to use as the preferred width hint. * by managers.
* @param h Integer to use as the preferred height hint. *
* @see evas_object_size_hint_request_get()
*/ */
EAPI void evas_object_size_hint_request_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1); EAPI void evas_object_size_hint_request_set (Evas_Object *obj, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
/** /**
* Retrieves the size aspect control hint. * Retrieves the hints for an object's aspect ratio.
* *
* This is not a size enforcement in any way, it's just a hint that should * @param obj The given Evas object to query hints from.
* be used whenever appropriate. * @param aspect Returns the policy/type of aspect ratio applied to @p obj.
* @param w Pointer to an integer in which to store the aspect's width
* ratio term.
* @param h Pointer to an integer in which to store the aspect's
* height ratio term.
* *
* Note that if any of @p aspect, @p w or @p h are @c NULL, the @c NULL * The different aspect ratio policies are documented in the
* parameters are ignored. * #Evas_Aspect_Control type. A container respecting these size hints
* would @b scale its children accordingly to those policies.
* *
* @param obj The given Evas object. * For any policy, if any of the given aspect ratio terms are @c 0,
* @param aspect Returns the hint on how size should be calculated. * the object's container should ignore the aspect and scale @p obj to
* @param w Pointer to an integer in which to store the aspect width. * occupy the whole available area. If they are both positive
* @param h Pointer to an integer in which to store the aspect height. * integers, that proportion will be respected, under each scaling
* policy.
*
* These images illustrate some of the #Evas_Aspect_Control policies:
*
* @image html any-policy.png
* @image rtf any-policy.png
* @image latex any-policy.eps
*
* @image html aspect-control-none-neither.png
* @image rtf aspect-control-none-neither.png
* @image latex aspect-control-none-neither.eps
*
* @image html aspect-control-both.png
* @image rtf aspect-control-both.png
* @image latex aspect-control-both.eps
*
* @image html aspect-control-horizontal.png
* @image rtf aspect-control-horizontal.png
* @image latex aspect-control-horizontal.eps
*
* This is not a size enforcement in any way, it's just a hint that
* should be used whenever appropriate.
*
* @note Use @c NULL pointers on the hint components you're not
* interested in: they'll be ignored by the function.
*
* @see evas_object_size_hint_aspect_set()
*/ */
EAPI void evas_object_size_hint_aspect_get (const Evas_Object *obj, Evas_Aspect_Control *aspect, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1); EAPI void evas_object_size_hint_aspect_get (const Evas_Object *obj, Evas_Aspect_Control *aspect, Evas_Coord *w, Evas_Coord *h) EINA_ARG_NONNULL(1);
/** /**
* Sets the size aspect control hint. * Sets the hints for an object's aspect ratio.
*
* @param obj The given Evas object to query hints from.
* @param aspect The policy/type of aspect ratio to apply to @p obj.
* @param w Integer to use as aspect width ratio term.
* @param 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 * This is not a size enforcement in any way, it's just a hint that should
* be used whenever appropriate. * be used whenever appropriate.
* *
* @param obj The given Evas object. * If any of the given aspect ratio terms are @c 0,
* @param aspect Hint on how to calculate size. * the object's container will ignore the aspect and scale @p obj to
* @param w Integer to use as aspect width hint. * occupy the whole available area, for any given policy.
* @param h Integer to use as aspect height hint. *
* @see evas_object_size_hint_aspect_get() for more information.
*/ */
EAPI void evas_object_size_hint_aspect_set (Evas_Object *obj, Evas_Aspect_Control aspect, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1); EAPI void evas_object_size_hint_aspect_set (Evas_Object *obj, Evas_Aspect_Control aspect, Evas_Coord w, Evas_Coord h) EINA_ARG_NONNULL(1);
/** /**
* Retrieves the size align control hint. * Retrieves the hints for on object's alignment.
* *
* This is not a size enforcement in any way, it's just a hint that should * @param obj The given Evas object to query hints from.
* be used whenever appropriate. * @param x Pointer to a double in which to store the horizontal
* alignment hint.
* @param y Pointer to a double in which to store the vertical
* alignment hint.
* *
* Note that if any of @p x or @p y are @c NULL, the @c NULL * This is not a size enforcement in any way, it's just a hint that
* parameters are ignored. * should be used whenever appropriate.
* *
* @param obj The given Evas object. * @note Use @c NULL pointers on the hint components you're not
* @param x Pointer to a double in which to store the align x. * interested in: they'll be ignored by the function.
* @param y Pointer to a double in which to store the align y. *
* @see evas_object_size_hint_align_set() for more information
*/ */
EAPI void evas_object_size_hint_align_get (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1); EAPI void evas_object_size_hint_align_get (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
/** /**
* Sets the size align control hint. * Sets the hints for an object's alignment.
* *
* This is not a size enforcement in any way, it's just a hint that should * @param obj The given Evas object to query hints from.
* be used whenever appropriate. * @param x Double, ranging from @c 0.0 to @c 1.0 or with the
* special value #EVAS_HINT_FILL, to use as horizontal alignment hint.
* @param y Double, ranging from @c 0.0 to @c 1.0 or with the
* special value #EVAS_HINT_FILL, to use as vertical alignment hint.
* *
* Accepted values are in the 0.0 to 1.0 range, with the special value * These are hints on how to align an object <b>inside the boundaries
* -1.0 used to specify "justify" or "fill" by some users. See * of a container/manager</b>. Accepted values are in the @c 0.0 to @c
* documentation of possible users. * 1.0 range, with the special value #EVAS_HINT_FILL used to specify
* "justify" or "fill" by some users. See documentation of possible
* users: in Evas, they are the @ref Evas_Object_Box "box" and @ref
* Evas_Object_Table "table" smart objects.
* *
* @param obj The given Evas object. * For the horizontal component, @c 0.0 means to the left, @c 1.0
* @param x Double (0.0..1.0 or -1.0) to use as align x hint. * means to the right. Analogously, for the vertical component, @c 0.0
* @param y Double (0.0..1.0 or -1.0) to use as align y hint. * to the top, @c 1.0 means to the bottom.
*
* See the following figure:
* @image html alignment-hints.png
* @image rtf alignment-hints.png
* @image latex alignment-hints.eps
*
* This is not a size enforcement in any way, it's just a hint that
* should be used whenever appropriate.
*
* @see evas_object_size_hint_align_get()
*/ */
EAPI void evas_object_size_hint_align_set (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1); EAPI void evas_object_size_hint_align_set (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
/** /**
* Retrieves the size weight control hint. * Retrieves the hints for an object's weight.
* *
* This is not a size enforcement in any way, it's just a hint that should * @param obj The given Evas object to query hints from.
* be used whenever appropriate. * @param x Pointer to a double in which to store the horizontal weight.
* * @param y Pointer to a double in which to store the vertical weight.
* Note that if any of @p x or @p y are @c NULL, the @c NULL
* parameters are ignored.
* *
* Accepted values are zero or positive values. Some users might use * Accepted values are zero or positive values. Some users might use
* this hint as a boolean, but some might consider it as a proportion, * this hint as a boolean, but some might consider it as a @b
* see documentation of possible users. * proportion, see documentation of possible users, which in Evas are
* the @ref Evas_Object_Box "box" and @ref Evas_Object_Table "table"
* smart objects.
* *
* @param obj The given Evas object. * This is not a size enforcement in any way, it's just a hint that
* @param x Pointer to a double in which to store the weight x. * should be used whenever appropriate.
* @param y Pointer to a double in which to store the weight y. *
* @note Use @c NULL pointers on the hint components you're not
* interested in: they'll be ignored by the function.
*
* @see evas_object_size_hint_weight_set()
*/ */
EAPI void evas_object_size_hint_weight_get (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1); EAPI void evas_object_size_hint_weight_get (const Evas_Object *obj, double *x, double *y) EINA_ARG_NONNULL(1);
/** /**
* Sets the size weight control hint. * Sets the hints for an object's weight.
*
* @param obj The given Evas object to query hints from.
* @param x Double (@c 0.0-1.0) to use as horizontal weight hint.
* @param y Double (@c 0.0-1.0) to use as vertical weight hint.
* *
* This is not a size enforcement in any way, it's just a hint that should * This is not a size enforcement in any way, it's just a hint that should
* be used whenever appropriate. * be used whenever appropriate.
* *
* @param obj The given Evas object. * @see evas_object_size_hint_weight_get() for more information
* @param x Double (0.0-1.0) to use as weight x hint.
* @param y Double (0.0-1.0) to use as weight y hint.
*/ */
EAPI void evas_object_size_hint_weight_set (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1); EAPI void evas_object_size_hint_weight_set (Evas_Object *obj, double x, double y) EINA_ARG_NONNULL(1);
/** /**
* Retrieves the size padding control hint. * Retrieves the hints for an object's padding space.
* *
* This is not a size enforcement in any way, it's just a hint that should * @param obj The given Evas object to query hints from.
* be used whenever appropriate. * @param l Pointer to an integer in which to store left padding.
* @param r Pointer to an integer in which to store right padding.
* @param t Pointer to an integer in which to store top padding.
* @param b Pointer to an integer in which to store bottom padding.
* *
* Note that if any of @p l, @p r, @p t or @p b are @c NULL, the @c * Padding is extra space an object takes on each of its delimiting
* NULL parameters are ignored. * rectangle sides, in canvas units. This space will be rendered
* transparent, naturally.
* *
* @param obj The given Evas object. * This is not a size enforcement in any way, it's just a hint that
* @param l Pointer to an integer in which to store left padding. * should be used whenever appropriate.
* @param r Pointer to an integer in which to store right padding. *
* @param t Pointer to an integer in which to store top padding. * @note Use @c NULL pointers on the hint components you're not
* @param b Pointer to an integer in which to store bottom padding. * interested in: they'll be ignored by the function.
*
* @see evas_object_size_hint_padding_set()
*/ */
EAPI void evas_object_size_hint_padding_get (const Evas_Object *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b) EINA_ARG_NONNULL(1); EAPI void evas_object_size_hint_padding_get (const Evas_Object *obj, Evas_Coord *l, Evas_Coord *r, Evas_Coord *t, Evas_Coord *b) EINA_ARG_NONNULL(1);
/** /**
* Sets the size padding control hint. * 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 * @param obj The given Evas object to query hints from.
* be used whenever appropriate. * @param l Integer to specify left padding.
* @param r Integer to specify right padding.
* @param t Integer to specify top padding.
* @param b Integer to specify bottom padding.
* *
* @param obj The given Evas object. * This is not a size enforcement in any way, it's just a hint that
* @param l Integer to specify left padding. * should be used whenever appropriate.
* @param r Integer to specify right padding. *
* @param t Integer to specify top padding. * @see evas_object_size_hint_padding_get() for more information
* @param b Integer to specify bottom padding.
*/ */
EAPI void evas_object_size_hint_padding_set (Evas_Object *obj, Evas_Coord l, Evas_Coord r, Evas_Coord t, Evas_Coord b) EINA_ARG_NONNULL(1); EAPI void evas_object_size_hint_padding_set (Evas_Object *obj, Evas_Coord l, Evas_Coord r, Evas_Coord t, Evas_Coord b) EINA_ARG_NONNULL(1);
/**
* @}
*/
/** /**
* @defgroup Evas_Object_Group_Extras Extra Object Manipulation * @defgroup Evas_Object_Group_Extras Extra Object Manipulation
* *