![]() |
![]() |
![]() |
adg-1 reference manual |
![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy |
AdgPoint;void adg_point_copy (AdgPoint *point
,const AdgPoint *src
);void adg_point_destroy (AdgPoint *point
); AdgPoint * adg_point_dup (const AdgPoint *src
);gboolean adg_point_equal (const AdgPoint *point1
,const AdgPoint *point2
); AdgModel * adg_point_get_model (AdgPoint *point
); constgchar * adg_point_get_name (AdgPoint *point
); const AdgPair * adg_point_get_pair (AdgPoint *point
);void adg_point_invalidate (AdgPoint *point
); AdgPoint * adg_point_new (void
);void adg_point_set_pair (AdgPoint *point
,const AdgPair *pair
);void adg_point_set_pair_explicit (AdgPoint *point
,,
gdouble x);
gdouble yvoid adg_point_set_pair_from_model (AdgPoint *point
,AdgModel *model
,const
);gchar *namevoid adg_point_unset (AdgPoint *point
);
AdgPoint is an opaque structure that manages 2D coordinates,
either set explicitely throught adg_point_set_pair()
and
adg_point_set_pair_explicit()
or taken from a model with
adg_point_set_pair_from_model()
. It can be thought as an
AdgPair on steroid, because it adds named pair support to
a simple pair, enabling coordinates depending on AdgModel.
typedef struct _AdgPoint AdgPoint;
This is an opaque struct: all its fields are privates.
Since 1.0
void adg_point_copy (AdgPoint *point
,const AdgPoint *src
);
Copies src
into point
. If the old content of point
was linked
to the named pair of a model, the reference to that model is
dropped. Similary, if src
is a named pair, a new reference to
the new model is added.
|
an AdgPoint |
|
the source point to copy |
Since 1.0
void adg_point_destroy (AdgPoint *point
);
Destroys the point
instance, unreferencing the internal model if
point
is linked to a named pair.
|
an AdgPoint |
Since 1.0
AdgPoint * adg_point_dup (const AdgPoint *src
);
Duplicates src
. This operation also adds a new reference
to the internal model if src
is linked to a named pair.
The returned value should be freed with adg_point_destroy()
when no longer needed.
Since 1.0
gboolean adg_point_equal (const AdgPoint *point1
,const AdgPoint *point2
);
Compares point1
and point2
and returns TRUE
cpml_pair_equal()
cpml_pair_equal(adg_point_get_pair(point1), adg_point_get_pair(point2));
NULL
|
the first point to compare |
|
the second point to compare |
Returns : |
TRUE point1 is equal to point2 , FALSE |
Since 1.0
AdgModel * adg_point_get_model (AdgPoint *point
);
Gets the source model of the named pair bound to point
, or
returns NULL
point
is an explicit pair. The returned
value is owned by point
.
|
an AdgPoint |
Returns : |
an AdgModel or NULL |
Since 1.0
constgchar * adg_point_get_name (AdgPoint *point
);
Gets the name of the named pair bound to point
, or returns
NULL
point
is an explicit pair. The returned value is
owned by point
and should not be modified or freed.
|
an AdgPoint |
Returns : |
the name of the named pair or NULL |
Since 1.0
const AdgPair * adg_point_get_pair (AdgPoint *point
);
AdgPoint is an evolution of the pair concept but internally the
relevant data is still stored in an AdgPair struct. This function
gets the pointer to this struct, updating the value prior to
return it if needed (that is, if point
is linked to a not up
to date named pair).
|
an AdgPoint |
Returns : |
the pair of point or NULL |
Since 1.0
void adg_point_invalidate (AdgPoint *point
);
Invalidates point
, forcing a refresh of its internal AdgPair if
the point is linked to a named pair. If point
is explicitely set,
this function has no effect.
|
an AdgPoint |
Since 1.0
AdgPoint * adg_point_new (void
);
Creates a new empty AdgPoint. The returned pointer
should be freed with adg_point_destroy()
when no longer needed.
Returns : |
a newly created AdgPoint |
Since 1.0
void adg_point_set_pair (AdgPoint *point
,const AdgPair *pair
);
Sets an explicit pair in point
by using the given pair
. If
point
was linked to a named pair in a model, this link is
dropped before setting the pair.
Since 1.0
void adg_point_set_pair_explicit (AdgPoint *point
,,
gdouble x);
gdouble y
Works in the same way of adg_point_set_pair()
but accept direct numbers
instead of an AdgPair structure.
|
an AdgPoint |
|
the x coordinate of the point |
|
the y coordinate of the point |
Since 1.0
void adg_point_set_pair_from_model (AdgPoint *point
,AdgModel *model
,const
);gchar *name
Links the name
named pair of model
to point
, so any subsequent
call to adg_point_get_pair()
will return the named pair value.
A new reference is added to model
while the previous model (if any)
is unreferenced.
Since 1.0
void adg_point_unset (AdgPoint *point
);
Unsets point
by resetting the internal "is_uptodate" flag.
This also means point
is unlinked from the model if it is
a named pair. In any cases, after this call the content of
point
is undefined, that is calling adg_point_get_pair()
will return NULL
|
a pointer to an AdgPoint |
Since 1.0