#define GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), CHAMPLAIN_TYPE_SELECTION_LAYER, ChamplainSelectionLayerPrivate))
+enum
+{
+ /* normal signals */
+ CHANGED,
+ LAST_SIGNAL
+};
+
enum
{
PROP_0,
PROP_SELECTION_MODE
};
+static guint signals[LAST_SIGNAL] = { 0, };
+
struct _ChamplainSelectionLayerPrivate {
ChamplainSelectionMode mode;
GList *selection;
CHAMPLAIN_TYPE_SELECTION_MODE,
CHAMPLAIN_SELECTION_SINGLE,
CHAMPLAIN_PARAM_READWRITE));
+
+ /**
+ * ChamplainSelectionLayer::changed
+ *
+ * The changed signal is emitted when the selected marker(s) change.
+ *
+ * Since: 0.4.1
+ */
+ signals[CHANGED] =
+ g_signal_new ("changed", G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST, 0, NULL, NULL,
+ g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
}
static void
g_object_ref (marker);
g_object_set (marker, "highlighted", TRUE, NULL);
layer->priv->selection = g_list_prepend (layer->priv->selection, marker);
+
+ g_signal_emit_by_name (layer, "changed", NULL);
}
static void
selection = g_list_delete_link (selection, selection);
}
layer->priv->selection = selection;
+
+ g_signal_emit_by_name (layer, "changed", NULL);
}
/**
g_object_set (selection->data, "highlighted", FALSE, NULL);
g_object_unref (selection->data);
layer->priv->selection = g_list_delete_link (layer->priv->selection, selection);
+
+ g_signal_emit_by_name (layer, "changed", NULL);
}
}