Top | ![]() |
![]() |
![]() |
![]() |
ccss_grammar_t *
ccss_grammar_create_css (void
);
Create a new grammar instance that interprets suppported CSS rules.
Grammar objects provide a factory to create stylesheets of the same class.
ccss_grammar_t *
ccss_grammar_create_generic (void
);
Create a new grammar instance.
Grammar objects provide a factory to create stylesheets of the same class.
void
ccss_grammar_destroy (ccss_grammar_t *self
);
Decreases the reference count on self
by one. If the result is zero, then
self
and all associated resources are freed. See ccss_grammar_reference()
.
ccss_grammar_t *
ccss_grammar_reference (ccss_grammar_t *self
);
Increases the reference count on self
by one. This prevents self
from being
destroyed until a matching call to ccss_grammar_destroy()
is made.
The number of references to a ccss_grammar_t can be acquired using
ccss_grammar_get_reference_count()
.
unsigned int
ccss_grammar_get_reference_count (ccss_grammar_t const *self
);
void ccss_grammar_add_properties (ccss_grammar_t *self
,ccss_property_class_t const *properties
);
Register a set of custom CSS properties with the grammar.
ccss_property_class_t const * ccss_grammar_lookup_property (ccss_grammar_t const *self
,char const *name
);
Look up a property handler by name.
void ccss_grammar_add_functions (ccss_grammar_t *self
,ccss_function_t const *functions
);
Register a set of custom css function handlers with the grammar.
ccss_function_t const * ccss_grammar_lookup_function (ccss_grammar_t const *self
,char const *name
);
Look up a function handler by name.
ccss_stylesheet_t *
ccss_grammar_create_stylesheet (ccss_grammar_t *self
);
Create an empty stylesheet associated with grammar self
.
ccss_stylesheet_t * ccss_grammar_create_stylesheet_from_buffer (ccss_grammar_t *self
,char const *buffer
,size_t size
,void *user_data
);
Create a new stylesheet instance based on a CSS string.
ccss_stylesheet_t * ccss_grammar_create_stylesheet_from_file (ccss_grammar_t *self
,char const *css_file
,void *user_data
);
Create a new stylesheet instance based on a CSS file.
char * ccss_grammar_invoke_function (ccss_grammar_t const *self
,char const *function_name
,CRTerm const *values
,void *user_data
);
Invoke a registerd function handler. This API is meant to be used by property implementations, like when parsing properties like `background-image: url(foo.png)'.