From: Pierre-Luc Beaudoin Date: Sat, 6 Sep 2008 15:45:51 +0000 (-0400) Subject: Merge branch 'POI' X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5be94f50aa70711649fab368fe06948fdc6a5be8;p=libchamplain Merge branch 'POI' Conflicts: champlain/champlainview.c --- 5be94f50aa70711649fab368fe06948fdc6a5be8 diff --cc champlain/champlainmarker.h index 0000000,899ae43..17a81fa mode 000000,100644..100644 --- a/champlain/champlainmarker.h +++ b/champlain/champlainmarker.h @@@ -1,0 -1,61 +1,61 @@@ + /* + * 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 Library General Public + * License as published by the Free Software Foundation; either + * version 2 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 + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + + #ifndef CHAMPLAIN_MARKER_H + #define CHAMPLAIN_MARKER_H + + #include + #include + #include + + #define CHAMPLAIN_TYPE_MARKER (champlain_marker_get_type()) + #define CHAMPLAIN_MARKER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), CHAMPLAIN_TYPE_MARKER, ChamplainMarker)) + #define CHAMPLAIN_MARKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), CHAMPLAIN_TYPE_MARKER, ChamplainMarkerClass)) + #define CHAMPLAIN_IS_MARKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), CHAMPLAIN_TYPE_MARKER)) + #define CHAMPLAIN_IS_MARKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), CHAMPLAIN_TYPE_MARKER)) + #define CHAMPLAIN_MARKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), CHAMPLAIN_TYPE_MARKER, ChamplainMarkerClass)) + + typedef struct _ChamplainMarkerPrivate ChamplainMarkerPrivate; + + struct _ChamplainMarker + { + ClutterGroup group; + + ChamplainMarkerPrivate *priv; + }; + + struct _ChamplainMarkerClass + { + ClutterGroupClass parent_class; + + }; + -CHAMPLAIN_API GType champlain_marker_get_type (void); ++GType champlain_marker_get_type (void); + -CHAMPLAIN_API ClutterActor *champlain_marker_new (); ++ClutterActor *champlain_marker_new (); + -CHAMPLAIN_API void champlain_marker_set_position (ChamplainMarker *marker, gdouble longitude, gdouble latitude); ++void champlain_marker_set_position (ChamplainMarker *marker, gdouble longitude, gdouble latitude); + -CHAMPLAIN_API void champlain_marker_set_anchor (ChamplainMarker *marker, gint x, gint y); ++void champlain_marker_set_anchor (ChamplainMarker *marker, gint x, gint y); + -CHAMPLAIN_API ClutterActor *champlain_marker_new_with_label (const gchar *label, ++ClutterActor *champlain_marker_new_with_label (const gchar *label, + const gchar *font, + ClutterColor *text_color, + ClutterColor *marker_color); + #endif diff --cc champlain/champlainview.c index 94dc82d,f089a30..0d503f6 --- a/champlain/champlainview.c +++ b/champlain/champlainview.c @@@ -61,24 -62,20 +62,20 @@@ static guint champlain_view_signals[LAS #define CHAMPLAIN_VIEW_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), CHAMPLAIN_TYPE_VIEW, ChamplainViewPrivate)) - #define CHAMPLAIN_PARAM_READABLE \ - (G_PARAM_READABLE | \ - G_PARAM_STATIC_NICK | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB) - - #define CHAMPLAIN_PARAM_READWRITE \ - (G_PARAM_READABLE | G_PARAM_WRITABLE | \ - G_PARAM_STATIC_NICK | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB) - struct _ChamplainViewPrivate { - GtkWidget *clutterEmbed; + GtkWidget *clutter_embed; - ChamplainMapSource mapSource; - gint zoomLevel; // only used when the zoom-level property is set before map is created + ChamplainMapSource map_source; - gint zoomLevel; // only used when the zoom-level property is set before map is created ++ gint zoom_level; // only used when the zoom-level property is set before map is created + ClutterActor *map_layer; ClutterActor *viewport; - ClutterActor *fingerScroll; - GdkRectangle viewportSize; + ClutterActor *finger_scroll; + GdkRectangle viewport_size; + + ClutterActor *user_layers; + Map *map; gboolean offline; @@@ -111,11 -140,13 +140,13 @@@ resize_viewport(ChamplainView *champlai ChamplainViewPrivate *priv = CHAMPLAIN_VIEW_GET_PRIVATE (champlainView); - if(priv->map == NULL) + if(!priv->map) { - priv->map = map_new(priv->mapSource); - map_load_level(priv->map, priv->zoomLevel); - clutter_container_add_actor (CLUTTER_CONTAINER (priv->viewport), priv->map->current_level->group); + priv->map = map_new(priv->map_source); - map_load_level(priv->map, priv->zoomLevel); ++ map_load_level(priv->map, priv->zoom_level); + clutter_container_add_actor (CLUTTER_CONTAINER (priv->map_layer), priv->map->current_level->group); + + marker_reposition(champlainView); g_object_notify(G_OBJECT(champlainView), "zoom-level"); g_object_notify(G_OBJECT(champlainView), "map-source"); @@@ -243,7 -272,7 +272,7 @@@ champlain_view_set_property(GObject* ob } else { -- priv->zoomLevel = level; ++ priv->zoom_level = level; } break; } @@@ -409,8 -440,8 +440,8 @@@ champlain_view_init (ChamplainView *cha { ChamplainViewPrivate *priv = CHAMPLAIN_VIEW_GET_PRIVATE (champlainView); - priv->mapSource = CHAMPLAIN_MAP_SOURCE_OPENSTREETMAP; - priv->zoomLevel = 3; + priv->map_source = CHAMPLAIN_MAP_SOURCE_OPENSTREETMAP; - priv->zoomLevel = 0; ++ priv->zoom_level = 3; priv->offline = FALSE; } diff --cc champlain/champlainview.h index ae55ab7,af55ede..da3c9c2 --- a/champlain/champlainview.h +++ b/champlain/champlainview.h @@@ -24,16 -24,8 +24,17 @@@ #include #include #include + #include +/** + * ChamplainMapSource: + * @CHAMPLAIN_MAP_SOURCE_DEBUG: Debug map, untested as of 0.2 + * @CHAMPLAIN_MAP_SOURCE_OPENSTREETMAP: Open Street Map - Mapnick tiles + * @CHAMPLAIN_MAP_SOURCE_OPENARIALMAP: Open Arial Map + * @CHAMPLAIN_MAP_SOURCE_MAPSFORFREE_RELIEF: Maps for free - Relief tiles + * + * Type of scrolling. + */ typedef enum { CHAMPLAIN_MAP_SOURCE_DEBUG, @@@ -77,14 -72,16 +78,16 @@@ struct _ChamplainViewClas }; -CHAMPLAIN_API GType champlain_view_get_type (void); +GType champlain_view_get_type (void); -CHAMPLAIN_API GtkWidget *champlain_view_new (ChamplainViewMode mode); +GtkWidget *champlain_view_new (ChamplainViewMode mode); -CHAMPLAIN_API void champlain_view_center_on (ChamplainView *view, gdouble longitude, gdouble latitude); +void champlain_view_center_on (ChamplainView *view, gdouble longitude, gdouble latitude); -CHAMPLAIN_API void champlain_view_zoom_in (ChamplainView *champlainView); +void champlain_view_zoom_in (ChamplainView *champlainView); -CHAMPLAIN_API void champlain_view_zoom_out (ChamplainView *champlainView); +void champlain_view_zoom_out (ChamplainView *champlainView); -CHAMPLAIN_API void champlain_view_add_layer (ChamplainView *champlainView, ClutterActor *layer); ++void champlain_view_add_layer (ChamplainView *champlainView, ClutterActor *layer); + #endif