]> err.no Git - libchamplain/commitdiff
Gtk-doc
authorPierre-Luc Beaudoin <pierre-luc@squidy.info>
Thu, 21 Aug 2008 01:57:34 +0000 (21:57 -0400)
committerPierre-Luc Beaudoin <pierre-luc@squidy.info>
Thu, 21 Aug 2008 01:57:34 +0000 (21:57 -0400)
Makefile.am
configure.ac
docs/reference/Makefile.am [new file with mode: 0644]
docs/reference/libchamplain-docs.sgml [new file with mode: 0644]
docs/reference/libchamplain-sections.txt [new file with mode: 0644]
docs/reference/libchamplain.types [new file with mode: 0644]
m4/gtk-doc.m4 [new file with mode: 0644]
src/champlain.h
src/champlainview.c
src/map.c
src/map.h

index f6d5602ef87ddbc6d5c0910b346d52e3e562aa41..df311b7d34e9b069012f80ac2df6c6ac598d76e8 100644 (file)
@@ -1,4 +1,4 @@
-SUBDIRS = tidy src 
+SUBDIRS = tidy src docs/reference
 
 pcfiles = champlain-1.0.pc
 
@@ -7,3 +7,6 @@ champlain-1.0.pc: champlain.pc
 
 pkgconfig_DATA = $(pcfiles)
 pkgconfigdir = $(libdir)/pkgconfig
+
+DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
+
index 584f5aedf4d38ef8f52abefb337f45f3314beec7..c8b19cdf6f1d2c6ef87f18bcf836cd5d5293e460 100644 (file)
@@ -5,6 +5,8 @@ AC_PREREQ(2.61)
 AC_INIT(champlain, 0.1, pierre-luc@squidy.info)
 AC_CONFIG_SRCDIR([src/champlainview.h])
 AC_CONFIG_HEADER([config.h])
+AC_CONFIG_MACRO_DIR(m4)
+
 
 AM_INIT_AUTOMAKE
 AC_LIBTOOL_DLOPEN
@@ -30,20 +32,16 @@ PKG_CHECK_MODULES(DEPS,
       gio-2.0 >= 2.16
   ]
 )
-
-# Checks for header files.
-
-# Checks for typedefs, structures, and compiler characteristics.
-
-# Checks for library functions.
+# check for gtk-doc
+GTK_DOC_CHECK(1.9)
 
 AC_CONFIG_FILES([Makefile
                  src/Makefile
                  tidy/Makefile
+                 docs/reference/Makefile
                  champlain.pc])
 AC_OUTPUT
 
