AdgAlignment — Base class for entity that can contain other entities
AdgAlignment; AdgAlignment * adg_alignment_new (const AdgPair *factor); AdgAlignment * adg_alignment_new_explicit (gdouble x_factor, gdouble y_factor); void adg_alignment_set_factor (AdgAlignment *alignment, const AdgPair *factor); void adg_alignment_set_factor_explicit (AdgAlignment *alignment, gdouble x_factor, gdouble y_factor); const AdgPair * adg_alignment_get_factor (AdgAlignment *alignment);
The AdgAlignment is an entity that can contains more sub-entities, much in the same way as the AdgContainer does, but allowing the alignment of the content with an arbitrary fraction of the boundaring box of the content itsself.
To specify the alignment fraction, use adg_alignment_set_factor() and
related methods or directly set the "factor" property.
For example, to center the children either in x and y, you can call
adg_alignment_set_factor_explicit(alignment, 0.5, 0.5). To align them
on the right, specify a (0, 1) factor.
The displacement is done by modifing the global matrix at the end of the arrange method.
typedef struct _AdgAlignment AdgAlignment;
All fields are private and should not be used directly. Use its public methods instead.
AdgAlignment * adg_alignment_new (const AdgPair *factor);
Creates a new alignment container with the specified factor.
|
|
the alignment factor |
|
Returns : |
the newly created alignment or NULL on errors |
AdgAlignment * adg_alignment_new_explicit (gdouble x_factor, gdouble y_factor);
Convenient function that creates a new alignment accepting explicit factor values.
|
|
x component of the factor |
|
|
y component of the factor |
|
Returns : |
the newly created alignment |
void adg_alignment_set_factor (AdgAlignment *alignment, const AdgPair *factor);
Sets a the "factor" property to factor on alignment.
The factor is applied to the alignment extents to compute the
displacement of the content, providing a way to for instance center
the content either vertically or horizontally. A pair factor of
(0.5, 0) means the content will be centered horizontally in
reference to the normal flow without alignment.
|
|
an AdgAlignment container |
|
|
the new factor |
void adg_alignment_set_factor_explicit (AdgAlignment *alignment, gdouble x_factor, gdouble y_factor);
Convenient wrapper around adg_alignment_set_factor() that accepts
explicit factors instead of an AdgPair value.
|
|
an AdgAlignment container |
|
|
x component of the factor |
|
|
y component of the factor |
const AdgPair * adg_alignment_get_factor (AdgAlignment *alignment);
Gets the value of the "factor" property. The returned
pair is owned by alignment and must not be modified or freed.
|
|
an AdgAlignment container |
|
Returns : |
the factor pair |
"factor" property"factor" AdgPair* : Read / Write
Portion of extents, either in x and y, the content will be displaced: a (0.5, 0.5) factor means the origin is the middle point of the extents.
AdgAlignmentwas last modified by gtk-doc on Sat 24 Jul 2010 09:35:27 AM CEST