From: Emmanuel Rodriguez Date: Mon, 15 Jun 2009 21:43:48 +0000 (+0200) Subject: Pass an extra argument ($data) through $factory->register($desc, $sub, $data). X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=515d70e0a23d1c4bc9729455851857c25119f874;p=libchamplain Pass an extra argument ($data) through $factory->register($desc, $sub, $data). The method register canl now handle an extra data parameter that will be passed to the constructor. --- diff --git a/bindings/perl/Champlain/xs/ChamplainMapSourceFactory.xs b/bindings/perl/Champlain/xs/ChamplainMapSourceFactory.xs index 84d1ba5..d920945 100644 --- a/bindings/perl/Champlain/xs/ChamplainMapSourceFactory.xs +++ b/bindings/perl/Champlain/xs/ChamplainMapSourceFactory.xs @@ -4,7 +4,6 @@ static GPerlCallback* champlainperl_constructor_create (SV *func, SV *data) { GType param_types [] = { CHAMPLAIN_TYPE_MAP_SOURCE_DESC, - G_TYPE_POINTER, }; return gperl_callback_new( func, data, @@ -26,7 +25,7 @@ champlainperl_constructor (ChamplainMapSourceDesc *desc, gpointer data) { g_value_init(&return_value, callback->return_type); /* FIXME desc is not passed as a Champlain::MapSourceDesc to the perl callback */ - gperl_callback_invoke(callback, &return_value, desc); + gperl_callback_invoke(callback, &return_value, desc, callback->data); retval = g_value_get_object(&return_value); g_value_unset(&return_value); @@ -137,7 +136,7 @@ champlain_map_source_factory_register (ChamplainMapSourceFactory *factory, SV *s CODE: desc = champlainperl_SvChamplainMapSourceDesc(sv_desc); - callback = champlainperl_constructor_create(sv_constructor, NULL); + callback = champlainperl_constructor_create(sv_constructor, sv_data); RETVAL = champlain_map_source_factory_register(factory, desc, champlainperl_constructor, callback); OUTPUT: