st-theme-node

st-theme-node — style information for one node in a tree of themed objects

Functions

StThemeNode * st_theme_node_new ()
StThemeNode * st_theme_node_get_parent ()
StTheme * st_theme_node_get_theme ()
gboolean st_theme_node_equal ()
guint st_theme_node_hash ()
GType st_theme_node_get_element_type ()
const char * st_theme_node_get_element_id ()
GStrv st_theme_node_get_element_classes ()
GStrv st_theme_node_get_pseudo_classes ()
gboolean st_theme_node_lookup_color ()
gboolean st_theme_node_lookup_double ()
gboolean st_theme_node_lookup_length ()
gboolean st_theme_node_lookup_time ()
gboolean st_theme_node_lookup_shadow ()
gboolean st_theme_node_lookup_url ()
void st_theme_node_get_color ()
gdouble st_theme_node_get_double ()
gdouble st_theme_node_get_length ()
StShadow * st_theme_node_get_shadow ()
GFile * st_theme_node_get_url ()
void st_theme_node_get_background_color ()
void st_theme_node_get_foreground_color ()
void st_theme_node_get_background_gradient ()
GFile * st_theme_node_get_background_image ()
int st_theme_node_get_border_width ()
int st_theme_node_get_border_radius ()
void st_theme_node_get_border_color ()
int st_theme_node_get_outline_width ()
void st_theme_node_get_outline_color ()
double st_theme_node_get_padding ()
double st_theme_node_get_horizontal_padding ()
double st_theme_node_get_vertical_padding ()
double st_theme_node_get_margin ()
int st_theme_node_get_width ()
int st_theme_node_get_height ()
int st_theme_node_get_min_width ()
int st_theme_node_get_min_height ()
int st_theme_node_get_max_width ()
int st_theme_node_get_max_height ()
int st_theme_node_get_transition_duration ()
StIconStyle st_theme_node_get_icon_style ()
StTextDecoration st_theme_node_get_text_decoration ()
StTextAlign st_theme_node_get_text_align ()
double st_theme_node_get_letter_spacing ()
const PangoFontDescription * st_theme_node_get_font ()
gchar * st_theme_node_get_font_features ()
StBorderImage * st_theme_node_get_border_image ()
StShadow * st_theme_node_get_box_shadow ()
StShadow * st_theme_node_get_text_shadow ()
StShadow * st_theme_node_get_background_image_shadow ()
StIconColors * st_theme_node_get_icon_colors ()
void st_theme_node_adjust_for_height ()
void st_theme_node_adjust_preferred_width ()
void st_theme_node_adjust_for_width ()
void st_theme_node_adjust_preferred_height ()
void st_theme_node_get_content_box ()
void st_theme_node_get_paint_box ()
void st_theme_node_get_background_paint_box ()
gboolean st_theme_node_geometry_equal ()
gboolean st_theme_node_paint_equal ()
void st_theme_node_paint ()
void st_theme_node_invalidate_background_image ()
void st_theme_node_invalidate_border_image ()
gchar * st_theme_node_to_string ()
void st_theme_node_paint_state_init ()
void st_theme_node_paint_state_free ()
void st_theme_node_paint_state_copy ()
void st_theme_node_paint_state_invalidate ()
gboolean st_theme_node_paint_state_invalidate_for_file ()
void st_theme_node_paint_state_set_node ()

Types and Values

Description

A StThemeNode represents the CSS style information (the set of CSS properties) for one node in a tree of themed objects. In typical usage, it represents the style information for a single ClutterActor. A StThemeNode is immutable: attributes such as the CSS classes for the node are passed in at construction. If the attributes of the node or any parent node change, the node should be discarded and a new node created. StThemeNode has generic accessors to look up properties by name and specific accessors for standard CSS properties that add caching and handling of various details of the CSS specification. StThemeNode also has convenience functions to help in implementing a ClutterActor with borders and padding.

Note that pixel measurements take the “scale-factor” into account so all values are in physical pixels, as opposed to logical pixels. Physical pixels correspond to actor sizes, not necessarily to pixels on display devices (eg. when scale-monitor-framebuffer is enabled).

Functions

st_theme_node_new ()

