![]() |
![]() |
![]() |
CCSS Reference Manual | ![]() |
---|---|---|---|---|
typedef ccss_stylesheet_t; ccss_stylesheet_t* ccss_stylesheet_new_from_buffer (char const *buffer, size_t size); ccss_stylesheet_t* ccss_stylesheet_new_from_file (char const *css_file); void ccss_stylesheet_free (ccss_stylesheet_t *self); ccss_selector_group_tconst * ccss_stylesheet_query_type (ccss_stylesheet_t const *self, char const *type_name); bool ccss_stylesheet_query_collect (ccss_stylesheet_t const *self, ccss_node_t const *node, ccss_selector_group_t *result_group, bool as_base); bool ccss_stylesheet_query_apply (ccss_stylesheet_t const *self, ccss_node_t const *node, ccss_style_t *style); void ccss_stylesheet_dump (ccss_stylesheet_t const *self); typedef ccss_stylesheet_iter_t; void ccss_stylesheet_iter_init (ccss_stylesheet_iter_t *self, ccss_stylesheet_t const *stylesheet); bool ccss_stylesheet_iter_next (ccss_stylesheet_iter_t *self, char const **type_name, ccss_selector_group_t const **group);
typedef struct ccss_stylesheet_ ccss_stylesheet_t;
Represents a parsed instance of a stylesheet.
ccss_stylesheet_t* ccss_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 ccss_stylesheet_t representation of the CSS string. |
ccss_stylesheet_t* ccss_stylesheet_new_from_file (char const *css_file);
Create a new stylesheet instance based on a CSS file.
|
file to parse. |
Returns : |
a ccss_stylesheet_t representation of the CSS file. |
void ccss_stylesheet_free (ccss_stylesheet_t *self);
Free the stylesheet and all associated resources.
|
a ccss_stylesheet_t. |
ccss_selector_group_tconst * ccss_stylesheet_query_type (ccss_stylesheet_t const *self, char const *type_name);
Query the stylesheet for styling information regarding a type.
|
a ccss_stylesheet_t. |
|
the type to query for, e.g. `h1'. |
Returns : |
a ccss_selector_group_t containing the requested information of NULL .
|
bool ccss_stylesheet_query_collect (ccss_stylesheet_t const *self, ccss_node_t const *node, ccss_selector_group_t *result_group, bool as_base);
Query the stylesheet for styling information regarding a document node and collect the results.
|
a ccss_stylesheet_t. |
|
a ccss_node_t implementation that is used by libccss to retrieve information about the underlying document. |
|
a ccss_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 ccss_stylesheet_query_apply (ccss_stylesheet_t const *self, ccss_node_t const *node, ccss_style_t *style);
Query the stylesheet for styling information regarding a document node and apply the results to a ccss_style_t object.
|
a ccss_stylesheet_t. |
|
a ccss_node_t implementation that is used by libccss to retrieve information about the underlying document. |
|
a ccss_style_t that the results of the query are applied to. |
Returns : |
TRUE if styling information has been found.
|
void ccss_stylesheet_dump (ccss_stylesheet_t const *self);
Print informations about the internal state of this object.
|
a ccss_stylesheet_t. |
typedef GHashTableIter ccss_stylesheet_iter_t;
Stack-allocatable iterator for walking a stylesheet.
void ccss_stylesheet_iter_init (ccss_stylesheet_iter_t *self, ccss_stylesheet_t const *stylesheet);
Modifying the underlying stylesheet invalidates the iterator.
|
a ccss_stylesheet_iter_t. |
|
the stylesheet to iterate. |
bool ccss_stylesheet_iter_next (ccss_stylesheet_iter_t *self, char const **type_name, ccss_selector_group_t const **group);
|
a ccss_stylesheet_iter_t. |
|
type the selector group regards, e.g. DIV in HTML. |
|
the ccss_selector_group_t containing rules for type_name. |
Returns : |
FALSE when the last element is reached.
|