[gnumeric] ui: embed gnumeric.css via glib resources.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] ui: embed gnumeric.css via glib resources.
- Date: Tue, 20 Jan 2015 01:08:38 +0000 (UTC)
commit ccbfe3654d878ae34eadf2b55e7d6e060f35bc2d
Author: Morten Welinder <terra gnome org>
Date: Mon Jan 19 19:58:50 2015 -0500
ui: embed gnumeric.css via glib resources.
src/.gitignore | 1 -
src/Makefile.am | 20 +++-----------------
src/embedded-imgs.h | 12 ------------
src/gnm.gresource.xml | 1 +
src/libgnumeric.c | 2 --
src/wbc-gtk.c | 6 ++++--
tools/grand-rename | 1 -
7 files changed, 8 insertions(+), 35 deletions(-)
---
diff --git a/src/.gitignore b/src/.gitignore
index f88f31d..92c4764 100644
--- a/src/.gitignore
+++ b/src/.gitignore
@@ -14,7 +14,6 @@ gnumeric-component
parser.c
gnm-marshalers.c
gnm-marshalers.h
-embedded-imgs.c
gnmresources.c
gnmresources.h
gnumeric-paths.h
diff --git a/src/Makefile.am b/src/Makefile.am
index de044e4..b59ec64 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,7 +22,7 @@ bin_PROGRAMS =
check_PROGRAMS =
noinst_PROGRAMS = sstest
-noinst_HEADERS = dead-kittens.h compilation.h embedded-imgs.h gnm-i18n.h
+noinst_HEADERS = dead-kittens.h compilation.h gnm-i18n.h
if WITH_GTK
SUBDIRS += dialogs widgets
@@ -44,13 +44,12 @@ AM_CPPFLAGS = \
BUILT_SOURCES = \
gnm-marshalers.c \
gnm-marshalers.h \
- embedded-imgs.c \
gnmresources.c \
gnmresources.h \
gnumeric-paths.h
# Another hint, see bugs #172211 and #172212:
-non-intermediate: gnm-marshalers.c embedded-imgs.c gnmresources.c
+non-intermediate: gnm-marshalers.c gnmresources.c
resource_files = $(shell $(GLIB_COMPILE_RESOURCES) --sourcedir=$(top_srcdir) --generate-dependencies
$(srcdir)/gnm.gresource.xml)
@@ -214,7 +213,7 @@ libspreadsheet_la_SOURCES = \
print.c \
print-cell.c
-nodist_libspreadsheet_la_SOURCES = embedded-imgs.c gnmresources.c gnmresources.h
+nodist_libspreadsheet_la_SOURCES = gnmresources.c gnmresources.h
# When we switch to subversion fix this to nest as
# libspreadsheet-ver/spreadsheet/header
@@ -435,18 +434,6 @@ gnumeric_app_libs = \
tools/libtools.la \
widgets/libwidgets.la
-embedded_imgs = \
- gnumeric.css
-
-
-embedded-imgs.c: $(top_srcdir)/tools/embedder $(embedded_imgs) Makefile
- cd $(srcdir) && @PERL@ $(abs_top_srcdir)/tools/embedder \
- --register-function=gnm_register_imgs_files \
- --register-file-function=go_rsm_register_file \
- --id-prefix=gnm: \
- --include '<goffice/goffice.h>' \
- --include embedded-imgs.h \
- NOCOMPRESS $(embedded_imgs) >$(abs_builddir)/$@
# Rules for the marshalers code:
GENMARSHAL_COMMAND = $(GLIB_GENMARSHAL) --prefix=gnm_
@@ -518,7 +505,6 @@ uninstall-hook:
# include conditional files to ensure everything gets distributed no matter
# what the build
EXTRA_DIST = \
- $(embedded_imgs) \
gnm.gresource.xml \
pixmaps/line_pattern_dash_dot.xpm \
pixmaps/line_pattern_dash_dot_dot.xpm \
diff --git a/src/gnm.gresource.xml b/src/gnm.gresource.xml
index 4847dc7..17e52df 100644
--- a/src/gnm.gresource.xml
+++ b/src/gnm.gresource.xml
@@ -180,5 +180,6 @@
<file alias="images/gnumeric_splash_1.4.png">src/pixmaps/gnumeric_splash_1.4.png</file>
<file alias="images/unknown_image.png">src/pixmaps/unknown_image.png</file>
<file preprocess='to-pixdata'
alias="images/sheet_move_marker.xpm">src/pixmaps/sheet_move_marker.xpm</file>
+ <file alias="ui/gnumeric.css">src/gnumeric.css</file>
</gresource>
</gresources>
diff --git a/src/libgnumeric.c b/src/libgnumeric.c
index 9941710..6d8bf55 100644
--- a/src/libgnumeric.c
+++ b/src/libgnumeric.c
@@ -58,7 +58,6 @@
#include "hlink.h"
#include "wbc-gtk-impl.h"
#include "gnmresources.h"
-#include "embedded-imgs.h"
#include "dialogs/embedded-ui.h"
#include <goffice/goffice.h>
@@ -304,7 +303,6 @@ gnm_init (void)
"/org/gnumeric/gnumeric/icons");
}
gnm_register_ui_files ();
- gnm_register_imgs_files ();
go_plugin_service_define ("function_group",
&plugin_service_function_group_get_type);
go_plugin_service_define ("ui",
diff --git a/src/wbc-gtk.c b/src/wbc-gtk.c
index 79dbda5..d6a3d06 100644
--- a/src/wbc-gtk.c
+++ b/src/wbc-gtk.c
@@ -2383,8 +2383,9 @@ cb_screen_changed (GtkWidget *widget)
data = g_object_get_data (app, app_key);
if (!data) {
- const char *resource = "gnm:gnumeric.css";
- const char *csstext = go_rsm_lookup (resource, NULL);
+ const char *resource = "/org/gnumeric/gnumeric/ui/gnumeric.css";
+ GBytes *cssbytes = g_resources_lookup_data (resource, 0, NULL);
+ const char *csstext = g_bytes_get_data (cssbytes, NULL);
gboolean debug = gnm_debug_flag ("css");
data = g_new (struct css_provider_data, 1);
@@ -2400,6 +2401,7 @@ cb_screen_changed (GtkWidget *widget)
gtk_css_provider_load_from_data (data->css, csstext, -1, NULL);
g_object_set_data_full (app, app_key, data, cb_unload_providers);
+ g_bytes_unref (cssbytes);
}
if (screen && !g_slist_find (data->screens, screen)) {
diff --git a/tools/grand-rename b/tools/grand-rename
index 040766e..71702e2 100644
--- a/tools/grand-rename
+++ b/tools/grand-rename
@@ -42,7 +42,6 @@ sub find_files {
('stamp.h' => 1,
'gnumeric-config.h' => 1,
'src/parser.c' => 1,
- 'src/embedded-imgs.c' => 1,
'src/dialogs/embedded-ui.c' => 1,
);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]