]> err.no Git - libchamplain/commitdiff
Bindings for champlain_map_source_factory_get_list
authorEmmanuel Rodriguez <emmanuel.rodriguez@gmail.com>
Mon, 4 May 2009 14:32:43 +0000 (16:32 +0200)
committerPierre-Luc Beaudoin <pierre-luc@pierlux.com>
Wed, 6 May 2009 03:16:03 +0000 (23:16 -0400)
bindings/perl/Champlain/t/ChamplainMapSourceFactory.t
bindings/perl/Champlain/xs/ChamplainMapSourceFactory.xs

index f727c583bec58a1d771d61cac84371bfd172ff81..1dbbe2b6fb37f1364a028d32ccc2d8da50183bde 100644 (file)
@@ -38,6 +38,9 @@ sub test_map_factory {
        generic_create($factory, Champlain::MapSourceFactory->OSM_CYCLEMAP);
        generic_create($factory, Champlain::MapSourceFactory->OAM);
        generic_create($factory, Champlain::MapSourceFactory->MFF_RELIEF);
+       
+       my @maps = $factory->get_list();
+       ok(@maps >= 5, "Maps factory has the default maps");
 }
 
 
index 40901e3397817f7b8938f129c9d1c686d3be0e42..4e02ac969c7551533dd0d1a0b566d0288003b3b9 100644 (file)
@@ -9,8 +9,23 @@ champlain_map_source_factory_get_default (class)
        C_ARGS: /* No args */
 
 
-#gchar**
-#champlain_map_source_factory_get_list (ChamplainMapSourceFactory *factory)
+void
+champlain_map_source_factory_get_list (ChamplainMapSourceFactory *factory)
+       PREINIT:
+               gchar **list = NULL;
+               gchar *item = NULL;
+               gint i = 0;
+       
+       PPCODE:
+               list = champlain_map_source_factory_get_list(factory);
+               
+               item = list[0];
+               while (item != NULL) {
+                       XPUSHs(sv_2mortal(newSVGChar(item)));
+                       item = list[++i];
+               }
+               
+               g_strfreev(list);
 
 
 ChamplainMapSource*