]> git.itanic.dy.fi Git - maemo-mapper/commitdiff
* Modified the build system and the code to support OS2008. It has been
authorgnuite <gnuite@gmail.com>
Wed, 28 Nov 2007 22:15:46 +0000 (22:15 +0000)
committergnuite <gnuite@gmail.com>
Wed, 28 Nov 2007 22:15:46 +0000 (22:15 +0000)
    tested only the N800.
  * Fixed a refresh bug that would cause Maemo Mapper to appear to hang under
    high CPU load.
  * Fixed bug in initial display of "Establishing GPS Fix" window.
  * Made a first stab at conditionally updating the track based on HDOP.  This
    will probably change a lot before I get it to "feel" right.  I hope I
    don't have to add a preference - we're running out of Settings space!

git-svn-id: svn+ssh://garage/var/lib/gforge/svnroot/maemo-mapper/trunk@137 6c538b50-5814-0410-93ad-8bdf4c0149d1

17 files changed:
src/cmenu.c
src/dbus-ifc.c
src/defines.h
src/display.c
src/gdk-pixbuf-rotate.c
src/gps.c
src/gpsbt.c
src/gpsbt.h
src/input.c
src/main.c
src/maps.c
src/menu.c
src/path.c
src/poi.c
src/settings.c
src/util.c
src/util.h

index f9adcd0c5d53c2d1b1859f1082d532c84659d68d..42791ae96ee0bdfbda97b17340b840ca6b22a77f 100644 (file)
  * along with Maemo Mapper.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+#    include "config.h"
+#endif
+
 #define _GNU_SOURCE
 
 #include <string.h>
 #include <math.h>
 #include <gtk/gtk.h>
-#include <hildon-widgets/hildon-note.h>
-#include <hildon-widgets/hildon-banner.h>
 
+#ifndef LEGACY
+#    include <hildon/hildon-note.h>
+#    include <hildon/hildon-banner.h>
+#else
+#    include <hildon-widgets/hildon-note.h>
+#    include <hildon-widgets/hildon-banner.h>
+#endif
 
 #include "types.h"
 #include "data.h"
index 2a171641eaf6015e52f8a8aaed853c103bf67ca4..dc68c91c50ca7cec35840597de310bc0addb8e37 100644 (file)
@@ -39,6 +39,8 @@
 #include "display.h"
 #include "dbus-ifc.h"
 
+static DBusConnection *_bus = NULL;
+
 /***********************
  * BELOW: DBUS METHODS *
  ***********************/
@@ -105,7 +107,8 @@ dbus_ifc_handle_set_view_center(GArray *args, osso_rpc_t *retval)
     {
         /* Latitude and/or Longitude are not defined.  Calculate next. */
         Point new_center = map_calc_new_center(svca->new_zoom);
-        unit2latlon(new_center.unitx, new_center.unity, svca->new_lat, svca->new_lon);
+        unit2latlon(new_center.unitx, new_center.unity,
+                svca->new_lat, svca->new_lon);
     }
 
     /* Argument 1: double: latitude. */
@@ -165,112 +168,57 @@ dbus_ifc_controller(const gchar *interface, const gchar *method,
  * BELOW: DBUS SIGNALS *
  ***********************/
 
-static gboolean
-dbus_ifc_view_position_changed_idle(ViewPositionChangedArgs *args)
+void
+dbus_ifc_fire_view_position_changed(
+        Point new_center, gint new_zoom, gdouble new_viewing_angle)
 {
-    DBusConnection *bus = NULL;
-    DBusError error;
     DBusMessage *message = NULL;
-    printf("%s(%f, %f, %d, %f)\n", __PRETTY_FUNCTION__, args->new_lat,
-            args->new_lon, args->new_zoom, args->new_viewing_angle);
+    gdouble new_lat, new_lon;
+    printf("%s(%d, %d, %d, %f)\n", __PRETTY_FUNCTION__, new_center.unitx,
+            new_center.unity, new_zoom, new_viewing_angle);
 
-    dbus_error_init(&error);
+    unit2latlon(new_center.unitx, new_center.unity, new_lat, new_lon);
 
-    if(NULL == (bus = dbus_bus_get(DBUS_BUS_SESSION, &error))
-            || NULL == (message = dbus_message_new_signal(MM_DBUS_PATH,
+    if(NULL == (message = dbus_message_new_signal(MM_DBUS_PATH,
                     MM_DBUS_INTERFACE, MM_DBUS_SIGNAL_VIEW_POSITION_CHANGED))
             || !dbus_message_append_args(message,
-                DBUS_TYPE_DOUBLE, &args->new_lat,
-                DBUS_TYPE_DOUBLE, &args->new_lon,
-                DBUS_TYPE_INT32, &args->new_zoom,
-                DBUS_TYPE_DOUBLE, &args->new_viewing_angle,
+                DBUS_TYPE_DOUBLE, &new_lat,
+                DBUS_TYPE_DOUBLE, &new_lon,
+                DBUS_TYPE_INT32, &new_zoom,
+                DBUS_TYPE_DOUBLE, &new_viewing_angle,
                 DBUS_TYPE_INVALID)
-            || !dbus_connection_send(bus, message, NULL))
+            || !dbus_connection_send(_bus, message, NULL))
     {
-        g_printerr("Error sending view_position_changed signal: %s: %s\n",
-                (dbus_error_is_set(&error)
-                 ? error.name : "<no error message>"),
-                (dbus_error_is_set(&error)
-                 ? error.message : ""));
+        g_printerr("Error sending view_position_changed signal.\n");
     }
 
     if(message)
         dbus_message_unref(message);
-    if(bus)
-        dbus_connection_unref(bus);
-
-    vprintf("%s(): return FALSE\n", __PRETTY_FUNCTION__);
-    return FALSE;
-}
-
-void
-dbus_ifc_fire_view_position_changed(
-        Point new_center, gint new_zoom, gdouble new_viewing_angle)
-{
-    ViewPositionChangedArgs *args;
-    printf("%s(%d, %d, %d, %f)\n", __PRETTY_FUNCTION__, new_center.unitx,
-            new_center.unity, new_zoom, new_viewing_angle);
-
-    args = g_new(ViewPositionChangedArgs, 1);
-    unit2latlon(new_center.unitx, new_center.unity,
-            args->new_lat, args->new_lon);
-    args->new_zoom = new_zoom;
-    args->new_viewing_angle = new_viewing_angle;
-
-    g_idle_add((GSourceFunc)dbus_ifc_view_position_changed_idle, args);
 
     vprintf("%s(): return\n", __PRETTY_FUNCTION__);
 }
 
-static gboolean
-dbus_ifc_view_dimensions_changed_idle(ViewDimensionsChangedArgs *args)
+void
+dbus_ifc_fire_view_dimensions_changed(
+        gint new_view_width_pixels, gint new_view_height_pixels)
 {
-    DBusConnection *bus = NULL;
-    DBusError error;
     DBusMessage *message = NULL;
     printf("%s(%d, %d)\n", __PRETTY_FUNCTION__,
-            args->new_view_width_pixels, args->new_view_height_pixels);
-
-    dbus_error_init(&error);
+            new_view_width_pixels, new_view_height_pixels);
 
-    if(NULL == (bus = dbus_bus_get(DBUS_BUS_SESSION, &error))
-            || NULL == (message = dbus_message_new_signal(MM_DBUS_PATH,
+    if(NULL == (message = dbus_message_new_signal(MM_DBUS_PATH,
                     MM_DBUS_INTERFACE, MM_DBUS_SIGNAL_VIEW_DIMENSIONS_CHANGED))
             || !dbus_message_append_args(message,
-                DBUS_TYPE_INT32, &args->new_view_width_pixels,
-                DBUS_TYPE_INT32, &args->new_view_height_pixels,
+                DBUS_TYPE_INT32, &new_view_width_pixels,
+                DBUS_TYPE_INT32, &new_view_height_pixels,
                 DBUS_TYPE_INVALID)
-            || !dbus_connection_send(bus, message, NULL))
+            || !dbus_connection_send(_bus, message, NULL))
     {
-        g_printerr("Error sending view_dimensions_changed signal: %s: %s\n",
-                (dbus_error_is_set(&error)
-                 ? error.name : "<no error message>"),
-                (dbus_error_is_set(&error)
-                 ? error.message : ""));
+        g_printerr("Error sending view_dimensions_changed signal.\n");
     }
 
     if(message)
         dbus_message_unref(message);
-    if(bus)
-        dbus_connection_unref(bus);
-
-    vprintf("%s(): return FALSE\n", __PRETTY_FUNCTION__);
-    return FALSE;
-}
-
-void
-dbus_ifc_fire_view_dimensions_changed(
-        gint new_view_width_pixels, gint new_view_height_pixels)
-{
-    ViewDimensionsChangedArgs *args;
-    printf("%s(%d, %d)\n", __PRETTY_FUNCTION__,
-            new_view_width_pixels, new_view_height_pixels);
-
-    args = g_new(ViewDimensionsChangedArgs, 1);
-    args->new_view_width_pixels = new_view_width_pixels;
-    args->new_view_height_pixels = new_view_height_pixels;
-
-    g_idle_add((GSourceFunc)dbus_ifc_view_dimensions_changed_idle, args);
 
     vprintf("%s(): return\n", __PRETTY_FUNCTION__);
 }
@@ -282,6 +230,7 @@ dbus_ifc_fire_view_dimensions_changed(
 void
 dbus_ifc_init()
 {
+    DBusError error;
     printf("%s()\n", __PRETTY_FUNCTION__);
 
     if(OSSO_OK != osso_rpc_set_default_cb_f(_osso, dbus_ifc_cb_default, NULL))
@@ -291,5 +240,15 @@ dbus_ifc_init()
                 MM_DBUS_PATH, MM_DBUS_INTERFACE, dbus_ifc_controller, NULL))
         g_printerr("osso_rpc_set_cb_f failed.\n");
 
+    dbus_error_init(&error);
+    if(NULL == (_bus = dbus_bus_get(DBUS_BUS_SESSION, &error)))
+    {
+        g_printerr("Error getting session bus: %s: %s\n",
+                (dbus_error_is_set(&error)
+                 ? error.name : "<no error message>"),
+                (dbus_error_is_set(&error)
+                 ? error.message : ""));
+    }
+
     vprintf("%s(): return\n", __PRETTY_FUNCTION__);
 }
index fc599e150ebfdc4b6be4db014579e67738d88fc3..01caeaed57c423e9e47590d6249f77bcc1ec1b47 100644 (file)
 #define TRACKS_MASK 0x00000001
 #define ROUTES_MASK 0x00000002
 
-#define g_timeout_add(I, F, D) g_timeout_add_full(G_PRIORITY_DEFAULT_IDLE, \
-          (I), (F), (D), NULL)
-
 #define MACRO_BANNER_SHOW_INFO(A, S) { \
     gchar *my_macro_buffer = g_markup_printf_escaped( \
             "<span size='%s'>%s</span>", \
index a8cf699ca9f43953a7293ef3b48fad205fc1ffd7..35b787045e3717b24d8911b0eb440f8f55944f79 100644 (file)
  * along with Maemo Mapper.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+#    include "config.h"
+#endif
 
 #define _GNU_SOURCE
 
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
-#include <osso-helplib.h>
-#include <hildon-widgets/hildon-note.h>
-#include <hildon-widgets/hildon-file-chooser-dialog.h>
-#include <hildon-widgets/hildon-banner.h>
-#include <hildon-widgets/hildon-system-sound.h>
+
+#ifndef LEGACY
+#    include <hildon/hildon-help.h>
+#    include <hildon/hildon-note.h>
+#    include <hildon/hildon-file-chooser-dialog.h>
+#    include <hildon/hildon-banner.h>
+#    include <hildon/hildon-sound.h>
+#else
+#    include <osso-helplib.h>
+#    include <hildon-widgets/hildon-note.h>
+#    include <hildon-widgets/hildon-file-chooser-dialog.h>
+#    include <hildon-widgets/hildon-banner.h>
+#    include <hildon-widgets/hildon-system-sound.h>
+#endif
 
 #include "types.h"
 #include "data.h"
@@ -61,7 +73,7 @@ static GtkWidget *_sdi_use = NULL;
 static GtkWidget *_sdi_fix = NULL;
 static GtkWidget *_sdi_fqu = NULL;
 static GtkWidget *_sdi_msp = NULL;
-static gboolean _redraw_count = 0;
+static gint _redraw_count = 0;
 
 static gint _mark_bufx1 = -1;
 static gint _mark_bufx2 = -1;
@@ -75,6 +87,7 @@ static GdkRectangle _scale_rect = { 0, 0, 0, 0};
 static GdkRectangle _zoom_rect = { 0, 0, 0, 0};
 static gint _dl_errors = 0;
 
+static volatile gint _pending_replaces = 0;
 
 /** Pango stuff. */
 GdkRectangle _comprose_rect = { 0, 0, 0, 0};
@@ -126,7 +139,8 @@ speed_limit(void)
         if(!_speed_excess)
         {
             _speed_excess = TRUE;
-            g_timeout_add(5000, (GSourceFunc)speed_excess, NULL);
+            g_timeout_add_full(G_PRIORITY_HIGH_IDLE,
+                    5000, (GSourceFunc)speed_excess, NULL, NULL);
         }
     }
     else
@@ -1093,7 +1107,13 @@ window_present()
                         " Otherwise, press Cancel to continue."));
 
             if(GTK_RESPONSE_OK == gtk_dialog_run(GTK_DIALOG(confirm)))
