*
* Copyright (C) 2005, Alex Foobarian <foobarian@gmail.com>
* Copyright (C) 2003-2007, Evan Battaglia <gtoevan@gmx.net>
+ * Copyright (C) 2013, Rob Norris <rw_norris@hotmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
return l->name;
}
-VikLayer *vik_layer_create ( VikLayerTypeEnum type, gpointer vp, GtkWindow *w, gboolean interactive )
+VikLayer *vik_layer_create ( VikLayerTypeEnum type, VikViewport *vp, gboolean interactive )
{
VikLayer *new_layer = NULL;
g_assert ( type < VIK_LAYER_NUM_TYPES );
}
/* returns TRUE if OK was pressed */
-gboolean vik_layer_properties ( VikLayer *layer, gpointer vp )
+gboolean vik_layer_properties ( VikLayer *layer, VikViewport *vp )
{
if ( vik_layer_interfaces[layer->type]->properties )
return vik_layer_interfaces[layer->type]->properties ( layer, vp );
d = get_param(vl, i, FALSE);
switch ( params[i].type )
{
- case VIK_LAYER_PARAM_STRING:
- vlm_append(d.s, strlen(d.s));
- break;
-
+ case VIK_LAYER_PARAM_STRING:
+ // Remember need braces as these are macro calls, not single statement functions!
+ if ( d.s ) {
+ vlm_append(d.s, strlen(d.s));
+ }
+ else {
+ // Need to insert empty string otherwise the unmarshall will get confused
+ vlm_append("", 0);
+ }
+ break;
/* print out the string list in the array */
case VIK_LAYER_PARAM_STRING_LIST: {
GList *list = d.sl;
*/
void vik_layer_set_defaults ( VikLayer *vl, VikViewport *vvp )
{
+ // Sneaky initialize of the viewport value here
+ vl->vvp = vvp;
VikLayerInterface *vli = vik_layer_get_interface ( vl->type );
const gchar *layer_name = vli->fixed_layer_name;
VikLayerParamData data;