[gtk+] Getting started: Add docs about desktop file and icon



commit 91f2d10710c5dacf4fb5787bee31e6cffd255972
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Jul 24 00:07:41 2013 -0400

    Getting started: Add docs about desktop file and icon

 docs/reference/gtk/Makefile.am           |    3 +-
 docs/reference/gtk/getting_started.xml   |   48 ++++++++++++++++++++++++++++++
 docs/reference/gtk/images/exampleapp.png |  Bin 0 -> 4117 bytes
 3 files changed, 50 insertions(+), 1 deletions(-)
---
diff --git a/docs/reference/gtk/Makefile.am b/docs/reference/gtk/Makefile.am
index e2fff14..4848ee5 100644
--- a/docs/reference/gtk/Makefile.am
+++ b/docs/reference/gtk/Makefile.am
@@ -419,7 +419,8 @@ HTML_IMAGES = \
        $(srcdir)/images/getting-started-app4.png                       \
        $(srcdir)/images/getting-started-app6.png                       \
        $(srcdir)/images/getting-started-app7.png                       \
-       $(srcdir)/images/getting-started-app8.png
+       $(srcdir)/images/getting-started-app8.png                       \
+       $(srcdir)/images/exampleapp.png
 
 # Extra options to supply to gtkdoc-fixref
 FIXXREF_OPTIONS=--extra-dir=../gdk/html \
diff --git a/docs/reference/gtk/getting_started.xml b/docs/reference/gtk/getting_started.xml
index 2bd5006..9baa5b4 100644
--- a/docs/reference/gtk/getting_started.xml
+++ b/docs/reference/gtk/getting_started.xml
@@ -263,6 +263,36 @@
   <section>
     <title>Building applications</title>
 
+    <para>An application consists of a number of files:
+    <variablelist>
+      <varlistentry>
+        <term>The binary</term>
+        <listitem>This gets installed in <filename>/usr/bin</filename>.</listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>A desktop file</term>
+        <listitem>The desktop file provides important information about the application to the desktop 
shell, such as its name, icon, D-Bus name, commandline to launch it, etc. It is installed in 
<filename>/usr/share/applications</filename>.</listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>An icon</term>
+        <listitem>The icon gets installed in <filename>/usr/share/icons/hicolor/48x48/apps</filename>, where 
it will be found regardless of the current theme.</listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>A settings schema</term>
+        <listitem>If the application uses GSettings, it will install its schema
+          in <filename>/usr/share/glib-2.0/schemas</filename>, so that tools
+          like dconf-editor can find it.</listitem>
+      </varlistentry>
+      <varlistentry>
+        <term>Other resources</term>
+        <listitem>Other files, such as GtkBuilder ui files, are best loaded from
+          resources stored in the application binary itself. This eliminates the
+          need for most of the files that would traditionally be installed in
+          an application-specific location in <filename>/usr/share</filename>.</listitem>
+      </varlistentry>
+    </variablelist>
+    </para>
+
     <para>GTK+ includes application support that is built on top of
     #GApplication. In this tutorial we'll build a simple application by
     starting from scratch, adding more and more pieces over time. Along
@@ -304,6 +334,24 @@
         <programlisting><xi:include href="../../../../examples/application1/exampleappwin.c" 
parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
       </informalexample>
 
+      <para>As part of the initial setup of our application, we also
+      create an icon and a desktop file.</para>
+
+      <informalfigure>
+        <mediaobject>
+          <imageobject>
+            <imagedata fileref="exampleapp.png" format="PNG"/>
+          </imageobject>
+        </mediaobject>
+      </informalfigure>
+
+      <informalexample>
+        <programlisting><xi:include href="../../../../examples/application1/exampleapp.desktop" 
parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
+      </informalexample>
+
+      <para>Note that <replaceable>@<!-- -->bindir@</replaceable> needs to be replaced
+      with the actual path to the binary before this desktop file can be used.</para>
+
       <para>Here is what we've achieved so far:</para>
 
       <informalfigure>
diff --git a/docs/reference/gtk/images/exampleapp.png b/docs/reference/gtk/images/exampleapp.png
new file mode 100644
index 0000000..8beb54e
Binary files /dev/null and b/docs/reference/gtk/images/exampleapp.png differ


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