+            {
+#ifndef LEGACY
+                hildon_help_show(_osso, HELP_ID_INTRO, 0);
+#else
                 ossohelp_show(_osso, HELP_ID_INTRO, 0);
+#endif
+            }
             gtk_widget_destroy(confirm);
 
             /* Present the settings dialog. */
@@ -1127,7 +1147,8 @@ window_present()
     if(done_here)
     {
         gtk_window_present(GTK_WINDOW(_window));
-        g_timeout_add(250, (GSourceFunc)banner_reset, NULL);
+        g_timeout_add_full(G_PRIORITY_HIGH_IDLE,
+                250, (GSourceFunc)banner_reset, NULL, NULL);
     }
 
     vprintf("%s(): return\n", __PRETTY_FUNCTION__);
@@ -1249,7 +1270,6 @@ map_center_unit_full(Point new_center,
         BOUND(new_center.unity, 0, WORLD_SIZE_UNITS);
 
         mrt = g_slice_new(MapRenderTask);
-        ++_redraw_count;
         mrt->repo = _curr_repo;
         mrt->old_offsetx = _map_offset_devx;
         mrt->old_offsety = _map_offset_devy;
@@ -1259,14 +1279,17 @@ map_center_unit_full(Point new_center,
         mrt->zoom = _next_zoom = zoom;
         mrt->rotate_angle = _next_map_rotate_angle = rotate_angle;
 
+
         gtk_widget_queue_draw_area(
                 _map_widget,
                 _redraw_wait_bounds.x,
                 _redraw_wait_bounds.y,
-                _redraw_wait_bounds.width + (_redraw_count - 1)
-                        * HOURGLASS_SEPARATION,
+                _redraw_wait_bounds.width
+                    + (_redraw_count * HOURGLASS_SEPARATION),
                 _redraw_wait_bounds.height);
 
+        ++_redraw_count;
+
         g_thread_pool_push(_mrt_thread_pool, mrt, NULL);
     }
 
@@ -1427,7 +1450,9 @@ map_download_refresh_idle(MapUpdateTask *mut)
                         TILE_SIZE_PIXELS,
                         TILE_SIZE_PIXELS,
                         &boundx, &boundy, &width, &height);
-            /* Un-multiply the matrix that we used for blitting. */
+            /* Un-multiply the matrix that we used for blitting.  Good thing
+             * we're multiplying by powers of two, or this wouldn't work
+             * consistently... */
             if(zoff)
                 gdk_pixbuf_rotate_matrix_mult_number(
                         _map_rotate_matrix, 1.f / (1 << zoff));
@@ -1522,7 +1547,7 @@ map_replace_pixbuf_idle(MapRenderTask *mrt)
 {
     printf("%s()\n", __PRETTY_FUNCTION__);
 
-    if(!_mouse_is_down
+    if(!--_pending_replaces && !_mouse_is_down
             && mrt->screen_width_pixels == _view_width_pixels
             && mrt->screen_height_pixels == _view_height_pixels)
     {
@@ -1551,8 +1576,6 @@ map_replace_pixbuf_idle(MapRenderTask *mrt)
                 deg2rad(_map_rotate_angle
                     - ROTATE_DIR_ENUM_DEGREES[_rotate_dir]));
 
-        g_slice_free(MapRenderTask, mrt);
-
         --_redraw_count;
 
         _map_offset_devx = 0;
@@ -1560,23 +1583,16 @@ map_replace_pixbuf_idle(MapRenderTask *mrt)
 
         map_set_mark();
         map_force_redraw();
-
     }
     else
     {
         /* Ignore this new pixbuf. We have newer ones coming. */
         g_object_unref(mrt->pixbuf);
-        g_slice_free(MapRenderTask, mrt);
-        gtk_widget_queue_draw_area(
-                _map_widget,
-                _redraw_wait_bounds.x,
-                _redraw_wait_bounds.y,
-                _redraw_wait_bounds.width + (_redraw_count - 1)
-                        * HOURGLASS_SEPARATION,
-                _redraw_wait_bounds.height * _redraw_count);
         --_redraw_count;
     }
 
+    g_slice_free(MapRenderTask, mrt);
+
     vprintf("%s(): return FALSE\n", __PRETTY_FUNCTION__);
     return FALSE;
 }
@@ -1594,7 +1610,7 @@ thread_render_map(MapRenderTask *mrt)
     gfloat *tile_dev;
     ThreadLatch *refresh_latch = NULL;
     gint cache_amount;
