[anjuta] starter: Use glib resource framework for UI files
- From: Johannes Schmid <jhs src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [anjuta] starter: Use glib resource framework for UI files
- Date: Thu, 26 Jul 2012 14:57:26 +0000 (UTC)
commit 44e92dc8efbbad2015a791c3cd8defa94fc72fe1
Author: Kalev Lember <kalevlember gmail com>
Date: Thu Apr 5 20:01:58 2012 +0300
starter: Use glib resource framework for UI files
https://bugzilla.gnome.org/show_bug.cgi?id=673618
plugins/starter/Makefile.am | 16 +++++++++++++---
plugins/starter/plugin.c | 5 +++--
plugins/starter/starter.gresource.xml | 6 ++++++
3 files changed, 22 insertions(+), 5 deletions(-)
---
diff --git a/plugins/starter/Makefile.am b/plugins/starter/Makefile.am
index 37eede3..5adf87d 100644
--- a/plugins/starter/Makefile.am
+++ b/plugins/starter/Makefile.am
@@ -11,8 +11,11 @@ starter_pixmaps_DATA = starter_logo.png
plugindir = $(anjuta_plugin_dir)
plugin_LTLIBRARIES = libanjuta-starter.la
-uidir = $(anjuta_glade_dir)
-ui_DATA = starter.ui
+starter-resources.c: starter.gresource.xml $(shell glib-compile-resources --sourcedir=$(srcdir) --generate-dependencies $(srcdir)/starter.gresource.xml)
+ $(AM_V_GEN) glib-compile-resources --target=$@ --sourcedir=$(srcdir) --generate-source $<
+
+BUILT_SOURCES = \
+ starter-resources.c
AM_CPPFLAGS = \
$(WARN_CFLAGS) \
@@ -31,11 +34,18 @@ libanjuta_starter_la_SOURCES= \
plugin.c \
plugin.h
+nodist_libanjuta_starter_la_SOURCES= = \
+ $(BUILT_SOURCES)
+
+CLEANFILES = \
+ $(BUILT_SOURCES)
+
EXTRA_DIST = \
$(plugin_in_files) \
$(starter_plugin_DATA) \
$(starter_pixmaps_DATA) \
- $(ui_DATA)
+ starter.gresource.xml \
+ starter.ui
-include $(top_srcdir)/git.mk
diff --git a/plugins/starter/plugin.c b/plugins/starter/plugin.c
index b3ca8c7..d4f1c1a 100644
--- a/plugins/starter/plugin.c
+++ b/plugins/starter/plugin.c
@@ -33,7 +33,6 @@
static gpointer parent_class;
-#define UI_FILE PACKAGE_DATA_DIR"/glade/starter.ui"
#define STARTER_VBOX "starter_vbox"
#define RECENT_VBOX "recent_vbox"
#define IMPORT_IMAGE "import_image"
@@ -192,7 +191,9 @@ create_starter_widget (StarterPlugin* plugin)
GtkBuilder* builder = gtk_builder_new ();
GtkWidget* image;
- if (!gtk_builder_add_from_file(builder, UI_FILE, &error))
+ if (!gtk_builder_add_from_resource (builder,
+ "/org/gnome/anjuta/ui/starter.ui",
+ &error))
{
DEBUG_PRINT ("Could load starter ui!", error->message);
g_error_free (error);
diff --git a/plugins/starter/starter.gresource.xml b/plugins/starter/starter.gresource.xml
new file mode 100644
index 0000000..b29c97a
--- /dev/null
+++ b/plugins/starter/starter.gresource.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+ <gresource prefix="/org/gnome/anjuta/ui">
+ <file preprocess="xml-stripblanks">starter.ui</file>
+ </gresource>
+</gresources>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]