summaryrefslogtreecommitdiff
path: root/gtk/gtkcssstylefuncs.c
diff options
context:
space:
mode:
authorCosimo Cecchi <cosimoc@gnome.org>2012-01-13 17:55:53 -0500
committerCosimo Cecchi <cosimoc@gnome.org>2012-01-13 17:55:53 -0500
commitd1f3fe4342878dc303034daa9b388e5d50fbbca4 (patch)
tree3f33520a883b365ab0c089b3a434d2e6a8000bf1 /gtk/gtkcssstylefuncs.c
parent4f4e42239a8365bfc27c2ba238964073e6822921 (diff)
downloadgtk+-d1f3fe4342878dc303034daa9b388e5d50fbbca4.tar.gz
parser: remove a duplicate copy of gtk_css_parse_url()
Move the function to gtkcssparser.c and use it in both places.
Diffstat (limited to 'gtk/gtkcssstylefuncs.c')
-rw-r--r--gtk/gtkcssstylefuncs.c58
1 files changed, 1 insertions, 57 deletions
diff --git a/gtk/gtkcssstylefuncs.c b/gtk/gtkcssstylefuncs.c
index 5184b526c5..21404bb243 100644
--- a/gtk/gtkcssstylefuncs.c
+++ b/gtk/gtkcssstylefuncs.c
@@ -740,62 +740,6 @@ gradient_value_print (const GValue *value,
}
}
-static GFile *
-gtk_css_parse_url (GtkCssParser *parser,
- GFile *base)
-{
- gchar *path;
- GFile *file;
-
- if (_gtk_css_parser_try (parser, "url", FALSE))
- {
- if (!_gtk_css_parser_try (parser, "(", TRUE))
- {
- _gtk_css_parser_skip_whitespace (parser);
- if (_gtk_css_parser_try (parser, "(", TRUE))
- {
- GError *error;
-
- error = g_error_new_literal (GTK_CSS_PROVIDER_ERROR,
- GTK_CSS_PROVIDER_ERROR_DEPRECATED,
- "Whitespace between 'url' and '(' is deprecated");
-
- _gtk_css_parser_take_error (parser, error);
- }
- else
- {
- _gtk_css_parser_error (parser, "Expected '(' after 'url'");
- return NULL;
- }
- }
-
- path = _gtk_css_parser_read_string (parser);
- if (path == NULL)
- return NULL;
-
- if (!_gtk_css_parser_try (parser, ")", TRUE))
- {
- _gtk_css_parser_error (parser, "No closing ')' found for 'url'");
- g_free (path);
- return NULL;
- }
- }
- else
- {
- path = _gtk_css_parser_try_name (parser, TRUE);
- if (path == NULL)
- {
- _gtk_css_parser_error (parser, "Not a valid url");
- return NULL;
- }
- }
-
- file = g_file_resolve_relative_path (base, path);
- g_free (path);
-
- return file;
-}
-
static gboolean
pattern_value_parse (GtkCssParser *parser,
GFile *base,
@@ -822,7 +766,7 @@ pattern_value_parse (GtkCssParser *parser,
cairo_t *cr;
cairo_matrix_t matrix;
- file = gtk_css_parse_url (parser, base);
+ file = _gtk_css_parser_read_url (parser, base);
if (file == NULL)
return FALSE;