[gnac/devel] Added support for Mallard documentation



commit 415cd2b54fb79fe1886a06494d6910d957971e08
Author: Benoît Dupasquier <bdupasqu src gnome org>
Date:   Fri May 21 09:06:04 2010 +0100

    Added support for Mallard documentation

 Makefile.am                  |   10 ++++++-
 configure.ac                 |    6 +---
 data/ui/gnac.xml             |    9 +++---
 help/C/figures/gnac-logo.png |  Bin 0 -> 2532 bytes
 help/C/index.page            |   17 ++++++++++++
 help/C/intro.page            |   16 +++++++++++
 help/C/license.page          |   57 ++++++++++++++++++++++++++++++++++++++++++
 help/Makefile.am             |   14 ++++++++++
 src/gnac-main.c              |   27 ++++++++-----------
 src/gnac-main.h              |    2 +-
 10 files changed, 131 insertions(+), 27 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index 77b953e..b851178 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,8 +1,9 @@
 SUBDIRS = \
-	po \
 	data \
+	help \
 	libgnac \
 	man \
+	po \
 	src
 
 ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
@@ -13,8 +14,13 @@ INTLTOOL_BUILT = \
 	intltool-update
 
 EXTRA_DIST = \
-	autogen.sh
+	autogen.sh \
+	gnome-doc-utils.make \
+	m4
 
 DISTCLEANFILES = \
+	gnome-doc-utils.make \
 	po/.intltool-merge-cache \
 	$(INTLTOOL_BUILT)
+
+DISTCHECK_CONFIGURE_FLAGS = --disable-scrollkeeper
diff --git a/configure.ac b/configure.ac
index 6069bd5..5e67311 100644
--- a/configure.ac
+++ b/configure.ac
@@ -64,6 +64,7 @@ fi
 AM_GCONF_SOURCE_2
 
 GNOME_COMMON_INIT
+GNOME_DOC_INIT([0.17.2])
 GNOME_DEBUG_CHECK
 GNOME_COMPILE_WARNINGS([maximum])
 GNOME_CXX_WARNINGS([yes])
@@ -141,10 +142,6 @@ AC_ARG_ENABLE([debug], [],
   AC_SUBST([CFLAGS])
   ])
 
-dnl We require Scroll Keeper 0.3.5 or above for the help
-#SCROLLKEEPER_BUILD_REQUIRED=0.3.5
-#AC_SUBST(SCROLLKEEPER_BUILD_REQUIRED)
-
 AC_SUBST([AM_CPPFLAGS])
 AC_SUBST([AM_CFLAGS])
 AC_SUBST([AM_LDFLAGS])
