symboliccolor: Change prototype of function

Makes it easier to use the function in the places where it's still used.
This commit is contained in:
Benjamin Otte 2012-11-24 21:56:31 +01:00
parent 5ca35bd5dd
commit 94b80cc774
5 changed files with 11 additions and 22 deletions

View File

@ -474,7 +474,7 @@ _gtk_gradient_parse (GtkCssParser *parser)
return NULL;
}
color = _gtk_symbolic_color_new_take_value (_gtk_css_symbolic_value_new (parser));
color = _gtk_css_symbolic_value_new (parser);
if (color == NULL)
{
gtk_gradient_unref (gradient);

View File

@ -1838,7 +1838,7 @@ parse_import (GtkCssScanner *scanner)
static gboolean
parse_color_definition (GtkCssScanner *scanner)
{
GtkCssValue *symbolic;
GtkSymbolicColor *symbolic;
char *name;
gtk_css_scanner_push_section (scanner, GTK_CSS_SECTION_COLOR_DEFINITION);
@ -1874,7 +1874,7 @@ parse_color_definition (GtkCssScanner *scanner)
if (!_gtk_css_parser_try (scanner->parser, ";", TRUE))
{
g_free (name);
_gtk_css_value_unref (symbolic);
gtk_symbolic_color_unref (symbolic);
gtk_css_provider_error_literal (scanner->provider,
scanner,
GTK_CSS_PROVIDER_ERROR,

View File

@ -171,7 +171,7 @@ rgba_value_parse (GtkCssParser *parser,
GtkSymbolicColor *symbolic;
GdkRGBA rgba;
symbolic = _gtk_symbolic_color_new_take_value (_gtk_css_symbolic_value_new (parser));
symbolic = _gtk_css_symbolic_value_new (parser);
if (symbolic == NULL)
return FALSE;
@ -253,7 +253,7 @@ color_value_parse (GtkCssParser *parser,
GtkSymbolicColor *symbolic;
GdkRGBA rgba;
symbolic = _gtk_symbolic_color_new_take_value (_gtk_css_symbolic_value_new (parser));
symbolic = _gtk_css_symbolic_value_new (parser);
if (symbolic == NULL)
return FALSE;
@ -338,7 +338,7 @@ symbolic_color_value_parse (GtkCssParser *parser,
{
GtkSymbolicColor *symbolic;
symbolic = _gtk_symbolic_color_new_take_value (_gtk_css_symbolic_value_new (parser));
symbolic = _gtk_css_symbolic_value_new (parser);
if (symbolic == NULL)
return FALSE;

View File

@ -810,8 +810,6 @@ typedef enum {
COLOR_WIN32
} ColorParseType;
static GtkSymbolicColor * gtk_css_parser_read_symbolic_color (GtkCssParser *parser);
static GtkSymbolicColor *
gtk_css_parser_read_symbolic_color_function (GtkCssParser *parser,
ColorParseType color)
@ -886,7 +884,7 @@ gtk_css_parser_read_symbolic_color_function (GtkCssParser *parser,
}
else
{
child1 = gtk_css_parser_read_symbolic_color (parser);
child1 = _gtk_css_symbolic_value_new (parser);
if (child1 == NULL)
return NULL;
@ -899,7 +897,7 @@ gtk_css_parser_read_symbolic_color_function (GtkCssParser *parser,
return NULL;
}
child2 = gtk_css_parser_read_symbolic_color (parser);
child2 = _gtk_css_symbolic_value_new (parser);
if (child2 == NULL)
{
gtk_symbolic_color_unref (child1);
@ -967,8 +965,8 @@ gtk_css_parser_read_symbolic_color_function (GtkCssParser *parser,
return symbolic;
}
static GtkSymbolicColor *
gtk_css_parser_read_symbolic_color (GtkCssParser *parser)
GtkSymbolicColor *
_gtk_css_symbolic_value_new (GtkCssParser *parser)
{
GtkSymbolicColor *symbolic;
GdkRGBA rgba;
@ -1036,12 +1034,3 @@ gtk_css_parser_read_symbolic_color (GtkCssParser *parser)
_gtk_css_parser_error (parser, "Not a color definition");
return NULL;
}
GtkCssValue *
_gtk_css_symbolic_value_new (GtkCssParser *parser)
{
g_return_val_if_fail (parser != NULL, NULL);
return _gtk_css_symbolic_value_new_take_symbolic_color (gtk_css_parser_read_symbolic_color (parser));
}

View File

@ -32,7 +32,7 @@ GtkCssValue * _gtk_symbolic_color_resolve_full (GtkSymbolicColor
GtkSymbolicColor * _gtk_symbolic_color_get_current_color (void);
GtkCssValue * _gtk_css_symbolic_value_new (GtkCssParser *parser);
GtkSymbolicColor * _gtk_css_symbolic_value_new (GtkCssParser *parser);
/* I made these inline functions instead of macros to gain type safety for the arguments passed in. */
static inline GtkSymbolicColor *