From: Pierre-Luc Beaudoin Date: Thu, 12 Feb 2009 19:46:45 +0000 (+0200) Subject: Merge branch 'master' of git://gitorious.org/libchamplain-gtk/mainline X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=95a920580bd829c0e3614b76e8a9fba01b1e8ac2;p=libchamplain Merge branch 'master' of git://gitorious.org/libchamplain-gtk/mainline Make libchamplain and libchamplain-gtk in one repo Conflicts: INSTALL Makefile.am NEWS configure.ac demos/Makefile.am demos/launcher.c docs/reference/Makefile.am --- 95a920580bd829c0e3614b76e8a9fba01b1e8ac2 diff --cc Makefile.am index 0119f58,23ea52b..7995343 --- a/Makefile.am +++ b/Makefile.am @@@ -1,12 -1,10 +1,15 @@@ - SUBDIRS = tidy champlain demos docs/reference -SUBDIRS = champlain-gtk demos docs/reference ++SUBDIRS = tidy champlain champlain-gtk demos docs/reference -pcfiles = champlain-gtk-@API_VERSION@.pc +ACLOCAL_AMFLAGS = -I m4 + - pcfiles = champlain-@API_VERSION@.pc ++pcfiles = champlain-@API_VERSION@.pc champlain-gtk-@API_VERSION@.pc + +champlain-@API_VERSION@.pc: champlain.pc + @cp -f $< $@ + champlain-gtk-@API_VERSION@.pc: champlain-gtk.pc + @cp -f $< $@ + pkgconfig_DATA = $(pcfiles) pkgconfigdir = $(libdir)/pkgconfig diff --cc champlain-gtk/Makefile.am index 0000000,d09158a..dedeb15 mode 000000,100644..100644 --- a/champlain-gtk/Makefile.am +++ b/champlain-gtk/Makefile.am @@@ -1,0 -1,36 +1,36 @@@ + + BUILT_SOURCES = \ + champlain-gtk-marshal.h \ + champlain-gtk-marshal.c + + CLEANFILES = $(BUILT_SOURCES) + + CHAMPLAIN_GTK_MARSHAL = champlain-gtk-marshal + CHAMPLAIN_GTK_MARSHAL_LIST = champlain-gtk-marshal.list + -lib_LTLIBRARIES = libchamplain-gtk-0.2.la ++lib_LTLIBRARIES = libchamplain-gtk-0.3.la + -libchamplain_gtk_0_2_la_SOURCES = \ ++libchamplain_gtk_0_3_la_SOURCES = \ + $(CHAMPLAIN_GTK_MARSHAL_LIST) \ + $(BUILT_SOURCES) \ + champlain-view-embed.c + + noinst_HEADERS = champlain-view-embed.h + -libchamplain_gtk_0_2_la_LIBADD = $(DEPS_LIBS) $(CPLAIN_DEPS_LIBS) ++libchamplain_gtk_0_3_la_LIBADD = $(DEPS_LIBS) $(CPLAIN_DEPS_LIBS) + + champlain-gtk-marshal.h: $(CHAMPLAIN_GTK_MARSHAL_LIST) + @GLIB_GENMARSHAL@ --header --prefix=champlain_gtk_marshal $< > $(CHAMPLAIN_GTK_MARSHAL).h + + champlain-gtk-marshal.c: $(CHAMPLAIN_GTK_MARSHAL_LIST) + @GLIB_GENMARSHAL@ --body --prefix=champlain_gtk_marshal $< > $(CHAMPLAIN_GTK_MARSHAL).c + -libchamplain_includedir=$(includedir)/libchamplain-gtk-0.2/champlain-gtk ++libchamplain_includedir=$(includedir)/libchamplain-gtk-0.3/champlain-gtk + libchamplain_include_HEADERS = champlain-gtk.h champlain-view-embed.h + -libchamplain_gtk_0_2_la_LDFLAGS= -version-info $(LIBRARY_VERSION) ++libchamplain_gtk_0_3_la_LDFLAGS= -version-info $(LIBRARY_VERSION) + + AM_CPPFLAGS = $(DEPS_CFLAGS) $(CPLAIN_DEPS_CFLAGS) -I$(top_srcdir) -DCHAMPLAIN_GTK_COMPILATION + AM_LDFLAGS = $(DEPS_LIBS) $(CPLAIN_DEPS_LIBS) -export-symbols-regex ^champlain_.* + + EXTRA_DIST = $(CHAMPLAIN_GTK_MARSHAL_LIST) diff --cc configure.ac index 4bda988,e0ebd3f..f144e0b --- a/configure.ac +++ b/configure.ac @@@ -26,39 -26,29 +26,43 @@@ AC_SUBST(DEPS_CFLAGS AC_SUBST(DEPS_LIBS) PKG_CHECK_MODULES(DEPS, - [ gtk+-2.0 >= 2.2, + [ glib-2.0 >= 2.16, + gobject-2.0 >= 2.10, + gdk-2.0 >= 2.10, clutter-0.8 >= 0.8, - clutter-gtk-0.8 >= 0.8 + clutter-cairo-0.8 >= 0.8, ++ clutter-gtk-0.8 >= 0.8, + cairo >= 1.4, + libsoup-2.4 >= 2.4.1, + gio-2.0 >= 2.16 ++ gtk+-2.0 >= 2.2 ] ) +# check for gtk-doc +GTK_DOC_CHECK(1.9) +# ----------------------------------------------------------- +# Enable debug +# ----------------------------------------------------------- -AC_SUBST(CPLAIN_DEPS_CFLAGS) -AC_SUBST(CPLAIN_DEPS_LIBS) +AC_ARG_ENABLE(debug, + AC_HELP_STRING([--disable-debug],[compile without debug code]), + enable_debug=$enableval, enable_debug=yes ) -PKG_CHECK_MODULES(CPLAIN_DEPS, - [champlain-0.3 >= 0.3] - ) - -# check for gtk-doc -GTK_DOC_CHECK(1.9) +if test x$enable_debug = xyes; then + AC_DEFINE(ENABLE_DEBUG, [], [Enable debug code]) +fi +# ----------------------------------------------------------- AC_CONFIG_FILES([Makefile + champlain/Makefile + champlain-gtk/Makefile demos/Makefile + tidy/Makefile docs/reference/Makefile docs/reference/version.xml - champlain.pc]) ++ champlain.pc + champlain-gtk.pc]) AC_OUTPUT echo "" @@@ -66,5 -56,4 +70,5 @@@ echo " libchamplain $VERSION echo "" echo " Prefix: ${prefix}" echo " Compiler flags: ${CPPFLAGS}" -echo "" +echo " Debug: ${enable_debug}" - echo "" ++ diff --cc demos/Makefile.am index fc18784,d37ac13..8ff4f52 --- a/demos/Makefile.am +++ b/demos/Makefile.am @@@ -1,13 -1,9 +1,17 @@@ - - noinst_PROGRAMS = launcher animated-marker -noinst_PROGRAMS = launcher ++noinst_PROGRAMS = launcher launcher-gtk animated-marker INCLUDES = -I$(top_srcdir) -AM_CPPFLAGS = $(DEPS_CFLAGS) $(CPLAIN_DEPS_CFLAGS) -AM_LDFLAGS = $(DEPS_LIBS) $(CPLAIN_DEPS_LIBS) +AM_CPPFLAGS = $(DEPS_CFLAGS) +AM_LDFLAGS = $(DEPS_LIBS) launcher_SOURCES = launcher.c -launcher_LDADD = $(DEPS_LIBS) $(CPLAIN_DEPS_LIBS) ../champlain-gtk/libchamplain-gtk-0.2.la +launcher_LDADD = $(DEPS_LIBS) ../champlain/libchamplain-0.3.la + +animated_marker_SOURCES = animated-marker.c +animated_marker_LDADD = $(DEPS_LIBS) ../champlain/libchamplain-0.3.la ++ ++launcher_gtk_SOURCES = launcher-gtk.c ++launcher_gtk_LDADD = $(DEPS_LIBS) $(CPLAIN_DEPS_LIBS) \ ++ ../champlain-gtk/libchamplain-gtk-0.3.la \ ++ ../champlain/libchamplain-0.3.la diff --cc demos/launcher-gtk.c index 0000000,0000000..12f6b06 new file mode 100644 --- /dev/null +++ b/demos/launcher-gtk.c @@@ -1,0 -1,0 +1,209 @@@ ++/* ++ * Copyright (C) 2008 Pierre-Luc Beaudoin ++ * ++ * This library is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * This library is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with this library; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#include ++ ++#include ++ ++#include ++#include ++#include ++ ++#define OSM_MAP "Open Street Map" ++#define OAM_MAP "Open Arial Map" ++#define MFF_MAP "Maps for free - Relief" ++ ++/* ++ * Terminate the main loop. ++ */ ++static void ++on_destroy (GtkWidget *widget, gpointer data) ++{ ++ gtk_main_quit (); ++} ++ ++static ClutterActor* ++create_marker_layer () ++{ ++ ClutterActor *layer, *marker; ++ ++ layer = champlain_layer_new(); ++ ++ ClutterColor orange = { 0xf3, 0x94, 0x07, 0xbb }; ++ ClutterColor white = { 0xff, 0xff, 0xff, 0xff }; ++ marker = champlain_marker_new_with_label("Montréal", "Airmole 14", NULL, NULL); ++ champlain_marker_set_position(CHAMPLAIN_MARKER(marker), 45.528178, -73.563788); ++ clutter_container_add(CLUTTER_CONTAINER(layer), marker, NULL); ++ ++ marker = champlain_marker_new_with_label("New York", "Sans 25", &white, NULL); ++ champlain_marker_set_position(CHAMPLAIN_MARKER(marker), 40.77, -73.98); ++ clutter_container_add(CLUTTER_CONTAINER(layer), marker, NULL); ++ ++ marker = champlain_marker_new_with_label("Saint-Tite-des-Caps", "Serif 12", NULL, &orange); ++ champlain_marker_set_position(CHAMPLAIN_MARKER(marker), 47.130885, -70.764141); ++ clutter_container_add(CLUTTER_CONTAINER(layer), marker, NULL); ++ ++ clutter_actor_hide(layer); ++ return layer; ++} ++ ++static void ++toggle_layer (GtkToggleButton *widget, ++ ClutterActor *layer) ++{ ++ if(gtk_toggle_button_get_active(widget)) ++ clutter_actor_show_all(layer); ++ else ++ clutter_actor_hide(layer); ++} ++ ++static void ++map_source_changed (GtkWidget *widget, ++ ChamplainView *view) ++{ ++ gchar* selection = gtk_combo_box_get_active_text(GTK_COMBO_BOX(widget)); ++ if (g_strcmp0(selection, OSM_MAP) == 0) ++ { ++ g_object_set(G_OBJECT(view), "map-source", CHAMPLAIN_MAP_SOURCE_OPENSTREETMAP, NULL); ++ } ++ else if (g_strcmp0(selection, OAM_MAP) == 0) ++ { ++ g_object_set(G_OBJECT(view), "map-source", CHAMPLAIN_MAP_SOURCE_OPENARIALMAP, NULL); ++ } ++ else if (g_strcmp0(selection, MFF_MAP) == 0) ++ { ++ g_object_set(G_OBJECT(view), "map-source", CHAMPLAIN_MAP_SOURCE_MAPSFORFREE_RELIEF, NULL); ++ } ++} ++ ++static void ++zoom_changed (GtkSpinButton *spinbutton, ++ ChamplainView *view) ++{ ++ gint zoom = gtk_spin_button_get_value_as_int(spinbutton); ++ g_object_set(G_OBJECT(view), "zoom-level", zoom, NULL); ++} ++ ++static void ++map_zoom_changed (ChamplainView *view, ++ GParamSpec *gobject, ++ GtkSpinButton *spinbutton) ++{ ++ gint zoom; ++ g_object_get(G_OBJECT(view), "zoom-level", &zoom, NULL); ++ gtk_spin_button_set_value(spinbutton, zoom); ++} ++ ++static void ++zoom_in (GtkWidget *widget, ++ ChamplainView *view) ++{ ++ champlain_view_zoom_in(view); ++} ++ ++static void ++zoom_out (GtkWidget *widget, ++ ChamplainView *view) ++{ ++ champlain_view_zoom_out(view); ++} ++ ++int ++main (int argc, ++ char *argv[]) ++{ ++ GtkWidget *window; ++ GtkWidget *widget, *vbox, *bbox, *button, *viewport; ++ ClutterActor *layer, *view; ++ ++ g_thread_init (NULL); ++ gtk_clutter_init (&argc, &argv); ++ ++ /* create the main, top level, window */ ++ window = gtk_window_new (GTK_WINDOW_TOPLEVEL); ++ ++ /* give the window a 10px wide border */ ++ gtk_container_set_border_width (GTK_CONTAINER (window), 10); ++ ++ /* give it the title */ ++ gtk_window_set_title (GTK_WINDOW (window), PACKAGE " " VERSION); ++ ++ /* Connect the destroy event of the window with our on_destroy function ++ * When the window is about to be destroyed we get a notificaiton and ++ * stop the main GTK loop ++ */ ++ g_signal_connect (G_OBJECT (window), "destroy", G_CALLBACK (on_destroy), ++ NULL); ++ ++ vbox = gtk_vbox_new(FALSE, 10); ++ ++ view = champlain_view_new (); ++ widget = champlain_view_embed_new(CHAMPLAIN_VIEW (view)); ++ g_object_set(G_OBJECT(view), "scroll-mode", CHAMPLAIN_SCROLL_MODE_KINETIC, ++ "zoom-level", 5, NULL); ++ layer = create_marker_layer(); ++ champlain_view_add_layer(CHAMPLAIN_VIEW (view), layer); ++ ++ gtk_widget_set_size_request(widget, 640, 480); ++ ++ bbox = gtk_hbox_new (FALSE, 10); ++ button = gtk_button_new_from_stock (GTK_STOCK_ZOOM_IN); ++ g_signal_connect (button, "clicked", G_CALLBACK (zoom_in), view); ++ gtk_container_add (GTK_CONTAINER (bbox), button); ++ ++ button = gtk_button_new_from_stock (GTK_STOCK_ZOOM_OUT); ++ g_signal_connect (button, "clicked", G_CALLBACK (zoom_out), view); ++ gtk_container_add (GTK_CONTAINER (bbox), button); ++ ++ button = gtk_toggle_button_new_with_label ("Markers"); ++ g_signal_connect (button, "toggled", G_CALLBACK (toggle_layer), layer); ++ gtk_container_add (GTK_CONTAINER (bbox), button); ++ ++ button = gtk_combo_box_new_text(); ++ gtk_combo_box_append_text(GTK_COMBO_BOX(button), OSM_MAP); ++ gtk_combo_box_append_text(GTK_COMBO_BOX(button), OAM_MAP); ++ gtk_combo_box_append_text(GTK_COMBO_BOX(button), MFF_MAP); ++ gtk_combo_box_set_active(GTK_COMBO_BOX(button), 0); ++ g_signal_connect (button, "changed", G_CALLBACK (map_source_changed), view); ++ gtk_container_add (GTK_CONTAINER (bbox), button); ++ ++ button = gtk_spin_button_new_with_range(0, 20, 1); ++ g_signal_connect (button, "changed", G_CALLBACK (zoom_changed), view); ++ g_signal_connect (view, "notify::zoom-level", G_CALLBACK (map_zoom_changed), ++ button); ++ gtk_container_add (GTK_CONTAINER (bbox), button); ++ ++ viewport = gtk_viewport_new (NULL, NULL); ++ gtk_viewport_set_shadow_type (GTK_VIEWPORT(viewport), GTK_SHADOW_ETCHED_IN); ++ gtk_container_add (GTK_CONTAINER (viewport), widget); ++ ++ gtk_box_pack_start (GTK_BOX (vbox), bbox, FALSE, FALSE, 0); ++ gtk_container_add (GTK_CONTAINER (vbox), viewport); ++ ++ /* and insert it into the main window */ ++ gtk_container_add (GTK_CONTAINER (window), vbox); ++ ++ /* make sure that everything, window and label, are visible */ ++ gtk_widget_show_all (window); ++ champlain_view_center_on(CHAMPLAIN_VIEW(view), 45.466, -73.75); ++ /* start the main loop */ ++ gtk_main (); ++ ++ return 0; ++} ++ diff --cc docs/reference/Makefile.am index 4cbfb84,c14c422..db48ec4 --- a/docs/reference/Makefile.am +++ b/docs/reference/Makefile.am @@@ -12,7 -12,7 +12,7 @@@ DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.s # 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=../../champlain -DOC_SOURCE_DIR=../../champlain-gtk ++DOC_SOURCE_DIR=../../champlain ../../champlain-gtk # Extra options to pass to gtkdoc-scangobj. Not normally needed. SCANGOBJ_OPTIONS= @@@ -31,17 -31,13 +31,16 @@@ 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= +FIXXREF_OPTIONS= \ + --extra-dir=$(PREFIX)/share/gtk-doc/html/gobject \ + --extra-dir=$(PREFIX)/share/gtk-doc/html/glib \ + --extra-dir=$(PREFIX)/share/gtk-doc/html/clutter - # 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)/champlain/*.h - CFILE_GLOB=$(top_srcdir)/champlain/*.c -HFILE_GLOB=$(top_srcdir)/champlain-gtk/*.h -CFILE_GLOB=$(top_srcdir)/champlain-gtk/*.c ++HFILE_GLOB=$(top_srcdir)/champlain/*.h $(top_srcdir)/champlain-gtk/*.h ++CFILE_GLOB=$(top_srcdir)/champlain/*.c $(top_srcdir)/champlain-gtk/*.c # Header files to ignore when scanning. # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h @@@ -66,7 -62,7 +65,7 @@@ expand_content_files # e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS) # e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib) INCLUDES=-I$(top_srcdir)/champlain -I$(top_srcdir) -I$(top_builddir) $(DEPS_CFLAGS) - GTKDOC_LIBS=$(DEPS_LIBS) $(top_builddir)/champlain/libchamplain-0.2.la -GTKDOC_LIBS=$(DEPS_LIBS) $(top_builddir)/champlain-gtk/libchamplain-gtk-0.2.la ++GTKDOC_LIBS=$(DEPS_LIBS) $(top_builddir)/champlain/libchamplain-0.3.la $(top_builddir)/champlain-gtk/libchamplain-gtk-0.3.la # This includes the standard gtk-doc make rules, copied by gtkdocize. include $(top_srcdir)/gtk-doc.make