#include "champlain-defines.h"
#include "champlain-base-marker.h"
+#include "champlain-enum-types.h"
#include <clutter/clutter.h>
#include <glib.h>
enum
{
- PROP_0
+ PROP_0,
+ PROP_SELECTION_MODE
};
struct _ChamplainSelectionLayerPrivate {
GValue *value,
GParamSpec *pspec)
{
- //ChamplainSelectionLayer *self = CHAMPLAIN_SELECTION_LAYER (object);
+ ChamplainSelectionLayer *self = CHAMPLAIN_SELECTION_LAYER (object);
+ ChamplainSelectionLayerPrivate *priv = self->priv;
+
switch (property_id)
{
+ case PROP_SELECTION_MODE:
+ g_value_set_enum (value, priv->mode);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
const GValue *value,
GParamSpec *pspec)
{
- //ChamplainSelectionLayer *self = CHAMPLAIN_SELECTION_LAYER (object);
+ ChamplainSelectionLayer *self = CHAMPLAIN_SELECTION_LAYER (object);
+
switch (property_id)
{
+ case PROP_SELECTION_MODE:
+ champlain_selection_layer_set_selection_mode (self, g_value_get_enum (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
object_class->get_property = champlain_selection_layer_get_property;
object_class->set_property = champlain_selection_layer_set_property;
+
+ /**
+ * ChamplainView:selection-mode:
+ *
+ * Determines the type of selection that will be performed.
+ *
+ * Since: 0.4
+ */
+ g_object_class_install_property (object_class,
+ PROP_SELECTION_MODE,
+ g_param_spec_enum ("selection-mode",
+ "Selection Mode",
+ "Determines the type of selection that will be performed.",
+ CHAMPLAIN_TYPE_SELECTION_MODE,
+ CHAMPLAIN_SELECTION_MULTIPLE,
+ CHAMPLAIN_PARAM_READWRITE));
}
static void
selection = g_list_find (layer->priv->selection, marker);
return selection != NULL;
}
+
+/**
+* champlain_selection_layer_set_selection_mode:
+* @layer: a #ChamplainSelectionLayer
+* @mode: a #ChamplainSelectionMode value
+*
+* Sets the selection mode of the layer.
+*
+* Since: 0.4
+*/
+void
+champlain_selection_layer_set_selection_mode (ChamplainSelectionLayer *layer,
+ ChamplainSelectionMode mode)
+{
+ g_return_if_fail (CHAMPLAIN_IS_SELECTION_LAYER (layer));
+ layer->priv->mode = mode;
+}
+
+/**
+* champlain_selection_layer_get_selection_mode:
+* @layer: a #ChamplainSelectionLayer
+*
+* REturns the selection mode of the layer.
+*
+* Since: 0.4
+*/
+ChamplainSelectionMode
+champlain_selection_layer_get_selection_mode (ChamplainSelectionLayer *layer)
+{
+ g_return_val_if_fail (
+ CHAMPLAIN_IS_SELECTION_LAYER (layer),
+ CHAMPLAIN_SELECTION_MULTIPLE);
+ return layer->priv->mode;
+}