]> git.street.me.uk Git - andy/viking.git/blobdiff - src/vikgeoreflayer.c
[QA] Replace some coef with more explicit function
[andy/viking.git] / src / vikgeoreflayer.c
index 04d3a8485192aeb4f70545c38a52770a32eeffe9..6f8afb3bf3cd7fdffca2878636172a25de8f82d6 100644 (file)
 #include "icons/icons.h"
 
 VikLayerParam georef_layer_params[] = {
-  { "image", VIK_LAYER_PARAM_STRING, VIK_LAYER_NOT_IN_PROPERTIES },
-  { "corner_easting", VIK_LAYER_PARAM_DOUBLE, VIK_LAYER_NOT_IN_PROPERTIES },
-  { "corner_northing", VIK_LAYER_PARAM_DOUBLE, VIK_LAYER_NOT_IN_PROPERTIES },
-  { "mpp_easting", VIK_LAYER_PARAM_DOUBLE, VIK_LAYER_NOT_IN_PROPERTIES },
-  { "mpp_northing", VIK_LAYER_PARAM_DOUBLE, VIK_LAYER_NOT_IN_PROPERTIES },
+  { "image", VIK_LAYER_PARAM_STRING, VIK_LAYER_NOT_IN_PROPERTIES, NULL, 0, NULL, NULL, },
+  { "corner_easting", VIK_LAYER_PARAM_DOUBLE, VIK_LAYER_NOT_IN_PROPERTIES, NULL, 0, NULL, NULL, NULL  },
+  { "corner_northing", VIK_LAYER_PARAM_DOUBLE, VIK_LAYER_NOT_IN_PROPERTIES, NULL, 0, NULL, NULL, NULL  },
+  { "mpp_easting", VIK_LAYER_PARAM_DOUBLE, VIK_LAYER_NOT_IN_PROPERTIES, NULL, 0, NULL, NULL, NULL },
+  { "mpp_northing", VIK_LAYER_PARAM_DOUBLE, VIK_LAYER_NOT_IN_PROPERTIES, NULL, 0, NULL, NULL, NULL  },
 };
 
 enum { PARAM_IMAGE = 0, PARAM_CE, PARAM_CN, PARAM_ME, PARAM_MN, NUM_PARAMS };
@@ -70,15 +70,20 @@ static VikToolInterface georef_tools[] = {
   { { "GeorefMoveMap", "vik-icon-Georef Move Map",  N_("_Georef Move Map"), NULL,  N_("Georef Move Map"), 0 },
     (VikToolConstructorFunc) georef_layer_move_create, NULL, NULL, NULL,
     (VikToolMouseFunc) georef_layer_move_press, NULL, (VikToolMouseFunc) georef_layer_move_release,
-    (VikToolKeyFunc) NULL, GDK_CURSOR_IS_PIXMAP, &cursor_geomove_pixbuf },
+    (VikToolKeyFunc) NULL,
+    FALSE,
+    GDK_CURSOR_IS_PIXMAP, &cursor_geomove_pixbuf },
 
   { { "GeorefZoomTool", "vik-icon-Georef Zoom Tool",  N_("Georef Z_oom Tool"), NULL,  N_("Georef Zoom Tool"), 0 },
     (VikToolConstructorFunc) georef_layer_zoom_create, NULL, NULL, NULL,
     (VikToolMouseFunc) georef_layer_zoom_press, NULL, NULL,
-    (VikToolKeyFunc) NULL, GDK_CURSOR_IS_PIXMAP, &cursor_geozoom_pixbuf },
+    (VikToolKeyFunc) NULL,
+    FALSE,
+    GDK_CURSOR_IS_PIXMAP, &cursor_geozoom_pixbuf },
 };
 
 VikLayerInterface vik_georef_layer_interface = {
+  "GeoRef Map",
   N_("GeoRef Map"),
   NULL,
   &vikgeoreflayer_pixbuf, /*icon */
@@ -226,7 +231,7 @@ static VikLayerParamData georef_layer_get_param ( VikGeorefLayer *vgl, guint16 i
 VikGeorefLayer *georef_layer_new ( )
 {
   VikGeorefLayer *vgl = VIK_GEOREF_LAYER ( g_object_new ( VIK_GEOREF_LAYER_TYPE, NULL ) );
-  vik_layer_init ( VIK_LAYER(vgl), VIK_LAYER_GEOREF );
+  vik_layer_set_type ( VIK_LAYER(vgl), VIK_LAYER_GEOREF );
 
   vgl->image = NULL;
   vgl->pixbuf = NULL;
@@ -634,7 +639,7 @@ static gboolean georef_layer_move_release ( VikGeorefLayer *vgl, GdkEventButton
   {
     vgl->corner.easting += (event->x - vgl->click_x) * vik_viewport_get_xmpp (vvp);
     vgl->corner.northing -= (event->y - vgl->click_y) * vik_viewport_get_ympp (vvp);
-    vik_layer_emit_update ( VIK_LAYER(vgl), FALSE );
+    vik_layer_emit_update ( VIK_LAYER(vgl) );
     return TRUE;
   }
   return FALSE; /* I didn't move anything on this layer! */
@@ -667,7 +672,7 @@ static gboolean georef_layer_zoom_press ( VikGeorefLayer *vgl, GdkEventButton *e
   }
   vik_viewport_set_xmpp ( vvp, vgl->mpp_easting );
   vik_viewport_set_ympp ( vvp, vgl->mpp_northing );
-  vik_layer_emit_update ( VIK_LAYER(vgl), FALSE );
+  vik_layer_emit_update ( VIK_LAYER(vgl) );
   return TRUE;
 }