From: Emmanuel Rodriguez Date: Sun, 14 Jun 2009 15:14:46 +0000 (+0200) Subject: Bindings for ChamplainPolygon X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ead5119ed804a1e100d29c2de6cdedee45340b99;p=libchamplain Bindings for ChamplainPolygon --- diff --git a/bindings/perl/Champlain/MANIFEST b/bindings/perl/Champlain/MANIFEST index 6f81967..5a3553d 100644 --- a/bindings/perl/Champlain/MANIFEST +++ b/bindings/perl/Champlain/MANIFEST @@ -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 diff --git a/bindings/perl/Champlain/maps b/bindings/perl/Champlain/maps index 12be7ba..9910027 100644 --- a/bindings/perl/Champlain/maps +++ b/bindings/perl/Champlain/maps @@ -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 index 0000000..950a4b2 --- /dev/null +++ b/bindings/perl/Champlain/t/ChamplainPolygon.t @@ -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 index 0000000..4bec9e4 --- /dev/null +++ b/bindings/perl/Champlain/xs/ChamplainPolygon.xs @@ -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)