From: Emmanuel Rodriguez Date: Sun, 14 Jun 2009 16:59:24 +0000 (+0200) Subject: Add add_polygon() and remove_polygon() X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e2731fd67431ef6ae4d2beaa63b5809c5619db9;p=libchamplain Add add_polygon() and remove_polygon() --- diff --git a/bindings/perl/Champlain/t/ChamplainView.t b/bindings/perl/Champlain/t/ChamplainView.t index 32a2a91..ac8924d 100644 --- a/bindings/perl/Champlain/t/ChamplainView.t +++ b/bindings/perl/Champlain/t/ChamplainView.t @@ -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(). # diff --git a/bindings/perl/Champlain/xs/ChamplainView.xs b/bindings/perl/Champlain/xs/ChamplainView.xs index caf403a..884be08 100644 --- a/bindings/perl/Champlain/xs/ChamplainView.xs +++ b/bindings/perl/Champlain/xs/ChamplainView.xs @@ -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)