![]() |
![]() |
![]() |
CCD Reference Manual | ![]() |
---|---|---|---|---|
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);
typedef struct ccd_stylesheet_ ccd_stylesheet_t;
Represents a parsed instance of a stylesheet.
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 to parse. |
|
size of the buffer. |
Returns : |
a ccd_stylesheet_t representation of the CSS string. |
ccd_stylesheet_t* ccd_stylesheet_new_from_file (char const *css_file);
Create a new stylesheet instance based on a CSS file.
|
file to parse. |
Returns : |
a ccd_stylesheet_t representation of the CSS file. |
void ccd_stylesheet_free (ccd_stylesheet_t *self);
Free the stylesheet and all associated resources.
|
a ccd_stylesheet_t. |
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.
|
a ccd_stylesheet_t. |
|
the type to query for, e.g. `h1'. |
Returns : |
a ccd_selector_group_t containing the requested information of NULL .
|
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.
|
a ccd_stylesheet_t. |
|
a ccd_node_t implementation that is used by libccd to retrieve information about the underlying document. |
|
a ccd_selector_group_t that accumulates the results of the query. |
|
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.
|
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.
|
a ccd_stylesheet_t. |
|
a ccd_node_t implementation that is used by libccd to retrieve information about the underlying document. |
|
a ccd_style_t that the results of the query are applied to. |
Returns : |
TRUE if styling information has been found.
|
void ccd_stylesheet_dump (ccd_stylesheet_t const *self);
Print informations about the internal state of this object.
|
a ccd_stylesheet_t. |