champlain-defines.h \
champlain-view.h \
champlain-layer.h \
+ champlain-base-marker.h \
champlain-marker.h \
champlain-map.h \
champlain-zoom-level.h \
champlain-debug.c \
champlain-view.c \
champlain-layer.c \
+ champlain-base-marker.c \
champlain-marker.c \
champlain-map.c \
champlain-zoom-level.c \
noinst_HEADERS = \
champlain-debug.h \
champlain-view.h \
- champlain-marker.c \
+ champlain-base-marker.h \
+ champlain-marker.h \
champlain-private.h \
champlain-map.h \
champlain-zoom-level.h \
champlain-network-map-source.h \
champlain-tile.h \
champlain-zoom-level.h \
+ champlain-base-marker.h \
champlain-marker.h \
champlain-version.h
--- /dev/null
+/*
+ * Copyright (C) 2008 Pierre-Luc Beaudoin <pierre-luc@pierlux.com>
+ *
+ * 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
+ */
+
+/**
+ * SECTION:champlain-base_marker
+ * @short_description: A base_marker to identify points of interest on a map
+ *
+ * BaseMarkers reprensent points of interest on a map. BaseMarkers need to be placed on
+ * a layer (a #ClutterGroup). Layers have to be added to a #ChamplainView for
+ * the base_markers to show on the map.
+ *
+ * A base_marker is nothing more than a regular #ClutterActor. You can draw on it
+ * what ever you want. Don't forget to set the anchor position in the base_marker
+ * using #champlain_base_marker_set_anchor. Set the base_markers position on the map
+ * using #champlain_base_marker_set_position.
+ *
+ * Champlain has a default type of base_markers with text. To create one,
+ * use #champlain_base_marker_new_with_label.
+ */
+
+#include "config.h"
+
+#include "champlain-base-marker.h"
+
+#include "champlain.h"
+#include "champlain-defines.h"
+#include "champlain-marshal.h"
+#include "champlain-private.h"
+#include "champlain-map.h"
+#include "champlain-tile.h"
+#include "champlain-zoom-level.h"
+
+#include <clutter/clutter.h>
+#include <clutter-cairo/clutter-cairo.h>
+#include <glib.h>
+#include <glib-object.h>
+#include <cairo.h>
+#include <math.h>
+
+enum
+{
+ /* normal signals */
+ LAST_SIGNAL
+};
+
+enum
+{
+ PROP_0,
+ PROP_LONGITUDE,
+ PROP_LATITUDE,
+};
+
+//static guint champlain_base_marker_signals[LAST_SIGNAL] = { 0, };
+
+G_DEFINE_TYPE (ChamplainBaseMarker, champlain_base_marker, CLUTTER_TYPE_GROUP);
+
+#define CHAMPLAIN_BASE_MARKER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), CHAMPLAIN_TYPE_BASE_MARKER, ChamplainBaseMarkerPrivate))
+
+static void
+champlain_base_marker_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ ChamplainBaseMarker *base_marker = CHAMPLAIN_BASE_MARKER (object);
+ ChamplainBaseMarkerPrivate *priv = CHAMPLAIN_BASE_MARKER_GET_PRIVATE (base_marker);
+
+ switch (prop_id)
+ {
+ case PROP_LONGITUDE:
+ g_value_set_double (value, priv->lon);
+ break;
+ case PROP_LATITUDE:
+ g_value_set_double (value, priv->lat);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+}
+
+static void
+champlain_base_marker_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ ChamplainBaseMarker *base_marker = CHAMPLAIN_BASE_MARKER (object);
+ ChamplainBaseMarkerPrivate *priv = CHAMPLAIN_BASE_MARKER_GET_PRIVATE (base_marker);
+
+ switch (prop_id)
+ {
+ case PROP_LONGITUDE:
+ {
+ gdouble lon = g_value_get_double (value);
+ champlain_base_marker_set_position (base_marker, lon, priv->lat);
+ break;
+ }
+ case PROP_LATITUDE:
+ {
+ gdouble lat = g_value_get_double (value);
+ champlain_base_marker_set_position (base_marker, priv->lon, lat);
+ break;
+ }
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ }
+}
+
+static void
+champlain_base_marker_finalize (GObject *object)
+{
+ //ChamplainBaseMarker *base_marker = CHAMPLAIN_BASE_MARKER (object);
+ //ChamplainBaseMarkerPrivate *priv = CHAMPLAIN_BASE_MARKER_GET_PRIVATE (base_marker);
+
+ G_OBJECT_CLASS (champlain_base_marker_parent_class)->finalize (object);
+}
+
+static void
+champlain_base_marker_class_init (ChamplainBaseMarkerClass *champlainBaseMarkerClass)
+{
+ g_type_class_add_private (champlainBaseMarkerClass, sizeof (ChamplainBaseMarkerPrivate));
+
+ GObjectClass *object_class = G_OBJECT_CLASS (champlainBaseMarkerClass);
+ object_class->finalize = champlain_base_marker_finalize;
+ object_class->get_property = champlain_base_marker_get_property;
+ object_class->set_property = champlain_base_marker_set_property;
+
+ /**
+ * ChamplainBaseMarker:longitude:
+ *
+ * The longitude coordonate of the map
+ *
+ * Since: 0.4
+ */
+ g_object_class_install_property (object_class, PROP_LONGITUDE,
+ g_param_spec_double ("longitude", "Longitude",
+ "The longitude coordonate of the base_marker",
+ -180.0f, 180.0f, 0.0f, CHAMPLAIN_PARAM_READWRITE));
+
+ /**
+ * ChamplainBaseMarker:latitude:
+ *
+ * The latitude coordonate of the map
+ *
+ * Since: 0.4
+ */
+ g_object_class_install_property (object_class, PROP_LATITUDE,
+ g_param_spec_double ("latitude", "Latitude",
+ "The latitude coordonate of the base_marker",
+ -90.0f, 90.0f, 0.0f, CHAMPLAIN_PARAM_READWRITE));
+
+}
+
+static void
+champlain_base_marker_init (ChamplainBaseMarker *marker)
+{
+ ChamplainBaseMarkerPrivate *priv = CHAMPLAIN_BASE_MARKER_GET_PRIVATE (marker);
+ marker->priv = priv;
+}
+
+
+/**
+ * champlain_base_marker_new:
+ *
+ * Returns a new #ChamplainBaseMarker ready to be used as a #ClutterActor.
+ *
+ * Since: 0.4
+ */
+ClutterActor *
+champlain_base_marker_new (void)
+{
+ ChamplainBaseMarker *base_marker;
+
+ base_marker = CHAMPLAIN_BASE_MARKER (g_object_new (CHAMPLAIN_TYPE_BASE_MARKER, NULL));
+ //ChamplainBaseMarkerPrivate *priv = CHAMPLAIN_BASE_MARKER_GET_PRIVATE (base_marker);
+
+ return CLUTTER_ACTOR (base_marker);
+}
+
+/**
+ * champlain_base_marker_set_position:
+ * @base_marker: a #ChamplainBaseMarker
+ * @longitude: the longitude to center the map at
+ * @latitude: the longitude to center the map at
+ *
+ * Positions the base_marker on the map at the coordinates
+ *
+ * Since: 0.4
+ */
+void
+champlain_base_marker_set_position (ChamplainBaseMarker *champlainBaseMarker, gdouble latitude, gdouble longitude)
+{
+ g_return_if_fail (CHAMPLAIN_IS_BASE_MARKER (champlainBaseMarker));
+
+ ChamplainBaseMarkerPrivate *priv = CHAMPLAIN_BASE_MARKER_GET_PRIVATE (champlainBaseMarker);
+
+ priv->lon = longitude;
+ priv->lat = latitude;
+
+ g_object_notify (G_OBJECT (champlainBaseMarker), "latitude");
+ g_object_notify (G_OBJECT (champlainBaseMarker), "longitude");
+}
--- /dev/null
+/*
+ * Copyright (C) 2008 Pierre-Luc Beaudoin <pierre-luc@pierlux.com>
+ *
+ * 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
+ */
+
+#if !defined (__CHAMPLAIN_CHAMPLAIN_H_INSIDE__) && !defined (CHAMPLAIN_COMPILATION)
+#error "Only <champlain/champlain.h> can be included directly."
+#endif
+
+#ifndef CHAMPLAIN_BASE_MARKER_H
+#define CHAMPLAIN_BASE_MARKER_H
+
+#include <champlain/champlain-defines.h>
+
+#include <glib-object.h>
+#include <clutter/clutter.h>
+
+G_BEGIN_DECLS
+
+#define CHAMPLAIN_TYPE_BASE_MARKER (champlain_base_marker_get_type())
+#define CHAMPLAIN_BASE_MARKER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), CHAMPLAIN_TYPE_BASE_MARKER, ChamplainBaseMarker))
+#define CHAMPLAIN_BASE_MARKER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), CHAMPLAIN_TYPE_BASE_MARKER, ChamplainBaseMarkerClass))
+#define CHAMPLAIN_IS_BASE_MARKER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), CHAMPLAIN_TYPE_BASE_MARKER))
+#define CHAMPLAIN_IS_BASE_MARKER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), CHAMPLAIN_TYPE_BASE_MARKER))
+#define CHAMPLAIN_BASE_MARKER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), CHAMPLAIN_TYPE_BASE_MARKER, ChamplainBaseMarkerClass))
+
+typedef struct _ChamplainBaseMarkerPrivate ChamplainBaseMarkerPrivate;
+
+typedef struct _ChamplainBaseMarker ChamplainBaseMarker;
+typedef struct _ChamplainBaseMarkerClass ChamplainBaseMarkerClass;
+
+
+struct _ChamplainBaseMarker
+{
+ ClutterGroup group;
+
+ ChamplainBaseMarkerPrivate *priv;
+};
+
+struct _ChamplainBaseMarkerClass
+{
+ ClutterGroupClass parent_class;
+
+};
+
+GType champlain_base_marker_get_type (void);
+
+ClutterActor *champlain_base_marker_new (void);
+
+void champlain_base_marker_set_position (ChamplainBaseMarker *marker,
+ gdouble longitude, gdouble latitude);
+
+G_END_DECLS
+
+#endif
typedef struct _ChamplainView ChamplainView;
typedef struct _ChamplainViewClass ChamplainViewClass;
-typedef struct _ChamplainMarker ChamplainMarker;
-typedef struct _ChamplainMarkerClass ChamplainMarkerClass;
-
#define CHAMPLAIN_PARAM_READABLE \
(G_PARAM_READABLE | \
G_PARAM_STATIC_NICK | G_PARAM_STATIC_NAME | G_PARAM_STATIC_BLURB)
#include "champlain-layer.h"
#include "champlain-defines.h"
+#include "champlain-base-marker.h"
#include <clutter/clutter.h>
#include <glib.h>
GList* markers = clutter_container_get_children (CLUTTER_CONTAINER(layer));
gint size, i;
gdouble y, tmp_y, low_y;
- ChamplainMarker *lowest = NULL;
+ ChamplainBaseMarker *lowest = NULL;
size = g_list_length (markers);
g_object_get(G_OBJECT(marker), "latitude", &y, NULL);
for (i = 0; i < size; i++)
{
- ChamplainMarker *prev_marker = (ChamplainMarker*) g_list_nth_data (markers, i);
+ ChamplainBaseMarker *prev_marker = (ChamplainBaseMarker*) g_list_nth_data (markers, i);
g_object_get(G_OBJECT(prev_marker), "latitude", &tmp_y, NULL);
tmp_y = 90 - tmp_y;
- if (prev_marker == (ChamplainMarker*) marker)
+ if (prev_marker == (ChamplainBaseMarker*) marker)
continue;
if (y < tmp_y && tmp_y < low_y)
#include "champlain-marker.h"
#include "champlain.h"
+#include "champlain-base-marker.h"
#include "champlain-defines.h"
#include "champlain-marshal.h"
#include "champlain-private.h"
enum
{
PROP_0,
- PROP_LONGITUDE,
- PROP_LATITUDE,
- PROP_ANCHOR_X,
- PROP_ANCHOR_Y,
};
//static guint champlain_marker_signals[LAST_SIGNAL] = { 0, };
-G_DEFINE_TYPE (ChamplainMarker, champlain_marker, CLUTTER_TYPE_GROUP);
+struct _ChamplainMarkerPrivate
+{
+ gboolean tmp;
+};
+
+G_DEFINE_TYPE (ChamplainMarker, champlain_marker, CHAMPLAIN_TYPE_BASE_MARKER);
+
+#define CHAMPLAIN_MARKER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), CHAMPLAIN_TYPE_MARKER, ChamplainMarkerPrivate))
static void
champlain_marker_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
- ChamplainMarker *marker = CHAMPLAIN_MARKER (object);
- ChamplainMarkerPrivate *priv = CHAMPLAIN_MARKER_GET_PRIVATE (marker);
+ //ChamplainMarker *marker = CHAMPLAIN_MARKER (object);
+ //ChamplainMarkerPrivate *priv = CHAMPLAIN_MARKER_GET_PRIVATE (marker);
switch (prop_id)
{
- case PROP_LONGITUDE:
- g_value_set_double (value, priv->lon);
- break;
- case PROP_LATITUDE:
- g_value_set_double (value, priv->lat);
- break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
const GValue *value,
GParamSpec *pspec)
{
- ChamplainMarker *marker = CHAMPLAIN_MARKER (object);
- ChamplainMarkerPrivate *priv = CHAMPLAIN_MARKER_GET_PRIVATE (marker);
+ //ChamplainMarker *marker = CHAMPLAIN_MARKER (object);
+ //ChamplainMarkerPrivate *priv = CHAMPLAIN_MARKER_GET_PRIVATE (marker);
switch (prop_id)
{
- case PROP_LONGITUDE:
- {
- gdouble lon = g_value_get_double (value);
- champlain_marker_set_position (marker, lon, priv->lat);
- break;
- }
- case PROP_LATITUDE:
- {
- gdouble lat = g_value_get_double (value);
- champlain_marker_set_position (marker, priv->lon, lat);
- break;
- }
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
}
}
static void
-champlain_marker_class_init (ChamplainMarkerClass *champlainMarkerClass)
+champlain_marker_class_init (ChamplainMarkerClass *markerClass)
{
- g_type_class_add_private (champlainMarkerClass, sizeof (ChamplainMarkerPrivate));
+ g_type_class_add_private (markerClass, sizeof (ChamplainMarkerPrivate));
- GObjectClass *object_class = G_OBJECT_CLASS (champlainMarkerClass);
+ GObjectClass *object_class = G_OBJECT_CLASS (markerClass);
object_class->finalize = champlain_marker_finalize;
object_class->get_property = champlain_marker_get_property;
object_class->set_property = champlain_marker_set_property;
- /**
- * ChamplainMarker:longitude:
- *
- * The longitude coordonate of the map
- *
- * Since: 0.2
- */
- g_object_class_install_property (object_class, PROP_LONGITUDE,
- g_param_spec_double ("longitude",
- "Longitude",
- "The longitude coordonate of the marker",
- -180.0f,
- 180.0f,
- 0.0f,
- CHAMPLAIN_PARAM_READWRITE));
-
- /**
- * ChamplainMarker:latitude:
- *
- * The latitude coordonate of the map
- *
- * Since: 0.2
- */
- g_object_class_install_property (object_class, PROP_LATITUDE,
- g_param_spec_double ("latitude",
- "Latitude",
- "The latitude coordonate of the marker",
- -90.0f,
- 90.0f,
- 0.0f,
- CHAMPLAIN_PARAM_READWRITE));
-
}
static void
-champlain_marker_init (ChamplainMarker *champlainMarker)
+champlain_marker_init (ChamplainMarker *marker)
{
- //ChamplainMarkerPrivate *priv = CHAMPLAIN_MARKER_GET_PRIVATE (champlainMarker);
+ ChamplainMarkerPrivate *priv = CHAMPLAIN_MARKER_GET_PRIVATE (marker);
+ marker->priv = priv;
}
-
/**
* champlain_marker_new:
*
return CLUTTER_ACTOR (marker);
}
-/**
- * champlain_marker_set_position:
- * @marker: a #ChamplainMarker
- * @longitude: the longitude to center the map at
- * @latitude: the longitude to center the map at
- *
- * Positions the marker on the map at the coordinates
- *
- * Since: 0.2
- */
-void
-champlain_marker_set_position (ChamplainMarker *champlainMarker, gdouble latitude, gdouble longitude)
-{
- g_return_if_fail (CHAMPLAIN_IS_MARKER (champlainMarker));
-
- ChamplainMarkerPrivate *priv = CHAMPLAIN_MARKER_GET_PRIVATE (champlainMarker);
-
- priv->lon = longitude;
- priv->lat = latitude;
-
- g_object_notify (G_OBJECT (champlainMarker), "latitude");
- g_object_notify (G_OBJECT (champlainMarker), "longitude");
-}
-
/**
* champlain_marker_new_with_label:
* @label: the text of the label
ClutterColor *text_color,
ClutterColor *marker_color)
{
- ChamplainMarker *champlainMarker = CHAMPLAIN_MARKER (champlain_marker_new ());
+ ChamplainMarker *marker = CHAMPLAIN_MARKER (champlain_marker_new ());
ClutterColor default_text_color = { 0x22, 0x22, 0x22, 0xFF },
default_marker_color = { 0x2A, 0xB1, 0x26, 0xEE },
darker_color;
text_width = clutter_actor_get_width (actor) + 2 * padding;
text_height = clutter_actor_get_height (actor)+ padding;
clutter_label_set_color (CLUTTER_LABEL (actor), text_color);
- clutter_container_add_actor (CLUTTER_CONTAINER (champlainMarker), actor);
+ clutter_container_add_actor (CLUTTER_CONTAINER (marker), actor);
point = (text_height + 2 * padding) / 4.0;
cairo_destroy (cr);
- clutter_container_add_actor (CLUTTER_CONTAINER (champlainMarker), bg);
+ clutter_container_add_actor (CLUTTER_CONTAINER (marker), bg);
clutter_actor_raise (actor, bg);
- clutter_actor_set_anchor_point (CLUTTER_ACTOR (champlainMarker), 0, text_height + point);
+ clutter_actor_set_anchor_point (CLUTTER_ACTOR (marker), 0, text_height + point);
- return CLUTTER_ACTOR (champlainMarker);
+ return CLUTTER_ACTOR (marker);
}
/**
if (filename == NULL)
return NULL;
- ChamplainMarker *champlainMarker = CHAMPLAIN_MARKER (champlain_marker_new ());
+ ChamplainMarker *marker = CHAMPLAIN_MARKER (champlain_marker_new ());
ClutterActor *actor = clutter_texture_new_from_file (filename, error);
if (actor == NULL){
- g_object_unref (G_OBJECT (champlainMarker));
+ g_object_unref (G_OBJECT (marker));
return NULL;
}
- clutter_container_add_actor (CLUTTER_CONTAINER (champlainMarker), actor);
+ clutter_container_add_actor (CLUTTER_CONTAINER (marker), actor);
- return CLUTTER_ACTOR (champlainMarker);
+ return CLUTTER_ACTOR (marker);
}
/**
if (filename == NULL)
return NULL;
- ChamplainMarker *champlainMarker = CHAMPLAIN_MARKER (champlain_marker_new ());
+ ChamplainMarker *marker = CHAMPLAIN_MARKER (champlain_marker_new ());
ClutterActor *actor = clutter_texture_new_from_file (filename, error);
if (actor == NULL)
{
- g_object_unref (G_OBJECT (champlainMarker));
+ g_object_unref (G_OBJECT (marker));
return NULL;
}
clutter_actor_set_size (actor, width, height);
- clutter_container_add_actor (CLUTTER_CONTAINER (champlainMarker), actor);
- clutter_actor_set_anchor_point (CLUTTER_ACTOR (champlainMarker), anchor_x,
+ clutter_container_add_actor (CLUTTER_CONTAINER (marker), actor);
+ clutter_actor_set_anchor_point (CLUTTER_ACTOR (marker), anchor_x,
anchor_y);
- return CLUTTER_ACTOR (champlainMarker);
+ return CLUTTER_ACTOR (marker);
}
#ifndef CHAMPLAIN_MARKER_H
#define CHAMPLAIN_MARKER_H
-#include <champlain/champlain-defines.h>
+#include <champlain/champlain-base-marker.h>
#include <glib-object.h>
#include <clutter/clutter.h>
+G_BEGIN_DECLS
+
#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))
typedef struct _ChamplainMarkerPrivate ChamplainMarkerPrivate;
-struct _ChamplainMarker
+typedef struct
{
- ClutterGroup group;
+ ChamplainBaseMarker base;
ChamplainMarkerPrivate *priv;
-};
+} ChamplainMarker;
-struct _ChamplainMarkerClass
+typedef struct
{
- ClutterGroupClass parent_class;
+ ChamplainBaseMarkerClass parent_class;
-};
+} ChamplainMarkerClass;
GType champlain_marker_get_type (void);
ClutterActor *champlain_marker_new (void);
-void champlain_marker_set_position (ChamplainMarker *marker,
- gdouble longitude, gdouble latitude);
-
ClutterActor *champlain_marker_new_with_label (const gchar *label,
const gchar *font, ClutterColor *text_color, ClutterColor *marker_color);
ClutterActor *champlain_marker_new_with_image_full(const gchar *filename,
gint width, gint height, gint anchor_x, gint anchor_y, GError **error);
+G_END_DECLS
+
#endif
#include <glib.h>
-#define CHAMPLAIN_MARKER_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE((obj), CHAMPLAIN_TYPE_MARKER, ChamplainMarkerPrivate))
typedef struct _Map Map;
gint z;
} ChamplainPoint;
-struct _ChamplainMarkerPrivate
+struct _ChamplainBaseMarkerPrivate
{
gdouble lon;
gdouble lat;
ChamplainView *view)
{
ChamplainViewPrivate *priv = view->priv;
- ChamplainMarkerPrivate *marker_priv = CHAMPLAIN_MARKER_GET_PRIVATE (marker);
+ ChamplainBaseMarkerPrivate *marker_priv = CHAMPLAIN_BASE_MARKER(marker)->priv;
gint x, y;
*/
void
champlain_view_ensure_markers_visible (ChamplainView *view,
- ChamplainMarker *markers[],
+ ChamplainBaseMarker *markers[],
gboolean animate)
{
gdouble min_lat, min_lon, max_lat, max_lon;
- ChamplainMarker *marker = NULL;
+ ChamplainBaseMarker *marker = NULL;
gint i = 0;
min_lat = min_lon = 200;
#include <champlain/champlain-defines.h>
#include <champlain/champlain-layer.h>
+#include <champlain/champlain-base-marker.h>
#include <champlain/champlain-map-source.h>
#include <champlain/champlain-zoom-level.h>
gdouble lon2,
gboolean animate);
void champlain_view_ensure_markers_visible (ChamplainView *view,
- ChamplainMarker *markers[],
+ ChamplainBaseMarker *markers[],
gboolean animate);
void champlain_view_set_map_source (ChamplainView *champlainView,
#include "champlain/champlain-defines.h"
#include "champlain/champlain-layer.h"
+#include "champlain/champlain-base-marker.h"
#include "champlain/champlain-marker.h"
#include "champlain/champlain-view.h"
#include "champlain/champlain-enum-types.h"
clutter_timeline_start (timeline);
/* Sets marker position on the map */
- champlain_marker_set_position (CHAMPLAIN_MARKER (marker),
+ champlain_base_marker_set_position (CHAMPLAIN_BASE_MARKER (marker),
45.528178, -73.563788);
return marker;
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);
+ champlain_base_marker_set_position (CHAMPLAIN_BASE_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);
+ champlain_base_marker_set_position (CHAMPLAIN_BASE_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);
+ champlain_base_marker_set_position (CHAMPLAIN_BASE_MARKER (marker), 47.130885, -70.764141);
clutter_container_add (CLUTTER_CONTAINER (layer), marker, NULL);
clutter_actor_hide (CLUTTER_ACTOR (layer));
button = gtk_image_new ();
g_signal_connect (view, "notify::state", G_CALLBACK (view_state_changed),
button);
- gtk_box_pack_end (GTK_HBOX (bbox), button, FALSE, FALSE, 0);
+ gtk_box_pack_end (GTK_BOX (bbox), button, FALSE, FALSE, 0);
viewport = gtk_viewport_new (NULL, NULL);
gtk_viewport_set_shadow_type (GTK_VIEWPORT(viewport), GTK_SHADOW_ETCHED_IN);
#include <champlain/champlain.h>
#define PADDING 10
-ChamplainMarker *markers [4];
+ChamplainBaseMarker *markers [4];
static gboolean
map_view_button_release_cb (ClutterActor *actor,
marker = champlain_marker_new_with_label ("Montréal", "Airmole 14", NULL,
NULL);
- markers[0] = CHAMPLAIN_MARKER (marker);
- champlain_marker_set_position (CHAMPLAIN_MARKER (marker),
+ markers[0] = CHAMPLAIN_BASE_MARKER (marker);
+ champlain_base_marker_set_position (CHAMPLAIN_BASE_MARKER (marker),
45.528178, -73.563788);
clutter_container_add (CLUTTER_CONTAINER (layer), marker, NULL);
clutter_actor_set_reactive (marker, TRUE);
marker = champlain_marker_new_with_label ("New York", "Sans 25", &white,
NULL);
- markers[1] = CHAMPLAIN_MARKER (marker);
- champlain_marker_set_position (CHAMPLAIN_MARKER (marker), 40.77, -73.98);
+ markers[1] = CHAMPLAIN_BASE_MARKER (marker);
+ champlain_base_marker_set_position (CHAMPLAIN_BASE_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);
- markers[2] = CHAMPLAIN_MARKER (marker);
- champlain_marker_set_position (CHAMPLAIN_MARKER (marker), 47.130885,
+ markers[2] = CHAMPLAIN_BASE_MARKER (marker);
+ champlain_base_marker_set_position (CHAMPLAIN_BASE_MARKER (marker), 47.130885,
-70.764141);
clutter_container_add (CLUTTER_CONTAINER (layer), marker, NULL);
<title>I. View API Reference</title>
<xi:include href="xml/champlain-view.xml"/>
<xi:include href="xml/champlain-layer.xml"/>
+ <xi:include href="xml/champlain-base-marker.xml"/>
<xi:include href="xml/champlain-marker.xml"/>
<xi:include href="xml/champlain-version.xml"/>
</chapter>
champlain_view_get_type
champlain_marker_get_type
+champlain_base_marker_get_type
champlain_layer_get_type
champlain_map_source_get_type
champlain_network_map_source_get_type