From 1a36414da73fadb52aa2f2c1628e553329a5aeef Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Thu, 12 Jan 2012 21:41:33 +0100 Subject: [PATCH] Access win32 css as resource, not custom generated C code --- gtk/Makefile.am | 14 ++------------ gtk/gtk.gresource.xml | 1 + gtk/gtkcssprovider.c | 4 +--- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/gtk/Makefile.am b/gtk/Makefile.am index 35f8ce21aa..87eeadd5fb 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -902,8 +902,7 @@ gtk_built_private_headers = \ gtkresources.h \ gtkmarshalers.h \ gtkbuiltincache.h \ - gtkprivatetypebuiltins.h \ - gtkwin32css.h + gtkprivatetypebuiltins.h gtk_built_sources = \ gtkresources.c \ @@ -918,7 +917,6 @@ stamp_files = \ stamp-gtkmarshalers.h \ stamp-gtktypebuiltins.h \ stamp-gtkprivatetypebuiltins.h \ - stamp-gtkwin32css.h \ stamp-icons # non-header sources (headers should be specified in the above variables) @@ -976,14 +974,6 @@ gtkmarshalers.c: @REBUILD@ gtkmarshalers.list && cp xgen-gmlc gtkmarshalers.c \ && rm -f xgen-gmlc -gtkwin32css.h: stamp-gtkwin32css.h - @true -stamp-gtkwin32css.h: @REBUILD@ gtk-win32.css - $(AWK) 'BEGIN { print "static const char *gtk_win32_default_css = " } { print " \"" $$0 "\\n\""} END { print ";" }' < $(srcdir)/gtk-win32.css >> xgen-gw3c\ - && (cmp -s xgen-gw3c gtkwin32css.h || cp xgen-gw3c gtkwin32css.h) \ - && rm -f xgen-gw3c \ - && echo timestamp > $(@F) - gtktypebuiltins.h: stamp-gtktypebuiltins.h @true stamp-gtktypebuiltins.h: @REBUILD@ $(gtk_public_h_sources) $(deprecated_h_sources) gtktypebuiltins.h.template @@ -1001,7 +991,7 @@ gtktypebuiltins.c: @REBUILD@ $(gtk_public_h_sources) $(deprecated_h_sources) gtk gtkresources.h: gtk.gresource.xml $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) gtk.gresource.xml \ --target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-header --manual-register -gtkresources.c: gtk.gresource.xml gtk-default.css +gtkresources.c: gtk.gresource.xml gtk-default.css gtk-win32.css $(AM_V_GEN) $(GLIB_COMPILE_RESOURCES) gtk.gresource.xml \ --target=$@ --sourcedir=$(srcdir) --c-name _gtk --generate-source --manual-register diff --git a/gtk/gtk.gresource.xml b/gtk/gtk.gresource.xml index bfed14546e..53854b986c 100644 --- a/gtk/gtk.gresource.xml +++ b/gtk/gtk.gresource.xml @@ -2,5 +2,6 @@ gtk-default.css + gtk-win32.css diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c index 7df80ce7cb..1aef9117fd 100644 --- a/gtk/gtkcssprovider.c +++ b/gtk/gtkcssprovider.c @@ -2814,8 +2814,6 @@ _gtk_css_provider_get_theme_dir (void) return path; } -#include "gtkwin32css.h" - /** * gtk_css_provider_get_named: * @name: A theme name @@ -2840,7 +2838,7 @@ gtk_css_provider_get_named (const gchar *name, themes = g_hash_table_new (g_str_hash, g_str_equal); provider = gtk_css_provider_new (); - if (!gtk_css_provider_load_from_data (provider, gtk_win32_default_css, -1, NULL)) + if (!_gtk_css_provider_load_from_resource (provider, "/org/gtk/libgtk/gtk-win32.css")) { g_warning ("Failed to load the internal win32 default CSS."); g_object_unref (provider);