]> err.no Git - libchamplain/commitdiff
Add add_polygon() and remove_polygon()
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Sun, 14 Jun 2009 16:59:24 +0000 (18:59 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Sun, 14 Jun 2009 17:19:59 +0000 (13:19 -0400)
bindings/perl/Champlain/t/ChamplainView.t
bindings/perl/Champlain/xs/ChamplainView.xs

index 32a2a91b3b327bb122ef7f6ec92d3d3e2caf40f6..ac8924dddac78d9569debac9f12fa8507117c258 100644 (file)
@@ -18,6 +18,7 @@ sub tests {
        test_generic();
        test_zoom();
        test_event();
+       test_polygons();
        return 0;
 }
 
@@ -291,6 +292,27 @@ sub test_go_to {
 }
 
 
+#
+# Test the polygons
+#
+sub test_polygons {
+       my $view = Champlain::View->new();
+       isa_ok($view, 'Champlain::View');
+
+       my $line = Champlain::Polygon->new();
+       my $triangle = Champlain::Polygon->new();
+       my $square = Champlain::Polygon->new();
+       
+       # Note these can't be tested as the API provides no way for querying the polygons
+       $view->add_polygon($line);
+       $view->add_polygon($triangle);
+       $view->add_polygon($square);
+       
+       $view->remove_polygon($line);
+       $view->remove_polygon($square);
+}
+
+
 #
 # Test ensure_visible().
 #
index caf403a77545dadeec64451a2c52f74d2c2b2fed..884be08a8a5d18ebf09441a88046d577b9fd0a45 100644 (file)
@@ -138,3 +138,11 @@ champlain_view_get_show_license (ChamplainView *view)
 
 gboolean
 champlain_view_get_zoom_on_double_click (ChamplainView *view)
+
+
+void
+champlain_view_add_polygon (ChamplainView *view, ChamplainPolygon *polygon)
+
+
+void
+champlain_view_remove_polygon (ChamplainView *view, ChamplainPolygon *polygon)