]> err.no Git - mapper/commitdiff
Fix missing init of read buffer.
authorKaj-Michael Lang <milang@onion.tal.org>
Thu, 7 Jun 2007 21:05:56 +0000 (00:05 +0300)
committerKaj-Michael Lang <milang@onion.tal.org>
Thu, 7 Jun 2007 21:05:56 +0000 (00:05 +0300)
Misc other things.

20 files changed:
src/bt-bluez.c
src/bt-maemo.c
src/bt.h
src/cb.c
src/config.c
src/gps-browse.c
src/gps-nmea-parse.c
src/gps-panels.c
src/gps.h
src/gpx.c
src/map.c
src/map.h
src/mapper-types.h
src/mapper.c
src/poi.h
src/speed-display.c
src/track.c
src/ui-common.c
src/utils.c
src/utils.h

index 843816ef336da44f0e195030e388b5193c0c54c6..8097c6367445cb5131c66c2deea68e85cbaadad4 100644 (file)
@@ -9,6 +9,7 @@
 #include <string.h>
 #include <strings.h>
 #include <stddef.h>
+#include <libintl.h>
 #include <locale.h>
 #include <math.h>
 #include <errno.h>
@@ -16,9 +17,7 @@
 #include <glib/gstdio.h>
 #include <gtk/gtk.h>
 #include <fcntl.h>
-#include <libgnomevfs/gnome-vfs.h>
 #include <gconf/gconf-client.h>
-#include <libxml/parser.h>
 
 #include <sys/socket.h>
 #include <bluetooth/bluetooth.h>
@@ -32,6 +31,7 @@
 #include "utils.h"
 #include "mapper-types.h"
 #include "settings.h"
+#include "ui-common.h"
 
 struct sockaddr_rc _rcvr_addr = { 0 };
 
@@ -88,22 +88,25 @@ static gboolean rcvr_connect_bt()
        r = connect(_fd, (struct sockaddr *)&_rcvr_addr, sizeof(_rcvr_addr));
        e = errno;
 
-/* The socket is non blocking so handle it */
-       if (r != 0 || e != EAGAIN || e != EINPROGRESS || e) {
+       /* The socket is non blocking so handle it */
+       if (r != 0) {
                switch (e) {
                case EAGAIN:
+               case EBUSY:
                case EINPROGRESS:
                case EALREADY:
+                       g_printf("*** Connection in progress... %d %d\n", e, r);
+                       perror("ERROR: ");
                        return TRUE;
-                       break;
+               break;
                default:
                        /* Connection failed.  Disconnect and try again later. */
+                       g_printf("### Connect failed, retrying... %d %d\n", e, r);
                        perror("ERROR: ");
-                       g_printf("Connect failed, retrying... %d %d\n", e, r);
                        rcvr_disconnect();
                        rcvr_connect_later();
                        return FALSE;
-                       break;
+               break;
                }
        }
        return TRUE;
@@ -150,21 +153,20 @@ gboolean rcvr_connect_now()
                        /* Reset GPS read buffer */
                        _gps_read_buf_curr = _gps_read_buf;
                        *_gps_read_buf_curr = '\0';
+                       _gps_read_buf_last = _gps_read_buf + GPS_READ_BUF_SIZE - 1;
 
                        /* Create channel and add watches. */
                        _channel = g_io_channel_unix_new(_fd);
-                       g_io_channel_set_flags(_channel, G_IO_FLAG_NONBLOCK,
-                                              NULL);
-                       _error_sid =
-                           g_io_add_watch_full(_channel, G_PRIORITY_HIGH_IDLE,
-                                               G_IO_ERR | G_IO_HUP,
-                                               channel_cb_error, NULL, NULL);
-                       _connect_sid =
-                           g_io_add_watch_full(_channel, G_PRIORITY_HIGH_IDLE,
-                                               G_IO_OUT, channel_cb_connect,
-                                               NULL, NULL);
+                       g_io_channel_set_encoding(_channel, NULL, NULL);
+                       g_io_channel_set_flags(_channel, G_IO_FLAG_NONBLOCK, NULL);
+                       _error_sid = g_io_add_watch_full(_channel, G_PRIORITY_HIGH_IDLE,
+                                               G_IO_ERR | G_IO_HUP, channel_cb_error, NULL, NULL);
+                       _connect_sid = g_io_add_watch_full(_channel, G_PRIORITY_HIGH_IDLE,
+                                               G_IO_OUT, channel_cb_connect, NULL, NULL);
                        if (*_rcvr_mac != '/') {
                                rcvr_connect_bt();
+                       } else {
+                               g_printf("Using dev node: %s\n", _rcvr_mac);
                        }
                }
 #else
@@ -197,18 +199,16 @@ channel_cb_connect(GIOChannel * src, GIOCondition condition, gpointer data)
        gint error, size = sizeof(error);
        printf("%s(%d)\n", __PRETTY_FUNCTION__, condition);
 
