[gnumeric] Build: start moving src/pixmaps images to resources.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Build: start moving src/pixmaps images to resources.
- Date: Tue, 19 Mar 2013 16:21:26 +0000 (UTC)
commit 9309b96c5f084b5af2526b724069fa8dab5c09e1
Author: Morten Welinder <terra gnome org>
Date: Tue Mar 19 12:20:38 2013 -0400
Build: start moving src/pixmaps images to resources.
And stuff that are not icons should not be registered as such.
src/Makefile.am | 25 +++++++++++++++++++++----
src/application.c | 2 --
src/io-context-gtk.c | 5 ++---
src/libgnumeric.c | 2 ++
src/pixmaps/Makefile.am | 5 +----
src/sheet-object-image.c | 5 ++---
6 files changed, 28 insertions(+), 16 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 3b3cbfb..30ca277 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
+noinst_HEADERS = dead-kittens.h compilation.h embedded-imgs.h gnm-i18n.h
if WITH_GTK
SUBDIRS += pixmaps dialogs widgets
@@ -44,10 +44,11 @@ AM_CPPFLAGS = \
BUILT_SOURCES = \
gnm-marshalers.c \
gnm-marshalers.h \
+ embedded-imgs.c \
gnumeric-paths.h
# Another hint, see bugs #172211 and #172212:
-non-intermediate: gnm-marshalers.c
+non-intermediate: gnm-marshalers.c embedded-imgs.c
CLEANFILES = $(BUILT_SOURCES) \
gnumeric.exe.a
@@ -197,6 +198,8 @@ libspreadsheet_la_SOURCES = \
print.c \
print-cell.c
+nodist_libspreadsheet_la_SOURCES = embedded-imgs.c
+
# When we switch to subversion fix this to nest as
# libspreadsheet-ver/spreadsheet/header
# doing it now would require massive cvs surgery.
@@ -294,7 +297,7 @@ libspreadsheet_include_HEADERS = \
sheet-object-widget-impl.h \
gnm-so-filled.h \
gnm-so-line.h \
- gnm-so-path.h \
+ gnm-so-path.h \
gnm-so-polygon.h \
sheet-object-component.h \
sheet-object-graph.h \
@@ -412,6 +415,19 @@ gnumeric_app_libs = \
tools/libtools.la \
widgets/libwidgets.la
+embedded_imgs = \
+ pixmaps/gnumeric_splash_1.4.png \
+ pixmaps/unknown_image.png
+
+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_
@@ -482,9 +498,10 @@ uninstall-hook:
# include conditional files to ensure everything gets distributed no matter
# what the build
EXTRA_DIST = \
+ $(embedded_imgs) \
gnm-marshalers.list \
README.gnm_float \
- gnumeric.rc gnm-i18n.h \
+ gnumeric.rc \
GNOME_Gnumeric-gtk.xml.in
gtkactiondir=$(gnumeric_datadir)
diff --git a/src/application.c b/src/application.c
index 26d81f5..f64e0d9 100644
--- a/src/application.c
+++ b/src/application.c
@@ -781,8 +781,6 @@ install_icons (void)
{ rev_diag_border, "rev_diag_border" },
{ right_border, "right_border" },
{ top_border, "top_border" },
- /* Stuff */
- { unknown_image, "unknown_image" }
};
unsigned int ui;
diff --git a/src/io-context-gtk.c b/src/io-context-gtk.c
index 2713179..51c8e25 100644
--- a/src/io-context-gtk.c
+++ b/src/io-context-gtk.c
@@ -18,7 +18,6 @@
#include "application.h"
#include "libgnumeric.h"
#include "dialogs.h"
-#include "pixmaps/gnumeric-stock-pixbufs.h"
#include <gsf/gsf-impl-utils.h>
#include <gtk/gtk.h>
@@ -127,8 +126,8 @@ icg_show_gui (GnmIOContextGtk *icg)
box = GTK_BOX (gtk_box_new (GTK_ORIENTATION_VERTICAL, 0));
if (icg->show_splash) {
- GdkPixbuf *pixbuf = gdk_pixbuf_new_from_inline
- (-1, gnumeric_splash, FALSE, NULL);
+ GdkPixbuf *pixbuf = go_gdk_pixbuf_load_from_file
+ ("res:gnm:pixmaps/gnumeric_splash_1.4.png");
gtk_box_pack_start (box, gtk_image_new_from_pixbuf (pixbuf),
TRUE, FALSE, 0);
g_object_unref (pixbuf);
diff --git a/src/libgnumeric.c b/src/libgnumeric.c
index d9de1ca..339c790 100644
--- a/src/libgnumeric.c
+++ b/src/libgnumeric.c
@@ -56,6 +56,7 @@
#include "mathfunc.h"
#include "hlink.h"
#include "wbc-gtk-impl.h"
+#include "embedded-imgs.h"
#include "dialogs/embedded-ui.h"
#include <goffice/goffice.h>
@@ -252,6 +253,7 @@ gnm_init (void)
g_object_new (GNM_APP_TYPE, NULL);
gnm_register_ui_files ();
+ gnm_register_imgs_files ();
mathfunc_init ();
gnm_style_init ();
diff --git a/src/pixmaps/Makefile.am b/src/pixmaps/Makefile.am
index ce67a1b..9041173 100644
--- a/src/pixmaps/Makefile.am
+++ b/src/pixmaps/Makefile.am
@@ -45,10 +45,8 @@ IMAGES = \
font.xpm \
expr_entry.png \
\
- gnumeric_splash_1.4.png \
gnm_subscript_16.png gnm_subscript_24.png \
gnm_superscript_16.png gnm_superscript_24.png \
- unknown_image.png \
\
object_arrow_24.png \
object_ellipse_24.png \
@@ -233,7 +231,6 @@ VARIABLES =
\
gnm_brush_16 $(srcdir)/brush-16.png \
gnm_brush_22 $(srcdir)/brush-22.png \
\
- gnumeric_splash $(srcdir)/gnumeric_splash_1.4.png \
unknown_image $(srcdir)/unknown_image.png \
\
gnm_object_arrow_24 $(srcdir)/object_arrow_24.png \
@@ -351,7 +348,7 @@ VARIABLES =
\
gnm_printsetup_hf_time $(srcdir)/hf_time.png \
gnm_printsetup_hf_sheet $(srcdir)/hf_sheet.png
-pixbuf_file = $(top_builddir)/src/pixmaps/gnumeric-stock-pixbufs.h
+pixbuf_file = $(builddir)/gnumeric-stock-pixbufs.h
noinst_DATA = $(pixbuf_file)
CLEANFILES = $(noinst_DATA)
diff --git a/src/sheet-object-image.c b/src/sheet-object-image.c
index d664ca1..1d6d68b 100644
--- a/src/sheet-object-image.c
+++ b/src/sheet-object-image.c
@@ -207,9 +207,8 @@ gnm_soi_new_view (SheetObject *so, SheetObjectViewContainer *container)
NULL));
} else {
- GdkPixbuf *placeholder = gtk_icon_theme_load_icon
- (gtk_icon_theme_get_default (),
- "unknown_image", 100, 0, NULL);
+ GdkPixbuf *placeholder = go_gdk_pixbuf_load_from_file
+ ("res:gnm:pixmaps/unknown_image.png");
GdkPixbuf *pixbuf = gdk_pixbuf_copy (placeholder);
goc_item_hide (goc_item_new (GOC_GROUP (item),
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]