--- /dev/null
-CHAMPLAIN_API GType champlain_marker_get_type (void);
+ /*
+ * Copyright (C) 2008 Pierre-Luc Beaudoin <pierre-luc@squidy.info>
+ *
+ * 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 <champlain_defines.h>
+ #include <glib-object.h>
+ #include <clutter/clutter.h>
+
+ #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 ClutterActor *champlain_marker_new ();
++GType champlain_marker_get_type (void);
+
-CHAMPLAIN_API void champlain_marker_set_position (ChamplainMarker *marker, gdouble longitude, gdouble latitude);
++ClutterActor *champlain_marker_new ();
+
-CHAMPLAIN_API void champlain_marker_set_anchor (ChamplainMarker *marker, gint x, gint y);
++void champlain_marker_set_position (ChamplainMarker *marker, gdouble longitude, gdouble latitude);
+
-CHAMPLAIN_API ClutterActor *champlain_marker_new_with_label (const gchar *label,
++void champlain_marker_set_anchor (ChamplainMarker *marker, gint x, gint y);
+
++ClutterActor *champlain_marker_new_with_label (const gchar *label,
+ const gchar *font,
+ ClutterColor *text_color,
+ ClutterColor *marker_color);
+ #endif
#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;
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");
}
else
{
-- priv->zoomLevel = level;
++ priv->zoom_level = level;
}
break;
}
{
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;
}
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
+ #include <clutter/clutter.h>
+/**
+ * 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,
};
-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