[goffice] UI: embed all (non-plugin) ui files into the library
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goffice] UI: embed all (non-plugin) ui files into the library
- Date: Thu, 1 Dec 2011 21:04:34 +0000 (UTC)
commit e676dbec4386bd6d680663ea2355d0fd90b4260a
Author: Morten Welinder <terra gnome org>
Date: Thu Dec 1 16:04:09 2011 -0500
UI: embed all (non-plugin) ui files into the library
ChangeLog | 6 ++++++
NEWS | 6 ++++++
configure.in | 3 +++
goffice/Makefile.am | 33 ++++++++++++++++++++++++++++++++-
goffice/goffice.c | 3 +++
goffice/graph/Makefile.am | 28 +++++++++++++++-------------
goffice/graph/gog-3d-box.c | 2 +-
goffice/graph/gog-axis-line.c | 2 +-
goffice/graph/gog-axis.c | 2 +-
goffice/graph/gog-chart.c | 2 +-
goffice/graph/gog-equation.c | 2 +-
goffice/graph/gog-error-bar.c | 2 +-
goffice/graph/gog-graph.c | 2 +-
goffice/graph/gog-guru.c | 4 ++--
goffice/graph/gog-label.c | 2 +-
goffice/graph/gog-object.c | 2 +-
goffice/graph/gog-reg-curve.c | 2 +-
goffice/graph/gog-series-labels.c | 2 +-
goffice/graph/gog-series.c | 4 ++--
goffice/gtk/Makefile.am | 13 +++++++------
goffice/gtk/go-3d-rotation-sel.c | 2 +-
goffice/gtk/go-font-sel.c | 2 +-
goffice/gtk/go-format-sel.c | 2 +-
goffice/gtk/go-image-sel.c | 2 +-
goffice/gtk/go-rotation-sel.c | 2 +-
goffice/gtk/goffice-gtk.c | 2 +-
goffice/utils/Makefile.am | 6 ++++--
goffice/utils/go-style.c | 6 +++---
tools/embedder | 8 ++++----
29 files changed, 104 insertions(+), 50 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 87b398d..5ee369c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-12-01 Morten Welinder <terra gnome org>
+
+ * goffice/goffice.c: Include generated embedded-ui.c here and call
+ the registration function.
+ * goffice/*/*.c: use resource, not filename for ui files.
+
2011-12-01 Andreas J. Guelzow <aguelzow pyrshep ca>
* goffice/utils/go-format.c (go_format_get_details): When
diff --git a/NEWS b/NEWS
index b718dfb..82ac457 100644
--- a/NEWS
+++ b/NEWS
@@ -6,9 +6,15 @@ Andreas:
* Fix recognition of formats with SI prefix by format selector.
[#665303]
+Morten:
+ * Embed ui files into library.
+
--------------------------------------------------------------------------
goffice 0.9.1:
+Morten:
+ * High-precision accumulator improvements.
+
--------------------------------------------------------------------------
goffice 0.9.0:
diff --git a/configure.in b/configure.in
index 2b06d0e..5d108d0 100644
--- a/configure.in
+++ b/configure.in
@@ -350,6 +350,9 @@ AC_CHECK_PROG(GLIB_GENMARSHAL, glib-genmarshal, glib-genmarshal)
AC_ARG_VAR(GDK_PIXBUF_CSOURCE, [The gdk-pixbuf-csource executable.])
AC_CHECK_PROG(GDK_PIXBUF_CSOURCE, gdk-pixbuf-csource, gdk-pixbuf-csource)
+AC_ARG_VAR(PERL, [The Perl executable.])
+AC_CHECK_PROG(PERL, perl, perl)
+
## this should come after `AC_PROG_CC'
ifdef([GNOME_COMPILE_WARNINGS],
[GNOME_COMPILE_WARNINGS] CFLAGS="$CFLAGS $WARN_CFLAGS",
diff --git a/goffice/Makefile.am b/goffice/Makefile.am
index 9b041dc..87e8871 100644
--- a/goffice/Makefile.am
+++ b/goffice/Makefile.am
@@ -25,7 +25,7 @@ libgoffice_ GOFFICE_API_VER@_la_DEPENDENCIES = goffice.def
libgoffice_ GOFFICE_API_VER@_la_LDFLAGS += -no-undefined -export-symbols goffice.def
endif
-BUILT_SOURCES = goffice-paths.h
+BUILT_SOURCES = goffice-paths.h embedded-ui.c
CLEANFILES = $(BUILT_SOURCES)
libgoffice_ GOFFICE_API_VER@_la_SOURCES = \
@@ -84,3 +84,34 @@ goffice-0.lib: libgoffice- GOFFICE_API_VER@.la goffice.def
lib -name:libgoffice-0-$(VERSION_IFACE).dll -def:goffice.def -out:$@
endif
endif
+
+embedded_uis = \
+ graph/gog-3d-box-prefs.ui \
+ graph/gog-axis-prefs.ui \
+ graph/gog-equation-prefs.ui \
+ graph/gog-error-bar-prefs.ui \
+ graph/gog-graph-prefs.ui \
+ graph/gog-guru-type-selector.ui \
+ graph/gog-guru.ui \
+ graph/gog-object-prefs.ui \
+ graph/gog-plot-prefs.ui \
+ graph/gog-reg-curve-prefs.ui \
+ graph/gog-reg-eqn-prefs.ui \
+ graph/gog-series-labels-prefs.ui \
+ graph/gog-series-prefs.ui \
+ gtk/go-3d-rotation-sel.ui \
+ gtk/go-font-sel.ui \
+ gtk/go-format-sel.ui \
+ gtk/go-image-save-dialog-extra.ui \
+ gtk/go-image-sel.ui \
+ gtk/go-rotation-sel.ui \
+ utils/go-style-prefs.ui
+
+
+embedded-ui.c: $(top_srcdir)/tools/embedder $(embedded_uis)
+ cd $(srcdir) && @PERL@ $(abs_top_srcdir)/tools/embedder \
+ --id-prefix=go: \
+ --static \
+ --register-function=go_register_ui_files \
+ --register-file-function=go_rsm_register_file \
+ COMPRESS $(embedded_uis) >$(abs_builddir)/$@
diff --git a/goffice/goffice.c b/goffice/goffice.c
index 52853a2..5c613d4 100644
--- a/goffice/goffice.c
+++ b/goffice/goffice.c
@@ -43,6 +43,8 @@
#include <goffice/graph/gog-equation.h>
#endif
+#include "embedded-ui.c"
+
int goffice_graph_debug_level = 0;
static char const *libgoffice_data_dir = GOFFICE_DATADIR;
@@ -184,6 +186,7 @@ libgoffice_init (void)
_go_fonts_init ();
_go_math_init ();
_go_rsm_init ();
+ go_register_ui_files ();
/* keep trigger happy linkers from leaving things out */
_go_plugin_services_init ();
diff --git a/goffice/graph/Makefile.am b/goffice/graph/Makefile.am
index 3efdb3e..a86b8af 100644
--- a/goffice/graph/Makefile.am
+++ b/goffice/graph/Makefile.am
@@ -1,3 +1,5 @@
+EXTRA_DIST =
+
noinst_LTLIBRARIES = libgoffice-graph.la
libgoffice_graph_la_SOURCES = \
@@ -82,29 +84,29 @@ if WITH_GTK
gog-child-button.h
endif
-uidir = $(goffice_datadir)/ui
-dist_ui_DATA = \
- gog-guru.ui \
+# ui files should be listed here for distribution and one level up for
+# embedding
+EXTRA_DIST += \
+ gog-3d-box-prefs.ui \
+ gog-axis-prefs.ui \
+ gog-equation-prefs.ui \
+ gog-error-bar-prefs.ui \
+ gog-graph-prefs.ui \
gog-guru-type-selector.ui \
+ gog-guru.ui \
gog-object-prefs.ui \
- gog-graph-prefs.ui \
gog-plot-prefs.ui \
- gog-axis-prefs.ui \
- gog-error-bar-prefs.ui \
- gog-reg-curve-prefs.ui \
- gog-reg-eqn-prefs.ui \
- gog-series-prefs.ui \
+ gog-reg-curve-prefs.ui \
+ gog-reg-eqn-prefs.ui \
gog-series-labels-prefs.ui \
- gog-3d-box-prefs.ui
+ gog-series-prefs.ui
if GOFFICE_WITH_LASEM
libgoffice_graph_la_SOURCES += gog-equation.c
libgoffice_graph_la_HEADERS += gog-equation.h
+ # Always distribute the ui file, see above
endif
-# Always distribute the ui file.
-dist_ui_DATA += gog-equation-prefs.ui
-
include $(top_srcdir)/goffice.mk
LIB_PUBLIC_HDRS = $(libgoffice_graph_la_HEADERS)
diff --git a/goffice/graph/gog-3d-box.c b/goffice/graph/gog-3d-box.c
index 1fe95af..f1c766b 100644
--- a/goffice/graph/gog-3d-box.c
+++ b/goffice/graph/gog-3d-box.c
@@ -165,7 +165,7 @@ gog_3d_box_populate_editor (GogObject *gobj,
go_3d_rotation_sel_set_fov (GO_3D_ROTATION_SEL (g3d), box->fov);
go_editor_add_page (editor, g3d, _("Rotation"));
- gui = go_gtk_builder_new_internal ("gog-3d-box-prefs.ui", GETTEXT_PACKAGE, cc);
+ gui = go_gtk_builder_new_internal ("res:go:graph/gog-3d-box-prefs.ui", GETTEXT_PACKAGE, cc);
if (gui == NULL)
return;
diff --git a/goffice/graph/gog-axis-line.c b/goffice/graph/gog-axis-line.c
index 2836831..2cdf03e 100644
--- a/goffice/graph/gog-axis-line.c
+++ b/goffice/graph/gog-axis-line.c
@@ -507,7 +507,7 @@ gog_axis_base_populate_editor (GogObject *gobj,
return;
}
- gui = go_gtk_builder_new_internal ("gog-axis-prefs.ui", GETTEXT_PACKAGE, cc);
+ gui = go_gtk_builder_new_internal ("res:go:graph/gog-axis-prefs.ui", GETTEXT_PACKAGE, cc);
if (gui == NULL) {
(GOG_OBJECT_CLASS(gab_parent_klass)->populate_editor) (gobj, editor, dalloc, cc);
return;
diff --git a/goffice/graph/gog-axis.c b/goffice/graph/gog-axis.c
index 0fa9f3b..bd22bcd 100644
--- a/goffice/graph/gog-axis.c
+++ b/goffice/graph/gog-axis.c
@@ -2531,7 +2531,7 @@ gog_axis_populate_editor (GogObject *gobj,
GogDataset *set = GOG_DATASET (gobj);
GtkBuilder *gui;
- gui = go_gtk_builder_new_internal ("gog-axis-prefs.ui", GETTEXT_PACKAGE, cc);
+ gui = go_gtk_builder_new_internal ("res:go:graph/gog-axis-prefs.ui", GETTEXT_PACKAGE, cc);
if (gui == NULL)
return;
diff --git a/goffice/graph/gog-chart.c b/goffice/graph/gog-chart.c
index b56aaaf..bb91d25 100644
--- a/goffice/graph/gog-chart.c
+++ b/goffice/graph/gog-chart.c
@@ -319,7 +319,7 @@ gog_chart_populate_editor (GogObject *gobj,
g_return_if_fail (chart != NULL);
- gui = go_gtk_builder_new_internal ("gog-plot-prefs.ui", GETTEXT_PACKAGE, cc);
+ gui = go_gtk_builder_new_internal ("res:go:graph/gog-plot-prefs.ui", GETTEXT_PACKAGE, cc);
g_return_if_fail (gui != NULL);
(GOG_OBJECT_CLASS(chart_parent_klass)->populate_editor) (gobj, editor, dalloc, cc);
diff --git a/goffice/graph/gog-equation.c b/goffice/graph/gog-equation.c
index b0ffc89..45d5a3a 100644
--- a/goffice/graph/gog-equation.c
+++ b/goffice/graph/gog-equation.c
@@ -83,7 +83,7 @@ gog_equation_populate_editor (GogObject *obj,
GtkTextBuffer *buffer;
static guint equation_pref_page = 0;
- gui = go_gtk_builder_new_internal ("gog-equation-prefs.ui", GETTEXT_PACKAGE, cc);
+ gui = go_gtk_builder_new_internal ("res:go:graph/gog-equation-prefs.ui", GETTEXT_PACKAGE, cc);
g_return_if_fail (gui != NULL);
widget = go_gtk_builder_get_widget (gui, "equation_text");
diff --git a/goffice/graph/gog-error-bar.c b/goffice/graph/gog-error-bar.c
index 5a4ab33..c51dce6 100644
--- a/goffice/graph/gog-error-bar.c
+++ b/goffice/graph/gog-error-bar.c
@@ -227,7 +227,7 @@ gog_error_bar_prefs (GogSeries *series,
}
set = GOG_DATASET (series);
- gui = go_gtk_builder_new_internal ("gog-error-bar-prefs.ui", GETTEXT_PACKAGE, cc);
+ gui = go_gtk_builder_new_internal ("res:go:graph/gog-error-bar-prefs.ui", GETTEXT_PACKAGE, cc);
/* Style properties */
diff --git a/goffice/graph/gog-graph.c b/goffice/graph/gog-graph.c
index 89e49b3..2387328 100644
--- a/goffice/graph/gog-graph.c
+++ b/goffice/graph/gog-graph.c
@@ -222,7 +222,7 @@ gog_graph_populate_editor (GogObject *gobj,
GSList *theme_names;
static guint graph_pref_page = 0;
- gui = go_gtk_builder_new_internal ("gog-graph-prefs.ui", GETTEXT_PACKAGE, cc);
+ gui = go_gtk_builder_new_internal ("res:go:graph/gog-graph-prefs.ui", GETTEXT_PACKAGE, cc);
if (gui == NULL)
return;
diff --git a/goffice/graph/gog-guru.c b/goffice/graph/gog-guru.c
index b3171be..cd8fddc 100644
--- a/goffice/graph/gog-guru.c
+++ b/goffice/graph/gog-guru.c
@@ -1145,7 +1145,7 @@ graph_guru_type_selector_new (GraphGuruState *s)
GtkBuilder *gui;
GOStyle *style;
- gui = go_gtk_builder_new_internal ("gog-guru-type-selector.ui", GETTEXT_PACKAGE, s->cc);
+ gui = go_gtk_builder_new_internal ("res:go:graph/gog-guru-type-selector.ui", GETTEXT_PACKAGE, s->cc);
typesel = g_new0 (GraphGuruTypeSelector, 1);
typesel->state = s;
@@ -1235,7 +1235,7 @@ graph_guru_type_selector_new (GraphGuruState *s)
static gboolean
graph_guru_init (GraphGuruState *s)
{
- s->gui = go_gtk_builder_new_internal ("gog-guru.ui", GETTEXT_PACKAGE, s->cc);
+ s->gui = go_gtk_builder_new_internal ("res:go:graph/gog-guru.ui", GETTEXT_PACKAGE, s->cc);
if (s->gui == NULL)
return TRUE;
diff --git a/goffice/graph/gog-label.c b/goffice/graph/gog-label.c
index 9eea342..504ab41 100644
--- a/goffice/graph/gog-label.c
+++ b/goffice/graph/gog-label.c
@@ -464,7 +464,7 @@ gog_reg_eqn_populate_editor (GogObject *gobj,
GtkBuilder *gui;
GogRegEqn *reg_eqn = GOG_REG_EQN (gobj);
- gui = go_gtk_builder_new_internal ("gog-reg-eqn-prefs.ui", GETTEXT_PACKAGE, cc);
+ gui = go_gtk_builder_new_internal ("res:go:graph/gog-reg-eqn-prefs.ui", GETTEXT_PACKAGE, cc);
if (gui == NULL)
return;
diff --git a/goffice/graph/gog-object.c b/goffice/graph/gog-object.c
index f7a7e18..b5c221d 100644
--- a/goffice/graph/gog-object.c
+++ b/goffice/graph/gog-object.c
@@ -454,7 +454,7 @@ gog_object_populate_editor (GogObject *gobj,
if (!(allowable_positions & (GOG_POSITION_MANUAL | GOG_POSITION_COMPASS)))
return;
- gui = go_gtk_builder_new_internal ("gog-object-prefs.ui", GETTEXT_PACKAGE, cc);
+ gui = go_gtk_builder_new_internal ("res:go:graph/gog-object-prefs.ui", GETTEXT_PACKAGE, cc);
if (gui == NULL)
return;
diff --git a/goffice/graph/gog-reg-curve.c b/goffice/graph/gog-reg-curve.c
index 1b2c708..a93f840 100644
--- a/goffice/graph/gog-reg-curve.c
+++ b/goffice/graph/gog-reg-curve.c
@@ -62,7 +62,7 @@ gog_reg_curve_populate_editor (GogObject *gobj,
GtkBuilder *gui;
GogDataset *set = GOG_DATASET (gobj);
- gui = go_gtk_builder_new_internal ("gog-reg-curve-prefs.ui", GETTEXT_PACKAGE, cc);
+ gui = go_gtk_builder_new_internal ("res:go:graph/gog-reg-curve-prefs.ui", GETTEXT_PACKAGE, cc);
if (gui == NULL)
return;
diff --git a/goffice/graph/gog-series-labels.c b/goffice/graph/gog-series-labels.c
index 76e6cad..f204c4d 100644
--- a/goffice/graph/gog-series-labels.c
+++ b/goffice/graph/gog-series-labels.c
@@ -355,7 +355,7 @@ gog_series_labels_populate_editor (GogObject *gobj,
char const *custom_lbl;
gboolean supports_percent;
- gui = go_gtk_builder_new_internal ("gog-series-labels-prefs.ui", GETTEXT_PACKAGE, cc);
+ gui = go_gtk_builder_new_internal ("res:go:graph/gog-series-labels-prefs.ui", GETTEXT_PACKAGE, cc);
labels_prefs = go_gtk_builder_get_widget (gui, "series-labels-prefs");
state->labels = gobj;
diff --git a/goffice/graph/gog-series.c b/goffice/graph/gog-series.c
index 6d5d52d..e2488d7 100644
--- a/goffice/graph/gog-series.c
+++ b/goffice/graph/gog-series.c
@@ -558,7 +558,7 @@ gog_series_populate_editor (GogObject *gobj,
GtkBuilder *gui;
GtkWidget *widget;
- gui = go_gtk_builder_new_internal ("gog-series-prefs.ui", GETTEXT_PACKAGE, cc);
+ gui = go_gtk_builder_new_internal ("res:go:graph/gog-series-prefs.ui", GETTEXT_PACKAGE, cc);
if (gui != NULL) {
int i;
GogAxisSet set = gog_plot_axis_set_pref (gog_series_get_plot (series));
@@ -613,7 +613,7 @@ gog_series_populate_editor (GogObject *gobj,
GtkBuilder *gui;
GtkWidget *widget;
- gui = go_gtk_builder_new_internal ("gog-series-prefs.ui", GETTEXT_PACKAGE, cc);
+ gui = go_gtk_builder_new_internal ("res:go:graph/gog-series-prefs.ui", GETTEXT_PACKAGE, cc);
if (gui != NULL) {
widget = go_gtk_builder_get_widget (gui, "fill_type_combo");
gog_series_populate_fill_type_combo (GOG_SERIES (series), GTK_COMBO_BOX (widget));
diff --git a/goffice/gtk/Makefile.am b/goffice/gtk/Makefile.am
index 14d0872..5b51f41 100644
--- a/goffice/gtk/Makefile.am
+++ b/goffice/gtk/Makefile.am
@@ -71,17 +71,18 @@ libgoffice_gtk_la_HEADERS = \
go-graph-widget.h \
go-image-sel.h
-uidir = $(goffice_datadir)/ui
-dist_ui_DATA = \
+EXTRA_DIST = $(UNUSED)
+
+# ui files should be listed here for distribution and one level up for
+# embedding
+EXTRA_DIST += \
go-rotation-sel.ui \
go-font-sel.ui \
go-format-sel.ui \
- go-3d-rotation-sel.ui \
- go-image-save-dialog-extra.ui \
+ go-3d-rotation-sel.ui \
+ go-image-save-dialog-extra.ui \
go-image-sel.ui
-EXTRA_DIST = $(UNUSED)
-
include $(top_srcdir)/goffice.mk
LIB_PUBLIC_HDRS = $(libgoffice_gtk_la_HEADERS)
diff --git a/goffice/gtk/go-3d-rotation-sel.c b/goffice/gtk/go-3d-rotation-sel.c
index 4730c55..0052815 100644
--- a/goffice/gtk/go-3d-rotation-sel.c
+++ b/goffice/gtk/go-3d-rotation-sel.c
@@ -329,7 +329,7 @@ g3d_init (GO3DRotationSel *g3d)
{
GtkWidget *w;
- g3d->gui = go_gtk_builder_new_internal ("go-3d-rotation-sel.ui",
+ g3d->gui = go_gtk_builder_new_internal ("res:go:gtk/go-3d-rotation-sel.ui",
GETTEXT_PACKAGE, NULL);
if (g3d->gui == NULL)
return;
diff --git a/goffice/gtk/go-font-sel.c b/goffice/gtk/go-font-sel.c
index ac42f5e..a6fc511 100644
--- a/goffice/gtk/go-font-sel.c
+++ b/goffice/gtk/go-font-sel.c
@@ -339,7 +339,7 @@ gfs_init (GOFontSel *gfs)
{
GtkWidget *w;
- gfs->gui = go_gtk_builder_new_internal ("go-font-sel.ui", GETTEXT_PACKAGE, NULL);
+ gfs->gui = go_gtk_builder_new_internal ("res:go:gtk/go-font-sel.ui", GETTEXT_PACKAGE, NULL);
if (gfs->gui == NULL)
return;
diff --git a/goffice/gtk/go-format-sel.c b/goffice/gtk/go-format-sel.c
index ff12509..a6a6ee1 100644
--- a/goffice/gtk/go-format-sel.c
+++ b/goffice/gtk/go-format-sel.c
@@ -1459,7 +1459,7 @@ nfs_init (GOFormatSel *gfs)
gfs->show_format_with_markup = FALSE;
gfs->locale = NULL;
- gfs->gui = go_gtk_builder_new_internal ("go-format-sel.ui", GETTEXT_PACKAGE, NULL);
+ gfs->gui = go_gtk_builder_new_internal ("res:go:gtk/go-format-sel.ui", GETTEXT_PACKAGE, NULL);
if (gfs->gui == NULL)
return;
diff --git a/goffice/gtk/go-image-sel.c b/goffice/gtk/go-image-sel.c
index 6345983..6d037a9 100644
--- a/goffice/gtk/go-image-sel.c
+++ b/goffice/gtk/go-image-sel.c
@@ -234,7 +234,7 @@ go_image_sel_new (GODoc *doc, GOCmdContext *cc, GOImage **image)
state->doc = doc;
state->cc = cc;
state->result = image;
- state->gui = go_gtk_builder_new_internal ("go-image-sel.ui", GETTEXT_PACKAGE, state->cc);
+ state->gui = go_gtk_builder_new_internal ("res:go:gtk/go-image-sel.ui", GETTEXT_PACKAGE, state->cc);
if (state->gui == NULL) {
g_free (state);
return NULL;
diff --git a/goffice/gtk/go-rotation-sel.c b/goffice/gtk/go-rotation-sel.c
index 5561e1a..79281c5 100644
--- a/goffice/gtk/go-rotation-sel.c
+++ b/goffice/gtk/go-rotation-sel.c
@@ -206,7 +206,7 @@ grs_init (GORotationSel *grs)
{
GtkWidget *w;
- grs->gui = go_gtk_builder_new_internal ("go-rotation-sel.ui", GETTEXT_PACKAGE, NULL);
+ grs->gui = go_gtk_builder_new_internal ("res:go:gtk/go-rotation-sel.ui", GETTEXT_PACKAGE, NULL);
if (grs->gui == NULL)
return;
diff --git a/goffice/gtk/goffice-gtk.c b/goffice/gtk/goffice-gtk.c
index 6fab0e4..969ac9b 100644
--- a/goffice/gtk/goffice-gtk.c
+++ b/goffice/gtk/goffice-gtk.c
@@ -870,7 +870,7 @@ go_gui_get_image_save_info (GtkWindow *toplevel, GSList *supported_formats,
g_object_set (G_OBJECT (fsel), "title", _("Save as"), NULL);
- gui = go_gtk_builder_new_internal ("go-image-save-dialog-extra.ui",
+ gui = go_gtk_builder_new_internal ("res:go:gtk/go-image-save-dialog-extra.ui",
GETTEXT_PACKAGE, NULL);
if (gui != NULL) {
GtkWidget *widget;
diff --git a/goffice/utils/Makefile.am b/goffice/utils/Makefile.am
index ce8db5b..4b3f556 100644
--- a/goffice/utils/Makefile.am
+++ b/goffice/utils/Makefile.am
@@ -1,3 +1,4 @@
+EXTRA_DIST =
patternsdir = $(goffice_datadir)/patterns
dist_patterns_DATA = svg-patterns.xml
@@ -74,8 +75,9 @@ libgoffice_utils_la_HEADERS = \
go-style.h \
go-styled-object.h
-uidir = $(goffice_datadir)/ui
-dist_ui_DATA = \
+# ui files should be listed here for distribution and one level up for
+# embedding
+EXTRA_DIST += \
go-style-prefs.ui
CLEANFILES = \
diff --git a/goffice/utils/go-style.c b/goffice/utils/go-style.c
index 53df6d0..fe29930 100644
--- a/goffice/utils/go-style.c
+++ b/goffice/utils/go-style.c
@@ -744,7 +744,7 @@ marker_init (StylePrefState *state, gboolean enable, GOEditor *editor, GOCmdCont
if (!enable)
return;
- gui = go_gtk_builder_new_internal ("go-style-prefs.ui", GETTEXT_PACKAGE, cc);
+ gui = go_gtk_builder_new_internal ("res:go:utils/go-style-prefs.ui", GETTEXT_PACKAGE, cc);
if (gui == NULL)
return;
@@ -858,7 +858,7 @@ font_init (StylePrefState *state, guint32 enable, GOEditor *editor, GOCmdContext
g_return_if_fail (style->font.font != NULL);
- gui = go_gtk_builder_new_internal ("go-style-prefs.ui", GETTEXT_PACKAGE, cc);
+ gui = go_gtk_builder_new_internal ("res:go:utils/go-style-prefs.ui", GETTEXT_PACKAGE, cc);
if (gui == NULL)
return;
@@ -1034,7 +1034,7 @@ go_style_populate_editor (GOStyle *style,
state->doc = NULL;
if ((enable & (GO_STYLE_OUTLINE | GO_STYLE_LINE | GO_STYLE_FILL)) != 0) {
- gui = go_gtk_builder_new_internal ("go-style-prefs.ui", GETTEXT_PACKAGE, cc);
+ gui = go_gtk_builder_new_internal ("res:go:utils/go-style-prefs.ui", GETTEXT_PACKAGE, cc);
if (gui == NULL) {
g_free (state);
return;
diff --git a/tools/embedder b/tools/embedder
index 4c033fa..5c8810a 100644
--- a/tools/embedder
+++ b/tools/embedder
@@ -11,19 +11,19 @@ my $WIDTH = 70;
my $regfunc = undef;
my $regfuncstatic = 0;
my $regfilefunc = undef;
+my $id_prefix = "";
my @includes;
&GetOptions("register-function=s" => \$regfunc,
"register-file-function=s" => \$regfilefunc,
"static" => \$regfuncstatic,
+ "id-prefix=s" => \$id_prefix,
"include=s" => \ includes,
) or die "$0: invalid usage -- inquire within\n";
# -----------------------------------------------------------------------------
print "/* Generated by $myself -- do not edit! */\n\n";
-print "#include <gnumeric-config.h>\n";
-print "#include <gnm-rsm.h>\n\n";
foreach (@includes) {
print "#include \"$_\"\n";
}
@@ -76,7 +76,7 @@ sub embed {
&embed_data ($data, $id);
my $len = length ($data);
- $reg .= " $regfilefunc (\"$file\", $id, $len);\n";
+ $reg .= " $regfilefunc (\"$id_prefix$file\", $id, $len);\n";
}
sub embed_data {
@@ -117,7 +117,7 @@ sub embed_data {
} elsif ($c eq "\\") {
print "\\\\";
$linelen += 2;
- } elsif ($ci >= 32 && $ci < 128) {
+ } elsif ($ci >= 32 && $ci < 127) {
if ($thisnohex && $c =~ /[a-fA-f0-9]/) {
print "\"\"";
$linelen += 2;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]