ccss_style_t

ccss_style_t

Functions

Types and Values

typedef ccss_style_t

Description

Functions

ccss_style_destroy ()

void
ccss_style_destroy (ccss_style_t *self);

Frees the style an all associated resources.

Parameters

self

a ccss_style_t.

 

ccss_style_get_double ()

bool
ccss_style_get_double (ccss_style_t const *self,
                       char const *property_name,
                       double *value);

Query a numeric property.

Parameters

self

a ccss_style_t.

 

property_name

name of the property.

 

value

location to store the converted property.

 

Returns

TRUE if the property was found and could be converted.


ccss_style_get_property ()

bool
ccss_style_get_property (ccss_style_t const *self,
                         char const *property_name,
                         ccss_property_t const **value);

Query a custom property.

Parameters

self

a ccss_style_t.

 

property_name

name of the property.

 

value

location to store the raw property pointer.

 

Returns

TRUE if the property was found.


ccss_style_set_property ()

void
ccss_style_set_property (ccss_style_t *self,
                         char const *property_name,
                         ccss_property_t const *value);

Insert custom property. This is for custom property implementations only.

Parameters

self

a ccss_style_t.

 

property_name

name of the property.

 

value

the property to insert into the style.

 

ccss_style_get_string ()

bool
ccss_style_get_string (ccss_style_t const *self,
                       char const *property_name,
                       char **value);

Query a string property.

Parameters

self

a ccss_style_t.

 

property_name

name of the property.

 

value

location to store the converted property.

 

Returns

TRUE if the property was found and could be converted.


ccss_style_hash ()

uint32_t
ccss_style_hash (ccss_style_t const *self);

Calculates a hash value that uniquely identifies a style. If two styles have the same hash value they are equal.

A hash value of 0 is returned for NULL or empty styles.

Parameters

self

a ccss_style_t.

 

Returns

hash value.


ccss_style_iterator_f ()

void
(*ccss_style_iterator_f) (ccss_style_t const *self,
                          char const *property_name,
                          void *user_data);

Specifies the type of the function passed to ccss_style_foreach().

Parameters

self

a ccss_style_t.

 

property_name

property name , e.g. `background-color'.

 

user_data

user data passed to ccss_style_foreach.

 

ccss_style_foreach ()

void
ccss_style_foreach (ccss_style_t const *self,
                    ccss_style_iterator_f func,
                    void *user_data);

The iterator function func is called for each type in the style.

Parameters

self

a ccss_style_t.

 

func

a ccss_style_iterator_f.

 

user_data

user data to pass to the iterator function.

 

ccss_style_dump ()

void
ccss_style_dump (ccss_style_t const *self);

Print informations about the internal state of this object.

Parameters

self

a ccss_style_t.

 

Types and Values

ccss_style_t

typedef struct ccss_style_ ccss_style_t;

Representation of a block of CSS statements.

Memory management: Style objects are owned by the stylesheet, and therefore not created or modified by the CCSS consumer.