--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Clutter::TestHelper tests => 5;
+
+use Champlain;
+
+exit tests();
+
+sub tests {
+ test_empty();
+ test_markers();
+ return 0;
+}
+
+
+sub test_empty {
+ my $layer = Champlain::SelectionLayer->new();
+ isa_ok($layer, 'Champlain::Layer');
+
+ is($layer->get_selected, undef, "No selection on an empty layer");
+
+ my @markers;
+ @markers = $layer->get_selected_markers;
+ is_deeply(\@markers, [], "No selected markers on an empty layer");
+
+ my $count = $layer->count_selected_markers;
+ is($count, 0, "Empty marker count on a empty layer");
+
+ my $marker = Champlain::BaseMarker->new();
+
+ ok(!$layer->marker_is_selected($marker), "Marker is unselected on an empty layer");
+
+ # Can't be tested but at least they are invoked
+ $layer->select($marker);
+ $layer->unselect($marker);
+# $layer->select_all();
+ $layer->unselect_all();
+
+ return 0;
+}
+
+
+sub test_markers {
+ my $layer = Champlain::SelectionLayer->new();
+ isa_ok($layer, 'Champlain::Layer');
+
+ is($layer->get_selected, undef, "No selection on an empty layer");
+
+ my @markers;
+ @markers = $layer->get_selected_markers;
+ is_deeply(\@markers, [], "No selected markers on an empty layer");
+
+ my $count = $layer->count_selected_markers;
+ is($count, 0, "Empty marker count on a empty layer");
+
+ my $marker = Champlain::BaseMarker->new();
+
+ ok(!$layer->marker_is_selected($marker), "Marker is unselected on an empty layer");
+
+ # Can't be tested but at least they are invoked
+ $layer->select($marker);
+ $layer->unselect($marker);
+# $layer->select_all();
+ $layer->unselect_all();
+
+ return 0;
+}
--- /dev/null
+#include "champlain-perl.h"
+
+
+MODULE = Champlain::SelectionLayer PACKAGE = Champlain::SelectionLayer PREFIX = champlain_selection_layer_
+
+
+ChamplainLayer*
+champlain_selection_layer_new (class)
+ C_ARGS: /* No args */
+
+
+ChamplainBaseMarker*
+champlain_selection_layer_get_selected (ChamplainSelectionLayer *layer)
+
+
+void
+champlain_selection_layer_get_selected_markers (ChamplainSelectionLayer *layer)
+ PREINIT:
+ const GList *item = NULL;
+
+ PPCODE:
+ item = champlain_selection_layer_get_selected_markers(layer);
+
+ if (!item) {
+ XSRETURN_EMPTY;
+ }
+
+ for (; item != NULL; item = item->next) {
+ ChamplainBaseMarker *marker = CHAMPLAIN_BASE_MARKER(item->data);
+ XPUSHs(sv_2mortal(newSVChamplainBaseMarker(marker)));
+ }
+
+ /* The doc says that the list shouldn't be freed! */
+
+
+guint
+champlain_selection_layer_count_selected_markers (ChamplainSelectionLayer *layer)
+
+
+void
+champlain_selection_layer_select (ChamplainSelectionLayer *layer, ChamplainBaseMarker *marker)
+
+
+void
+champlain_selection_layer_unselect (ChamplainSelectionLayer *layer, ChamplainBaseMarker *marker)
+
+
+gboolean
+champlain_selection_layer_marker_is_selected (ChamplainSelectionLayer *layer, ChamplainBaseMarker *marker)
+
+
+#void
+#champlain_selection_layer_select_all (ChamplainSelectionLayer *layer)
+
+
+void
+champlain_selection_layer_unselect_all (ChamplainSelectionLayer *layer)