[libchamplain] Implement champlain_selection_layer_select_all



commit 8c9c621a7744a5a00a6d68c83edf16e7cde00170
Author: Emmanuel Rodriguez <emmanuel rodriguez gmail com>
Date:   Sat Jul 11 10:11:28 2009 +0200

    Implement champlain_selection_layer_select_all
    
    This implementation will only work when the layer selection mode is set to
    multiple. This is because it seems strange to select more than one marker if
    the selection mode is set to single.

 champlain/champlain-selection-layer.c |   30 ++++++++++++++++++++++++++++++
 1 files changed, 30 insertions(+), 0 deletions(-)
---
diff --git a/champlain/champlain-selection-layer.c b/champlain/champlain-selection-layer.c
index 18850be..0155997 100644
--- a/champlain/champlain-selection-layer.c
+++ b/champlain/champlain-selection-layer.c
@@ -290,6 +290,36 @@ champlain_selection_layer_unselect_all (ChamplainSelectionLayer *layer)
   layer->priv->selection = selection;
 }
 
+/**
+ * champlain_selection_layer_select_all:
+ *
+ * Selects all markers in the layer. This call will only work if the selection
+ * mode is set CHAMPLAIN_SELETION_MULTIPLE.
+ *
+ * Since: 0.4
+ */
+void
+champlain_selection_layer_select_all (ChamplainSelectionLayer *layer)
+{
+  gint n_children = 0;
+  gint i = 0;
+
+  if (layer->priv->mode == CHAMPLAIN_SELECTION_SINGLE)
+    return;
+
+  n_children = clutter_group_get_n_children (CLUTTER_GROUP (layer) );
+  for (; i < n_children; ++i)
+    {
+      ClutterActor *actor = clutter_group_get_nth_child (
+          CLUTTER_GROUP (layer), i);
+      if (CHAMPLAIN_IS_BASE_MARKER (actor) )
+        {
+          ChamplainBaseMarker *marker = CHAMPLAIN_BASE_MARKER (actor);
+          real_select (layer, marker, TRUE);
+        }
+    }
+}
+
 void
 champlain_selection_layer_unselect (ChamplainSelectionLayer *layer,
     ChamplainBaseMarker *marker)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]