[glib] docs: Mention the alias GResource attribute in the documentation
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] docs: Mention the alias GResource attribute in the documentation
- Date: Wed, 31 May 2017 10:11:14 +0000 (UTC)
commit 678899e87a77b534535af58d87872d642aef6a5c
Author: Philip Withnall <withnall endlessm com>
Date: Wed May 31 11:08:05 2017 +0100
docs: Mention the alias GResource attribute in the documentation
It was the only part of the XML format which was not documented.
Signed-off-by: Philip Withnall <withnall endlessm com>
https://bugzilla.gnome.org/show_bug.cgi?id=782336
gio/gresource.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/gio/gresource.c b/gio/gresource.c
index 80c80ab..117fe8c 100644
--- a/gio/gresource.c
+++ b/gio/gresource.c
@@ -83,6 +83,13 @@ G_DEFINE_BOXED_TYPE (GResource, g_resource, g_resource_ref, g_resource_unref)
* set to the full path to the gdk-pixbuf-pixdata executable; otherwise the resource compiler will
* abort.
*
+ * Resource files will be exported in the GResource namespace using the
+ * combination of the given `prefix` and the filename from the `file` element.
+ * The `alias` attribute can be used to alter the filename to expose them at a
+ * different location in the resource namespace. Typically, this is used to
+ * include files from a different source directory without exposing the source
+ * directory in the resource namespace, as in the example below.
+ *
* Resource bundles are created by the [glib-compile-resources][glib-compile-resources] program
* which takes an XML file that describes the bundle, and a set of files that the XML references. These
* are combined into a binary resource bundle.
@@ -95,6 +102,7 @@ G_DEFINE_BOXED_TYPE (GResource, g_resource, g_resource_ref, g_resource_unref)
* <file>data/splashscreen.png</file>
* <file compressed="true">dialog.ui</file>
* <file preprocess="xml-stripblanks">menumarkup.xml</file>
+ * <file alias="example.css">data/example.css</file>
* </gresource>
* </gresources>
* ]|
@@ -104,6 +112,7 @@ G_DEFINE_BOXED_TYPE (GResource, g_resource, g_resource_ref, g_resource_unref)
* /org/gtk/Example/data/splashscreen.png
* /org/gtk/Example/dialog.ui
* /org/gtk/Example/menumarkup.xml
+ * /org/gtk/Example/example.css
* ]|
*
* Note that all resources in the process share the same namespace, so use Java-style
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]