-    static gint8 auto_download_batch_id = CHAR_MIN;
+    static gint8 auto_download_batch_id = INT8_MIN;
     printf("%s(%d, %d, %d, %d, %d, %d)\n", __PRETTY_FUNCTION__,
             mrt->screen_width_pixels, mrt->screen_height_pixels,
             mrt->new_center.unitx, mrt->new_center.unity, mrt->zoom,
@@ -1604,13 +1620,6 @@ thread_render_map(MapRenderTask *mrt)
     if(g_thread_pool_unprocessed(_mrt_thread_pool))
     {
         g_slice_free(MapRenderTask, mrt);
-        gtk_widget_queue_draw_area(
-                _map_widget,
-                _redraw_wait_bounds.x,
-                _redraw_wait_bounds.y,
-                _redraw_wait_bounds.width + (_redraw_count - 1)
-                        * HOURGLASS_SEPARATION,
-                _redraw_wait_bounds.height * _redraw_count);
         --_redraw_count;
         vprintf("%s(): return FALSE\n", __PRETTY_FUNCTION__);
         return FALSE;
@@ -1811,7 +1820,9 @@ thread_render_map(MapRenderTask *mrt)
                         TILE_SIZE_PIXELS >> zoff,
                         &boundx, &boundy, &width, &height);
                 g_object_unref(tile_pixbuf);
-                /* Un-multiply the matrix that we used for blitting. */
+                /* Un-multiply the matrix that we used for blitting.  Good
+                 * thing we're multiplying by powers of two, or this wouldn't
+                 * work consistently... */
                 if(zoff)
                     gdk_pixbuf_rotate_matrix_mult_number(
                             matrix, 1.f / (1 << zoff));
@@ -1822,7 +1833,8 @@ thread_render_map(MapRenderTask *mrt)
 
     /* Don't replace the pixbuf unless/until the mouse is released. */
     g_mutex_lock(_mouse_mutex);
-    g_idle_add_full(G_PRIORITY_HIGH_IDLE,
+    ++_pending_replaces;
+    g_idle_add_full(G_PRIORITY_HIGH_IDLE + 20,
             (GSourceFunc)map_replace_pixbuf_idle, mrt, NULL);
     g_mutex_unlock(_mouse_mutex);
 
@@ -2626,8 +2638,8 @@ display_init()
     /* heading_panel_expose() */
     pango_context = gtk_widget_get_pango_context(_map_widget);
     _heading_panel_layout = pango_layout_new(pango_context);
-    pango_font = pango_font_description_new();
-    pango_font_description_set_family(pango_font,"Sans Serif");
+    _heading_panel_fontdesc =  pango_font_description_new();
+    pango_font_description_set_family(_heading_panel_fontdesc, "Sans Serif");
 
     /* draw_sat_details() */
     pango_context = gtk_widget_get_pango_context(_map_widget);
@@ -2656,13 +2668,13 @@ display_init()
     {
         GError *error = NULL;
         gchar *icon_path = "/usr/share/icons/hicolor/scalable/hildon"
-                           "/qgn_list_gene_image_file_wait.png";
+                           "/maemo-mapper-wait.png";
         _redraw_wait_bounds.x = 0;
         _redraw_wait_bounds.y = 0;
         _redraw_wait_icon = gdk_pixbuf_new_from_file(icon_path, &error);
         if(!_redraw_wait_icon || error)
         {
-            printf("Error parsing pixbuf: %s\n",
+            g_printerr("Error parsing pixbuf: %s\n",
                     error ? error->message : icon_path);
             _redraw_wait_bounds.width = 0;
             _redraw_wait_bounds.height = 0;
index 70409dfcccfc9070371d4eced1ef74044cc6171f..99c0e284fcf34bd38931135b2ea199c95cb901e7 100644 (file)
@@ -205,7 +205,7 @@ gdk_pixbuf_rotate_matrix_determinant(const gfloat* matrix)
 }
 
 
-#define ROTATE_CUT_EDGES (0.0) /* cut small part of texel on edges - to avoid artefacts */
+#define ROTATE_CUT_EDGES (0.0) /* cut small part of edges, to avoid artefacts*/
 
 /**
  * gdk_pixbuf_rotate:
index 47abd9f81e8855c04cb20608803194098cfd0ba7..3773d9c24e95851c829a2828bee86c468262f2dc 100644 (file)
--- a/src/gps.c
+++ b/src/gps.c
  * along with Maemo Mapper.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+#    include "config.h"
+#endif
+
 #define _GNU_SOURCE
 
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
-#include <hildon-widgets/hildon-note.h>
-#include <hildon-widgets/hildon-banner.h>
+
 #include <libgnomevfs/gnome-vfs.h>
 #include <libgnomevfs/gnome-vfs-inet-connection.h>
 #include <errno.h>
 
+#ifndef LEGACY
+#    include <hildon/hildon-note.h>
+#    include <hildon/hildon-banner.h>
+#else
+#    include <hildon-widgets/hildon-note.h>
+#    include <hildon-widgets/hildon-banner.h>
+#endif
+
 #include "types.h"
 #include "data.h"
 #include "defines.h"
@@ -44,7 +55,7 @@
 
 static volatile GThread *_gps_thread = NULL;
 static GMutex *_gps_init_mutex = NULL;
-static volatile gint _gps_rcvr_retry_count = 0;
+static gint _gps_rcvr_retry_count = 0;
 
 static gint _gmtoffset = 0;
 
@@ -195,7 +206,7 @@ gps_parse_rmc(gchar *sentence)
     /* Add new data to track. */
     if(_gps_state == RCVR_FIXED)
     {
-        if(track_add(_pos.time, newly_fixed))
+        if(track_add(_pos.time, newly_fixed) || newly_fixed)
         {
             /* Move mark to new location. */
             map_refresh_mark(FALSE);
@@ -229,7 +240,7 @@ gps_parse_gga(gchar *sentence)
                    7 = Manual input mode
                    8 = Simulation mode
      7. Number of satellites being tracked
-     8. Horizontal dilution of position
+     8. Horizontal dilution of precision
      9. Altitude, Meters, above mean sea level
      10. Alt unit (meters)
      11. Height of geoid (mean sea level) above WGS84 ellipsoid
@@ -262,7 +273,7 @@ gps_parse_gga(gchar *sentence)
     /* Skip number of satellites */
     token = strsep(&sentence, DELIM);
 
-    /* Parse Horizontal dilution of position */
+    /* Parse Horizontal dilution of precision */
     token = strsep(&sentence, DELIM);
     if(token && *token)
         MACRO_PARSE_INT(_gps.hdop, token);
@@ -409,7 +420,7 @@ gps_parse_gsv(gchar *sentence)
             if(_gps_state == RCVR_UP)
             {
                 gdouble fraction = running_total * sqrtf(num_sats_used)
-                    / num_sats_used / 100.0;
+                    / num_sats_used / 150.0;
                 BOUND(fraction, 0.0, 1.0);
                 hildon_banner_set_fraction(
                         HILDON_BANNER(_fix_banner), fraction);
@@ -476,6 +487,9 @@ gps_parse_nmea_idle(gchar *nmea)
 
     if(_enable_gps && _gps_state >= RCVR_DOWN)
     {
+        if(_gps_state < RCVR_UP)
+            set_conn_state(RCVR_UP);
+
         if(!strncmp(nmea + 3, "GSV", 3))
         {
             if(_gps_state == RCVR_UP || _gps_info || _satdetails_on)
@@ -735,6 +749,7 @@ thread_read_nmea(GpsRcvrInfo *gri)
                     buf_curr -= (eol - buf + 1);
                 }
             }
+            _gps_rcvr_retry_count = 0;
         }
     }
 
index 4c73d78dadf3cd975423d33866b2d95d730359e6..2a6e69c1cdc468e416d444f273b40be1c3e7183d 100644 (file)
@@ -42,6 +42,10 @@ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WAR
 
 /* $Id:$ */
 
+#ifdef HAVE_CONFIG_H
+#    include "config.h"
+#endif
+
 #define _GNU_SOURCE
 
 #include <errno.h>
@@ -60,6 +64,8 @@ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WAR
 
 #include "gpsbt.h"
 
+#ifdef LEGACY
+
 /* Set following #if to 1 if you want to use automatic bt dev disconnect.
  * This does not seem to work correctly currently (disconnects too fast)
  */
@@ -143,30 +149,30 @@ static int debug_level;
 
 #ifdef DEBUG
 #if (__GNUC__ > 2) && ((__GNUC__ > 3) || (__GNUC_MINOR__ > 2))
-#define PDEBUG(fmt...) do {                                            \
-    if (debug_level) {                                                 \
-      struct timeval tv;                                               \
-      gettimeofday(&tv, 0);                                            \
-      printf("DEBUG[%d]:%ld.%ld:%s:%s():%d: ",                         \
-            getpid(),                                                  \
-            tv.tv_sec, tv.tv_usec,                                     \
-            __FILE__, __FUNCTION__, __LINE__);                         \
-      printf(fmt);                                                     \
-      fflush(stdout);                                                  \
-    }                                                                  \
+#define PDEBUG(fmt...) do {                                                \
+    if (debug_level) {                                                     \
+      struct timeval tv;                                                   \
+      gettimeofday(&tv, 0);                                                \
+      printf("DEBUG[%d]:%ld.%ld:%s:%s():%d: ",                             \
+             getpid(),                                                     \
+             tv.tv_sec, tv.tv_usec,                                        \
+             __FILE__, __FUNCTION__, __LINE__);                            \
+      printf(fmt);                                                         \
+      fflush(stdout);                                                      \
+    }                                                                      \
   }while(0)
 #else
-#define PDEBUG(fmt...) do {                                            \
-    if (debug_level) {                                                 \
-      struct timeval tv;                                               \
-      gettimeofday(&tv, 0);                                            \
-      printf("DEBUG[%d]:%ld.%ld:%s:%s():%d: ",                         \
-            getpid(),                                                  \
-            tv.tv_sec, tv.tv_usec,                                     \
-            __FILE__, __FUNCTION__, __LINE__);                         \
-      printf(##fmt);                                                   \
-      fflush(stdout);                                                  \
-    }                                                                  \
+#define PDEBUG(fmt...) do {                                                \
+    if (debug_level) {                                                     \
+      struct timeval tv;                                                   \
+      gettimeofday(&tv, 0);                                                \
+      printf("DEBUG[%d]:%ld.%ld:%s:%s():%d: ",                             \
+             getpid(),                                                     \
+             tv.tv_sec, tv.tv_usec,                                        \
+             __FILE__, __FUNCTION__, __LINE__);                            \
+      printf(##fmt);                                                       \
+      fflush(stdout);                                                      \
+    }                                                                      \
   }while(0)
 #endif
 #else
@@ -203,9 +209,9 @@ static inline DBusGConnection *get_dbus_gconn(GError **error)
 
 /* ----------------------------------------------------------------------- */
 static int set_error_msg(char *errbuf,
-                        int errbuf_max_len,
-                        char *msg,
-                        ...)
+                         int errbuf_max_len,
+                         char *msg,
+                         ...)
 {
   int st, len;
   va_list args;
@@ -232,13 +238,13 @@ static int set_error_msg(char *errbuf,
 
 /* ----------------------------------------------------------------------- */
 extern int gpsbt_start(char *bda,
-                      int our_debug_level,
-                      int gpsd_debug_level,
-                      short port,
-                      char *error_buf,
-                      int error_buf_max_len,
-                      int timeout_ms,
-                      gpsbt_t *ctx)
+                       int our_debug_level,
+                       int gpsd_debug_level,
+                       short port,
+                       char *error_buf,
+                       int error_buf_max_len,
+                       int timeout_ms,
+                       gpsbt_t *ctx)
 {
   int i, j, k, st, num_bondings = 0,
     bonding_cnt = 0, num_classes = 0, num_rfcomms = 0,
@@ -261,18 +267,18 @@ extern int gpsbt_start(char *bda,
 
 
 #if (__GNUC__ > 2) && ((__GNUC__ > 3) || (__GNUC_MINOR__ > 2))
-#define ERRSTR(fmt, args...)                                   \
-  if (error_buf && error_buf_max_len>0) {                      \
-    set_error_msg(error_buf, error_buf_max_len, fmt, args);    \
-  } else {                                                     \
-    PDEBUG(fmt, args);                                         \
+#define ERRSTR(fmt, args...)                                     \
+  if (error_buf && error_buf_max_len>0) {                        \
+    set_error_msg(error_buf, error_buf_max_len, fmt, args);      \
+  } else {                                                       \
+    PDEBUG(fmt, args);                                           \
   }
 #else
-#define ERRSTR(fmt, args...)                                   \
-  if (error_buf && error_buf_max_len>0) {                      \
-    set_error_msg(error_buf, error_buf_max_len, fmt, ##args);  \
-  } else {                                                     \
-    PDEBUG(fmt, ##args);                                       \
+#define ERRSTR(fmt, args...)                                     \
+  if (error_buf && error_buf_max_len>0) {                        \
+    set_error_msg(error_buf, error_buf_max_len, fmt, ##args);    \
+  } else {                                                       \
+    PDEBUG(fmt, ##args);                                         \
   }
 #endif  
 
@@ -321,15 +327,15 @@ extern int gpsbt_start(char *bda,
   if (st) {
 
     if (st!=2) { /* gpsd is running, value 2 would mean that gpsd is not
-                 * running but we have a lock acquired
-                 */
+                  * running but we have a lock acquired
+                  */
 
       st = gpsmgr_start(gpsd_prog, NULL, gpsd_ctrl_sock,
-                       gpsd_debug_level, port, &ctx->mgr);
+                        gpsd_debug_level, port, &ctx->mgr);
       if (!st) {
-       /* everything is ok */
-       PDEBUG("%s already running, doing nothing\n",gpsd_prog);
-       goto OUT;
+        /* everything is ok */
+        PDEBUG("%s already running, doing nothing\n",gpsd_prog);
+        goto OUT;
       }
 
       PDEBUG("gpsmgr_start() returned %d [%s, %d]\n",st,strerror(errno),errno);
@@ -350,12 +356,12 @@ extern int gpsbt_start(char *bda,
     goto OUT;
   }
 
-#define CHECK_ERROR(s,o,i,m,t)                                         \
-  if (st<0) {                                                          \
-    ERRSTR("Cannot send msg (service=%s, object=%s, interface=%s, "    \
-          "method=%s) [%s]\n", s, o, i, m,                             \
-          error.message ? error.message : "<no error msg>");           \
-    goto OUT;                                                          \
+#define CHECK_ERROR(s,o,i,m,t)                                             \
+  if (st<0) {                                                              \
+    ERRSTR("Cannot send msg (service=%s, object=%s, interface=%s, "        \
+           "method=%s) [%s]\n", s, o, i, m,                                \
+           error.message ? error.message : "<no error msg>");              \
+    goto OUT;                                                              \
   }
 
 
@@ -398,27 +404,27 @@ extern int gpsbt_start(char *bda,
 
         /* Allocate bondings array, note that we DO allocate one extra array
          * element for marking end of array.
-        */
-       bondings = (bonding_t *)realloc(bondings,
-                                       (bonding_cnt+num_bondings+1)*sizeof(bonding_t));
-       if (!bondings) {
-         st = -1;
-         errno = ENOMEM;
-         goto OUT;
-       }
-       bondings[bonding_cnt+num_bondings].bonding=
-         bondings[bonding_cnt+num_bondings].adapter=NULL; /* just in case */
-
-
-       j = 0;
-       while (j<num_bondings && tmp_bondings[j]) {
-         bondings[bonding_cnt].bonding = strdup(tmp_bondings[j]);
-         free(tmp_bondings[j]);
-
-         bondings[bonding_cnt].adapter = adapters[i]; /* no allocation! */
-         
-         PDEBUG("Bondings[%d]=%s (adapter=%s)\n", bonding_cnt,
-                bondings[bonding_cnt].bonding, bondings[bonding_cnt].adapter);
+         */
+        bondings = (bonding_t *)realloc(bondings,
+                (bonding_cnt+num_bondings+1)*sizeof(bonding_t));
+        if (!bondings) {
+          st = -1;
+          errno = ENOMEM;
+          goto OUT;
+        }
+        bondings[bonding_cnt+num_bondings].bonding=
+          bondings[bonding_cnt+num_bondings].adapter=NULL; /* just in case */
+
+
+        j = 0;
+        while (j<num_bondings && tmp_bondings[j]) {
+          bondings[bonding_cnt].bonding = strdup(tmp_bondings[j]);
+          free(tmp_bondings[j]);
+
+          bondings[bonding_cnt].adapter = adapters[i]; /* no allocation! */
+          
+          PDEBUG("Bondings[%d]=%s (adapter=%s)\n", bonding_cnt,
+                 bondings[bonding_cnt].bonding, bondings[bonding_cnt].adapter);
 
           /* Get all remote service classes for this bonding. */
           error = NULL;
@@ -449,7 +455,8 @@ extern int gpsbt_start(char *bda,
               } else {
                 onoff = "OFF";
               }
-              PDEBUG("Addr=%s, Class[%d]=%s (adapter=%s), positioning bit %s\n",
+              PDEBUG("Addr=%s, Class[%d]=%s (adapter=%s), "
+                      "positioning bit %s\n",
                      bondings[bonding_cnt].bonding, k, tmp_classes[k],
                      bondings[bonding_cnt].adapter, onoff);
               free(tmp_classes[k]);
@@ -462,9 +469,9 @@ extern int gpsbt_start(char *bda,
           }
 
           num_classes = 0;
-         bonding_cnt++;
-         j++;
-       }
+          bonding_cnt++;
+          j++;
+        }
       }
 
       free(tmp_bondings);
@@ -478,13 +485,13 @@ extern int gpsbt_start(char *bda,
     if (debug_level) {
       int i=0;
       if (bonding_cnt) {
-       PDEBUG("Bondings [%d]:\n", bonding_cnt);
-       while (bondings[i].bonding && i<bonding_cnt) {
-         PDEBUG("\t%s\n", bondings[i].bonding);
-         i++;
-       }
+        PDEBUG("Bondings [%d]:\n", bonding_cnt);
+        while (bondings[i].bonding && i<bonding_cnt) {
+          PDEBUG("\t%s\n", bondings[i].bonding);
+          i++;
+        }
       } else {
-       PDEBUG("No bondings exists.\n");
+        PDEBUG("No bondings exists.\n");
       }
     }
 #endif
@@ -511,7 +518,8 @@ extern int gpsbt_start(char *bda,
           if (check_device_name(tmp)) {
 
             /* Found a GPS device */
-            posdev = (bonding_t *)realloc(posdev, (num_posdev+1)*sizeof(bonding_t));
+            posdev = (bonding_t *)realloc(posdev,
+                    (num_posdev+1)*sizeof(bonding_t));
             if (!posdev) {
               st = -1;
               errno = ENOMEM;
@@ -525,9 +533,9 @@ extern int gpsbt_start(char *bda,
             PDEBUG("Addr=%s, (adapter=%s), Name=\"%s\"\n",
                    bondings[i].bonding, bondings[i].adapter, tmp);
           }
-       }
+        }
         g_object_unref(proxy);
-       i++;
+        i++;
       }
     }
 
@@ -563,9 +571,9 @@ extern int gpsbt_start(char *bda,
           G_TYPE_STRING, posdev[i].bonding,
           G_TYPE_STRING, spp,
 #ifdef USE_AUTOMATIC_DISCONNECT
-                      G_TYPE_BOOLEAN, TRUE, /* automatic disconnect (does not work, the system disconnects too fast) */
+                       G_TYPE_BOOLEAN, TRUE,
 #else
-                      G_TYPE_BOOLEAN, FALSE, /* no automatic disconnect (this seems to work ok) */
+                       G_TYPE_BOOLEAN, FALSE,
 #endif
           G_TYPE_INVALID,
           G_TYPE_STRING, &tmp,
@@ -581,22 +589,22 @@ extern int gpsbt_start(char *bda,
             "com.nokia.btcond.error.connected")) {
 
       ERROR:
-       ERRSTR("Cannot send msg (service=%s, object=%s, interface=%s, "
-              "method=%s) [%s]\n",
-              BTCOND_DBUS,
-              BTCOND_PATH,
-              BTCOND_INTERFACE,
-              BTCOND_CONNECT,
-              error->message ? error->message : "<no error msg>");
-       continue;
+        ERRSTR("Cannot send msg (service=%s, object=%s, interface=%s, "
+               "method=%s) [%s]\n",
+               BTCOND_DBUS,
+               BTCOND_PATH,
+               BTCOND_INTERFACE,
+               BTCOND_CONNECT,
+               error->message ? error->message : "<no error msg>");
+        continue;
 
       } else if(!tmp || !*tmp) {
 
-       /* hack: rfcommX device name is at the end of error message */
-       char *last_space = strstr(error->message, " rfcomm");
-       if (!last_space) {
-         goto ERROR;
-       }
+        /* hack: rfcommX device name is at the end of error message */
+        char *last_space = strstr(error->message, " rfcomm");
+        if (!last_space) {
+          goto ERROR;
+        }
 
         g_free(tmp);
         tmp = g_strdup_printf("/dev/%s", last_space+1);
@@ -614,7 +622,8 @@ extern int gpsbt_start(char *bda,
       rfcomms[num_rfcomms] = tmp;
       num_rfcomms++;
 
-      PDEBUG("BT addr=%s, RFCOMM %s now exists (adapter=%s)\n", posdev[i].bonding, tmp, posdev[i].adapter);
+      PDEBUG("BT addr=%s, RFCOMM %s now exists (adapter=%s)\n",
+              posdev[i].bonding, tmp, posdev[i].adapter);
 
       tmp = NULL;
     }
@@ -646,10 +655,11 @@ extern int gpsbt_start(char *bda,
 #endif
 
       /* Just start the beast (to be done if everything is ok) */
-      st = gpsmgr_start(gpsd_prog, rfcomms, gpsd_ctrl_sock, gpsd_debug_level, port, &ctx->mgr);
+      st = gpsmgr_start(gpsd_prog, rfcomms, gpsd_ctrl_sock,
+              gpsd_debug_level, port, &ctx->mgr);
       if (!st) {
-       /* everything is ok */
-       goto OUT;
+        /* everything is ok */
+        goto OUT;
       }
     }
   }
@@ -662,8 +672,8 @@ extern int gpsbt_start(char *bda,
   if (posdev) {
     for (i=0; i<num_posdev; i++) {
       if (posdev[i].bonding) {
-       free(posdev[i].bonding);
-       memset(&posdev[i], 0, sizeof(bonding_t)); /* just in case */
+        free(posdev[i].bonding);
+        memset(&posdev[i], 0, sizeof(bonding_t)); /* just in case */
       }
     }
     free(posdev);
@@ -673,8 +683,8 @@ extern int gpsbt_start(char *bda,
   if (bondings) {
     for (i=0; i<num_bondings; i++) {
       if (bondings[i].bonding) {
-       free(bondings[i].bonding);
-       memset(&bondings[i], 0, sizeof(bonding_t)); /* just in case */
+        free(bondings[i].bonding);
+        memset(&bondings[i], 0, sizeof(bonding_t)); /* just in case */
       }
     }
     free(bondings);
@@ -685,8 +695,8 @@ extern int gpsbt_start(char *bda,
   if (rfcomms) {
     for (i=0; i<num_rfcomms; i++) {
       if (rfcomms[i]) {
-       free(rfcomms[i]);
-       rfcomms[i]=0;
+        free(rfcomms[i]);
+        rfcomms[i]=0;
       }
     }
     free(rfcomms);
@@ -737,29 +747,30 @@ extern int gpsbt_stop(gpsbt_t *ctx)
        * we are the only one using the dev.
        */
       if (st>0) {
-       skip_dbus = 1;
-       PDEBUG("Skipping rfcomm device deletion as we are not the only location user\n");
+        skip_dbus = 1;
+        PDEBUG("Skipping rfcomm device deletion as we are "
+                "not the only location user\n");
       }
     }
 
     while (ctx->rfcomms[i]) {
 
       if (!skip_dbus) {
-       /* Disconnect the device */
+        /* Disconnect the device */
         proxy = dbus_g_proxy_new_for_name(bus,
             BTCOND_DBUS, BTCOND_PATH, BTCOND_INTERFACE);
         error = NULL;
         if(!dbus_g_proxy_call(proxy, BTCOND_DISCONNECT, &error,
               G_TYPE_STRING, ctx->rfcomms[i], G_TYPE_INVALID, G_TYPE_INVALID)
             || error){
-         PDEBUG("Cannot send msg (service=%s, object=%s, interface=%s, "
-          "method=%s) [%s]\n",
-                BTCOND_DBUS,
-                BTCOND_PATH,
-                BTCOND_INTERFACE,
-                BTCOND_DISCONNECT,
-                error->message ? error->message : "<no error msg>");
-       }
+          PDEBUG("Cannot send msg (service=%s, object=%s, interface=%s, "
+           "method=%s) [%s]\n",
+                 BTCOND_DBUS,
+                 BTCOND_PATH,
+                 BTCOND_INTERFACE,
+                 BTCOND_DISCONNECT,
+                 error->message ? error->message : "<no error msg>");
+        }
         g_object_unref(proxy);
       }
 
@@ -780,3 +791,4 @@ extern int gpsbt_stop(gpsbt_t *ctx)
   return st;
 }
 
+#endif
index f30d9d4812900c989c9f7042818d7d4b48089349..441add3171b007c5970230dd8d9f6af1794d97e8 100644 (file)
  * along with Maemo Mapper.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifndef LEGACY
+#  include "/usr/include/gpsbt.h"
+#else
+
 /*
 GPS BT management API. The API is used by those applications that
 wish to use services provided by gps daemon i.e., they wish to receive
@@ -56,9 +60,9 @@ THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WAR
 typedef struct {
   gpsmgr_t mgr;
   char **rfcomms; /* what devices where found (null terminated array),
-                  * not used if compiled with USE_AUTOMATIC_DISCONNECT
-                  * (see gpsbt.c for details)
-                  */
+                   * not used if compiled with USE_AUTOMATIC_DISCONNECT
+                   * (see gpsbt.c for details)
+                   */
   int timeout; /* timeout for dbus messages */
 } gpsbt_t;
 
@@ -117,13 +121,13 @@ typedef struct {
  */
 
 extern int gpsbt_start(char *bda,
-                      int debug_level,
-                      int gpsd_debug_level,
-                      short port,
-                      char *error_buf,
-                      int error_buf_max_len,
-                      int timeout_ms,
-                      gpsbt_t *ctx);
+                       int debug_level,
+                       int gpsd_debug_level,
+                       short port,
+                       char *error_buf,
+                       int error_buf_max_len,
+                       int timeout_ms,
+                       gpsbt_t *ctx);
 
 
 /* Stop function stops the gpsd if it was running and nobody
@@ -141,3 +145,5 @@ extern int gpsbt_start(char *bda,
 extern int gpsbt_stop(gpsbt_t *ctx);
 
 #endif /* gpsbt_included */
+
+#endif
index d825ed28169a1750d0495ae3b1957ef3788c5d66..5065df909053936417266fa04ed5e48dec13abc6 100644 (file)
  * along with Maemo Mapper.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+#    include "config.h"
+#endif
+
 #define _GNU_SOURCE
 
 #include <math.h>
 #include <gdk/gdkkeysyms.h>
-#include <hildon-widgets/hildon-defines.h>
-#include <hildon-widgets/hildon-banner.h>
+
+#ifndef LEGACY
+#    include <hildon/hildon-defines.h>
+#    include <hildon/hildon-banner.h>
+#else
+#    include <hildon-widgets/hildon-defines.h>
+#    include <hildon-widgets/hildon-banner.h>
+#endif
 
 #include "types.h"
 #include "data.h"
@@ -234,9 +244,9 @@ window_cb_key_press(GtkWidget* widget, GdkEventKey *event)
                         ;
                 }
                 key_pan_timeout(_action[custom_key]);
-                _key_pan_timeout_sid = g_timeout_add(
+                _key_pan_timeout_sid = g_timeout_add_full(G_PRIORITY_HIGH_IDLE,
                         250, (GSourceFunc)key_pan_timeout,
-                        (gpointer)(_action[custom_key]));
+                        (gpointer)(_action[custom_key]), NULL);
             }
             break;
 
@@ -300,9 +310,9 @@ window_cb_key_press(GtkWidget* widget, GdkEventKey *event)
                             _("Zoom to Level"), _key_zoom_new);
                     MACRO_BANNER_SHOW_INFO(_window, buffer);
                 }
-                _key_zoom_timeout_sid = g_timeout_add(
+                _key_zoom_timeout_sid =g_timeout_add_full(G_PRIORITY_HIGH_IDLE,
                         500, (GSourceFunc)key_zoom_timeout,
-                        (gpointer)(_action[custom_key]));
+                        (gpointer)(_action[custom_key]), NULL);
             }
             break;
 
@@ -447,8 +457,8 @@ window_cb_key_release(GtkWidget* widget, GdkEventKey *event)
             {
                 g_source_remove(_key_zoom_timeout_sid);
                 _key_zoom_timeout_sid = 0;
-                _key_zoom_timeout_sid = g_timeout_add(
-                        500, (GSourceFunc)key_zoom_timeout, NULL);
+                _key_zoom_timeout_sid =g_timeout_add_full(G_PRIORITY_HIGH_IDLE,
+                        500, (GSourceFunc)key_zoom_timeout, NULL, NULL);
             }
             _key_zoom_is_down = FALSE;
             return TRUE;
@@ -464,8 +474,8 @@ window_cb_key_release(GtkWidget* widget, GdkEventKey *event)
             if(_key_pan_timeout_sid)
             {
                 g_source_remove(_key_pan_timeout_sid);
-                _key_pan_timeout_sid = g_timeout_add(
-                        500, (GSourceFunc)key_pan_timeout, NULL);
+                _key_pan_timeout_sid = g_timeout_add_full(G_PRIORITY_HIGH_IDLE,
+                        500, (GSourceFunc)key_pan_timeout, NULL, NULL);
             }
             _key_pan_is_down = FALSE;
             _key_pan_incr_devx = 0;
index 0adc966ccf03c4b9833bbff2b9a75f9e2d5308f3..93ed9c26ebb08d301b48c9e3e6daf577b3be42f2 100644 (file)
 
 #define _GNU_SOURCE
 
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+#    include "config.h"
+#endif
+
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
 #include <dbus/dbus-glib.h>
-#include <hildon-widgets/hildon-program.h>
-#include <hildon-widgets/hildon-banner.h>
+#include <locale.h>
+
 #include <gconf/gconf-client.h>
 #include <device_symbols.h>
 #include <conicconnection.h>
 #include <conicconnectionevent.h>
 
-#include <locale.h>
+#ifndef LEGACY
+#    include <hildon/hildon-program.h>
+#    include <hildon/hildon-banner.h>
+#else
+#    include <hildon-widgets/hildon-program.h>
+#    include <hildon-widgets/hildon-banner.h>
+#endif
 
 #include "types.h"
 #include "data.h"
@@ -277,22 +286,24 @@ maemo_mapper_init(gint argc, gchar **argv)
     CUSTOM_ACTION_ENUM_TEXT[CUSTOM_ACTION_TOGGLE_TRACKS] = _("Toggle Tracks");
     CUSTOM_ACTION_ENUM_TEXT[CUSTOM_ACTION_TOGGLE_SCALE] = _("Toggle Scale");
     CUSTOM_ACTION_ENUM_TEXT[CUSTOM_ACTION_TOGGLE_POI] = _("Toggle POIs");
-    CUSTOM_ACTION_ENUM_TEXT[CUSTOM_ACTION_CHANGE_REPO]= _("Select Next Repository");
+    CUSTOM_ACTION_ENUM_TEXT[CUSTOM_ACTION_CHANGE_REPO]
+        = _("Select Next Repository");
     CUSTOM_ACTION_ENUM_TEXT[CUSTOM_ACTION_ROUTE_DISTNEXT]
         = _("Show Distance to Next Waypoint");
     CUSTOM_ACTION_ENUM_TEXT[CUSTOM_ACTION_ROUTE_DISTLAST]
         = _("Show Distance to End of Route");
-    CUSTOM_ACTION_ENUM_TEXT[CUSTOM_ACTION_TRACK_BREAK] = _("Insert Track Break");
+    CUSTOM_ACTION_ENUM_TEXT[CUSTOM_ACTION_TRACK_BREAK]=_("Insert Track Break");
     CUSTOM_ACTION_ENUM_TEXT[CUSTOM_ACTION_TRACK_CLEAR] = _("Clear Track");
     CUSTOM_ACTION_ENUM_TEXT[CUSTOM_ACTION_TRACK_DISTLAST]
         = _("Show Distance from Last Break");
     CUSTOM_ACTION_ENUM_TEXT[CUSTOM_ACTION_TRACK_DISTFIRST]
         = _("Show Distance from Beginning");
     CUSTOM_ACTION_ENUM_TEXT[CUSTOM_ACTION_TOGGLE_GPS] = _("Toggle GPS");
-    CUSTOM_ACTION_ENUM_TEXT[CUSTOM_ACTION_TOGGLE_GPSINFO] = _("Toggle GPS Info");
+    CUSTOM_ACTION_ENUM_TEXT[CUSTOM_ACTION_TOGGLE_GPSINFO]=_("Toggle GPS Info");
     CUSTOM_ACTION_ENUM_TEXT[CUSTOM_ACTION_TOGGLE_SPEEDLIMIT]
         = _("Toggle Speed Limit");
-    CUSTOM_ACTION_ENUM_TEXT[CUSTOM_ACTION_RESET_BLUETOOTH] = _("Reset Bluetooth");
+    CUSTOM_ACTION_ENUM_TEXT[CUSTOM_ACTION_RESET_BLUETOOTH]
+        = _("Reset Bluetooth");
 
     COLORABLE_GCONF[COLORABLE_MARK] = GCONF_KEY_PREFIX"/color_mark";
     COLORABLE_GCONF[COLORABLE_MARK_VELOCITY]
index fdbe2864fd84744a9f780b5c4076f30bdcaa523e..5ee5c540e161f318beeca8d2c5218d49db95ac03 100644 (file)
@@ -21,6 +21,9 @@
  * along with Maemo Mapper.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+#    include "config.h"
+#endif
 
 #define _GNU_SOURCE
 
 #include <math.h>
 #include <glib/gstdio.h>
 #include <fcntl.h>
-#include <osso-helplib.h>
-#include <hildon-widgets/hildon-note.h>
-#include <hildon-widgets/hildon-file-chooser-dialog.h>
-#include <hildon-widgets/hildon-number-editor.h>
-#include <hildon-widgets/hildon-banner.h>
-#include <hildon-widgets/hildon-input-mode-hint.h>
-
 #include <locale.h>
 
+#ifndef LEGACY
+#    include <hildon/hildon-help.h>
+#    include <hildon/hildon-note.h>
+#    include <hildon/hildon-file-chooser-dialog.h>
+#    include <hildon/hildon-number-editor.h>
+#    include <hildon/hildon-banner.h>
+#else
+#    include <osso-helplib.h>
+#    include <hildon-widgets/hildon-note.h>
+#    include <hildon-widgets/hildon-file-chooser-dialog.h>
+#    include <hildon-widgets/hildon-number-editor.h>
+#    include <hildon-widgets/hildon-banner.h>
+#    include <hildon-widgets/hildon-input-mode-hint.h>
+#endif
+
+
 #include "types.h"
 #include "data.h"
 #include "defines.h"
@@ -1721,7 +1733,11 @@ repoman_dialog()
                 NULL);
 
         /* Enable the help button. */
+#ifndef LEGACY
+        hildon_help_dialog_help_enable(
+#else
         ossohelp_dialog_help_enable(
+#endif
                 GTK_DIALOG(dialog), HELP_ID_REPOMAN, _osso);
 
         /* Reset button. */
@@ -2218,7 +2234,11 @@ mapman_dialog()
                 NULL);
 
         /* Enable the help button. */
+#ifndef LEGACY
+        hildon_help_dialog_help_enable(
+#else
         ossohelp_dialog_help_enable(
+#endif
                 GTK_DIALOG(mapman_info.dialog), HELP_ID_MAPMAN, _osso);
 
         /* Clear button. */
@@ -2377,22 +2397,32 @@ mapman_dialog()
         gtk_entry_set_width_chars(GTK_ENTRY(mapman_info.txt_topleft_lat), 12);
         gtk_entry_set_alignment(GTK_ENTRY(mapman_info.txt_topleft_lat), 1.f);
         g_object_set(G_OBJECT(mapman_info.txt_topleft_lat),
+#ifndef LEGACY
+                "hildon-input-mode",
+                HILDON_GTK_INPUT_MODE_FULL, NULL);
+#else
                 HILDON_INPUT_MODE_HINT,
                 HILDON_INPUT_MODE_HINT_ALPHANUMERICSPECIAL, NULL);
         g_object_set(G_OBJECT(mapman_info.txt_topleft_lat),
                 HILDON_AUTOCAP,
                 FALSE, NULL);
+#endif
         gtk_table_attach(GTK_TABLE(mapman_info.tbl_area),
                 mapman_info.txt_topleft_lon = gtk_entry_new(),
                 2, 3, 3, 4, GTK_FILL, 0, 4, 0);
         gtk_entry_set_width_chars(GTK_ENTRY(mapman_info.txt_topleft_lon), 12);
         gtk_entry_set_alignment(GTK_ENTRY(mapman_info.txt_topleft_lon), 1.f);
         g_object_set(G_OBJECT(mapman_info.txt_topleft_lon),
+#ifndef LEGACY
+                "hildon-input-mode",
+                HILDON_GTK_INPUT_MODE_FULL, NULL);
+#else
                 HILDON_INPUT_MODE_HINT,
                 HILDON_INPUT_MODE_HINT_ALPHANUMERICSPECIAL, NULL);
         g_object_set(G_OBJECT(mapman_info.txt_topleft_lon),
                 HILDON_AUTOCAP,
                 FALSE, NULL);
+#endif
 
         /* Bottom Right. */
         gtk_table_attach(GTK_TABLE(mapman_info.tbl_area),
@@ -2405,22 +2435,32 @@ mapman_dialog()
         gtk_entry_set_width_chars(GTK_ENTRY(mapman_info.txt_botright_lat), 12);
         gtk_entry_set_alignment(GTK_ENTRY(mapman_info.txt_botright_lat), 1.f);
         g_object_set(G_OBJECT(mapman_info.txt_botright_lat),
+#ifndef LEGACY
+                "hildon-input-mode",
+                HILDON_GTK_INPUT_MODE_FULL, NULL);
+#else
                 HILDON_INPUT_MODE_HINT,
                 HILDON_INPUT_MODE_HINT_ALPHANUMERICSPECIAL, NULL);
         g_object_set(G_OBJECT(mapman_info.txt_botright_lat),
                 HILDON_AUTOCAP,
                 FALSE, NULL);
+#endif
         gtk_table_attach(GTK_TABLE(mapman_info.tbl_area),
                 mapman_info.txt_botright_lon = gtk_entry_new(),
                 2, 3, 4, 5, GTK_FILL, 0, 4, 0);
         gtk_entry_set_width_chars(GTK_ENTRY(mapman_info.txt_botright_lat), 12);
         gtk_entry_set_alignment(GTK_ENTRY(mapman_info.txt_botright_lon), 1.f);
         g_object_set(G_OBJECT(mapman_info.txt_botright_lon),
+#ifndef LEGACY
+                "hildon-input-mode",
+                HILDON_GTK_INPUT_MODE_FULL, NULL);
+#else
                 HILDON_INPUT_MODE_HINT,
                 HILDON_INPUT_MODE_HINT_ALPHANUMERICSPECIAL, NULL);
         g_object_set(G_OBJECT(mapman_info.txt_botright_lon),
                 HILDON_AUTOCAP,
                 FALSE, NULL);
+#endif
 
         /* Default action is to download by area. */
         gtk_toggle_button_set_active(
index 5e7141dd1f96aacfd2d989c4e50e569bb987790a..d97b7afd550ac6a0aa496e80293a630c06df1d2c 100644 (file)
  * along with Maemo Mapper.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+#    include "config.h"
+#endif
+
 #define _GNU_SOURCE
 
 #include <math.h>
-#include <osso-helplib.h>
-#include <hildon-widgets/hildon-program.h>
-#include <hildon-widgets/hildon-banner.h>
-#include <hildon-widgets/hildon-input-mode-hint.h>
+
+#ifndef LEGACY
+#    include <hildon/hildon-help.h>
+#    include <hildon/hildon-program.h>
+#    include <hildon/hildon-banner.h>
+#else
+#    include <osso-helplib.h>
+#    include <hildon-widgets/hildon-program.h>
+#    include <hildon-widgets/hildon-banner.h>
+#    include <hildon-widgets/hildon-input-mode-hint.h>
+#endif
 
 #include "types.h"
 #include "data.h"
@@ -794,9 +805,14 @@ menu_cb_view_goto_latlon(GtkMenuItem *item)
                 1, 2, 0, 1, GTK_FILL, 0, 2, 4);
         gtk_entry_set_width_chars(GTK_ENTRY(txt_lat), 16);
         gtk_misc_set_alignment(GTK_MISC(label), 0.0f, 0.5f);
+#ifndef LEGACY
+        g_object_set(G_OBJECT(txt_lat), "hildon-input-mode",
+                HILDON_GTK_INPUT_MODE_FULL, NULL);
+#else
         g_object_set(G_OBJECT(txt_lat), HILDON_AUTOCAP, FALSE, NULL);
         g_object_set(G_OBJECT(txt_lat), HILDON_INPUT_MODE_HINT,
                 HILDON_INPUT_MODE_HINT_ALPHANUMERICSPECIAL, NULL);
+#endif
 
         gtk_table_attach(GTK_TABLE(table),
                 label = gtk_label_new(_("Longitude")),
@@ -808,9 +824,14 @@ menu_cb_view_goto_latlon(GtkMenuItem *item)
                 1, 2, 1, 2, GTK_FILL, 0, 2, 4);
         gtk_entry_set_width_chars(GTK_ENTRY(txt_lon), 16);
         gtk_misc_set_alignment(GTK_MISC(label), 0.0f, 0.5f);
+#ifndef LEGACY
+        g_object_set(G_OBJECT(txt_lon), "hildon-input-mode",
+                HILDON_GTK_INPUT_MODE_FULL, NULL);
+#else
         g_object_set(G_OBJECT(txt_lon), HILDON_AUTOCAP, FALSE, NULL);
         g_object_set(G_OBJECT(txt_lon), HILDON_INPUT_MODE_HINT,
                 HILDON_INPUT_MODE_HINT_ALPHANUMERICSPECIAL, NULL);
+#endif
     }
 
     /* Initialize with the current center position. */
@@ -1138,7 +1159,8 @@ menu_cb_view_ac_lead(GtkMenuItem *item)
 {
     printf("%s()\n", __PRETTY_FUNCTION__);
 
-    if(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(_menu_view_ac_lead_item)))
+    if(gtk_check_menu_item_get_active(
+                GTK_CHECK_MENU_ITEM(_menu_view_ac_lead_item)))
     {
         _center_mode = CENTER_LEAD;
         MACRO_BANNER_SHOW_INFO(_window, _("Auto-Center Mode: Lead"));
@@ -1171,7 +1193,8 @@ menu_cb_view_ac_none(GtkMenuItem *item)
 {
     printf("%s()\n", __PRETTY_FUNCTION__);
 
-    if(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(_menu_view_ac_none_item)))
+    if(gtk_check_menu_item_get_active(
+                GTK_CHECK_MENU_ITEM(_menu_view_ac_none_item)))
     {
         _center_mode = -_center_mode;
         MACRO_BANNER_SHOW_INFO(_window, _("Auto-Center Off"));
@@ -1290,7 +1313,11 @@ menu_cb_help(GtkMenuItem *item)
 {
     printf("%s()\n", __PRETTY_FUNCTION__);
 
+#ifndef LEGACY
+    hildon_help_show(_osso, HELP_ID_INTRO, 0);
+#else
     ossohelp_show(_osso, HELP_ID_INTRO, 0);
+#endif
 
     vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
     return TRUE;
@@ -1301,7 +1328,11 @@ menu_cb_about(GtkMenuItem *item)
 {
     printf("%s()\n", __PRETTY_FUNCTION__);
 
+#ifndef LEGACY
+    hildon_help_show(_osso, HELP_ID_ABOUT, HILDON_HELP_SHOW_DIALOG);
+#else
     ossohelp_show(_osso, HELP_ID_ABOUT, OSSO_HELP_SHOW_DIALOG);
+#endif
 
     vprintf("%s(): return TRUE\n", __PRETTY_FUNCTION__);
     return TRUE;
index bca3a00852d9bb83f3e057e402c036523ea0c4d7..67edeae287b49bbae0f8c5cf36263e3d176898d1 100644 (file)
  * along with Maemo Mapper.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+#    include "config.h"
+#endif
 
 #define _GNU_SOURCE
 
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
-#include <osso-helplib.h>
 #include <bt-dbus.h>
-#include <hildon-widgets/hildon-note.h>
-#include <hildon-widgets/hildon-banner.h>
-#include <hildon-widgets/hildon-system-sound.h>
-#include <hildon-widgets/hildon-input-mode-hint.h>
 #include <sqlite3.h>
 
+#ifndef LEGACY
+#    include <hildon/hildon-help.h>
+#    include <hildon/hildon-note.h>
+#    include <hildon/hildon-banner.h>
+#    include <hildon/hildon-sound.h>
+#else
+#    include <osso-helplib.h>
+#    include <hildon-widgets/hildon-note.h>
+#    include <hildon-widgets/hildon-banner.h>
+#    include <hildon-widgets/hildon-system-sound.h>
+#    include <hildon-widgets/hildon-input-mode-hint.h>
+#endif
+
 #include "types.h"
 #include "data.h"
 #include "defines.h"
@@ -749,13 +760,30 @@ track_add(time_t time, gboolean newly_fixed)
     {
         gboolean moving = FALSE;
         gboolean approaching_waypoint = FALSE;
+        gint xdiff, ydiff, dopcand;
 
         announce_thres_unsquared = (20+_gps.speed) * _announce_notice_ratio*32;
 
-        if(!_track.tail->unity || (_pos.unitx != _track.tail->unitx)
-                || (_pos.unity != _track.tail->unity))
+        if(!_track.tail->unity
+                || ((xdiff = _pos.unitx - _track.tail->unitx), /* comma op */
+                    (ydiff = _pos.unity - _track.tail->unity), /* comma op */
+                    /* Check if xdiff or ydiff are huge. */
+                    ((abs(xdiff) >> 12) || (abs(ydiff) >> 12)
+                    /* Okay, let's see if we've moved enough to justify adding
+                     * to the track.  It depends on our error.  I'd like to
+                     * make the threshold roughly linear with respect to the
+                     * P/HDOP (completely arbitrary, I know), but I also
+                     * want to keep the threshold at a minimum of 2
+                     * zoom-level-4 pixel, and I want dop's of less than 2 to
+                     * also have a 1-pixel threshold.  I also throw in some
+                     * PDOP into the mix, just for fun. */
+                    || ((dopcand = 8 * (_gps.pdop - 6 +(_gps.hdop*_gps.hdop))),
+                        ((xdiff * xdiff) + (ydiff * ydiff)
+                             >= (MAX(2, dopcand) << 8))))))
         {
+            /* We moved enough to actually register a move. */
             ret = TRUE;
+
             /* Update the nearest-waypoint data. */
             if(_route.head != _route.tail
                     && (newly_fixed ? (route_find_nearest_point(), TRUE)
@@ -817,7 +845,7 @@ track_add(time_t time, gboolean newly_fixed)
                     }
                     else
                     {
-                        route_dist_squared_1 = fabsf((slope * _pos.unitx)
+                        route_dist_squared_1 = abs((slope * _pos.unitx)
                             - _pos.unity + (route_y1 - (slope * route_x1)));
                         route_dist_squared_1 =
                             route_dist_squared_1 * route_dist_squared_1
@@ -839,7 +867,7 @@ track_add(time_t time, gboolean newly_fixed)
                     }
                     else
                     {
-                        route_dist_squared_2 = fabsf((slope * _pos.unitx)
+                        route_dist_squared_2 = abs((slope * _pos.unitx)
                             - _pos.unity + (route_y1 - (slope * route_x1)));
                         route_dist_squared_2 =
                             route_dist_squared_2 * route_dist_squared_2
@@ -1136,7 +1164,11 @@ route_download(gchar *to)
                 NULL);
 
         /* Enable the help button. */
+#ifndef LEGACY
+        hildon_help_dialog_help_enable(
+#else
         ossohelp_dialog_help_enable(
+#endif
                 GTK_DIALOG(dialog), HELP_ID_DOWNROUTE, _osso);
 
         gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),
@@ -1190,7 +1222,12 @@ route_download(gchar *to)
                 oti.txt_from = gtk_entry_new(),
                 1, 4, 3, 4, GTK_EXPAND | GTK_FILL, 0, 2, 4);
         gtk_entry_set_width_chars(GTK_ENTRY(oti.txt_from), 25);
+#ifndef LEGACY
+        g_object_set(G_OBJECT(oti.txt_from), "hildon-input-mode",
+                                HILDON_GTK_INPUT_MODE_FULL, NULL);
+#else
         g_object_set(G_OBJECT(oti.txt_from), HILDON_AUTOCAP, FALSE, NULL);
+#endif
 
         /* Destination. */
         gtk_table_attach(GTK_TABLE(table),
@@ -1201,7 +1238,12 @@ route_download(gchar *to)
                 oti.txt_to = gtk_entry_new(),
                 1, 4, 4, 5, GTK_EXPAND | GTK_FILL, 0, 2, 4);
         gtk_entry_set_width_chars(GTK_ENTRY(oti.txt_to), 25);
+#ifndef LEGACY
+        g_object_set(G_OBJECT(oti.txt_to), "hildon-input-mode",
+                                HILDON_GTK_INPUT_MODE_FULL, NULL);
+#else
         g_object_set(G_OBJECT(oti.txt_to), HILDON_AUTOCAP, FALSE, NULL);
+#endif
 
 
         /* Set up auto-completion. */
@@ -1223,7 +1265,7 @@ route_download(gchar *to)
         g_signal_connect(G_OBJECT(oti.rad_use_text), "toggled",
                           G_CALLBACK(origin_type_selected), &oti);
 
-        //gtk_widget_set_sensitive(oti.chk_auto, FALSE);
+        gtk_widget_set_sensitive(oti.chk_auto, FALSE);
     }
 
     /* Initialize fields. */
@@ -1581,7 +1623,8 @@ path_init()
                     "delete from route_way",
                     -1, &_route_stmt_delete_way, NULL)
             || SQLITE_OK != sqlite3_prepare(_path_db,
-                    "insert into route_path (num, unitx, unity, time, altitude) "
+                    "insert into route_path "
+                    "(num, unitx, unity, time, altitude) "
                     "values (NULL, ?, ?, ?, ?)",
                     -1, &_route_stmt_insert_path, NULL)
             || SQLITE_OK != sqlite3_prepare(_path_db,
@@ -1595,7 +1638,8 @@ path_init()
                     "delete from track_way",
                     -1, &_track_stmt_delete_way, NULL)
             || SQLITE_OK != sqlite3_prepare(_path_db,
-                    "insert into track_path (num, unitx, unity, time, altitude) "
+                    "insert into track_path "
+                    "(num, unitx, unity, time, altitude) "
                     "values (NULL, ?, ?, ?, ?)",
                     -1, &_track_stmt_insert_path, NULL)
             || SQLITE_OK != sqlite3_prepare(_path_db,
index 7344fd37b15ea3d1dee3d7eeb4667fb7b62fa443..dfa5decee743cc4d5b14e7e2eaaed4d81144be0b 100644 (file)
--- a/src/poi.c
+++ b/src/poi.c
  * along with Maemo Mapper.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+#    include "config.h"
+#endif
 
 #define _GNU_SOURCE
 
 #include <string.h>
 #include <math.h>
-#include <osso-helplib.h>
-#include <hildon-widgets/hildon-note.h>
-#include <hildon-widgets/hildon-file-chooser-dialog.h>
-#include <hildon-widgets/hildon-number-editor.h>
-#include <hildon-widgets/hildon-banner.h>
-#include <hildon-widgets/hildon-input-mode-hint.h>
+
+#ifndef LEGACY
+#    include <hildon/hildon-help.h>
+#    include <hildon/hildon-note.h>
+#    include <hildon/hildon-file-chooser-dialog.h>
+#    include <hildon/hildon-number-editor.h>
+#    include <hildon/hildon-banner.h>
+#else
+#    include <osso-helplib.h>
+#    include <hildon-widgets/hildon-note.h>
+#    include <hildon-widgets/hildon-file-chooser-dialog.h>
+#    include <hildon-widgets/hildon-number-editor.h>
+#    include <hildon-widgets/hildon-banner.h>
+#    include <hildon-widgets/hildon-input-mode-hint.h>
+#endif
 
 #include <sqlite3.h>
 
@@ -911,7 +923,11 @@ category_list_dialog(GtkWidget *parent)
                 NULL);
 
         /* Enable the help button. */
+#ifndef LEGACY
+        hildon_help_dialog_help_enable(
+#else
         ossohelp_dialog_help_enable(
+#endif
                 GTK_DIALOG(dialog), HELP_ID_POICAT, _osso);
 
         gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area),
@@ -2225,7 +2241,11 @@ poi_list_dialog(GtkWidget *parent, gint unitx, gint unity, GList *poi_list)
         g_object_unref(G_OBJECT(store));
 
         /* Enable the help button. */
+#ifndef LEGACY
+        hildon_help_dialog_help_enable(
+#else
         ossohelp_dialog_help_enable(
+#endif
                 GTK_DIALOG(pli.dialog), HELP_ID_POILIST, _osso);
 
         gtk_container_add(GTK_CONTAINER(GTK_DIALOG(pli.dialog)->action_area),
@@ -2503,7 +2523,11 @@ poi_download_dialog(gint unitx, gint unity)
                 NULL);
 
         /* Enable the help button. */
+#ifndef LEGACY
+        hildon_help_dialog_help_enable(
+#else
         ossohelp_dialog_help_enable(
+#endif
                 GTK_DIALOG(dialog), HELP_ID_DOWNPOI, _osso);
 
         gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),
@@ -2568,7 +2592,12 @@ poi_download_dialog(gint unitx, gint unity)
                 oti.txt_origin = gtk_entry_new(),
                 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 4);
         gtk_entry_set_width_chars(GTK_ENTRY(oti.txt_origin), 25);
+#ifndef LEGACY
+        g_object_set(G_OBJECT(oti.txt_origin), "hildon-input-mode",
+                HILDON_GTK_INPUT_MODE_FULL, NULL);
+#else
         g_object_set(G_OBJECT(oti.txt_origin), HILDON_AUTOCAP, FALSE, NULL);
+#endif
 
         /* Query. */
         gtk_table_attach(GTK_TABLE(table2),
@@ -2579,7 +2608,12 @@ poi_download_dialog(gint unitx, gint unity)
                 oti.txt_query = gtk_entry_new(),
                 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 4);
         gtk_entry_set_width_chars(GTK_ENTRY(oti.txt_query), 25);
+#ifndef LEGACY
+        g_object_set(G_OBJECT(oti.txt_query), "hildon-input-mode",
+                HILDON_GTK_INPUT_MODE_FULL, NULL);
+#else
         g_object_set(G_OBJECT(oti.txt_query), HILDON_AUTOCAP, FALSE, NULL);
+#endif
 
         /* Set up auto-completion. */
         origin_comp = gtk_entry_completion_new();
@@ -2816,7 +2850,11 @@ poi_browse_dialog(gint unitx, gint unity)
                 NULL);
 
         /* Enable the help button. */
+#ifndef LEGACY
+        hildon_help_dialog_help_enable(
+#else
         ossohelp_dialog_help_enable(
+#endif
                 GTK_DIALOG(dialog), HELP_ID_BROWSEPOI, _osso);
 
         gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),
@@ -2871,7 +2909,12 @@ poi_browse_dialog(gint unitx, gint unity)
                 oti.txt_origin = gtk_entry_new(),
                 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, 0, 2, 4);
         gtk_entry_set_width_chars(GTK_ENTRY(oti.txt_origin), 25);
+#ifndef LEGACY
+        g_object_set(G_OBJECT(oti.txt_origin), "hildon-input-mode",
+                HILDON_GTK_INPUT_MODE_FULL, NULL);
+#else
         g_object_set(G_OBJECT(oti.txt_origin), HILDON_AUTOCAP, FALSE, NULL);
+#endif
 
         /* Destination. */
         gtk_table_attach(GTK_TABLE(table2),
@@ -2882,7 +2925,12 @@ poi_browse_dialog(gint unitx, gint unity)
                 oti.txt_query = gtk_entry_new(),
                 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, 0, 2, 4);
         gtk_entry_set_width_chars(GTK_ENTRY(oti.txt_query), 25);
+#ifndef LEGACY
+        g_object_set(G_OBJECT(oti.txt_query), "hildon-input-mode",
+                HILDON_GTK_INPUT_MODE_FULL, NULL);
+#else
         g_object_set(G_OBJECT(oti.txt_query), HILDON_AUTOCAP, FALSE, NULL);
+#endif
 
         /* Set up auto-completion. */
         origin_comp = gtk_entry_completion_new();
index 94383615b72f3af0ba4106482a0f3ef4602409a8..5bac7204b9401c0976902a6a1b646307eac02e88 100644 (file)
  * along with Maemo Mapper.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+#    include "config.h"
+#endif
 
 #define _GNU_SOURCE
 
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
-#include <osso-helplib.h>
 #include <dbus/dbus-glib.h>
 #include <bt-dbus.h>
-#include <hildon-widgets/hildon-note.h>
-#include <hildon-widgets/hildon-color-button.h>
-#include <hildon-widgets/hildon-file-chooser-dialog.h>
-#include <hildon-widgets/hildon-number-editor.h>
-#include <hildon-widgets/hildon-banner.h>
-#include <hildon-widgets/hildon-input-mode-hint.h>
 #include <gconf/gconf-client.h>
 
+#ifndef LEGACY
+#    include <hildon/hildon-help.h>
+#    include <hildon/hildon-note.h>
+#    include <hildon/hildon-color-button.h>
+#    include <hildon/hildon-file-chooser-dialog.h>
+#    include <hildon/hildon-number-editor.h>
+#    include <hildon/hildon-banner.h>
+#else
+#    include <osso-helplib.h>
+#    include <hildon-widgets/hildon-note.h>
+#    include <hildon-widgets/hildon-color-button.h>
+#    include <hildon-widgets/hildon-file-chooser-dialog.h>
+#    include <hildon-widgets/hildon-number-editor.h>
+#    include <hildon-widgets/hildon-banner.h>
+#    include <hildon-widgets/hildon-input-mode-hint.h>
+#endif
+
 #include "types.h"
 #include "data.h"
 #include "defines.h"
@@ -907,6 +920,47 @@ settings_dialog_colors(GtkWidget *widget, GtkWidget *parent)
 
     while(GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog)))
     {
+#ifndef LEGACY
+        hildon_color_button_get_color(
+                HILDON_COLOR_BUTTON(cdi.col[COLORABLE_MARK]), 
+                &_color[COLORABLE_MARK]);
+
+        hildon_color_button_get_color(
+                HILDON_COLOR_BUTTON(cdi.col[COLORABLE_MARK_VELOCITY]), 
+                &_color[COLORABLE_MARK_VELOCITY]);
+
+        hildon_color_button_get_color(
+                HILDON_COLOR_BUTTON(cdi.col[COLORABLE_MARK_OLD]),
+                &_color[COLORABLE_MARK_OLD]);
+
+        hildon_color_button_get_color(
+                HILDON_COLOR_BUTTON(cdi.col[COLORABLE_TRACK]),
+                &_color[COLORABLE_TRACK]);
+
+        hildon_color_button_get_color(
+                HILDON_COLOR_BUTTON(cdi.col[COLORABLE_TRACK_MARK]),
+                &_color[COLORABLE_TRACK_MARK]);
+
+        hildon_color_button_get_color(
+                HILDON_COLOR_BUTTON(cdi.col[COLORABLE_TRACK_BREAK]),
+                &_color[COLORABLE_TRACK_BREAK]);
+
+        hildon_color_button_get_color(
+                HILDON_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE]),
+                &_color[COLORABLE_ROUTE]);
+
+        hildon_color_button_get_color(
+                HILDON_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE_WAY]),
+                &_color[COLORABLE_ROUTE_WAY]);
+
+        hildon_color_button_get_color(
+                HILDON_COLOR_BUTTON(cdi.col[COLORABLE_ROUTE_BREAK]),
+                &_color[COLORABLE_ROUTE_BREAK]);
+
+        hildon_color_button_get_color(
+                HILDON_COLOR_BUTTON(cdi.col[COLORABLE_POI]),
+                &_color[COLORABLE_POI]);
+#else
         GdkColor *color;
 
         color = hildon_color_button_get_color(
@@ -949,6 +1003,8 @@ settings_dialog_colors(GtkWidget *widget, GtkWidget *parent)
                 HILDON_COLOR_BUTTON(cdi.col[COLORABLE_POI]));
         _color[COLORABLE_POI] = *color;
 
+#endif
+        
         update_gcs();
         break;
     }
@@ -1021,7 +1077,11 @@ settings_dialog()
                 NULL);
 
         /* Enable the help button. */
+#ifndef LEGACY
+        hildon_help_dialog_help_enable(
+#else
         ossohelp_dialog_help_enable(
+#endif 
                 GTK_DIALOG(dialog), HELP_ID_SETTINGS, _osso);
 
         gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->action_area),
@@ -1053,7 +1113,12 @@ settings_dialog()
         gtk_box_pack_start(GTK_BOX(hbox),
                 txt_gps_bt_mac = gtk_entry_new(),
                 TRUE, TRUE, 0);
+#ifndef LEGACY
+        g_object_set(G_OBJECT(txt_gps_bt_mac), "hildon-input-mode",
+                HILDON_GTK_INPUT_MODE_FULL, NULL);
+#else
         g_object_set(G_OBJECT(txt_gps_bt_mac), HILDON_AUTOCAP, FALSE, NULL);
+#endif
         gtk_box_pack_start(GTK_BOX(hbox),
                 btn_scan = gtk_button_new_with_label(_("Scan...")),
                 FALSE, FALSE, 0);
@@ -1070,7 +1135,12 @@ settings_dialog()
         gtk_box_pack_start(GTK_BOX(hbox),
                 txt_gps_file_path = gtk_entry_new(),
                 TRUE, TRUE, 0);
+#ifndef LEGACY
+        g_object_set(G_OBJECT(txt_gps_file_path), "hildon-input-mode",
+                HILDON_GTK_INPUT_MODE_FULL, NULL);
+#else
         g_object_set(G_OBJECT(txt_gps_file_path), HILDON_AUTOCAP, FALSE, NULL);
+#endif
         gtk_box_pack_start(GTK_BOX(hbox),
                 btn_browse_gps = gtk_button_new_with_label(_("Browse...")),
                 FALSE, FALSE, 0);
@@ -1087,7 +1157,12 @@ settings_dialog()
         gtk_box_pack_start(GTK_BOX(hbox),
                 txt_gps_gpsd_host = gtk_entry_new(),
                 TRUE, TRUE, 0);
+#ifndef LEGACY
+        g_object_set(G_OBJECT(txt_gps_gpsd_host), "hildon-input-mode",
+                HILDON_GTK_INPUT_MODE_FULL, NULL);
+#else
         g_object_set(G_OBJECT(txt_gps_gpsd_host), HILDON_AUTOCAP, FALSE, NULL);
+#endif
         gtk_box_pack_start(GTK_BOX(hbox),
                 label = gtk_label_new(_("Port")),
                 FALSE, FALSE, 0);
@@ -1325,7 +1400,12 @@ settings_dialog()
         gtk_box_pack_start(GTK_BOX(hbox),
                 txt_poi_db = gtk_entry_new(),
                 TRUE, TRUE, 0);
+#ifndef LEGACY
+        g_object_set(G_OBJECT(txt_poi_db), "hildon-input-mode",
+                HILDON_GTK_INPUT_MODE_FULL, NULL);
+#else
         g_object_set(G_OBJECT(txt_poi_db), HILDON_AUTOCAP, FALSE, NULL);
+#endif
         gtk_box_pack_start(GTK_BOX(hbox),
                 btn_browse_poi = gtk_button_new_with_label(_("Browse...")),
                 FALSE, FALSE, 0);
index ab8b294f6e55066485607feefe7b3f6ae16abe80..e94791496728b3394683b661b43eca8f6bcd21a4 100644 (file)
  * along with Maemo Mapper.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+#    include "config.h"
+#endif
 
 #define _GNU_SOURCE
 
 #include <ctype.h>
 #include <string.h>
 #include <math.h>
-#include <hildon-widgets/hildon-note.h>
+
+#ifndef LEGACY
+#    include <hildon/hildon-note.h>
+#else
+#    include <hildon-widgets/hildon-note.h>
+#endif
 
 #include "types.h"
 #include "data.h"
@@ -228,6 +236,7 @@ calculate_bearing(gdouble lat1, gdouble lon1, gdouble lat2, gdouble lon2)
 void
 force_min_visible_bars(HildonControlbar *control_bar, gint num_bars)
 {
+#ifdef LEGACY
     GValue val;
     printf("%s()\n", __PRETTY_FUNCTION__);
     memset(&val, 0, sizeof(val));
@@ -235,6 +244,7 @@ force_min_visible_bars(HildonControlbar *control_bar, gint num_bars)
     g_value_set_int(&val, num_bars);
     g_object_set_property(G_OBJECT(control_bar), "minimum-visible-bars", &val);
     vprintf("%s(): return\n", __PRETTY_FUNCTION__);
+#endif
 }
 
 gboolean
index ff11f57b2546cf0ce96a262cd57c98bd5c3f44d0..c4c2c7c1a68e5712f4ea00415778b2c0fec0d46a 100644 (file)
  * along with Maemo Mapper.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#ifdef HAVE_CONFIG_H
+#    include "config.h"
+#endif
+
 #ifndef MAEMO_MAPPER_UTIL_H
 #define MAEMO_MAPPER_UTIL_H
 
-#include <hildon-widgets/hildon-controlbar.h>
+#ifndef LEGACY
+#    include <hildon/hildon-controlbar.h>
+#else
+#    include <hildon-widgets/hildon-controlbar.h>
+#endif
 
 void popup_error(GtkWidget *window, const gchar *error);