css: Rename function to _gtk_style_property_parse_value()

... and take an optional style property as argument. This way, we can
allow custom parse functions for properties. The style property needs to
be optional so that we can use it for widget style properties, too.
This commit is contained in:
Benjamin Otte 2011-05-26 01:01:44 +02:00
parent 35488f5846
commit 5a42464547
3 changed files with 16 additions and 12 deletions

View File

@ -1371,9 +1371,10 @@ gtk_css_provider_get_style_property (GtkStyleProvider *provider,
gtk_css_provider_parser_error,
provider);
found = _gtk_css_value_parse (value,
parser,
NULL);
found = _gtk_style_property_parse_value (NULL,
value,
parser,
NULL);
_gtk_css_parser_free (parser);
@ -2122,9 +2123,10 @@ parse_declaration (GtkCssScanner *scanner,
}
else
{
if (_gtk_css_value_parse (val,
scanner->parser,
gtk_css_scanner_get_base_url (scanner)))
if (_gtk_style_property_parse_value (property,
val,
scanner->parser,
gtk_css_scanner_get_base_url (scanner)))
{
if (_gtk_css_parser_begins_with (scanner->parser, ';') ||
_gtk_css_parser_begins_with (scanner->parser, '}') ||

View File

@ -1375,9 +1375,10 @@ css_string_funcs_init (void)
}
gboolean
_gtk_css_value_parse (GValue *value,
GtkCssParser *parser,
GFile *base)
_gtk_style_property_parse_value (const GtkStyleProperty *property,
GValue *value,
GtkCssParser *parser,
GFile *base)
{
ParseFunc func;

View File

@ -56,9 +56,10 @@ void _gtk_style_property_pack (const GtkStyleProper
GtkStateFlags state,
GValue *value);
gboolean _gtk_css_value_parse (GValue *value,
GtkCssParser *parser,
GFile *base);
gboolean _gtk_style_property_parse_value (const GtkStyleProperty *property,
GValue *value,
GtkCssParser *parser,
GFile *base);
void _gtk_style_property_print_value (const GtkStyleProperty *property,
const GValue *value,
GString *string);