![]() |
![]() |
![]() |
![]() |
AsBranding — Description of branding for an AsComponent.
#define | AS_TYPE_BRANDING |
struct | AsBrandingClass |
AsBrandingColorIter | |
enum | AsColorKind |
enum | AsColorSchemeKind |
AsBranding |
This class provides information contained in an AppStream branding tag. See https://www.freedesktop.org/software/appstream/docs/chap-Metadata.htmltag-branding for more information.
See also: AsComponent
const gchar *
as_color_kind_to_string (AsColorKind kind
);
Converts the enumerated value to an text representation.
Since: 0.15.2
AsColorKind
as_color_kind_from_string (const gchar *str
);
Converts the text representation to an enumerated value.
Since: 0.15.2
const gchar *
as_color_scheme_kind_to_string (AsColorSchemeKind kind
);
Converts the enumerated value to an text representation.
Since: 0.15.2
AsColorSchemeKind
as_color_scheme_kind_from_string (const gchar *str
);
Converts the text representation to an enumerated value.
Since: 0.15.2
void as_branding_set_color (AsBranding *branding
,AsColorKind kind
,AsColorSchemeKind scheme_preference
,const gchar *colorcode
);
Sets a new accent color. If a color of the given kind with the given scheme preference already exists, it will be overriden with the new color code.
branding |
an AsBranding instance. |
|
kind |
the AsColorKind, e.g. |
|
scheme_preference |
Type of color scheme preferred for this color, e.g. |
|
colorcode |
a HTML color code. |
Since: 0.15.2
void as_branding_remove_color (AsBranding *branding
,AsColorKind kind
,AsColorSchemeKind scheme_preference
);
Deletes a color that matches the given type and scheme preference.
branding |
an AsBranding instance. |
|
kind |
the AsColorKind, e.g. |
|
scheme_preference |
Type of color scheme preferred for this color, e.g. |
Since: 0.15.2
void as_branding_color_iter_init (AsBrandingColorIter *iter
,AsBranding *branding
);
Initializes a color iterator for the accent color list and associates it
it with branding
.
The AsBrandingColorIter structure is typically allocated on the stack
and does not need to be freed explicitly.
gboolean as_branding_color_iter_next (AsBrandingColorIter *iter
,AsColorKind *kind
,AsColorSchemeKind *scheme_preference
,const gchar **value
);
Returns the current color entry and advances the iterator. Example:
1 2 3 4 5 6 7 8 9 |
AsBrandingColorIter iter; AsColorKind ckind; AsColorSchemeKind scheme_preference; const gchar *color_value; as_branding_color_iter_init (&iter, branding); while (as_branding_color_iter_next (&iter, &ckind, &scheme_preference, &color_value)) { // do something with the color data } |
iter |
an initialized AsBrandingColorIter |
|
kind |
Destination of the returned color kind. |
[out][optional][not nullable] |
scheme_preference |
Destination of the returned color's scheme preference. |
[out][optional][not nullable] |
value |
Destination of the returned color code. |
[out][optional][not nullable] |
const gchar * as_branding_get_color (AsBranding *branding
,AsColorKind kind
,AsColorSchemeKind scheme_kind
);
Retrieve a color of the given kind
that matches scheme_kind
.
If a color has no scheme preference defined, it will be returned for either scheme type,
unless a more suitable color was found.
branding |
an AsBranding instance. |
|
kind |
the AsColorKind, e.g. |
|
scheme_kind |
Color scheme preference for the color, e.g. |
Since: 0.15.2
typedef struct { } AsBrandingColorIter;
A AsBrandingColorIter structure represents an iterator that can be used
to iterate over the accent colors of an AsBranding object.
AsBrandingColorIter structures are typically allocated on the stack and
then initialized with as_branding_color_iter_init()
.