[libchamplain] Add champlain_marker_layer_get_selected() to retrieve selected markers
- From: Jiří Techet <jiritechet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libchamplain] Add champlain_marker_layer_get_selected() to retrieve selected markers
- Date: Sat, 19 Feb 2011 21:34:13 +0000 (UTC)
commit 339647b0a9ac77e5fe226b71dbce9c1c5cfce128
Author: JiÅ?Ã Techet <techet gmail com>
Date: Sat Feb 19 22:30:59 2011 +0100
Add champlain_marker_layer_get_selected() to retrieve selected markers
champlain/champlain-marker-layer.c | 36 ++++++++++++++++++++++++++++++
champlain/champlain-marker-layer.h | 1 +
docs/reference/libchamplain-sections.txt | 1 +
3 files changed, 38 insertions(+), 0 deletions(-)
---
diff --git a/champlain/champlain-marker-layer.c b/champlain/champlain-marker-layer.c
index bf94af9..1fabb0a 100644
--- a/champlain/champlain-marker-layer.c
+++ b/champlain/champlain-marker-layer.c
@@ -522,6 +522,42 @@ champlain_marker_layer_get_markers (ChamplainMarkerLayer *layer)
/**
+ * champlain_marker_layer_get_selected:
+ * @layer: a #ChamplainMarkerLayer
+ *
+ * Gets a list of selected markers.
+ *
+ * Returns: (transfer container) (element-type ChamplainMarker): the list
+ *
+ * Since: 0.10
+ */
+GList *
+champlain_marker_layer_get_selected (ChamplainMarkerLayer *layer)
+{
+ ChamplainMarkerLayerPrivate *priv = GET_PRIVATE (layer);
+ GList *elem;
+ GList *markers;
+ GList *selected = NULL;
+
+ g_return_val_if_fail (CHAMPLAIN_IS_MARKER_LAYER (layer), NULL);
+
+ markers = clutter_container_get_children (CLUTTER_CONTAINER (priv->content_group));
+
+ for (elem = markers; elem != NULL; elem = elem->next)
+ {
+ ChamplainMarker *marker = CHAMPLAIN_MARKER (elem->data);
+
+ if (champlain_marker_get_selected (marker))
+ selected = g_list_append (selected, marker);
+ }
+
+ g_list_free (markers);
+
+ return selected;
+}
+
+
+/**
* champlain_marker_layer_remove_marker:
* @layer: a #ChamplainMarkerLayer
* @marker: a #ChamplainMarker
diff --git a/champlain/champlain-marker-layer.h b/champlain/champlain-marker-layer.h
index ac311b5..79b7f93 100644
--- a/champlain/champlain-marker-layer.h
+++ b/champlain/champlain-marker-layer.h
@@ -93,6 +93,7 @@ void champlain_marker_layer_remove_marker (ChamplainMarkerLayer *layer,
ChamplainMarker *marker);
void champlain_marker_layer_remove_all (ChamplainMarkerLayer *layer);
GList *champlain_marker_layer_get_markers (ChamplainMarkerLayer *layer);
+GList *champlain_marker_layer_get_selected (ChamplainMarkerLayer *layer);
void champlain_marker_layer_animate_in_all_markers (ChamplainMarkerLayer *layer);
void champlain_marker_layer_animate_out_all_markers (ChamplainMarkerLayer *layer);
diff --git a/docs/reference/libchamplain-sections.txt b/docs/reference/libchamplain-sections.txt
index c22feda..e355a3a 100644
--- a/docs/reference/libchamplain-sections.txt
+++ b/docs/reference/libchamplain-sections.txt
@@ -315,6 +315,7 @@ champlain_marker_layer_add_marker
champlain_marker_layer_remove_marker
champlain_marker_layer_remove_all
champlain_marker_layer_get_markers
+champlain_marker_layer_get_selected
champlain_marker_layer_animate_in_all_markers
champlain_marker_layer_animate_out_all_markers
champlain_marker_layer_show_all_markers
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]