diff options
author | Robert Staudinger <robsta@gnome.org> | 2008-12-04 13:52:14 +0100 |
---|---|---|
committer | Robert Staudinger <robsta@gnome.org> | 2008-12-04 13:52:14 +0100 |
commit | b3cf09da0208c97edb8fad14fbd9db9320854d5b (patch) | |
tree | 917960736b08efef2feacb0cf929fba569ea4efe /ccss/ccss-grammar.c | |
parent | 7450d84dd1368eac2808584020fc2b9f18f0da78 (diff) |
* ccss-doc/ccss-sections.txt:
* ccss-doc/tmpl/grammar.sgml:
* ccss-gtk/Makefile.am:
* ccss-gtk/ccss-gtk-properties.c:
* ccss-gtk/ccss-gtk-properties.h:
* ccss/ccss-grammar.c (ccss_grammar_lookup_property),
(ccss_grammar_lookup_function):
* ccss/ccss-grammar.h:
* ccss/ccss.sym:
API to query property- and function-handlers.
Diffstat (limited to 'ccss/ccss-grammar.c')
-rw-r--r-- | ccss/ccss-grammar.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/ccss/ccss-grammar.c b/ccss/ccss-grammar.c index d40177c..c21e228 100644 --- a/ccss/ccss-grammar.c +++ b/ccss/ccss-grammar.c @@ -130,6 +130,25 @@ ccss_grammar_add_properties (ccss_grammar_t *self, } /** + * ccss_grammar_lookup_property: + * @self: a #ccss_grammar_t. + * @name: name of the property class to look up. + * + * Look up a property handler by name. + * + * Returns: the property handler or %NULL if not found. + **/ +ccss_property_class_t const * +ccss_grammar_lookup_property (ccss_grammar_t const *self, + char const *name) +{ + g_return_val_if_fail (self, NULL); + + return (ccss_property_class_t const *) + g_hash_table_lookup (self->properties, name); +} + +/** * ccss_grammar_add_functions: * @functions: Null-terminated array of #ccss_function_t to register. * @@ -153,6 +172,25 @@ ccss_grammar_add_functions (ccss_grammar_t *self, } /** + * ccss_grammar_lookup_function: + * @self: a #ccss_grammar_t. + * @name: name of the function handler to look up. + * + * Look up a function handler by name. + * + * Returns: the property handler or %NULL if not found. + **/ +ccss_function_t const * +ccss_grammar_lookup_function (ccss_grammar_t const *self, + char const *name) +{ + g_return_val_if_fail (self, NULL); + + return (ccss_function_t const *) + g_hash_table_lookup (self->functions, name); +} + +/** * ccss_grammar_create_stylesheet_from_buffer: * @self: a #ccss_grammar_t. * @buffer: buffer to parse. |