St.ThemeNode
Description: Reference for St.ThemeNode

### Class

# StThemeNode

#### Description [src]

    final class St.ThemeNode : GObject.Object
    {
      /* No available fields */
    }

Style information for one node in a tree of themed objects

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 `StThemeContext: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).

#### Ancestors

- GObject

#### Constructors

###### st_theme_node_new

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.

#### Instance methods

###### st_theme_node_adjust_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.

###### st_theme_node_adjust_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.

###### st_theme_node_adjust_preferred_height

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.

###### st_theme_node_adjust_preferred_width

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.

###### st_theme_node_equal

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.

###### st_theme_node_geometry_equal

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.

###### st_theme_node_get_background_color

Gets `node`‘s background color.

###### st_theme_node_get_background_gradient

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

###### st_theme_node_get_background_image

No description available.

###### st_theme_node_get_background_image_shadow

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

###### st_theme_node_get_background_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.

###### st_theme_node_get_border_color

Gets the color of `node`‘s border on `side`.

###### st_theme_node_get_border_image

Gets the value for the border-image style property.

###### st_theme_node_get_border_radius

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

###### st_theme_node_get_border_width

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

###### st_theme_node_get_box_shadow

Gets the value for the box-shadow style property.

###### st_theme_node_get_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.

###### st_theme_node_get_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.

###### st_theme_node_get_double

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

###### st_theme_node_get_element_classes

Get the list of element classes for `node`.

###### st_theme_node_get_element_id

Get the unique element ID for `node`.

###### st_theme_node_get_element_type

Get the element `GType` for `node`.

###### st_theme_node_get_font

Get the current font of `node` as a `PangoFontDescription`.

###### st_theme_node_get_font_features

Get the CSS font-features for `node`.

###### st_theme_node_get_foreground_color

Gets `node`‘s foreground color.

###### st_theme_node_get_height

Get the height for `node`, in physical pixels.

###### st_theme_node_get_horizontal_padding

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

###### st_theme_node_get_icon_colors

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

###### st_theme_node_get_icon_style

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

###### st_theme_node_get_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.

###### st_theme_node_get_letter_spacing

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

###### st_theme_node_get_margin

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

###### st_theme_node_get_max_height

Get the maximum height for `node`, in physical pixels.

###### st_theme_node_get_max_width

Get the maximum width for `node`, in physical pixels.

###### st_theme_node_get_min_height

Get the minimum height for `node`, in physical pixels.

###### st_theme_node_get_min_width

Get the minimum width for `node`, in physical pixels.

###### st_theme_node_get_outline_color

Gets the color of `node`‘s outline.

###### st_theme_node_get_outline_width

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

###### st_theme_node_get_padding

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

###### st_theme_node_get_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.

###### st_theme_node_get_parent

Gets the parent themed element node.

###### st_theme_node_get_pseudo_classes

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

###### st_theme_node_get_shadow

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.

###### st_theme_node_get_text_align

Get the text alignment of `node`.

###### st_theme_node_get_text_decoration

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

###### st_theme_node_get_text_shadow

Gets the value for the text-shadow style property.

###### st_theme_node_get_theme

Gets the theme stylesheet set that styles this node.

###### st_theme_node_get_transition_duration

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

###### st_theme_node_get_url

Looks up a property containing a single URL value.

###### st_theme_node_get_vertical_padding

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

###### st_theme_node_get_width

Get the width for `node`, in physical pixels.

###### st_theme_node_hash

Converts `node` to a hash value.

###### st_theme_node_invalidate_background_image

No description available.

###### st_theme_node_invalidate_border_image

No description available.

###### st_theme_node_lookup_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.

###### st_theme_node_lookup_double

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

###### st_theme_node_lookup_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.

###### st_theme_node_lookup_shadow

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

###### st_theme_node_lookup_time

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

###### st_theme_node_lookup_url

Looks up a property containing a single URL value.

###### st_theme_node_paint

No description available.

###### st_theme_node_paint_equal

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.

###### st_theme_node_to_string

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

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct StThemeNodeClass {
      GObjectClass parent_class;

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.