-SUBDIRS = tidy src
+SUBDIRS = tidy src docs/reference
pcfiles = champlain-1.0.pc
pkgconfig_DATA = $(pcfiles)
pkgconfigdir = $(libdir)/pkgconfig
+
+DISTCHECK_CONFIGURE_FLAGS=--enable-gtk-doc
+
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
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 ""
--- /dev/null
+## 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)
+
--- /dev/null
+<?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>
--- /dev/null
+<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>
+
--- /dev/null
+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"])
+])
#include <glib.h>
-typedef struct {
- gint x;
- gint y;
- guint width;
- guint height;
-} ChamplainRect;
-
#include "champlain_defines.h"
#include "champlainview.h"
GtkWidget *clutterEmbed;
ClutterActor *viewport;
ClutterActor *fingerScroll;
- ChamplainRect viewportSize;
+ GdkRectangle viewportSize;
Map *map;
};
{
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;
}
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;
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);