[goffice] plot_pie: embed icons into plugin.xml



commit cebad1aa03678b626e5babf2d6950f175fafc517
Author: Morten Welinder <terra gnome org>
Date:   Tue Dec 6 15:37:16 2011 -0500

    plot_pie: embed icons into plugin.xml

 pixmaps/Makefile.am                        |    2 --
 plugins/plot_pie/Makefile.am               |   10 +++++++++-
 {pixmaps => plugins/plot_pie}/doughnut.xpm |    0
 {pixmaps => plugins/plot_pie}/pie.xpm      |    0
 plugins/plot_pie/plot-types.xml.in         |    4 ++--
 plugins/plot_pie/plugin.xml.in             |    7 +++++++
 6 files changed, 18 insertions(+), 5 deletions(-)
---
diff --git a/pixmaps/Makefile.am b/pixmaps/Makefile.am
index 74043b6..e32d0d1 100644
--- a/pixmaps/Makefile.am
+++ b/pixmaps/Makefile.am
@@ -1,7 +1,5 @@
 icondir = $(goffice_icondir)
 dist_icon_DATA = \
-	doughnut.xpm	\
-	pie.xpm		\
 	radar.xpm	\
 	polar.png	\
 	stock.xpm
diff --git a/plugins/plot_pie/Makefile.am b/plugins/plot_pie/Makefile.am
index 065cbf6..e4e4498 100644
--- a/plugins/plot_pie/Makefile.am
+++ b/plugins/plot_pie/Makefile.am
@@ -17,6 +17,14 @@ xml_DATA = $(xml_in_files:.xml.in=.xml)
 if WITH_GTK
 pie_la_SOURCES += gog-pie-prefs.c
 endif
+plugin_resources = pie.xpm doughnut.xpm
+pofiles = $(wildcard $(top_srcdir)/po/*.po)
+
+plugin.xml: plugin.xml.in $(plugin_resources) $(pofiles) $(top_srcdir)/tools/embedder
+	LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< $  tmp
+	cd $(srcdir) && @PERL@ $(abs_top_srcdir)/tools/resource-embedder \
+		$  tmp $@
+	rm -f $  tmp
 
 # Do not use the intl-tool stuff to merge the text back;
 # it's simpler to just use gettext directly
@@ -55,7 +63,7 @@ embedded-stuff.c: $(top_srcdir)/tools/embedder $(embedded_stuff)
 BUILT_SOURCES =	embedded-stuff.c
 CLEANFILES = $(BUILT_SOURCES)
 
-EXTRA_DIST = $(xml_in_files) $(embedded_stuff)
+EXTRA_DIST = $(xml_in_files) $(embedded_stuff) $(plugin_resources)
 DISTCLEANFILES = $(xml_in_files:.xml.in=.xml)
 
 include $(top_srcdir)/goffice-plugins.mk
diff --git a/pixmaps/doughnut.xpm b/plugins/plot_pie/doughnut.xpm
similarity index 100%
rename from pixmaps/doughnut.xpm
rename to plugins/plot_pie/doughnut.xpm
diff --git a/pixmaps/pie.xpm b/plugins/plot_pie/pie.xpm
similarity index 100%
rename from pixmaps/pie.xpm
rename to plugins/plot_pie/pie.xpm
diff --git a/plugins/plot_pie/plot-types.xml.in b/plugins/plot_pie/plot-types.xml.in
index 46d9419..f89ae5f 100644
--- a/plugins/plot_pie/plot-types.xml.in
+++ b/plugins/plot_pie/plot-types.xml.in
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Types xmlns:graph="http://www.gnumeric.org/graph_v2.dtd";>
-    <Family _name="Pie"	sample_image_file="pie.xpm" axis_set="none"/>
-    <Family _name="Ring" sample_image_file="doughnut.xpm" axis_set="none"/>
+    <Family _name="Pie"	sample_image_file="res:go:plot_pie/pie.xpm" axis_set="none"/>
+    <Family _name="Ring" sample_image_file="res:go:plot_pie/doughnut.xpm" axis_set="none"/>
 
     <Type _name="Pie" row="1" col="1"
 	  engine="GogPiePlot" family="Pie"
diff --git a/plugins/plot_pie/plugin.xml.in b/plugins/plot_pie/plugin.xml.in
index e0f6edd..e010e7f 100644
--- a/plugins/plot_pie/plugin.xml.in
+++ b/plugins/plot_pie/plugin.xml.in
@@ -8,6 +8,13 @@
 		<attribute name="module_file" value="pie"/>
 	</loader>
 	<services>
+		<service type="resource"
+			 id="go:plot_pie/pie.xpm"
+			 file="pie.xpm"/>
+		<service type="resource"
+			 id="go:plot_pie/doughnut.xpm"
+			 file="doughnut.xpm"/>
+
 		<service type="plot_engine" id="GogRingPlot">
 			<information>
 				<_description>Ring plotting engine</_description>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]