mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-04 01:31:13 +00:00
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:
parent
5ca35bd5dd
commit
94b80cc774
@ -474,7 +474,7 @@ _gtk_gradient_parse (GtkCssParser *parser)
|
|||||||
return NULL;
|
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)
|
if (color == NULL)
|
||||||
{
|
{
|
||||||
gtk_gradient_unref (gradient);
|
gtk_gradient_unref (gradient);
|
||||||
|
@ -1838,7 +1838,7 @@ parse_import (GtkCssScanner *scanner)
|
|||||||
static gboolean
|
static gboolean
|
||||||
parse_color_definition (GtkCssScanner *scanner)
|
parse_color_definition (GtkCssScanner *scanner)
|
||||||
{
|
{
|
||||||
GtkCssValue *symbolic;
|
GtkSymbolicColor *symbolic;
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
gtk_css_scanner_push_section (scanner, GTK_CSS_SECTION_COLOR_DEFINITION);
|
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))
|
if (!_gtk_css_parser_try (scanner->parser, ";", TRUE))
|
||||||
{
|
{
|
||||||
g_free (name);
|
g_free (name);
|
||||||
_gtk_css_value_unref (symbolic);
|
gtk_symbolic_color_unref (symbolic);
|
||||||
gtk_css_provider_error_literal (scanner->provider,
|
gtk_css_provider_error_literal (scanner->provider,
|
||||||
scanner,
|
scanner,
|
||||||
GTK_CSS_PROVIDER_ERROR,
|
GTK_CSS_PROVIDER_ERROR,
|
||||||
|
@ -171,7 +171,7 @@ rgba_value_parse (GtkCssParser *parser,
|
|||||||
GtkSymbolicColor *symbolic;
|
GtkSymbolicColor *symbolic;
|
||||||
GdkRGBA rgba;
|
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)
|
if (symbolic == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
@ -253,7 +253,7 @@ color_value_parse (GtkCssParser *parser,
|
|||||||
GtkSymbolicColor *symbolic;
|
GtkSymbolicColor *symbolic;
|
||||||
GdkRGBA rgba;
|
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)
|
if (symbolic == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
@ -338,7 +338,7 @@ symbolic_color_value_parse (GtkCssParser *parser,
|
|||||||
{
|
{
|
||||||
GtkSymbolicColor *symbolic;
|
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)
|
if (symbolic == NULL)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
@ -810,8 +810,6 @@ typedef enum {
|
|||||||
COLOR_WIN32
|
COLOR_WIN32
|
||||||
} ColorParseType;
|
} ColorParseType;
|
||||||
|
|
||||||
static GtkSymbolicColor * gtk_css_parser_read_symbolic_color (GtkCssParser *parser);
|
|
||||||
|
|
||||||
static GtkSymbolicColor *
|
static GtkSymbolicColor *
|
||||||
gtk_css_parser_read_symbolic_color_function (GtkCssParser *parser,
|
gtk_css_parser_read_symbolic_color_function (GtkCssParser *parser,
|
||||||
ColorParseType color)
|
ColorParseType color)
|
||||||
@ -886,7 +884,7 @@ gtk_css_parser_read_symbolic_color_function (GtkCssParser *parser,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
child1 = gtk_css_parser_read_symbolic_color (parser);
|
child1 = _gtk_css_symbolic_value_new (parser);
|
||||||
if (child1 == NULL)
|
if (child1 == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
@ -899,7 +897,7 @@ gtk_css_parser_read_symbolic_color_function (GtkCssParser *parser,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
child2 = gtk_css_parser_read_symbolic_color (parser);
|
child2 = _gtk_css_symbolic_value_new (parser);
|
||||||
if (child2 == NULL)
|
if (child2 == NULL)
|
||||||
{
|
{
|
||||||
gtk_symbolic_color_unref (child1);
|
gtk_symbolic_color_unref (child1);
|
||||||
@ -967,8 +965,8 @@ gtk_css_parser_read_symbolic_color_function (GtkCssParser *parser,
|
|||||||
return symbolic;
|
return symbolic;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GtkSymbolicColor *
|
GtkSymbolicColor *
|
||||||
gtk_css_parser_read_symbolic_color (GtkCssParser *parser)
|
_gtk_css_symbolic_value_new (GtkCssParser *parser)
|
||||||
{
|
{
|
||||||
GtkSymbolicColor *symbolic;
|
GtkSymbolicColor *symbolic;
|
||||||
GdkRGBA rgba;
|
GdkRGBA rgba;
|
||||||
@ -1036,12 +1034,3 @@ gtk_css_parser_read_symbolic_color (GtkCssParser *parser)
|
|||||||
_gtk_css_parser_error (parser, "Not a color definition");
|
_gtk_css_parser_error (parser, "Not a color definition");
|
||||||
return NULL;
|
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));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ GtkCssValue * _gtk_symbolic_color_resolve_full (GtkSymbolicColor
|
|||||||
|
|
||||||
GtkSymbolicColor * _gtk_symbolic_color_get_current_color (void);
|
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. */
|
/* I made these inline functions instead of macros to gain type safety for the arguments passed in. */
|
||||||
static inline GtkSymbolicColor *
|
static inline GtkSymbolicColor *
|
||||||
|
Loading…
Reference in New Issue
Block a user