AdgAlignment

AdgAlignment — Base class for entity that can contain other entities

Synopsis

                    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);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----AdgEntity
               +----AdgContainer
                     +----AdgAlignment

Properties

  "factor"                   AdgPair*              : Read / Write

Description

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.

Details

AdgAlignment

typedef struct _AdgAlignment AdgAlignment;

All fields are private and should not be used directly. Use its public methods instead.


adg_alignment_new ()

AdgAlignment *      adg_alignment_new                   (const AdgPair *factor);

Creates a new alignment container with the specified factor.

factor :

the alignment factor

Returns :

the newly created alignment or NULL on errors

adg_alignment_new_explicit ()

AdgAlignment *      adg_alignment_new_explicit          (gdouble x_factor,
                                                         gdouble y_factor);

Convenient function that creates a new alignment accepting explicit factor values.

x_factor :

x component of the factor

y_factor :

y component of the factor

Returns :

the newly created alignment

adg_alignment_set_factor ()

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.

alignment :

an AdgAlignment container

factor :

the new factor

adg_alignment_set_factor_explicit ()

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.

alignment :

an AdgAlignment container

x_factor :

x component of the factor

y_factor :

y component of the factor

adg_alignment_get_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.

alignment :

an AdgAlignment container

Returns :

the factor pair

Property Details

The "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.

AdgAlignment was last modified by gtk-doc on Sat 24 Jul 2010 09:35:27 AM CEST
Hosted by Get Automatic Drawing Generation at SourceForge.net. Fast, secure and Free Open Source software downloads
Search on this domain