CtkStyleProperties

CtkStyleProperties — Store for style property information

Functions

Types and Values

Includes

#include <ctk/ctk.h>

Description

CtkStyleProperties provides the storage for style information that is used by CtkStyleContext and other CtkStyleProvider implementations.

Before style properties can be stored in CtkStyleProperties, they must be registered with ctk_style_properties_register_property().

Unless you are writing a CtkStyleProvider implementation, you are unlikely to use this API directly, as ctk_style_context_get() and its variants are the preferred way to access styling information from widget implementations and theming engine implementations should use the APIs provided by CtkThemingEngine instead.

Functions

ctk_style_properties_clear ()

void
ctk_style_properties_clear (CtkStyleProperties *props);

Clears all style information from props .

Parameters

props

a CtkStyleProperties

 

ctk_style_properties_get ()

void
ctk_style_properties_get (CtkStyleProperties *props,
                          CtkStateFlags state,
                          ...);

Retrieves several style property values from props for a given state.

Parameters

props

a CtkStyleProperties

 

state

state to retrieve the property values for

 

...

property name /return value pairs, followed by NULL

 

Since: 3.0


ctk_style_properties_get_property ()

gboolean
ctk_style_properties_get_property (CtkStyleProperties *props,
                                   const gchar *property,
                                   CtkStateFlags state,
                                   GValue *value);

Gets a style property from props for the given state. When done with value , g_value_unset() needs to be called to free any allocated memory.

Parameters

props

a CtkStyleProperties

 

property

style property name

 

state

state to retrieve the property value for

 

value

return location for the style property value.

[out][transfer full]

Returns

TRUE if the property exists in props , FALSE otherwise

Since: 3.0


ctk_style_properties_get_valist ()

void
ctk_style_properties_get_valist (CtkStyleProperties *props,
                                 CtkStateFlags state,
                                 va_list args);

Retrieves several style property values from props for a given state.

Parameters

props

a CtkStyleProperties

 

state

state to retrieve the property values for

 

args

va_list of property name/return location pairs, followed by NULL

 

Since: 3.0


ctk_style_properties_lookup_color ()

CtkSymbolicColor *
ctk_style_properties_lookup_color (CtkStyleProperties *props,
                                   const gchar *name);

ctk_style_properties_lookup_color has been deprecated since version 3.8 and should not be used in newly-written code.

CtkSymbolicColor is deprecated.

Returns the symbolic color that is mapped to name .

Parameters

props

a CtkStyleProperties

 

name

color name to lookup

 

Returns

The mapped color.

[transfer none]

Since: 3.0


ctk_style_properties_lookup_property ()

gboolean
ctk_style_properties_lookup_property (const gchar *property_name,
                                      CtkStylePropertyParser *parse_func,
                                      GParamSpec **pspec);

ctk_style_properties_lookup_property has been deprecated since version 3.8 and should not be used in newly-written code.

This code could only look up custom properties and those are deprecated.

Returns TRUE if a property has been registered, if pspec or parse_func are not NULL, the GParamSpec and parsing function will be respectively returned.

[skip]

Parameters

property_name

property name to look up

 

parse_func

return location for the parse function.

[out]

pspec

return location for the GParamSpec.

[out][transfer none]

Returns

TRUE if the property is registered, FALSE otherwise

Since: 3.0


ctk_style_properties_map_color ()

void
ctk_style_properties_map_color (CtkStyleProperties *props,
                                const gchar *name,
                                CtkSymbolicColor *color);

ctk_style_properties_map_color has been deprecated since version 3.8 and should not be used in newly-written code.

CtkSymbolicColor is deprecated.

Maps color so it can be referenced by name . See ctk_style_properties_lookup_color()

Parameters

props

a CtkStyleProperties

 

name

color name

 

color

CtkSymbolicColor to map name to

 

Since: 3.0


ctk_style_properties_merge ()

void
ctk_style_properties_merge (CtkStyleProperties *props,
                            const CtkStyleProperties *props_to_merge,
                            gboolean replace);

ctk_style_properties_merge has been deprecated since version 3.16 and should not be used in newly-written code.

CtkSymbolicColor is deprecated.

Merges into props all the style information contained in props_to_merge . If replace is TRUE, the values will be overwritten, if it is FALSE, the older values will prevail.

Parameters

props

a CtkStyleProperties

 

props_to_merge

a second CtkStyleProperties

 

replace

whether to replace values or not

 

Since: 3.0


ctk_style_properties_new ()

CtkStyleProperties *
ctk_style_properties_new (void);

Returns a newly created CtkStyleProperties

Returns

a new CtkStyleProperties


CtkStylePropertyParser ()

gboolean
(*CtkStylePropertyParser) (const gchar *string,
                           GValue *value,
                           GError **error);

ctk_style_properties_register_property ()

void
ctk_style_properties_register_property
                               (CtkStylePropertyParser parse_func,
                                GParamSpec *pspec);

ctk_style_properties_register_property has been deprecated since version 3.8 and should not be used in newly-written code.

Code should use the default properties provided by CSS.

Registers a property so it can be used in the CSS file format. This function is the low-level equivalent of ctk_theming_engine_register_property(), if you are implementing a theming engine, you want to use that function instead.

[skip]

Parameters

parse_func

parsing function to use, or NULL.

[nullable]

pspec

the GParamSpec for the new property

 

Since: 3.0


ctk_style_properties_set ()

void
ctk_style_properties_set (CtkStyleProperties *props,
                          CtkStateFlags state,
                          ...);

Sets several style properties on props .

Parameters

props

a CtkStyleProperties

 

state

state to set the values for

 

...

property name/value pairs, followed by NULL

 

Since: 3.0


ctk_style_properties_set_property ()

void
ctk_style_properties_set_property (CtkStyleProperties *props,
                                   const gchar *property,
                                   CtkStateFlags state,
                                   const GValue *value);

Sets a styling property in props .

Parameters

props

a CtkStyleProperties

 

property

styling property to set

 

state

state to set the value for

 

value

new value for the property

 

Since: 3.0


ctk_style_properties_set_valist ()

void
ctk_style_properties_set_valist (CtkStyleProperties *props,
                                 CtkStateFlags state,
                                 va_list args);

Sets several style properties on props .

Parameters

props

a CtkStyleProperties

 

state

state to set the values for

 

args

va_list of property name/value pairs, followed by NULL

 

Since: 3.0


ctk_style_properties_unset_property ()

void
ctk_style_properties_unset_property (CtkStyleProperties *props,
                                     const gchar *property,
                                     CtkStateFlags state);

Unsets a style property in props .

Parameters

props

a CtkStyleProperties

 

property

property to unset

 

state

state to unset

 

Since: 3.0

Types and Values

struct CtkStyleProperties

struct CtkStyleProperties {
};