diff --git a/gdk/gdkglobals.c b/gdk/gdkglobals.c index 644dcfa63f..22b4cf0f44 100644 --- a/gdk/gdkglobals.c +++ b/gdk/gdkglobals.c @@ -30,4 +30,3 @@ #include guint _gdk_debug_flags = 0; -GList *_gdk_default_filters = NULL; diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c index 4cfe31535c..16a76dbff8 100644 --- a/gsk/gl/gskglrenderer.c +++ b/gsk/gl/gskglrenderer.c @@ -1120,7 +1120,7 @@ compile_glshader (GskGLRenderer *self, program->glshader.texture_locations[2] = glGetUniformLocation(program->id, "u_texture3"); program->glshader.texture_locations[3] = glGetUniformLocation(program->id, "u_texture4"); - /* We use u_textue1 for the texture 0 in the glshaders, so alias it here so we can use the regular setters */ + /* We use u_texture1 for the texture 0 in the glshaders, so alias it here so we can use the regular setters */ program->source_location = program->glshader.texture_locations[0]; for (int i = 0; i < G_N_ELEMENTS (program->glshader.args_locations); i++) diff --git a/gsk/gskrendernodeparser.c b/gsk/gskrendernodeparser.c index 667a68f8a9..c07b749bf6 100644 --- a/gsk/gskrendernodeparser.c +++ b/gsk/gskrendernodeparser.c @@ -32,6 +32,7 @@ #include #include "gtk/css/gtkcssdataurlprivate.h" #include "gtk/css/gtkcssparserprivate.h" +#include "gtk/css/gtkcssserializerprivate.h" #ifdef CAIRO_HAS_SCRIPT_SURFACE #include @@ -2125,7 +2126,7 @@ append_string_param (Printer *p, { _indent (p); g_string_append_printf (p->str, "%s: ", param_name); - _gtk_css_print_string (p->str, value); + gtk_css_print_string (p->str, value, TRUE); g_string_append_c (p->str, ';'); g_string_append_c (p->str, '\n'); } diff --git a/gtk/css/gtkcssparserprivate.h b/gtk/css/gtkcssparserprivate.h index 9239477020..349ad67999 100644 --- a/gtk/css/gtkcssparserprivate.h +++ b/gtk/css/gtkcssparserprivate.h @@ -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__ */ diff --git a/gtk/gtkcssparser.c b/gtk/css/gtkcssserializer.c similarity index 81% rename from gtk/gtkcssparser.c rename to gtk/css/gtkcssserializer.c index bb5b0a8c4a..d939f38cb6 100644 --- a/gtk/gtkcssparser.c +++ b/gtk/css/gtkcssserializer.c @@ -17,11 +17,15 @@ #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) +gtk_css_print_string (GString *str, + const char *string, + gboolean multiline) { gsize len; @@ -39,7 +43,10 @@ _gtk_css_print_string (GString *str, case '\0': goto out; case '\n': - g_string_append (str, "\\A "); + if (multiline) + g_string_append (str, "\\A\\\n"); + else + g_string_append (str, "\\A "); break; case '\r': g_string_append (str, "\\D "); @@ -63,4 +70,3 @@ _gtk_css_print_string (GString *str, out: g_string_append_c (str, '"'); } - diff --git a/gtk/gtkcssparserprivate.h b/gtk/css/gtkcssserializerprivate.h similarity index 57% rename from gtk/gtkcssparserprivate.h rename to gtk/css/gtkcssserializerprivate.h index 68fa8a18d2..86f9934faa 100644 --- a/gtk/gtkcssparserprivate.h +++ b/gtk/css/gtkcssserializerprivate.h @@ -1,10 +1,10 @@ -/* GTK - The GIMP Toolkit - * Copyright (C) 2011 Benjamin Otte +/* + * 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,22 @@ * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . + * + * Authors: Matthias Clasen */ -#ifndef __GTK_CSS_PARSER_PRIVATE_H__ -#define __GTK_CSS_PARSER_PRIVATE_H__ -#include +#ifndef __GTK_CSS_SERIALIZER_H__ +#define __GTK_CSS_SERIALIZER_H__ -#include -#include "gtk/css/gtkcsstokenizerprivate.h" -#include "gtk/css/gtkcssparserprivate.h" +#include -#endif /* __GTK_CSS_PARSER_PRIVATE_H__ */ +G_BEGIN_DECLS + +void gtk_css_print_string (GString *str, + const char *string, + gboolean multiline); + +G_END_DECLS + +#endif /* __GTK_CSS_SERIALIZER_H__ */ diff --git a/gtk/css/meson.build b/gtk/css/meson.build index 00284baf36..6b24561928 100644 --- a/gtk/css/meson.build +++ b/gtk/css/meson.build @@ -8,6 +8,7 @@ gtk_css_private_sources = files([ 'gtkcssdataurl.c', 'gtkcssparser.c', 'gtkcsstokenizer.c', + 'gtkcssserializer.c', ]) gtk_css_public_headers = files([ diff --git a/gtk/gtkcssarrayvalueprivate.h b/gtk/gtkcssarrayvalueprivate.h index fb9fb376c0..1f9f38b006 100644 --- a/gtk/gtkcssarrayvalueprivate.h +++ b/gtk/gtkcssarrayvalueprivate.h @@ -20,7 +20,9 @@ #ifndef __GTK_CSS_ARRAY_VALUE_PRIVATE_H__ #define __GTK_CSS_ARRAY_VALUE_PRIVATE_H__ -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcssvalueprivate.h" #include "gtktypes.h" diff --git a/gtk/gtkcssbgsizevalueprivate.h b/gtk/gtkcssbgsizevalueprivate.h index 5f31ff2208..47e356ead6 100644 --- a/gtk/gtkcssbgsizevalueprivate.h +++ b/gtk/gtkcssbgsizevalueprivate.h @@ -20,7 +20,9 @@ #ifndef __GTK_CSS_BG_SIZE_VALUE_PRIVATE_H__ #define __GTK_CSS_BG_SIZE_VALUE_PRIVATE_H__ -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcssimageprivate.h" #include "gtkcssvalueprivate.h" diff --git a/gtk/gtkcssbordervalueprivate.h b/gtk/gtkcssbordervalueprivate.h index fe49904002..0fcaaf7db7 100644 --- a/gtk/gtkcssbordervalueprivate.h +++ b/gtk/gtkcssbordervalueprivate.h @@ -20,7 +20,9 @@ #ifndef __GTK_CSS_BORDER_VALUE_PRIVATE_H__ #define __GTK_CSS_BORDER_VALUE_PRIVATE_H__ -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcssnumbervalueprivate.h" #include "gtkcssvalueprivate.h" diff --git a/gtk/gtkcsscolorvalueprivate.h b/gtk/gtkcsscolorvalueprivate.h index 49387d2c43..f96f6f4234 100644 --- a/gtk/gtkcsscolorvalueprivate.h +++ b/gtk/gtkcsscolorvalueprivate.h @@ -18,7 +18,9 @@ #ifndef __GTK_CSS_COLOR_VALUE_PRIVATE_H__ #define __GTK_CSS_COLOR_VALUE_PRIVATE_H__ -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcssvalueprivate.h" G_BEGIN_DECLS diff --git a/gtk/gtkcsscornervalueprivate.h b/gtk/gtkcsscornervalueprivate.h index 59451a7840..a364ce9df5 100644 --- a/gtk/gtkcsscornervalueprivate.h +++ b/gtk/gtkcsscornervalueprivate.h @@ -20,7 +20,9 @@ #ifndef __GTK_CSS_CORNER_VALUE_PRIVATE_H__ #define __GTK_CSS_CORNER_VALUE_PRIVATE_H__ -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcssvalueprivate.h" G_BEGIN_DECLS diff --git a/gtk/gtkcsseasevalueprivate.h b/gtk/gtkcsseasevalueprivate.h index 6b4dab3717..8aa2770fee 100644 --- a/gtk/gtkcsseasevalueprivate.h +++ b/gtk/gtkcsseasevalueprivate.h @@ -20,7 +20,9 @@ #ifndef __GTK_CSS_EASE_VALUE_PRIVATE_H__ #define __GTK_CSS_EASE_VALUE_PRIVATE_H__ -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcssvalueprivate.h" G_BEGIN_DECLS diff --git a/gtk/gtkcssenumvalueprivate.h b/gtk/gtkcssenumvalueprivate.h index 22bab5f1f4..7ac181b7a9 100644 --- a/gtk/gtkcssenumvalueprivate.h +++ b/gtk/gtkcssenumvalueprivate.h @@ -21,7 +21,9 @@ #define __GTK_CSS_ENUM_VALUE_PRIVATE_H__ #include "gtkenums.h" -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcsstypesprivate.h" #include "gtkcssvalueprivate.h" diff --git a/gtk/gtkcssfiltervalueprivate.h b/gtk/gtkcssfiltervalueprivate.h index b9eabaa237..6d76f906b7 100644 --- a/gtk/gtkcssfiltervalueprivate.h +++ b/gtk/gtkcssfiltervalueprivate.h @@ -20,7 +20,9 @@ #ifndef __GTK_CSS_FILTER_VALUE_PRIVATE_H__ #define __GTK_CSS_FILTER_VALUE_PRIVATE_H__ -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcssvalueprivate.h" G_BEGIN_DECLS diff --git a/gtk/gtkcssfontfeaturesvalue.c b/gtk/gtkcssfontfeaturesvalue.c index c5f79eff89..faedc8cf44 100644 --- a/gtk/gtkcssfontfeaturesvalue.c +++ b/gtk/gtkcssfontfeaturesvalue.c @@ -20,7 +20,9 @@ #include "config.h" #include "gtkcsstypesprivate.h" -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcssnumbervalueprivate.h" #include "gtkcssfontfeaturesvalueprivate.h" diff --git a/gtk/gtkcssfontfeaturesvalueprivate.h b/gtk/gtkcssfontfeaturesvalueprivate.h index f78a8cd182..b0001da986 100644 --- a/gtk/gtkcssfontfeaturesvalueprivate.h +++ b/gtk/gtkcssfontfeaturesvalueprivate.h @@ -20,7 +20,9 @@ #ifndef __GTK_CSS_FONT_FEATURES_VALUE_PRIVATE_H__ #define __GTK_CSS_FONT_FEATURES_VALUE_PRIVATE_H__ -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcssvalueprivate.h" G_BEGIN_DECLS diff --git a/gtk/gtkcssfontvariationsvalue.c b/gtk/gtkcssfontvariationsvalue.c index 174cacf417..2ecae30ab0 100644 --- a/gtk/gtkcssfontvariationsvalue.c +++ b/gtk/gtkcssfontvariationsvalue.c @@ -19,7 +19,9 @@ #include "config.h" -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcssnumbervalueprivate.h" #include "gtkcssfontvariationsvalueprivate.h" diff --git a/gtk/gtkcssfontvariationsvalueprivate.h b/gtk/gtkcssfontvariationsvalueprivate.h index 90e0fd3a84..c468848190 100644 --- a/gtk/gtkcssfontvariationsvalueprivate.h +++ b/gtk/gtkcssfontvariationsvalueprivate.h @@ -20,7 +20,9 @@ #ifndef __GTK_CSS_FONT_VARIATIONS_VALUE_PRIVATE_H__ #define __GTK_CSS_FONT_VARIATIONS_VALUE_PRIVATE_H__ -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcssvalueprivate.h" G_BEGIN_DECLS diff --git a/gtk/gtkcssimageicontheme.c b/gtk/gtkcssimageicontheme.c index 2fa93d2540..109b0abd83 100644 --- a/gtk/gtkcssimageicontheme.c +++ b/gtk/gtkcssimageicontheme.c @@ -23,6 +23,7 @@ #include +#include "gtk/css/gtkcssserializerprivate.h" #include "gtksettingsprivate.h" #include "gtksnapshot.h" #include "gtkstyleproviderprivate.h" @@ -132,7 +133,7 @@ gtk_css_image_icon_theme_print (GtkCssImage *image, GtkCssImageIconTheme *icon_theme = GTK_CSS_IMAGE_ICON_THEME (image); g_string_append (string, "-gtk-icontheme("); - _gtk_css_print_string (string, icon_theme->name); + gtk_css_print_string (string, icon_theme->name, FALSE); g_string_append (string, ")"); } diff --git a/gtk/gtkcssimageprivate.h b/gtk/gtkcssimageprivate.h index d4e4e669ea..707c5d7648 100644 --- a/gtk/gtkcssimageprivate.h +++ b/gtk/gtkcssimageprivate.h @@ -23,7 +23,9 @@ #include #include -#include "gtk/gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtk/gtkcsstypesprivate.h" #include "gtk/gtksnapshot.h" #include "gtk/gtkstyleprovider.h" diff --git a/gtk/gtkcsskeyframesprivate.h b/gtk/gtkcsskeyframesprivate.h index 89de02536c..359184840a 100644 --- a/gtk/gtkcsskeyframesprivate.h +++ b/gtk/gtkcsskeyframesprivate.h @@ -20,7 +20,9 @@ #ifndef __GTK_CSS_KEYFRAMES_PRIVATE_H__ #define __GTK_CSS_KEYFRAMES_PRIVATE_H__ -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcssvalueprivate.h" #include "gtktypes.h" diff --git a/gtk/gtkcssnumbervalueprivate.h b/gtk/gtkcssnumbervalueprivate.h index bcac90e45e..5ea9b8f63b 100644 --- a/gtk/gtkcssnumbervalueprivate.h +++ b/gtk/gtkcssnumbervalueprivate.h @@ -20,7 +20,9 @@ #ifndef __GTK_CSS_NUMBER_VALUE_PRIVATE_H__ #define __GTK_CSS_NUMBER_VALUE_PRIVATE_H__ -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcsstypesprivate.h" #include "gtkcssvalueprivate.h" diff --git a/gtk/gtkcsspalettevalueprivate.h b/gtk/gtkcsspalettevalueprivate.h index b422494a8a..baf25b90e7 100644 --- a/gtk/gtkcsspalettevalueprivate.h +++ b/gtk/gtkcsspalettevalueprivate.h @@ -20,7 +20,9 @@ #ifndef __GTK_CSS_PALETTE_VALUE_PRIVATE_H__ #define __GTK_CSS_PALETTE_VALUE_PRIVATE_H__ -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcssvalueprivate.h" G_BEGIN_DECLS diff --git a/gtk/gtkcsspositionvalueprivate.h b/gtk/gtkcsspositionvalueprivate.h index fc87fbcbce..2ef70df8d7 100644 --- a/gtk/gtkcsspositionvalueprivate.h +++ b/gtk/gtkcsspositionvalueprivate.h @@ -20,7 +20,9 @@ #ifndef __GTK_CSS_POSITION_VALUE_PRIVATE_H__ #define __GTK_CSS_POSITION_VALUE_PRIVATE_H__ -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcssvalueprivate.h" G_BEGIN_DECLS diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c index db84e1daef..ebbc1a165a 100644 --- a/gtk/gtkcssprovider.c +++ b/gtk/gtkcssprovider.c @@ -19,11 +19,13 @@ #include "gtkcssproviderprivate.h" +#include +#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" diff --git a/gtk/gtkcssrepeatvalueprivate.h b/gtk/gtkcssrepeatvalueprivate.h index 7e8baa315f..02665c5792 100644 --- a/gtk/gtkcssrepeatvalueprivate.h +++ b/gtk/gtkcssrepeatvalueprivate.h @@ -20,7 +20,9 @@ #ifndef __GTK_CSS_REPEAT_VALUE_PRIVATE_H__ #define __GTK_CSS_REPEAT_VALUE_PRIVATE_H__ -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcssvalueprivate.h" G_BEGIN_DECLS diff --git a/gtk/gtkcssselectorprivate.h b/gtk/gtkcssselectorprivate.h index 9cff8e90a8..af6781867f 100644 --- a/gtk/gtkcssselectorprivate.h +++ b/gtk/gtkcssselectorprivate.h @@ -18,9 +18,11 @@ #ifndef __GTK_CSS_SELECTOR_PRIVATE_H__ #define __GTK_CSS_SELECTOR_PRIVATE_H__ +#include +#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 diff --git a/gtk/gtkcssshadowvalueprivate.h b/gtk/gtkcssshadowvalueprivate.h index c14d686566..5784dfa516 100644 --- a/gtk/gtkcssshadowvalueprivate.h +++ b/gtk/gtkcssshadowvalueprivate.h @@ -23,9 +23,11 @@ #include #include +#include +#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" diff --git a/gtk/gtkcssshorthandpropertyprivate.h b/gtk/gtkcssshorthandpropertyprivate.h index 52b8a470a9..4af065b265 100644 --- a/gtk/gtkcssshorthandpropertyprivate.h +++ b/gtk/gtkcssshorthandpropertyprivate.h @@ -22,7 +22,9 @@ #include -#include "gtk/gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtk/gtkcssstylepropertyprivate.h" #include "gtk/gtkstylepropertyprivate.h" diff --git a/gtk/gtkcssstringvalue.c b/gtk/gtkcssstringvalue.c index c211c33afa..b72427de11 100644 --- a/gtk/gtkcssstringvalue.c +++ b/gtk/gtkcssstringvalue.c @@ -18,6 +18,7 @@ #include "config.h" #include "gtkcssstringvalueprivate.h" +#include "gtk/css/gtkcssserializerprivate.h" #include @@ -69,7 +70,7 @@ gtk_css_value_string_print (const GtkCssValue *value, return; } - _gtk_css_print_string (str, value->string); + gtk_css_print_string (str, value->string, FALSE); } static void diff --git a/gtk/gtkcssstringvalueprivate.h b/gtk/gtkcssstringvalueprivate.h index 5fb703b6e3..8645077cd0 100644 --- a/gtk/gtkcssstringvalueprivate.h +++ b/gtk/gtkcssstringvalueprivate.h @@ -20,7 +20,9 @@ #ifndef __GTK_CSS_STRING_VALUE_PRIVATE_H__ #define __GTK_CSS_STRING_VALUE_PRIVATE_H__ -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcsstypesprivate.h" #include "gtkcssvalueprivate.h" diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c index eabafee6df..de7f2e3762 100644 --- a/gtk/gtkcssstylepropertyimpl.c +++ b/gtk/gtkcssstylepropertyimpl.c @@ -23,7 +23,9 @@ #include #include -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcssstylepropertyprivate.h" #include "gtkcsstypesprivate.h" #include "gtkintl.h" diff --git a/gtk/gtkcsstransformvalueprivate.h b/gtk/gtkcsstransformvalueprivate.h index 143dd87868..d6b8191d4b 100644 --- a/gtk/gtkcsstransformvalueprivate.h +++ b/gtk/gtkcsstransformvalueprivate.h @@ -20,7 +20,9 @@ #ifndef __GTK_CSS_TRANSFORM_VALUE_PRIVATE_H__ #define __GTK_CSS_TRANSFORM_VALUE_PRIVATE_H__ -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcssvalueprivate.h" G_BEGIN_DECLS diff --git a/gtk/gtkemojichooser.c b/gtk/gtkemojichooser.c index 55c8f328ad..e660e6c5aa 100644 --- a/gtk/gtkemojichooser.c +++ b/gtk/gtkemojichooser.c @@ -378,6 +378,22 @@ add_recent_item (GtkEmojiChooser *chooser, g_variant_unref (item); } +static gboolean +should_close (GtkEmojiChooser *chooser) +{ + GdkDisplay *display; + GdkSeat *seat; + GdkDevice *device; + GdkModifierType state; + + display = gtk_widget_get_display (GTK_WIDGET (chooser)); + seat = gdk_display_get_default_seat (display); + device = gdk_seat_get_keyboard (seat); + state = gdk_device_get_modifier_state (device); + + return (state & GDK_CONTROL_MASK) == 0; +} + static void emoji_activated (GtkFlowBox *box, GtkFlowBoxChild *child, @@ -389,7 +405,16 @@ emoji_activated (GtkFlowBox *box, GVariant *item; gunichar modifier; - gtk_popover_popdown (GTK_POPOVER (chooser)); + if (should_close (chooser)) + gtk_popover_popdown (GTK_POPOVER (chooser)); + else + { + GtkWidget *popover; + + popover = gtk_widget_get_ancestor (GTK_WIDGET (box), GTK_TYPE_POPOVER); + if (popover != GTK_WIDGET (chooser)) + gtk_popover_popdown (GTK_POPOVER (popover)); + } label = gtk_flow_box_child_get_child (child); text = g_strdup (gtk_label_get_label (GTK_LABEL (label))); diff --git a/gtk/gtkenums.h b/gtk/gtkenums.h index be5bd75a9e..d1ca41cb1a 100644 --- a/gtk/gtkenums.h +++ b/gtk/gtkenums.h @@ -866,6 +866,8 @@ typedef enum * @GTK_INPUT_HINT_VERTICAL_WRITING: The text is vertical * @GTK_INPUT_HINT_EMOJI: Suggest offering Emoji support * @GTK_INPUT_HINT_NO_EMOJI: Suggest not offering Emoji support + * @GTK_INPUT_HINT_PRIVATE: Request that the input method should not + * update personalized data (like typing history) * * Describes hints that might be taken into account by input methods * or applications. Note that input methods may already tailor their @@ -890,7 +892,8 @@ typedef enum GTK_INPUT_HINT_INHIBIT_OSK = 1 << 7, GTK_INPUT_HINT_VERTICAL_WRITING = 1 << 8, GTK_INPUT_HINT_EMOJI = 1 << 9, - GTK_INPUT_HINT_NO_EMOJI = 1 << 10 + GTK_INPUT_HINT_NO_EMOJI = 1 << 10, + GTK_INPUT_HINT_PRIVATE = 1 << 11, } GtkInputHints; /** diff --git a/gtk/gtkpicture.c b/gtk/gtkpicture.c index 9c2b87c9e7..fc030fd80d 100644 --- a/gtk/gtkpicture.c +++ b/gtk/gtkpicture.c @@ -62,7 +62,7 @@ * * # Accessibility * - * GtkImage uses the #GTK_ACCESSIBLE_ROLE_IMG role. + * GtkPicture uses the #GTK_ACCESSIBLE_ROLE_IMG role. */ enum diff --git a/gtk/gtkstyleproperty.c b/gtk/gtkstyleproperty.c index d0c82ec72c..e6fee266f0 100644 --- a/gtk/gtkstyleproperty.c +++ b/gtk/gtkstyleproperty.c @@ -20,7 +20,9 @@ #include "gtkstylepropertyprivate.h" #include "gtkcssprovider.h" -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkcssshorthandpropertyprivate.h" #include "gtkcssstylepropertyprivate.h" #include "gtkcsstypesprivate.h" diff --git a/gtk/gtkstylepropertyprivate.h b/gtk/gtkstylepropertyprivate.h index 385913f83e..b57331dd84 100644 --- a/gtk/gtkstylepropertyprivate.h +++ b/gtk/gtkstylepropertyprivate.h @@ -18,7 +18,9 @@ #ifndef __GTK_STYLEPROPERTY_PRIVATE_H__ #define __GTK_STYLEPROPERTY_PRIVATE_H__ -#include "gtkcssparserprivate.h" +#include +#include "gtk/css/gtkcsstokenizerprivate.h" +#include "gtk/css/gtkcssparserprivate.h" #include "gtkstylecontextprivate.h" #include "gtkcssvalueprivate.h" diff --git a/gtk/meson.build b/gtk/meson.build index 3e18f05cb6..8edef68f8b 100644 --- a/gtk/meson.build +++ b/gtk/meson.build @@ -82,7 +82,6 @@ gtk_private_sources = files([ 'gtkcssnodestylecache.c', 'gtkcssnumbervalue.c', 'gtkcsspalettevalue.c', - 'gtkcssparser.c', 'gtkcsspositionvalue.c', 'gtkcssrepeatvalue.c', 'gtkcssselector.c', diff --git a/make-release.sh b/make-release.sh index 69a4a0d037..905e223dc8 100755 --- a/make-release.sh +++ b/make-release.sh @@ -10,10 +10,10 @@ if [ -d ${release_build_dir} ]; then fi # we include gtk-doc since we need the gtk-doc-for-gtk4 branch -meson setup --force-fallback-for gtk-doc ${release_build_dir} || exit +meson setup ${release_build_dir} || exit # make the release tarball -meson dist -C${release_build_dir} --include-subprojects || exit +meson dist -C${release_build_dir} || exit # now build the docs meson configure -Dgtk_doc=true ${release_build_dir} || exit diff --git a/meson.build b/meson.build index ac940638fc..ab4e0a1f31 100644 --- a/meson.build +++ b/meson.build @@ -383,7 +383,7 @@ graphene_dep = dependency('graphene-gobject-1.0', version: graphene_req, fallback: ['graphene', 'graphene_dep']) iso_codes_dep = dependency('iso-codes', required: false) -gtk_doc_dep = dependency('gtk-doc', version: '>=1.99', +gtk_doc_dep = dependency('gtk-doc', version: '>=1.33', fallback: ['gtk-doc', 'dummy_dep'], default_options: ['tests=false', 'yelp_manual=false'], required: get_option('gtk_doc')) diff --git a/subprojects/gtk-doc.wrap b/subprojects/gtk-doc.wrap index 2f71008fc3..79ec37220a 100644 --- a/subprojects/gtk-doc.wrap +++ b/subprojects/gtk-doc.wrap @@ -1,5 +1,5 @@ [wrap-git] directory=gtk-doc url=https://gitlab.gnome.org/GNOME/gtk-doc.git -revision=gtk-doc-for-gtk4 +revision=master depth=1 diff --git a/testsuite/gsk/shader.c b/testsuite/gsk/shader.c index 7983d94c04..555acb0869 100644 --- a/testsuite/gsk/shader.c +++ b/testsuite/gsk/shader.c @@ -201,6 +201,40 @@ test_format_args (void) g_object_unref (shader); } +static void +test_compile (void) +{ + GBytes *bytes; + GskGLShader *shader; + GdkSurface *surface; + GskRenderer *renderer; + GError *error = NULL; + gboolean ret; + + bytes = g_bytes_new_static ("blaat", 6); + shader = gsk_gl_shader_new_from_bytes (bytes); + g_assert_nonnull (shader); + + surface = gdk_surface_new_toplevel (gdk_display_get_default ()); + renderer = gsk_renderer_new_for_surface (surface); + g_assert_nonnull (renderer); + + ret = gsk_gl_shader_compile (shader, renderer, &error); + + g_assert_false (ret); + g_assert_nonnull (error); + if (g_str_equal (G_OBJECT_TYPE_NAME (renderer), "GskGLRenderer")) + g_assert_nonnull (strstr (error->message, "blaat")); + else + g_error_matches (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED); + g_clear_error (&error); + + gsk_renderer_unrealize (renderer); + g_object_unref (renderer); + g_object_unref (surface); + g_bytes_unref (bytes); +} + int main (int argc, char *argv[]) @@ -210,6 +244,7 @@ main (int argc, g_test_add_func ("/shader/create/simple", test_create_simple); g_test_add_func ("/shader/create/data", test_create_data); g_test_add_func ("/shader/format-args", test_format_args); + g_test_add_func ("/shader/compile", test_compile); return g_test_run (); }