[libchamplain] Add add_polygon() and remove_polygon()



commit 1e2731fd67431ef6ae4d2beaa63b5809c5619db9
Author: Emmanuel Rodriguez <emmanuel rodriguez gmail com>
Date:   Sun Jun 14 18:59:24 2009 +0200

    Add add_polygon() and remove_polygon()

 bindings/perl/Champlain/t/ChamplainView.t   |   22 ++++++++++++++++++++++
 bindings/perl/Champlain/xs/ChamplainView.xs |    8 ++++++++
 2 files changed, 30 insertions(+), 0 deletions(-)
---
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;
 }
 
@@ -292,6 +293,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().
 #
 sub 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)



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