-       if (*_rcvr_mac != '/'
-           && (getsockopt(_fd, SOL_SOCKET, SO_ERROR, &error, &size) || error))
+       if (*_rcvr_mac != '/' && (getsockopt(_fd, SOL_SOCKET, SO_ERROR, &error, &size) || error))
        {
-               printf("%s(): Error connecting to receiver; retrying...\n",
-                      __PRETTY_FUNCTION__);
+               printf("%s(): Error connecting to receiver; retrying...\n", __PRETTY_FUNCTION__);
                /* Try again. */
                rcvr_disconnect();
                rcvr_connect_later();
        } else {
                printf("%s(): Connected to receiver!\n", __PRETTY_FUNCTION__);
                set_conn_state(RCVR_UP);
-               _input_sid = g_io_add_watch_full(_channel, G_PRIORITY_HIGH_IDLE,
+               _input_sid = g_io_add_watch_full(_channel, G_PRIORITY_LOW,
                                                 G_IO_IN | G_IO_PRI,
                                                 channel_cb_input, NULL, NULL);
        }
index d50336ffc0c8648ed492953e0904a80ae766cec4..6a0bb6031fd109e78c432b0b9da7f346f6867ceb 100644 (file)
@@ -113,8 +113,7 @@ void rcvr_connect_fd(gchar * fdpath)
                _error_sid = g_io_add_watch_full(_channel, G_PRIORITY_HIGH_IDLE,
                                                 G_IO_ERR | G_IO_HUP,
                                                 channel_cb_error, NULL, NULL);
-               _connect_sid =
-                   g_io_add_watch_full(_channel, G_PRIORITY_HIGH_IDLE,
+               _connect_sid = g_io_add_watch_full(_channel, G_PRIORITY_HIGH_IDLE,
                                        G_IO_OUT, channel_cb_connect, NULL,
                                        NULL);
        }
index 11072cb92e36e6808cb60e9fee3d28cc8bef5192..6463d9b55bb0cbd1e07e33348f5f38561a95fd31 100644 (file)
--- a/src/bt.h
+++ b/src/bt.h
@@ -6,10 +6,43 @@
 #include "utils.h"
 #include "mapper-types.h"
 
+/** This enumerated type defines the possible connection states. */
+typedef enum {
+    /** The receiver is "off", meaning that either the bluetooth radio is
+     * off or the user has requested not to connect to the GPS receiver.
+     * No gtk_banner is visible. */
+       RCVR_OFF,
+
+    /** The connection with the receiver is down.  A gtk_banner is visible with
+     * the text, "Connecting to GPS receiver". */
+       RCVR_DOWN,
+
+    /** The connection with the receiver is up, but a GPS fix is not available.
+     * A gtk_banner is visible with the text, "(Re-)Establishing GPS fix". */
+       RCVR_UP,
+
+    /** The connection with the receiver is up and a GPS fix IS available.
+     * No gtk_banner is visible. */
+       RCVR_FIXED
+} ConnState;
+
+typedef struct _ScanInfo ScanInfo;
+struct _ScanInfo {
+       GtkWidget *settings_dialog;
+       GtkWidget *txt_rcvr_mac;
+       GtkWidget *scan_dialog;
+       GtkWidget *banner;
+       GtkListStore *store;
+       guint sid;
+};
+
+ConnState _conn_state;
+
 void rcvr_disconnect();
 void rcvr_connect_later();
-
+gint scan_start_search();
 gboolean rcvr_connect_now();
 gboolean scan_bluetooth(GtkWidget * widget, ScanInfo * scan_info);
+gboolean scan_bluetooth_idle(ScanInfo * scan_info);
 
 #endif
index 5fd3ea3fe3b31b5695a238d2a590bcaf5b6e5742..f8bc6d1536d0f399e3e080ab1667c476e27d3678 100644 (file)
--- a/src/cb.c
+++ b/src/cb.c
@@ -598,8 +598,7 @@ gboolean cb_fullscreen(GtkAction * action)
 {
        printf("%s()\n", __PRETTY_FUNCTION__);
 
-       if ((_fullscreen =
-            gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM
+       if ((_fullscreen = gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM
                                            (_menu_fullscreen_item))))
                gtk_window_fullscreen(GTK_WINDOW(_window));
        else
index dcf429e4dbc8404e3e9166503b70f91766fead12..c237a346645d0836888e8706f6edc9694e61195e 100644 (file)
@@ -16,7 +16,6 @@
 #include <libgnomevfs/gnome-vfs.h>
 #include <curl/multi.h>
 #include <gconf/gconf-client.h>
-#include <libxml/parser.h>
 
 #include "utils.h"
 #include "mapper-types.h"
@@ -25,6 +24,7 @@
 #include "db.h"
 #include "poi.h"
 #include "gps.h"
+#include "bt.h"
 #include "ui-common.h"
 #include "settings.h"
 
@@ -57,6 +57,32 @@ void config_update_proxy()
 #endif
 }
 
+static void config_save_track(gchar *config_dir)
+{
+GnomeVFSHandle *handle;
+gchar *track_file;
+track_file = gnome_vfs_uri_make_full_from_relative(config_dir, CONFIG_FILE_TRACK);
+if (GNOME_VFS_OK == gnome_vfs_create(&handle, track_file, GNOME_VFS_OPEN_WRITE,
+                                    FALSE, 0600)) {
+                       write_gpx(&_track, handle);
+                       gnome_vfs_close(handle);
+}
+g_free(track_file);
+}
+
+static void config_save_route(gchar *config_dir)
+{
+GnomeVFSHandle *handle;
+gchar *route_file;
+route_file = gnome_vfs_uri_make_full_from_relative(config_dir, CONFIG_FILE_ROUTE);
+if (GNOME_VFS_OK == gnome_vfs_create(&handle, route_file, GNOME_VFS_OPEN_WRITE,
+                                    FALSE, 0600)) {
+                       write_gpx(&_route, handle);
+                       gnome_vfs_close(handle);
+}
+g_free(route_file);
+}
+
 /**
  * Save all configuration data to GCONF.
  */
@@ -292,37 +318,9 @@ void config_save()
        /* Save Show POI below zoom. */
        gconf_client_set_int(gconf_client, GCONF_KEY_POI_ZOOM, _poi_zoom, NULL);
 
-       /* Save route. */
-       {
-               GnomeVFSHandle *handle;
-               gchar *route_file;
-               route_file =
-                   gnome_vfs_uri_make_full_from_relative(config_dir,
-                                                         CONFIG_FILE_ROUTE);
-               if (GNOME_VFS_OK ==
-                   gnome_vfs_create(&handle, route_file, GNOME_VFS_OPEN_WRITE,
-                                    FALSE, 0600)) {
-                       write_gpx(&_route, handle);
-                       gnome_vfs_close(handle);
-               }
-               g_free(route_file);
-       }
 
-       /* Save track. */
-       {
-               GnomeVFSHandle *handle;
-               gchar *track_file;
-               track_file =
-                   gnome_vfs_uri_make_full_from_relative(config_dir,
-                                                         CONFIG_FILE_TRACK);
-               if (GNOME_VFS_OK ==
-                   gnome_vfs_create(&handle, track_file, GNOME_VFS_OPEN_WRITE,
-                                    FALSE, 0600)) {
-                       write_gpx(&_track, handle);
-                       gnome_vfs_close(handle);
-               }
-               g_free(track_file);
-       }
+       config_save_track(config_dir);
+       config_save_route(config_dir);
 
        gconf_client_clear_cache(gconf_client);
        g_object_unref(gconf_client);
index 7cbf6db524d89c1da9d8526aaa46ba31bcdf67f3..cdf0b930fc61d9d4086b97804defc29af138f17a 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "utils.h"
 #include "mapper-types.h"
+#include "bt.h"
 
 /**
  * Scan for all bluetooth devices.  This method can take a few seconds,
index a81f63769395c1bd60283119066cc3140c7b8c89..fda4ff5147ffcd0e0d6908acbd82f28f7cde0ebf 100644 (file)
 #include "mapper-types.h"
 #include "ui-common.h"
 
+#include "track.h"
+#include "route.h"
+
+#include "settings.h"
+
 gboolean
 channel_cb_error(GIOChannel * src, GIOCondition condition, gpointer data)
 {
@@ -29,7 +34,7 @@ channel_cb_error(GIOChannel * src, GIOCondition condition, gpointer data)
        /* An error has occurred - re-connect(). */
        rcvr_disconnect();
        track_add(0, FALSE);
-       /*   _speed_excess = FALSE; */
+       _speed_excess = FALSE;
 
        if (_conn_state > RCVR_OFF) {
                set_conn_state(RCVR_DOWN);
@@ -146,15 +151,14 @@ void channel_parse_rmc(gchar * sentence)
        } else
                _pos.time = time(NULL);
 
-       /* Translate data into integers. */
-       integerize_data(_vel_offsetx, _vel_offsety, _pos, _gps);
-
-       /* Add new data to track. */
-       if (_conn_state == RCVR_FIXED)
+       /* Add new data to track only if we have a fix */
+       if (_conn_state == RCVR_FIXED) {
+               /* Translate data into integers. */
+               integerize_data(_vel_offsetx, _vel_offsety, _pos, _gps);
                track_add(_pos.time, newly_fixed);
-
-       /* Move mark to new location. */
-       refresh_mark();
+               /* Move mark to new location. */
+               refresh_mark();
+       }
 
        vprintf("%s(): return\n", __PRETTY_FUNCTION__);
 }
@@ -350,9 +354,7 @@ void channel_parse_gsv(gchar * sentence)
                                    running_total * sqrt(num_sats_used)
                                    / num_sats_used / 100.0;
                                BOUND(fraction, 0.0, 1.0);
-                               hildon_banner_set_fraction(HILDON_BANNER
-                                                          (_fix_banner),
-                                                          fraction);
+                               hildon_banner_set_fraction(HILDON_BANNER(_fix_banner), fraction);
                        }
                        running_total = 0;
                        num_sats_used = 0;
