css: Move _gtk_css_print_string around

Move this to a separate header, since it is not
parser functionality, and kill the duplicate
gtkcssparserprivate.h header.
This commit is contained in:
Matthias Clasen 2020-10-02 22:28:17 -04:00
parent da8ee53e2d
commit 9033336a23
35 changed files with 105 additions and 43 deletions

View File

@ -32,6 +32,7 @@
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcssdataurlprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtk/css/gtkcssserializerprivate.h"
#ifdef CAIRO_HAS_SCRIPT_SURFACE
#include <cairo-script.h>

View File

@ -151,9 +151,6 @@ gsize gtk_css_parser_consume_any (GtkCssParser
gsize n_options,
gpointer user_data);
void _gtk_css_print_string (GString *str,
const char *string);
G_END_DECLS
#endif /* __GTK_CSS_PARSER_H__ */

View File

@ -17,8 +17,11 @@
#include "config.h"
#include "gtkcssparserprivate.h"
#include "gtkcssserializerprivate.h"
/* Escape a string so that it can be parsed
* as a css string again.
*/
void
_gtk_css_print_string (GString *str,
const char *string)
@ -63,4 +66,3 @@ _gtk_css_print_string (GString *str,
out:
g_string_append_c (str, '"');
}

View File

@ -1,10 +1,10 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2011 Benjamin Otte <otte@gnome.org>
/*
* Copyright © 2020 Red Hat, Inc
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@ -13,15 +13,21 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors: Matthias Clasen <mclasen@redhat.com>
*/
#ifndef __GTK_CSS_PARSER_PRIVATE_H__
#define __GTK_CSS_PARSER_PRIVATE_H__
#include <gtk/gtkcssprovider.h>
#ifndef __GTK_CSS_SERIALIZER_H__
#define __GTK_CSS_SERIALIZER_H__
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include <glib.h>
#endif /* __GTK_CSS_PARSER_PRIVATE_H__ */
G_BEGIN_DECLS
void _gtk_css_print_string (GString *str,
const char *string);
G_END_DECLS
#endif /* __GTK_CSS_SERIALIZER_H__ */

View File

