Synopsis

#include <adg-1/adg.h>

#define             ADG_VALUE_HOLDS_DRESS               (value)
AdgDress            adg_dress_from_name                 (const gchar *name);
gboolean            adg_dress_set                       (AdgDress *dress,
                                                         AdgDress src);
gboolean            adg_dress_are_related               (AdgDress dress1,
                                                         AdgDress dress2);
const gchar *       adg_dress_get_name                  (AdgDress dress);
GType               adg_dress_get_ancestor_type         (AdgDress dress);
void                adg_dress_set_fallback              (AdgDress dress,
                                                         AdgStyle *fallback);
AdgStyle *          adg_dress_get_fallback              (AdgDress dress);
gboolean            adg_dress_style_is_compatible       (AdgDress dress,
                                                         AdgStyle *style);

Description

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.

Details

ADG_VALUE_HOLDS_DRESS()

#define ADG_VALUE_HOLDS_DRESS(value)    (G_TYPE_CHECK_VALUE_TYPE((value), ADG_TYPE_DRESS))

Checks whether a GValue is actually holding an AdgDress value or not.

value :

a GValue

Returns :

TRUE is value is holding an AdgDress, FALSE otherwise

Since 1.0


adg_dress_from_name ()

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.

name :

the name of a dress

Returns :

the AdgDress value or ADG_DRESS_UNDEFINED if not found.

Since 1.0


adg_dress_set ()

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.

dress :

a pointer to an AdgDress

src :

the source dress

Returns :

TRUE on copy done, FALSE on copy failed or not needed.

Since 1.0


adg_dress_are_related ()

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().

dress1 :

an AdgDress

dress2 :

another AdgDress

Returns :

TRUE if the dresses are related, FALSE otherwise.

Since 1.0


adg_dress_get_name ()

const gchar *       adg_dress_get_name                  (AdgDress dress);

Gets the name associated to dress. No warnings are raised if dress is not found.

dress :

an AdgDress

Returns :

the requested name or NULL if not found.

Since 1.0


adg_dress_get_ancestor_type ()

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.

dress :

an AdgDress

Returns :

the ancestor type or 0 on errors.

Since 1.0


adg_dress_set_fallback ()

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.

dress :

an AdgDress

fallback :

the new fallback style. [transfer full]

Since 1.0


adg_dress_get_fallback ()

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.

dress :

an AdgDress

Returns :

the requested AdgStyle derived instance or NULL if not set. [transfer none]

Since 1.0


adg_dress_style_is_compatible ()

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.

dress :

an AdgDress

style :

the AdgStyle to check. [transfer none]

Returns :

TRUE if dress can accept style, FALSE otherwise.

Since 1.0