]> err.no Git - libchamplain/commitdiff
Bindings for ChamplainPolygon
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Sun, 14 Jun 2009 15:14:46 +0000 (17:14 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Sun, 14 Jun 2009 17:19:59 +0000 (13:19 -0400)
bindings/perl/Champlain/MANIFEST
bindings/perl/Champlain/maps
bindings/perl/Champlain/t/ChamplainPolygon.t [new file with mode: 0644]
bindings/perl/Champlain/xs/ChamplainPolygon.xs [new file with mode: 0644]

index 6f8196725923bcff4169016f01e1449f28f4650f..5a3553d61e542e3f3a53b79cb1924df5543b350a 100644 (file)
@@ -17,6 +17,7 @@ xs/ChamplainMapSourceFactory.xs
 xs/ChamplainMarker.xs
 xs/ChamplainNetworkMapSource.xs
 xs/ChamplainPoint.xs
+xs/ChamplainPolygon.xs
 xs/ChamplainTile.xs
 xs/ChamplainView.xs
 xs/ChamplainZoomLevel.xs
@@ -30,6 +31,7 @@ t/ChamplainMapSourceFactory.t
 t/ChamplainMarker.t
 t/ChamplainNetworkMapSource.t
 t/ChamplainPoint.t
+t/ChamplainPolygon.t
 t/ChamplainTile.t
 t/ChamplainView.t
 t/ChamplainZoomLevel.t
index 12be7ba008d2bc5552b39b6a72ff3a66c091b460..9910027e78730f969431d00a05bd630831479925 100644 (file)
@@ -13,3 +13,4 @@ CHAMPLAIN_TYPE_MAP_SOURCE_FACTORY  ChamplainMapSourceFactory  GObject  Champlain
 CHAMPLAIN_TYPE_CACHE               ChamplainCache             GObject  Champlain::Cache
 CHAMPLAIN_TYPE_MAP_SOURCE_DESC     ChamplainMapSourceDesc     GBoxed   Champlain::MapSourceDesc
 CHAMPLAIN_TYPE_POINT               ChamplainPoint             GBoxed   Champlain::Point
+CHAMPLAIN_TYPE_POLYGON             ChamplainPolygon           GObject  Champlain::Polygon
diff --git a/bindings/perl/Champlain/t/ChamplainPolygon.t b/bindings/perl/Champlain/t/ChamplainPolygon.t
new file mode 100644 (file)
index 0000000..950a4b2
--- /dev/null
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Clutter::TestHelper tests => 1;
+
+use Champlain;
+
+exit tests();
+
+sub tests {
+       test_generic();
+       return 0;
+}
+
+
+sub test_generic {
+       my $polygon = Champlain::Polygon->new();
+       isa_ok($polygon, 'Champlain::Polygon');
+}
diff --git a/bindings/perl/Champlain/xs/ChamplainPolygon.xs b/bindings/perl/Champlain/xs/ChamplainPolygon.xs
new file mode 100644 (file)
index 0000000..4bec9e4
--- /dev/null
@@ -0,0 +1,85 @@
+#include "champlain-perl.h"
+
+
+MODULE = Champlain::Polygon  PACKAGE = Champlain::Polygon  PREFIX = champlain_polygon_
+
+
+ChamplainPolygon*
+champlain_polygon_new (class)
+       C_ARGS: /* No args */
+
+
+ChamplainPoint*
+champlain_polygon_append_point (ChamplainPolygon *polygon, gdouble lat, gdouble lon)
+
+
+ChamplainPoint*
+champlain_polygon_insert_point (ChamplainPolygon *polygon, gdouble lat, gdouble lon, gint pos)
+
+
+void
+champlain_polygon_clear_points (ChamplainPolygon *polygon)
+
+
+void
+champlain_polygon_get_points (ChamplainPolygon *polygon)
+       PREINIT:
+               GList *item = NULL;
+       
+       PPCODE:
+               item = champlain_polygon_get_points(polygon);
+               
+               for (; item != NULL; item = item->next) {
+                       ChamplainPoint *point = CHAMPLAIN_POINT(item->data);
+                       XPUSHs(sv_2mortal(newSVChamplainPoint(point)));
+               }
+               
+               /* The doc says that the list shouldn't be freed! */
+
+
+void
+champlain_polygon_set_fill_color (ChamplainPolygon *polygon, const ClutterColor *color)
+
+
+void
+champlain_polygon_set_stroke_color (ChamplainPolygon *polygon, const ClutterColor *color)
+
+
+ClutterColor*
+champlain_polygon_get_fill_color (ChamplainPolygon *polygon)
+
+
+ClutterColor*
+champlain_polygon_get_stroke_color (ChamplainPolygon *polygon)
+
+
+gboolean
+champlain_polygon_get_fill (ChamplainPolygon *polygon)
+
+
+void
+champlain_polygon_set_fill (ChamplainPolygon *polygon, gboolean value)
+
+
+gboolean
+champlain_polygon_get_stroke (ChamplainPolygon *polygon)
+
+
+void
+champlain_polygon_set_stroke (ChamplainPolygon *polygon, gboolean value)
+
+
+void
+champlain_polygon_set_stroke_width (ChamplainPolygon *polygon, gdouble value)
+
+
+gdouble
+champlain_polygon_get_stroke_width (ChamplainPolygon *polygon)
+
+
+void
+champlain_polygon_show (ChamplainPolygon *polygon)
+
+
+void
+champlain_polygon_hide (ChamplainPolygon *polygon)