@@ -378,6 +380,7 @@ channel_cb_input(GIOChannel * src, GIOCondition condition, gpointer data)
                                                          _gps_read_buf_curr,
                                                          &bytes_read, NULL)) {
                gchar *eol;
+
                _gps_read_buf_curr += bytes_read;
                *_gps_read_buf_curr = '\0';     /* append a \0 so we can read as string */
                while ((eol = strchr(_gps_read_buf, '\n'))) {
@@ -391,35 +394,23 @@ channel_cb_input(GIOChannel * src, GIOCondition condition, gpointer data)
 
                                /* If we're at a \0 (meaning there is no checksum), or if the
                                 * checksum is good, then parse the sentence. */
-                               if (!*sptr
-                                   || csum == strtol(sptr + 1, NULL, 16)) {
+                               if (!*sptr || csum == strtol(sptr + 1, NULL, 16)) {
                                        if (*sptr)
                                                *sptr = '\0';   /* take checksum out of the buffer. */
-                                       if (!strncmp
-                                           (_gps_read_buf + 3, "GSV", 3)) {
+                                       if (!strncmp(_gps_read_buf + 3, "GSV", 3)) {
                                                if (_conn_state == RCVR_UP)
-                                                       channel_parse_gsv
-                                                           (_gps_read_buf + 7);
-                                       } else
-                                           if (!strncmp
-                                               (_gps_read_buf + 3, "RMC", 3))
-                                               channel_parse_rmc(_gps_read_buf
-                                                                 + 7);
-                                       else if (!strncmp
-                                                (_gps_read_buf + 3, "GGA", 3))
-                                               channel_parse_gga(_gps_read_buf
-                                                                 + 7);
-                                       else if (!strncmp
-                                                (_gps_read_buf + 3, "GSA", 3))
-                                               channel_parse_gsa(_gps_read_buf
-                                                                 + 7);
-
-#if 0
+                                                       channel_parse_gsv(_gps_read_buf + 7);
+                                       } else if (!strncmp(_gps_read_buf + 3, "RMC", 3))
+                                               channel_parse_rmc(_gps_read_buf + 7);
+                                       else if (!strncmp(_gps_read_buf + 3, "GGA", 3))
+                                               channel_parse_gga(_gps_read_buf + 7);
+                                       else if (!strncmp(_gps_read_buf + 3, "GSA", 3))
+                                               channel_parse_gsa(_gps_read_buf + 7);
+                                       else g_print("Unknown NMEA: [%s]\n", _gps_read_buf);
                                        if (_gps_info)
                                                gps_display_data();
                                        if (_satdetails_on)
                                                gps_display_details();
-#endif
                                } else {
                                        /* There was a checksum, and it was bad. */
                                        g_printerr
index 35107492e4b966639ff9322911e0685119e87f5f..101d1d07237ba1d126b5be28006ce3b8ef6f3bc1 100644 (file)
@@ -12,6 +12,8 @@
 #include <sys/wait.h>
 #include <glib/gstdio.h>
 #include <gtk/gtk.h>
+#include <libintl.h>
+#include <locale.h>
 
 #include "utils.h"
 #include "gps.h"
@@ -19,7 +21,7 @@
 #include "mapper-types.h"
 #include "ui-common.h"
 
-static void gps_display_data(void)
+void gps_display_data(void)
 {
        gchar *buffer, litbuf[16];
        printf("%s()\n", __PRETTY_FUNCTION__);
@@ -584,7 +586,8 @@ sat_details_panel_expose(GtkWidget * widget, GdkEventExpose * event)
        return TRUE;
 }
 
-static gboolean gps_display_details(void)
+gboolean 
+gps_display_details(void)
 {
        gchar *buffer, litbuf[16];
        printf("%s()\n", __PRETTY_FUNCTION__);
@@ -675,31 +678,31 @@ static gboolean gps_display_details(void)
        else {
                switch (_gps.fixquality) {
                case 1:
-                       buffer = g_strdup_printf(_("SPS"));
+                       buffer = g_strdup(_("SPS"));
                        break;
                case 2:
-                       buffer = g_strdup_printf(_("DGPS"));
+                       buffer = g_strdup(_("DGPS"));
                        break;
                case 3:
-                       buffer = g_strdup_printf(_("PPS"));
+                       buffer = g_strdup(_("PPS"));
                        break;
                case 4:
-                       buffer = g_strdup_printf(_("Real Time Kinematic"));
+                       buffer = g_strdup(_("Real Time Kinematic"));
                        break;
                case 5:
-                       buffer = g_strdup_printf(_("Float RTK"));
+                       buffer = g_strdup(_("Float RTK"));
                        break;
                case 6:
-                       buffer = g_strdup_printf(_("Estimated"));
+                       buffer = g_strdup(_("Estimated"));
                        break;
                case 7:
-                       buffer = g_strdup_printf(_("Manual"));
+                       buffer = g_strdup(_("Manual"));
                        break;
                case 8:
-                       buffer = g_strdup_printf(_("Simulation"));
+                       buffer = g_strdup(_("Simulation"));
                        break;
                default:
-                       buffer = g_strdup_printf(_("none"));
+                       buffer = g_strdup(_("none"));
                        break;
                }
        }
index d69e05f90f57ddf3ccf8983d814798c51e867d81..5dec5c3339fd4559e1e69f902803b759c5a37f15 100644 (file)
--- a/src/gps.h
+++ b/src/gps.h
@@ -47,7 +47,7 @@ struct _GpsSatelliteData {
        guint snr;
 };
 
-#define GPS_READ_BUF_SIZE 256
+#define GPS_READ_BUF_SIZE 1024
 
 /** The file descriptor of our connection with the GPS receiver. */
 gint _fd;
@@ -81,13 +81,8 @@ gint _vel_offsety;
 GpsData _gps;
 GpsSatelliteData _gps_sat[12];
 
-gboolean
-channel_cb_error(GIOChannel * src, GIOCondition condition, gpointer data);
-
-gboolean
-channel_cb_connect(GIOChannel * src, GIOCondition condition, gpointer data);
-
-gboolean
-channel_cb_input(GIOChannel * src, GIOCondition condition, gpointer data);
+gboolean channel_cb_error(GIOChannel * src, GIOCondition condition, gpointer data);
+gboolean channel_cb_connect(GIOChannel * src, GIOCondition condition, gpointer data);
+gboolean channel_cb_input(GIOChannel * src, GIOCondition condition, gpointer data);
 
 #endif
index 9d49cde9c77414ed9f78643a8cdac57a8240dbea..1bb50d5c0f675bb82bcc2dadf805be336173e319 100644 (file)
--- a/src/gpx.c
+++ b/src/gpx.c
@@ -60,13 +60,12 @@ gchar XML_TZONE[7];
 
 void gpx_init(void)
 {
-       time_t time1;
-       struct tm time2;
-       time1 = time(NULL);
-       localtime_r(&time1, &time2);
-       snprintf(XML_TZONE, sizeof(XML_TZONE), "%+03ld:%02ld",
-                (time2.tm_gmtoff / 60 / 60), (time2.tm_gmtoff / 60) % 60);
-       _gmtoffset = time2.tm_gmtoff;
+time_t time1;
+struct tm time2;
+time1 = time(NULL);
+localtime_r(&time1, &time2);
+snprintf(XML_TZONE, sizeof(XML_TZONE), "%+03ld:%02ld",
+        (time2.tm_gmtoff / 60 / 60), (time2.tm_gmtoff / 60) % 60);
 }
 
 gboolean write_gpx(Path * path, GnomeVFSHandle * handle)
index a7c309227552e57f430c7cfb4838f1a77bc65edf..79421899dfabce3f5e938653d3cb40170b35cb9d 100644 (file)
--- a/src/map.c
+++ b/src/map.c
@@ -27,6 +27,7 @@
 #include "map.h"
 #include "route.h"
 #include "gps.h"
+#include "bt.h"
 #include "mapper-types.h"
 #include "ui-common.h"
 #include "settings.h"
@@ -47,7 +48,8 @@ static guint release[2] = { 0, 0 };
 static guint before[2] = { 0, 0 };
 static guint _id = 0;
 
-static _zoom_timeout=0;
+static gint _zoom_timeout_sid=0;
+static gint _map_mode=0;
 
 void map_render_paths();
 void map_force_redraw();
@@ -940,12 +942,14 @@ void map_move_mark()
 
        /* Just queue the old and new draw areas. */
        gtk_widget_queue_draw_area(_map_widget,
-                                  _mark_minx,
-                                  _mark_miny, _mark_width, _mark_height);
+                                  _mark_minx<0 ? 0 : _mark_minx,
+                                  _mark_miny<0 ? 0 : _mark_miny, 
+                                  _mark_width, _mark_height);
        map_set_mark();
        gtk_widget_queue_draw_area(_map_widget,
-                                  _mark_minx,
-                                  _mark_miny, _mark_width, _mark_height);
+                                  _mark_minx<0 ? 0 : _mark_minx,
+                                  _mark_miny<0 ? 0 : _mark_miny, 
+                                  _mark_width, _mark_height);
 
        vprintf("%s(): return\n", __PRETTY_FUNCTION__);
 }
@@ -1118,6 +1122,7 @@ static gboolean map_follow_move(GtkWidget * widget, GdkEventMotion * event)
 
        before[0] = xx;
        before[1] = yy;
+       return FALSE;
 }
 
 gboolean map_key_zoom_timeout()
@@ -1154,13 +1159,123 @@ gboolean map_key_zoom_timeout()
        return TRUE;
 }
 
