![]() |
![]() |
![]() |
adg-1 reference manual |
![]() |
---|---|---|---|---|
Top | Description |
gboolean adg_dress_are_related (AdgDress dress1
,AdgDress dress2
); AdgDress adg_dress_from_name (const
);gchar *nameGType adg_dress_get_ancestor_type (AdgDress dress
); AdgStyle * adg_dress_get_fallback (AdgDress dress
); constgchar * adg_dress_get_name (AdgDress dress
); AdgDress adg_dress_new (const
,gchar *nameAdgStyle *fallback
); AdgDress adg_dress_new_full (const
,gchar *nameAdgStyle *fallback
,);
GType ancestor_typegboolean adg_dress_set (AdgDress *dress
,AdgDress src
);void adg_dress_set_fallback (AdgDress dress
,AdgStyle *fallback
);gboolean adg_dress_style_is_compatible (AdgDress dress
,AdgStyle *style
);GParamSpec * adg_param_spec_dress (const
,gchar *nameconst
,gchar *nickconst
,gchar *blurbAdgDress dress
,);
GParamFlags flags
The dress is a virtualization of an AdgStyle instance. AdgEntity objects do not directly refer to AdgStyle but use AdgDress values instead. This allows some advanced operations, such as overriding a dress only in a specific entity branch of the hierarchy or customize multiple entities at once.
gboolean adg_dress_are_related (AdgDress dress1
,AdgDress dress2
);
Checks whether dress1
and dress2
are related, that is
if they have the same ancestor type as returned by
adg_dress_get_ancestor_type()
.
|
an AdgDress |
|
another AdgDress |
Returns : |
TRUE FALSE |
Since 1.0
AdgDress adg_dress_from_name (const gchar *name
);
Gets the dress bound to a name
string. No warnings are raised
if the dress is not found.
|
the name of a dress. [transfer none] |
Returns : |
the AdgDress code or ADG_DRESS_UNDEFINED if not found. [transfer none] |
Since 1.0
GType adg_dress_get_ancestor_type (AdgDress dress
);
Gets the base type that should be present in every AdgStyle
acceptable by dress
. No warnings are raised if dress
is not found.
|
an AdgDress |
Returns : |
the ancestor type or 0 |
Since 1.0
AdgStyle * adg_dress_get_fallback (AdgDress dress
);
Gets the fallback style associated to dress
. No warnings
are raised if the dress is not found. The returned style
is owned by dress and should not be freed or modified.
|
an AdgDress |
Returns : |
the requested AdgStyle derived instance
or NULL |
Since 1.0
constgchar * adg_dress_get_name (AdgDress dress
);
Gets the name associated to dress
. No warnings are raised if
dress
is not found.
|
an AdgDress |
Returns : |
the requested name or NULL |
Since 1.0
AdgDress adg_dress_new (const
,gchar *nameAdgStyle *fallback
);
Creates a new dress. It is a convenient wrapper of adg_dress_new_full()
that uses as ancestor the G_TYPE_FROM_INSTANCE()
fallback
.
After a succesfull call, a new reference is added to fallback
.
|
the dress name |
|
the fallback style |
Returns : |
the new AdgDress value or ADG_DRESS_UNDEFINED on errors. [type gint][transfer full] |
Since 1.0
AdgDress adg_dress_new_full (const
,gchar *nameAdgStyle *fallback
,);
GType ancestor_type
Creates a new dress, explicitely setting the ancestor type.
If fallback
is not NULL
ancestor_type
must be present in
its hierarchy: check out the adg_dress_style_is_compatible()
documentation to know what the ancestor type is used for.
fallback
can be NULL
After a succesfull call, a new reference is added to fallback
if needed.
|
the dress name |
|
the fallback style |
|
the common ancestor type |
Returns : |
the new AdgDress value or ADG_DRESS_UNDEFINED on errors. [type gint][transfer full] |
Since 1.0
gboolean adg_dress_set (AdgDress *dress
,AdgDress src
);
Copies src
in dress
. This operation can be succesful only if
dress
is ADG_DRESS_UNDEFINED or if it contains a dress related
to src
, that is adg_dress_are_related()
returns TRUE
|
a pointer to an AdgDress |
|
the source dress |
Returns : |
TRUE FALSE |
Since 1.0
void adg_dress_set_fallback (AdgDress dress
,AdgStyle *fallback
);
Associates a new fallback
style to dress
. If the dress does
not exist (it was not previously created by adg_dress_new()
),
a warning message is raised and the function fails.
fallback
is checked for compatibily with dress
. Any dress holds
an ancestor type: if this type is not found in the fallback
hierarchy, a warning message is raised and the function fails.
After a succesfull call, the reference to the previous fallback
(if any) is dropped while a new reference to fallback
is added.
|
an AdgDress |
|
the new fallback style |
Since 1.0
gboolean adg_dress_style_is_compatible (AdgDress dress
,AdgStyle *style
);
Checks whether style
is compatible with dress
, that is if
style
has the ancestor style type (as returned by
adg_dress_get_ancestor_type()
) in its hierarchy.
|
an AdgDress |
|
the AdgStyle to check |
Returns : |
TRUE dress can accept style , FALSE |
Since 1.0
GParamSpec * adg_param_spec_dress (const
,gchar *nameconst
,gchar *nickconst
,gchar *blurbAdgDress dress
,);
GParamFlags flags
Creates a param spec to hold a dress value.
|
canonical name |
|
nickname of the param |
|
brief desciption |
|
the AdgDress dress |
|
a combination of |
Returns : |
the newly allocated |
Since 1.0