-
 echo ""
 echo " Champlain $VERSION"
 echo ""
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
new file mode 100644 (file)
index 0000000..07112c5
--- /dev/null
@@ -0,0 +1,81 @@
+## Process this file with automake to produce Makefile.in
+
+AUTOMAKE_OPTIONS = 1.6
+
+# The name of the module, e.g. 'glib'.
+DOC_MODULE=libchamplain
+
+# The top-level SGML file. You can change this if you want to.
+DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
+
+# The directory containing the source code. Relative to $(srcdir).
+# gtk-doc will search all .c & .h files beneath here for inline comments
+# documenting the functions and macros.
+# e.g. DOC_SOURCE_DIR=../../../gtk
+DOC_SOURCE_DIR=../../src
+
+# Extra options to pass to gtkdoc-scangobj. Not normally needed.
+SCANGOBJ_OPTIONS=
+
+# Extra options to supply to gtkdoc-scan.
+# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
+SCAN_OPTIONS=--rebuild-types
+
+# Extra options to supply to gtkdoc-mkdb.
+# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml
+MKDB_OPTIONS=--sgml-mode --output-format=xml
+
+# Extra options to supply to gtkdoc-mktmpl
+# e.g. MKTMPL_OPTIONS=--only-section-tmpl
+MKTMPL_OPTIONS=
+
+# Extra options to supply to gtkdoc-fixref. Not normally needed.
+# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
+FIXXREF_OPTIONS=
+
+# Used for dependencies. The docs will be rebuilt if any of these change.
+# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
+# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
+HFILE_GLOB=$(top_srcdir)/src/*.h
+CFILE_GLOB=$(top_srcdir)/src/*.h
+
+# Header files to ignore when scanning.
+# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h
+IGNORE_HFILES=
+
+# Images to copy into HTML directory.
+# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
+HTML_IMAGES=
+
+# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
+# e.g. content_files=running.sgml building.sgml changes-2.0.sgml
+content_files=
+
+# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
+# These files must be listed here *and* in content_files
+# e.g. expand_content_files=running.sgml
+expand_content_files=
+
+# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
+# Only needed if you are using gtkdoc-scangobj to dynamically query widget
+# signals and properties.
+# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
+# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
+INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
+GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
+
+# This includes the standard gtk-doc make rules, copied by gtkdocize.
+include $(top_srcdir)/gtk-doc.make
+
+# Other files to distribute
+# e.g. EXTRA_DIST += version.xml.in
+EXTRA_DIST +=
+
+# Files not to distribute
+# for --rebuild-types in $(SCAN_OPTIONS), e.g. $(DOC_MODULE).types
+# for --rebuild-sections in $(SCAN_OPTIONS) e.g. $(DOC_MODULE)-sections.txt
+#DISTCLEANFILES +=
+
+# Comment this out if you want your docs-status tested during 'make check'
+#TESTS = $(GTKDOC_CHECK)
+
diff --git a/docs/reference/libchamplain-docs.sgml b/docs/reference/libchamplain-docs.sgml
new file mode 100644 (file)
index 0000000..73a5b9d
--- /dev/null
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+               "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
+<book id="index" xmlns:xi="http://www.w3.org/2003/XInclude">
+  <bookinfo>
+    <title>libchamplain Reference Manual</title>
+    <releaseinfo>
+      for libchamplain [VERSION]
+      The latest version of this documentation can be found on-line at
+      <ulink role="online-location" url="http://[SERVER]/libchamplain/index.html">http://[SERVER]/libchamplain/</ulink>.
+    </releaseinfo>
+  </bookinfo>
+
+  <chapter>
+    <title>I. API Reference</title>
+    <xi:include href="xml/champlainview.xml"/>
+  </chapter>
+</book>
diff --git a/docs/reference/libchamplain-sections.txt b/docs/reference/libchamplain-sections.txt
new file mode 100644 (file)
index 0000000..e92e418
--- /dev/null
@@ -0,0 +1,65 @@
+<SECTION>
+<FILE>champlainview</FILE>
+ChamplainMapSource
+CHAMPLAIN_CLASS
+CHAMPLAIN_GET_CLASS
+ChamplainViewPrivate
+<TITLE>ChamplainView</TITLE>
+ChamplainView
+<SUBSECTION Standard>
+CHAMPLAIN_VIEW
+CHAMPLAIN_IS_VIEW
+CHAMPLAIN_TYPE_VIEW
+CHAMPLAIN_IS_VIEW_CLASS
+</SECTION>
+
+<SECTION>
+<FILE>champlain</FILE>
+CHAMPLAIN_MIN_LAT
+CHAMPLAIN_MAX_LAT
+CHAMPLAIN_MIN_LONG
+CHAMPLAIN_MAX_LONG
+</SECTION>
+
+<SECTION>
+<FILE>champlain_defines</FILE>
+CHAMPLAIN_API
+CHAMPLAIN_OBSOLETE_API
+ChamplainView
+ChamplainViewClass
+Map
+</SECTION>
+
+<SECTION>
+<FILE>zoomlevel</FILE>
+zoom_level_get_width
+zoom_level_get_height
+zoom_level_new
+</SECTION>
+
+<SECTION>
+<FILE>map</FILE>
+Map
+map_load_visible_tiles
+map_zoom_in
+</SECTION>
+
+<SECTION>
+<FILE>champlain-marshal</FILE>
+champlain_marshal_VOID__OBJECT_OBJECT
+</SECTION>
+
+<SECTION>
+<FILE>tile</FILE>
+</SECTION>
+
+<SECTION>
+<FILE>openstreetmap</FILE>
+osm_init
+</SECTION>
+
+<SECTION>
+<FILE>debugmap</FILE>
+debugmap_init
+</SECTION>
+
diff --git a/docs/reference/libchamplain.types b/docs/reference/libchamplain.types
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/m4/gtk-doc.m4 b/m4/gtk-doc.m4
new file mode 100644 (file)
index 0000000..bfdfa1d
--- /dev/null
@@ -0,0 +1,39 @@
+dnl -*- mode: autoconf -*-
+
+# serial 1
+
+dnl Usage:
+dnl   GTK_DOC_CHECK([minimum-gtk-doc-version])
+AC_DEFUN([GTK_DOC_CHECK],
+[
+  AC_BEFORE([AC_PROG_LIBTOOL],[$0])dnl setup libtool first
+  AC_BEFORE([AM_PROG_LIBTOOL],[$0])dnl setup libtool first
+  dnl for overriding the documentation installation directory
+  AC_ARG_WITH([html-dir],
+    AS_HELP_STRING([--with-html-dir=PATH], [path to installed docs]),,
+    [with_html_dir='${datadir}/gtk-doc/html'])
+  HTML_DIR="$with_html_dir"
+  AC_SUBST([HTML_DIR])
+
+  dnl enable/disable documentation building
+  AC_ARG_ENABLE([gtk-doc],
+    AS_HELP_STRING([--enable-gtk-doc],
+                   [use gtk-doc to build documentation [[default=no]]]),,
+    [enable_gtk_doc=no])
+
+  if test x$enable_gtk_doc = xyes; then
+    ifelse([$1],[],
+      [PKG_CHECK_EXISTS([gtk-doc],,
+                        AC_MSG_ERROR([gtk-doc not installed and --enable-gtk-doc requested]))],
+      [PKG_CHECK_EXISTS([gtk-doc >= $1],,
+                        AC_MSG_ERROR([You need to have gtk-doc >= $1 installed to build gtk-doc]))])
+  fi
+
+  AC_MSG_CHECKING([whether to build gtk-doc documentation])
+  AC_MSG_RESULT($enable_gtk_doc)
+
+  AC_PATH_PROGS(GTKDOC_CHECK,gtkdoc-check,)
+
+  AM_CONDITIONAL([ENABLE_GTK_DOC], [test x$enable_gtk_doc = xyes])
+  AM_CONDITIONAL([GTK_DOC_USE_LIBTOOL], [test -n "$LIBTOOL"])
+])
index 26909f159dc2cb50e62750f8a4cd45c79d4164d6..24150484148c1bdb40d9cb78fcb940b5c748f6ba 100644 (file)
 
 #include <glib.h>
 
-typedef struct {
-  gint x;
-  gint y;
-  guint width;
-  guint height;
-} ChamplainRect;
-
 #include "champlain_defines.h"
 #include "champlainview.h"
 
index 1e8d6b95aecc6942c2042fe661354c74d18cc1b1..d9bcff3bfef69e5059fde4ad80b0bc209227b246 100644 (file)
@@ -69,7 +69,7 @@ struct _ChamplainViewPrivate
   GtkWidget *clutterEmbed;
   ClutterActor *viewport;
   ClutterActor *fingerScroll;
-  ChamplainRect viewportSize;
+  GdkRectangle viewportSize;
   Map *map;
 };
 
@@ -244,7 +244,7 @@ void viewport_x_changed_cb(GObject    *gobject,
 {
   ChamplainViewPrivate *priv = CHAMPLAIN_VIEW_GET_PRIVATE (champlainView);
   
-  ChamplainRect rect;
+  GdkRectangle rect;
   tidy_viewport_get_origin(TIDY_VIEWPORT(priv->viewport), &rect.x, &rect.y, NULL);
   if (rect.x < 0 || rect.y < 0)
       return;
index d0ce3730ac5e9c13745b3ce6c6f409153373f549..cabd35f395ae1a3a4fe007c0adbc6c4eb5504053 100644 (file)
--- a/src/map.c
+++ b/src/map.c
@@ -54,7 +54,7 @@ map_load_level(Map* map, gint zoom_level)
 }
 
 void
-map_load_visible_tiles (Map* map, ChamplainRect viewport)
+map_load_visible_tiles (Map* map, GdkRectangle viewport)
 {
   gint x_count = ceil((float)viewport.width / map->tile_size) + 1;
   gint y_count = ceil((float)viewport.height / map->tile_size) + 1;
index 5c74ff3b653cc347768484e5006e5cea506b03e4..0cd514832dd25774a82aa6792e148813cf76f785 100644 (file)
--- a/src/map.h
+++ b/src/map.h
@@ -53,7 +53,7 @@ struct _Map
 
 CHAMPLAIN_API Map* champlain_map_new (ChamplainMapSource source);
 
-void map_load_visible_tiles (Map* map, ChamplainRect viewport);
+void map_load_visible_tiles (Map* map, GdkRectangle viewport);
 
 gboolean map_zoom_in (Map* map);