+void map_scale_draw(GdkEventExpose *event)
+{
+       gdk_rectangle_intersect(&event->area, &_scale_rect, &event->area);
+
+       if (event->area.width && event->area.height) {
+               gdk_draw_rectangle(_map_widget->window,
+                                  _map_widget->style->
+                                  bg_gc[GTK_WIDGET_STATE(_map_widget)],
+                                  TRUE, _scale_rect.x, _scale_rect.y,
+                                  _scale_rect.width,
+                                  _scale_rect.height);
+               gdk_draw_rectangle(_map_widget->window,
+                                  _map_widget->style->
+                                  fg_gc[GTK_WIDGET_STATE(_map_widget)],
+                                  FALSE, _scale_rect.x, _scale_rect.y,
+                                  _scale_rect.width,
+                                  _scale_rect.height);
+
+               /* Now calculate and draw the distance. */
+               {
+                       gchar buffer[16];
+                       gfloat distance;
+                       gfloat lat1, lon1, lat2, lon2;
+                       gint width;
+
+                       unit2latlon(_center.unitx -
+                                   pixel2unit(SCALE_WIDTH / 2 - 4),
+                                   _center.unity, lat1, lon1);
+                       unit2latlon(_center.unitx +
+                                   pixel2unit(SCALE_WIDTH / 2 - 4),
+                                   _center.unity, lat2, lon2);
+                       distance = calculate_distance(lat1, lon1, lat2, lon2) * UNITS_CONVERT[_units];
+
+                       if (distance < 1.f)
+                               snprintf(buffer, sizeof(buffer),
+                                        "%0.2f %s", distance,
+                                        UNITS_TEXT[_units]);
+                       else if (distance < 10.f)
+                               snprintf(buffer, sizeof(buffer),
+                                        "%0.1f %s", distance,
+                                        UNITS_TEXT[_units]);
+                       else
+                               snprintf(buffer, sizeof(buffer),
+                                        "%0.f %s", distance,
+                                        UNITS_TEXT[_units]);
+
+                       pango_layout_set_text(_scale_layout, buffer, -1);
+                       pango_layout_get_pixel_size(_scale_layout, &width, NULL);
+
+                       /* Draw the layout itself. */
+                       gdk_draw_layout(_map_widget->window,
+                                       _map_widget->style->
+                                       fg_gc[GTK_WIDGET_STATE
+                                             (_map_widget)],
+                                       _scale_rect.x +
+                                       (_scale_rect.width - width) / 2,
+                                       _scale_rect.y, _scale_layout);
+
+                       /* Draw little hashes on the ends. */
+                       gdk_draw_line(_map_widget->window,
+                                     _map_widget->style->
+                                     fg_gc[GTK_WIDGET_STATE
+                                           (_map_widget)],
+                                     _scale_rect.x + 4,
+                                     _scale_rect.y +
+                                     _scale_rect.height / 2 - 4,
+                                     _scale_rect.x + 4,
+                                     _scale_rect.y +
+                                     _scale_rect.height / 2 + 4);
+                       gdk_draw_line(_map_widget->window,
+                                     _map_widget->style->
+                                     fg_gc[GTK_WIDGET_STATE
+                                           (_map_widget)],
+                                     _scale_rect.x + 4,
+                                     _scale_rect.y +
+                                     _scale_rect.height / 2,
+                                     _scale_rect.x +
+                                     (_scale_rect.width - width) / 2 -
+                                     4,
+                                     _scale_rect.y +
+                                     _scale_rect.height / 2);
+                       gdk_draw_line(_map_widget->window,
+                                     _map_widget->style->
+                                     fg_gc[GTK_WIDGET_STATE
+                                           (_map_widget)],
+                                     _scale_rect.x +
+                                     _scale_rect.width - 4,
+                                     _scale_rect.y +
+                                     _scale_rect.height / 2 - 4,
+                                     _scale_rect.x +
+                                     _scale_rect.width - 4,
+                                     _scale_rect.y +
+                                     _scale_rect.height / 2 + 4);
+                       gdk_draw_line(_map_widget->window,
+                                     _map_widget->style->
+                                     fg_gc[GTK_WIDGET_STATE
+                                           (_map_widget)],
+                                     _scale_rect.x +
+                                     _scale_rect.width - 4,
+                                     _scale_rect.y +
+                                     _scale_rect.height / 2,
+                                     _scale_rect.x +
+                                     (_scale_rect.width + width) / 2 +
+                                     4,
+                                     _scale_rect.y +
+                                     _scale_rect.height / 2);
+               }
+       }
+}
+
 gboolean map_cb_expose(GtkWidget * widget, GdkEventExpose * event)
 {
        printf("%s(%d, %d, %d, %d)\n", __PRETTY_FUNCTION__,
               event->area.x, event->area.y,
               event->area.width, event->area.height);
 
-       gdk_draw_drawable(_map_widget->window,
+       gdk_draw_drawable(GDK_DRAWABLE(_map_widget->window),
                          _gc[COLORABLE_MARK],
                          _map_pixmap,
                          event->area.x + _offsetx, event->area.y + _offsety,
@@ -1169,118 +1284,8 @@ gboolean map_cb_expose(GtkWidget * widget, GdkEventExpose * event)
        map_draw_mark();
 
        /* Draw scale, if necessary. */
-       if (_show_scale) {
-               gdk_rectangle_intersect(&event->area, &_scale_rect,
-                                       &event->area);
-               if (event->area.width && event->area.height) {
-                       gdk_draw_rectangle(_map_widget->window,
-                                          _map_widget->style->
-                                          bg_gc[GTK_WIDGET_STATE(_map_widget)],
-                                          TRUE, _scale_rect.x, _scale_rect.y,
-                                          _scale_rect.width,
-                                          _scale_rect.height);
-                       gdk_draw_rectangle(_map_widget->window,
-                                          _map_widget->style->
-                                          fg_gc[GTK_WIDGET_STATE(_map_widget)],
-                                          FALSE, _scale_rect.x, _scale_rect.y,
-                                          _scale_rect.width,
-                                          _scale_rect.height);
-
-                       /* Now calculate and draw the distance. */
-                       {
-                               gchar buffer[16];
-                               gfloat distance;
-                               gfloat lat1, lon1, lat2, lon2;
-                               gint width;
-
-                               unit2latlon(_center.unitx -
-                                           pixel2unit(SCALE_WIDTH / 2 - 4),
-                                           _center.unity, lat1, lon1);
-                               unit2latlon(_center.unitx +
-                                           pixel2unit(SCALE_WIDTH / 2 - 4),
-                                           _center.unity, lat2, lon2);
-                               distance =
-                                   calculate_distance(lat1, lon1, lat2, lon2)
-                                   * UNITS_CONVERT[_units];
-
-                               if (distance < 1.f)
-                                       snprintf(buffer, sizeof(buffer),
-                                                "%0.2f %s", distance,
-                                                UNITS_TEXT[_units]);
-                               else if (distance < 10.f)
-                                       snprintf(buffer, sizeof(buffer),
-                                                "%0.1f %s", distance,
-                                                UNITS_TEXT[_units]);
-                               else
-                                       snprintf(buffer, sizeof(buffer),
-                                                "%0.f %s", distance,
-                                                UNITS_TEXT[_units]);
-                               pango_layout_set_text(_scale_layout, buffer,
-                                                     -1);
-
-                               pango_layout_get_pixel_size(_scale_layout,
-                                                           &width, NULL);
-
-                               /* Draw the layout itself. */
-                               gdk_draw_layout(_map_widget->window,
-                                               _map_widget->style->
-                                               fg_gc[GTK_WIDGET_STATE
-                                                     (_map_widget)],
-                                               _scale_rect.x +
-                                               (_scale_rect.width - width) / 2,
-                                               _scale_rect.y, _scale_layout);
-
-                               /* Draw little hashes on the ends. */
-                               gdk_draw_line(_map_widget->window,
-                                             _map_widget->style->
-                                             fg_gc[GTK_WIDGET_STATE
-                                                   (_map_widget)],
-                                             _scale_rect.x + 4,
-                                             _scale_rect.y +
-                                             _scale_rect.height / 2 - 4,
-                                             _scale_rect.x + 4,
-                                             _scale_rect.y +
-                                             _scale_rect.height / 2 + 4);
-                               gdk_draw_line(_map_widget->window,
-                                             _map_widget->style->
-                                             fg_gc[GTK_WIDGET_STATE
-                                                   (_map_widget)],
-                                             _scale_rect.x + 4,
-                                             _scale_rect.y +
-                                             _scale_rect.height / 2,
-                                             _scale_rect.x +
-                                             (_scale_rect.width - width) / 2 -
-                                             4,
-                                             _scale_rect.y +
-                                             _scale_rect.height / 2);
-                               gdk_draw_line(_map_widget->window,
-                                             _map_widget->style->
-                                             fg_gc[GTK_WIDGET_STATE
-                                                   (_map_widget)],
-                                             _scale_rect.x +
-                                             _scale_rect.width - 4,
-                                             _scale_rect.y +
-                                             _scale_rect.height / 2 - 4,
-                                             _scale_rect.x +
-                                             _scale_rect.width - 4,
-                                             _scale_rect.y +
-                                             _scale_rect.height / 2 + 4);
-                               gdk_draw_line(_map_widget->window,
-                                             _map_widget->style->
-                                             fg_gc[GTK_WIDGET_STATE
-                                                   (_map_widget)],
-                                             _scale_rect.x +
-                                             _scale_rect.width - 4,
-                                             _scale_rect.y +
-                                             _scale_rect.height / 2,
-                                             _scale_rect.x +
-                                             (_scale_rect.width + width) / 2 +
-                                             4,
-                                             _scale_rect.y +
-                                             _scale_rect.height / 2);
-                       }
-               }
-       }
+       if (_show_scale)
+               map_scale_draw(event);
 
        vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
        return TRUE;
@@ -1307,13 +1312,22 @@ static gboolean
 map_autozoomer()
 {
 static gfloat z=6.0;
+static gint last=6;
+gint iz;
+
+g_print("AutoZoom\n");
 
-if (_zoom_timeout==0)
+if (_zoom_timeout_sid==0)
        return FALSE;
 
 z=(z+_gps.speed+1)/2;
 if (z>7) z=7.0; else if (z<1) z=1.0;
-map_set_zoom(round(z));
+iz=(gint)roundf(z);
+g_printf("Setting autozoom to: %f %d S:%f\n", z, iz, _gps.speed);
+if (iz>last) iz=last+1; 
+else if (iz<last) iz=last-1;
+last=iz;
+map_set_zoom(iz);
 
 return TRUE;
 }
@@ -1321,16 +1335,24 @@ return TRUE;
 void
 map_set_autozoom(gboolean az)
 {
-if ((az==TRUE) && (_zoom_timeout!=0)) {
-       _zoom_timeout=g_timeout_add(5000, (GSourceFunc) map_autozoomer, NULL);
+if (az==TRUE) {
+       g_print("Enabled autozoom\n");
+       _zoom_timeout_sid=g_timeout_add(5000, (GSourceFunc) map_autozoomer, NULL);
+       return;
+} else {
+       if (_zoom_timeout_sid) {
+               g_source_remove(_zoom_timeout_sid);
+               _zoom_timeout_sid=0;
+       }
+       g_print("Disabled autozoom\n");
        return;
 }
 
-if ((az==FALSE) && (_zoom_timeout!=0)) {
-       _zoom_timeout=0;
-       return;
 }
 
+static void map_draw_route(gint x, gint y)
+{
+       cmenu_route_add_way(x, y);
 }
 
 static void map_draw_track(gint x, gint y)
@@ -1404,8 +1426,13 @@ gboolean map_cb_button_release(GtkWidget * widget, GdkEventButton * event)
                                                       (_menu_ac_none_item),
                                                       TRUE);
 
-               if (TRUE) {
+               switch (_map_mode) {
+               case MAP_MODE_DRAW_TRACK:
                        map_draw_track(event->x, event->y);
+               break;
+               case MAP_MODE_DRAW_ROUTE:
+                       map_draw_route(event->x, event->y);
+               break;
                }
 
                map_center_unit(x2unit((gint) (event->x + 0.5)),
index 1c24ec2c03ac29735bd07542df0dcedec4a443b4..85c26b28a1b3823bb06eeecdf13114264d81c198 100644 (file)
--- a/src/map.h
+++ b/src/map.h
 #include "utils.h"
 #include "mapper-types.h"
 
+typedef enum {
+        MAP_MODE_NORMAL=0,
+       MAP_MODE_DRAW_TRACK=1,
+        MAP_MODE_DRAW_ROUTE=2
+} MapMode;
+
 /** VARIABLES FOR MAINTAINING STATE OF THE CURRENT VIEW. */
 
 /** The "zoom" level defines the resolution of a pixel, from 0 to MAX_ZOOM.
index 6248e225ead4fa3045563b71a8d6638c52394c26..da1593edc055cecf3fd797e3cbdd5654d7b4629f 100644 (file)
@@ -1,3 +1,5 @@
+#include "config.h"
+
 #define _GNU_SOURCE
 
 #include <math.h>
@@ -5,26 +7,6 @@
 #ifndef _MAPPER_TYPES_H
 #define _MAPPER_TYPES_H
 
-/** This enumerated type defines the possible connection states. */
-typedef enum {
-    /** The receiver is "off", meaning that either the bluetooth radio is
-     * off or the user has requested not to connect to the GPS receiver.
-     * No gtk_banner is visible. */
-       RCVR_OFF,
-
-    /** The connection with the receiver is down.  A gtk_banner is visible with
-     * the text, "Connecting to GPS receiver". */
-       RCVR_DOWN,
-
-    /** The connection with the receiver is up, but a GPS fix is not available.
-     * A gtk_banner is visible with the text, "(Re-)Establishing GPS fix". */
-       RCVR_UP,
-
-    /** The connection with the receiver is up and a GPS fix IS available.
-     * No gtk_banner is visible. */
-       RCVR_FIXED
-} ConnState;
-
 /** This enumerated type defines the supported types of repositories. */
 typedef enum {
        REPOTYPE_NONE,          /* No URL set. */
@@ -41,6 +23,7 @@ typedef enum {
 typedef enum {
        CENTER_WAS_LATLON = -2,
        CENTER_WAS_LEAD = -1,
+       CENTER_MANUAL =0,
        CENTER_LEAD = 1,
        CENTER_LATLON = 2
 } CenterMode;
@@ -234,14 +217,6 @@ struct _SaxData {
        GString *chars;
 };
 
-/** Data used during action: add or edit category/poi **/
-typedef struct _DeletePOI DeletePOI;
-struct _DeletePOI {
-       GtkWidget *dialog;
-       gchar *txt_label;
-       guint id;
-};
-
 /** Data regarding a map repository. */
 typedef struct _RepoData RepoData;
 struct _RepoData {
@@ -286,27 +261,6 @@ struct _AutoRouteDownloadData {
        RouteDownloadData rdl_data;
 };
 
-/** Data to describe a POI. */
-typedef struct _PoiInfo PoiInfo;
-struct _PoiInfo {
-       guint poi_id;
-       guint cat_id;
-       gfloat lat;
-       gfloat lon;
-       gchar *label;
-       gchar *desc;
-};
-
-typedef struct _ScanInfo ScanInfo;
-struct _ScanInfo {
-       GtkWidget *settings_dialog;
-       GtkWidget *txt_rcvr_mac;
-       GtkWidget *scan_dialog;
-       GtkWidget *banner;
-       GtkListStore *store;
-       guint sid;
-};
-
 typedef struct _BrowseInfo BrowseInfo;
 struct _BrowseInfo {
        GtkWidget *dialog;
@@ -314,6 +268,5 @@ struct _BrowseInfo {
 };
 
 Point _point_null;
-ConnState _conn_state;
 
 #endif
index 4f60cb67b15e2dfa6dbe9eea0167fce987578599..3cab0bff1ad5d6c94edc9e5aea777c725b66e20b 100644 (file)
@@ -122,6 +122,7 @@ void set_conn_state(ConnState new_conn_state)
        switch (_conn_state = new_conn_state) {
        case RCVR_OFF:
        case RCVR_FIXED:
+#ifdef WITH_HILDON
                if (_connect_banner) {
                        gtk_widget_destroy(_connect_banner);
                        _connect_banner = NULL;
@@ -130,26 +131,35 @@ void set_conn_state(ConnState new_conn_state)
                        gtk_widget_destroy(_fix_banner);
                        _fix_banner = NULL;
                }
+#else
+
+#endif
                break;
        case RCVR_DOWN:
+#ifdef WITH_HILDON
                if (_fix_banner) {
                        gtk_widget_destroy(_fix_banner);
                        _fix_banner = NULL;
                }
                if (!_connect_banner)
-                       _connect_banner =
-                           hildon_banner_show_animation(_window, NULL,
-                                                        _("Searching for GPS receiver"));
+                       _connect_banner = hildon_banner_show_animation(_window, NULL,           
+                                        _("Searching for GPS receiver"));
+#else
+
+#endif
                break;
        case RCVR_UP:
+#ifdef WITH_HILDON
                if (_connect_banner) {
                        gtk_widget_destroy(_connect_banner);
                        _connect_banner = NULL;
                }
                if (!_fix_banner)
-                       _fix_banner =
-                           hildon_banner_show_progress(_window, NULL,
+                       _fix_banner = hildon_banner_show_progress(_window, NULL,
                                                        _("Establishing GPS fix"));
+#else
+
+#endif
                break;
        default:;               /* to quell warning. */
        }
@@ -232,6 +242,41 @@ void set_var_defaults(void)
        _conn_state = RCVR_OFF;
 }
 
+gint mapper_osso_init(void)
+{
+#ifdef WITH_HILDON
+/* Initialize _osso. */
+_osso = osso_initialize("org.tal.mapper", VERSION, TRUE, NULL);
+if (!_osso) {
+       g_printerr("osso_initialize failed.\n");
+       return 1;
+}
+#endif
+return 0;
+}
+
+gint mapper_osso_cb_init(void)
+{
+#ifdef WITH_HILDON
+if (OSSO_OK != osso_rpc_set_default_cb_f(_osso, dbus_cb_default, NULL)) {
+       g_printerr("osso_rpc_set_default_cb_f failed.\n");
+       return 1;
+}
+#endif
+return 0;
+}
+
+void timezone_init(void)
+{
+time_t time1;
+struct tm time2;
+
+time1 = time(NULL);
+localtime_r(&time1, &time2);
+_gmtoffset = time2.tm_gmtoff;
+}
+
+
 gint main(gint argc, gchar * argv[])
 {
        printf("%s()\n", __PRETTY_FUNCTION__);
@@ -243,42 +288,26 @@ gint main(gint argc, gchar * argv[])
        textdomain(GETTEXT_PACKAGE);
 
        g_thread_init(NULL);
+       g_type_init();
 
-#ifdef WITH_HILDON
-       /* Initialize _osso. */
-       _osso = osso_initialize("org.tal.mapper", VERSION, TRUE, NULL);
-       if (!_osso) {
-               g_printerr("osso_initialize failed.\n");
+       if (mapper_osso_init()!=0)
                return 1;
-       }
-#endif
 
        set_var_defaults();
        
+#ifdef WITH_GSTREAMER
        gst_init(&argc, &argv);
+#endif
        gtk_init(&argc, &argv);
-
-       /* Init gconf. */
-       g_type_init();
        gconf_init(argc, argv, NULL);
-
-       /* Init Gnome-VFS. */
        gnome_vfs_init();
-
-       /* Init libcurl. */
        curl_global_init(CURL_GLOBAL_NOTHING);
-
+       timezone_init();
+       gpx_init();
        mapper_init(argc, argv);
-
-#ifdef WITH_HILDON
-       if (OSSO_OK != osso_rpc_set_default_cb_f(_osso, dbus_cb_default, NULL)) {
-               g_printerr("osso_rpc_set_default_cb_f failed.\n");
+       if (mapper_osso_cb_init()!=0)
                return 1;
-       }
-#endif
-
        gtk_main();
-
        mapper_destroy();
 
 #ifdef WITH_HILDON
index bd7d085324e46d2807d5a4c09e8ca176ed0131fa..dfa48b0cfa6bd676892d44386690fc5f5ff17e7a 100644 (file)
--- a/src/poi.h
+++ b/src/poi.h
@@ -64,6 +64,25 @@ struct _PoiData {
        gchar *desc;
 };
 
+/** Data to describe a POI. */
+typedef struct _PoiInfo PoiInfo;
+struct _PoiInfo {
+       guint poi_id;
+       guint cat_id;
+       gfloat lat;
+       gfloat lon;
+       gchar *label;
+       gchar *desc;
+};
+
+/** Data used during action: add or edit category/poi **/
+typedef struct _DeletePOI DeletePOI;
+struct _DeletePOI {
+       GtkWidget *dialog;
+       gchar *txt_label;
+       guint id;
+};
+
 /** POI */
 sqlite3 *_db;
 gchar *_poi_db;
index 597e7a2a4d3024331c64d82aef81a6bf53c689a9..55aa0214a0931b11d2118ee3f02098245534bf11 100644 (file)
@@ -7,17 +7,11 @@
 #include <string.h>
 #include <strings.h>
 #include <stddef.h>
-#include <locale.h>
 #include <math.h>
 #include <errno.h>
-#include <sys/wait.h>
 #include <glib/gstdio.h>
 #include <gtk/gtk.h>
 #include <fcntl.h>
-#include <libgnomevfs/gnome-vfs.h>
-#include <curl/multi.h>
-#include <gconf/gconf-client.h>
-#include <libxml/parser.h>
 #include <libintl.h>
 #include <locale.h>
 
@@ -67,11 +61,9 @@ void speed_limit(void)
 
        buffer = g_strdup_printf("%0.0f", cur_speed);
        pango_layout_set_text(_speed_limit_layout, buffer, -1);
-
        pango_layout_get_pixel_size(_speed_limit_layout, &width, &height);
 
-       gtk_widget_queue_draw_area(_map_widget,
-                                  x - 5, y - 5, width + 5, height + 5);
+       gtk_widget_queue_draw_area(_map_widget, x - 5, y - 5, width + 15, height + 5);
        gdk_window_process_all_updates();
 
        switch (_speed_location) {
index f5cdd66de61981d4fe0eee62365516c327344503..7f609b397d6a7a24491537a84f5c9dd1ad917f94 100644 (file)
@@ -9,6 +9,8 @@
 #include "ui-common.h"
 #include "file.h"
 
+#include "track.h"
+
 void path_resize(Path * path, guint size)
 {
        printf("%s()\n", __PRETTY_FUNCTION__);
index b2287c083018e386eefdb8d284a74b98c8f24d9c..df9101ffcaf7a4f588aa81ef3ee50e84fdd9e77d 100644 (file)
@@ -41,6 +41,7 @@
 
 GtkWidget *_menu_bar;
 GtkWidget *_toolbar;
+GtkWidget *_fix_banner=NULL;
 
 /**
  * Update all GdkGC objects to reflect the current _draw_width.
index 9e96b053e830cd5061f180f067a2689973880976..d1da6550f1e066b4ee32e8ba86ce034d488f52e0 100644 (file)
@@ -22,6 +22,7 @@
 #include "utils.h"
 #include "gps.h"
 #include "mapper-types.h"
+#include "bt.h"
 
 void sound_noise(void)
 {
@@ -52,7 +53,7 @@ void sound_speak(gchar * phrase)
 }
 
 #if 0
-void latlon2unit(gfloat lat, gfloat lon, gint * unitx_, gint * unity_)
+void latlon2unit(gfloat lat, gfloat lon, gint *unitx_, gint *unity_)
 {
        gfloat tmp;
 
@@ -65,7 +66,7 @@ void latlon2unit(gfloat lat, gfloat lon, gint * unitx_, gint * unity_)
            * (logf((1.f + tmp) / (1.f - tmp)) * 0.5f - MERCATOR_TOP);
 }
 
-void unit2latlon(gint unitx, gint unity, gfloat lat, gfloat lon)
+void unit2latlon(gint unitx, gint unity, gfloat *lat, gfloat *lon)
 {
        (lon) = ((unitx) * (360.f / WORLD_SIZE_UNITS)) - 180.f;
        (lat) = (360.f * (atanf(expf(((unity)
@@ -112,6 +113,7 @@ deg_format(DegFormat degformat, gfloat coor, gchar * scoor, gchar neg_char,
                        ((min - (int)min) * 60.0),
                        coor < 0.f ? neg_char : pos_char);
                break;
+       default:;
        }
        vprintf("%s(): return\n", __PRETTY_FUNCTION__);
 }
index f8a860bcc4f9a6e76b66025adc0b40eae733186b..4bd4fec3e62ee07a9a85c9a4b4aceeb9d8379e97 100644 (file)
 #define KEEP_DISPLAY_ON()
 #endif
 
-#define lat_format(A, B) deg_format((A), (B), 'S', 'N')
-#define lon_format(A, B) deg_format((A), (B), 'W', 'E')
+#define lat_format(A, B) deg_format(_degformat,(A), (B), 'S', 'N')
+#define lon_format(A, B) deg_format(_degformat,(A), (B), 'W', 'E')
 
 #define TRACKS_MASK 0x00000001
 #define ROUTES_MASK 0x00000002
@@ -327,8 +327,6 @@ if (_iap_http_proxy_host) {
 #define MACRO_BANNER_SHOW_INFO(A, S) { hildon_banner_show_information(A, NULL, S); }
 #endif
 
-#define GPS_READ_BUF_SIZE 256
-
 #define WRITE_STRING(string) { \
     GnomeVFSResult vfs_result; \
     GnomeVFSFileSize size; \
@@ -348,5 +346,7 @@ if (_iap_http_proxy_host) {
 gint download_comparefunc(const ProgressUpdateInfo * a,
                          const ProgressUpdateInfo * b, gpointer user_data);
 gfloat calculate_distance(gfloat lat1, gfloat lon1, gfloat lat2, gfloat lon2);
+void deg_format(DegFormat degformat, gfloat coor, gchar *scoor, gchar neg_char, gchar pos_char);
+void integerize_data();
 
 #endif