From: Pierre-Luc Beaudoin Date: Thu, 21 Aug 2008 01:57:34 +0000 (-0400) Subject: Gtk-doc X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=182ab6dd89814485d905d79b0a921e8c96790fb0;p=libchamplain Gtk-doc --- diff --git a/Makefile.am b/Makefile.am index f6d5602..df311b7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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 + diff --git a/configure.ac b/configure.ac index 584f5ae..c8b19cd 100644 --- a/configure.ac +++ b/configure.ac @@ -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 index 0000000..07112c5 --- /dev/null +++ b/docs/reference/Makefile.am @@ -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 index 0000000..73a5b9d --- /dev/null +++ b/docs/reference/libchamplain-docs.sgml @@ -0,0 +1,18 @@ + + + + + libchamplain Reference Manual + + for libchamplain [VERSION] + The latest version of this documentation can be found on-line at + http://[SERVER]/libchamplain/. + + + + + I. API Reference + + + diff --git a/docs/reference/libchamplain-sections.txt b/docs/reference/libchamplain-sections.txt new file mode 100644 index 0000000..e92e418 --- /dev/null +++ b/docs/reference/libchamplain-sections.txt @@ -0,0 +1,65 @@ +
+champlainview +ChamplainMapSource +CHAMPLAIN_CLASS +CHAMPLAIN_GET_CLASS +ChamplainViewPrivate +ChamplainView +ChamplainView + +CHAMPLAIN_VIEW +CHAMPLAIN_IS_VIEW +CHAMPLAIN_TYPE_VIEW +CHAMPLAIN_IS_VIEW_CLASS +
+ +
+champlain +CHAMPLAIN_MIN_LAT +CHAMPLAIN_MAX_LAT +CHAMPLAIN_MIN_LONG +CHAMPLAIN_MAX_LONG +
+ +
+champlain_defines +CHAMPLAIN_API +CHAMPLAIN_OBSOLETE_API +ChamplainView +ChamplainViewClass +Map +
+ +
+zoomlevel +zoom_level_get_width +zoom_level_get_height +zoom_level_new +
+ +
+map +Map +map_load_visible_tiles +map_zoom_in +
+ +
+champlain-marshal +champlain_marshal_VOID__OBJECT_OBJECT +
+ +
+tile +
+ +
+openstreetmap +osm_init +
+ +
+debugmap +debugmap_init +
+ diff --git a/docs/reference/libchamplain.types b/docs/reference/libchamplain.types new file mode 100644 index 0000000..e69de29 diff --git a/m4/gtk-doc.m4 b/m4/gtk-doc.m4 new file mode 100644 index 0000000..bfdfa1d --- /dev/null +++ b/m4/gtk-doc.m4 @@ -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"]) +]) diff --git a/src/champlain.h b/src/champlain.h index 26909f1..2415048 100644 --- a/src/champlain.h +++ b/src/champlain.h @@ -27,13 +27,6 @@ #include -typedef struct { - gint x; - gint y; - guint width; - guint height; -} ChamplainRect; - #include "champlain_defines.h" #include "champlainview.h" diff --git a/src/champlainview.c b/src/champlainview.c index 1e8d6b9..d9bcff3 100644 --- a/src/champlainview.c +++ b/src/champlainview.c @@ -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; diff --git a/src/map.c b/src/map.c index d0ce373..cabd35f 100644 --- 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; diff --git a/src/map.h b/src/map.h index 5c74ff3..0cd5148 100644 --- 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);