* - filename
*/
desc = g_new0(ChamplainMapSourceDesc, 1);
-
- if (! ((s = hv_fetch(hash, "id", 2, 0)) && SvOK(*s))) {
+ if ((s = hv_fetch(hash, "id", 2, 0)) && SvOK(*s)) {
desc->id = SvGChar(*s);
}
else {
croak("SvChamplainMapSourceDesc: requires the key: 'id'");
}
- if (! ((s = hv_fetch(hash, "name", 4, 0)) && SvOK(*s))) {
+ if ((s = hv_fetch(hash, "name", 4, 0)) && SvOK(*s)) {
desc->name = SvGChar(*s);
}
else {
croak("SvChamplainMapSourceDesc: requires the key: 'name'");
}
- if (! ((s = hv_fetch(hash, "license", 7, 0)) && SvOK(*s))) {
+ if ((s = hv_fetch(hash, "license", 7, 0)) && SvOK(*s)) {
desc->license = SvGChar(*s);
}
else {
croak("SvChamplainMapSourceDesc: requires the key: 'license'");
}
- if (! ((s = hv_fetch(hash, "license_uri", 11, 0)) && SvOK(*s))) {
+ if ((s = hv_fetch(hash, "license_uri", 11, 0)) && SvOK(*s)) {
desc->license_uri = SvGChar(*s);
}
else {
croak("SvChamplainMapSourceDesc: requires the key: 'license_uri'");
}
- if (! ((s = hv_fetch(hash, "min_zoom_level", 14, 0)) && SvOK(*s))) {
+ if ((s = hv_fetch(hash, "min_zoom_level", 14, 0)) && SvOK(*s)) {
desc->min_zoom_level = (gint)SvIV(*s);
}
else {
croak("SvChamplainMapSourceDesc: requires the key: 'min_zoom_level'");
}
- if (! ((s = hv_fetch(hash, "max_zoom_level", 14, 0)) && SvOK(*s))) {
+ if ((s = hv_fetch(hash, "max_zoom_level", 14, 0)) && SvOK(*s)) {
desc->max_zoom_level = (gint)SvIV(*s);
}
else {
croak("SvChamplainMapSourceDesc: requires the key: 'max_zoom_level'");
}
- if (! ((s = hv_fetch(hash, "projection", 10, 0)) && SvOK(*s))) {
+ if ((s = hv_fetch(hash, "projection", 10, 0)) && SvOK(*s)) {
desc->projection = SvChamplainMapProjection(*s);
}
else {
champlain_map_source_factory_create (ChamplainMapSourceFactory *factory, const gchar *id)
-#gboolean
-#champlain_map_source_factory_register (ChamplainMapSourceFactory *factory, const gchar *id, ChamplainMapSourceConstructor callback)
+gboolean
+champlain_map_source_factory_register (ChamplainMapSourceFactory *factory, SV *data)
+ PREINIT:
+ ChamplainMapSourceDesc *desc = NULL;
+ SV *sv = NULL;
+
+ CODE:
+
+ desc = SvChamplainMapSourceDesc(data);
+ RETVAL = champlain_map_source_factory_register(factory, desc);
+
+ OUTPUT:
+ RETVAL
const gchar*