StThemeNode *
st_theme_node_new (StThemeContext *context,
                   StThemeNode *parent_node,
                   StTheme *theme,
                   GType element_type,
                   const char *element_id,
                   const char *element_class,
                   const char *pseudo_class,
                   const char *inline_style);

Creates a new StThemeNode. Once created, a node is immutable. If any of the attributes of the node (like the element_class ) change the node and its child nodes must be destroyed and recreated.

Parameters

context

the context representing global state for this themed tree

 

parent_node

the parent node of this node.

[nullable]

theme

a theme (stylesheet set) that overrides the theme inherited from the parent node.

[nullable]

element_type

the type of the GObject represented by this node in the tree (corresponding to an element if we were theming an XML document. G_TYPE_NONE means this style was created for the stage actor and matches a selector element name of 'stage'.

 

element_id

the ID to match CSS rules against.

[nullable]

element_class

a whitespace-separated list of classes to match CSS rules against.

[nullable]

pseudo_class

a whitespace-separated list of pseudo-classes (like 'hover' or 'visited') to match CSS rules against.

[nullable]

Returns

a new StThemeNode.

[transfer full]


st_theme_node_get_parent ()

StThemeNode *
st_theme_node_get_parent (StThemeNode *node);

Gets the parent themed element node.

Parameters

node

a StThemeNode

 

Returns

the parent StThemeNode, or NULL if this is the root node of the tree of theme elements.

[nullable][transfer none]


st_theme_node_get_theme ()

StTheme *
st_theme_node_get_theme (StThemeNode *node);

Gets the theme stylesheet set that styles this node

Parameters

node

a StThemeNode

 

Returns

the theme stylesheet set.

[transfer none]


st_theme_node_equal ()

gboolean
st_theme_node_equal (StThemeNode *node_a,
                     StThemeNode *node_b);

Compare two StThemeNodes. Two nodes which compare equal will match the same CSS rules and have the same style properties. However, two nodes that have ended up with identical style properties do not necessarily compare equal.

In detail, node_a and node_b are considered equal if and only if:

  • they share the same StTheme and StThemeContext

  • they have the same parent

  • they have the same element type

  • their id, class, pseudo-class and inline-style match

Parameters

node_a

first StThemeNode

 

node_b

second StThemeNode

 

Returns

TRUE if node_a equals node_b


st_theme_node_hash ()

guint
st_theme_node_hash (StThemeNode *node);

Converts node to a hash value.

Parameters

node

a StThemeNode

 

Returns

a hash value corresponding to node


st_theme_node_get_element_type ()

GType
st_theme_node_get_element_type (StThemeNode *node);

Get the element GType for node .

Parameters

node

a StThemeNode

 

Returns

the element type


st_theme_node_get_element_id ()

const char *
st_theme_node_get_element_id (StThemeNode *node);

Get the unique element ID for node .

Parameters

node

a StThemeNode

 

Returns

the element's ID.

[transfer none]


st_theme_node_get_element_classes ()

GStrv
st_theme_node_get_element_classes (StThemeNode *node);

Get the list of element classes for node .

Parameters

node

a StThemeNode

 

Returns

the element's classes.

[transfer none]


st_theme_node_get_pseudo_classes ()

GStrv
st_theme_node_get_pseudo_classes (StThemeNode *node);

Get the list of pseudo-classes for node (eg. :focused).

Parameters

node

a StThemeNode

 

Returns

the element's pseudo-classes.

[transfer none]


st_theme_node_lookup_color ()

gboolean
st_theme_node_lookup_color (StThemeNode *node,
                            const char *property_name,
                            gboolean inherit,
                            ClutterColor *color);

Generically looks up a property containing a single color value. When specific getters (like st_theme_node_get_background_color()) exist, they should be used instead. They are cached, so more efficient, and have handling for shortcut properties and other details of CSS.

See also st_theme_node_get_color(), which provides a simpler API.

Parameters

node

a StThemeNode

 

property_name

The name of the color property

 

inherit

if TRUE, if a value is not found for the property on the node, then it will be looked up on the parent node, and then on the parent's parent, and so forth. Note that if the property has a value of 'inherit' it will be inherited even if FALSE is passed in for inherit ; this only affects the default behavior for inheritance.

 

color

location to store the color that was determined. If the property is not found, the value in this location will not be changed.

[out caller-allocates]

Returns

TRUE if the property was found in the properties for this theme node (or in the properties of parent nodes when inheriting.)


st_theme_node_lookup_double ()

gboolean
st_theme_node_lookup_double (StThemeNode *node,
                             const char *property_name,
                             gboolean inherit,
                             double *value);

Generically looks up a property containing a single numeric value without units.

See also st_theme_node_get_double(), which provides a simpler API.

Parameters

node

a StThemeNode

 

property_name

The name of the numeric property

 

inherit

if TRUE, if a value is not found for the property on the node, then it will be looked up on the parent node, and then on the parent's parent, and so forth. Note that if the property has a value of 'inherit' it will be inherited even if FALSE is passed in for inherit ; this only affects the default behavior for inheritance.

 

value

location to store the value that was determined. If the property is not found, the value in this location will not be changed.

[out]

Returns

TRUE if the property was found in the properties for this theme node (or in the properties of parent nodes when inheriting.)


st_theme_node_lookup_length ()

gboolean
st_theme_node_lookup_length (StThemeNode *node,
                             const char *property_name,
                             gboolean inherit,
                             gdouble *length);

Generically looks up a property containing a single length value. When specific getters (like st_theme_node_get_border_width()) exist, they should be used instead. They are cached, so more efficient, and have handling for shortcut properties and other details of CSS.

See also st_theme_node_get_length(), which provides a simpler API.

Parameters

node

a StThemeNode

 

property_name

The name of the length property

 

inherit

if TRUE, if a value is not found for the property on the node, then it will be looked up on the parent node, and then on the parent's parent, and so forth. Note that if the property has a value of 'inherit' it will be inherited even if FALSE is passed in for inherit ; this only affects the default behavior for inheritance.

 

length

location to store the length that was determined. If the property is not found, the value in this location will not be changed. The returned length is resolved to pixels.

[out]

Returns

TRUE if the property was found in the properties for this theme node (or in the properties of parent nodes when inheriting.)


st_theme_node_lookup_time ()

gboolean
st_theme_node_lookup_time (StThemeNode *node,
                           const char *property_name,
                           gboolean inherit,
                           gdouble *value);

Generically looks up a property containing a single time value, which is converted to milliseconds.

Parameters

node

a StThemeNode

 

property_name

The name of the time property

 

inherit

if TRUE, if a value is not found for the property on the node, then it will be looked up on the parent node, and then on the parent's parent, and so forth. Note that if the property has a value of 'inherit' it will be inherited even if FALSE is passed in for inherit ; this only affects the default behavior for inheritance.

 

value

location to store the value that was determined. If the property is not found, the value in this location will not be changed.

[out]

Returns

TRUE if the property was found in the properties for this theme node (or in the properties of parent nodes when inheriting.)


st_theme_node_lookup_shadow ()

gboolean
st_theme_node_lookup_shadow (StThemeNode *node,
                             const char *property_name,
                             gboolean inherit,
                             StShadow **shadow);

If the property is not found, the value in the shadow variable will not be changed.

Generically looks up a property containing a set of shadow values. When specific getters (like st_theme_node_get_box_shadow()) exist, they should be used instead. They are cached, so more efficient, and have handling for shortcut properties and other details of CSS.

See also st_theme_node_get_shadow(), which provides a simpler API.

Parameters

node

a StThemeNode

 

property_name

The name of the shadow property

 

inherit

if TRUE, if a value is not found for the property on the node, then it will be looked up on the parent node, and then on the parent's parent, and so forth. Note that if the property has a value of 'inherit' it will be inherited even if FALSE is passed in for inherit ; this only affects the default behavior for inheritance.

 

shadow

location to store the shadow.

[out]

Returns

TRUE if the property was found in the properties for this theme node (or in the properties of parent nodes when inheriting.), FALSE if the property was not found, or was explicitly set to 'none'.


st_theme_node_lookup_url ()

gboolean
st_theme_node_lookup_url (StThemeNode *node,
                          const char *property_name,
                          gboolean inherit,
                          GFile **file);

Looks up a property containing a single URL value.

See also st_theme_node_get_url(), which provides a simpler API.

Parameters

node

a StThemeNode

 

property_name

The name of the string property

 

inherit

if TRUE, if a value is not found for the property on the node, then it will be looked up on the parent node, and then on the parent's parent, and so forth. Note that if the property has a value of 'inherit' it will be inherited even if FALSE is passed in for inherit ; this only affects the default behavior for inheritance.

 

file

location to store the newly allocated value that was determined. If the property is not found, the value in this location will not be changed.

[out][transfer full]

Returns

TRUE if the property was found in the properties for this theme node (or in the properties of parent nodes when inheriting.)


st_theme_node_get_color ()

void
st_theme_node_get_color (StThemeNode *node,
                         const char *property_name,
                         ClutterColor *color);

Generically looks up a property containing a single color value. When specific getters (like st_theme_node_get_background_color()) exist, they should be used instead. They are cached, so more efficient, and have handling for shortcut properties and other details of CSS.

If property_name is not found, a warning will be logged and a default color returned.

See also st_theme_node_lookup_color(), which provides more options, and lets you handle the case where the theme does not specify the indicated color.

Parameters

node

a StThemeNode

 

property_name

The name of the color property

 

color

location to store the color that was determined.

[out caller-allocates]

st_theme_node_get_double ()

gdouble
st_theme_node_get_double (StThemeNode *node,
                          const char *property_name);

Generically looks up a property containing a single numeric value without units.

See also st_theme_node_lookup_double(), which provides more options, and lets you handle the case where the theme does not specify the indicated value.

Parameters

node

a StThemeNode

 

property_name

The name of the numeric property

 

Returns

the value found. If property_name is not found, a warning will be logged and 0 will be returned.


st_theme_node_get_length ()

gdouble
st_theme_node_get_length (StThemeNode *node,
                          const char *property_name);

Generically looks up a property containing a single length value. When specific getters (like st_theme_node_get_border_width()) exist, they should be used instead. They are cached, so more efficient, and have handling for shortcut properties and other details of CSS.

Unlike st_theme_node_get_color() and st_theme_node_get_double(), this does not print a warning if the property is not found; it just returns 0.

See also st_theme_node_lookup_length(), which provides more options. The returned value is in physical pixels, as opposed to logical pixels.

Parameters

node

a StThemeNode

 

property_name

The name of the length property

 

Returns

the length, in pixels, or 0 if the property was not found.


st_theme_node_get_shadow ()

StShadow *
st_theme_node_get_shadow (StThemeNode *node,
                          const char *property_name);

Generically looks up a property containing a set of shadow values. When specific getters (like st_theme_node_get_box_shadow()) exist, they should be used instead. They are cached, so more efficient, and have handling for shortcut properties and other details of CSS.

Like st_theme_get_length(), this does not print a warning if the property is not found; it just returns NULL

See also st_theme_node_lookup_shadow(), which provides more options.

Parameters

node

a StThemeNode

 

property_name

The name of the shadow property

 

Returns

the shadow, or NULL if the property was not found.

[nullable][transfer full]


st_theme_node_get_url ()

GFile *
st_theme_node_get_url (StThemeNode *node,
                       const char *property_name);

Looks up a property containing a single URL value.

See also st_theme_node_lookup_url(), which provides more options, and lets you handle the case where the theme does not specify the indicated value.

Parameters

node

a StThemeNode

 

property_name

The name of the string property

 

Returns

the newly allocated value if found. If property_name is not found, a warning will be logged and NULL will be returned.

[nullable][transfer full]


st_theme_node_get_background_color ()

void
st_theme_node_get_background_color (StThemeNode *node,
                                    ClutterColor *color);

Gets node 's background color.

Parameters

node

a StThemeNode

 

color

location to store the color.

[out caller-allocates]

st_theme_node_get_foreground_color ()

void
st_theme_node_get_foreground_color (StThemeNode *node,
                                    ClutterColor *color);

Gets node 's foreground color.

Parameters

node

a StThemeNode

 

color

location to store the color.

[out caller-allocates]

st_theme_node_get_background_gradient ()

void
st_theme_node_get_background_gradient (StThemeNode *node,
                                       StGradientType *type,
                                       ClutterColor *start,
                                       ClutterColor *end);

The start and end arguments will only be set if type is not ST_GRADIENT_NONE.

Parameters

node

A StThemeNode

 

type

Type of gradient.

[out]

start

Color at start of gradient.

[out caller-allocates]

end

Color at end of gradient.

[out caller-allocates]

st_theme_node_get_background_image ()

GFile *
st_theme_node_get_background_image (StThemeNode *node);

Parameters

node

a StThemeNode

 

Returns

node 's background image.

[transfer none]


st_theme_node_get_border_width ()

int
st_theme_node_get_border_width (StThemeNode *node,
                                StSide side);

Get the border width for node on side , in physical pixels.

Parameters

node

a StThemeNode

 

side

a StCorner

 

Returns

the border width in physical pixels


st_theme_node_get_border_radius ()

int
st_theme_node_get_border_radius (StThemeNode *node,
                                 StCorner corner);

Get the border radius for node at corner , in physical pixels.

Parameters

node

a StThemeNode

 

corner

a StCorner

 

Returns

the border radius in physical pixels


st_theme_node_get_border_color ()

void
st_theme_node_get_border_color (StThemeNode *node,
                                StSide side,
                                ClutterColor *color);

Gets the color of node 's border on side

Parameters

node

a StThemeNode

 

side

a StSide

 

color

location to store the color.

[out caller-allocates]

st_theme_node_get_outline_width ()

int
st_theme_node_get_outline_width (StThemeNode *node);

Get the width of the outline for node , in physical pixels.

Parameters

node

a StThemeNode

 

Returns

the width in physical pixels


st_theme_node_get_outline_color ()

void
st_theme_node_get_outline_color (StThemeNode *node,
                                 ClutterColor *color);

Gets the color of node 's outline.

Parameters

node

a StThemeNode

 

color

location to store the color.

[out caller-allocates]

st_theme_node_get_padding ()

double
st_theme_node_get_padding (StThemeNode *node,
                           StSide side);

Get the padding for node on side , in physical pixels. This corresponds to the CSS properties such as padding-top.

Parameters

node

a StThemeNode

 

side

a StSide

 

Returns

the padding size in physical pixels


st_theme_node_get_horizontal_padding ()

double
st_theme_node_get_horizontal_padding (StThemeNode *node);

Gets the total horizontal padding (left + right padding), in physical pixels.

Parameters

node

a StThemeNode

 

Returns

the total horizontal padding in physical pixels


st_theme_node_get_vertical_padding ()

double
st_theme_node_get_vertical_padding (StThemeNode *node);

Gets the total vertical padding (top + bottom padding), in physical pixels.

Parameters

node

a StThemeNode

 

Returns

the total vertical padding in physical pixels


st_theme_node_get_margin ()

double
st_theme_node_get_margin (StThemeNode *node,
                          StSide side);

Get the margin for node on side , in physical pixels. This corresponds to the CSS properties such as margin-top.

Parameters

node

a StThemeNode

 

side

a StSide

 

Returns

the margin size in physical pixels


st_theme_node_get_width ()

int
st_theme_node_get_width (StThemeNode *node);

Get the width for node , in physical pixels.

Parameters

node

a StThemeNode

 

Returns

the width in physical pixels


st_theme_node_get_height ()

int
st_theme_node_get_height (StThemeNode *node);

Get the height for node , in physical pixels.

Parameters

node

a StThemeNode

 

Returns

the height in physical pixels


st_theme_node_get_min_width ()

int
st_theme_node_get_min_width (StThemeNode *node);

Get the minimum width for node , in physical pixels.

Parameters

node

a StThemeNode

 

Returns

the minimum width in physical pixels


st_theme_node_get_min_height ()

int
st_theme_node_get_min_height (StThemeNode *node);

Get the minimum height for node , in physical pixels.

Parameters

node

a StThemeNode

 

Returns

the minimum height in physical pixels


st_theme_node_get_max_width ()

int
st_theme_node_get_max_width (StThemeNode *node);

Get the maximum width for node , in physical pixels.

Parameters

node

a StThemeNode

 

Returns

the maximum width in physical pixels


st_theme_node_get_max_height ()

int
st_theme_node_get_max_height (StThemeNode *node);

Get the maximum height for node , in physical pixels.

Parameters

node

a StThemeNode

 

Returns

the maximum height in physical pixels


st_theme_node_get_transition_duration ()

int
st_theme_node_get_transition_duration (StThemeNode *node);

Get the value of the transition-duration property, which specifies the transition time between the previous StThemeNode and node .

Parameters

node

an StThemeNode

 

Returns

the node's transition duration in milliseconds


st_theme_node_get_icon_style ()

StIconStyle
st_theme_node_get_icon_style (StThemeNode *node);

Get the icon style for node (eg. symbolic, regular). This corresponds to the special -st-icon-style CSS property.

Parameters

node

a StThemeNode

 

Returns

the icon style for node


st_theme_node_get_text_decoration ()

StTextDecoration
st_theme_node_get_text_decoration (StThemeNode *node);

Get the text decoration for node (eg. underline, line-through, etc).

Parameters

node

a StThemeNode

 

Returns

the text decoration for node


st_theme_node_get_text_align ()

StTextAlign
st_theme_node_get_text_align (StThemeNode *node);

Get the text alignment of node .

Parameters

node

a StThemeNode

 

Returns

the alignment of text for node


st_theme_node_get_letter_spacing ()

double
st_theme_node_get_letter_spacing (StThemeNode *node);

Gets the value for the letter-spacing style property, in physical pixels.

Parameters

node

a StThemeNode

 

Returns

the value of the letter-spacing property, if found, or zero if such property has not been found.


st_theme_node_get_font ()

const PangoFontDescription *
st_theme_node_get_font (StThemeNode *node);

Get the current font of node as a PangoFontDescription

Parameters

node

a StThemeNode

 

Returns

the current font.

[transfer none]


st_theme_node_get_font_features ()

gchar *
st_theme_node_get_font_features (StThemeNode *node);

Get the CSS font-features for node .

Parameters

node

a StThemeNode

 

Returns

font-features as a string.

[transfer full]


st_theme_node_get_border_image ()

StBorderImage *
st_theme_node_get_border_image (StThemeNode *node);

Gets the value for the border-image style property

Parameters

node

a StThemeNode

 

Returns

the border image, or NULL if there is no border image.

[transfer none]


st_theme_node_get_box_shadow ()

StShadow *
st_theme_node_get_box_shadow (StThemeNode *node);

Gets the value for the box-shadow style property

Parameters

node

a StThemeNode

 

Returns

the node's shadow, or NULL if node has no shadow.

[nullable][transfer none]


st_theme_node_get_text_shadow ()

StShadow *
st_theme_node_get_text_shadow (StThemeNode *node);

Gets the value for the text-shadow style property

Parameters

node

a StThemeNode

 

Returns

the node's text-shadow, or NULL if node has no text-shadow.

[nullable][transfer none]


st_theme_node_get_background_image_shadow ()

StShadow *
st_theme_node_get_background_image_shadow
                               (StThemeNode *node);

Gets the value for the -st-background-image-shadow style property

Parameters

node

a StThemeNode

 

Returns

the node's background image shadow, or NULL if node has no such shadow.

[nullable][transfer none]


st_theme_node_get_icon_colors ()

StIconColors *
st_theme_node_get_icon_colors (StThemeNode *node);

Gets the colors that should be used for colorizing symbolic icons according the style of this node.

Parameters

node

a StThemeNode

 

Returns

the icon colors to use for this theme node.

[transfer none]


st_theme_node_adjust_for_height ()

void
st_theme_node_adjust_for_height (StThemeNode *node,
                                 float *for_height);

Adjusts a "for height" passed to clutter_actor_get_preferred_width() to account for borders and padding. This is a convenience function meant to be called from a get_preferred_width() method of a ClutterActor subclass. The value after adjustment is the height available for the actor's content.

Parameters

node

a StThemeNode

 

for_height

the "for height" to adjust.

[inout]

st_theme_node_adjust_preferred_width ()

void
st_theme_node_adjust_preferred_width (StThemeNode *node,
                                      float *min_width_p,
                                      float *natural_width_p);

Adjusts the minimum and natural width computed for an actor by adding on the necessary space for borders and padding and taking into account any minimum or maximum width. This is a convenience function meant to be called from the get_preferred_width() method of a ClutterActor subclass

Parameters

node

a StThemeNode

 

min_width_p

the minimum width to adjust.

[inout][nullable]

natural_width_p

the natural width to adjust.

[inout]

st_theme_node_adjust_for_width ()

void
st_theme_node_adjust_for_width (StThemeNode *node,
                                float *for_width);

Adjusts a "for width" passed to clutter_actor_get_preferred_height() to account for borders and padding. This is a convenience function meant to be called from a get_preferred_height() method of a ClutterActor subclass. The value after adjustment is the width available for the actor's content.

Parameters

node

a StThemeNode

 

for_width

the "for width" to adjust.

[inout]

st_theme_node_adjust_preferred_height ()

void
st_theme_node_adjust_preferred_height (StThemeNode *node,
                                       float *min_height_p,
                                       float *natural_height_p);

Adjusts the minimum and natural height computed for an actor by adding on the necessary space for borders and padding and taking into account any minimum or maximum height. This is a convenience function meant to be called from the get_preferred_height() method of a ClutterActor subclass

Parameters

node

a StThemeNode

 

min_height_p

the minimum height to adjust.

[inout][nullable]

natural_height_p

the natural height to adjust.

[inout]

st_theme_node_get_content_box ()

void
st_theme_node_get_content_box (StThemeNode *node,
                               const ClutterActorBox *allocation,
                               ClutterActorBox *content_box);

Gets the box within an actor's allocation that contents the content of an actor (excluding borders and padding). This is a convenience function meant to be used from the allocate() or paint() methods of a ClutterActor subclass.

Parameters

node

a StThemeNode

 

allocation

the box allocated to a ClutterAlctor

 

content_box

computed box occupied by the actor's content.

[out caller-allocates]

st_theme_node_get_paint_box ()

void
st_theme_node_get_paint_box (StThemeNode *node,
                             const ClutterActorBox *allocation,
                             ClutterActorBox *paint_box);

Gets the box used to paint the actor, including the area occupied by properties which paint outside the actor's assigned allocation. When painting node to an offscreen buffer, this function can be used to determine the necessary size of the buffer.

Parameters

node

a StThemeNode

 

allocation

the box allocated to a ClutterActor

 

paint_box

computed box occupied when painting the actor.

[out caller-allocates]

st_theme_node_get_background_paint_box ()

void
st_theme_node_get_background_paint_box
                               (StThemeNode *node,
                                const ClutterActorBox *allocation,
                                ClutterActorBox *paint_box);

Gets the box used to paint the actor's background, including the area occupied by properties which paint outside the actor's assigned allocation.

Parameters

node

a StThemeNode

 

allocation

the box allocated to a ClutterActor

 

paint_box

computed box occupied when painting the actor's background.

[out caller-allocates]

st_theme_node_geometry_equal ()

gboolean
st_theme_node_geometry_equal (StThemeNode *node,
                              StThemeNode *other);

Tests if two theme nodes have the same borders and padding; this can be used to optimize having to relayout when the style applied to a Clutter actor changes colors without changing the geometry.

Parameters

node

a StThemeNode

 

other

a different StThemeNode

 

Returns

TRUE if equal, FALSE otherwise


st_theme_node_paint_equal ()

gboolean
st_theme_node_paint_equal (StThemeNode *node,
                           StThemeNode *other);

Check if st_theme_node_paint() will paint identically for node as it does for other . Note that in some cases this function may return TRUE even if there is no visible difference in the painting.

Parameters

node

a StThemeNode.

[nullable]

other

a different StThemeNode.

[nullable]

Returns

TRUE if the two theme nodes paint identically. FALSE if the two nodes potentially paint differently.


st_theme_node_paint ()

void
st_theme_node_paint (StThemeNode *node,
                     StThemeNodePaintState *state,
                     CoglFramebuffer *framebuffer,
                     const ClutterActorBox *box,
                     guint8 paint_opacity,
                     float resource_scale);

[skip]


st_theme_node_invalidate_background_image ()

void
st_theme_node_invalidate_background_image
                               (StThemeNode *node);

st_theme_node_invalidate_border_image ()

void
st_theme_node_invalidate_border_image (StThemeNode *node);

st_theme_node_to_string ()

gchar *
st_theme_node_to_string (StThemeNode *node);

Serialize node to a string of its GType name, CSS ID, classes and pseudo-classes.

Parameters

node

a StThemeNode

 

Returns

the serialized theme node


st_theme_node_paint_state_init ()

void
st_theme_node_paint_state_init (StThemeNodePaintState *state);

st_theme_node_paint_state_free ()

void
st_theme_node_paint_state_free (StThemeNodePaintState *state);

st_theme_node_paint_state_copy ()

void
st_theme_node_paint_state_copy (StThemeNodePaintState *state,
                                StThemeNodePaintState *other);

st_theme_node_paint_state_invalidate ()

void
st_theme_node_paint_state_invalidate (StThemeNodePaintState *state);

st_theme_node_paint_state_invalidate_for_file ()

gboolean
st_theme_node_paint_state_invalidate_for_file
                               (StThemeNodePaintState *state,
                                GFile *file);

st_theme_node_paint_state_set_node ()

void
st_theme_node_paint_state_set_node (StThemeNodePaintState *state,
                                    StThemeNode *node);

Types and Values

ST_TYPE_THEME_NODE

#define ST_TYPE_THEME_NODE              (st_theme_node_get_type ())

enum StSide

Used to target a particular side of a StThemeNode element.

Members

ST_SIDE_TOP

The top side.

 

ST_SIDE_RIGHT

The right side.

 

ST_SIDE_BOTTOM

The bottom side.

 

ST_SIDE_LEFT

The left side.

 

enum StCorner

Used to target a particular corner of a StThemeNode element.

Members

ST_CORNER_TOPLEFT

The top-right corner.

 

ST_CORNER_TOPRIGHT

The top-right corner.

 

ST_CORNER_BOTTOMRIGHT

The bottom-right corner.

 

ST_CORNER_BOTTOMLEFT

The bottom-left corner.

 

enum StTextDecoration

Flags used to determine the decoration of text.

Not that neither ST_TEXT_DECORATION_OVERLINE or ST_TEXT_DECORATION_BLINK are implemented, currently.

Members

ST_TEXT_DECORATION_UNDERLINE

   

ST_TEXT_DECORATION_OVERLINE

Text is overlined

 

ST_TEXT_DECORATION_LINE_THROUGH

Text is striked out

 

ST_TEXT_DECORATION_BLINK

Text blinks

 

enum StTextAlign

Used to align text in a label.

Members

ST_TEXT_ALIGN_LEFT

Text is aligned at the beginning of the label.

 

ST_TEXT_ALIGN_CENTER

Text is aligned in the middle of the label.

 

ST_TEXT_ALIGN_RIGHT

Text is aligned at the end of the label.

 

ST_TEXT_ALIGN_JUSTIFY

   

enum StGradientType

Used to specify options when rendering gradients.

Members

ST_GRADIENT_NONE

No gradient.

 

ST_GRADIENT_VERTICAL

A vertical gradient.

 

ST_GRADIENT_HORIZONTAL

A horizontal gradient.

 

ST_GRADIENT_RADIAL

Lookup the style requested in the icon name.

 

enum StIconStyle

Used to specify options when looking up icons.

Members

ST_ICON_STYLE_REQUESTED

Lookup the style requested in the icon name.

 

ST_ICON_STYLE_REGULAR

Try to always load regular icons, even when symbolic icon names are given.

 

ST_ICON_STYLE_SYMBOLIC

Try to always load symbolic icons, even when regular icon names are given.

 

struct StThemeNodePaintState

struct StThemeNodePaintState {
  StThemeNode *node;

  float alloc_width;
  float alloc_height;

  float box_shadow_width;
  float box_shadow_height;

  float resource_scale;

  CoglPipeline *box_shadow_pipeline;
  CoglPipeline *prerendered_texture;
  CoglPipeline *prerendered_pipeline;
  CoglPipeline *corner_material[4];
};

StTheme

typedef struct _StTheme StTheme;

StThemeContext

typedef struct _StThemeContext StThemeContext;

StThemeNode

typedef struct _StThemeNode StThemeNode;