@ -8,6 +8,7 @@ gtk_css_private_sources = files([
'gtkcssdataurl.c',
'gtkcssparser.c',
'gtkcsstokenizer.c',
'gtkcssserializer.c',
])
gtk_css_public_headers = files([

View File

@ -20,7 +20,9 @@
#ifndef __GTK_CSS_ARRAY_VALUE_PRIVATE_H__
#define __GTK_CSS_ARRAY_VALUE_PRIVATE_H__
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
#include "gtktypes.h"

View File

@ -20,7 +20,9 @@
#ifndef __GTK_CSS_BG_SIZE_VALUE_PRIVATE_H__
#define __GTK_CSS_BG_SIZE_VALUE_PRIVATE_H__
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssimageprivate.h"
#include "gtkcssvalueprivate.h"

View File

@ -20,7 +20,9 @@
#ifndef __GTK_CSS_BORDER_VALUE_PRIVATE_H__
#define __GTK_CSS_BORDER_VALUE_PRIVATE_H__
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkcssvalueprivate.h"

View File

@ -18,7 +18,9 @@
#ifndef __GTK_CSS_COLOR_VALUE_PRIVATE_H__
#define __GTK_CSS_COLOR_VALUE_PRIVATE_H__
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS

View File

@ -20,7 +20,9 @@
#ifndef __GTK_CSS_CORNER_VALUE_PRIVATE_H__
#define __GTK_CSS_CORNER_VALUE_PRIVATE_H__
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS

View File

@ -20,7 +20,9 @@
#ifndef __GTK_CSS_EASE_VALUE_PRIVATE_H__
#define __GTK_CSS_EASE_VALUE_PRIVATE_H__
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS

View File

@ -21,7 +21,9 @@
#define __GTK_CSS_ENUM_VALUE_PRIVATE_H__
#include "gtkenums.h"
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcsstypesprivate.h"
#include "gtkcssvalueprivate.h"

View File

@ -20,7 +20,9 @@
#ifndef __GTK_CSS_FILTER_VALUE_PRIVATE_H__
#define __GTK_CSS_FILTER_VALUE_PRIVATE_H__
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS

View File

@ -20,7 +20,9 @@
#include "config.h"
#include "gtkcsstypesprivate.h"
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkcssfontfeaturesvalueprivate.h"

View File

@ -20,7 +20,9 @@
#ifndef __GTK_CSS_FONT_FEATURES_VALUE_PRIVATE_H__
#define __GTK_CSS_FONT_FEATURES_VALUE_PRIVATE_H__
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS

View File

@ -19,7 +19,9 @@
#include "config.h"
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssnumbervalueprivate.h"
#include "gtkcssfontvariationsvalueprivate.h"

View File

@ -20,7 +20,9 @@
#ifndef __GTK_CSS_FONT_VARIATIONS_VALUE_PRIVATE_H__
#define __GTK_CSS_FONT_VARIATIONS_VALUE_PRIVATE_H__
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS

View File

@ -23,6 +23,7 @@
#include <math.h>
#include "gtk/css/gtkcssserializerprivate.h"
#include "gtksettingsprivate.h"
#include "gtksnapshot.h"
#include "gtkstyleproviderprivate.h"

View File

@ -23,7 +23,9 @@
#include <cairo.h>
#include <glib-object.h>
#include "gtk/gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtk/gtkcsstypesprivate.h"
#include "gtk/gtksnapshot.h"
#include "gtk/gtkstyleprovider.h"

View File

@ -20,7 +20,9 @@
#ifndef __GTK_CSS_KEYFRAMES_PRIVATE_H__
#define __GTK_CSS_KEYFRAMES_PRIVATE_H__
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
#include "gtktypes.h"

View File

@ -20,7 +20,9 @@
#ifndef __GTK_CSS_NUMBER_VALUE_PRIVATE_H__
#define __GTK_CSS_NUMBER_VALUE_PRIVATE_H__
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcsstypesprivate.h"
#include "gtkcssvalueprivate.h"

View File

@ -20,7 +20,9 @@
#ifndef __GTK_CSS_PALETTE_VALUE_PRIVATE_H__
#define __GTK_CSS_PALETTE_VALUE_PRIVATE_H__
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS

View File

@ -20,7 +20,9 @@
#ifndef __GTK_CSS_POSITION_VALUE_PRIVATE_H__
#define __GTK_CSS_POSITION_VALUE_PRIVATE_H__
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS

View File

@ -19,11 +19,13 @@
#include "gtkcssproviderprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkbitmaskprivate.h"
#include "gtkcssarrayvalueprivate.h"
#include "gtkcsscolorvalueprivate.h"
#include "gtkcsskeyframesprivate.h"
#include "gtkcssparserprivate.h"
#include "gtkcssselectorprivate.h"
#include "gtkcssshorthandpropertyprivate.h"
#include "gtksettingsprivate.h"

View File

@ -20,7 +20,9 @@
#ifndef __GTK_CSS_REPEAT_VALUE_PRIVATE_H__
#define __GTK_CSS_REPEAT_VALUE_PRIVATE_H__
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS

View File

@ -18,9 +18,11 @@
#ifndef __GTK_CSS_SELECTOR_PRIVATE_H__
#define __GTK_CSS_SELECTOR_PRIVATE_H__
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtk/gtkcountingbloomfilterprivate.h"
#include "gtk/gtkcsstypesprivate.h"
#include "gtk/gtkcssparserprivate.h"
#define GDK_ARRAY_ELEMENT_TYPE gpointer
#define GDK_ARRAY_TYPE_NAME GtkCssSelectorMatches

View File

@ -23,9 +23,11 @@
#include <cairo.h>
#include <pango/pango.h>
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkborder.h"
#include "gtktypes.h"
#include "gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
#include "gtkroundedboxprivate.h"
#include "gtksnapshot.h"

View File

@ -22,7 +22,9 @@
#include <glib-object.h>
#include "gtk/gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtk/gtkcssstylepropertyprivate.h"
#include "gtk/gtkstylepropertyprivate.h"

View File

@ -18,6 +18,7 @@
#include "config.h"
#include "gtkcssstringvalueprivate.h"
#include "gtk/css/gtkcssserializerprivate.h"
#include <string.h>

View File

@ -20,7 +20,9 @@
#ifndef __GTK_CSS_STRING_VALUE_PRIVATE_H__
#define __GTK_CSS_STRING_VALUE_PRIVATE_H__
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcsstypesprivate.h"
#include "gtkcssvalueprivate.h"

View File

@ -23,7 +23,9 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <math.h>
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssstylepropertyprivate.h"
#include "gtkcsstypesprivate.h"
#include "gtkintl.h"

View File

@ -20,7 +20,9 @@
#ifndef __GTK_CSS_TRANSFORM_VALUE_PRIVATE_H__
#define __GTK_CSS_TRANSFORM_VALUE_PRIVATE_H__
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS

View File

@ -20,7 +20,9 @@
#include "gtkstylepropertyprivate.h"
#include "gtkcssprovider.h"
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkcssshorthandpropertyprivate.h"
#include "gtkcssstylepropertyprivate.h"
#include "gtkcsstypesprivate.h"

View File

@ -18,7 +18,9 @@
#ifndef __GTK_STYLEPROPERTY_PRIVATE_H__
#define __GTK_STYLEPROPERTY_PRIVATE_H__
#include "gtkcssparserprivate.h"
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
#include "gtk/css/gtkcssparserprivate.h"
#include "gtkstylecontextprivate.h"
#include "gtkcssvalueprivate.h"

View File

@ -82,7 +82,6 @@ gtk_private_sources = files([
'gtkcssnodestylecache.c',
'gtkcssnumbervalue.c',
'gtkcsspalettevalue.c',
'gtkcssparser.c',
'gtkcsspositionvalue.c',
'gtkcssrepeatvalue.c',
'gtkcssselector.c',