champlain-point.h \
champlain-view.h \
champlain-layer.h \
+ champlain-selection-layer.h \
champlain-base-marker.h \
champlain-marker.h \
champlain-map.h \
champlain-debug.c \
champlain-view.c \
champlain-layer.c \
+ champlain-selection-layer.c \
champlain-base-marker.c \
champlain-marker.c \
champlain-map.c \
champlain-point.h \
champlain-enum-types.h \
champlain-layer.h \
+ champlain-selection-layer.h \
champlain-map-source.h \
champlain-network-map-source.h \
champlain-map-source-factory.h \
--- /dev/null
+/*
+ * Copyright (C) 2009 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-selection-layer
+ * @short_description: A container for #ChamplainMarker supporting selection
+ *
+ * A ChamplainSelectionLayer is little more than a #ChamplainLayer. The markers
+ * can be selected.
+ *
+ * Use #clutter_container_add to add markers to the layer and
+ * #clutter_container_remove to remove them.
+ */
+
+#include "config.h"
+
+#include "champlain-selection-layer.h"
+
+#include "champlain-defines.h"
+#include "champlain-base-marker.h"
+
+#include <clutter/clutter.h>
+#include <glib.h>
+
+G_DEFINE_TYPE (ChamplainSelectionLayer, champlain_selection_layer, CHAMPLAIN_TYPE_LAYER)
+
+#define GET_PRIVATE(o) \
+ (G_TYPE_INSTANCE_GET_PRIVATE ((o), CHAMPLAIN_TYPE_SELECTION_LAYER, ChamplainSelectionLayerPrivate))
+
+enum
+{
+ PROP_0
+};
+
+typedef struct _ChamplainSelectionLayerPrivate ChamplainSelectionLayerPrivate;
+
+struct _ChamplainSelectionLayerPrivate {
+ gpointer spacer;
+};
+
+static void
+champlain_selection_layer_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ //ChamplainSelectionLayer *self = CHAMPLAIN_SELECTION_LAYER (object);
+ switch (property_id)
+ {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ }
+}
+
+static void
+champlain_selection_layer_set_property (GObject *object,
+ guint property_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ //ChamplainSelectionLayer *self = CHAMPLAIN_SELECTION_LAYER (object);
+ switch (property_id)
+ {
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ }
+}
+
+static void
+champlain_selection_layer_class_init (ChamplainSelectionLayerClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ g_type_class_add_private (klass, sizeof (ChamplainSelectionLayerPrivate));
+
+ object_class->get_property = champlain_selection_layer_get_property;
+ object_class->set_property = champlain_selection_layer_set_property;
+}
+
+static void
+champlain_selection_layer_init (ChamplainSelectionLayer *self)
+{
+
+}
+
+/**
+ * champlain_selection_layer_new:
+ *
+ * Returns a new #ChamplainSelectionLayer ready to be used as a #ClutterContainer for the markers.
+ *
+ * Since: 0.4
+ */
+ChamplainLayer *
+champlain_selection_layer_new ()
+{
+ return g_object_new (CHAMPLAIN_TYPE_SELECTION_LAYER, NULL);
+}
--- /dev/null
+/*
+ * Copyright (C) 2009 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_SELECTION_LAYER_H
+#define CHAMPLAIN_SELECTION_LAYER_H
+
+#include <champlain/champlain-defines.h>
+#include <champlain/champlain-layer.h>
+
+#include <glib-object.h>
+#include <clutter/clutter.h>
+
+G_BEGIN_DECLS
+
+#define CHAMPLAIN_TYPE_SELECTION_LAYER champlain_selection_layer_get_type()
+
+#define CHAMPLAIN_SELECTION_LAYER(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), CHAMPLAIN_TYPE_SELECTION_LAYER, ChamplainSelectionLayer))
+
+#define CHAMPLAIN_SELECTION_LAYER_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_CAST ((klass), CHAMPLAIN_TYPE_SELECTION_LAYER, ChamplainSelectionLayerClass))
+
+#define CHAMPLAIN_IS_SELECTION_LAYER(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CHAMPLAIN_TYPE_SELECTION_LAYER))
+
+#define CHAMPLAIN_IS_SELECTION_LAYER_CLASS(klass) \
+ (G_TYPE_CHECK_CLASS_TYPE ((klass), CHAMPLAIN_TYPE_SELECTION_LAYER))
+
+#define CHAMPLAIN_SELECTION_LAYER_GET_CLASS(obj) \
+ (G_TYPE_INSTANCE_GET_CLASS ((obj), CHAMPLAIN_TYPE_SELECTION_LAYER, ChamplainSelectionLayerClass))
+
+typedef struct {
+ ChamplainLayer parent;
+} ChamplainSelectionLayer;
+
+typedef struct {
+ ChamplainLayerClass parent_class;
+} ChamplainSelectionLayerClass;
+
+GType champlain_selection_layer_get_type (void);
+
+ChamplainLayer * champlain_selection_layer_new (void);
+
+G_END_DECLS
+
+#endif
#include "champlain/champlain-defines.h"
#include "champlain/champlain-cache.h"
#include "champlain/champlain-layer.h"
+#include "champlain/champlain-selection-layer.h"
#include "champlain/champlain-base-marker.h"
#include "champlain/champlain-marker.h"
#include "champlain/champlain-view.h"
ChamplainLayer *layer;
ClutterColor orange = { 0xf3, 0x94, 0x07, 0xbb };
- layer = champlain_layer_new ();
+ layer = champlain_selection_layer_new ();
marker = champlain_marker_new_with_text ("Montréal\n<span size=\"xx-small\">Québec</span>",
"Serif 14", NULL, NULL);