ccd_stylesheet_t

ccd_stylesheet_t

Synopsis

typedef             ccd_stylesheet_t;
ccd_stylesheet_t*   ccd_stylesheet_new_from_buffer      (char const *buffer,
                                                         size_t size);
ccd_stylesheet_t*   ccd_stylesheet_new_from_file        (char const *css_file);
void                ccd_stylesheet_free                 (ccd_stylesheet_t *self);
ccd_selector_group_tconst * ccd_stylesheet_query_type   (ccd_stylesheet_t const *self,
                                                         char const *type_name);
bool                ccd_stylesheet_query_collect        (ccd_stylesheet_t const *self,
                                                         ccd_node_t const *node,
                                                         ccd_selector_group_t *result_group,
                                                         bool as_base);
bool                ccd_stylesheet_query_apply          (ccd_stylesheet_t const *self,
                                                         ccd_node_t const *node,
                                                         ccd_style_t *style);
void                ccd_stylesheet_dump                 (ccd_stylesheet_t const *self);

Description

Details

ccd_stylesheet_t

typedef struct ccd_stylesheet_ ccd_stylesheet_t;

Represents a parsed instance of a stylesheet.


ccd_stylesheet_new_from_buffer ()

ccd_stylesheet_t*   ccd_stylesheet_new_from_buffer      (char const *buffer,
                                                         size_t size);

Create a new stylesheet instance based on a CSS string.

buffer :

buffer to parse.

size :

size of the buffer.

Returns :

a ccd_stylesheet_t representation of the CSS string.

ccd_stylesheet_new_from_file ()

ccd_stylesheet_t*   ccd_stylesheet_new_from_file        (char const *css_file);

Create a new stylesheet instance based on a CSS file.

css_file :

file to parse.

Returns :

a ccd_stylesheet_t representation of the CSS file.

ccd_stylesheet_free ()

void                ccd_stylesheet_free                 (ccd_stylesheet_t *self);

Free the stylesheet and all associated resources.

self :

a ccd_stylesheet_t.

ccd_stylesheet_query_type ()

ccd_selector_group_tconst * ccd_stylesheet_query_type   (ccd_stylesheet_t const *self,
                                                         char const *type_name);

Query the stylesheet for styling information regarding a type.

self :

a ccd_stylesheet_t.

type_name :

the type to query for, e.g. `h1'.

Returns :

a ccd_selector_group_t containing the requested information of NULL.

ccd_stylesheet_query_collect ()

bool                ccd_stylesheet_query_collect        (ccd_stylesheet_t const *self,
                                                         ccd_node_t const *node,
                                                         ccd_selector_group_t *result_group,
                                                         bool as_base);

Query the stylesheet for styling information regarding a document node and collect the results.

self :

a ccd_stylesheet_t.

node :

a ccd_node_t implementation that is used by libccd to retrieve information about the underlying document.

result_group :

a ccd_selector_group_t that accumulates the results of the query.

as_base :

whether the results should be accumulates with lowered priority, e.g. when querying for base style information.

Returns :

TRUE if styling information has been found.

ccd_stylesheet_query_apply ()

bool                ccd_stylesheet_query_apply          (ccd_stylesheet_t const *self,
                                                         ccd_node_t const *node,
                                                         ccd_style_t *style);

Query the stylesheet for styling information regarding a document node and apply the results to a ccd_style_t object.

self :

a ccd_stylesheet_t.

node :

a ccd_node_t implementation that is used by libccd to retrieve information about the underlying document.

style :

a ccd_style_t that the results of the query are applied to.

Returns :

TRUE if styling information has been found.

ccd_stylesheet_dump ()

void                ccd_stylesheet_dump                 (ccd_stylesheet_t const *self);

Print informations about the internal state of this object.

self :

a ccd_stylesheet_t.