@@ -159,6 +156,7 @@ AC_CONFIG_FILES([
   data/profiles/default/Makefile
   data/profiles/ui/Makefile
   data/ui/Makefile
+  help/Makefile
   libgnac/Makefile
   man/Makefile
   po/Makefile.in
diff --git a/data/ui/gnac.xml b/data/ui/gnac.xml
index f68d747..e4b4efc 100644
--- a/data/ui/gnac.xml
+++ b/data/ui/gnac.xml
@@ -88,13 +88,14 @@
             <property name="label" translatable="yes">_Help</property>
           </object>
         </child>
-        <!--
         <child>
           <object class="GtkAction" id="help_item">
             <property name="stock_id">gtk-help</property>
-            <property name="name">help_item</property>
+            <property name="label" translatable="yes">_Contents</property>
+            <signal handler="gnac_on_ui_help_cb" name="activate"/>
           </object>
-        </child>-->
+          <accelerator key="F1"/>
+        </child>
         <child>
           <object class="GtkAction" id="about_item">
             <property name="stock_id">gtk-about</property>
@@ -154,7 +155,7 @@
           <menuitem action="prefs_item"/>
         </menu>
         <menu action="menuitem4">
-          <!--<menuitem action="help_item"/>-->
+          <menuitem action="help_item"/>
           <menuitem action="about_item"/>
         </menu>
       </menubar>
diff --git a/help/C/figures/gnac-logo.png b/help/C/figures/gnac-logo.png
new file mode 100644
index 0000000..9c12438
Binary files /dev/null and b/help/C/figures/gnac-logo.png differ
diff --git a/help/C/index.page b/help/C/index.page
new file mode 100644
index 0000000..59a3034
--- /dev/null
+++ b/help/C/index.page
@@ -0,0 +1,17 @@
+<page xmlns="http://projectmallard.org/1.0/";
+      type="guide"
+      id="index">
+
+  <info>
+    <title type="link">Gnac</title>
+    <title type="text">Gnac</title>
+  </info>
+
+  <title>
+    <media type="image" mime="image/png" src="figures/gnac-logo.png">
+      Gnac logo
+    </media>
+    Gnac
+  </title>
+
+</page>
diff --git a/help/C/intro.page b/help/C/intro.page
new file mode 100644
index 0000000..5722984
--- /dev/null
+++ b/help/C/intro.page
@@ -0,0 +1,16 @@
+<page xmlns="http://projectmallard.org/1.0/";
+      type="topic"
+      id="intro">
+
+  <info>
+    <link type="guide" xref="index"/>
+    <desc>Introduction to <app>Gnac</app>.</desc>
+  </info>
+
+  <title>Introduction</title>
+
+  <p>
+    <app>Gnac</app> is ...
+  </p>
+
+</page>
diff --git a/help/C/license.page b/help/C/license.page
new file mode 100644
index 0000000..7ef1551
--- /dev/null
+++ b/help/C/license.page
@@ -0,0 +1,57 @@
+<page xmlns="http://projectmallard.org/1.0/";
+  type="guide"
+  id="license">
+  
+  <info>
+    <link type="seealso" xref="index"/>
+    <revision pkgversion="2.30" version="0.1" date="2009-12-28" status="draft"/>
+    <desc>Legal information.</desc>
+  </info>
+
+  <title>License</title>
+  <p>
+    <!-- Translators: try to use the same translation as the one provided by the CreativeCommons website. 
+    If there is no translation for your language, consider providing one to CreativeCommons. -->
+    This work is distributed under a CreativeCommons Attribution-Share Alike
+    3.0 Unported license.
+  </p>
+  <p>
+    You are free:
+  </p>
+  <terms>
+    <item>
+      <title><em>To share</em></title>
+      <p>To copy, distribute and transmit the work.</p>
+    </item>
+    <item>
+      <title><em>To remix</em></title>
+      <p>To adapt the work.</p> 
+    </item>
+  </terms>
+  <p>
+    Under the following conditions:
+  </p>
+  <terms>
+    <item>
+      <title><em>Attribution</em></title>
+      <p>
+        You must attribute the work in the manner specified by the author or 
+        licensor (but not in any way that suggests that they endorse you or 
+        your use of the work).  
+      </p>
+    </item>
+    <item>
+      <title><em>Share Alike</em></title>
+      <p>
+        If you alter, transform, or build upon this work, you may distribute the 
+        resulting work only under the same, similar or a compatible license.  
+      </p>
+    </item>
+  </terms>
+  <p>
+    <!-- Translators: there are no official localized versions of the legal code, only the deed is localized. -->
+    For the full text of the license, see the 
+    <link href="http://creativecommons.org/licenses/by-sa/3.0/legalcode";>CreativeCommons website</link>, 
+    or read the full <link href="http://creativecommons.org/licenses/by-sa/3.0/";>Commons Deed</link>. 
+  </p>
+</page>
diff --git a/help/Makefile.am b/help/Makefile.am
new file mode 100644
index 0000000..90aeb52
--- /dev/null
+++ b/help/Makefile.am
@@ -0,0 +1,14 @@
+include $(top_srcdir)/gnome-doc-utils.make
+dist-hook: doc-dist-hook
+
+DOC_ID = gnac
+
+DOC_FIGURES = \
+	figures/gnac-logo.png
+
+DOC_PAGES = \
+	index.page \
+	intro.page \
+	license.page
+
+DOC_LINGUAS = 
diff --git a/src/gnac-main.c b/src/gnac-main.c
index 36f832c..73d09fe 100644
--- a/src/gnac-main.c
+++ b/src/gnac-main.c
@@ -1128,26 +1128,21 @@ gnac_on_ui_clear_cb(GtkWidget *widget,
 }
 
 
-/*void
-gnac_on_ui_help_cb(GtkWidget *widget, 
+void
+gnac_on_ui_help_cb(GtkAction *action,
                    gpointer   data)
 {
-  GtkWidget *dialog;
-  
-  dialog = gtk_message_dialog_new(
-      GTK_WINDOW(gnac_ui_get_widget("main_window")),
-      GTK_DIALOG_DESTROY_WITH_PARENT,
-      GTK_MESSAGE_ERROR,
-      GTK_BUTTONS_CLOSE,
-      _("No help available yet"));
-
-  gtk_window_set_title(GTK_WINDOW(dialog), APPNAME);
+  gboolean ret;
+  GError *error = NULL;
 
-  g_signal_connect_swapped(dialog, "response", 
-      G_CALLBACK(gtk_widget_destroy), dialog);
+  ret = gtk_show_uri(gtk_widget_get_screen(gnac_ui_get_widget("main_window")),
+      "ghelp:gnac", gtk_get_current_event_time(), &error);
 
-  gtk_widget_show(dialog);
-}*/
+  if (!ret && error) {
+    g_printerr(_("Could not display help: %s\n"), error->message);
+    g_error_free(error);
+  }
+}
 
 
 void
diff --git a/src/gnac-main.h b/src/gnac-main.h
index bae59f5..1b55170 100644
--- a/src/gnac-main.h
+++ b/src/gnac-main.h
@@ -74,7 +74,7 @@ gnac_on_ui_clear_cb(GtkWidget *widget,
                     gpointer   data);
 
 void
-gnac_on_ui_help_cb(GtkWidget *widget, 
+gnac_on_ui_help_cb(GtkAction *action,
                    gpointer   data);
 
 gboolean



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