ccss_style_t

ccss_style_t

Synopsis

typedef             ccss_style_t;
void                ccss_style_destroy                  (ccss_style_t *self);
bool                ccss_style_get_double               (ccss_style_t const *self,
                                                         char const *property_name,
                                                         double *value);
bool                ccss_style_get_property             (ccss_style_t const *self,
                                                         char const *property_name,
                                                         ccss_property_base_t const **value);
void                ccss_style_set_property             (ccss_style_t *self,
                                                         char const *property_name,
                                                         ccss_property_base_t const *value);
bool                ccss_style_get_string               (ccss_style_t const *self,
                                                         char const *property_name,
                                                         char **value);
void                (*ccss_style_iterator_f)            (ccss_style_t const *self,
                                                         char const *property_name,
                                                         void *user_data);
void                ccss_style_foreach                  (ccss_style_t const *self,
                                                         ccss_style_iterator_f func,
                                                         void *user_data);
void                ccss_style_dump                     (ccss_style_t const *self);

Description

Details

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.


ccss_style_destroy ()

void                ccss_style_destroy                  (ccss_style_t *self);

Frees the style an all associated resources.

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.

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_base_t const **value);

Query a custom property.

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_base_t const *value);

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

self :

a ccss_style_t.

property_name :

name of the property.

value :

location to store the raw property pointer.

ccss_style_get_string ()

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

Query a string property.

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_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().

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.

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.

self :

a ccss_style_t.