]> git.street.me.uk Git - andy/viking.git/blobdiff - src/vikgeoreflayer.c
Add copyright
[andy/viking.git] / src / vikgeoreflayer.c
index 37b08b77a54dfd95966e2733f15a66450058c125..579150528e009ddc4ed2c600b79edd5d813b17f8 100644 (file)
 #endif
 
 #include "viking.h"
 #endif
 
 #include "viking.h"
-#include "vikgeoreflayer_pixmap.h"
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <glib.h>
 #include <glib/gstdio.h>
 #include <glib/gi18n.h>
 #include <glib/gstdio.h>
 #include <glib/gi18n.h>
+#include <string.h>
 
 #include "icons/icons.h"
 
 
 #include "icons/icons.h"
 
@@ -67,16 +65,16 @@ static gboolean georef_layer_zoom_press ( VikGeorefLayer *vgl, GdkEventButton *e
 static VikToolInterface georef_tools[] = {
   { N_("Georef Move Map"), (VikToolConstructorFunc) georef_layer_move_create, NULL, NULL, NULL,
     (VikToolMouseFunc) georef_layer_move_press, NULL, (VikToolMouseFunc) georef_layer_move_release,
 static VikToolInterface georef_tools[] = {
   { N_("Georef Move Map"), (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 },
+    (VikToolKeyFunc) NULL, GDK_CURSOR_IS_PIXMAP, &cursor_geomove_pixbuf },
 
   { N_("Georef Zoom Tool"), (VikToolConstructorFunc) georef_layer_zoom_create, NULL, NULL, NULL,
     (VikToolMouseFunc) georef_layer_zoom_press, NULL, NULL,
 
   { N_("Georef Zoom Tool"), (VikToolConstructorFunc) georef_layer_zoom_create, NULL, NULL, NULL,
     (VikToolMouseFunc) georef_layer_zoom_press, NULL, NULL,
-    (VikToolKeyFunc) NULL, GDK_CURSOR_IS_PIXMAP, &cursor_geozoom },
+    (VikToolKeyFunc) NULL, GDK_CURSOR_IS_PIXMAP, &cursor_geozoom_pixbuf },
 };
 
 VikLayerInterface vik_georef_layer_interface = {
   "GeoRef Map",
 };
 
 VikLayerInterface vik_georef_layer_interface = {
   "GeoRef Map",
-  &georeflayer_pixbuf, /*icon */
+  &vikgeoreflayer_pixbuf, /*icon */
 
   georef_tools,
   sizeof(georef_tools) / sizeof(VikToolInterface),
 
   georef_tools,
   sizeof(georef_tools) / sizeof(VikToolInterface),
@@ -300,7 +298,7 @@ static gboolean world_file_read_line ( gchar *buffer, gint size, FILE *f, GtkWid
   }
   if ( use_value )
   {
   }
   if ( use_value )
   {
-    gdouble val = strtod ( buffer, NULL );
+    gdouble val = g_strtod ( buffer, NULL );
     gtk_spin_button_set_value ( GTK_SPIN_BUTTON(widget), val > 0 ? val : -val );
   }
   return TRUE;
     gtk_spin_button_set_value ( GTK_SPIN_BUTTON(widget), val > 0 ? val : -val );
   }
   return TRUE;
@@ -327,8 +325,8 @@ static void georef_layer_dialog_load ( GtkWidget *pass_along[4] )
     else
     {
       gchar *buffer = g_malloc ( 1024 * sizeof(gchar) );
     else
     {
       gchar *buffer = g_malloc ( 1024 * sizeof(gchar) );
-      if ( world_file_read_line ( buffer, 1024, f, pass_along[0], TRUE ) && world_file_read_line ( buffer, 1024, f, pass_along[1], TRUE )
-        && world_file_read_line ( buffer, 1024, f, pass_along[0], FALSE ) && world_file_read_line ( buffer, 1024, f, pass_along[0], FALSE )
+      if ( world_file_read_line ( buffer, 1024, f, pass_along[0], TRUE ) && world_file_read_line ( buffer, 1024, f, pass_along[0], FALSE)
+        && world_file_read_line ( buffer, 1024, f, pass_along[0], FALSE ) && world_file_read_line ( buffer, 1024, f, pass_along[1], TRUE)
         && world_file_read_line ( buffer, 1024, f, pass_along[2], TRUE ) && world_file_read_line ( buffer, 1024, f, pass_along[3], TRUE ) )
       {
         g_free ( buffer );
         && world_file_read_line ( buffer, 1024, f, pass_along[2], TRUE ) && world_file_read_line ( buffer, 1024, f, pass_along[3], TRUE ) )
       {
         g_free ( buffer );
@@ -407,18 +405,22 @@ static gboolean georef_layer_dialog ( VikGeorefLayer **vgl, gpointer vp, GtkWind
 
   ce_label = gtk_label_new ( _("Corner pixel easting:") );
   ce_spin = gtk_spin_button_new ( (GtkAdjustment *) gtk_adjustment_new ( 4, 0.0, 1500000.0, 1, 5, 5 ), 1, 4 );
 
   ce_label = gtk_label_new ( _("Corner pixel easting:") );
   ce_spin = gtk_spin_button_new ( (GtkAdjustment *) gtk_adjustment_new ( 4, 0.0, 1500000.0, 1, 5, 5 ), 1, 4 );
+  gtk_widget_set_tooltip_text ( GTK_WIDGET(ce_spin), _("the UTM \"easting\" value of the upper-right corner pixel of the map") );
 
   cn_label = gtk_label_new ( _("Corner pixel northing:") );
   cn_spin = gtk_spin_button_new ( (GtkAdjustment *) gtk_adjustment_new ( 4, 0.0, 9000000.0, 1, 5, 5 ), 1, 4 );
 
   cn_label = gtk_label_new ( _("Corner pixel northing:") );
   cn_spin = gtk_spin_button_new ( (GtkAdjustment *) gtk_adjustment_new ( 4, 0.0, 9000000.0, 1, 5, 5 ), 1, 4 );
+  gtk_widget_set_tooltip_text ( GTK_WIDGET(cn_spin), _("the UTM \"northing\" value of the upper-right corner pixel of the map") );
 
   xlabel = gtk_label_new ( _("X (easting) scale (mpp): "));
   ylabel = gtk_label_new ( _("Y (northing) scale (mpp): "));
 
   xspin = gtk_spin_button_new ( (GtkAdjustment *) gtk_adjustment_new ( 4, VIK_VIEWPORT_MIN_ZOOM, VIK_VIEWPORT_MAX_ZOOM, 1, 5, 5 ), 1, 8 );
 
   xlabel = gtk_label_new ( _("X (easting) scale (mpp): "));
   ylabel = gtk_label_new ( _("Y (northing) scale (mpp): "));
 
   xspin = gtk_spin_button_new ( (GtkAdjustment *) gtk_adjustment_new ( 4, VIK_VIEWPORT_MIN_ZOOM, VIK_VIEWPORT_MAX_ZOOM, 1, 5, 5 ), 1, 8 );
+  gtk_widget_set_tooltip_text ( GTK_WIDGET(xspin), _("the scale of the map in the X direction (meters per pixel)") );
   yspin = gtk_spin_button_new ( (GtkAdjustment *) gtk_adjustment_new ( 4, VIK_VIEWPORT_MIN_ZOOM, VIK_VIEWPORT_MAX_ZOOM, 1, 5, 5 ), 1, 8 );
   yspin = gtk_spin_button_new ( (GtkAdjustment *) gtk_adjustment_new ( 4, VIK_VIEWPORT_MIN_ZOOM, VIK_VIEWPORT_MAX_ZOOM, 1, 5, 5 ), 1, 8 );
+  gtk_widget_set_tooltip_text ( GTK_WIDGET(yspin), _("the scale of the map in the Y direction (meters per pixel)") );
 
   imagelabel = gtk_label_new ( _("Map Image:") );
 
   imagelabel = gtk_label_new ( _("Map Image:") );
-  imageentry = vik_file_entry_new ();
+  imageentry = vik_file_entry_new (GTK_FILE_CHOOSER_ACTION_OPEN);
 
   if (*vgl)
   {
 
   if (*vgl)
   {