summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjandegr <jandegr@users.noreply.github.com>2018-05-02 10:02:46 +0200
committerGitHub <noreply@github.com>2018-05-02 10:02:46 +0200
commitde4680665398c523dfaa0879c18b0f6e39264d57 (patch)
tree5769f2076e6e041c07ad7fd6fa052ae0b8e5b914
parent53315091a2aa5a4469a743f29516cc1ae78b6b14 (diff)
parenta9f61c26e31eca52b1bf1a444f6283bb26bc2391 (diff)
downloadnavit-Android_gradle.tar.gz
Merge branch 'trunk' into Android_gradleAndroid_gradle
-rw-r--r--.circleci/config.yml2
-rw-r--r--.mailmap35
-rw-r--r--AUTHORS73
-rw-r--r--ci/generate_contributors.sh52
-rw-r--r--ci/publish.sh29
-rw-r--r--ci/setup_android.sh2
-rw-r--r--ci/setup_common_requirements.sh2
-rw-r--r--navit/android.c78
-rw-r--r--navit/android/res/layout/ua_com_vassiliev_filebrowser_layout.xml166
-rw-r--r--navit/android/src/org/navitproject/navit/FileBrowserActivity.java860
-rw-r--r--navit/android/src/org/navitproject/navit/Navit.java1818
-rw-r--r--navit/android/src/org/navitproject/navit/NavitAddressSearchActivity.java770
-rwxr-xr-xnavit/android/src/org/navitproject/navit/NavitAppConfig.java141
-rw-r--r--navit/android/src/org/navitproject/navit/NavitDialogs.java12
-rw-r--r--navit/android/src/org/navitproject/navit/NavitDownloadSelectMapActivity.java476
-rw-r--r--navit/android/src/org/navitproject/navit/NavitGraphics.java127
-rw-r--r--navit/android/src/org/navitproject/navit/NavitMap.java8
-rw-r--r--navit/android/src/org/navitproject/navit/NavitMapDownloader.java1420
-rw-r--r--navit/android/src/org/navitproject/navit/NavitSpeech2.java7
-rw-r--r--navit/android/src/org/navitproject/navit/NavitTextTranslations.java408
-rw-r--r--navit/android/src/org/navitproject/navit/NavitVehicle.java3
-rw-r--r--navit/attr.c24
-rw-r--r--navit/autoload/osso/osso.c8
-rw-r--r--navit/binding/dbus/binding_dbus.c68
-rw-r--r--navit/binding/python/config.c2
-rw-r--r--navit/binding/python/navit.c8
-rw-r--r--navit/binding/python/pcoord.c2
-rw-r--r--navit/binding/win32/binding_win32.c20
-rw-r--r--navit/bookmarks.c12
-rw-r--r--navit/cache.c44
-rw-r--r--navit/callback.c10
-rw-r--r--navit/command.c80
-rw-r--r--navit/config_.c8
-rw-r--r--navit/coord.c32
-rw-r--r--navit/debug.c20
-rw-r--r--navit/event.c6
-rw-r--r--navit/file.c28
-rw-r--r--navit/font/freetype/font_freetype.c16
-rw-r--r--navit/geom.c43
-rw-r--r--navit/graphics.c92
-rw-r--r--navit/graphics/android/graphics_android.c116
-rw-r--r--navit/graphics/cocoa/graphics_cocoa.m42
-rw-r--r--navit/graphics/egl/graphics_egl.c4
-rw-r--r--navit/graphics/gd/graphics_gd.c42
-rw-r--r--navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c30
-rw-r--r--navit/graphics/null/graphics_null.c20
-rw-r--r--navit/graphics/opengl/graphics_opengl.c32
-rw-r--r--navit/graphics/opengl/graphics_opengl_egl.c10
-rw-r--r--navit/graphics/opengl/graphics_opengl_x11.c18
-rw-r--r--navit/graphics/qt5/QNavitQuick.cpp30
-rw-r--r--navit/graphics/qt5/QNavitWidget.cpp22
-rw-r--r--navit/graphics/qt5/event_qt5.cpp26
-rw-r--r--navit/graphics/qt5/graphics_qt5.cpp102
-rw-r--r--navit/graphics/qt_qpainter/RenderArea.cpp12
-rw-r--r--navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp28
-rw-r--r--navit/graphics/sdl/event.c32
-rw-r--r--navit/graphics/sdl/event_sdl.c30
-rw-r--r--navit/graphics/sdl/graphics_sdl.c108
-rw-r--r--navit/graphics/win32/graphics_win32.c68
-rw-r--r--navit/gui.c6
-rw-r--r--navit/gui/gtk/datawindow.c2
-rw-r--r--navit/gui/gtk/destination.c16
-rw-r--r--navit/gui/gtk/gui_gtk_action.c8
-rw-r--r--navit/gui/gtk/gui_gtk_poi.c40
-rw-r--r--navit/gui/gtk/gui_gtk_window.c10
-rw-r--r--navit/gui/internal/gui_internal.c88
-rw-r--r--navit/gui/internal/gui_internal_bookmark.c6
-rw-r--r--navit/gui/internal/gui_internal_command.c58
-rw-r--r--navit/gui/internal/gui_internal_gesture.c14
-rw-r--r--navit/gui/internal/gui_internal_html.c16
-rw-r--r--navit/gui/internal/gui_internal_keyboard.c8
-rw-r--r--navit/gui/internal/gui_internal_menu.c6
-rw-r--r--navit/gui/internal/gui_internal_poi.c14
-rw-r--r--navit/gui/internal/gui_internal_search.c26
-rw-r--r--navit/gui/internal/gui_internal_widget.c4
-rw-r--r--navit/gui/qml/bookmarksProxy.h4
-rw-r--r--navit/gui/qml/gui_qml.cpp10
-rw-r--r--navit/gui/qml/ngqpoint.h2
-rw-r--r--navit/gui/qml/proxy.h2
-rw-r--r--navit/gui/qml/routeProxy.h2
-rw-r--r--navit/gui/qml/searchProxy.h6
-rw-r--r--navit/gui/qml/skins/navit/ButtonIcon.qml78
-rw-r--r--navit/gui/qml/skins/navit/PageSettingsRules.qml72
-rw-r--r--navit/gui/qt5_qml/backend.cpp58
-rw-r--r--navit/gui/qt5_qml/gui_qt5_qml.cpp30
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.chevron.down.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.chevron.up.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.cog.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.cogs.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.fullscreen.box.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.home.variant.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.information.circle.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.layer.delete.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.layer.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.location.checkin.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.map.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.power.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.rocket.svg2
-rw-r--r--navit/gui/qt5_qml/skins/icons/appbar.transit.car.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.book.list.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.chevron.down.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.chevron.up.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.city.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.cog.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.cogs.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.fullscreen.box.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.home.variant.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.information.circle.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.layer.delete.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.layer.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.location.checkin.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.location.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.map.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.power.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.rocket.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.timer.rewind.svg2
-rw-r--r--navit/gui/qt5_qml/skins/modern/icons/appbar.transit.car.svg2
-rw-r--r--navit/gui/win32/ceglue.c154
-rw-r--r--navit/gui/win32/ceglue.h32
-rw-r--r--navit/gui/win32/gui_win32.c6
-rw-r--r--navit/gui/win32/win32_gui_destination.c6
-rw-r--r--navit/icons/gui_layers.svg64
-rw-r--r--navit/item.c6
-rw-r--r--navit/layout.c10
-rw-r--r--navit/linguistics.c4
-rw-r--r--navit/log.c12
-rw-r--r--navit/main.c4
-rw-r--r--navit/map.c12
-rw-r--r--navit/map/binfile/binfile.c184
-rw-r--r--navit/map/csv/csv.c42
-rw-r--r--navit/map/csv/quadtree.c26
-rw-r--r--navit/map/filter/filter.c10
-rw-r--r--navit/map/garmin/garmin.c11
-rw-r--r--navit/map/mg/block.c27
-rw-r--r--navit/map/mg/map.c36
-rw-r--r--navit/map/mg/poly.c6
-rw-r--r--navit/map/mg/street.c125
-rw-r--r--navit/map/mg/town.c19
-rw-r--r--navit/map/mg/tree.c52
-rw-r--r--navit/map/shapefile/shapefile.c26
-rw-r--r--navit/map/textfile/textfile.c46
-rw-r--r--navit/maps.c8
-rw-r--r--navit/mapset.c2
-rw-r--r--navit/maptool/boundaries.c31
-rw-r--r--navit/maptool/ch.c15
-rw-r--r--navit/maptool/coastline.c141
-rw-r--r--navit/maptool/itembin.c14
-rw-r--r--navit/maptool/osm.c18
-rw-r--r--navit/maptool/osm_protobuf.c73
-rw-r--r--navit/maptool/osm_protobufdb.c81
-rw-r--r--navit/maptool/tile.c12
-rw-r--r--navit/navigation.c185
-rw-r--r--navit/navit.c170
-rw-r--r--navit/osd.c34
-rw-r--r--navit/osd/core/osd_core.c56
-rw-r--r--navit/plugin.c24
-rw-r--r--navit/plugin/j1850/j1850.c38
-rw-r--r--navit/plugin/pedestrian/pedestrian.c140
-rw-r--r--navit/popup.c12
-rw-r--r--navit/profile_option.c2
-rw-r--r--navit/projection.c8
-rw-r--r--navit/route.c175
-rw-r--r--navit/script.c10
-rw-r--r--navit/script/download_index.html290
-rw-r--r--navit/script/mapextract.php450
-rw-r--r--navit/search.c52
-rw-r--r--navit/search_houseno_interpol.c20
-rw-r--r--navit/speech.c16
-rw-r--r--navit/speech/android/speech_android.c14
-rw-r--r--navit/speech/cmdline/speech_cmdline.c23
-rw-r--r--navit/speech/espeak/speak.c30
-rw-r--r--navit/speech/iphone/speech_iphone.m8
-rw-r--r--navit/speech/qt5_espeak/Qt5EspeakAudioOut.cpp14
-rwxr-xr-xnavit/speech/qt5_espeak/qt5_espeak.cpp32
-rw-r--r--navit/start_apple.m4
-rw-r--r--navit/start_real.c16
-rwxr-xr-xnavit/support/espeak/espeak-data/voices/!v/m736
-rw-r--r--navit/support/libc/stat.c8
-rw-r--r--navit/support/win32/X11/XF86keysym.h378
-rw-r--r--navit/support/win32/addwinsock.c16
-rw-r--r--navit/support/win32/addwinsock.h16
-rw-r--r--navit/support/win32/serial_io.c16
-rw-r--r--navit/support/wordexp/glob.c6
-rw-r--r--navit/support/xgetopt/XGetopt.c432
-rw-r--r--navit/support/xgetopt/XGetopt.h58
-rw-r--r--navit/tools/latlon2bookmark/latlon2bookmark.c280
-rw-r--r--navit/track.c58
-rw-r--r--navit/transform.c46
-rw-r--r--navit/util.c20
-rw-r--r--navit/vehicle.c24
-rw-r--r--navit/vehicle/android/vehicle_android.c24
-rw-r--r--navit/vehicle/demo/vehicle_demo.c24
-rw-r--r--navit/vehicle/file/vehicle_file.c70
-rw-r--r--navit/vehicle/gpsd/vehicle_gpsd.c38
-rw-r--r--navit/vehicle/gpsd_dbus/vehicle_gpsd_dbus.c10
-rw-r--r--navit/vehicle/gypsy/vehicle_gypsy.c12
-rw-r--r--navit/vehicle/iphone/vehicle_iphone.c8
-rw-r--r--navit/vehicle/maemo/vehicle_maemo.c76
-rw-r--r--navit/vehicle/null/vehicle_null.c26
-rw-r--r--navit/vehicle/qt5/vehicle_qt5.cpp40
-rw-r--r--navit/vehicle/webos/bluetooth.c161
-rw-r--r--navit/vehicle/webos/vehicle_webos.c32
-rw-r--r--navit/vehicle/wince/vehicle_wince.c76
-rw-r--r--navit/vehicleprofile.c16
-rw-r--r--navit/xmlconfig.c70
-rw-r--r--po/af.po.in2
-rw-r--r--po/ar.po.in2
-rw-r--r--po/ast.po.in2
-rw-r--r--po/be.po.in2
-rw-r--r--po/bg.po.in2
-rw-r--r--po/bs.po.in2
-rw-r--r--po/ca.po.in2
-rw-r--r--po/ckb.po.in2
-rw-r--r--po/cs.po.in4
-rw-r--r--po/cy.po.in2
-rw-r--r--po/da.po.in2
-rw-r--r--po/de.po.in1001
-rw-r--r--po/de_CH.po.in2
-rw-r--r--po/el.po.in2
-rw-r--r--po/en.po.in7
-rw-r--r--po/en_AU.po.in7
-rw-r--r--po/en_CA.po.in7
-rw-r--r--po/en_GB.po.in9
-rw-r--r--po/eo.po.in2
-rw-r--r--po/es.po.in990
-rw-r--r--po/et.po.in2
-rw-r--r--po/eu.po.in2
-rw-r--r--po/fa.po.in2
-rw-r--r--po/fi.po.in2
-rw-r--r--po/fil.po.in2
-rw-r--r--po/fo.po.in2
-rw-r--r--po/fr.po.in4
-rw-r--r--po/fr_CH.po.in2
-rw-r--r--po/fy.po.in2
-rw-r--r--po/gl.po.in2
-rw-r--r--po/he.po.in2
-rw-r--r--po/hi.po.in2
-rw-r--r--po/hr.po.in2
-rw-r--r--po/hu.po.in2
-rw-r--r--po/id.po.in2
-rw-r--r--po/it.po.in4
-rw-r--r--po/ja.po.in2
-rw-r--r--po/jv.po.in2
-rw-r--r--po/kk.po.in2
-rw-r--r--po/kn.po.in2
-rw-r--r--po/ko.po.in2
-rw-r--r--po/ku.po.in2
-rw-r--r--po/lb.po.in2
-rw-r--r--po/lt.po.in4
-rw-r--r--po/lv.po.in4
-rw-r--r--po/mk.po.in2
-rw-r--r--po/ml.po.in2
-rw-r--r--po/mn.po.in2
-rw-r--r--po/mr.po.in2
-rw-r--r--po/nb.po.in2
-rw-r--r--po/nds.po.in2
-rw-r--r--po/nl.po.in4
-rw-r--r--po/nn.po.in2
-rw-r--r--po/pl.po.in2
-rw-r--r--po/pms.po.in2
-rw-r--r--po/pt.po.in4
-rw-r--r--po/pt_BR.po.in4
-rw-r--r--po/ro.po.in2
-rw-r--r--po/ru.po.in2
-rw-r--r--po/sc.po.in2
-rw-r--r--po/si.po.in2
-rw-r--r--po/sk.po.in2
-rw-r--r--po/sl.po.in2
-rw-r--r--po/sq.po.in2
-rw-r--r--po/sr.po.in4
-rw-r--r--po/sv.po.in2
-rw-r--r--po/sw.po.in2
-rw-r--r--po/ta.po.in2
-rw-r--r--po/te.po.in2
-rw-r--r--po/th.po.in2
-rw-r--r--po/tr.po.in2
-rw-r--r--po/uk.po.in2
-rw-r--r--po/ur.po.in2
-rw-r--r--po/vi.po.in2
-rw-r--r--po/zh_CN.po.in2
-rw-r--r--po/zh_HK.po.in2
-rw-r--r--po/zh_TW.po.in2
282 files changed, 7698 insertions, 8132 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
index 1c718e93e..991ebefdc 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -15,7 +15,7 @@ jobs:
name: Setup requirements
command: |
bash ci/setup_common_requirements.sh
- apt-get install -y libpng12-dev librsvg2-bin libfreetype6-dev libdbus-glib-1-dev libgtk2.0-dev curl
+ apt-get install -y libpng12-dev libfreetype6-dev libdbus-glib-1-dev libgtk2.0-dev curl
- run:
name: Build for Linux
command: bash ci/build_linux.sh
diff --git a/.mailmap b/.mailmap
new file mode 100644
index 000000000..1f3ba9b08
--- /dev/null
+++ b/.mailmap
@@ -0,0 +1,35 @@
+Cedric Paille <cedricpaille@gmail.com> Cedric PAILLE <cedricpaille@gmail.com>
+Charles Curley <charlescurley@users.noreply.github.com> Charles Curley <charlescurley@charlescurley.com>
+gauthier60 <gauthier60@ffa7fe5e-494d-0410-b361-a75ebd5db220> Gauthier60 <Gauthier60@ffa7fe5e-494d-0410-b361-a75ebd5db220>
+Joseph Herlant <aerostitch@users.noreply.github.com> Joseph Herlant <herlantj@gmail.com>
+Marc Capdeville <mcapdeville@users.noreply.github.com> Marc CAPDEVILLE <marc@icrea-technologies.fr>
+Marc Capdeville <mcapdeville@users.noreply.github.com> mcapdeville <m.capdeville@no-log.org>
+Patrick Höhn <hoehnp@users.noreply.github.com> Patrick Höhn <hoehnp@gmx.de>
+Pierre Grandin <pgrandin@users.noreply.github.com> Pierre GRANDIN <pgrandin@users.noreply.github.com>
+Pierre Grandin <pgrandin@users.noreply.github.com> Pierre GRANDIN <grandinp@altern.org>
+Pierre Grandin <pgrandin@users.noreply.github.com> Pierre Grandin <grandinp@altern.org>
+Pierre Grandin <pgrandin@users.noreply.github.com> Pierre Grandin <grandinp@gmail.com>
+Pierre Grandin <pgrandin@users.noreply.github.com> kazer_ <kazer_@ffa7fe5e-494d-0410-b361-a75ebd5db220>
+Sebastian Leske <sebastian.leske@sleske.name> Sebastian Leske <Sebastian.Leske@sleske.name>
+Sebastian Leske <sebastian.leske@sleske.name> sleske <sleske@ffa7fe5e-494d-0410-b361-a75ebd5db220>
+Stefan Wildemann <metalstrolch@users.noreply.github.com> Stefan Wildemann <gta04@metalstrolche.de>
+Stefan Wildemann <metalstrolch@users.noreply.github.com> Stefan Wildemann <metalstrolch@metalstrolche.de>
+Stefan Wildemann <metalstrolch@users.noreply.github.com> Stefan Wildemann <stefan.wildemann@metalstrolche.de>
+Stefan Wildemann <metalstrolch@users.noreply.github.com> Wildemann Stefan <stefan.wildemann@corpuls.com>
+Michael Dankov <mdankov@users.noreply.github.com> Michael Dankov <tryagain@navit-project.org>
+Michael Dankov <mdankov@users.noreply.github.com> mdankov <mdankov@ffa7fe5e-494d-0410-b361-a75ebd5db220>
+Michael Dankov <mdankov@users.noreply.github.com> mdankov <mdankov@users.noreply.github.com>
+youte62 <jeremylheureux@gmail.com> youte62 <jeremylheureux@gmailcom>
+Johan Fitié <jfitie@users.noreply.github.com> Johan Fitié <jfitie@gmail.com>
+jandegr <jandegr@users.noreply.github.com> jandegr <jandegr1@hotmail.com>
+jkoan <jkoan@users.noreply.github.com> jkoan <jkoan@gmx.de>
+mvglasow <mvglasow@users.noreply.github.com> mvglasow <michael -at- vonglasow.com>
+mvglasow <mvglasow@users.noreply.github.com> mvglasow <michael@vonglasow.com>
+mvglasow <mvglasow@users.noreply.github.com> mvglasow <mvglasow@ffa7fe5e-494d-0410-b361-a75ebd5db220>
+Manuel Hohmann <xenos1984@users.noreply.github.com> xenos1984 <xenos1984@ffa7fe5e-494d-0410-b361-a75ebd5db220>
+Manuel Hohmann <xenos1984@users.noreply.github.com> xenos1984 <mhohmann@physnet.uni-hamburg.de>
+Rikky <Rikky@ffa7fe5e-494d-0410-b361-a75ebd5db220> rikky <rikky@ffa7fe5e-494d-0410-b361-a75ebd5db220>
+Robert Pohlink <pohlinkzei@users.noreply.github.com> Robert Pohlink <pohlinkzei@gmx-topmail.de>
+Robert Pohlink <pohlinkzei@users.noreply.github.com> pohlinkzei <pohlinkzei@gmx-topmail.de>
+Michael Farmbauer <horwitz@users.sourceforge.net> horwitz <horwitz@ffa7fe5e-494d-0410-b361-a75ebd5db220>
+Martin Schaller <martin-s@users.sourceforge.net> martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
diff --git a/AUTHORS b/AUTHORS
index 426de519d..f202302e7 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,7 +1,68 @@
-Michael Farmbauer <horwitz@users.sourceforge.net>
-Martin Schaller <martin-s@users.sourceforge.net>
-Pierre Grandin <kazer_@users.sourceforge.net>
-Alexander Atanasov <aatanasov@gmail.com>
+# Active contributors:
+Charles Curley
+jandegr
+jkoan
+Johan Fitié
+Joseph Herlant
+lains
+Marc Capdeville
+Michael Dankov
+mvglasow
+naggety
+Patrick Höhn
+Pierre Grandin
+Robert Pohlink
+Sebastian Leske
+Stefan Wildemann
+Timo
+trldp
+youte62
-And all the Navit Team members and contributors.
-See http://wiki.navit-project.org/index.php/Navit_project_members_and_contributors for the full list!
+# Retired contributors:
+afaber
+akashihi
+anhanguera
+aurel_j
+bjasspa
+bodenseepingu
+bustersnyvel
+carcinoma
+Cedric Paille
+christeck
+eiten
+gauthier60
+geoghegan
+ghenzo
+gotwo
+greg
+hafting
+hawke666
+kelvinzhao
+klausg
+korrosa
+latouche
+Manuel Hohmann
+Martin Schaller
+mattcallow
+Michael Farmbauer
+niccolo
+norad
+OmegA_MRS
+pavel
+plum_
+Rikky
+Robotaxi
+rphlx
+sanderd17
+seralph
+singesang
+spaetz
+steven_s
+tegzed
+tinloaf
+woglinde
+worldcitizen
+zaxl
+zintor
+zoff99
+zoniq
diff --git a/ci/generate_contributors.sh b/ci/generate_contributors.sh
new file mode 100644
index 000000000..b957d486d
--- /dev/null
+++ b/ci/generate_contributors.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+set -e
+
+# ###########################################################################################################
+# This script generates a AUTHORS file in the current directory based on the
+# output of the git log command. It splits the contributors in 2 groups:
+# * The "active contributors" are the contributors that authored commits over the last 2 years
+# * The "retired contributors" are the contributors that have authored commits but not over the last 2 years
+# Note: it uses git's mailmap functionnality to get a clean list of users
+# ###########################################################################################################
+
+declare -A CONTRIBUTORS=()
+declare -a authors=()
+TWO_YEARS_AGO=`date +%s --date="2 years ago"`
+retiredTitleWritten=false
+
+git log --encoding=utf-8 --full-history --date=short --use-mailmap "--format=format:%ad;%aN" |
+{
+ echo "# Active contributors:" > AUTHORS
+ while read -r line; do
+ IFS=';'; arrLine=($line); unset IFS;
+ author=${arrLine[1]}
+ commitDate=`date +%s --date="${arrLine[0]}"`
+
+ # Exclude circleci
+ if [[ $author =~ [Cc]ircle\s*[Cc][Ii] ]]; then
+ continue
+ fi
+
+ # indicates that the commits are now older than 2 years so we print the
+ # sorted list of active contributors and reset the authors array
+ if [ "$retiredTitleWritten" = false ]; then
+ if [ $TWO_YEARS_AGO -ge $commitDate ]; then
+ IFS=$'\n' sorted=($(sort <<<"${authors[*]}"))
+ printf "%s\n" "${sorted[@]}" >> AUTHORS
+ authors=()
+ echo -e "\n# Retired contributors:" >> AUTHORS
+ retiredTitleWritten=true
+ fi
+ fi
+
+ # using the map as an easy way to check if the author has already been listed
+ if [ -z "${CONTRIBUTORS[${author}]}" ]; then
+ CONTRIBUTORS[${author}]=${arrLine[0]}
+ authors+=("${author}")
+ fi
+ done
+ # We are still in the subprocess scope so we can print the sorted list of
+ # retired contributors
+ IFS=$'\n' sorted=($(sort <<<"${authors[*]}"))
+ printf "%s\n" "${sorted[@]}" >> AUTHORS
+}
diff --git a/ci/publish.sh b/ci/publish.sh
index 58c3c05d5..b3c0a6298 100644
--- a/ci/publish.sh
+++ b/ci/publish.sh
@@ -1,20 +1,35 @@
#!/bin/sh
+
+if [ -z $CI ];then
+ echo "This Script needs to be run by CI"
+fi
+if [ -z $CIRCLECI ];then
+ echo "This Script needs to be run on CircleCI"
+fi
+if [[ "${CIRCLE_PROJECT_USERNAME}" != "navit-gps" || "${CIRCLE_BRANCH}" != "trunk" ]]; then
+ echo "Only trunk on navit-gps may upload to the Play Store"
+ exit 0
+fi
+
set -e
ARCH="arm"
+BINPATH="android-arm/navit/android/bin"
+
+export PATH="/opt/android-sdk-linux/build-tools/25.0.1/":$PATH
cd ~/
git clone git@github.com:navit-gps/infrastructure-blackbox.git
cd infrastructure-blackbox/keyrings/
openssl aes-256-cbc -d -in keystore.gpg -k $KEY > ~/.keystore
-openssl aes-256-cbc -d -in client_secrets.gpg -k $KEY > ~/navit/ci/client_secrets.json
-openssl aes-256-cbc -d -in androidpublisher.gpg -k $KEY > androidpublisher.dat
+openssl aes-256-cbc -d -in client_secrets.gpg -k $KEY > /root/project/ci/client_secrets.json
+openssl aes-256-cbc -d -in androidpublisher.gpg -k $KEY > /root/project/androidpublisher.dat
+cd ~/project
pip install google-api-python-client
-jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -storepass $SP $CIRCLE_ARTIFACTS/navit-$CIRCLE_SHA1-${ARCH}-release-unsigned.apk $key_name
+jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -storepass $SP $BINPATH/navit-$CIRCLE_SHA1-${ARCH}-release-unsigned.apk $key_name
-/usr/local/android-sdk-linux/build-tools/25.0.1/zipalign 4 $CIRCLE_ARTIFACTS/navit-$CIRCLE_SHA1-${ARCH}-release-unsigned.apk $CIRCLE_ARTIFACTS/navit-$CIRCLE_SHA1-${ARCH}-release-signed.apk
-# /usr/local/android-sdk-linux/build-tools/25.0.1/apksigner sign -v --ks-pass pass:$SP --key $key_name $CIRCLE_ARTIFACTS/navit-$CIRCLE_SHA1-${ARCH}-release-signed.apk
-/usr/local/android-sdk-linux/build-tools/25.0.1/apksigner verify -v $CIRCLE_ARTIFACTS/navit-$CIRCLE_SHA1-${ARCH}-release-signed.apk
-python ~/navit/ci/basic_upload_apks.py org.navitproject.navit $CIRCLE_ARTIFACTS/navit-$CIRCLE_SHA1-${ARCH}-release-signed.apk
+zipalign 4 $BINPATH/navit-$CIRCLE_SHA1-${ARCH}-release-unsigned.apk $BINPATH/navit-$CIRCLE_SHA1-${ARCH}-release-signed.apk
+apksigner verify -v $BINPATH/navit-$CIRCLE_SHA1-${ARCH}-release-signed.apk
+python ~/project/ci/basic_upload_apks.py org.navitproject.navit $BINPATH/navit-$CIRCLE_SHA1-${ARCH}-release-signed.apk --noauth_local_webserver
diff --git a/ci/setup_android.sh b/ci/setup_android.sh
index 992044302..fee29613b 100644
--- a/ci/setup_android.sh
+++ b/ci/setup_android.sh
@@ -3,7 +3,7 @@ set -e
apt-get update && apt-get install -y software-properties-common
add-apt-repository -y ppa:openjdk-r/ppa
-apt-get update && apt-get install -y openjdk-8-jdk wget expect git curl libsaxonb-java ant
+apt-get update && apt-get install -y openjdk-8-jdk wget expect curl libsaxonb-java ant ca-certificates python-pip
apt-get remove -y openjdk-7-jre-headless
export ANDROID_SDK_HOME=/opt/android-sdk-linux
diff --git a/ci/setup_common_requirements.sh b/ci/setup_common_requirements.sh
index 40a87dd07..6343194bb 100644
--- a/ci/setup_common_requirements.sh
+++ b/ci/setup_common_requirements.sh
@@ -1,4 +1,4 @@
#!/bin/sh
set -e
-apt-get update && apt-get install -y wget unzip cmake build-essential gettext imagemagick util-linux git ssh
+apt-get update && apt-get install -y wget unzip cmake build-essential gettext librsvg2-bin util-linux git ssh
diff --git a/navit/android.c b/navit/android.c
index 6e62da1b3..eadd6eaab 100644
--- a/navit/android.c
+++ b/navit/android.c
@@ -43,7 +43,7 @@ android_find_class_global(char *name, jclass *ret)
{
*ret=(*jnienv)->FindClass(jnienv, name);
if (! *ret) {
- dbg(lvl_error,"Failed to get Class %s\n",name);
+ dbg(lvl_error,"Failed to get Class %s",name);
return 0;
}
*ret = (*jnienv)->NewGlobalRef(jnienv, *ret);
@@ -55,7 +55,7 @@ android_find_method(jclass class, char *name, char *args, jmethodID *ret)
{
*ret = (*jnienv)->GetMethodID(jnienv, class, name, args);
if (*ret == NULL) {
- dbg(lvl_error,"Failed to get Method %s with signature %s\n",name,args);
+ dbg(lvl_error,"Failed to get Method %s with signature %s",name,args);
return 0;
}
return 1;
@@ -67,7 +67,7 @@ android_find_static_method(jclass class, char *name, char *args, jmethodID *ret)
{
*ret = (*jnienv)->GetStaticMethodID(jnienv, class, name, args);
if (*ret == NULL) {
- dbg(lvl_error,"Failed to get static Method %s with signature %s\n",name,args);
+ dbg(lvl_error,"Failed to get static Method %s with signature %s",name,args);
return 0;
}
return 1;
@@ -84,12 +84,12 @@ Java_org_navitproject_navit_Navit_NavitMain( JNIEnv* env, jobject thiz, jobject
jnienv=env;
android_activity = (*jnienv)->NewGlobalRef(jnienv, activity);
langstr=(*env)->GetStringUTFChars(env, lang, NULL);
- dbg(lvl_debug,"enter env=%p thiz=%p activity=%p lang=%s version=%d\n",env,thiz,android_activity,langstr,version);
+ dbg(lvl_debug,"enter env=%p thiz=%p activity=%p lang=%s version=%d",env,thiz,android_activity,langstr,version);
setenv("LANG",langstr,1);
(*env)->ReleaseStringUTFChars(env, lang, langstr);
displaydensitystr=(*env)->GetStringUTFChars(env, display_density_string, NULL);
- dbg(lvl_debug,"*****displaydensity=%s\n",displaydensitystr);
+ dbg(lvl_debug,"*****displaydensity=%s",displaydensitystr);
setenv("ANDROID_DENSITY",displaydensitystr,1);
(*env)->ReleaseStringUTFChars(env, display_density_string, displaydensitystr);
@@ -105,14 +105,14 @@ Java_org_navitproject_navit_Navit_NavitMain( JNIEnv* env, jobject thiz, jobject
JNIEXPORT void JNICALL
Java_org_navitproject_navit_Navit_NavitDestroy( JNIEnv* env)
{
- dbg(lvl_debug, "shutdown navit\n");
+ dbg(lvl_debug, "shutdown navit");
exit(0);
}
JNIEXPORT void JNICALL
Java_org_navitproject_navit_NavitGraphics_SizeChangedCallback( JNIEnv* env, jobject thiz, int id, int w, int h)
{
- dbg(lvl_debug,"enter %p %d %d\n",(struct callback *)id,w,h);
+ dbg(lvl_debug,"enter %p %d %d",(struct callback *)id,w,h);
if (id)
callback_call_2((struct callback *)id,w,h);
}
@@ -120,7 +120,7 @@ Java_org_navitproject_navit_NavitGraphics_SizeChangedCallback( JNIEnv* env, jobj
JNIEXPORT void JNICALL
Java_org_navitproject_navit_NavitGraphics_PaddingChangedCallback(JNIEnv* env, jobject thiz, int id, int left, int top, int right, int bottom)
{
- dbg(lvl_debug,"enter %p %d %d %d %d\n",(struct callback *)id, left, top, right, bottom);
+ dbg(lvl_debug,"enter %p %d %d %d %d",(struct callback *)id, left, top, right, bottom);
if (id)
callback_call_4((struct callback *)id, left, top, right, bottom);
}
@@ -128,7 +128,7 @@ Java_org_navitproject_navit_NavitGraphics_PaddingChangedCallback(JNIEnv* env, jo
JNIEXPORT void JNICALL
Java_org_navitproject_navit_NavitGraphics_ButtonCallback( JNIEnv* env, jobject thiz, int id, int pressed, int button, int x, int y)
{
- dbg(lvl_debug,"enter %p %d %d\n",(struct callback *)id,pressed,button);
+ dbg(lvl_debug,"enter %p %d %d",(struct callback *)id,pressed,button);
if (id)
callback_call_4((struct callback *)id,pressed,button,x,y);
}
@@ -136,7 +136,7 @@ Java_org_navitproject_navit_NavitGraphics_ButtonCallback( JNIEnv* env, jobject t
JNIEXPORT void JNICALL
Java_org_navitproject_navit_NavitGraphics_MotionCallback( JNIEnv* env, jobject thiz, int id, int x, int y)
{
- dbg(lvl_debug,"enter %p %d %d\n",(struct callback *)id,x,y);
+ dbg(lvl_debug,"enter %p %d %d",(struct callback *)id,x,y);
if (id)
callback_call_2((struct callback *)id,x,y);
}
@@ -145,7 +145,7 @@ JNIEXPORT void JNICALL
Java_org_navitproject_navit_NavitGraphics_KeypressCallback( JNIEnv* env, jobject thiz, int id, jobject str)
{
const char *s;
- dbg(lvl_debug,"enter %p %p\n",(struct callback *)id,str);
+ dbg(lvl_debug,"enter %p %p",(struct callback *)id,str);
s=(*env)->GetStringUTFChars(env, str, NULL);
dbg(lvl_debug,"key=%d",s);
if (id)
@@ -157,7 +157,7 @@ JNIEXPORT void JNICALL
Java_org_navitproject_navit_NavitTimeout_TimeoutCallback( JNIEnv* env, jobject thiz, int id)
{
void (*event_handler)(void *) = *(void **)id;
- dbg(lvl_debug,"enter %p %p\n",thiz, (void *)id);
+ dbg(lvl_debug,"enter %p %p",thiz, (void *)id);
event_handler((void*)id);
}
@@ -170,7 +170,7 @@ Java_org_navitproject_navit_NavitVehicle_VehicleCallback( JNIEnv * env, jobject
JNIEXPORT void JNICALL
Java_org_navitproject_navit_NavitIdle_IdleCallback( JNIEnv* env, jobject thiz, int id)
{
- dbg(lvl_debug,"enter %p %p\n",thiz, (void *)id);
+ dbg(lvl_debug,"enter %p %p",thiz, (void *)id);
callback_call_0((struct callback *)id);
}
@@ -185,14 +185,14 @@ Java_org_navitproject_navit_NavitWatch_poll( JNIEnv* env, jobject thiz, int func
JNIEXPORT void JNICALL
Java_org_navitproject_navit_NavitWatch_WatchCallback( JNIEnv* env, jobject thiz, int id)
{
- dbg(lvl_debug,"enter %p %p\n",thiz, (void *)id);
+ dbg(lvl_debug,"enter %p %p",thiz, (void *)id);
callback_call_0((struct callback *)id);
}
JNIEXPORT void JNICALL
Java_org_navitproject_navit_NavitSensors_SensorCallback( JNIEnv* env, jobject thiz, int id, int sensor, float x, float y, float z)
{
- dbg(lvl_debug,"enter %p %p %f %f %f\n",thiz, (void *)id,x,y,z);
+ dbg(lvl_debug,"enter %p %p %f %f %f",thiz, (void *)id,x,y,z);
callback_call_4((struct callback *)id, sensor, &x, &y, &z);
}
@@ -222,7 +222,7 @@ Java_org_navitproject_navit_NavitGraphics_CallbackLocalizedString( JNIEnv* env,
const char *localized_str;
s=(*env)->GetStringUTFChars(env, str, NULL);
- //dbg(lvl_debug,"*****string=%s\n",s);
+ //dbg(lvl_debug,"*****string=%s",s);
localized_str=navit_nls_gettext(s);
//dbg(lvl_debug,"localized string=%s",localized_str);
@@ -241,7 +241,7 @@ Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel( JNIEnv* env, j
struct attr attr;
const char *s;
jint ret = 0;
- dbg(lvl_debug,"enter %d %p\n",channel,str);
+ dbg(lvl_debug,"enter %d %p",channel,str);
config_get_attr(config_get(), attr_navit, &attr, NULL);
@@ -262,7 +262,7 @@ Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel( JNIEnv* env, j
struct mapset *ms = navit_get_mapset(attr.u.navit);
struct attr type, name, data, *attrs[4];
const char *map_location=(*env)->GetStringUTFChars(env, str, NULL);
- dbg(lvl_debug,"*****string=%s\n",map_location);
+ dbg(lvl_debug,"*****string=%s",map_location);
type.type=attr_type;
type.u.str="binfile";
@@ -306,7 +306,7 @@ Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel( JNIEnv* env, j
case 5:
// call a command (like in gui)
s=(*env)->GetStringUTFChars(env, str, NULL);
- dbg(lvl_debug,"*****string=%s\n",s);
+ dbg(lvl_debug,"*****string=%s",s);
command_evaluate(&attr,s);
(*env)->ReleaseStringUTFChars(env, str, s);
break;
@@ -324,7 +324,7 @@ Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel( JNIEnv* env, j
char parse_str[strlen(s) + 1];
strcpy(parse_str, s);
(*env)->ReleaseStringUTFChars(env, str, s);
- dbg(lvl_debug,"*****string=%s\n",parse_str);
+ dbg(lvl_debug,"*****string=%s",parse_str);
// set destination to (pixel-x#pixel-y)
// pixel-x
@@ -334,8 +334,8 @@ Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel( JNIEnv* env, j
pstr = strtok (NULL, "#");
p.y = atoi(pstr);
- dbg(lvl_debug,"11x=%d\n",p.x);
- dbg(lvl_debug,"11y=%d\n",p.y);
+ dbg(lvl_debug,"11x=%d",p.x);
+ dbg(lvl_debug,"11y=%d",p.y);
transform_reverse(transform, &p, &c);
@@ -344,8 +344,8 @@ Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel( JNIEnv* env, j
pc.y = c.y;
pc.pro = transform_get_projection(transform);
- dbg(lvl_debug,"22x=%d\n",pc.x);
- dbg(lvl_debug,"22y=%d\n",pc.y);
+ dbg(lvl_debug,"22x=%d",pc.x);
+ dbg(lvl_debug,"22y=%d",pc.y);
// start navigation asynchronous
navit_set_destination(attr.u.navit, &pc, parse_str, 1);
@@ -359,7 +359,7 @@ Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel( JNIEnv* env, j
char parse_str[strlen(s) + 1];
strcpy(parse_str, s);
(*env)->ReleaseStringUTFChars(env, str, s);
- dbg(lvl_debug,"*****string=%s\n",s);
+ dbg(lvl_debug,"*****string=%s",s);
// set destination to (lat#lon#title)
struct coord_geo g;
@@ -375,9 +375,9 @@ Java_org_navitproject_navit_NavitGraphics_CallbackMessageChannel( JNIEnv* env, j
// description
name = strtok (NULL, "#");
- dbg(lvl_debug,"lat=%f\n",g.lat);
- dbg(lvl_debug,"lng=%f\n",g.lng);
- dbg(lvl_debug,"str1=%s\n",name);
+ dbg(lvl_debug,"lat=%f",g.lat);
+ dbg(lvl_debug,"lng=%f",g.lng);
+ dbg(lvl_debug,"str1=%s",name);
struct coord c;
transform_from_geo(projection_mg, &g, &c);
@@ -408,7 +408,7 @@ Java_org_navitproject_navit_NavitGraphics_GetDefaultCountry( JNIEnv* env, jobjec
jstring return_string = NULL;
struct attr attr;
- dbg(lvl_debug,"enter %d %p\n",channel,str);
+ dbg(lvl_debug,"enter %d %p",channel,str);
config_get_attr(config_get(), attr_navit, &attr, NULL);
@@ -423,12 +423,12 @@ Java_org_navitproject_navit_NavitGraphics_GetDefaultCountry( JNIEnv* env, jobjec
struct mapset *ms=navit_get_mapset(attr.u.navit);
struct search_list *search_list = search_list_new(ms);
search_attr.type=attr_country_all;
- dbg(lvl_debug,"country %s\n", country_name.u.str);
+ dbg(lvl_debug,"country %s", country_name.u.str);
search_attr.u.str=country_name.u.str;
search_list_search(search_list, &search_attr, 0);
while((res=search_list_get_result(search_list)))
{
- dbg(lvl_debug,"Get result: %s\n", res->country->iso2);
+ dbg(lvl_debug,"Get result: %s", res->country->iso2);
}
if (item_attr_get(item, attr_country_iso2, &country_iso2))
return_string = (*env)->NewStringUTF(env,country_iso2.u.str);
@@ -449,7 +449,7 @@ Java_org_navitproject_navit_NavitGraphics_GetAllCountries( JNIEnv* env, jobject
jobjectArray all_countries;
struct attr attr;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
config_get_attr(config_get(), attr_navit, &attr, NULL);
@@ -457,12 +457,12 @@ Java_org_navitproject_navit_NavitGraphics_GetAllCountries( JNIEnv* env, jobject
struct search_list *search_list = search_list_new(ms);
jobjectArray current_country = NULL;
search_attr.type=attr_country_all;
- //dbg(lvl_debug,"country %s\n", country_name.u.str);
+ //dbg(lvl_debug,"country %s", country_name.u.str);
search_attr.u.str=g_strdup("");//country_name.u.str;
search_list_search(search_list, &search_attr, 1);
while((res=search_list_get_result(search_list)))
{
- dbg(lvl_debug,"Get result: %s\n", res->country->iso2);
+ dbg(lvl_debug,"Get result: %s", res->country->iso2);
if (strlen(res->country->iso2)==2)
{
@@ -593,7 +593,7 @@ android_search_idle(struct android_search_priv *search_priv)
struct search_list_result *res = search_list_get_result(search_priv->search_list);
if (res) {
- dbg(lvl_debug, "Town: %s, Street: %s\n",res->town ? res->town->common.town_name : "no town", res->street ? res->street->name : "no street");
+ dbg(lvl_debug, "Town: %s, Street: %s",res->town ? res->town->common.town_name : "no town", res->street ? res->street->name : "no street");
search_priv->found = 1;
switch (search_priv->search_attr.type)
{
@@ -691,7 +691,7 @@ search_fix_spaces(const char *str)
static void start_search(struct android_search_priv *search_priv, const char *search_string)
{
- dbg(lvl_debug,"enter %s\n", search_string);
+ dbg(lvl_debug,"enter %s", search_string);
char *str=search_fix_spaces(search_string);
search_priv->phrases = g_strsplit(str, " ", 0);
//ret=search_address_town(ret, sl, phrases, NULL, partial, jni);
@@ -706,7 +706,7 @@ static void start_search(struct android_search_priv *search_priv, const char *se
//callback_call_0(search_priv->idle_clb);
g_free(str);
- dbg(lvl_debug,"leave\n");
+ dbg(lvl_debug,"leave");
}
JNIEXPORT jlong JNICALL
@@ -714,7 +714,7 @@ Java_org_navitproject_navit_NavitAddressSearchActivity_CallbackStartAddressSearc
{
struct attr attr;
const char *search_string =(*env)->GetStringUTFChars(env, str, NULL);
- dbg(lvl_debug,"search '%s'\n", search_string);
+ dbg(lvl_debug,"search '%s'", search_string);
config_get_attr(config_get(), attr_navit, &attr, NULL);
@@ -747,7 +747,7 @@ Java_org_navitproject_navit_NavitAddressSearchActivity_CallbackStartAddressSearc
if (!count)
dbg(lvl_error,"Country not found");
- dbg(lvl_debug,"search in country '%s'\n", str_country);
+ dbg(lvl_debug,"search in country '%s'", str_country);
(*env)->ReleaseStringUTFChars(env, country, str_country);
search_priv->search_result_obj.env = env;
diff --git a/navit/android/res/layout/ua_com_vassiliev_filebrowser_layout.xml b/navit/android/res/layout/ua_com_vassiliev_filebrowser_layout.xml
index 28bedf592..d45485f49 100644
--- a/navit/android/res/layout/ua_com_vassiliev_filebrowser_layout.xml
+++ b/navit/android/res/layout/ua_com_vassiliev_filebrowser_layout.xml
@@ -1,84 +1,84 @@
-<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical"
- android:padding="3dp" >
-
- <!--
- android:layout_weight="1"
- android:layout_weight="1"
- android:layout_height="wrap_content"
- android:layout_width="fill_parent"
- android:layout_width="fill_parent"
- android:layout_gravity="top"
- android:background = "#f00"
- android:background = "#0f0"
-
- -->
-
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_margin="0dp"
- android:gravity="top"
- android:orientation="horizontal"
- android:padding="0dp" >
-
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_margin="0dp"
- android:layout_weight="1"
- android:gravity="top"
- android:orientation="horizontal"
- android:padding="0dp" >
-
- <Button
- android:id="@+id/upDirectoryButton"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="top"
- android:layout_margin="0dp"
- android:layout_weight="1"
- android:padding="0dp"
- android:drawableLeft="@drawable/dir_up"
- android:text="Up" />
- </LinearLayout>
-
- <LinearLayout
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_margin="0dp"
- android:layout_weight="1"
- android:gravity="top"
- android:orientation="horizontal"
- android:padding="0dp" >
-
- <Button
- android:id="@+id/selectCurrentDirectoryButton"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:layout_gravity="top"
- android:gravity = "center|center_vertical"
- android:layout_margin="0dp"
- android:layout_weight="1"
- android:padding="0dp"
- android:text="Select" />
- </LinearLayout>
- </LinearLayout>
-
- <TextView
- android:id="@+id/currentDirectoryTextView"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="Current folder: \n/THis/is/a/long/path/to/test/if/this/will/span/multiple/lines" />
-
- <ListView
- android:id="@+id/fileListView"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:layout_marginTop="5dp"
- android:layout_weight="1" />
-
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:orientation="vertical"
+ android:padding="3dp" >
+
+ <!--
+ android:layout_weight="1"
+ android:layout_weight="1"
+ android:layout_height="wrap_content"
+ android:layout_width="fill_parent"
+ android:layout_width="fill_parent"
+ android:layout_gravity="top"
+ android:background = "#f00"
+ android:background = "#0f0"
+
+ -->
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="0dp"
+ android:gravity="top"
+ android:orientation="horizontal"
+ android:padding="0dp" >
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="0dp"
+ android:layout_weight="1"
+ android:gravity="top"
+ android:orientation="horizontal"
+ android:padding="0dp" >
+
+ <Button
+ android:id="@+id/upDirectoryButton"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top"
+ android:layout_margin="0dp"
+ android:layout_weight="1"
+ android:padding="0dp"
+ android:drawableLeft="@drawable/dir_up"
+ android:text="Up" />
+ </LinearLayout>
+
+ <LinearLayout
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_margin="0dp"
+ android:layout_weight="1"
+ android:gravity="top"
+ android:orientation="horizontal"
+ android:padding="0dp" >
+
+ <Button
+ android:id="@+id/selectCurrentDirectoryButton"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:layout_gravity="top"
+ android:gravity = "center|center_vertical"
+ android:layout_margin="0dp"
+ android:layout_weight="1"
+ android:padding="0dp"
+ android:text="Select" />
+ </LinearLayout>
+ </LinearLayout>
+
+ <TextView
+ android:id="@+id/currentDirectoryTextView"
+ android:layout_width="fill_parent"
+ android:layout_height="wrap_content"
+ android:text="Current folder: \n/THis/is/a/long/path/to/test/if/this/will/span/multiple/lines" />
+
+ <ListView
+ android:id="@+id/fileListView"
+ android:layout_width="fill_parent"
+ android:layout_height="fill_parent"
+ android:layout_marginTop="5dp"
+ android:layout_weight="1" />
+
</LinearLayout> \ No newline at end of file
diff --git a/navit/android/src/org/navitproject/navit/FileBrowserActivity.java b/navit/android/src/org/navitproject/navit/FileBrowserActivity.java
index f3dac4894..d24be64e3 100644
--- a/navit/android/src/org/navitproject/navit/FileBrowserActivity.java
+++ b/navit/android/src/org/navitproject/navit/FileBrowserActivity.java
@@ -1,430 +1,430 @@
-package org.navitproject.navit;
-
-//Heavily based on code from
-//https://github.com/mburman/Android-File-Explore
-// Version of Aug 13, 2011
-//Also contributed:
-// Sugan Krishnan (https://github.com/rgksugan) - Jan 2013.
-//
-
-//Project type now is Android library:
-// http://developer.android.com/guide/developing/projects/projects-eclipse.html#ReferencingLibraryProject
-
-//General Java imports
-import java.io.File;
-import java.io.FilenameFilter;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Collections;
-
-//Android imports
-import android.app.Activity;
-import android.content.Intent;
-import android.content.res.Configuration;
-import android.graphics.Color;
-import android.os.Bundle;
-import android.os.Environment;
-import android.os.StatFs;
-import android.util.Log;
-import android.view.View.OnClickListener;
-import android.view.ViewGroup.LayoutParams;
-import android.view.*;
-import android.widget.*;
-
-//Import of resources file for file browser
-import org.navitproject.navit.R;
-
-public class FileBrowserActivity extends Activity {
- // Intent Action Constants
- public static final String INTENT_ACTION_SELECT_DIR = "ua.com.vassiliev.androidfilebrowser.SELECT_DIRECTORY_ACTION";
- public static final String INTENT_ACTION_SELECT_FILE = "ua.com.vassiliev.androidfilebrowser.SELECT_FILE_ACTION";
-
- // Intent parameters names constants
- public static final String startDirectoryParameter = "ua.com.vassiliev.androidfilebrowser.directoryPath";
- public static final String returnDirectoryParameter = "ua.com.vassiliev.androidfilebrowser.directoryPathRet";
- public static final String returnFileParameter = "ua.com.vassiliev.androidfilebrowser.filePathRet";
- public static final String showCannotReadParameter = "ua.com.vassiliev.androidfilebrowser.showCannotRead";
- public static final String filterExtension = "ua.com.vassiliev.androidfilebrowser.filterExtension";
-
- // Stores names of traversed directories
- ArrayList<String> pathDirsList = new ArrayList<String>();
-
- // Check if the first level of the directory structure is the one showing
- // private Boolean firstLvl = true;
-
- private static final String LOGTAG = "F_PATH";
-
- private List<Item> fileList = new ArrayList<Item>();
- private File path = null;
- private String chosenFile;
- // private static final int DIALOG_LOAD_FILE = 1000;
-
- ArrayAdapter<Item> adapter;
-
- private boolean showHiddenFilesAndDirs = true;
-
- private boolean directoryShownIsEmpty = false;
-
- private String filterFileExtension = null;
-
- // Action constants
- private static int currentAction = -1;
- private static final int SELECT_DIRECTORY = 1;
- private static final int SELECT_FILE = 2;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- // In case of
- // ua.com.vassiliev.androidfilebrowser.SELECT_DIRECTORY_ACTION
- // Expects com.mburman.fileexplore.directoryPath parameter to
- // point to the start folder.
- // If empty or null, will start from SDcard root.
- setContentView(R.layout.ua_com_vassiliev_filebrowser_layout);
-
- // Set action for this activity
- Intent thisInt = this.getIntent();
- currentAction = SELECT_DIRECTORY;// This would be a default action in
- // case not set by intent
- if (thisInt.getAction().equalsIgnoreCase(INTENT_ACTION_SELECT_FILE)) {
- Log.d(LOGTAG, "SELECT ACTION - SELECT FILE");
- currentAction = SELECT_FILE;
- }
-
- showHiddenFilesAndDirs = thisInt.getBooleanExtra(
- showCannotReadParameter, true);
-
- filterFileExtension = thisInt.getStringExtra(filterExtension);
-
- setInitialDirectory();
-
- parseDirectoryPath();
- loadFileList();
- this.createFileListAdapter();
- this.initializeButtons();
- this.initializeFileListView();
- updateCurrentDirectoryTextView();
- Log.d(LOGTAG, path.getAbsolutePath());
- }
-
- private void setInitialDirectory() {
- Intent thisInt = this.getIntent();
- String requestedStartDir = thisInt
- .getStringExtra(startDirectoryParameter);
-
- if (requestedStartDir != null && requestedStartDir.length() > 0) {// if(requestedStartDir!=null
- File tempFile = new File(requestedStartDir);
- if (tempFile.isDirectory())
- this.path = tempFile;
- }// if(requestedStartDir!=null
-
- if (this.path == null) {// No or invalid directory supplied in intent
- // parameter
- if (Environment.getExternalStorageDirectory().isDirectory()
- && Environment.getExternalStorageDirectory().canRead())
- path = Environment.getExternalStorageDirectory();
- else
- path = new File("/");
- }// if(this.path==null) {//No or invalid directory supplied in intent
- // parameter
- }// private void setInitialDirectory() {
-
- private void parseDirectoryPath() {
- pathDirsList.clear();
- String pathString = path.getAbsolutePath();
- String[] parts = pathString.split("/");
- int i = 0;
- while (i < parts.length) {
- pathDirsList.add(parts[i]);
- i++;
- }
- }
-
- private void initializeButtons() {
- Button upDirButton = (Button) this.findViewById(R.id.upDirectoryButton);
- upDirButton.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- Log.d(LOGTAG, "onclick for upDirButton");
- loadDirectoryUp();
- loadFileList();
- adapter.notifyDataSetChanged();
- updateCurrentDirectoryTextView();
- }
- });// upDirButton.setOnClickListener(
-
- Button selectFolderButton = (Button) this
- .findViewById(R.id.selectCurrentDirectoryButton);
- if (currentAction == SELECT_DIRECTORY) {
- selectFolderButton.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- Log.d(LOGTAG, "onclick for selectFolderButton");
- returnDirectoryFinishActivity();
- }
- });
- } else {// if(currentAction == this.SELECT_DIRECTORY) {
- selectFolderButton.setVisibility(View.GONE);
- }// } else {//if(currentAction == this.SELECT_DIRECTORY) {
- }// private void initializeButtons() {
-
- private void loadDirectoryUp() {
- // present directory removed from list
- String s = pathDirsList.remove(pathDirsList.size() - 1);
- // path modified to exclude present directory
- path = new File(path.toString().substring(0,
- path.toString().lastIndexOf(s)));
- fileList.clear();
- }
-
- private void updateCurrentDirectoryTextView() {
- int i = 0;
- String curDirString = "";
- while (i < pathDirsList.size()) {
- curDirString += pathDirsList.get(i) + "/";
- i++;
- }
- if (pathDirsList.size() == 0) {
- ((Button) this.findViewById(R.id.upDirectoryButton))
- .setEnabled(false);
- curDirString = "/";
- } else
- ((Button) this.findViewById(R.id.upDirectoryButton))
- .setEnabled(true);
- long freeSpace = getFreeSpace(curDirString);
- String formattedSpaceString = formatBytes(freeSpace);
- if (freeSpace == 0) {
- Log.d(LOGTAG, "NO FREE SPACE");
- File currentDir = new File(curDirString);
- if(!currentDir.canWrite())
- formattedSpaceString = "NON Writable";
- }
-
- ((Button) this.findViewById(R.id.selectCurrentDirectoryButton))
- .setText("Select\n[" + formattedSpaceString
- + "]");
-
- ((TextView) this.findViewById(R.id.currentDirectoryTextView))
- .setText("Current directory: " + curDirString);
- }// END private void updateCurrentDirectoryTextView() {
-
- private void showToast(String message) {
- Toast.makeText(this, message, Toast.LENGTH_LONG).show();
- }
-
- private void initializeFileListView() {
- ListView lView = (ListView) this.findViewById(R.id.fileListView);
- LinearLayout.LayoutParams lParam = new LinearLayout.LayoutParams(
- LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
- lParam.setMargins(15, 5, 15, 5);
- lView.setAdapter(this.adapter);
- lView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
- public void onItemClick(AdapterView<?> parent, View view,
- int position, long id) {
- chosenFile = fileList.get(position).file;
- File sel = new File(path + "/" + chosenFile);
- Log.d(LOGTAG, "Clicked:" + chosenFile);
- if (sel.isDirectory()) {
- if (sel.canRead()) {
- // Adds chosen directory to list
- pathDirsList.add(chosenFile);
- path = new File(sel + "");
- Log.d(LOGTAG, "Just reloading the list");
- loadFileList();
- adapter.notifyDataSetChanged();
- updateCurrentDirectoryTextView();
- Log.d(LOGTAG, path.getAbsolutePath());
- } else {// if(sel.canRead()) {
- showToast("Path does not exist or cannot be read");
- }// } else {//if(sel.canRead()) {
- }// if (sel.isDirectory()) {
- // File picked or an empty directory message clicked
- else {// if (sel.isDirectory()) {
- Log.d(LOGTAG, "item clicked");
- if (!directoryShownIsEmpty) {
- Log.d(LOGTAG, "File selected:" + chosenFile);
- returnFileFinishActivity(sel.getAbsolutePath());
- }
- }// else {//if (sel.isDirectory()) {
- }// public void onClick(DialogInterface dialog, int which) {
- });// lView.setOnClickListener(
- }// private void initializeFileListView() {
-
- private void returnDirectoryFinishActivity() {
- Intent retIntent = new Intent();
- retIntent.putExtra(returnDirectoryParameter, path.getAbsolutePath());
- this.setResult(RESULT_OK, retIntent);
- this.finish();
- }// END private void returnDirectoryFinishActivity() {
-
- private void returnFileFinishActivity(String filePath) {
- Intent retIntent = new Intent();
- retIntent.putExtra(returnFileParameter, filePath);
- this.setResult(RESULT_OK, retIntent);
- this.finish();
- }// END private void returnDirectoryFinishActivity() {
-
- private void loadFileList() {
- try {
- path.mkdirs();
- } catch (SecurityException e) {
- Log.e(LOGTAG, "unable to write on the sd card ");
- }
- fileList.clear();
-
- if (path.exists() && path.canRead()) {
- FilenameFilter filter = new FilenameFilter() {
- public boolean accept(File dir, String filename) {
- File sel = new File(dir, filename);
- boolean showReadableFile = showHiddenFilesAndDirs
- || sel.canRead();
- // Filters based on whether the file is hidden or not
- if (currentAction == SELECT_DIRECTORY) {
- return (sel.isDirectory() && showReadableFile);
- }
- if (currentAction == SELECT_FILE) {
-
- // If it is a file check the extension if provided
- if (sel.isFile() && filterFileExtension != null) {
- return (showReadableFile && sel.getName().endsWith(
- filterFileExtension));
- }
- return (showReadableFile);
- }
- return true;
- }// public boolean accept(File dir, String filename) {
- };// FilenameFilter filter = new FilenameFilter() {
-
- String[] fList = path.list(filter);
- this.directoryShownIsEmpty = false;
- for (int i = 0; i < fList.length; i++) {
- // Convert into file path
- File sel = new File(path, fList[i]);
- Log.d(LOGTAG,
- "File:" + fList[i] + " readable:"
- + (Boolean.valueOf(sel.canRead())).toString());
- int drawableID = R.drawable.file_icon;
- boolean canRead = sel.canRead();
- // Set drawables
- if (sel.isDirectory()) {
- if (canRead) {
- drawableID = R.drawable.folder_icon;
- } else {
- drawableID = R.drawable.folder_icon_light;
- }
- }
- fileList.add(i, new Item(fList[i], drawableID, canRead));
- }// for (int i = 0; i < fList.length; i++) {
- if (fileList.size() == 0) {
- // Log.d(LOGTAG, "This directory is empty");
- this.directoryShownIsEmpty = true;
- fileList.add(0, new Item("Directory is empty", -1, true));
- } else {// sort non empty list
- Collections.sort(fileList, new ItemFileNameComparator());
- }
- } else {
- Log.e(LOGTAG, "path does not exist or cannot be read");
- }
- // Log.d(TAG, "loadFileList finished");
- }// private void loadFileList() {
-
- private void createFileListAdapter() {
- adapter = new ArrayAdapter<Item>(this,
- android.R.layout.select_dialog_item, android.R.id.text1,
- fileList) {
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- // creates view
- View view = super.getView(position, convertView, parent);
- TextView textView = (TextView) view
- .findViewById(android.R.id.text1);
- // put the image on the text view
- int drawableID = 0;
- if (fileList.get(position).icon != -1) {
- // If icon == -1, then directory is empty
- drawableID = fileList.get(position).icon;
- }
- textView.setCompoundDrawablesWithIntrinsicBounds(drawableID, 0,
- 0, 0);
-
- textView.setEllipsize(null);
-
- // add margin between image and text (support various screen
- // densities)
- // int dp5 = (int) (5 *
- // getResources().getDisplayMetrics().density + 0.5f);
- int dp3 = (int) (3 * getResources().getDisplayMetrics().density + 0.5f);
- // TODO: change next line for empty directory, so text will be
- // centered
- textView.setCompoundDrawablePadding(dp3);
- return view;
- }// public View getView(int position, View convertView, ViewGroup
- };// adapter = new ArrayAdapter<Item>(this,
- }// private createFileListAdapter(){
-
- private class Item {
- public String file;
- public int icon;
- public boolean canRead;
-
- public Item(String file, Integer icon, boolean canRead) {
- this.file = file;
- this.icon = icon;
- }
-
- @Override
- public String toString() {
- return file;
- }
- }// END private class Item {
-
- private class ItemFileNameComparator implements Comparator<Item> {
- public int compare(Item lhs, Item rhs) {
- return lhs.file.toLowerCase().compareTo(rhs.file.toLowerCase());
- }
- }
-
- public void onConfigurationChanged(Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
- Log.d(LOGTAG, "ORIENTATION_LANDSCAPE");
- } else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
- Log.d(LOGTAG, "ORIENTATION_PORTRAIT");
- }
- // Layout apparently changes itself, only have to provide good onMeasure
- // in custom components
- // TODO: check with keyboard
- // if(newConfig.keyboard == Configuration.KEYBOARDHIDDEN_YES)
- }// END public void onConfigurationChanged(Configuration newConfig) {
-
- public static long getFreeSpace(String path) {
- StatFs stat = new StatFs(path);
- long availSize = (long) stat.getAvailableBlocks()
- * (long) stat.getBlockSize();
- return availSize;
- }// END public static long getFreeSpace(String path) {
-
- public static String formatBytes(long bytes) {
- // TODO: add flag to which part is needed (e.g. GB, MB, KB or bytes)
- String retStr = "";
- // One binary gigabyte equals 1,073,741,824 bytes.
- if (bytes > 1073741824) {// Add GB
- long gbs = bytes / 1073741824;
- retStr += (new Long(gbs)).toString() + "GB ";
- bytes = bytes - (gbs * 1073741824);
- }
- // One MB - 1048576 bytes
- if (bytes > 1048576) {// Add GB
- long mbs = bytes / 1048576;
- retStr += (new Long(mbs)).toString() + "MB ";
- bytes = bytes - (mbs * 1048576);
- }
- if (bytes > 1024) {
- long kbs = bytes / 1024;
- retStr += (new Long(kbs)).toString() + "KB";
- bytes = bytes - (kbs * 1024);
- } else
- retStr += (new Long(bytes)).toString() + " bytes";
- return retStr;
- }// public static String formatBytes(long bytes){
-
-}// END public class FileBrowserActivity extends Activity {
+package org.navitproject.navit;
+
+//Heavily based on code from
+//https://github.com/mburman/Android-File-Explore
+// Version of Aug 13, 2011
+//Also contributed:
+// Sugan Krishnan (https://github.com/rgksugan) - Jan 2013.
+//
+
+//Project type now is Android library:
+// http://developer.android.com/guide/developing/projects/projects-eclipse.html#ReferencingLibraryProject
+
+//General Java imports
+import java.io.File;
+import java.io.FilenameFilter;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Collections;
+
+//Android imports
+import android.app.Activity;
+import android.content.Intent;
+import android.content.res.Configuration;
+import android.graphics.Color;
+import android.os.Bundle;
+import android.os.Environment;
+import android.os.StatFs;
+import android.util.Log;
+import android.view.View.OnClickListener;
+import android.view.ViewGroup.LayoutParams;
+import android.view.*;
+import android.widget.*;
+
+//Import of resources file for file browser
+import org.navitproject.navit.R;
+
+public class FileBrowserActivity extends Activity {
+ // Intent Action Constants
+ public static final String INTENT_ACTION_SELECT_DIR = "ua.com.vassiliev.androidfilebrowser.SELECT_DIRECTORY_ACTION";
+ public static final String INTENT_ACTION_SELECT_FILE = "ua.com.vassiliev.androidfilebrowser.SELECT_FILE_ACTION";
+
+ // Intent parameters names constants
+ public static final String startDirectoryParameter = "ua.com.vassiliev.androidfilebrowser.directoryPath";
+ public static final String returnDirectoryParameter = "ua.com.vassiliev.androidfilebrowser.directoryPathRet";
+ public static final String returnFileParameter = "ua.com.vassiliev.androidfilebrowser.filePathRet";
+ public static final String showCannotReadParameter = "ua.com.vassiliev.androidfilebrowser.showCannotRead";
+ public static final String filterExtension = "ua.com.vassiliev.androidfilebrowser.filterExtension";
+
+ // Stores names of traversed directories
+ ArrayList<String> pathDirsList = new ArrayList<String>();
+
+ // Check if the first level of the directory structure is the one showing
+ // private Boolean firstLvl = true;
+
+ private static final String LOGTAG = "F_PATH";
+
+ private List<Item> fileList = new ArrayList<Item>();
+ private File path = null;
+ private String chosenFile;
+ // private static final int DIALOG_LOAD_FILE = 1000;
+
+ ArrayAdapter<Item> adapter;
+
+ private boolean showHiddenFilesAndDirs = true;
+
+ private boolean directoryShownIsEmpty = false;
+
+ private String filterFileExtension = null;
+
+ // Action constants
+ private static int currentAction = -1;
+ private static final int SELECT_DIRECTORY = 1;
+ private static final int SELECT_FILE = 2;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ // In case of
+ // ua.com.vassiliev.androidfilebrowser.SELECT_DIRECTORY_ACTION
+ // Expects com.mburman.fileexplore.directoryPath parameter to
+ // point to the start folder.
+ // If empty or null, will start from SDcard root.
+ setContentView(R.layout.ua_com_vassiliev_filebrowser_layout);
+
+ // Set action for this activity
+ Intent thisInt = this.getIntent();
+ currentAction = SELECT_DIRECTORY;// This would be a default action in
+ // case not set by intent
+ if (thisInt.getAction().equalsIgnoreCase(INTENT_ACTION_SELECT_FILE)) {
+ Log.d(LOGTAG, "SELECT ACTION - SELECT FILE");
+ currentAction = SELECT_FILE;
+ }
+
+ showHiddenFilesAndDirs = thisInt.getBooleanExtra(
+ showCannotReadParameter, true);
+
+ filterFileExtension = thisInt.getStringExtra(filterExtension);
+
+ setInitialDirectory();
+
+ parseDirectoryPath();
+ loadFileList();
+ this.createFileListAdapter();
+ this.initializeButtons();
+ this.initializeFileListView();
+ updateCurrentDirectoryTextView();
+ Log.d(LOGTAG, path.getAbsolutePath());
+ }
+
+ private void setInitialDirectory() {
+ Intent thisInt = this.getIntent();
+ String requestedStartDir = thisInt
+ .getStringExtra(startDirectoryParameter);
+
+ if (requestedStartDir != null && requestedStartDir.length() > 0) {// if(requestedStartDir!=null
+ File tempFile = new File(requestedStartDir);
+ if (tempFile.isDirectory())
+ this.path = tempFile;
+ }// if(requestedStartDir!=null
+
+ if (this.path == null) {// No or invalid directory supplied in intent
+ // parameter
+ if (Environment.getExternalStorageDirectory().isDirectory()
+ && Environment.getExternalStorageDirectory().canRead())
+ path = Environment.getExternalStorageDirectory();
+ else
+ path = new File("/");
+ }// if(this.path==null) {//No or invalid directory supplied in intent
+ // parameter
+ }// private void setInitialDirectory() {
+
+ private void parseDirectoryPath() {
+ pathDirsList.clear();
+ String pathString = path.getAbsolutePath();
+ String[] parts = pathString.split("/");
+ int i = 0;
+ while (i < parts.length) {
+ pathDirsList.add(parts[i]);
+ i++;
+ }
+ }
+
+ private void initializeButtons() {
+ Button upDirButton = (Button) this.findViewById(R.id.upDirectoryButton);
+ upDirButton.setOnClickListener(new OnClickListener() {
+ public void onClick(View v) {
+ Log.d(LOGTAG, "onclick for upDirButton");
+ loadDirectoryUp();
+ loadFileList();
+ adapter.notifyDataSetChanged();
+ updateCurrentDirectoryTextView();
+ }
+ });// upDirButton.setOnClickListener(
+
+ Button selectFolderButton = (Button) this
+ .findViewById(R.id.selectCurrentDirectoryButton);
+ if (currentAction == SELECT_DIRECTORY) {
+ selectFolderButton.setOnClickListener(new OnClickListener() {
+ public void onClick(View v) {
+ Log.d(LOGTAG, "onclick for selectFolderButton");
+ returnDirectoryFinishActivity();
+ }
+ });
+ } else {// if(currentAction == this.SELECT_DIRECTORY) {
+ selectFolderButton.setVisibility(View.GONE);
+ }// } else {//if(currentAction == this.SELECT_DIRECTORY) {
+ }// private void initializeButtons() {
+
+ private void loadDirectoryUp() {
+ // present directory removed from list
+ String s = pathDirsList.remove(pathDirsList.size() - 1);
+ // path modified to exclude present directory
+ path = new File(path.toString().substring(0,
+ path.toString().lastIndexOf(s)));
+ fileList.clear();
+ }
+
+ private void updateCurrentDirectoryTextView() {
+ int i = 0;
+ String curDirString = "";
+ while (i < pathDirsList.size()) {
+ curDirString += pathDirsList.get(i) + "/";
+ i++;
+ }
+ if (pathDirsList.size() == 0) {
+ ((Button) this.findViewById(R.id.upDirectoryButton))
+ .setEnabled(false);
+ curDirString = "/";
+ } else
+ ((Button) this.findViewById(R.id.upDirectoryButton))
+ .setEnabled(true);
+ long freeSpace = getFreeSpace(curDirString);
+ String formattedSpaceString = formatBytes(freeSpace);
+ if (freeSpace == 0) {
+ Log.d(LOGTAG, "NO FREE SPACE");
+ File currentDir = new File(curDirString);
+ if(!currentDir.canWrite())
+ formattedSpaceString = "NON Writable";
+ }
+
+ ((Button) this.findViewById(R.id.selectCurrentDirectoryButton))
+ .setText("Select\n[" + formattedSpaceString
+ + "]");
+
+ ((TextView) this.findViewById(R.id.currentDirectoryTextView))
+ .setText("Current directory: " + curDirString);
+ }// END private void updateCurrentDirectoryTextView() {
+
+ private void showToast(String message) {
+ Toast.makeText(this, message, Toast.LENGTH_LONG).show();
+ }
+
+ private void initializeFileListView() {
+ ListView lView = (ListView) this.findViewById(R.id.fileListView);
+ LinearLayout.LayoutParams lParam = new LinearLayout.LayoutParams(
+ LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT);
+ lParam.setMargins(15, 5, 15, 5);
+ lView.setAdapter(this.adapter);
+ lView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+ public void onItemClick(AdapterView<?> parent, View view,
+ int position, long id) {
+ chosenFile = fileList.get(position).file;
+ File sel = new File(path + "/" + chosenFile);
+ Log.d(LOGTAG, "Clicked:" + chosenFile);
+ if (sel.isDirectory()) {
+ if (sel.canRead()) {
+ // Adds chosen directory to list
+ pathDirsList.add(chosenFile);
+ path = new File(sel + "");
+ Log.d(LOGTAG, "Just reloading the list");
+ loadFileList();
+ adapter.notifyDataSetChanged();
+ updateCurrentDirectoryTextView();
+ Log.d(LOGTAG, path.getAbsolutePath());
+ } else {// if(sel.canRead()) {
+ showToast("Path does not exist or cannot be read");
+ }// } else {//if(sel.canRead()) {
+ }// if (sel.isDirectory()) {
+ // File picked or an empty directory message clicked
+ else {// if (sel.isDirectory()) {
+ Log.d(LOGTAG, "item clicked");
+ if (!directoryShownIsEmpty) {
+ Log.d(LOGTAG, "File selected:" + chosenFile);
+ returnFileFinishActivity(sel.getAbsolutePath());
+ }
+ }// else {//if (sel.isDirectory()) {
+ }// public void onClick(DialogInterface dialog, int which) {
+ });// lView.setOnClickListener(
+ }// private void initializeFileListView() {
+
+ private void returnDirectoryFinishActivity() {
+ Intent retIntent = new Intent();
+ retIntent.putExtra(returnDirectoryParameter, path.getAbsolutePath());
+ this.setResult(RESULT_OK, retIntent);
+ this.finish();
+ }// END private void returnDirectoryFinishActivity() {
+
+ private void returnFileFinishActivity(String filePath) {
+ Intent retIntent = new Intent();
+ retIntent.putExtra(returnFileParameter, filePath);
+ this.setResult(RESULT_OK, retIntent);
+ this.finish();
+ }// END private void returnDirectoryFinishActivity() {
+
+ private void loadFileList() {
+ try {
+ path.mkdirs();
+ } catch (SecurityException e) {
+ Log.e(LOGTAG, "unable to write on the sd card ");
+ }
+ fileList.clear();
+
+ if (path.exists() && path.canRead()) {
+ FilenameFilter filter = new FilenameFilter() {
+ public boolean accept(File dir, String filename) {
+ File sel = new File(dir, filename);
+ boolean showReadableFile = showHiddenFilesAndDirs
+ || sel.canRead();
+ // Filters based on whether the file is hidden or not
+ if (currentAction == SELECT_DIRECTORY) {
+ return (sel.isDirectory() && showReadableFile);
+ }
+ if (currentAction == SELECT_FILE) {
+
+ // If it is a file check the extension if provided
+ if (sel.isFile() && filterFileExtension != null) {
+ return (showReadableFile && sel.getName().endsWith(
+ filterFileExtension));
+ }
+ return (showReadableFile);
+ }
+ return true;
+ }// public boolean accept(File dir, String filename) {
+ };// FilenameFilter filter = new FilenameFilter() {
+
+ String[] fList = path.list(filter);
+ this.directoryShownIsEmpty = false;
+ for (int i = 0; i < fList.length; i++) {
+ // Convert into file path
+ File sel = new File(path, fList[i]);
+ Log.d(LOGTAG,
+ "File:" + fList[i] + " readable:"
+ + (Boolean.valueOf(sel.canRead())).toString());
+ int drawableID = R.drawable.file_icon;
+ boolean canRead = sel.canRead();
+ // Set drawables
+ if (sel.isDirectory()) {
+ if (canRead) {
+ drawableID = R.drawable.folder_icon;
+ } else {
+ drawableID = R.drawable.folder_icon_light;
+ }
+ }
+ fileList.add(i, new Item(fList[i], drawableID, canRead));
+ }// for (int i = 0; i < fList.length; i++) {
+ if (fileList.size() == 0) {
+ // Log.d(LOGTAG, "This directory is empty");
+ this.directoryShownIsEmpty = true;
+ fileList.add(0, new Item("Directory is empty", -1, true));
+ } else {// sort non empty list
+ Collections.sort(fileList, new ItemFileNameComparator());
+ }
+ } else {
+ Log.e(LOGTAG, "path does not exist or cannot be read");
+ }
+ // Log.d(TAG, "loadFileList finished");
+ }// private void loadFileList() {
+
+ private void createFileListAdapter() {
+ adapter = new ArrayAdapter<Item>(this,
+ android.R.layout.select_dialog_item, android.R.id.text1,
+ fileList) {
+ @Override
+ public View getView(int position, View convertView, ViewGroup parent) {
+ // creates view
+ View view = super.getView(position, convertView, parent);
+ TextView textView = (TextView) view
+ .findViewById(android.R.id.text1);
+ // put the image on the text view
+ int drawableID = 0;
+ if (fileList.get(position).icon != -1) {
+ // If icon == -1, then directory is empty
+ drawableID = fileList.get(position).icon;
+ }
+ textView.setCompoundDrawablesWithIntrinsicBounds(drawableID, 0,
+ 0, 0);
+
+ textView.setEllipsize(null);
+
+ // add margin between image and text (support various screen
+ // densities)
+ // int dp5 = (int) (5 *
+ // getResources().getDisplayMetrics().density + 0.5f);
+ int dp3 = (int) (3 * getResources().getDisplayMetrics().density + 0.5f);
+ // TODO: change next line for empty directory, so text will be
+ // centered
+ textView.setCompoundDrawablePadding(dp3);
+ return view;
+ }// public View getView(int position, View convertView, ViewGroup
+ };// adapter = new ArrayAdapter<Item>(this,
+ }// private createFileListAdapter(){
+
+ private class Item {
+ public String file;
+ public int icon;
+ public boolean canRead;
+
+ public Item(String file, Integer icon, boolean canRead) {
+ this.file = file;
+ this.icon = icon;
+ }
+
+ @Override
+ public String toString() {
+ return file;
+ }
+ }// END private class Item {
+
+ private class ItemFileNameComparator implements Comparator<Item> {
+ public int compare(Item lhs, Item rhs) {
+ return lhs.file.toLowerCase().compareTo(rhs.file.toLowerCase());
+ }
+ }
+
+ public void onConfigurationChanged(Configuration newConfig) {
+ super.onConfigurationChanged(newConfig);
+ if (newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE) {
+ Log.d(LOGTAG, "ORIENTATION_LANDSCAPE");
+ } else if (newConfig.orientation == Configuration.ORIENTATION_PORTRAIT) {
+ Log.d(LOGTAG, "ORIENTATION_PORTRAIT");
+ }
+ // Layout apparently changes itself, only have to provide good onMeasure
+ // in custom components
+ // TODO: check with keyboard
+ // if(newConfig.keyboard == Configuration.KEYBOARDHIDDEN_YES)
+ }// END public void onConfigurationChanged(Configuration newConfig) {
+
+ public static long getFreeSpace(String path) {
+ StatFs stat = new StatFs(path);
+ long availSize = (long) stat.getAvailableBlocks()
+ * (long) stat.getBlockSize();
+ return availSize;
+ }// END public static long getFreeSpace(String path) {
+
+ public static String formatBytes(long bytes) {
+ // TODO: add flag to which part is needed (e.g. GB, MB, KB or bytes)
+ String retStr = "";
+ // One binary gigabyte equals 1,073,741,824 bytes.
+ if (bytes > 1073741824) {// Add GB
+ long gbs = bytes / 1073741824;
+ retStr += (new Long(gbs)).toString() + "GB ";
+ bytes = bytes - (gbs * 1073741824);
+ }
+ // One MB - 1048576 bytes
+ if (bytes > 1048576) {// Add GB
+ long mbs = bytes / 1048576;
+ retStr += (new Long(mbs)).toString() + "MB ";
+ bytes = bytes - (mbs * 1048576);
+ }
+ if (bytes > 1024) {
+ long kbs = bytes / 1024;
+ retStr += (new Long(kbs)).toString() + "KB";
+ bytes = bytes - (kbs * 1024);
+ } else
+ retStr += (new Long(bytes)).toString() + " bytes";
+ return retStr;
+ }// public static String formatBytes(long bytes){
+
+}// END public class FileBrowserActivity extends Activity {
diff --git a/navit/android/src/org/navitproject/navit/Navit.java b/navit/android/src/org/navitproject/navit/Navit.java
index 6290d4ac5..e2d122de2 100644
--- a/navit/android/src/org/navitproject/navit/Navit.java
+++ b/navit/android/src/org/navitproject/navit/Navit.java
@@ -1,919 +1,899 @@
-/**
- * Navit, a modular navigation system.
- * Copyright (C) 2005-2008 Navit Team
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-package org.navitproject.navit;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.lang.reflect.Field;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.Locale;
-import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import android.annotation.TargetApi;
-import android.app.Activity;
-import android.app.ActivityManager.TaskDescription;
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.app.Notification;
-import android.app.NotificationManager;
-import android.app.PendingIntent;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.content.pm.ApplicationInfo;
-import android.content.pm.PackageManager;
-import android.content.pm.PackageManager.NameNotFoundException;
-import android.content.res.Configuration;
-import android.content.res.Resources;
-import android.graphics.Bitmap;
-import android.graphics.BitmapFactory;
-import android.graphics.Color;
-import android.graphics.Point;
-import android.Manifest;
-import android.media.AudioManager;
-import android.net.Uri;
-import android.os.Build;
-import android.os.Bundle;
-import android.os.Environment;
-import android.os.Message;
-import android.os.PowerManager;
-import android.support.v4.app.ActivityCompat;
-import android.support.v4.content.ContextCompat;
-import android.text.SpannableString;
-import android.text.method.LinkMovementMethod;
-import android.text.util.Linkify;
-import android.util.DisplayMetrics;
-import android.util.Log;
-import android.view.Display;
-import android.view.Menu;
-import android.view.MenuItem;
-import android.view.View;
-import android.view.Window;
-import android.view.WindowManager;
-import android.view.inputmethod.InputMethodManager;
-import android.widget.RelativeLayout;
-import android.widget.TextView;
-import android.widget.Toast;
-import android.support.v4.app.NotificationCompat;
-
-
-public class Navit extends Activity
-{
-
- public NavitDialogs dialogs;
- private PowerManager.WakeLock wl;
- private NavitActivityResult ActivityResults[];
- public static InputMethodManager mgr = null;
- public static DisplayMetrics metrics = null;
- public static int status_bar_height = 0;
- public static int action_bar_default_height = 0;
- public static int navigation_bar_height = 0;
- public static int navigation_bar_height_landscape= 0;
- public static int navigation_bar_width = 0;
- public static Boolean show_soft_keyboard = false;
- public static Boolean show_soft_keyboard_now_showing = false;
- public static long last_pressed_menu_key = 0L;
- public static long time_pressed_menu_key = 0L;
- private static Intent startup_intent = null;
- private static long startup_intent_timestamp = 0L;
- public static String my_display_density = "mdpi";
- public static final int NavitDownloaderSelectMap_id = 967;
- public static final int NavitAddressSearch_id = 70;
- public static final int NavitSelectStorage_id = 43;
- public static String NavitLanguage;
- public static Resources NavitResources = null;
- static final String NAVIT_PACKAGE_NAME = "org.navitproject.navit";
- static final String TAG = "Navit";
- static String map_filename_path = null;
- static final String NAVIT_DATA_DIR = "/data/data/" + NAVIT_PACKAGE_NAME;
- static final String NAVIT_DATA_SHARE_DIR = NAVIT_DATA_DIR + "/share";
- public static final String NAVIT_PREFS = "NavitPrefs";
- Boolean isFullscreen = false;
- private static final int MY_PERMISSIONS_REQUEST_ALL = 101;
- public static NotificationManager nm;
-
-
- /**
- * @brief A Runnable to restore soft input when the user returns to the activity.
- *
- * An instance of this class can be passed to the main message queue in the Activity's
- * {@code onRestore()} method.
- */
- private class SoftInputRestorer implements Runnable {
- public void run() {
- Navit.this.showNativeKeyboard();
- }
- }
-
-
- public void removeFileIfExists(String source) {
- File file = new File(source);
-
- if (!file.exists())
- return;
-
- file.delete();
- }
-
- public void copyFileIfExists(String source, String destination) throws IOException {
- File file = new File(source);
-
- if (!file.exists())
- return;
-
- FileInputStream is = null;
- FileOutputStream os = null;
-
- try {
- is = new FileInputStream(source);
- os = new FileOutputStream(destination);
-
- int len;
- byte buffer[] = new byte[1024];
-
- while ((len = is.read(buffer)) != -1) {
- os.write(buffer, 0, len);
- }
- } finally {
- /* Close the FileStreams to prevent Resource leaks */
- if (is != null)
- is.close();
-
- if (os != null)
- os.close();
- }
- return;
- }
-
-
- public static String T(String in)
- {
- return NavitTextTranslations.get_text(in);
- }
-
- private boolean extractRes(String resname, String result) {
- boolean needs_update = false;
- Log.e(TAG, "Res Name " + resname + ", result " + result);
- int id = NavitResources.getIdentifier(resname, "raw", NAVIT_PACKAGE_NAME);
- Log.e(TAG, "Res ID " + id);
- if (id == 0)
- return false;
-
- File resultfile = new File(result);
- if (!resultfile.exists()) {
- needs_update = true;
- File path = resultfile.getParentFile();
- if ( !path.exists() && !resultfile.getParentFile().mkdirs())
- return false;
- } else {
- PackageManager pm = getPackageManager();
- ApplicationInfo appInfo;
- long apkUpdateTime = 0;
- try {
- appInfo = pm.getApplicationInfo(NAVIT_PACKAGE_NAME, 0);
- apkUpdateTime = new File(appInfo.sourceDir).lastModified();
- } catch (NameNotFoundException e) {
- Log.e(TAG, "Could not read package infos");
- e.printStackTrace();
- }
- if (apkUpdateTime > resultfile.lastModified())
- needs_update = true;
- }
-
- if (needs_update) {
- Log.e(TAG, "Extracting resource");
-
- try {
- InputStream resourcestream = NavitResources.openRawResource(id);
- FileOutputStream resultfilestream = new FileOutputStream(resultfile);
- byte[] buf = new byte[1024];
- int i = 0;
- while ((i = resourcestream.read(buf)) != -1) {
- resultfilestream.write(buf, 0, i);
- }
- resultfilestream.close();
- } catch (Exception e) {
- Log.e(TAG, "Exception " + e.getMessage());
- return false;
- }
- }
- return true;
- }
-
- private void showInfos()
- {
- SharedPreferences settings = getSharedPreferences(NAVIT_PREFS, MODE_PRIVATE);
- boolean firstStart = settings.getBoolean("firstStart", true);
-
- if (firstStart)
- {
- AlertDialog.Builder infobox = new AlertDialog.Builder(this);
- infobox.setTitle(getString(R.string.initial_info_box_title)); // TRANS
- infobox.setCancelable(false);
-
- infobox.setMessage(R.string.initial_info_box_message);
-
- // TRANS
- infobox.setPositiveButton(getString(R.string.initial_info_box_OK), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface arg0, int arg1) {
- Log.d(TAG, "Ok, user saw the infobox");
- }
- });
-
- // TRANS
- infobox.setNeutralButton(getString(R.string.initial_info_box_more_info), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface arg0, int arg1) {
- Log.d(TAG, "user wants more info, show the website");
- String url = "http://wiki.navit-project.org/index.php/Navit_on_Android";
- Intent i = new Intent(Intent.ACTION_VIEW);
- i.setData(Uri.parse(url));
- startActivity(i);
- }
- });
- infobox.show();
- SharedPreferences.Editor edit_settings = settings.edit();
- edit_settings.putBoolean("firstStart", false);
- edit_settings.commit();
- }
- }
-
- /** Called when the activity is first created. */
- @Override
- public void onCreate(Bundle savedInstanceState)
- {
- super.onCreate(savedInstanceState);
- if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB)
- this.requestWindowFeature(Window.FEATURE_NO_TITLE);
- else
- this.getActionBar().hide();
-
- dialogs = new NavitDialogs(this);
-
- NavitResources = getResources();
-
- // only take arguments here, onResume gets called all the time (e.g. when screenblanks, etc.)
- Navit.startup_intent = this.getIntent();
- // hack! Remember time stamps, and only allow 4 secs. later in onResume to set target!
- Navit.startup_intent_timestamp = System.currentTimeMillis();
- Log.d(TAG, "**1**A " + startup_intent.getAction());
- Log.d(TAG, "**1**D " + startup_intent.getDataString());
-
- // init translated text
- NavitTextTranslations.init();
-
- // NOTIFICATION
- // Setup the status bar notification
- // This notification is removed in the exit() function
- nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); // Grab a handle to the NotificationManager
- PendingIntent appIntent = PendingIntent.getActivity(getApplicationContext(), 0, getIntent(), 0);
-
- NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
- builder.setContentIntent(appIntent);
- builder.setAutoCancel(false).setOngoing(true);
- builder.setContentTitle(getString(R.string.app_name));
- builder.setContentText(getString(R.string.notification_event_default));
- builder.setSmallIcon(R.drawable.ic_notify);
- Notification NavitNotification = builder.build();
- nm.notify(R.string.app_name, NavitNotification);// Show the notification
-
- // Status and navigation bar sizes
- // These are platform defaults and do not change with rotation, but we have to figure out which ones apply
- // (is the navigation bar visible? on the side or at the bottom?)
- Resources resources = getResources();
- int shid = resources.getIdentifier("status_bar_height", "dimen", "android");
- int adhid = resources.getIdentifier("action_bar_default_height", "dimen", "android");
- int nhid = resources.getIdentifier("navigation_bar_height", "dimen", "android");
- int nhlid = resources.getIdentifier("navigation_bar_height_landscape", "dimen", "android");
- int nwid = resources.getIdentifier("navigation_bar_width", "dimen", "android");
- status_bar_height = (shid > 0) ? resources.getDimensionPixelSize(shid) : 0;
- action_bar_default_height = (adhid > 0) ? resources.getDimensionPixelSize(adhid) : 0;
- navigation_bar_height = (nhid > 0) ? resources.getDimensionPixelSize(nhid) : 0;
- navigation_bar_height_landscape = (nhlid > 0) ? resources.getDimensionPixelSize(nhlid) : 0;
- navigation_bar_width = (nwid > 0) ? resources.getDimensionPixelSize(nwid) : 0;
- Log.d(TAG, String.format("status_bar_height=%d, action_bar_default_height=%d, navigation_bar_height=%d, navigation_bar_height_landscape=%d, navigation_bar_width=%d",
- status_bar_height, action_bar_default_height, navigation_bar_height, navigation_bar_height_landscape, navigation_bar_width));
- if ((ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED)||
- (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED)) {
- Log.d (TAG,"ask for permission(s)");
- ActivityCompat.requestPermissions(this,
- new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.ACCESS_FINE_LOCATION},MY_PERMISSIONS_REQUEST_ALL);
- }
- // get the local language -------------
- Locale locale = java.util.Locale.getDefault();
- String lang = locale.getLanguage();
- String langu = lang;
- String langc = lang;
- Log.d(TAG, "lang=" + lang);
- int pos = langu.indexOf('_');
- if (pos != -1)
- {
- langc = langu.substring(0, pos);
- NavitLanguage = langc + langu.substring(pos).toUpperCase(locale);
- Log.d(TAG, "substring lang " + NavitLanguage.substring(pos).toUpperCase(locale));
- // set lang. for translation
- NavitTextTranslations.main_language = langc;
- NavitTextTranslations.sub_language = NavitLanguage.substring(pos).toUpperCase(locale);
- }
- else
- {
- String country = locale.getCountry();
- Log.d(TAG, "Country1 " + country);
- Log.d(TAG, "Country2 " + country.toUpperCase(locale));
- NavitLanguage = langc + "_" + country.toUpperCase(locale);
- // set lang. for translation
- NavitTextTranslations.main_language = langc;
- NavitTextTranslations.sub_language = country.toUpperCase(locale);
- }
- Log.d(TAG, "Language " + lang);
-
- SharedPreferences prefs = getSharedPreferences(NAVIT_PREFS,MODE_PRIVATE);
- map_filename_path = prefs.getString("filenamePath", Environment.getExternalStorageDirectory().getPath() + "/navit/");
-
- // make sure the new path for the navitmap.bin file(s) exist!!
- File navit_maps_dir = new File(map_filename_path);
- navit_maps_dir.mkdirs();
-
- // make sure the share dir exists
- File navit_data_share_dir = new File(NAVIT_DATA_SHARE_DIR);
- navit_data_share_dir.mkdirs();
-
- Display display_ = getWindowManager().getDefaultDisplay();
- int width_ = display_.getWidth();
- int height_ = display_.getHeight();
- metrics = new DisplayMetrics();
- display_.getMetrics(Navit.metrics);
- int densityDpi = (int)(( Navit.metrics.density*160)-.5f);
- Log.d(TAG, "Navit -> pixels x=" + width_ + " pixels y=" + height_);
- Log.d(TAG, "Navit -> dpi=" + densityDpi);
- Log.d(TAG, "Navit -> density=" + Navit.metrics.density);
- Log.d(TAG, "Navit -> scaledDensity=" + Navit.metrics.scaledDensity);
-
- ActivityResults = new NavitActivityResult[16];
- setVolumeControlStream(AudioManager.STREAM_MUSIC);
- PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
- wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE,"NavitDoNotDimScreen");
-
- if (!extractRes(langc, NAVIT_DATA_DIR + "/locale/" + langc + "/LC_MESSAGES/navit.mo"))
- {
- Log.e(TAG, "Failed to extract language resource " + langc);
- }
-
- if (densityDpi <= 120)
- {
- my_display_density = "ldpi";
- }
- else if (densityDpi <= 160)
- {
- my_display_density = "mdpi";
- }
- else if (densityDpi < 240)
- {
- my_display_density = "hdpi";
- }
- else if (densityDpi < 320)
- {
- my_display_density = "xhdpi";
- }
- else if (densityDpi < 480)
- {
- my_display_density = "xxhdpi";
- }
- else if (densityDpi < 640)
- {
- my_display_density = "xxxhdpi";
- }
- else
- {
- Log.e(TAG, "found device of very high density ("+densityDpi+")");
- Log.e(TAG, "using xxxhdpi values");
- my_display_density = "xxxhdpi";
- }
-
- if (!extractRes("navit" + my_display_density, NAVIT_DATA_DIR + "/share/navit.xml"))
- {
- Log.e(TAG, "Failed to extract navit.xml for " + my_display_density);
- }
-
- // --> dont use android.os.Build.VERSION.SDK_INT, needs API >= 4
- Log.d(TAG, "android.os.Build.VERSION.SDK_INT=" + Integer.valueOf(android.os.Build.VERSION.SDK));
- NavitMain(this, NavitLanguage, Integer.valueOf(android.os.Build.VERSION.SDK), my_display_density, NAVIT_DATA_DIR+"/bin/navit",map_filename_path);
-
- showInfos();
-
- Navit.mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
- }
-
- @Override
- public void onResume()
- {
- super.onResume();
- Log.d(TAG, "OnResume");
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
- /* Required to make system bars fully transparent */
- getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
- | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
- | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
- }
- //InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
- // DEBUG
- // intent_data = "google.navigation:q=Wien Burggasse 27";
- // intent_data = "google.navigation:q=48.25676,16.643";
- // intent_data = "google.navigation:ll=48.25676,16.643&q=blabla-strasse";
- // intent_data = "google.navigation:ll=48.25676,16.643";
- if (startup_intent != null)
- {
- if (System.currentTimeMillis() <= Navit.startup_intent_timestamp + 4000L)
- {
- Log.d(TAG, "**2**A " + startup_intent.getAction());
- Log.d(TAG, "**2**D " + startup_intent.getDataString());
- String navi_scheme = startup_intent.getScheme();
- if ( navi_scheme != null && navi_scheme.equals("google.navigation")) {
- parseNavigationURI(startup_intent.getData().getSchemeSpecificPart());
- }
- }
- else {
- Log.e(TAG, "timestamp for navigate_to expired! not using data");
- }
- }
- Log.d(TAG, "onResume");
- if (show_soft_keyboard_now_showing) {
- /* Calling showNativeKeyboard() directly won't work here, we need to use the message queue */
- View cf = getCurrentFocus();
- if (cf == null)
- Log.e(TAG, "no view in focus, can't get a handler");
- else
- cf.getHandler().post(new SoftInputRestorer());
- }
- }
-
- @Override
- public void onPause() {
- super.onPause();
- Log.d(TAG, "onPause");
- if (show_soft_keyboard_now_showing) {
- Log.d(TAG, "onPause:hiding soft input");
- this.hideNativeKeyboard();
- show_soft_keyboard_now_showing = true;
- }
- }
-
- @Override
- public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
- switch (requestCode) {
- case MY_PERMISSIONS_REQUEST_ALL: {
- if (grantResults.length > 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED
- && grantResults[1] == PackageManager.PERMISSION_GRANTED) {
- // ok, we got permissions
- } else {
- AlertDialog.Builder infobox = new AlertDialog.Builder(this);
- infobox.setTitle(getString(R.string.permissions_info_box_title)); // TRANS
- infobox.setCancelable(false);
- final TextView message = new TextView(this);
- message.setFadingEdgeLength(20);
- message.setVerticalFadingEdgeEnabled(true);
- RelativeLayout.LayoutParams rlp = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.FILL_PARENT, RelativeLayout.LayoutParams.FILL_PARENT);
- message.setLayoutParams(rlp);
- final SpannableString s = new SpannableString(getString(R.string.permissions_not_granted)); // TRANS
- message.setText(s);
- message.setMovementMethod(LinkMovementMethod.getInstance());
- infobox.setView(message);
- // TRANS
- infobox.setPositiveButton(getString(R.string.initial_info_box_OK), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface arg0, int arg1) {
- exit();
- }
- });
- infobox.show();
- }
- return;
- }
- }
- }
-
- private void parseNavigationURI(String schemeSpecificPart) {
- String naviData[]= schemeSpecificPart.split("&");
- Pattern p = Pattern.compile("(.*)=(.*)");
- Map<String,String> params = new HashMap<String,String>();
- for (int count=0; count < naviData.length; count++) {
- Matcher m = p.matcher(naviData[count]);
-
- if (m.matches()) {
- params.put(m.group(1), m.group(2));
- }
- }
-
- // d: google.navigation:q=blabla-strasse # (this happens when you are offline, or from contacts)
- // a: google.navigation:ll=48.25676,16.643&q=blabla-strasse
- // c: google.navigation:ll=48.25676,16.643
- // b: google.navigation:q=48.25676,16.643
-
- Float lat;
- Float lon;
- Bundle b = new Bundle();
-
- String geoString = params.get("ll");
- if (geoString != null) {
- String address = params.get("q");
- if (address != null) b.putString("q", address);
- }
- else {
- geoString = params.get("q");
- }
-
- if ( geoString != null) {
- if (geoString.matches("^[+-]{0,1}\\d+(|\\.\\d*),[+-]{0,1}\\d+(|\\.\\d*)$")) {
- String geo[] = geoString.split(",");
- if (geo.length == 2) {
- try {
- lat = Float.valueOf(geo[0]);
- lon = Float.valueOf(geo[1]);
- b.putFloat("lat", lat);
- b.putFloat("lon", lon);
- Message msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_SET_DESTINATION.ordinal());
-
- msg.setData(b);
- msg.sendToTarget();
- Log.e(TAG, "target found (b): " + geoString);
- } catch (NumberFormatException e) { } // nothing to do here
- }
- }
- else {
- start_targetsearch_from_intent(geoString);
- }
- }
- }
-
- public void setActivityResult(int requestCode, NavitActivityResult ActivityResult)
- {
- ActivityResults[requestCode] = ActivityResult;
- }
-
- /*
- * This is unused since we dont have the dropdown
- * TODO: recheck if this is right and remove this!
- */
- @Override
- public boolean onPrepareOptionsMenu(Menu menu)
- {
- super.onPrepareOptionsMenu(menu);
- //Log.e("Navit","onPrepareOptionsMenu");
- // this gets called every time the menu is opened!!
- // change menu items here!
- menu.clear();
-
- // group-id,item-id,sort order number
- //menu.add(1, 1, 100, getString(R.string.optionsmenu_zoom_in)); //TRANS
- //menu.add(1, 2, 200, getString(R.string.optionsmenu_zoom_out)); //TRANS
-
- menu.add(1, 3, 300, getString(R.string.optionsmenu_download_maps)); //TRANS
- menu.add(1, 5, 400, getString(R.string.optionsmenu_toggle_poi)); //TRANS
-
- menu.add(1, 6, 500, getString(R.string.optionsmenu_address_search)); //TRANS
- menu.add(1, 10, 600, getString(R.string.optionsmenu_set_map_location));
-
- menu.add(1, 99, 900, getString(R.string.optionsmenu_exit_navit)); //TRANS
-
- /* Only show the Backup to SD-Card Option if we really have one */
- if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED))
- menu.add(1, 7, 700, getString(R.string.optionsmenu_backup_restore)); //TRANS
-
- return true;
- }
-
- // define callback id here
- public static NavitGraphics N_NavitGraphics = null;
-
- // callback id gets set here when called from NavitGraphics
- public static void setKeypressCallback(int kp_cb_id, NavitGraphics ng)
- {
- N_NavitGraphics = ng;
- }
-
- public static void setMotionCallback(int mo_cb_id, NavitGraphics ng)
- {
- N_NavitGraphics = ng;
- }
-
- public void start_targetsearch_from_intent(String target_address)
- {
- if (target_address == null || target_address.equals(""))
- {
- // empty search string entered
- Toast.makeText(getApplicationContext(), getString(R.string.address_search_not_found), Toast.LENGTH_LONG).show(); //TRANS
- }
- else
- {
- Intent search_intent = new Intent(this, NavitAddressSearchActivity.class);
- search_intent.putExtra("search_string", target_address);
- this.startActivityForResult(search_intent, NavitAddressSearch_id);
- }
- }
-
- @Override
- public boolean onOptionsItemSelected(MenuItem item)
- {
- runOptionsItem(item.getItemId());
- return true;
- }
-
- public void runOptionsItem(int id)
- {
- switch (id)
- {
- case 1 :
- // zoom in
- Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_ZOOM_IN.ordinal()).sendToTarget();
- // if we zoom, hide the bubble
- Log.d(TAG, "onOptionsItemSelected -> zoom in");
- break;
- case 2 :
- // zoom out
- Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_ZOOM_OUT.ordinal()).sendToTarget();
- // if we zoom, hide the bubble
- Log.d(TAG, "onOptionsItemSelected -> zoom out");
- break;
- case 3 :
- // map download menu
- Intent map_download_list_activity = new Intent(this, NavitDownloadSelectMapActivity.class);
- startActivityForResult(map_download_list_activity, Navit.NavitDownloaderSelectMap_id);
- break;
- case 5 :
- // toggle the normal POI layers and labels (to avoid double POIs)
- Message msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_CALL_CMD.ordinal());
- Bundle b = new Bundle();
- b.putString("cmd", "toggle_layer(\"POI Symbols\");");
- msg.setData(b);
- msg.sendToTarget();
-
- msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_CALL_CMD.ordinal());
- b = new Bundle();
- b.putString("cmd", "toggle_layer(\"POI Labels\");");
- msg.setData(b);
- msg.sendToTarget();
-
- // toggle full POI icons on/off
- msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_CALL_CMD.ordinal());
- b = new Bundle();
- b.putString("cmd", "toggle_layer(\"Android-POI-Icons-full\");");
- msg.setData(b);
- msg.sendToTarget();
-
- break;
- case 6 :
- // ok startup address search activity
- Intent search_intent = new Intent(this, NavitAddressSearchActivity.class);
- this.startActivityForResult(search_intent, NavitAddressSearch_id);
- break;
- case 7 :
- /* Backup / Restore */
- showDialog(NavitDialogs.DIALOG_BACKUP_RESTORE);
- break;
- case 10:
- setMapLocation();
- break;
- case 99 :
- // exit
- this.onStop();
- this.exit();
- break;
- }
- }
-
-
- /**
- * @brief Shows the Options menu.
- *
- * Calling this method has the same effect as pressing the hardware Menu button, where present, or touching
- * the overflow button in the Action bar.
- */
- public void showMenu() {
- openOptionsMenu();
- }
-
-
- /**
- * @brief Shows the native keyboard or other input method.
- *
- * @return {@code true} if an input method is going to be displayed, {@code false} if not
- */
- public int showNativeKeyboard() {
- /*
- * Apologies for the huge mess that this function is, but Android's soft input API is a big
- * nightmare. Its devs have mercifully given us an option to show or hide the keyboard, but
- * there is no reliable way to figure out if it is actually showing, let alone how much of the
- * screen it occupies, so our best bet is guesswork.
- */
- Configuration config = getResources().getConfiguration();
- if ((config.keyboard == Configuration.KEYBOARD_QWERTY) && (config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO))
- /* physical keyboard present, exit */
- return 0;
-
- /* Use SHOW_FORCED here, else keyboard won't show in landscape mode */
- mgr.showSoftInput(getCurrentFocus(), InputMethodManager.SHOW_FORCED);
- show_soft_keyboard_now_showing = true;
-
- /*
- * Crude way to estimate the height occupied by the keyboard: for AOSP on KitKat and Lollipop it
- * is about 62-63% of available screen width (in portrait mode) but no more than slightly above
- * 46% of height (in landscape mode).
- */
- Display display_ = getWindowManager().getDefaultDisplay();
- int width_ = display_.getWidth();
- int height_ = display_.getHeight();
- int maxHeight = height_ * 47 / 100;
- int inputHeight = width_ * 63 / 100;
- if (inputHeight > (maxHeight))
- inputHeight = maxHeight;
-
- /* the receiver isn't going to fire before the UI thread becomes idle, well after this method returns */
- Log.d(TAG, "showNativeKeyboard:return (assuming true)");
- return inputHeight;
- }
-
-
- /**
- * @brief Hides the native keyboard or other input method.
- */
- public void hideNativeKeyboard() {
- mgr.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
- show_soft_keyboard_now_showing = false;
- }
-
-
- void setDestination(float latitude, float longitude, String address) {
- Toast.makeText( getApplicationContext(),getString(R.string.address_search_set_destination) + "\n" + address, Toast.LENGTH_LONG).show(); //TRANS
-
- Message msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_SET_DESTINATION.ordinal());
- Bundle b = new Bundle();
- b.putFloat("lat", latitude);
- b.putFloat("lon", longitude);
- b.putString("q", address);
- msg.setData(b);
- msg.sendToTarget();
- }
-
- protected void onActivityResult(int requestCode, int resultCode, Intent data)
- {
- switch (requestCode)
- {
- case Navit.NavitDownloaderSelectMap_id :
- if (resultCode == Activity.RESULT_OK)
- {
- Message msg = dialogs.obtainMessage(NavitDialogs.MSG_START_MAP_DOWNLOAD
- , data.getIntExtra("map_index", -1), 0);
- msg.sendToTarget();
- }
- break;
- case NavitAddressSearch_id :
- if (resultCode == Activity.RESULT_OK) {
- Bundle destination = data.getExtras();
- Toast.makeText( getApplicationContext(),getString(R.string.address_search_set_destination) + "\n" + destination.getString(("q")), Toast.LENGTH_LONG).show(); //TRANS
-
- Message msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_SET_DESTINATION.ordinal());
- msg.setData(destination);
- msg.sendToTarget();
- }
- break;
- case NavitSelectStorage_id :
- if(resultCode == RESULT_OK) {
- String newDir = data.getStringExtra(FileBrowserActivity.returnDirectoryParameter);
- Log.d(TAG, "selected path= "+newDir);
- if(!newDir.contains("/navit"))
- newDir = newDir+"/navit/";
- else
- newDir = newDir+"/";
- SharedPreferences prefs = this.getSharedPreferences(NAVIT_PREFS,MODE_PRIVATE);
- SharedPreferences.Editor prefs_editor = prefs.edit();
- prefs_editor.putString("filenamePath", newDir);
- prefs_editor.commit();
- Toast.makeText(this, String.format(Navit.T("New location set to %s\nRestart Navit to apply the changes."),newDir),Toast.LENGTH_LONG).show();
- }
- else Log.w(TAG, "select path failed");
- break;
- default :
- ActivityResults[requestCode].onActivityResult(requestCode, resultCode, data);
- break;
- }
- }
-
- @Override
- protected void onPrepareDialog(int id, Dialog dialog) {
- dialogs.prepareDialog(id, dialog);
- super.onPrepareDialog(id, dialog);
- }
-
- protected Dialog onCreateDialog(int id)
- {
- return dialogs.createDialog(id);
- }
-
- @Override
- public boolean onSearchRequested() {
- /* Launch the internal Search Activity */
- Intent search_intent = new Intent(this, NavitAddressSearchActivity.class);
- this.startActivityForResult(search_intent, NavitAddressSearch_id);
-
- return true;
- }
-
- public boolean setMapLocation()
- {
- Intent fileExploreIntent = new Intent(this,FileBrowserActivity.class);
- fileExploreIntent
- .putExtra(FileBrowserActivity.startDirectoryParameter, "/mnt")
- .setAction(FileBrowserActivity.INTENT_ACTION_SELECT_DIR);
- startActivityForResult(fileExploreIntent,NavitSelectStorage_id);
-
- return true;
- }
-
- @Override
- public void onDestroy()
- {
- super.onDestroy();
- Log.d(TAG, "OnDestroy");
- // TODO next call will kill our app the hard way. This should not be necessary, but ensures navit is
- // properly restarted and no resources are wasted with navit in background. Remove this call after
- // code review
- NavitDestroy();
- }
-
- public void fullscreen(int fullscreen) {
- int w, h;
-
- isFullscreen = (fullscreen != 0);
- if (isFullscreen) {
- getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
- getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
- }
- else {
- getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
- getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
- }
-
- Display display_ = getWindowManager().getDefaultDisplay();
- if (Build.VERSION.SDK_INT < 17) {
- w = display_.getWidth();
- h = display_.getHeight();
- } else {
- Point size = new Point();
- display_.getRealSize(size);
- w = size.x;
- h = size.y;
- }
- Log.d(TAG, String.format("Toggle fullscreen, w=%d, h=%d", w, h));
- N_NavitGraphics.handleResize(w, h);
- }
-
- public void disableSuspend()
- {
- wl.acquire();
- wl.release();
- }
-
- public void exit()
- {
- nm.cancelAll();
- NavitVehicle.removeListener();
- NavitDestroy();
- }
-
- public native void NavitMain(Navit x, String lang, int version, String display_density_string, String path, String path2);
- public native void NavitDestroy();
-
- /*
- * this is used to load the 'navit' native library on
- * application startup. The library has already been unpacked at
- * installation time by the package manager.
- */
- static
- {
- System.loadLibrary("navit");
- }
-}
+/**
+ * Navit, a modular navigation system.
+ * Copyright (C) 2005-2008 Navit Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+package org.navitproject.navit;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.pm.ApplicationInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.content.res.Configuration;
+import android.content.res.Resources;
+import android.graphics.Point;
+import android.Manifest;
+import android.media.AudioManager;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Bundle;
+import android.os.Environment;
+import android.os.Message;
+import android.os.PowerManager;
+import android.util.DisplayMetrics;
+import android.util.Log;
+import android.view.Display;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.Window;
+import android.view.WindowManager;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.Toast;
+import android.support.v4.app.NotificationCompat;
+import android.support.v4.app.ActivityCompat;
+import android.support.v4.content.ContextCompat;
+
+public class Navit extends Activity
+{
+
+ public NavitDialogs dialogs;
+ private PowerManager.WakeLock wl;
+ private NavitActivityResult ActivityResults[];
+ public static InputMethodManager mgr = null;
+ public static DisplayMetrics metrics = null;
+ public static int status_bar_height = 0;
+ public static int action_bar_default_height = 0;
+ public static int navigation_bar_height = 0;
+ public static int navigation_bar_height_landscape= 0;
+ public static int navigation_bar_width = 0;
+ public static Boolean show_soft_keyboard = false;
+ public static Boolean show_soft_keyboard_now_showing = false;
+ public static long last_pressed_menu_key = 0L;
+ public static long time_pressed_menu_key = 0L;
+ private static Intent startup_intent = null;
+ private static long startup_intent_timestamp = 0L;
+ public static String my_display_density = "mdpi";
+ public static final int NavitDownloaderSelectMap_id = 967;
+ public static final int NavitAddressSearch_id = 70;
+ public static final int NavitSelectStorage_id = 43;
+ public static String NavitLanguage;
+ public static Resources NavitResources = null;
+ static final String NAVIT_PACKAGE_NAME = "org.navitproject.navit";
+ static final String TAG = "Navit";
+ static String map_filename_path = null;
+ static final String NAVIT_DATA_DIR = "/data/data/" + NAVIT_PACKAGE_NAME;
+ static final String NAVIT_DATA_SHARE_DIR = NAVIT_DATA_DIR + "/share";
+ public static final String NAVIT_PREFS = "NavitPrefs";
+ Boolean isFullscreen = false;
+ private static final int MY_PERMISSIONS_REQUEST_ALL = 101;
+ public static NotificationManager nm;
+ private static Navit navit;
+
+ public static Navit getInstance() {
+ return navit;
+ }
+
+
+ /**
+ * @brief A Runnable to restore soft input when the user returns to the activity.
+ *
+ * An instance of this class can be passed to the main message queue in the Activity's
+ * {@code onRestore()} method.
+ */
+ private class SoftInputRestorer implements Runnable {
+ public void run() {
+ Navit.this.showNativeKeyboard();
+ }
+ }
+
+
+ public void removeFileIfExists(String source) {
+ File file = new File(source);
+
+ if (!file.exists())
+ return;
+
+ file.delete();
+ }
+
+ public void copyFileIfExists(String source, String destination) throws IOException {
+ File file = new File(source);
+
+ if (!file.exists())
+ return;
+
+ FileInputStream is = null;
+ FileOutputStream os = null;
+
+ try {
+ is = new FileInputStream(source);
+ os = new FileOutputStream(destination);
+
+ int len;
+ byte buffer[] = new byte[1024];
+
+ while ((len = is.read(buffer)) != -1) {
+ os.write(buffer, 0, len);
+ }
+ } finally {
+ /* Close the FileStreams to prevent Resource leaks */
+ if (is != null)
+ is.close();
+
+ if (os != null)
+ os.close();
+ }
+ }
+
+
+ public static String T(String in)
+ {
+ return NavitTextTranslations.get_text(in);
+ }
+
+ private boolean extractRes(String resname, String result) {
+ boolean needs_update = false;
+ Log.e(TAG, "Res Name " + resname + ", result " + result);
+ int id = NavitResources.getIdentifier(resname, "raw", NAVIT_PACKAGE_NAME);
+ Log.e(TAG, "Res ID " + id);
+ if (id == 0)
+ return false;
+
+ File resultfile = new File(result);
+ if (!resultfile.exists()) {
+ needs_update = true;
+ File path = resultfile.getParentFile();
+ if ( !path.exists() && !resultfile.getParentFile().mkdirs())
+ return false;
+ } else {
+ PackageManager pm = getPackageManager();
+ ApplicationInfo appInfo;
+ long apkUpdateTime = 0;
+ try {
+ appInfo = pm.getApplicationInfo(NAVIT_PACKAGE_NAME, 0);
+ apkUpdateTime = new File(appInfo.sourceDir).lastModified();
+ } catch (NameNotFoundException e) {
+ Log.e(TAG, "Could not read package infos");
+ e.printStackTrace();
+ }
+ if (apkUpdateTime > resultfile.lastModified())
+ needs_update = true;
+ }
+
+ if (needs_update) {
+ Log.e(TAG, "Extracting resource");
+
+ try {
+ InputStream resourcestream = NavitResources.openRawResource(id);
+ FileOutputStream resultfilestream = new FileOutputStream(resultfile);
+ byte[] buf = new byte[1024];
+ int i = 0;
+ while ((i = resourcestream.read(buf)) != -1) {
+ resultfilestream.write(buf, 0, i);
+ }
+ resultfilestream.close();
+ } catch (Exception e) {
+ Log.e(TAG, "Exception " + e.getMessage());
+ return false;
+ }
+ }
+ return true;
+ }
+
+ private void showInfos()
+ {
+ SharedPreferences settings = getSharedPreferences(NAVIT_PREFS, MODE_PRIVATE);
+ boolean firstStart = settings.getBoolean("firstStart", true);
+
+ if (firstStart)
+ {
+ AlertDialog.Builder infobox = new AlertDialog.Builder(this);
+ infobox.setTitle(getString(R.string.initial_info_box_title)); // TRANS
+ infobox.setCancelable(false);
+
+ infobox.setMessage(R.string.initial_info_box_message);
+
+ // TRANS
+ infobox.setPositiveButton(getString(R.string.initial_info_box_OK), new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface arg0, int arg1) {
+ Log.d(TAG, "Ok, user saw the infobox");
+ }
+ });
+
+ // TRANS
+ infobox.setNeutralButton(getString(R.string.initial_info_box_more_info), new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface arg0, int arg1) {
+ Log.d(TAG, "user wants more info, show the website");
+ String url = "http://wiki.navit-project.org/index.php/Navit_on_Android";
+ Intent i = new Intent(Intent.ACTION_VIEW);
+ i.setData(Uri.parse(url));
+ startActivity(i);
+ }
+ });
+ infobox.show();
+ SharedPreferences.Editor edit_settings = settings.edit();
+ edit_settings.putBoolean("firstStart", false);
+ edit_settings.apply();
+ }
+ }
+
+ /** Called when the activity is first created. */
+ @Override
+ public void onCreate(Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB)
+ this.requestWindowFeature(Window.FEATURE_NO_TITLE);
+ else
+ this.getActionBar().hide();
+
+ navit = this;
+ dialogs = new NavitDialogs(this);
+
+ NavitResources = getResources();
+
+ // only take arguments here, onResume gets called all the time (e.g. when screenblanks, etc.)
+ Navit.startup_intent = this.getIntent();
+ // hack! Remember time stamps, and only allow 4 secs. later in onResume to set target!
+ Navit.startup_intent_timestamp = System.currentTimeMillis();
+ Log.d(TAG, "**1**A " + startup_intent.getAction());
+ Log.d(TAG, "**1**D " + startup_intent.getDataString());
+
+ // init translated text
+ NavitTextTranslations.init();
+
+ // NOTIFICATION
+ // Setup the status bar notification
+ // This notification is removed in the exit() function
+ nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); // Grab a handle to the NotificationManager
+ PendingIntent appIntent = PendingIntent.getActivity(getApplicationContext(), 0, getIntent(), 0);
+
+ NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
+ builder.setContentIntent(appIntent);
+ builder.setAutoCancel(false).setOngoing(true);
+ builder.setContentTitle(getString(R.string.app_name));
+ builder.setContentText(getString(R.string.notification_event_default));
+ builder.setSmallIcon(R.drawable.ic_notify);
+ Notification NavitNotification = builder.build();
+ nm.notify(R.string.app_name, NavitNotification);// Show the notification
+
+ // Status and navigation bar sizes
+ // These are platform defaults and do not change with rotation, but we have to figure out which ones apply
+ // (is the navigation bar visible? on the side or at the bottom?)
+ Resources resources = getResources();
+ int shid = resources.getIdentifier("status_bar_height", "dimen", "android");
+ int adhid = resources.getIdentifier("action_bar_default_height", "dimen", "android");
+ int nhid = resources.getIdentifier("navigation_bar_height", "dimen", "android");
+ int nhlid = resources.getIdentifier("navigation_bar_height_landscape", "dimen", "android");
+ int nwid = resources.getIdentifier("navigation_bar_width", "dimen", "android");
+ status_bar_height = (shid > 0) ? resources.getDimensionPixelSize(shid) : 0;
+ action_bar_default_height = (adhid > 0) ? resources.getDimensionPixelSize(adhid) : 0;
+ navigation_bar_height = (nhid > 0) ? resources.getDimensionPixelSize(nhid) : 0;
+ navigation_bar_height_landscape = (nhlid > 0) ? resources.getDimensionPixelSize(nhlid) : 0;
+ navigation_bar_width = (nwid > 0) ? resources.getDimensionPixelSize(nwid) : 0;
+ Log.d(TAG, String.format("status_bar_height=%d, action_bar_default_height=%d, navigation_bar_height=%d, navigation_bar_height_landscape=%d, navigation_bar_width=%d",
+ status_bar_height, action_bar_default_height, navigation_bar_height, navigation_bar_height_landscape, navigation_bar_width));
+ if ((ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED)||
+ (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED)) {
+ Log.d (TAG,"ask for permission(s)");
+ ActivityCompat.requestPermissions(this,
+ new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE,Manifest.permission.ACCESS_FINE_LOCATION},MY_PERMISSIONS_REQUEST_ALL);
+ }
+ // get the local language -------------
+ Locale locale = java.util.Locale.getDefault();
+ String lang = locale.getLanguage();
+ String langc = lang;
+ Log.d(TAG, "lang=" + lang);
+ int pos = lang.indexOf('_');
+ if (pos != -1)
+ {
+ langc = lang.substring(0, pos);
+ NavitLanguage = langc + lang.substring(pos).toUpperCase(locale);
+ Log.d(TAG, "substring lang " + NavitLanguage.substring(pos).toUpperCase(locale));
+ // set lang. for translation
+ NavitTextTranslations.main_language = langc;
+ NavitTextTranslations.sub_language = NavitLanguage.substring(pos).toUpperCase(locale);
+ }
+ else
+ {
+ String country = locale.getCountry();
+ Log.d(TAG, "Country1 " + country);
+ Log.d(TAG, "Country2 " + country.toUpperCase(locale));
+ NavitLanguage = langc + "_" + country.toUpperCase(locale);
+ // set lang. for translation
+ NavitTextTranslations.main_language = langc;
+ NavitTextTranslations.sub_language = country.toUpperCase(locale);
+ }
+ Log.d(TAG, "Language " + lang);
+
+ SharedPreferences prefs = getSharedPreferences(NAVIT_PREFS,MODE_PRIVATE);
+ map_filename_path = prefs.getString("filenamePath", Environment.getExternalStorageDirectory().getPath() + "/navit/");
+
+ // make sure the new path for the navitmap.bin file(s) exist!!
+ File navit_maps_dir = new File(map_filename_path);
+ navit_maps_dir.mkdirs();
+
+ // make sure the share dir exists
+ File navit_data_share_dir = new File(NAVIT_DATA_SHARE_DIR);
+ navit_data_share_dir.mkdirs();
+
+ Display display_ = getWindowManager().getDefaultDisplay();
+ int width_ = display_.getWidth();
+ int height_ = display_.getHeight();
+ metrics = new DisplayMetrics();
+ display_.getMetrics(Navit.metrics);
+ int densityDpi = (int)(( Navit.metrics.density*160)-.5f);
+ Log.d(TAG, "Navit -> pixels x=" + width_ + " pixels y=" + height_);
+ Log.d(TAG, "Navit -> dpi=" + densityDpi);
+ Log.d(TAG, "Navit -> density=" + Navit.metrics.density);
+ Log.d(TAG, "Navit -> scaledDensity=" + Navit.metrics.scaledDensity);
+
+ ActivityResults = new NavitActivityResult[16];
+ setVolumeControlStream(AudioManager.STREAM_MUSIC);
+ PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
+ wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ON_AFTER_RELEASE,"NavitDoNotDimScreen");
+
+ if (!extractRes(langc, NAVIT_DATA_DIR + "/locale/" + langc + "/LC_MESSAGES/navit.mo"))
+ {
+ Log.e(TAG, "Failed to extract language resource " + langc);
+ }
+
+ if (densityDpi <= 120)
+ {
+ my_display_density = "ldpi";
+ }
+ else if (densityDpi <= 160)
+ {
+ my_display_density = "mdpi";
+ }
+ else if (densityDpi < 240)
+ {
+ my_display_density = "hdpi";
+ }
+ else if (densityDpi < 320)
+ {
+ my_display_density = "xhdpi";
+ }
+ else if (densityDpi < 480)
+ {
+ my_display_density = "xxhdpi";
+ }
+ else if (densityDpi < 640)
+ {
+ my_display_density = "xxxhdpi";
+ }
+ else
+ {
+ Log.e(TAG, "found device of very high density ("+densityDpi+")");
+ Log.e(TAG, "using xxxhdpi values");
+ my_display_density = "xxxhdpi";
+ }
+
+ if (!extractRes("navit" + my_display_density, NAVIT_DATA_DIR + "/share/navit.xml"))
+ {
+ Log.e(TAG, "Failed to extract navit.xml for " + my_display_density);
+ }
+
+ Log.d(TAG, "android.os.Build.VERSION.SDK_INT=" + Integer.valueOf(android.os.Build.VERSION.SDK));
+ NavitMain(this, NavitLanguage, Integer.valueOf(android.os.Build.VERSION.SDK), my_display_density, NAVIT_DATA_DIR+"/bin/navit",map_filename_path);
+
+ showInfos();
+
+ Navit.mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
+ }
+
+ @Override
+ public void onResume()
+ {
+ super.onResume();
+ Log.d(TAG, "OnResume");
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {
+ /* Required to make system bars fully transparent */
+ getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+ | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+ | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION);
+ }
+ //InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
+ // DEBUG
+ // intent_data = "google.navigation:q=Wien Burggasse 27";
+ // intent_data = "google.navigation:q=48.25676,16.643";
+ // intent_data = "google.navigation:ll=48.25676,16.643&q=blabla-strasse";
+ // intent_data = "google.navigation:ll=48.25676,16.643";
+ if (startup_intent != null)
+ {
+ if (System.currentTimeMillis() <= Navit.startup_intent_timestamp + 4000L)
+ {
+ Log.d(TAG, "**2**A " + startup_intent.getAction());
+ Log.d(TAG, "**2**D " + startup_intent.getDataString());
+ String navi_scheme = startup_intent.getScheme();
+ if ( navi_scheme != null && navi_scheme.equals("google.navigation")) {
+ parseNavigationURI(startup_intent.getData().getSchemeSpecificPart());
+ }
+ }
+ else {
+ Log.e(TAG, "timestamp for navigate_to expired! not using data");
+ }
+ }
+ Log.d(TAG, "onResume");
+ if (show_soft_keyboard_now_showing) {
+ /* Calling showNativeKeyboard() directly won't work here, we need to use the message queue */
+ View cf = getCurrentFocus();
+ if (cf == null)
+ Log.e(TAG, "no view in focus, can't get a handler");
+ else
+ cf.getHandler().post(new SoftInputRestorer());
+ }
+ }
+
+ @Override
+ public void onPause() {
+ super.onPause();
+ Log.d(TAG, "onPause");
+ if (show_soft_keyboard_now_showing) {
+ Log.d(TAG, "onPause:hiding soft input");
+ this.hideNativeKeyboard();
+ show_soft_keyboard_now_showing = true;
+ }
+ }
+
+ @Override
+ public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
+ switch (requestCode) {
+ case MY_PERMISSIONS_REQUEST_ALL: {
+ if (grantResults.length > 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED
+ && grantResults[1] == PackageManager.PERMISSION_GRANTED) {
+ return;
+ }
+ AlertDialog.Builder infobox = new AlertDialog.Builder(this);
+ infobox.setTitle(getString(R.string.permissions_info_box_title)); // TRANS
+ infobox.setCancelable(false);
+ infobox.setMessage(getString(R.string.permissions_not_granted));
+ // TRANS
+ infobox.setPositiveButton(getString(R.string.initial_info_box_OK), new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface arg0, int arg1) {
+ exit();
+ }
+ });
+ infobox.show();
+ }
+ }
+ }
+
+ private void parseNavigationURI(String schemeSpecificPart) {
+ String naviData[]= schemeSpecificPart.split("&");
+ Pattern p = Pattern.compile("(.*)=(.*)");
+ Map<String,String> params = new HashMap<String,String>();
+ for (int count=0; count < naviData.length; count++) {
+ Matcher m = p.matcher(naviData[count]);
+
+ if (m.matches()) {
+ params.put(m.group(1), m.group(2));
+ }
+ }
+
+ // d: google.navigation:q=blabla-strasse # (this happens when you are offline, or from contacts)
+ // a: google.navigation:ll=48.25676,16.643&q=blabla-strasse
+ // c: google.navigation:ll=48.25676,16.643
+ // b: google.navigation:q=48.25676,16.643
+
+ Float lat;
+ Float lon;
+ Bundle b = new Bundle();
+
+ String geoString = params.get("ll");
+ if (geoString != null) {
+ String address = params.get("q");
+ if (address != null) b.putString("q", address);
+ }
+ else {
+ geoString = params.get("q");
+ }
+
+ if ( geoString != null) {
+ if (geoString.matches("^[+-]{0,1}\\d+(|\\.\\d*),[+-]{0,1}\\d+(|\\.\\d*)$")) {
+ String geo[] = geoString.split(",");
+ if (geo.length == 2) {
+ try {
+ lat = Float.valueOf(geo[0]);
+ lon = Float.valueOf(geo[1]);
+ b.putFloat("lat", lat);
+ b.putFloat("lon", lon);
+ Message msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_SET_DESTINATION.ordinal());
+
+ msg.setData(b);
+ msg.sendToTarget();
+ Log.e(TAG, "target found (b): " + geoString);
+ } catch (NumberFormatException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ else {
+ start_targetsearch_from_intent(geoString);
+ }
+ }
+ }
+
+ public void setActivityResult(int requestCode, NavitActivityResult ActivityResult)
+ {
+ ActivityResults[requestCode] = ActivityResult;
+ }
+
+ /*
+ * This is unused since we dont have the dropdown
+ * TODO: recheck if this is right and remove this!
+ */
+ @Override
+ public boolean onPrepareOptionsMenu(Menu menu)
+ {
+ super.onPrepareOptionsMenu(menu);
+ //Log.e("Navit","onPrepareOptionsMenu");
+ // this gets called every time the menu is opened!!
+ // change menu items here!
+ menu.clear();
+
+ // group-id,item-id,sort order number
+ //menu.add(1, 1, 100, getString(R.string.optionsmenu_zoom_in)); //TRANS
+ //menu.add(1, 2, 200, getString(R.string.optionsmenu_zoom_out)); //TRANS
+
+ menu.add(1, 3, 300, getString(R.string.optionsmenu_download_maps)); //TRANS
+ menu.add(1, 5, 400, getString(R.string.optionsmenu_toggle_poi)); //TRANS
+
+ menu.add(1, 6, 500, getString(R.string.optionsmenu_address_search)); //TRANS
+ menu.add(1, 10, 600, getString(R.string.optionsmenu_set_map_location));
+
+ menu.add(1, 99, 900, getString(R.string.optionsmenu_exit_navit)); //TRANS
+
+ /* Only show the Backup to SD-Card Option if we really have one */
+ if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED))
+ menu.add(1, 7, 700, getString(R.string.optionsmenu_backup_restore)); //TRANS
+
+ return true;
+ }
+
+ // define callback id here
+ private NavitGraphics N_NavitGraphics = null;
+
+ // callback id gets set here when called from NavitGraphics
+ public void setKeypressCallback(int kp_cb_id, NavitGraphics ng)
+ {
+ N_NavitGraphics = ng;
+ }
+
+ public void setMotionCallback(int mo_cb_id, NavitGraphics ng)
+ {
+ N_NavitGraphics = ng;
+ }
+
+ public NavitGraphics getNavitGraphics() {
+ return N_NavitGraphics;
+ }
+
+
+ public void start_targetsearch_from_intent(String target_address)
+ {
+ if (target_address == null || target_address.equals(""))
+ {
+ // empty search string entered
+ Toast.makeText(getApplicationContext(), getString(R.string.address_search_not_found), Toast.LENGTH_LONG).show(); //TRANS
+ }
+ else
+ {
+ Intent search_intent = new Intent(this, NavitAddressSearchActivity.class);
+ search_intent.putExtra("search_string", target_address);
+ this.startActivityForResult(search_intent, NavitAddressSearch_id);
+ }
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item)
+ {
+ runOptionsItem(item.getItemId());
+ return true;
+ }
+
+ public void runOptionsItem(int id)
+ {
+ switch (id)
+ {
+ case 1 :
+ // zoom in
+ Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_ZOOM_IN.ordinal()).sendToTarget();
+ // if we zoom, hide the bubble
+ Log.d(TAG, "onOptionsItemSelected -> zoom in");
+ break;
+ case 2 :
+ // zoom out
+ Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_ZOOM_OUT.ordinal()).sendToTarget();
+ // if we zoom, hide the bubble
+ Log.d(TAG, "onOptionsItemSelected -> zoom out");
+ break;
+ case 3 :
+ // map download menu
+ Intent map_download_list_activity = new Intent(this, NavitDownloadSelectMapActivity.class);
+ startActivityForResult(map_download_list_activity, Navit.NavitDownloaderSelectMap_id);
+ break;
+ case 5 :
+ // toggle the normal POI layers and labels (to avoid double POIs)
+ Message msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_CALL_CMD.ordinal());
+ Bundle b = new Bundle();
+ b.putString("cmd", "toggle_layer(\"POI Symbols\");");
+ msg.setData(b);
+ msg.sendToTarget();
+
+ msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_CALL_CMD.ordinal());
+ b = new Bundle();
+ b.putString("cmd", "toggle_layer(\"POI Labels\");");
+ msg.setData(b);
+ msg.sendToTarget();
+
+ // toggle full POI icons on/off
+ msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_CALL_CMD.ordinal());
+ b = new Bundle();
+ b.putString("cmd", "toggle_layer(\"Android-POI-Icons-full\");");
+ msg.setData(b);
+ msg.sendToTarget();
+
+ break;
+ case 6 :
+ // ok startup address search activity
+ Intent search_intent = new Intent(this, NavitAddressSearchActivity.class);
+ this.startActivityForResult(search_intent, NavitAddressSearch_id);
+ break;
+ case 7 :
+ /* Backup / Restore */
+ showDialog(NavitDialogs.DIALOG_BACKUP_RESTORE);
+ break;
+ case 10:
+ setMapLocation();
+ break;
+ case 99 :
+ // exit
+ this.onStop();
+ this.exit();
+ break;
+ }
+ }
+
+
+ /**
+ * @brief Shows the Options menu.
+ *
+ * Calling this method has the same effect as pressing the hardware Menu button, where present, or touching
+ * the overflow button in the Action bar.
+ */
+ public void showMenu() {
+ openOptionsMenu();
+ }
+
+
+ /**
+ * @brief Shows the native keyboard or other input method.
+ */
+ public int showNativeKeyboard() {
+ /*
+ * Apologies for the huge mess that this function is, but Android's soft input API is a big
+ * nightmare. Its devs have mercifully given us an option to show or hide the keyboard, but
+ * there is no reliable way to figure out if it is actually showing, let alone how much of the
+ * screen it occupies, so our best bet is guesswork.
+ */
+ Configuration config = getResources().getConfiguration();
+ if ((config.keyboard == Configuration.KEYBOARD_QWERTY) && (config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_NO))
+ /* physical keyboard present, exit */
+ return 0;
+
+ /* Use SHOW_FORCED here, else keyboard won't show in landscape mode */
+ mgr.showSoftInput(getCurrentFocus(), InputMethodManager.SHOW_FORCED);
+ show_soft_keyboard_now_showing = true;
+
+ /*
+ * Crude way to estimate the height occupied by the keyboard: for AOSP on KitKat and Lollipop it
+ * is about 62-63% of available screen width (in portrait mode) but no more than slightly above
+ * 46% of height (in landscape mode).
+ */
+ Display display_ = getWindowManager().getDefaultDisplay();
+ int width_ = display_.getWidth();
+ int height_ = display_.getHeight();
+ int maxHeight = height_ * 47 / 100;
+ int inputHeight = width_ * 63 / 100;
+ if (inputHeight > (maxHeight))
+ inputHeight = maxHeight;
+
+ /* the receiver isn't going to fire before the UI thread becomes idle, well after this method returns */
+ Log.d(TAG, "showNativeKeyboard:return (assuming true)");
+ return inputHeight;
+ }
+
+
+ /**
+ * @brief Hides the native keyboard or other input method.
+ */
+ public void hideNativeKeyboard() {
+ mgr.hideSoftInputFromWindow(getCurrentFocus().getWindowToken(), 0);
+ show_soft_keyboard_now_showing = false;
+ }
+
+
+ void setDestination(float latitude, float longitude, String address) {
+ Toast.makeText( getApplicationContext(),getString(R.string.address_search_set_destination) + "\n" + address, Toast.LENGTH_LONG).show(); //TRANS
+
+ Message msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_SET_DESTINATION.ordinal());
+ Bundle b = new Bundle();
+ b.putFloat("lat", latitude);
+ b.putFloat("lon", longitude);
+ b.putString("q", address);
+ msg.setData(b);
+ msg.sendToTarget();
+ }
+
+ protected void onActivityResult(int requestCode, int resultCode, Intent data)
+ {
+ switch (requestCode)
+ {
+ case Navit.NavitDownloaderSelectMap_id :
+ if (resultCode == Activity.RESULT_OK)
+ {
+ Message msg = dialogs.obtainMessage(NavitDialogs.MSG_START_MAP_DOWNLOAD
+ , data.getIntExtra("map_index", -1), 0);
+ msg.sendToTarget();
+ }
+ break;
+ case NavitAddressSearch_id :
+ if (resultCode == Activity.RESULT_OK) {
+ Bundle destination = data.getExtras();
+ Toast.makeText( getApplicationContext(),getString(R.string.address_search_set_destination) + "\n" + destination.getString(("q")), Toast.LENGTH_LONG).show(); //TRANS
+
+ Message msg = Message.obtain(N_NavitGraphics.callback_handler, NavitGraphics.msg_type.CLB_SET_DESTINATION.ordinal());
+ msg.setData(destination);
+ msg.sendToTarget();
+ }
+ break;
+ case NavitSelectStorage_id :
+ if(resultCode == RESULT_OK) {
+ String newDir = data.getStringExtra(FileBrowserActivity.returnDirectoryParameter);
+ Log.d(TAG, "selected path= "+newDir);
+ if(!newDir.contains("/navit"))
+ newDir = newDir+"/navit/";
+ else
+ newDir = newDir+"/";
+ SharedPreferences prefs = this.getSharedPreferences(NAVIT_PREFS,MODE_PRIVATE);
+ SharedPreferences.Editor prefs_editor = prefs.edit();
+ prefs_editor.putString("filenamePath", newDir);
+ prefs_editor.apply();
+ Toast.makeText(this, String.format(Navit.T("New location set to %s\nRestart Navit to apply the changes."),newDir),Toast.LENGTH_LONG).show();
+ }
+ else Log.w(TAG, "select path failed");
+ break;
+ default :
+ ActivityResults[requestCode].onActivityResult(requestCode, resultCode, data);
+ break;
+ }
+ }
+
+ @Override
+ protected void onPrepareDialog(int id, Dialog dialog) {
+ dialogs.prepareDialog(id, dialog);
+ super.onPrepareDialog(id, dialog);
+ }
+
+ protected Dialog onCreateDialog(int id)
+ {
+ return dialogs.createDialog(id);
+ }
+
+ @Override
+ public boolean onSearchRequested() {
+ /* Launch the internal Search Activity */
+ Intent search_intent = new Intent(this, NavitAddressSearchActivity.class);
+ this.startActivityForResult(search_intent, NavitAddressSearch_id);
+
+ return true;
+ }
+
+ public void setMapLocation()
+ {
+ Intent fileExploreIntent = new Intent(this,FileBrowserActivity.class);
+ fileExploreIntent
+ .putExtra(FileBrowserActivity.startDirectoryParameter, "/mnt")
+ .setAction(FileBrowserActivity.INTENT_ACTION_SELECT_DIR);
+ startActivityForResult(fileExploreIntent,NavitSelectStorage_id);
+ }
+
+ @Override
+ public void onDestroy()
+ {
+ super.onDestroy();
+ Log.d(TAG, "OnDestroy");
+ // TODO next call will kill our app the hard way. This should not be necessary, but ensures navit is
+ // properly restarted and no resources are wasted with navit in background. Remove this call after
+ // code review
+ NavitDestroy();
+ }
+
+ public void fullscreen(int fullscreen) {
+ int w, h;
+
+ isFullscreen = (fullscreen != 0);
+ if (isFullscreen) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
+ }
+ else {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
+ getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
+ }
+
+ Display display_ = getWindowManager().getDefaultDisplay();
+ if (Build.VERSION.SDK_INT < 17) {
+ w = display_.getWidth();
+ h = display_.getHeight();
+ } else {
+ Point size = new Point();
+ display_.getRealSize(size);
+ w = size.x;
+ h = size.y;
+ }
+ Log.d(TAG, String.format("Toggle fullscreen, w=%d, h=%d", w, h));
+ N_NavitGraphics.handleResize(w, h);
+ }
+
+ public void disableSuspend()
+ {
+ wl.acquire();
+ wl.release();
+ }
+
+ public void exit()
+ {
+ nm.cancelAll();
+ NavitVehicle.removeListener();
+ NavitDestroy();
+ }
+
+ public native void NavitMain(Navit x, String lang, int version, String display_density_string, String path, String path2);
+ public native void NavitDestroy();
+
+ /*
+ * this is used to load the 'navit' native library on
+ * application startup. The library has already been unpacked at
+ * installation time by the package manager.
+ */
+ static
+ {
+ System.loadLibrary("navit");
+ }
+}
diff --git a/navit/android/src/org/navitproject/navit/NavitAddressSearchActivity.java b/navit/android/src/org/navitproject/navit/NavitAddressSearchActivity.java
index 80d285fa5..361a511ab 100644
--- a/navit/android/src/org/navitproject/navit/NavitAddressSearchActivity.java
+++ b/navit/android/src/org/navitproject/navit/NavitAddressSearchActivity.java
@@ -1,385 +1,385 @@
-/**
- * Navit, a modular navigation system.
- * Copyright (C) 2005-2008 Navit Team
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-package org.navitproject.navit;
-
-import java.lang.reflect.Field;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Locale;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.app.Dialog;
-import android.app.ProgressDialog;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.content.SharedPreferences;
-import android.os.Bundle;
-import android.util.Log;
-import android.util.TypedValue;
-import android.view.Gravity;
-import android.view.View;
-import android.view.View.OnClickListener;
-import android.view.WindowManager;
-import android.widget.AdapterView;
-import android.widget.AdapterView.OnItemClickListener;
-import android.widget.ArrayAdapter;
-import android.widget.Button;
-import android.widget.CheckBox;
-import android.widget.EditText;
-import android.widget.ImageButton;
-import android.widget.LinearLayout;
-import android.widget.ListView;
-import android.widget.RelativeLayout;
-import android.widget.Toast;
-import android.widget.RelativeLayout.LayoutParams;
-import android.widget.TextView;
-
-public class NavitAddressSearchActivity extends Activity {
- public static final class NavitAddress {
- public NavitAddress(int type, float latitude, float longitude, String address) {
- result_type = type;
- lat = latitude;
- lon = longitude;
- addr = address;
- }
-
- int result_type;
- float lat;
- float lon;
- String addr;
- }
-
- private static final String TAG = "NavitAddress";
- private static final int ADDRESS_RESULT_PROGRESS_MAX = 10;
-
- private List<NavitAddress> Addresses_found = null;
- private List<NavitAddress> addresses_shown = null;
- private String mAddressString = "";
- private boolean mPartialSearch = false;
- private String mCountry;
- private ImageButton mCountryButton;
- ProgressDialog search_results_wait = null;
- public RelativeLayout NavitAddressSearchActivity_layout;
- private int search_results_towns = 0;
- private int search_results_streets = 0;
- private int search_results_streets_hn = 0;
- private long search_handle = 0;
-
- // TODO remember settings
- private static String last_address_search_string = "";
- private static Boolean last_address_partial_match = false;
- private static String last_country = "";
-
- private int getDrawableID(String resourceName) {
- int drawableId = 0;
- try {
- Class<?> res = R.drawable.class;
- Field field = res.getField(resourceName);
- drawableId = field.getInt(null);
- } catch (Exception e) {
- Log.e("NavitAddressSearch", "Failure to get drawable id.", e);
- }
- return drawableId;
- }
-
- private void setCountryButtonImage() {
- // We have all images stored as drawable_nodpi resources which allows native code to manipulate them
- // without interference with android builtin choosing and scaling system. But that makes us to
- // reinvent the wheel here to show an image in android native interface.
- int flag_icon_sizes[]={24,32,48,64,96};
- int exact_size, nearest_size;
- exact_size=(int)(Navit.metrics.density*24.0 -.5);
- nearest_size=flag_icon_sizes[0];
- for(int size: flag_icon_sizes) {
- nearest_size=size;
- if(exact_size<=size)
- break;
- }
- mCountryButton.setImageResource(getDrawableID("country_" + mCountry+"_"+nearest_size+"_"+nearest_size));
- }
-
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- Bundle extras = getIntent().getExtras();
- if ( extras != null )
- {
- String search_string = extras.getString(("search_string"));
- if (search_string != null) {
- mPartialSearch = true;
- mAddressString = search_string;
- executeSearch();
- return;
- }
- }
-
- mPartialSearch = last_address_partial_match;
- mAddressString = last_address_search_string;
-
- getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND, WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
- LinearLayout panel = new LinearLayout(this);
- panel.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
- panel.setOrientation(LinearLayout.VERTICAL);
-
- // address: label and text field
- SharedPreferences settings = getSharedPreferences(Navit.NAVIT_PREFS, MODE_PRIVATE);
- mCountry = settings.getString(("DefaultCountry") , null);
-
- if (mCountry == null) {
- Locale defaultLocale = Locale.getDefault();
- mCountry = defaultLocale.getCountry().toLowerCase(defaultLocale);
- SharedPreferences.Editor edit_settings = settings.edit();
- edit_settings.putString("DefaultCountry", mCountry);
- edit_settings.commit();
- }
-
- mCountryButton = new ImageButton(this);
-
- setCountryButtonImage();
-
- mCountryButton.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- requestCountryDialog();
- }
- });
-
- // address: label and text field
- TextView addr_view = new TextView(this);
- addr_view.setText(Navit.T("Enter Destination")); // TRANS
- addr_view.setTextSize(TypedValue.COMPLEX_UNIT_SP, 20f);
- addr_view.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
- addr_view.setPadding(4, 4, 4, 4);
-
- // partial match checkbox
- final CheckBox checkboxPartialMatch = new CheckBox(this);
- checkboxPartialMatch.setText(Navit.T("partial match")); // TRANS
- checkboxPartialMatch.setChecked(last_address_partial_match);
- checkboxPartialMatch.setGravity(Gravity.CENTER);
-
- final EditText address_string = new EditText(this);
- address_string.setText(last_address_search_string);
- address_string.setSelectAllOnFocus(true);
-
- // search button
- final Button btnSearch = new Button(this);
- btnSearch.setText(Navit.T("Search")); // TRANS
- btnSearch.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
- btnSearch.setGravity(Gravity.CENTER);
- btnSearch.setOnClickListener(new OnClickListener() {
- public void onClick(View v) {
- mPartialSearch = checkboxPartialMatch.isChecked();
- mAddressString = address_string.getText().toString();
- last_address_partial_match = mPartialSearch;
- last_address_search_string = mAddressString;
- executeSearch();
- }
- });
-
- ListView lastAddresses = new ListView(this);
- NavitAppConfig navitConfig = (NavitAppConfig) getApplicationContext();
-
- final List<NavitAddress> addresses = navitConfig.getLastAddresses();
- int addressCount = addresses.size();
- if (addressCount > 0) {
- String[] strAddresses = new String[addressCount];
- for (int addrIndex = 0; addrIndex < addressCount; addrIndex++) {
- strAddresses[addrIndex] = addresses.get(addrIndex).addr;
- }
- ArrayAdapter<String> addressList =
- new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, strAddresses);
- lastAddresses.setAdapter(addressList);
- lastAddresses.setOnItemClickListener(new OnItemClickListener() {
- public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
- NavitAddress addressSelected = addresses.get(arg2);
- Intent resultIntent = new Intent();
-
- resultIntent.putExtra("lat", addressSelected.lat);
- resultIntent.putExtra("lon", addressSelected.lon);
- resultIntent.putExtra("q", addressSelected.addr);
-
- setResult(Activity.RESULT_OK, resultIntent);
- finish();
- }
- });
- }
-
- String title = getString(R.string.address_search_title);
-
- if (title != null && title.length() > 0)
- this.setTitle(title);
-
- LinearLayout searchSettingsLayout = new LinearLayout(this);
- searchSettingsLayout.setOrientation(LinearLayout.HORIZONTAL);
-
- searchSettingsLayout.addView(mCountryButton);
- searchSettingsLayout.addView(checkboxPartialMatch);
- panel.addView(addr_view);
- panel.addView(address_string);
- panel.addView(searchSettingsLayout);
- panel.addView(btnSearch);
- panel.addView(lastAddresses);
-
- setContentView(panel);
- }
-
- private void requestCountryDialog() {
- final String[][] all_countries = NavitGraphics.GetAllCountries();
-
- Comparator<String[]> country_comperator = new Comparator<String[]>() {
- public int compare(String[] object1, String[] object2) {
- return object1[1].compareTo(object2[1]);
- }
- };
-
- Arrays.sort(all_countries, country_comperator);
-
- AlertDialog.Builder mapModeChooser = new AlertDialog.Builder(this);
- // ToDo also show icons and country code
- String[] country_name = new String[all_countries.length];
-
- for (int country_index = 0; country_index < all_countries.length; country_index++) {
- country_name[country_index] = all_countries[country_index][1];
- }
-
- mapModeChooser.setItems(country_name, new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface dialog, int item) {
- SharedPreferences settings = getSharedPreferences(Navit.NAVIT_PREFS, MODE_PRIVATE);
- mCountry = all_countries[item][0];
- SharedPreferences.Editor edit_settings = settings.edit();
- edit_settings.putString("DefaultCountry", mCountry);
- edit_settings.commit();
-
- setCountryButtonImage();
- }
- });
-
- AlertDialog d=mapModeChooser.create();
- d.getListView().setFastScrollEnabled(true);
- d.show();
- }
-
- /**
- * start a search on the map
- */
- public void receiveAddress(int type, float latitude, float longitude, String address) {
- Log.e(TAG, "(" + String.valueOf(latitude) + ", " + String.valueOf(longitude) + ") " + address);
-
- switch (type) {
- case 0:
- search_results_towns++;
- break;
- case 1:
- search_results_streets++;
- break;
- case 2:
- search_results_streets_hn++;
- break;
-
- }
- search_results_wait.setMessage(Navit.T("Towns") + ":" + search_results_towns + " "
- + Navit.T("Streets") + ":" + search_results_streets + "/"
- + search_results_streets_hn);
-
- search_results_wait.setProgress(Addresses_found.size() % (ADDRESS_RESULT_PROGRESS_MAX + 1));
-
- Addresses_found.add(new NavitAddress(type, latitude, longitude, address));
- }
-
- public void finishAddressSearch() {
- if (Addresses_found.isEmpty()) {
- Toast.makeText( getApplicationContext(),getString(R.string.address_search_not_found) + "\n" + mAddressString, Toast.LENGTH_LONG).show(); //TRANS
- setResult(Activity.RESULT_CANCELED);
- finish();
- }
- ListView addressesFound = new ListView(this);
- addressesFound.setFastScrollEnabled(true);
- ArrayAdapter<String> addressList =
- new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1);
-
- addresses_shown = new ArrayList<NavitAddress>();
-
- for (NavitAddress currentAddress : Addresses_found) {
- if (currentAddress.result_type != 0 || search_results_streets == 0) {
- addressList.add(currentAddress.addr);
- addresses_shown.add(currentAddress);
- }
- }
-
- addressesFound.setAdapter(addressList);
-
- addressesFound.setOnItemClickListener(new OnItemClickListener() {
- public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
- NavitAddress addressSelected = addresses_shown.get(arg2);
- Intent resultIntent = new Intent();
-
- resultIntent.putExtra("lat", addressSelected.lat);
- resultIntent.putExtra("lon", addressSelected.lon);
- resultIntent.putExtra("q", addressSelected.addr);
-
- setResult(Activity.RESULT_OK, resultIntent);
- finish();
- }
- });
-
- setContentView(addressesFound);
- search_results_wait.dismiss();
- }
-
- public native long CallbackStartAddressSearch(int partial_match, String country, String s);
- public native void CallbackCancelAddressSearch(long handle);
-
- @Override
- protected Dialog onCreateDialog(int id) {
- search_results_wait = new ProgressDialog(this);
- search_results_wait.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
- search_results_wait.setTitle("Loading search results");
- search_results_wait.setMessage("--");
- search_results_wait.setCancelable(true);
- search_results_wait.setProgress(0);
- search_results_wait.setMax(10);
-
- Addresses_found = new ArrayList<NavitAddress>();
- search_results_towns = 0;
- search_results_streets = 0;
- search_results_streets_hn = 0;
-
- search_handle = CallbackStartAddressSearch(mPartialSearch ? 1 : 0, mCountry, mAddressString);
-
- search_results_wait.setOnCancelListener(new DialogInterface.OnCancelListener() {
- @Override
- public void onCancel(DialogInterface dialog) {
- CallbackCancelAddressSearch(search_handle);
- search_handle = 0;
- search_results_wait.dismiss();
- }
- });
- return search_results_wait;
- }
-
- void executeSearch() {
- showDialog(0);
- }
-}
-
+/**
+ * Navit, a modular navigation system.
+ * Copyright (C) 2005-2008 Navit Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+package org.navitproject.navit;
+
+import java.lang.reflect.Field;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Locale;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.app.ProgressDialog;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.util.Log;
+import android.util.TypedValue;
+import android.view.Gravity;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.WindowManager;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemClickListener;
+import android.widget.ArrayAdapter;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.RelativeLayout;
+import android.widget.Toast;
+import android.widget.RelativeLayout.LayoutParams;
+import android.widget.TextView;
+
+public class NavitAddressSearchActivity extends Activity {
+ public static final class NavitAddress {
+ public NavitAddress(int type, float latitude, float longitude, String address) {
+ result_type = type;
+ lat = latitude;
+ lon = longitude;
+ addr = address;
+ }
+
+ int result_type;
+ float lat;
+ float lon;
+ String addr;
+ }
+
+ private static final String TAG = "NavitAddress";
+ private static final int ADDRESS_RESULT_PROGRESS_MAX = 10;
+
+ private List<NavitAddress> Addresses_found = null;
+ private List<NavitAddress> addresses_shown = null;
+ private String mAddressString = "";
+ private boolean mPartialSearch = false;
+ private String mCountry;
+ private ImageButton mCountryButton;
+ ProgressDialog search_results_wait = null;
+ public RelativeLayout NavitAddressSearchActivity_layout;
+ private int search_results_towns = 0;
+ private int search_results_streets = 0;
+ private int search_results_streets_hn = 0;
+ private long search_handle = 0;
+
+ // TODO remember settings
+ private static String last_address_search_string = "";
+ private static Boolean last_address_partial_match = false;
+ private static String last_country = "";
+
+ private int getDrawableID(String resourceName) {
+ int drawableId = 0;
+ try {
+ Class<?> res = R.drawable.class;
+ Field field = res.getField(resourceName);
+ drawableId = field.getInt(null);
+ } catch (Exception e) {
+ Log.e("NavitAddressSearch", "Failure to get drawable id.", e);
+ }
+ return drawableId;
+ }
+
+ private void setCountryButtonImage() {
+ // We have all images stored as drawable_nodpi resources which allows native code to manipulate them
+ // without interference with android builtin choosing and scaling system. But that makes us to
+ // reinvent the wheel here to show an image in android native interface.
+ int flag_icon_sizes[]={24,32,48,64,96};
+ int exact_size, nearest_size;
+ exact_size=(int)(Navit.metrics.density*24.0 -.5);
+ nearest_size=flag_icon_sizes[0];
+ for(int size: flag_icon_sizes) {
+ nearest_size=size;
+ if(exact_size<=size)
+ break;
+ }
+ mCountryButton.setImageResource(getDrawableID("country_" + mCountry+"_"+nearest_size+"_"+nearest_size));
+ }
+
+
+ @Override
+ protected void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ Bundle extras = getIntent().getExtras();
+ if ( extras != null )
+ {
+ String search_string = extras.getString(("search_string"));
+ if (search_string != null) {
+ mPartialSearch = true;
+ mAddressString = search_string;
+ executeSearch();
+ return;
+ }
+ }
+
+ mPartialSearch = last_address_partial_match;
+ mAddressString = last_address_search_string;
+
+ getWindow().setFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND, WindowManager.LayoutParams.FLAG_BLUR_BEHIND);
+ LinearLayout panel = new LinearLayout(this);
+ panel.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
+ panel.setOrientation(LinearLayout.VERTICAL);
+
+ // address: label and text field
+ SharedPreferences settings = getSharedPreferences(Navit.NAVIT_PREFS, MODE_PRIVATE);
+ mCountry = settings.getString(("DefaultCountry") , null);
+
+ if (mCountry == null) {
+ Locale defaultLocale = Locale.getDefault();
+ mCountry = defaultLocale.getCountry().toLowerCase(defaultLocale);
+ SharedPreferences.Editor edit_settings = settings.edit();
+ edit_settings.putString("DefaultCountry", mCountry);
+ edit_settings.commit();
+ }
+
+ mCountryButton = new ImageButton(this);
+
+ setCountryButtonImage();
+
+ mCountryButton.setOnClickListener(new OnClickListener() {
+ public void onClick(View v) {
+ requestCountryDialog();
+ }
+ });
+
+ // address: label and text field
+ TextView addr_view = new TextView(this);
+ addr_view.setText(Navit.T("Enter Destination")); // TRANS
+ addr_view.setTextSize(TypedValue.COMPLEX_UNIT_SP, 20f);
+ addr_view.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
+ addr_view.setPadding(4, 4, 4, 4);
+
+ // partial match checkbox
+ final CheckBox checkboxPartialMatch = new CheckBox(this);
+ checkboxPartialMatch.setText(Navit.T("partial match")); // TRANS
+ checkboxPartialMatch.setChecked(last_address_partial_match);
+ checkboxPartialMatch.setGravity(Gravity.CENTER);
+
+ final EditText address_string = new EditText(this);
+ address_string.setText(last_address_search_string);
+ address_string.setSelectAllOnFocus(true);
+
+ // search button
+ final Button btnSearch = new Button(this);
+ btnSearch.setText(Navit.T("Search")); // TRANS
+ btnSearch.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));
+ btnSearch.setGravity(Gravity.CENTER);
+ btnSearch.setOnClickListener(new OnClickListener() {
+ public void onClick(View v) {
+ mPartialSearch = checkboxPartialMatch.isChecked();
+ mAddressString = address_string.getText().toString();
+ last_address_partial_match = mPartialSearch;
+ last_address_search_string = mAddressString;
+ executeSearch();
+ }
+ });
+
+ ListView lastAddresses = new ListView(this);
+ NavitAppConfig navitConfig = (NavitAppConfig) getApplicationContext();
+
+ final List<NavitAddress> addresses = navitConfig.getLastAddresses();
+ int addressCount = addresses.size();
+ if (addressCount > 0) {
+ String[] strAddresses = new String[addressCount];
+ for (int addrIndex = 0; addrIndex < addressCount; addrIndex++) {
+ strAddresses[addrIndex] = addresses.get(addrIndex).addr;
+ }
+ ArrayAdapter<String> addressList =
+ new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, strAddresses);
+ lastAddresses.setAdapter(addressList);
+ lastAddresses.setOnItemClickListener(new OnItemClickListener() {
+ public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
+ NavitAddress addressSelected = addresses.get(arg2);
+ Intent resultIntent = new Intent();
+
+ resultIntent.putExtra("lat", addressSelected.lat);
+ resultIntent.putExtra("lon", addressSelected.lon);
+ resultIntent.putExtra("q", addressSelected.addr);
+
+ setResult(Activity.RESULT_OK, resultIntent);
+ finish();
+ }
+ });
+ }
+
+ String title = getString(R.string.address_search_title);
+
+ if (title != null && title.length() > 0)
+ this.setTitle(title);
+
+ LinearLayout searchSettingsLayout = new LinearLayout(this);
+ searchSettingsLayout.setOrientation(LinearLayout.HORIZONTAL);
+
+ searchSettingsLayout.addView(mCountryButton);
+ searchSettingsLayout.addView(checkboxPartialMatch);
+ panel.addView(addr_view);
+ panel.addView(address_string);
+ panel.addView(searchSettingsLayout);
+ panel.addView(btnSearch);
+ panel.addView(lastAddresses);
+
+ setContentView(panel);
+ }
+
+ private void requestCountryDialog() {
+ final String[][] all_countries = NavitGraphics.GetAllCountries();
+
+ Comparator<String[]> country_comperator = new Comparator<String[]>() {
+ public int compare(String[] object1, String[] object2) {
+ return object1[1].compareTo(object2[1]);
+ }
+ };
+
+ Arrays.sort(all_countries, country_comperator);
+
+ AlertDialog.Builder mapModeChooser = new AlertDialog.Builder(this);
+ // ToDo also show icons and country code
+ String[] country_name = new String[all_countries.length];
+
+ for (int country_index = 0; country_index < all_countries.length; country_index++) {
+ country_name[country_index] = all_countries[country_index][1];
+ }
+
+ mapModeChooser.setItems(country_name, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int item) {
+ SharedPreferences settings = getSharedPreferences(Navit.NAVIT_PREFS, MODE_PRIVATE);
+ mCountry = all_countries[item][0];
+ SharedPreferences.Editor edit_settings = settings.edit();
+ edit_settings.putString("DefaultCountry", mCountry);
+ edit_settings.commit();
+
+ setCountryButtonImage();
+ }
+ });
+
+ AlertDialog d=mapModeChooser.create();
+ d.getListView().setFastScrollEnabled(true);
+ d.show();
+ }
+
+ /**
+ * start a search on the map
+ */
+ public void receiveAddress(int type, float latitude, float longitude, String address) {
+ Log.e(TAG, "(" + String.valueOf(latitude) + ", " + String.valueOf(longitude) + ") " + address);
+
+ switch (type) {
+ case 0:
+ search_results_towns++;
+ break;
+ case 1:
+ search_results_streets++;
+ break;
+ case 2:
+ search_results_streets_hn++;
+ break;
+
+ }
+ search_results_wait.setMessage(Navit.T("Towns") + ":" + search_results_towns + " "
+ + Navit.T("Streets") + ":" + search_results_streets + "/"
+ + search_results_streets_hn);
+
+ search_results_wait.setProgress(Addresses_found.size() % (ADDRESS_RESULT_PROGRESS_MAX + 1));
+
+ Addresses_found.add(new NavitAddress(type, latitude, longitude, address));
+ }
+
+ public void finishAddressSearch() {
+ if (Addresses_found.isEmpty()) {
+ Toast.makeText( getApplicationContext(),getString(R.string.address_search_not_found) + "\n" + mAddressString, Toast.LENGTH_LONG).show(); //TRANS
+ setResult(Activity.RESULT_CANCELED);
+ finish();
+ }
+ ListView addressesFound = new ListView(this);
+ addressesFound.setFastScrollEnabled(true);
+ ArrayAdapter<String> addressList =
+ new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1);
+
+ addresses_shown = new ArrayList<NavitAddress>();
+
+ for (NavitAddress currentAddress : Addresses_found) {
+ if (currentAddress.result_type != 0 || search_results_streets == 0) {
+ addressList.add(currentAddress.addr);
+ addresses_shown.add(currentAddress);
+ }
+ }
+
+ addressesFound.setAdapter(addressList);
+
+ addressesFound.setOnItemClickListener(new OnItemClickListener() {
+ public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
+ NavitAddress addressSelected = addresses_shown.get(arg2);
+ Intent resultIntent = new Intent();
+
+ resultIntent.putExtra("lat", addressSelected.lat);
+ resultIntent.putExtra("lon", addressSelected.lon);
+ resultIntent.putExtra("q", addressSelected.addr);
+
+ setResult(Activity.RESULT_OK, resultIntent);
+ finish();
+ }
+ });
+
+ setContentView(addressesFound);
+ search_results_wait.dismiss();
+ }
+
+ public native long CallbackStartAddressSearch(int partial_match, String country, String s);
+ public native void CallbackCancelAddressSearch(long handle);
+
+ @Override
+ protected Dialog onCreateDialog(int id) {
+ search_results_wait = new ProgressDialog(this);
+ search_results_wait.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL);
+ search_results_wait.setTitle("Loading search results");
+ search_results_wait.setMessage("--");
+ search_results_wait.setCancelable(true);
+ search_results_wait.setProgress(0);
+ search_results_wait.setMax(10);
+
+ Addresses_found = new ArrayList<NavitAddress>();
+ search_results_towns = 0;
+ search_results_streets = 0;
+ search_results_streets_hn = 0;
+
+ search_handle = CallbackStartAddressSearch(mPartialSearch ? 1 : 0, mCountry, mAddressString);
+
+ search_results_wait.setOnCancelListener(new DialogInterface.OnCancelListener() {
+ @Override
+ public void onCancel(DialogInterface dialog) {
+ CallbackCancelAddressSearch(search_handle);
+ search_handle = 0;
+ search_results_wait.dismiss();
+ }
+ });
+ return search_results_wait;
+ }
+
+ void executeSearch() {
+ showDialog(0);
+ }
+}
+
diff --git a/navit/android/src/org/navitproject/navit/NavitAppConfig.java b/navit/android/src/org/navitproject/navit/NavitAppConfig.java
index 1a1a61f94..7cc5a6173 100755
--- a/navit/android/src/org/navitproject/navit/NavitAppConfig.java
+++ b/navit/android/src/org/navitproject/navit/NavitAppConfig.java
@@ -1,71 +1,70 @@
-package org.navitproject.navit;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.navitproject.navit.NavitAddressSearchActivity.NavitAddress;
-
-import android.app.Application;
-import android.content.SharedPreferences;
-import android.util.Log;
-
-
-public class NavitAppConfig extends Application {
-
- private static final int MAX_LAST_ADDRESSES = 10;
- private static final String TAG = "Navit";
-
- private List<NavitAddress> mLastAddresses = null;
- private int mLastAddressField;
- private SharedPreferences mSettings;
-
- @Override
- public void onCreate() {
- mSettings = getSharedPreferences(Navit.NAVIT_PREFS, MODE_PRIVATE);
- super.onCreate();
- }
-
- public List<NavitAddress> getLastAddresses() {
- if (mLastAddresses == null) {
- mLastAddresses = new ArrayList<NavitAddress>();
- int mLastAddressField = mSettings.getInt("LastAddress", -1);
- if (mLastAddressField >= 0) {
- int index = mLastAddressField;
- do {
- String addr_str = mSettings.getString("LastAddress_" + String.valueOf(index), "");
-
- if (addr_str.length() > 0) {
- mLastAddresses.add(new NavitAddress(
- 1,
- mSettings.getFloat("LastAddress_Lat_" + String.valueOf(index), 0),
- mSettings.getFloat("LastAddress_Lon_" + String.valueOf(index), 0),
- addr_str));
- }
-
- if (--index < 0) index = MAX_LAST_ADDRESSES - 1;
-
- } while (index != mLastAddressField);
- }
- }
- return mLastAddresses;
- }
-
- public void addLastAddress(NavitAddress newAddress) {
- getLastAddresses();
-
- mLastAddresses.add(newAddress);
- if (mLastAddresses.size() > MAX_LAST_ADDRESSES) mLastAddresses.remove(0);
-
- mLastAddressField++;
- if (mLastAddressField >= MAX_LAST_ADDRESSES) mLastAddressField = 0;
-
- SharedPreferences.Editor editSettings = mSettings.edit();
-
- editSettings.putInt("LastAddress", mLastAddressField);
- editSettings.putString("LastAddress_" + String.valueOf(mLastAddressField), newAddress.addr);
- editSettings.putFloat("LastAddress_Lat_" + String.valueOf(mLastAddressField), newAddress.lat);
- editSettings.putFloat("LastAddress_Lon_" + String.valueOf(mLastAddressField), newAddress.lon);
-
- editSettings.commit();
- }
-}
+package org.navitproject.navit;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.navitproject.navit.NavitAddressSearchActivity.NavitAddress;
+
+import android.app.Application;
+import android.content.SharedPreferences;
+
+
+public class NavitAppConfig extends Application {
+
+ private static final int MAX_LAST_ADDRESSES = 10;
+ private static final String TAG = "Navit";
+
+ private List<NavitAddress> mLastAddresses = null;
+ private int mLastAddressField;
+ private SharedPreferences mSettings;
+
+ @Override
+ public void onCreate() {
+ mSettings = getSharedPreferences(Navit.NAVIT_PREFS, MODE_PRIVATE);
+ super.onCreate();
+ }
+
+ public List<NavitAddress> getLastAddresses() {
+ if (mLastAddresses == null) {
+ mLastAddresses = new ArrayList<NavitAddress>();
+ int mLastAddressField = mSettings.getInt("LastAddress", -1);
+ if (mLastAddressField >= 0) {
+ int index = mLastAddressField;
+ do {
+ String addr_str = mSettings.getString("LastAddress_" + String.valueOf(index), "");
+
+ if (addr_str.length() > 0) {
+ mLastAddresses.add(new NavitAddress(
+ 1,
+ mSettings.getFloat("LastAddress_Lat_" + String.valueOf(index), 0),
+ mSettings.getFloat("LastAddress_Lon_" + String.valueOf(index), 0),
+ addr_str));
+ }
+
+ if (--index < 0) index = MAX_LAST_ADDRESSES - 1;
+
+ } while (index != mLastAddressField);
+ }
+ }
+ return mLastAddresses;
+ }
+
+ public void addLastAddress(NavitAddress newAddress) {
+ getLastAddresses();
+
+ mLastAddresses.add(newAddress);
+ if (mLastAddresses.size() > MAX_LAST_ADDRESSES) mLastAddresses.remove(0);
+
+ mLastAddressField++;
+ if (mLastAddressField >= MAX_LAST_ADDRESSES) mLastAddressField = 0;
+
+ SharedPreferences.Editor editSettings = mSettings.edit();
+
+ editSettings.putInt("LastAddress", mLastAddressField);
+ editSettings.putString("LastAddress_" + String.valueOf(mLastAddressField), newAddress.addr);
+ editSettings.putFloat("LastAddress_Lat_" + String.valueOf(mLastAddressField), newAddress.lat);
+ editSettings.putFloat("LastAddress_Lon_" + String.valueOf(mLastAddressField), newAddress.lon);
+
+ editSettings.apply();
+ }
+}
diff --git a/navit/android/src/org/navitproject/navit/NavitDialogs.java b/navit/android/src/org/navitproject/navit/NavitDialogs.java
index 10f30d5b3..7605b7aa9 100644
--- a/navit/android/src/org/navitproject/navit/NavitDialogs.java
+++ b/navit/android/src/org/navitproject/navit/NavitDialogs.java
@@ -19,7 +19,7 @@ public class NavitDialogs extends Handler{
// Dialogs
public static final int DIALOG_MAPDOWNLOAD = 1;
public static final int DIALOG_BACKUP_RESTORE = 2;
- public static final int DIALOG_SELECT_BACKUP = 3;
+ private static final int DIALOG_SELECT_BACKUP = 3;
// dialog messages
static final int MSG_MAP_DOWNLOAD_FINISHED = 0;
@@ -28,15 +28,15 @@ public class NavitDialogs extends Handler{
static final int MSG_TOAST_LONG = 3;
static final int MSG_POSITION_MENU = 6;
static final int MSG_START_MAP_DOWNLOAD = 7;
- static final int MSG_REMOVE_DIALOG_GENERIC = 99;
- static Handler mHandler;
+ private static final int MSG_REMOVE_DIALOG_GENERIC = 99;
+ private static Handler mHandler;
private ProgressDialog mapdownloader_dialog = null;
private NavitMapDownloader mapdownloader = null;
private Navit mActivity;
- public NavitDialogs(Navit activity) {
+ NavitDialogs(Navit activity) {
super();
mActivity = activity;
mHandler = this;
@@ -69,12 +69,12 @@ public class NavitDialogs extends Handler{
mActivity.removeDialog(DIALOG_MAPDOWNLOAD);
if (msg.getData().getInt("value1") == 1) {
Message msg_out =
- Message.obtain(Navit.N_NavitGraphics.callback_handler,
+ Message.obtain(Navit.getInstance().getNavitGraphics().callback_handler,
NavitGraphics.msg_type.CLB_LOAD_MAP.ordinal());
msg_out.setData(msg.getData());
msg_out.sendToTarget();
- msg_out = Message.obtain(Navit.N_NavitGraphics.callback_handler,
+ msg_out = Message.obtain(Navit.getInstance().getNavitGraphics().callback_handler,
NavitGraphics.msg_type.CLB_CALL_CMD.ordinal());
Bundle b = new Bundle();
int mi=msg.getData().getInt("value2");
diff --git a/navit/android/src/org/navitproject/navit/NavitDownloadSelectMapActivity.java b/navit/android/src/org/navitproject/navit/NavitDownloadSelectMapActivity.java
index 9cc056e31..f0b01ee0f 100644
--- a/navit/android/src/org/navitproject/navit/NavitDownloadSelectMapActivity.java
+++ b/navit/android/src/org/navitproject/navit/NavitDownloadSelectMapActivity.java
@@ -1,238 +1,238 @@
-/**
- * Navit, a modular navigation system.
- * Copyright (C) 2005-2008 Navit Team
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-package org.navitproject.navit;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import android.app.Activity;
-import android.app.AlertDialog;
-import android.app.ExpandableListActivity;
-import android.content.Context;
-import android.content.DialogInterface;
-import android.content.Intent;
-import android.location.Location;
-import android.location.LocationManager;
-import android.os.Bundle;
-import android.os.Message;
-import android.os.StatFs;
-import android.util.Log;
-import android.view.View;
-import android.widget.ExpandableListView;
-import android.widget.RelativeLayout;
-import android.widget.SimpleExpandableListAdapter;
-import android.widget.TextView;
-
-public class NavitDownloadSelectMapActivity extends ExpandableListActivity {
-
- private static SimpleExpandableListAdapter adapter = null;
- private static final String MAP_BULLETPOINT = " * ";
- private static ArrayList<HashMap<String, String>> downloaded_maps_childs = null;
- private static ArrayList<HashMap<String, String>> maps_current_position_childs = null;
- private static boolean currentLocationKnown = false;
-
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- if (adapter == null) {
- adapter = createAdapter();
- }
- updateDownloadedMaps();
- updateMapsForLocation(NavitMapDownloader.osm_maps);
- setListAdapter(adapter);
- try {
- setTitle(String.valueOf(getFreeSpace() / 1024 / 1024) + "MB available");
- } catch (Exception e) {
- Log.e("Navit","Exception "+e.getClass().getName()+" during getFreeSpace, reporting 'no sdcard present'");
- NavitDialogs.sendDialogMessage(NavitDialogs.MSG_TOAST_LONG, null,
- String.format(Navit.T("Current map location %s is not available\nPlease restart Navit after you attach an SD card or select a different map location."),Navit.map_filename_path),
- -1, 0, 0);
- finish();
- }
- }
-
- protected long getFreeSpace()
- {
- StatFs fsInfo = new StatFs(Navit.map_filename_path);
- return (long)fsInfo.getAvailableBlocks() * fsInfo.getBlockSize();
- }
-
- private void updateDownloadedMaps() {
- downloaded_maps_childs.clear();
- for (NavitMap map : NavitMapDownloader.getAvailableMaps()) {
- HashMap<String, String> child = new HashMap<String, String>();
- child.put("map_name", map.mapName + " " + (map.size() / 1024 / 1024) + "MB");
- child.put("map_location", map.getLocation());
- downloaded_maps_childs.add(child);
- }
- }
-
- private void updateMapsForLocation(NavitMapDownloader.osm_map_values osm_maps[]) {
- Location currentLocation = NavitVehicle.lastLocation;
- if (maps_current_position_childs.size() == 0 || (currentLocation != null && !currentLocationKnown)) {
- if (currentLocation == null) {
- LocationManager mapLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
- List<String> providers = mapLocationManager.getProviders(true);
- long lastUpdate = 0;
- long bestUpdateTime = -1;
- for (String provider : providers) {
- Location lastKnownLocation = mapLocationManager.getLastKnownLocation(provider);
- if (lastKnownLocation != null) {
- lastUpdate = lastKnownLocation.getTime();
- if (lastUpdate > bestUpdateTime) {
- currentLocation = lastKnownLocation;
- bestUpdateTime = lastUpdate;
- }
- }
- }
- } else currentLocationKnown = true;
-
- if (currentLocation != null) {
- // if this map contains data to our current position, add it to
- // the
- // MapsOfCurrentLocation-list
- for (int currentMapIndex = 0; currentMapIndex < osm_maps.length; currentMapIndex++) {
- if (osm_maps[currentMapIndex].isInMap(currentLocation)) {
- HashMap<String, String> currentPositionMapChild = new HashMap<String, String>();
- currentPositionMapChild.put("map_name", osm_maps[currentMapIndex].map_name + " "
- + (osm_maps[currentMapIndex].est_size_bytes / 1024 / 1024) + "MB");
- currentPositionMapChild.put("map_index", String.valueOf(currentMapIndex));
-
- maps_current_position_childs.add(currentPositionMapChild);
- }
- }
- }
- }
- }
-
- private SimpleExpandableListAdapter createAdapter() {
-
- NavitMapDownloader.osm_map_values osm_maps[] = NavitMapDownloader.osm_maps;
-
- ArrayList<HashMap<String, String>> resultGroups = new ArrayList<HashMap<String, String>>();
- ArrayList<ArrayList<HashMap<String, String>>> resultChilds =
- new ArrayList<ArrayList<HashMap<String, String>>>();
-
- // add already downloaded maps (group and empty child list
- HashMap<String, String> downloaded_maps_hash = new HashMap<String, String>();
- downloaded_maps_hash.put("category_name", Navit.T("Downloaded maps"));
- resultGroups.add(downloaded_maps_hash);
- downloaded_maps_childs = new ArrayList<HashMap<String, String>>();
- resultChilds.add(downloaded_maps_childs);
-
- ArrayList<HashMap<String, String>> secList = new ArrayList<HashMap<String, String>>();
- maps_current_position_childs = new ArrayList<HashMap<String, String>>();
- // maps containing the current location
- HashMap<String, String> matching_maps = new HashMap<String, String>();
- matching_maps.put("category_name", Navit.NavitResources.getString(R.string.maps_for_current_location));
- resultGroups.add(matching_maps);
- resultChilds.add(maps_current_position_childs);
-
- // add all maps
- for (int currentMapIndex = 0; currentMapIndex < osm_maps.length; currentMapIndex++) {
- if (osm_maps[currentMapIndex].level == 0) {
- if (secList != null && secList.size() > 0) {
- resultChilds.add(secList);
- }
- secList = new ArrayList<HashMap<String, String>>();
- HashMap<String, String> map_info_hash = new HashMap<String, String>();
- map_info_hash.put("category_name", osm_maps[currentMapIndex].map_name);
- resultGroups.add(map_info_hash);
- }
-
- HashMap<String, String> child = new HashMap<String, String>();
- child.put("map_name", (osm_maps[currentMapIndex].level > 1 ? MAP_BULLETPOINT : "")
- + osm_maps[currentMapIndex].map_name + " "
- + (osm_maps[currentMapIndex].est_size_bytes / 1024 / 1024) + "MB");
- child.put("map_index", String.valueOf(currentMapIndex));
-
- secList.add(child);
- }
- resultChilds.add(secList);
-
- return new SimpleExpandableListAdapter(this, resultGroups, android.R.layout.simple_expandable_list_item_1,
- new String[] { "category_name" }, new int[] { android.R.id.text1 }, resultChilds,
- android.R.layout.simple_expandable_list_item_1, new String[] { "map_name" },
- new int[] { android.R.id.text1 });
- }
-
- @Override
- public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
- super.onChildClick(parent, v, groupPosition, childPosition, id);
- Log.d("Navit", "p:" + groupPosition + ", child_pos:" + childPosition);
-
- @SuppressWarnings("unchecked")
- HashMap<String, String> child = (HashMap<String, String>) adapter.getChild(groupPosition, childPosition);
-
- String map_index = child.get("map_index");
- if (map_index != null) {
- int mi=Integer.parseInt(map_index);
- if(NavitMapDownloader.osm_maps[mi].est_size_bytes/1024/1024/950>=4) {
- NavitDialogs.sendDialogMessage(NavitDialogs.MSG_TOAST_LONG, null,
- Navit.T("Sorry, we currently do not support maps above 3.8G on Android, please select a smaller one."),
- -1, 0, 0);
- return true;
- }
- Intent resultIntent = new Intent();
- resultIntent.putExtra("map_index", mi);
- setResult(Activity.RESULT_OK, resultIntent);
- finish();
- } else {
- // ask user if to delete this map
- askForMapDeletion(child.get("map_location"));
- }
- return true;
- }
-
- private void askForMapDeletion(final String map_location) {
- AlertDialog.Builder deleteMapBox = new AlertDialog.Builder(this);
- deleteMapBox.setTitle(R.string.map_delete); // Android also takes recource id
- deleteMapBox.setCancelable(true);
-
- NavitMap maptoDelete = new NavitMap(map_location);
- deleteMapBox.setMessage(maptoDelete.mapName + " " + String.valueOf(maptoDelete.size() / 1024 / 1024) + "MB");
-
-
- // TRANS
- deleteMapBox.setPositiveButton(getString(R.string.yes), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface arg0, int arg1) {
- Log.e("Navit", "Delete Map");
- Message msg =
- Message.obtain(Navit.N_NavitGraphics.callback_handler,
- NavitGraphics.msg_type.CLB_DELETE_MAP.ordinal());
- Bundle b = new Bundle();
- b.putString("title", map_location);
- msg.setData(b);
- msg.sendToTarget();
- finish();
- }
- });
-
- // TRANS
- deleteMapBox.setNegativeButton(getString(R.string.no), new DialogInterface.OnClickListener() {
- public void onClick(DialogInterface arg0, int arg1) {
- Log.e("Navit", "don't delete map");
- }
- });
- deleteMapBox.show();
- }
-}
+/**
+ * Navit, a modular navigation system.
+ * Copyright (C) 2005-2008 Navit Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+package org.navitproject.navit;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.ExpandableListActivity;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.location.Location;
+import android.location.LocationManager;
+import android.os.Bundle;
+import android.os.Message;
+import android.os.StatFs;
+import android.util.Log;
+import android.view.View;
+import android.widget.ExpandableListView;
+import android.widget.RelativeLayout;
+import android.widget.SimpleExpandableListAdapter;
+import android.widget.TextView;
+
+public class NavitDownloadSelectMapActivity extends ExpandableListActivity {
+
+ private static SimpleExpandableListAdapter adapter = null;
+ private static final String MAP_BULLETPOINT = " * ";
+ private static ArrayList<HashMap<String, String>> downloaded_maps_childs = null;
+ private static ArrayList<HashMap<String, String>> maps_current_position_childs = null;
+ private static boolean currentLocationKnown = false;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+
+ if (adapter == null) {
+ adapter = createAdapter();
+ }
+ updateDownloadedMaps();
+ updateMapsForLocation(NavitMapDownloader.osm_maps);
+ setListAdapter(adapter);
+ try {
+ setTitle(String.valueOf(getFreeSpace() / 1024 / 1024) + "MB available");
+ } catch (Exception e) {
+ Log.e("Navit","Exception "+e.getClass().getName()+" during getFreeSpace, reporting 'no sdcard present'");
+ NavitDialogs.sendDialogMessage(NavitDialogs.MSG_TOAST_LONG, null,
+ String.format(Navit.T("Current map location %s is not available\nPlease restart Navit after you attach an SD card or select a different map location."),Navit.map_filename_path),
+ -1, 0, 0);
+ finish();
+ }
+ }
+
+ protected long getFreeSpace()
+ {
+ StatFs fsInfo = new StatFs(Navit.map_filename_path);
+ return (long)fsInfo.getAvailableBlocks() * fsInfo.getBlockSize();
+ }
+
+ private void updateDownloadedMaps() {
+ downloaded_maps_childs.clear();
+ for (NavitMap map : NavitMapDownloader.getAvailableMaps()) {
+ HashMap<String, String> child = new HashMap<String, String>();
+ child.put("map_name", map.mapName + " " + (map.size() / 1024 / 1024) + "MB");
+ child.put("map_location", map.getLocation());
+ downloaded_maps_childs.add(child);
+ }
+ }
+
+ private void updateMapsForLocation(NavitMapDownloader.osm_map_values osm_maps[]) {
+ Location currentLocation = NavitVehicle.lastLocation;
+ if (maps_current_position_childs.size() == 0 || (currentLocation != null && !currentLocationKnown)) {
+ if (currentLocation == null) {
+ LocationManager mapLocationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
+ List<String> providers = mapLocationManager.getProviders(true);
+ long lastUpdate = 0;
+ long bestUpdateTime = -1;
+ for (String provider : providers) {
+ Location lastKnownLocation = mapLocationManager.getLastKnownLocation(provider);
+ if (lastKnownLocation != null) {
+ lastUpdate = lastKnownLocation.getTime();
+ if (lastUpdate > bestUpdateTime) {
+ currentLocation = lastKnownLocation;
+ bestUpdateTime = lastUpdate;
+ }
+ }
+ }
+ } else currentLocationKnown = true;
+
+ if (currentLocation != null) {
+ // if this map contains data to our current position, add it to
+ // the
+ // MapsOfCurrentLocation-list
+ for (int currentMapIndex = 0; currentMapIndex < osm_maps.length; currentMapIndex++) {
+ if (osm_maps[currentMapIndex].isInMap(currentLocation)) {
+ HashMap<String, String> currentPositionMapChild = new HashMap<String, String>();
+ currentPositionMapChild.put("map_name", osm_maps[currentMapIndex].map_name + " "
+ + (osm_maps[currentMapIndex].est_size_bytes / 1024 / 1024) + "MB");
+ currentPositionMapChild.put("map_index", String.valueOf(currentMapIndex));
+
+ maps_current_position_childs.add(currentPositionMapChild);
+ }
+ }
+ }
+ }
+ }
+
+ private SimpleExpandableListAdapter createAdapter() {
+
+ NavitMapDownloader.osm_map_values osm_maps[] = NavitMapDownloader.osm_maps;
+
+ ArrayList<HashMap<String, String>> resultGroups = new ArrayList<HashMap<String, String>>();
+ ArrayList<ArrayList<HashMap<String, String>>> resultChilds =
+ new ArrayList<ArrayList<HashMap<String, String>>>();
+
+ // add already downloaded maps (group and empty child list
+ HashMap<String, String> downloaded_maps_hash = new HashMap<String, String>();
+ downloaded_maps_hash.put("category_name", Navit.T("Downloaded maps"));
+ resultGroups.add(downloaded_maps_hash);
+ downloaded_maps_childs = new ArrayList<HashMap<String, String>>();
+ resultChilds.add(downloaded_maps_childs);
+
+ ArrayList<HashMap<String, String>> secList = new ArrayList<HashMap<String, String>>();
+ maps_current_position_childs = new ArrayList<HashMap<String, String>>();
+ // maps containing the current location
+ HashMap<String, String> matching_maps = new HashMap<String, String>();
+ matching_maps.put("category_name", Navit.NavitResources.getString(R.string.maps_for_current_location));
+ resultGroups.add(matching_maps);
+ resultChilds.add(maps_current_position_childs);
+
+ // add all maps
+ for (int currentMapIndex = 0; currentMapIndex < osm_maps.length; currentMapIndex++) {
+ if (osm_maps[currentMapIndex].level == 0) {
+ if (secList != null && secList.size() > 0) {
+ resultChilds.add(secList);
+ }
+ secList = new ArrayList<HashMap<String, String>>();
+ HashMap<String, String> map_info_hash = new HashMap<String, String>();
+ map_info_hash.put("category_name", osm_maps[currentMapIndex].map_name);
+ resultGroups.add(map_info_hash);
+ }
+
+ HashMap<String, String> child = new HashMap<String, String>();
+ child.put("map_name", (osm_maps[currentMapIndex].level > 1 ? MAP_BULLETPOINT : "")
+ + osm_maps[currentMapIndex].map_name + " "
+ + (osm_maps[currentMapIndex].est_size_bytes / 1024 / 1024) + "MB");
+ child.put("map_index", String.valueOf(currentMapIndex));
+
+ secList.add(child);
+ }
+ resultChilds.add(secList);
+
+ return new SimpleExpandableListAdapter(this, resultGroups, android.R.layout.simple_expandable_list_item_1,
+ new String[] { "category_name" }, new int[] { android.R.id.text1 }, resultChilds,
+ android.R.layout.simple_expandable_list_item_1, new String[] { "map_name" },
+ new int[] { android.R.id.text1 });
+ }
+
+ @Override
+ public boolean onChildClick(ExpandableListView parent, View v, int groupPosition, int childPosition, long id) {
+ super.onChildClick(parent, v, groupPosition, childPosition, id);
+ Log.d("Navit", "p:" + groupPosition + ", child_pos:" + childPosition);
+
+ @SuppressWarnings("unchecked")
+ HashMap<String, String> child = (HashMap<String, String>) adapter.getChild(groupPosition, childPosition);
+
+ String map_index = child.get("map_index");
+ if (map_index != null) {
+ int mi=Integer.parseInt(map_index);
+ if(NavitMapDownloader.osm_maps[mi].est_size_bytes/1024/1024/950>=4) {
+ NavitDialogs.sendDialogMessage(NavitDialogs.MSG_TOAST_LONG, null,
+ Navit.T("Sorry, we currently do not support maps above 3.8G on Android, please select a smaller one."),
+ -1, 0, 0);
+ return true;
+ }
+ Intent resultIntent = new Intent();
+ resultIntent.putExtra("map_index", mi);
+ setResult(Activity.RESULT_OK, resultIntent);
+ finish();
+ } else {
+ // ask user if to delete this map
+ askForMapDeletion(child.get("map_location"));
+ }
+ return true;
+ }
+
+ private void askForMapDeletion(final String map_location) {
+ AlertDialog.Builder deleteMapBox = new AlertDialog.Builder(this);
+ deleteMapBox.setTitle(R.string.map_delete); // Android also takes recource id
+ deleteMapBox.setCancelable(true);
+
+ NavitMap maptoDelete = new NavitMap(map_location);
+ deleteMapBox.setMessage(maptoDelete.mapName + " " + String.valueOf(maptoDelete.size() / 1024 / 1024) + "MB");
+
+
+ // TRANS
+ deleteMapBox.setPositiveButton(getString(R.string.yes), new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface arg0, int arg1) {
+ Log.e("Navit", "Delete Map");
+ Message msg =
+ Message.obtain(Navit.getInstance().getNavitGraphics().callback_handler,
+ NavitGraphics.msg_type.CLB_DELETE_MAP.ordinal());
+ Bundle b = new Bundle();
+ b.putString("title", map_location);
+ msg.setData(b);
+ msg.sendToTarget();
+ finish();
+ }
+ });
+
+ // TRANS
+ deleteMapBox.setNegativeButton(getString(R.string.no), new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface arg0, int arg1) {
+ Log.e("Navit", "don't delete map");
+ }
+ });
+ deleteMapBox.show();
+ }
+}
diff --git a/navit/android/src/org/navitproject/navit/NavitGraphics.java b/navit/android/src/org/navitproject/navit/NavitGraphics.java
index a2d8e405f..d40dee3a5 100644
--- a/navit/android/src/org/navitproject/navit/NavitGraphics.java
+++ b/navit/android/src/org/navitproject/navit/NavitGraphics.java
@@ -26,10 +26,8 @@ import java.util.ArrayList;
import android.app.Activity;
import android.content.Context;
import android.content.res.Configuration;
-import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.Canvas;
-import android.graphics.Color;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.graphics.Path;
@@ -38,7 +36,6 @@ import android.graphics.Rect;
import android.os.Build;
import android.os.Handler;
import android.os.Message;
-import android.util.FloatMath;
import android.util.Log;
import android.view.ContextMenu;
import android.view.Gravity;
@@ -57,27 +54,27 @@ public class NavitGraphics
{
private NavitGraphics parent_graphics;
private ArrayList<NavitGraphics> overlays = new ArrayList<NavitGraphics>();
- int bitmap_w;
- int bitmap_h;
- int pos_x;
- int pos_y;
- int pos_wraparound;
- int overlay_disabled;
- int bgcolor;
- float trackball_x, trackball_y;
- View view;
- SystemBarTintView navigationTintView;
- SystemBarTintView statusTintView;
- FrameLayout frameLayout;
- RelativeLayout relativelayout;
- NavitCamera camera;
- Activity activity;
-
- public static Boolean in_map = false;
+ private int bitmap_w;
+ private int bitmap_h;
+ private int pos_x;
+ private int pos_y;
+ private int pos_wraparound;
+ private int overlay_disabled;
+ private int bgcolor;
+ private float trackball_x, trackball_y;
+ private View view;
+ private SystemBarTintView navigationTintView;
+ private SystemBarTintView statusTintView;
+ private FrameLayout frameLayout;
+ private RelativeLayout relativelayout;
+ private NavitCamera camera;
+ private Navit activity;
+
+ private static Boolean in_map = false;
// for menu key
private static long time_for_long_press = 300L;
- private static long interval_for_long_press = 200L;
+
private Handler timer_handler = new Handler();
@@ -89,7 +86,7 @@ public class NavitGraphics
statusTintView.setBackgroundColor(bgcolor);
}
- public void SetCamera(int use_camera)
+ private void SetCamera(int use_camera)
{
if (use_camera != 0 && camera == null)
{
@@ -100,7 +97,7 @@ public class NavitGraphics
}
}
- protected Rect get_rect()
+ private Rect get_rect()
{
Rect ret=new Rect();
ret.left=pos_x;
@@ -243,7 +240,9 @@ public class NavitGraphics
e.printStackTrace();
}
}
- catch (NoSuchFieldException ex) {}
+ catch (NoSuchFieldException ex) {
+ ex.printStackTrace();
+ }
return ret_value;
}
@@ -385,7 +384,9 @@ public class NavitGraphics
pos.set(x.floatValue(), y.floatValue());
}
- catch (Exception e){}
+ catch (Exception e){
+ e.printStackTrace();
+ }
}
return pos;
}
@@ -396,6 +397,7 @@ public class NavitGraphics
int i;
String s = null;
boolean handled = true;
+ long interval_for_long_press = 200L;
i = event.getUnicodeChar();
//Log.e("NavitGraphics", "onKeyDown " + keyCode + " " + i);
// Log.e("NavitGraphics","Unicode "+event.getUnicodeChar());
@@ -434,17 +436,15 @@ public class NavitGraphics
// if in menu view:
// use as OK (Enter) key
s = java.lang.String.valueOf((char) 13);
- handled = true;
// dont use menu key here (use it in onKeyUp)
- return handled;
+ return true;
}
else
{
// if on map view:
// volume UP
//s = java.lang.String.valueOf((char) 1);
- handled = false;
- return handled;
+ return true;
}
}
else if (keyCode == android.view.KeyEvent.KEYCODE_SEARCH)
@@ -471,15 +471,13 @@ public class NavitGraphics
// if in menu view:
// use as UP key
s = java.lang.String.valueOf((char) 16);
- handled = true;
}
else
{
// if on map view:
// volume UP
//s = java.lang.String.valueOf((char) 21);
- handled = false;
- return handled;
+ return false;
}
}
else if (keyCode == android.view.KeyEvent.KEYCODE_VOLUME_DOWN)
@@ -489,15 +487,13 @@ public class NavitGraphics
// if in menu view:
// use as DOWN key
s = java.lang.String.valueOf((char) 14);
- handled = true;
}
else
{
// if on map view:
// volume DOWN
//s = java.lang.String.valueOf((char) 4);
- handled = false;
- return handled;
+ return false;
}
}
else if (keyCode == android.view.KeyEvent.KEYCODE_DPAD_CENTER)
@@ -530,7 +526,7 @@ public class NavitGraphics
{
KeypressCallback(KeypressCallbackID, s);
}
- return handled;
+ return true;
}
@Override
@@ -547,33 +543,11 @@ public class NavitGraphics
{
if (keyCode == android.view.KeyEvent.KEYCODE_VOLUME_UP)
{
- if (!in_map)
- {
- //s = java.lang.String.valueOf((char) 16);
- handled = true;
- return handled;
- }
- else
- {
- //s = java.lang.String.valueOf((char) 21);
- handled = false;
- return handled;
- }
+ return (!in_map);
}
else if (keyCode == android.view.KeyEvent.KEYCODE_VOLUME_DOWN)
{
- if (!in_map)
- {
- //s = java.lang.String.valueOf((char) 14);
- handled = true;
- return handled;
- }
- else
- {
- //s = java.lang.String.valueOf((char) 4);
- handled = false;
- return handled;
- }
+ return (!in_map);
}
else if (keyCode == android.view.KeyEvent.KEYCODE_SEARCH) {
/* Handle event in Main Activity if map is shown */
@@ -588,8 +562,7 @@ public class NavitGraphics
}
//Log.e("NavitGraphics", "KEYCODE_BACK up");
//s = java.lang.String.valueOf((char) 27);
- handled = true;
- return handled;
+ return true;
}
else if (keyCode == android.view.KeyEvent.KEYCODE_MENU)
{
@@ -604,7 +577,6 @@ public class NavitGraphics
// if in menu view:
// use as OK (Enter) key
s = java.lang.String.valueOf((char) 13);
- handled = true;
}
}
else
@@ -612,8 +584,7 @@ public class NavitGraphics
// if on map view:
// volume UP
//s = java.lang.String.valueOf((char) 1);
- handled = false;
- return handled;
+ return false;
}
}
}
@@ -626,7 +597,7 @@ public class NavitGraphics
{
KeypressCallback(KeypressCallbackID, s);
}
- return handled;
+ return true;
}
@@ -716,7 +687,7 @@ public class NavitGraphics
{
if (parent == null)
{
- this.activity = activity;
+ this.activity = (Navit) activity;
view = new NavitView(activity);
//activity.registerForContextMenu(view);
view.setClickable(false);
@@ -767,7 +738,7 @@ public class NavitGraphics
, CLB_SET_DISPLAY_DESTINATION, CLB_CALL_CMD, CLB_COUNTRY_CHOOSER, CLB_LOAD_MAP, CLB_UNLOAD_MAP, CLB_DELETE_MAP
};
- static public msg_type[] msg_values = msg_type.values();
+ static private msg_type[] msg_values = msg_type.values();
public Handler callback_handler = new Handler()
{
@@ -849,8 +820,8 @@ public class NavitGraphics
if (frameLayout == null)
return;
- if (!(activity instanceof Navit)) {
- Log.e("NavitGraphics", "Main Activity is not a Navit instance, cannot update padding");
+ if (activity == null) {
+ Log.w("NavitGraphics", "Main Activity is not a Navit instance, cannot update padding");
return;
}
@@ -976,14 +947,18 @@ public class NavitGraphics
public void setMotionCallback(int id)
{
MotionCallbackID = id;
- Navit.setMotionCallback(id, this);
+ if(activity != null){
+ activity.setMotionCallback(id, this);
+ }
}
public void setKeypressCallback(int id)
{
KeypressCallbackID = id;
// set callback id also in main intent (for menus)
- Navit.setKeypressCallback(id, this);
+ if(activity != null) {
+ activity.setKeypressCallback(id, this);
+ }
}
@@ -1140,8 +1115,8 @@ public class NavitGraphics
}
/* These constants must be synchronized with enum draw_mode_num in graphics.h. */
- public static final int draw_mode_begin = 0;
- public static final int draw_mode_end = 1;
+ private static final int draw_mode_begin = 0;
+ private static final int draw_mode_end = 1;
protected void draw_mode(int mode)
{
@@ -1194,9 +1169,7 @@ public class NavitGraphics
public static String getLocalizedString(String text)
{
- String ret = CallbackLocalizedString(text);
- //Log.e("NavitGraphics", "callback_handler -> lozalized string=" + ret);
- return ret;
+ return CallbackLocalizedString(text);
}
diff --git a/navit/android/src/org/navitproject/navit/NavitMap.java b/navit/android/src/org/navitproject/navit/NavitMap.java
index b7bd265a4..274cbdd8b 100644
--- a/navit/android/src/org/navitproject/navit/NavitMap.java
+++ b/navit/android/src/org/navitproject/navit/NavitMap.java
@@ -3,11 +3,11 @@ package org.navitproject.navit;
import java.io.File;
public class NavitMap {
- String fileName;
+ private String fileName;
String mapName;
- String mapPath;
+ private String mapPath;
- public NavitMap(String path, String map_file_name) {
+ NavitMap(String path, String map_file_name) {
mapPath = path;
fileName = map_file_name;
if (map_file_name.endsWith(".bin")) {
@@ -17,7 +17,7 @@ public class NavitMap {
}
}
- public NavitMap(String map_location) {
+ NavitMap(String map_location) {
File mapFile = new File(map_location);
mapPath = mapFile.getParent() + "/";
diff --git a/navit/android/src/org/navitproject/navit/NavitMapDownloader.java b/navit/android/src/org/navitproject/navit/NavitMapDownloader.java
index feda451b8..dc520ff30 100644
--- a/navit/android/src/org/navitproject/navit/NavitMapDownloader.java
+++ b/navit/android/src/org/navitproject/navit/NavitMapDownloader.java
@@ -1,711 +1,709 @@
-/**
- * Navit, a modular navigation system.
- * Copyright (C) 2005-2008 Navit Team
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-package org.navitproject.navit;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.FilenameFilter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.OutputStream;
-import java.net.HttpURLConnection;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.net.URLConnection;
-
-import android.location.Location;
-import android.os.Bundle;
-import android.os.Message;
-import android.os.StatFs;
-import android.util.Log;
-
-/**
- * @author rikky
- *
- */
-public class NavitMapDownloader extends Thread
-{
- public static class osm_map_values
- {
- String lon1;
- String lat1;
- String lon2;
- String lat2;
- String map_name = "";
- long est_size_bytes = 0;
- int level = 0;
-
-
- public osm_map_values(String mapname, String lon_1, String lat_1, String lon_2, String lat_2,
- long bytes_est, int level)
- {
- this.map_name = mapname;
- this.lon1 = lon_1;
- this.lat1 = lat_1;
- this.lon2 = lon_2;
- this.lat2 = lat_2;
- this.est_size_bytes = bytes_est;
- this.level = level;
- }
-
- public boolean isInMap(Location location) {
- double longitude_1 = Double.valueOf(this.lon1);
- double latitude_1 = Double.valueOf(this.lat1);
- double longitude_2 = Double.valueOf(this.lon2);
- double latitude_2 = Double.valueOf(this.lat2);
-
- if (location.getLongitude() < longitude_1)
- return false;
- if (location.getLongitude() > longitude_2)
- return false;
- if (location.getLatitude() < latitude_1)
- return false;
- if (location.getLatitude() > latitude_2)
- return false;
-
- return true;
- }
- }
-
- //
- // define the maps here
- // size estimations updated 2017-06-22
- //
- public static final osm_map_values[] osm_maps = {
- new osm_map_values(Navit.T("Whole Planet"), "-180", "-90", "180", "90", 23992258630L, 0),
- new osm_map_values(Navit.T("Africa"), "-30.89", "-36.17", "61.68", "38.40", 2070076339L, 0),
- new osm_map_values(Navit.T("Angola"), "11.4", "-18.1", "24.2", "-5.3", 127557789L, 1),
- new osm_map_values(Navit.T("Burundi"), "28.9", "-4.5", "30.9", "-2.2", 124049667L, 1),
- new osm_map_values(Navit.T("Canary Islands"), "-18.69", "26.52", "-12.79", "29.99", 133565815L, 1),
- new osm_map_values(Navit.T("Congo, Democratic Republic of the"), "11.7", "-13.6", "31.5", "5.7", 244228485L, 1),
- new osm_map_values(Navit.T("Ethiopia"), "32.89", "3.33", "48.07", "14.97", 153067406L, 1),
- new osm_map_values(Navit.T("Guinea"), "-15.47", "7.12", "-7.58", "12.74", 188047126L, 1),
- new osm_map_values(Navit.T("Cote d'Ivoire"), "-8.72", "4.09", "-2.43", "10.80", 132187496L, 1),
- new osm_map_values(Navit.T("Kenya"), "33.8", "-5.2", "42.4", "4.9", 190073089L, 1),
- new osm_map_values(Navit.T("Lesotho"), "26.9", "-30.7", "29.6", "-28.4", 196189429L, 1),
- new osm_map_values(Navit.T("Liberia"), "-15.00", "-0.73", "-7.20", "8.65", 156257253L, 1),
- new osm_map_values(Navit.T("Libya"), "9.32", "19.40", "25.54", "33.63", 126046917L, 1),
- new osm_map_values(Navit.T("Madagascar"), "42.25", "-26.63", "51.20", "-11.31", 145210721L, 1),
- new osm_map_values(Navit.T("Namibia")+"+"+Navit.T("Botswana"), "11.4", "-29.1", "29.5", "-16.9", 248970987L, 1),
- new osm_map_values(Navit.T("Reunion"), "55.2", "-21.4", "55.9", "-20.9", 126008774L, 1),
- new osm_map_values(Navit.T("Rwanda"), "28.8", "-2.9", "30.9", "-1.0", 128267595L, 1),
- new osm_map_values(Navit.T("South Africa")+"+"+Navit.T("Lesotho"), "15.93", "-36.36", "33.65", "-22.08", 307280006L, 1),
- new osm_map_values(Navit.T("Tanzania, United Republic of"), "29.19", "-11.87", "40.74", "-0.88", 253621029L, 1),
- new osm_map_values(Navit.T("Uganda"), "29.3", "-1.6", "35.1", "4.3", 179134521L, 1),
- new osm_map_values(Navit.T("Asia"), "23.8", "0.1", "195.0", "82.4", 5113673780L, 0),
- new osm_map_values(Navit.T("Azerbaijan"), "44.74", "38.34", "51.69", "42.37", 138346406L, 1),
- new osm_map_values(Navit.T("China"), "67.3", "5.3", "135.0", "54.5", 1718108758L, 1),
- new osm_map_values(Navit.T("Cyprus"), "32.0", "34.5", "34.9", "35.8", 118472448L, 1),
- new osm_map_values(Navit.T("India")+"+"+Navit.T("Nepal"), "67.9", "5.5", "89.6", "36.0", 601877877L, 1),
- new osm_map_values(Navit.T("Indonesia"), "93.7", "-17.3", "155.5", "7.6", 420741405L, 1),
- new osm_map_values(Navit.T("Iran, Islamic Republic of"), "43.5", "24.4", "63.6", "40.4", 242016066L, 1),
- new osm_map_values(Navit.T("Iraq"), "38.7", "28.5", "49.2", "37.4", 160751805L, 1),
- new osm_map_values(Navit.T("Israel"), "33.99", "29.8", "35.95", "33.4", 155685778L, 1),
- new osm_map_values(Navit.T("Japan")+"+"+Navit.T("Korea"), "123.6", "25.2", "151.3", "47.1", 1029080156L, 1),
- new osm_map_values(Navit.T("Kazakhstan"), "46.44", "40.89", "87.36", "55.45", 407633007L, 1),
- new osm_map_values(Navit.T("Kyrgyzstan"), "69.23", "39.13", "80.33", "43.29", 147997835L, 1),
- new osm_map_values(Navit.T("Malaysia")+"+"+Navit.T("Singapore"), "94.3", "-5.9", "108.6", "6.8", 168816435L, 1),
- new osm_map_values(Navit.T("Mongolia"), "87.5", "41.4", "120.3", "52.7", 153534851L, 1),
- new osm_map_values(Navit.T("Pakistan"), "60.83", "23.28", "77.89", "37.15", 217644321L, 1),
- new osm_map_values(Navit.T("Philippines"), "115.58", "4.47", "127.85", "21.60", 281428307L, 1),
- new osm_map_values(Navit.T("Saudi Arabia"), "33.2", "16.1", "55.9", "33.5", 242648303L, 1),
- new osm_map_values(Navit.T("Taiwan"), "119.1", "21.5", "122.5", "25.2", 1029080156L, 1),
- new osm_map_values(Navit.T("Thailand"), "97.5", "5.7", "105.2", "19.7", 185135492L, 1),
- new osm_map_values(Navit.T("Turkey"), "25.1", "35.8", "46.4", "42.8", 331087441L, 1),
- new osm_map_values(Navit.T("Turkmenistan"), "51.78", "35.07", "66.76", "42.91", 131045087L, 1),
- new osm_map_values(Navit.T("UAE+Other"), "51.5", "22.6", "56.7", "26.5", 128934674L, 1),
- new osm_map_values(Navit.T("Australia")+"+"+Navit.T("Oceania"), "89.84", "-57.39", "179.79", "7.26", 782722650L, 0),
- new osm_map_values(Navit.T("Australia"), "110.5", "-44.2", "154.9", "-9.2", 348652900L, 0),
- new osm_map_values(Navit.T("Tasmania"), "144.0", "-45.1", "155.3", "-24.8", 253231890L, 1),
- new osm_map_values(Navit.T("Victoria")+"+"+Navit.T("New South Wales"), "140.7", "-39.4", "153.7", "-26.9", 241500829L, 1),
- new osm_map_values(Navit.T("New Caledonia"), "157.85", "-25.05", "174.15", "-16.85", 115512336L, 1),
- new osm_map_values(Navit.T("New Zealand"), "165.2", "-47.6", "179.1", "-33.7", 239264192L, 1),
- new osm_map_values(Navit.T("Europe"), "-12.97", "33.59", "34.15", "72.10", 11984126789L, 0),
- new osm_map_values(Navit.T("Western Europe"), "-17.6", "34.5", "42.9", "70.9", 12648810717L, 1),
- new osm_map_values(Navit.T("Austria"), "9.4", "46.32", "17.21", "49.1", 898273634L, 1),
- new osm_map_values(Navit.T("Azores"), "-31.62", "36.63", "-24.67", "40.13", 112687225L, 1),
- new osm_map_values(Navit.T("BeNeLux"), "2.08", "48.87", "7.78", "54.52", 1771971595L, 1),
- new osm_map_values(Navit.T("Netherlands"), "3.07", "50.75", "7.23", "53.73", 1191828033L, 1),
- new osm_map_values(Navit.T("Denmark"), "7.65", "54.32", "15.58", "58.07", 365606979L, 1),
- new osm_map_values(Navit.T("Faroe Islands"), "-7.8", "61.3", "-6.1", "62.5", 109377568L, 1),
- new osm_map_values(Navit.T("France"), "-5.45", "42.00", "8.44", "51.68", 3907969744L, 1),
- new osm_map_values(Navit.T("Alsace"), "6.79", "47.27", "8.48", "49.17", 354249349L, 2),
- new osm_map_values(Navit.T("Aquitaine"), "-2.27", "42.44", "1.50", "45.76", 443715019L, 2),
- new osm_map_values(Navit.T("Auvergne"), "2.01", "44.57", "4.54", "46.85", 287663213L, 2),
- new osm_map_values(Navit.T("Basse-Normandie"), "-2.09", "48.13", "1.03", "49.98", 262352354L, 2),
- new osm_map_values(Navit.T("Bourgogne"), "2.80", "46.11", "5.58", "48.45", 298868796L, 2),
- new osm_map_values(Navit.T("Bretagne"), "-5.58", "46.95", "-0.96", "48.99", 382770794L, 2),
- new osm_map_values(Navit.T("Centre"), "0.01", "46.29", "3.18", "48.99", 474224721L, 2),
- new osm_map_values(Navit.T("Champagne-Ardenne"), "3.34", "47.53", "5.94", "50.28", 269947824L, 2),
- new osm_map_values(Navit.T("Corse"), "8.12", "41.32", "9.95", "43.28", 129902146L, 2),
- new osm_map_values(Navit.T("Franche-Comte"), "5.20", "46.21", "7.83", "48.07", 324476070L, 2),
- new osm_map_values(Navit.T("Haute-Normandie"), "-0.15", "48.62", "1.85", "50.18", 202782876L, 2),
- new osm_map_values(Navit.T("Ile-de-France"), "1.40", "48.07", "3.61", "49.29", 311052699L, 2),
- new osm_map_values(Navit.T("Languedoc-Roussillon"), "1.53", "42.25", "4.89", "45.02", 380145667L, 2),
- new osm_map_values(Navit.T("Limousin"), "0.58", "44.87", "2.66", "46.50", 206696539L, 2),
- new osm_map_values(Navit.T("Lorraine"), "4.84", "47.77", "7.72", "49.73", 330777318L, 2),
- new osm_map_values(Navit.T("Midi-Pyrenees"), "-0.37", "42.18", "3.50", "45.10", 462618363L, 2),
- new osm_map_values(Navit.T("Nord-pas-de-Calais"), "1.42", "49.92", "4.49", "51.31", 368467511L, 2),
- new osm_map_values(Navit.T("Pays-de-la-Loire"), "-2.88", "46.20", "0.97", "48.62", 499471143L, 2),
- new osm_map_values(Navit.T("Picardie"), "1.25", "48.79", "4.31", "50.43", 374308041L, 2),
- new osm_map_values(Navit.T("Poitou-Charentes"), "-1.69", "45.04", "1.26", "47.23", 342125526L, 2),
- new osm_map_values(Navit.T("Provence-Alpes-Cote-d-Azur"), "4.21", "42.91", "7.99", "45.18", 390306134L, 2),
- new osm_map_values(Navit.T("Rhone-Alpes"), "3.65", "44.07", "7.88", "46.64", 510797942L, 2),
- new osm_map_values(Navit.T("Germany"), "5.18", "46.84", "15.47", "55.64", 3521359466L, 1),
- new osm_map_values(Navit.T("Baden-Wuerttemberg"), "7.32", "47.14", "10.57", "49.85", 674361124L, 2),
- new osm_map_values(Navit.T("Bayern"), "8.92", "47.22", "13.90", "50.62", 860161150L, 2),
- new osm_map_values(Navit.T("Mittelfranken"), "9.86", "48.78", "11.65", "49.84", 203055195L, 2),
- new osm_map_values(Navit.T("Niederbayern"), "11.55", "47.75", "14.12", "49.42", 312924770L, 2),
- new osm_map_values(Navit.T("Oberbayern"), "10.67", "47.05", "13.57", "49.14", 382734883L, 2),
- new osm_map_values(Navit.T("Oberfranken"), "10.31", "49.54", "12.49", "50.95", 235258691L, 2),
- new osm_map_values(Navit.T("Oberpfalz"), "11.14", "48.71", "13.47", "50.43", 264536012L, 2),
- new osm_map_values(Navit.T("Schwaben"), "9.27", "47.10", "11.36", "49.09", 321141607L, 2),
- new osm_map_values(Navit.T("Unterfranken"), "8.59", "49.16", "10.93", "50.67", 303720890L, 2),
- new osm_map_values(Navit.T("Berlin"), "13.03", "52.28", "13.81", "52.73", 169019946L, 2),
- new osm_map_values(Navit.T("Brandenburg"), "11.17", "51.30", "14.83", "53.63", 323497599L, 2),
- new osm_map_values(Navit.T("Bremen"), "8.43", "52.96", "9.04", "53.66", 150963608L, 2),
- new osm_map_values(Navit.T("Hamburg"), "9.56", "53.34", "10.39", "53.80", 156284421L, 2),
- new osm_map_values(Navit.T("Hessen"), "7.72", "49.34", "10.29", "51.71", 432279328L, 2),
- new osm_map_values(Navit.T("Mecklenburg-Vorpommern"), "10.54", "53.05", "14.48", "55.05", 213183908L, 2),
- new osm_map_values(Navit.T("Niedersachsen"), "6.40", "51.24", "11.69", "54.22", 819766939L, 2),
- new osm_map_values(Navit.T("Nordrhein-westfalen"), "5.46", "50.26", "9.52", "52.59", 967053517L, 2),
- new osm_map_values(Navit.T("Rheinland-Pfalz"), "6.06", "48.91", "8.56", "51.00", 442868899L, 2),
- new osm_map_values(Navit.T("Saarland"), "6.30", "49.06", "7.46", "49.69", 157721162L, 2),
- new osm_map_values(Navit.T("Sachsen-Anhalt"), "10.50", "50.88", "13.26", "53.11", 287785088L, 2),
- new osm_map_values(Navit.T("Sachsen"), "11.82", "50.11", "15.10", "51.73", 342620834L, 2),
- new osm_map_values(Navit.T("Schleswig-Holstein"), "7.41", "53.30", "11.98", "55.20", 280293910L, 2),
- new osm_map_values(Navit.T("Thueringen"), "9.81", "50.15", "12.72", "51.70", 269428239L, 2),
- new osm_map_values(Navit.T("Germany")+"+"+Navit.T("Austria")+"+"+Navit.T("Switzerland"), "3.4", "44.5", "18.6", "55.1", 5746126429L, 1),
- new osm_map_values(Navit.T("Iceland"), "-25.3", "62.8", "-11.4", "67.5", 124837162L, 1),
- new osm_map_values(Navit.T("Ireland"), "-11.17", "51.25", "-5.23", "55.9", 234750271L, 1),
- new osm_map_values(Navit.T("Italy"), "6.52", "36.38", "18.96", "47.19", 1610171395L, 1),
- new osm_map_values(Navit.T("Spain")+"+"+Navit.T("Portugal"), "-11.04", "34.87", "4.62", "44.41", 1039624918L, 1),
- new osm_map_values(Navit.T("Mallorca"), "2.2", "38.8", "4.7", "40.2", 137200636L, 2),
- new osm_map_values(Navit.T("Galicia"), "-10.0", "41.7", "-6.3", "44.1", 174549553L, 2),
- new osm_map_values(Navit.T("Scandinavia"), "4.0", "54.4", "32.1", "71.5", 1398661090L, 1),
- new osm_map_values(Navit.T("Finland"), "18.6", "59.2", "32.3", "70.3", 460997178L, 1),
- new osm_map_values(Navit.T("Denmark"), "7.49", "54.33", "13.05", "57.88", 321870414L, 1),
- new osm_map_values(Navit.T("Switzerland"), "5.79", "45.74", "10.59", "47.84", 552565332L, 1),
- new osm_map_values(Navit.T("United Kingdom"), "-9.7", "49.6", "2.2", "61.2", 901724648L, 1),
- new osm_map_values(Navit.T("England"), "-7.80", "48.93", "2.41", "56.14", 937728414L, 1),
- new osm_map_values(Navit.T("Buckinghamshire"), "-1.19", "51.44", "-0.43", "52.25", 142256978L, 2),
- new osm_map_values(Navit.T("Cambridgeshire"), "-0.55", "51.96", "0.56", "52.79", 142334001L, 2),
- new osm_map_values(Navit.T("Cumbria"), "-3.96", "53.85", "-2.11", "55.24", 144422460L, 2),
- new osm_map_values(Navit.T("East yorkshire with hull"), "-1.16", "53.50", "0.54", "54.26", 141518744L, 2),
- new osm_map_values(Navit.T("Essex"), "-0.07", "51.40", "1.36", "52.14", 162542730L, 2),
- new osm_map_values(Navit.T("Herefordshire"), "-3.19", "51.78", "-2.29", "52.45", 129368660L, 2),
- new osm_map_values(Navit.T("Kent"), "-0.02", "50.81", "1.65", "51.53", 145482562L, 2),
- new osm_map_values(Navit.T("Lancashire"), "-3.20", "53.43", "-2.00", "54.29", 148964975L, 2),
- new osm_map_values(Navit.T("Leicestershire"), "-1.65", "52.34", "-0.61", "53.03", 154199956L, 2),
- new osm_map_values(Navit.T("Norfolk"), "0.10", "52.30", "2.04", "53.41", 146017009L, 2),
- new osm_map_values(Navit.T("Nottinghamshire"), "-1.39", "52.73", "-0.62", "53.55", 147986548L, 2),
- new osm_map_values(Navit.T("Oxfordshire"), "-1.77", "51.41", "-0.82", "52.22", 142240992L, 2),
- new osm_map_values(Navit.T("Shropshire"), "-3.29", "52.26", "-2.18", "53.05", 136909363L, 2),
- new osm_map_values(Navit.T("Somerset"), "-3.89", "50.77", "-2.20", "51.40", 145186096L, 2),
- new osm_map_values(Navit.T("South yorkshire"), "-1.88", "53.25", "-0.80", "53.71", 145902650L, 2),
- new osm_map_values(Navit.T("Suffolk"), "0.29", "51.88", "1.81", "52.60", 143799697L, 2),
- new osm_map_values(Navit.T("Surrey"), "-0.90", "51.02", "0.10", "51.52", 157987139L, 2),
- new osm_map_values(Navit.T("Wiltshire"), "-2.41", "50.90", "-1.44", "51.76", 138652346L, 2),
- new osm_map_values(Navit.T("Scotland"), "-8.13", "54.49", "-0.15", "61.40", 258853845L, 2),
- new osm_map_values(Navit.T("Wales"), "-5.56", "51.28", "-2.60", "53.60", 193593409L, 2),
- new osm_map_values(Navit.T("Albania"), "19.09", "39.55", "21.12", "42.72", 146199817L, 1),
- new osm_map_values(Navit.T("Belarus"), "23.12", "51.21", "32.87", "56.23", 324470696L, 1),
- new osm_map_values(Navit.T("Russian Federation"), "27.9", "41.5", "190.4", "77.6", 2148314279L, 1),
- new osm_map_values(Navit.T("Bulgaria"), "24.7", "42.1", "24.8", "42.1", 109869373L, 1),
- new osm_map_values(Navit.T("Bosnia and Herzegovina"), "15.69", "42.52", "19.67", "45.32", 187122485L, 1),
- new osm_map_values(Navit.T("Czech Republic"), "11.91", "48.48", "19.02", "51.17", 904838442L, 1),
- new osm_map_values(Navit.T("Croatia"), "13.4", "42.1", "19.4", "46.9", 460854751L, 1),
- new osm_map_values(Navit.T("Estonia"), "21.5", "57.5", "28.2", "59.6", 173378927L, 1),
- new osm_map_values(Navit.T("Greece"), "28.9", "37.8", "29.0", "37.8", 109435051L, 1),
- new osm_map_values(Navit.T("Crete"), "23.3", "34.5", "26.8", "36.0", 115985063L, 1),
- new osm_map_values(Navit.T("Hungary"), "16.08", "45.57", "23.03", "48.39", 350318541L, 1),
- new osm_map_values(Navit.T("Latvia"), "20.7", "55.6", "28.3", "58.1", 188188140L, 1),
- new osm_map_values(Navit.T("Lithuania"), "20.9", "53.8", "26.9", "56.5", 217852597L, 1),
- new osm_map_values(Navit.T("Poland"), "13.6", "48.8", "24.5", "55.0", 1464968657L, 1),
- new osm_map_values(Navit.T("Romania"), "20.3", "43.5", "29.9", "48.4", 347931565L, 1),
- new osm_map_values(Navit.T("Ukraine"), "22.0", "44.3", "40.4", "52.4", 793611912L, 1),
- new osm_map_values(Navit.T("North America"), "-178.1", "6.5", "-10.4", "84.0", 5601866516L, 0),
- new osm_map_values(Navit.T("Alaska"), "-179.5", "49.5", "-129", "71.6", 207746039L, 1),
- new osm_map_values(Navit.T("Canada"), "-141.3", "41.5", "-52.2", "70.2", 2635719651L, 1),
- new osm_map_values(Navit.T("Hawaii"), "-161.07", "18.49", "-154.45", "22.85", 115016656L, 1),
- new osm_map_values(Navit.T("USA")+Navit.T(" (except Alaska and Hawaii)"), "-125.4", "24.3", "-66.5", "49.3", 4060487198L, 1),
- new osm_map_values(Navit.T("Midwest"), "-104.11", "35.92", "-80.46", "49.46", 1145596450L, 2),
- new osm_map_values(Navit.T("Michigan"), "-90.47", "41.64", "-79.00", "49.37", 538247019L, 2),
- new osm_map_values(Navit.T("Ohio"), "-84.87", "38.05", "-79.85", "43.53", 277022336L, 2),
- new osm_map_values(Navit.T("Northeast"), "-80.58", "38.72", "-66.83", "47.53", 1017160709L, 2),
- new osm_map_values(Navit.T("Massachusetts"), "-73.56", "40.78", "-68.67", "42.94", 340055487L, 2),
- new osm_map_values(Navit.T("Vermont"), "-73.49", "42.68", "-71.41", "45.07", 139626067L, 2),
- new osm_map_values(Navit.T("Pacific"), "-180.05", "15.87", "-129.75", "73.04", 207090640L, 2),
- new osm_map_values(Navit.T("South"), "-106.70", "23.98", "-71.46", "40.70", 1747935356L, 2),
- new osm_map_values(Navit.T("Arkansas"), "-94.67", "32.95", "-89.59", "36.60", 155658661L, 2),
- new osm_map_values(Navit.T("District of Columbia"), "-77.17", "38.74", "-76.86", "39.05", 129235755L, 2),
- new osm_map_values(Navit.T("Florida"), "-88.75", "23.63", "-77.67", "31.05", 224022108L, 2),
- new osm_map_values(Navit.T("Louisiana"), "-94.09", "28.09", "-88.62", "33.07", 210120605L, 2),
- new osm_map_values(Navit.T("Maryland"), "-79.54", "37.83", "-74.99", "40.22", 276462622L, 2),
- new osm_map_values(Navit.T("Mississippi"), "-91.71", "29.99", "-88.04", "35.05", 177858031L, 2),
- new osm_map_values(Navit.T("Oklahoma"), "-103.41", "33.56", "-94.38", "37.38", 200061473L, 2),
- new osm_map_values(Navit.T("Texas"), "-106.96", "25.62", "-92.97", "36.58", 430089141L, 2),
- new osm_map_values(Navit.T("Virginia"), "-83.73", "36.49", "-74.25", "39.52", 384187569L, 2),
- new osm_map_values(Navit.T("West Virginia"), "-82.70", "37.15", "-77.66", "40.97", 220552071L, 2),
- new osm_map_values(Navit.T("West"), "-133.11", "31.28", "-101.99", "49.51", 1152909162L, 2),
- new osm_map_values(Navit.T("Arizona"), "-114.88", "30.01", "-108.99", "37.06", 182826833L, 2),
- new osm_map_values(Navit.T("California"), "-125.94", "32.43", "-114.08", "42.07", 586923326L, 2),
- new osm_map_values(Navit.T("Colorado"), "-109.11", "36.52", "-100.41", "41.05", 228623724L, 2),
- new osm_map_values(Navit.T("Idaho"), "-117.30", "41.93", "-110.99", "49.18", 170684507L, 2),
- new osm_map_values(Navit.T("Montana"), "-116.10", "44.31", "-102.64", "49.74", 176229800L, 2),
- new osm_map_values(Navit.T("New Mexico"), "-109.10", "26.98", "-96.07", "37.05", 361793070L, 2),
- new osm_map_values(Navit.T("Nevada"), "-120.2", "35.0", "-113.8", "42.1", 200614482L, 2),
- new osm_map_values(Navit.T("Oregon"), "-124.8", "41.8", "-116.3", "46.3", 211462685L, 2),
- new osm_map_values(Navit.T("Utah"), "-114.11", "36.95", "-108.99", "42.05", 151590197L, 2),
- new osm_map_values(Navit.T("Washington State"), "-125.0", "45.5", "-116.9", "49.0", 222553768L, 2),
- new osm_map_values(Navit.T("South+Middle America"), "-83.5", "-56.3", "-30.8", "13.7", 958895383L, 0),
- new osm_map_values(Navit.T("Argentina"), "-73.9", "-57.3", "-51.6", "-21.0", 376857648L, 1),
- new osm_map_values(Navit.T("Argentina")+"+"+Navit.T("Chile"), "-77.2", "-56.3", "-52.7", "-16.1", 420275812L, 1),
- new osm_map_values(Navit.T("Bolivia"), "-70.5", "-23.1", "-57.3", "-9.3", 175937824L, 1),
- new osm_map_values(Navit.T("Brazil"), "-71.4", "-34.7", "-32.8", "5.4", 664872975L, 1),
- new osm_map_values(Navit.T("Chile"), "-81.77", "-58.50", "-65.46", "-17.41", 241657330L, 1),
- new osm_map_values(Navit.T("Cuba"), "-85.3", "19.6", "-74.0", "23.6", 129043575L, 1),
- new osm_map_values(Navit.T("Colombia"), "-79.1", "-4.0", "-66.7", "12.6", 212016580L, 1),
- new osm_map_values(Navit.T("Ecuador"), "-82.6", "-5.4", "-74.4", "2.3", 158857591L, 1),
- new osm_map_values(Navit.T("Guyana")+"+"+Navit.T("Suriname")+"+"+Navit.T("Guyane Francaise"), "-62.0", "1.0", "-51.2", "8.9", 123000072L, 1),
- new osm_map_values(Navit.T("Haiti")+"+"+Navit.T("Dominican Republic"), "-74.8", "17.3", "-68.2", "20.1", 149925689L, 1),
- new osm_map_values(Navit.T("Jamaica"), "-78.6", "17.4", "-75.9", "18.9", 113961998L, 1),
- new osm_map_values(Navit.T("Mexico"), "-117.6", "14.1", "-86.4", "32.8", 551307973L, 1),
- new osm_map_values(Navit.T("Paraguay"), "-63.8", "-28.1", "-53.6", "-18.8", 159498397L, 1),
- new osm_map_values(Navit.T("Peru"), "-82.4", "-18.1", "-67.5", "0.4", 212490557L, 1),
- new osm_map_values(Navit.T("Uruguay"), "-59.2", "-36.5", "-51.7", "-29.7", 157482719L, 1),
- new osm_map_values(Navit.T("Venezuela"), "-73.6", "0.4", "-59.7", "12.8", 167295729L, 1)
- };
-
- private String map_filename_path;
-
- public static NavitMap[] getAvailableMaps() {
- class filterMaps implements FilenameFilter {
- public boolean accept(File dir, String filename) {
- if (filename.endsWith(".bin"))
- return true;
- return false;
- }
- }
- NavitMap maps[] = new NavitMap[0];
- File map_dir = new File(Navit.map_filename_path);
- String map_file_names[] = map_dir.list(new filterMaps());
- if (map_file_names != null) {
- maps = new NavitMap[map_file_names.length];
- for (int map_file_index = 0; map_file_index < map_file_names.length; map_file_index++) {
- maps[map_file_index] = new NavitMap(Navit.map_filename_path, map_file_names[map_file_index]);
- }
- }
- return maps;
- }
- private Boolean stop_me = false;
- private osm_map_values map_values;
- private int map_id;
- private long uiLastUpdated = -1;
-
- private Boolean retryDownload = false; //Download failed, but
- //we should try to resume
- private static final int SOCKET_CONNECT_TIMEOUT = 60000; // 60 secs.
- private static final int SOCKET_READ_TIMEOUT = 120000; // 120 secs.
- private static final int MAP_WRITE_FILE_BUFFER = 1024 * 64;
- private static final int MAP_WRITE_MEM_BUFFER = 1024 * 64;
- private static final int MAP_READ_FILE_BUFFER = 1024 * 64;
- private static final int UPDATE_PROGRESS_TIME_NS = 1000 * 1000000; // 1ns=1E-9s
- private static final int MAX_RETRIES = 5;
- private static final String TAG = "NavitMapDownloader";
-
- protected int retry_counter = 0;
-
- public NavitMapDownloader(int map_id) {
- this.map_values = osm_maps[map_id];
- this.map_id=map_id;
- this.map_filename_path=Navit.map_filename_path;
- }
-
- public void run() {
- stop_me = false;
- retry_counter = 0;
-
- Log.v(TAG, "start download " + map_values.map_name);
- updateProgress(0, map_values.est_size_bytes, Navit.T("downloading") + ": " + map_values.map_name);
-
- boolean success;
- do {
- try {
- Thread.sleep(10 + retry_counter * 1000);
- } catch (InterruptedException e1) {}
- retryDownload = false;
- success = download_osm_map();
- } while ( !success
- && retryDownload
- && retry_counter < MAX_RETRIES
- && !stop_me);
-
- if (success) {
- toast(map_values.map_name + " " + Navit.T("ready"));
- getMapInfoFile().delete();
- Log.d(TAG, "success");
- }
-
- if (success || stop_me ) {
- NavitDialogs.sendDialogMessage( NavitDialogs.MSG_MAP_DOWNLOAD_FINISHED
- , map_filename_path + map_values.map_name + ".bin", null, -1, success ? 1 : 0 , map_id );
- }
- }
-
- public void stop_thread() {
- stop_me = true;
- Log.d(TAG, "stop_me -> true");
- }
-
- protected boolean checkFreeSpace(long needed_bytes) {
- long free_space = getFreeSpace();
-
- if ( needed_bytes <= 0 )
- needed_bytes = MAP_WRITE_FILE_BUFFER;
-
- if (free_space < needed_bytes ) {
- String msg;
- Log.e(TAG, "Not enough free space or media not available. Please free at least " + needed_bytes / 1024 /1024 + "Mb.");
- if(free_space<0)
- msg=Navit.T("Media selected for map storage is not available");
- else
- msg=Navit.T("Not enough free space");
- updateProgress(free_space, needed_bytes, Navit.T("Error downloading map!") + "\n" + msg);
- return false;
- }
- return true;
- }
-
- protected boolean deleteMap() {
- File finalOutputFile = getMapFile();
-
- if (finalOutputFile.exists()) {
- Message msg =
- Message.obtain(Navit.N_NavitGraphics.callback_handler,
- NavitGraphics.msg_type.CLB_DELETE_MAP.ordinal());
- Bundle b = new Bundle();
- b.putString("title", finalOutputFile.getAbsolutePath());
- msg.setData(b);
- msg.sendToTarget();
- return true;
- }
- return false;
- }
-
- /**
- * @param map_values
- * @return
- */
- protected boolean download_osm_map() {
- long already_read = 0;
- long real_size_bytes = 0;
- boolean resume = true;
-
- File outputFile = getDestinationFile();
- long old_download_size = outputFile.length();
-
- URL url = null;
- if (old_download_size > 0) {
- url = readFileInfo();
- }
-
- if (url == null) {
- resume = false;
- url = getDownloadURL();
- }
-
- // URL url = new URL("http://192.168.2.101:8080/zweibruecken.bin");
- URLConnection c = initConnection(url);
- if (c != null) {
-
- if (resume) {
- c.setRequestProperty("Range", "bytes=" + old_download_size + "-");
- already_read = old_download_size;
- }
- try {
- real_size_bytes=Long.parseLong(c.getHeaderField("Content-Length")) + already_read;
- } catch(Exception e) {
- real_size_bytes=-1;
- }
-
- long fileTime = c.getLastModified();
-
- if (!resume) {
- outputFile.delete();
- writeFileInfo(c, real_size_bytes);
- }
-
- if (real_size_bytes <= 0)
- real_size_bytes = map_values.est_size_bytes;
-
- Log.d(TAG, "size: " + real_size_bytes + ", read: " + already_read + ", timestamp: " + fileTime
- + ", Connection ref: " + c.getURL());
-
- if (checkFreeSpace(real_size_bytes - already_read)
- && downloadData(c, already_read, real_size_bytes, resume, outputFile)) {
-
- File finalOutputFile = getMapFile();
- // delete an already existing file first
- finalOutputFile.delete();
- // rename file to its final name
- outputFile.renameTo(finalOutputFile);
- return true;
- }
- }
- return false;
- }
-
- protected File getDestinationFile() {
- File outputFile = new File(map_filename_path, map_values.map_name + ".tmp");
- outputFile.getParentFile().mkdir();
- return outputFile;
- }
-
- protected boolean downloadData(URLConnection c, long already_read, long real_size_bytes
- , boolean resume,File outputFile) {
- boolean success = false;
- BufferedOutputStream buf = getOutputStream(outputFile, resume);
- BufferedInputStream bif = getInputStream(c);
-
- if (buf != null && bif != null) {
- success = readData(buf, bif, already_read, real_size_bytes);
- // always cleanup, as we might get errors when trying to resume
- try {
- buf.flush();
- buf.close();
-
- bif.close();
- } catch (IOException e) {
- }
- }
- return success;
- }
-
- protected URL getDownloadURL() {
- URL url = null;
- try {
- url =
- new URL("http://maps.navit-project.org/api/map/?bbox=" + map_values.lon1 + "," + map_values.lat1
- + "," + map_values.lon2 + "," + map_values.lat2);
- } catch (MalformedURLException e) {
- Log.e(TAG, "We failed to create a URL to " + map_values.map_name);
- e.printStackTrace();
- return null;
- }
- Log.v(TAG, "connect to " + url.toString());
- return url;
- }
-
- protected long getFreeSpace() {
- try {
- StatFs fsInfo = new StatFs(map_filename_path);
- return (long)fsInfo.getAvailableBlocks() * fsInfo.getBlockSize();
- } catch(Exception e) {
- return -1;
- }
- }
-
- protected BufferedInputStream getInputStream(URLConnection c) {
- BufferedInputStream bif = null;
- try {
- bif = new BufferedInputStream(c.getInputStream(), MAP_READ_FILE_BUFFER);
- } catch (FileNotFoundException e) {
- Log.e(TAG, "File not found on server: " + e);
- if (retry_counter > 0) {
- getMapInfoFile().delete();
- }
- enableRetry();
- bif = null;
- } catch (IOException e) {
- Log.e(TAG, "Error reading from server: " + e);
- enableRetry();
- bif = null;
- }
- return bif;
- }
-
- protected File getMapFile() {
- return new File(map_filename_path, map_values.map_name + ".bin");
- }
-
- protected File getMapInfoFile() {
- return new File(map_filename_path, map_values.map_name + ".tmp.info");
- }
-
- protected BufferedOutputStream getOutputStream(File outputFile, boolean resume) {
- BufferedOutputStream buf = null;
- try {
- buf = new BufferedOutputStream(new FileOutputStream(outputFile, resume), MAP_WRITE_FILE_BUFFER);
- } catch (FileNotFoundException e) {
- Log.e(TAG, "Could not open output file for writing: " + e);
- buf = null;
- }
- return buf;
- }
-
- protected URLConnection initConnection(URL url) {
- HttpURLConnection c = null;
- try {
- c = (HttpURLConnection) url.openConnection();
- c.setRequestMethod("GET");
- } catch (Exception e) {
- Log.e(TAG, "Failed connecting server: " + e);
- enableRetry();
- return null;
- }
-
- c.setReadTimeout(SOCKET_READ_TIMEOUT);
- c.setConnectTimeout(SOCKET_CONNECT_TIMEOUT);
- return c;
- }
-
- protected boolean readData(OutputStream buf, InputStream bif, long already_read, long real_size_bytes) {
- long start_timestamp = System.nanoTime();
- byte[] buffer = new byte[MAP_WRITE_MEM_BUFFER];
- int len1 = 0;
- long mapFileSize = real_size_bytes;
- long startOffset = already_read;
- boolean success = false;
-
- try {
- while (!stop_me && (len1 = bif.read(buffer)) != -1) {
- already_read += len1;
- updateProgress(start_timestamp, startOffset, already_read, mapFileSize);
-
- try {
- buf.write(buffer, 0, len1);
- } catch (IOException e) {
- Log.d(TAG, "Error: " + e);
- if ( !checkFreeSpace(real_size_bytes - already_read + MAP_WRITE_FILE_BUFFER)) {
- if (deleteMap()) {
- enableRetry();
- } else {
- updateProgress(already_read, real_size_bytes, Navit.T("Error downloading map!") + "\n"
- + Navit.T("Not enough free space"));
- }
- } else {
- updateProgress(already_read, real_size_bytes, Navit.T("Error writing map!"));
- }
-
- return false;
- }
- }
-
- if (stop_me) {
- toast(Navit.T("Map download aborted!"));
- } else if ( already_read < real_size_bytes ) {
- Log.d(TAG, "Server send only " + already_read + " bytes of " + real_size_bytes);
- enableRetry();
- } else {
- success = true;
- }
- } catch (IOException e) {
- Log.d(TAG, "Error: " + e);
-
- enableRetry();
- updateProgress(already_read, real_size_bytes, Navit.T("Error downloading map!"));
- }
-
- return success;
- }
-
- protected URL readFileInfo() {
- URL url = null;
- try {
- ObjectInputStream infoStream = new ObjectInputStream(new FileInputStream(getMapInfoFile()));
- String resume_proto = infoStream.readUTF();
- infoStream.readUTF(); // read the host name (unused for now)
- String resume_file = infoStream.readUTF();
- infoStream.close();
- // looks like the same file, try to resume
- Log.v(TAG, "Try to resume download");
- url = new URL(resume_proto + "://" + "maps.navit-project.org" + resume_file);
- } catch (Exception e) {
- getMapInfoFile().delete();
- }
- return url;
- }
-
- protected void toast(String message) {
- NavitDialogs.sendDialogMessage(NavitDialogs.MSG_TOAST, null, message, -1, 0, 0);
- }
-
- protected void updateProgress(long startTime, long offsetBytes, long readBytes, long maxBytes) {
- long currentTime = System.nanoTime();
-
- if ((currentTime > uiLastUpdated + UPDATE_PROGRESS_TIME_NS) && startTime!=currentTime) {
- float per_second_overall = (readBytes - offsetBytes) / ((currentTime - startTime) / 1000000000f);
- long bytes_remaining = maxBytes - readBytes;
- int eta_seconds = (int) (bytes_remaining / per_second_overall);
-
- String eta_string;
- if (eta_seconds > 60) {
- eta_string = (int) (eta_seconds / 60f) + " m";
- } else {
- eta_string = eta_seconds + " s";
- }
- String info =
- String.format("%s: %s\n %dMb / %dMb\n %.1f kb/s %s: %s", Navit.T("downloading")
- , map_values.map_name, readBytes / 1024 / 1024, maxBytes / 1024 / 1024,
- per_second_overall / 1024f, Navit.T("ETA"), eta_string);
-
- if (retry_counter > 0) {
- info += "\n Retry " + retry_counter + "/" + MAX_RETRIES;
- }
- Log.e(TAG, "info: " + info);
-
- updateProgress(readBytes, maxBytes, info);
- uiLastUpdated = currentTime;
- }
- }
-
- protected void updateProgress(long positionBytes, long maximumBytes, String infoText) {
- NavitDialogs.sendDialogMessage(NavitDialogs.MSG_PROGRESS_BAR, Navit.T("Map download"), infoText
- , NavitDialogs.DIALOG_MAPDOWNLOAD, (int) (maximumBytes / 1024),
- (int) (positionBytes / 1024));
- }
-
- protected void writeFileInfo(URLConnection c, long sizeInBytes) {
- ObjectOutputStream infoStream;
- try {
- infoStream = new ObjectOutputStream(new FileOutputStream(getMapInfoFile()));
- infoStream.writeUTF(c.getURL().getProtocol());
- infoStream.writeUTF(c.getURL().getHost());
- infoStream.writeUTF(c.getURL().getFile());
- infoStream.writeLong(sizeInBytes);
- infoStream.close();
- } catch (Exception e) {
- Log.e(TAG, "Could not write info file for map download. Resuming will not be possible. (" + e.getMessage() + ")");
- }
- }
-
- void enableRetry() {
- retryDownload = true;
- retry_counter++;
- }
- // dialog send helper methods
-}
+/**
+ * Navit, a modular navigation system.
+ * Copyright (C) 2005-2008 Navit Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+package org.navitproject.navit;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.OutputStream;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
+
+import android.location.Location;
+import android.os.Bundle;
+import android.os.Message;
+import android.os.StatFs;
+import android.util.Log;
+
+/**
+ * @author rikky
+ *
+ */
+public class NavitMapDownloader extends Thread
+{
+ public static class osm_map_values
+ {
+ String lon1;
+ String lat1;
+ String lon2;
+ String lat2;
+ String map_name = "";
+ long est_size_bytes = 0;
+ int level = 0;
+
+
+ private osm_map_values(String mapname, String lon_1, String lat_1, String lon_2, String lat_2,
+ long bytes_est, int level)
+ {
+ this.map_name = mapname;
+ this.lon1 = lon_1;
+ this.lat1 = lat_1;
+ this.lon2 = lon_2;
+ this.lat2 = lat_2;
+ this.est_size_bytes = bytes_est;
+ this.level = level;
+ }
+
+ public boolean isInMap(Location location) {
+ double longitude_1 = Double.valueOf(this.lon1);
+ double latitude_1 = Double.valueOf(this.lat1);
+ double longitude_2 = Double.valueOf(this.lon2);
+ double latitude_2 = Double.valueOf(this.lat2);
+
+ if (location.getLongitude() < longitude_1)
+ return false;
+ if (location.getLongitude() > longitude_2)
+ return false;
+ if (location.getLatitude() < latitude_1)
+ return false;
+ if (location.getLatitude() > latitude_2)
+ return false;
+
+ return true;
+ }
+ }
+
+ //
+ // define the maps here
+ // size estimations updated 2017-06-22
+ //
+ public static final osm_map_values[] osm_maps = {
+ new osm_map_values(Navit.T("Whole Planet"), "-180", "-90", "180", "90", 23992258630L, 0),
+ new osm_map_values(Navit.T("Africa"), "-30.89", "-36.17", "61.68", "38.40", 2070076339L, 0),
+ new osm_map_values(Navit.T("Angola"), "11.4", "-18.1", "24.2", "-5.3", 127557789L, 1),
+ new osm_map_values(Navit.T("Burundi"), "28.9", "-4.5", "30.9", "-2.2", 124049667L, 1),
+ new osm_map_values(Navit.T("Canary Islands"), "-18.69", "26.52", "-12.79", "29.99", 133565815L, 1),
+ new osm_map_values(Navit.T("Congo, Democratic Republic of the"), "11.7", "-13.6", "31.5", "5.7", 244228485L, 1),
+ new osm_map_values(Navit.T("Ethiopia"), "32.89", "3.33", "48.07", "14.97", 153067406L, 1),
+ new osm_map_values(Navit.T("Guinea"), "-15.47", "7.12", "-7.58", "12.74", 188047126L, 1),
+ new osm_map_values(Navit.T("Cote d'Ivoire"), "-8.72", "4.09", "-2.43", "10.80", 132187496L, 1),
+ new osm_map_values(Navit.T("Kenya"), "33.8", "-5.2", "42.4", "4.9", 190073089L, 1),
+ new osm_map_values(Navit.T("Lesotho"), "26.9", "-30.7", "29.6", "-28.4", 196189429L, 1),
+ new osm_map_values(Navit.T("Liberia"), "-15.00", "-0.73", "-7.20", "8.65", 156257253L, 1),
+ new osm_map_values(Navit.T("Libya"), "9.32", "19.40", "25.54", "33.63", 126046917L, 1),
+ new osm_map_values(Navit.T("Madagascar"), "42.25", "-26.63", "51.20", "-11.31", 145210721L, 1),
+ new osm_map_values(Navit.T("Namibia")+"+"+Navit.T("Botswana"), "11.4", "-29.1", "29.5", "-16.9", 248970987L, 1),
+ new osm_map_values(Navit.T("Reunion"), "55.2", "-21.4", "55.9", "-20.9", 126008774L, 1),
+ new osm_map_values(Navit.T("Rwanda"), "28.8", "-2.9", "30.9", "-1.0", 128267595L, 1),
+ new osm_map_values(Navit.T("South Africa")+"+"+Navit.T("Lesotho"), "15.93", "-36.36", "33.65", "-22.08", 307280006L, 1),
+ new osm_map_values(Navit.T("Tanzania, United Republic of"), "29.19", "-11.87", "40.74", "-0.88", 253621029L, 1),
+ new osm_map_values(Navit.T("Uganda"), "29.3", "-1.6", "35.1", "4.3", 179134521L, 1),
+ new osm_map_values(Navit.T("Asia"), "23.8", "0.1", "195.0", "82.4", 5113673780L, 0),
+ new osm_map_values(Navit.T("Azerbaijan"), "44.74", "38.34", "51.69", "42.37", 138346406L, 1),
+ new osm_map_values(Navit.T("China"), "67.3", "5.3", "135.0", "54.5", 1718108758L, 1),
+ new osm_map_values(Navit.T("Cyprus"), "32.0", "34.5", "34.9", "35.8", 118472448L, 1),
+ new osm_map_values(Navit.T("India")+"+"+Navit.T("Nepal"), "67.9", "5.5", "89.6", "36.0", 601877877L, 1),
+ new osm_map_values(Navit.T("Indonesia"), "93.7", "-17.3", "155.5", "7.6", 420741405L, 1),
+ new osm_map_values(Navit.T("Iran, Islamic Republic of"), "43.5", "24.4", "63.6", "40.4", 242016066L, 1),
+ new osm_map_values(Navit.T("Iraq"), "38.7", "28.5", "49.2", "37.4", 160751805L, 1),
+ new osm_map_values(Navit.T("Israel"), "33.99", "29.8", "35.95", "33.4", 155685778L, 1),
+ new osm_map_values(Navit.T("Japan")+"+"+Navit.T("Korea"), "123.6", "25.2", "151.3", "47.1", 1029080156L, 1),
+ new osm_map_values(Navit.T("Kazakhstan"), "46.44", "40.89", "87.36", "55.45", 407633007L, 1),
+ new osm_map_values(Navit.T("Kyrgyzstan"), "69.23", "39.13", "80.33", "43.29", 147997835L, 1),
+ new osm_map_values(Navit.T("Malaysia")+"+"+Navit.T("Singapore"), "94.3", "-5.9", "108.6", "6.8", 168816435L, 1),
+ new osm_map_values(Navit.T("Mongolia"), "87.5", "41.4", "120.3", "52.7", 153534851L, 1),
+ new osm_map_values(Navit.T("Pakistan"), "60.83", "23.28", "77.89", "37.15", 217644321L, 1),
+ new osm_map_values(Navit.T("Philippines"), "115.58", "4.47", "127.85", "21.60", 281428307L, 1),
+ new osm_map_values(Navit.T("Saudi Arabia"), "33.2", "16.1", "55.9", "33.5", 242648303L, 1),
+ new osm_map_values(Navit.T("Taiwan"), "119.1", "21.5", "122.5", "25.2", 1029080156L, 1),
+ new osm_map_values(Navit.T("Thailand"), "97.5", "5.7", "105.2", "19.7", 185135492L, 1),
+ new osm_map_values(Navit.T("Turkey"), "25.1", "35.8", "46.4", "42.8", 331087441L, 1),
+ new osm_map_values(Navit.T("Turkmenistan"), "51.78", "35.07", "66.76", "42.91", 131045087L, 1),
+ new osm_map_values(Navit.T("UAE+Other"), "51.5", "22.6", "56.7", "26.5", 128934674L, 1),
+ new osm_map_values(Navit.T("Australia")+"+"+Navit.T("Oceania"), "89.84", "-57.39", "179.79", "7.26", 782722650L, 0),
+ new osm_map_values(Navit.T("Australia"), "110.5", "-44.2", "154.9", "-9.2", 348652900L, 0),
+ new osm_map_values(Navit.T("Tasmania"), "144.0", "-45.1", "155.3", "-24.8", 253231890L, 1),
+ new osm_map_values(Navit.T("Victoria")+"+"+Navit.T("New South Wales"), "140.7", "-39.4", "153.7", "-26.9", 241500829L, 1),
+ new osm_map_values(Navit.T("New Caledonia"), "157.85", "-25.05", "174.15", "-16.85", 115512336L, 1),
+ new osm_map_values(Navit.T("New Zealand"), "165.2", "-47.6", "179.1", "-33.7", 239264192L, 1),
+ new osm_map_values(Navit.T("Europe"), "-12.97", "33.59", "34.15", "72.10", 11984126789L, 0),
+ new osm_map_values(Navit.T("Western Europe"), "-17.6", "34.5", "42.9", "70.9", 12648810717L, 1),
+ new osm_map_values(Navit.T("Austria"), "9.4", "46.32", "17.21", "49.1", 898273634L, 1),
+ new osm_map_values(Navit.T("Azores"), "-31.62", "36.63", "-24.67", "40.13", 112687225L, 1),
+ new osm_map_values(Navit.T("BeNeLux"), "2.08", "48.87", "7.78", "54.52", 1771971595L, 1),
+ new osm_map_values(Navit.T("Netherlands"), "3.07", "50.75", "7.23", "53.73", 1191828033L, 1),
+ new osm_map_values(Navit.T("Denmark"), "7.65", "54.32", "15.58", "58.07", 365606979L, 1),
+ new osm_map_values(Navit.T("Faroe Islands"), "-7.8", "61.3", "-6.1", "62.5", 109377568L, 1),
+ new osm_map_values(Navit.T("France"), "-5.45", "42.00", "8.44", "51.68", 3907969744L, 1),
+ new osm_map_values(Navit.T("Alsace"), "6.79", "47.27", "8.48", "49.17", 354249349L, 2),
+ new osm_map_values(Navit.T("Aquitaine"), "-2.27", "42.44", "1.50", "45.76", 443715019L, 2),
+ new osm_map_values(Navit.T("Auvergne"), "2.01", "44.57", "4.54", "46.85", 287663213L, 2),
+ new osm_map_values(Navit.T("Basse-Normandie"), "-2.09", "48.13", "1.03", "49.98", 262352354L, 2),
+ new osm_map_values(Navit.T("Bourgogne"), "2.80", "46.11", "5.58", "48.45", 298868796L, 2),
+ new osm_map_values(Navit.T("Bretagne"), "-5.58", "46.95", "-0.96", "48.99", 382770794L, 2),
+ new osm_map_values(Navit.T("Centre"), "0.01", "46.29", "3.18", "48.99", 474224721L, 2),
+ new osm_map_values(Navit.T("Champagne-Ardenne"), "3.34", "47.53", "5.94", "50.28", 269947824L, 2),
+ new osm_map_values(Navit.T("Corse"), "8.12", "41.32", "9.95", "43.28", 129902146L, 2),
+ new osm_map_values(Navit.T("Franche-Comte"), "5.20", "46.21", "7.83", "48.07", 324476070L, 2),
+ new osm_map_values(Navit.T("Haute-Normandie"), "-0.15", "48.62", "1.85", "50.18", 202782876L, 2),
+ new osm_map_values(Navit.T("Ile-de-France"), "1.40", "48.07", "3.61", "49.29", 311052699L, 2),
+ new osm_map_values(Navit.T("Languedoc-Roussillon"), "1.53", "42.25", "4.89", "45.02", 380145667L, 2),
+ new osm_map_values(Navit.T("Limousin"), "0.58", "44.87", "2.66", "46.50", 206696539L, 2),
+ new osm_map_values(Navit.T("Lorraine"), "4.84", "47.77", "7.72", "49.73", 330777318L, 2),
+ new osm_map_values(Navit.T("Midi-Pyrenees"), "-0.37", "42.18", "3.50", "45.10", 462618363L, 2),
+ new osm_map_values(Navit.T("Nord-pas-de-Calais"), "1.42", "49.92", "4.49", "51.31", 368467511L, 2),
+ new osm_map_values(Navit.T("Pays-de-la-Loire"), "-2.88", "46.20", "0.97", "48.62", 499471143L, 2),
+ new osm_map_values(Navit.T("Picardie"), "1.25", "48.79", "4.31", "50.43", 374308041L, 2),
+ new osm_map_values(Navit.T("Poitou-Charentes"), "-1.69", "45.04", "1.26", "47.23", 342125526L, 2),
+ new osm_map_values(Navit.T("Provence-Alpes-Cote-d-Azur"), "4.21", "42.91", "7.99", "45.18", 390306134L, 2),
+ new osm_map_values(Navit.T("Rhone-Alpes"), "3.65", "44.07", "7.88", "46.64", 510797942L, 2),
+ new osm_map_values(Navit.T("Germany"), "5.18", "46.84", "15.47", "55.64", 3521359466L, 1),
+ new osm_map_values(Navit.T("Baden-Wuerttemberg"), "7.32", "47.14", "10.57", "49.85", 674361124L, 2),
+ new osm_map_values(Navit.T("Bayern"), "8.92", "47.22", "13.90", "50.62", 860161150L, 2),
+ new osm_map_values(Navit.T("Mittelfranken"), "9.86", "48.78", "11.65", "49.84", 203055195L, 2),
+ new osm_map_values(Navit.T("Niederbayern"), "11.55", "47.75", "14.12", "49.42", 312924770L, 2),
+ new osm_map_values(Navit.T("Oberbayern"), "10.67", "47.05", "13.57", "49.14", 382734883L, 2),
+ new osm_map_values(Navit.T("Oberfranken"), "10.31", "49.54", "12.49", "50.95", 235258691L, 2),
+ new osm_map_values(Navit.T("Oberpfalz"), "11.14", "48.71", "13.47", "50.43", 264536012L, 2),
+ new osm_map_values(Navit.T("Schwaben"), "9.27", "47.10", "11.36", "49.09", 321141607L, 2),
+ new osm_map_values(Navit.T("Unterfranken"), "8.59", "49.16", "10.93", "50.67", 303720890L, 2),
+ new osm_map_values(Navit.T("Berlin"), "13.03", "52.28", "13.81", "52.73", 169019946L, 2),
+ new osm_map_values(Navit.T("Brandenburg"), "11.17", "51.30", "14.83", "53.63", 323497599L, 2),
+ new osm_map_values(Navit.T("Bremen"), "8.43", "52.96", "9.04", "53.66", 150963608L, 2),
+ new osm_map_values(Navit.T("Hamburg"), "9.56", "53.34", "10.39", "53.80", 156284421L, 2),
+ new osm_map_values(Navit.T("Hessen"), "7.72", "49.34", "10.29", "51.71", 432279328L, 2),
+ new osm_map_values(Navit.T("Mecklenburg-Vorpommern"), "10.54", "53.05", "14.48", "55.05", 213183908L, 2),
+ new osm_map_values(Navit.T("Niedersachsen"), "6.40", "51.24", "11.69", "54.22", 819766939L, 2),
+ new osm_map_values(Navit.T("Nordrhein-westfalen"), "5.46", "50.26", "9.52", "52.59", 967053517L, 2),
+ new osm_map_values(Navit.T("Rheinland-Pfalz"), "6.06", "48.91", "8.56", "51.00", 442868899L, 2),
+ new osm_map_values(Navit.T("Saarland"), "6.30", "49.06", "7.46", "49.69", 157721162L, 2),
+ new osm_map_values(Navit.T("Sachsen-Anhalt"), "10.50", "50.88", "13.26", "53.11", 287785088L, 2),
+ new osm_map_values(Navit.T("Sachsen"), "11.82", "50.11", "15.10", "51.73", 342620834L, 2),
+ new osm_map_values(Navit.T("Schleswig-Holstein"), "7.41", "53.30", "11.98", "55.20", 280293910L, 2),
+ new osm_map_values(Navit.T("Thueringen"), "9.81", "50.15", "12.72", "51.70", 269428239L, 2),
+ new osm_map_values(Navit.T("Germany")+"+"+Navit.T("Austria")+"+"+Navit.T("Switzerland"), "3.4", "44.5", "18.6", "55.1", 5746126429L, 1),
+ new osm_map_values(Navit.T("Iceland"), "-25.3", "62.8", "-11.4", "67.5", 124837162L, 1),
+ new osm_map_values(Navit.T("Ireland"), "-11.17", "51.25", "-5.23", "55.9", 234750271L, 1),
+ new osm_map_values(Navit.T("Italy"), "6.52", "36.38", "18.96", "47.19", 1610171395L, 1),
+ new osm_map_values(Navit.T("Spain")+"+"+Navit.T("Portugal"), "-11.04", "34.87", "4.62", "44.41", 1039624918L, 1),
+ new osm_map_values(Navit.T("Mallorca"), "2.2", "38.8", "4.7", "40.2", 137200636L, 2),
+ new osm_map_values(Navit.T("Galicia"), "-10.0", "41.7", "-6.3", "44.1", 174549553L, 2),
+ new osm_map_values(Navit.T("Scandinavia"), "4.0", "54.4", "32.1", "71.5", 1398661090L, 1),
+ new osm_map_values(Navit.T("Finland"), "18.6", "59.2", "32.3", "70.3", 460997178L, 1),
+ new osm_map_values(Navit.T("Denmark"), "7.49", "54.33", "13.05", "57.88", 321870414L, 1),
+ new osm_map_values(Navit.T("Switzerland"), "5.79", "45.74", "10.59", "47.84", 552565332L, 1),
+ new osm_map_values(Navit.T("United Kingdom"), "-9.7", "49.6", "2.2", "61.2", 901724648L, 1),
+ new osm_map_values(Navit.T("England"), "-7.80", "48.93", "2.41", "56.14", 937728414L, 1),
+ new osm_map_values(Navit.T("Buckinghamshire"), "-1.19", "51.44", "-0.43", "52.25", 142256978L, 2),
+ new osm_map_values(Navit.T("Cambridgeshire"), "-0.55", "51.96", "0.56", "52.79", 142334001L, 2),
+ new osm_map_values(Navit.T("Cumbria"), "-3.96", "53.85", "-2.11", "55.24", 144422460L, 2),
+ new osm_map_values(Navit.T("East yorkshire with hull"), "-1.16", "53.50", "0.54", "54.26", 141518744L, 2),
+ new osm_map_values(Navit.T("Essex"), "-0.07", "51.40", "1.36", "52.14", 162542730L, 2),
+ new osm_map_values(Navit.T("Herefordshire"), "-3.19", "51.78", "-2.29", "52.45", 129368660L, 2),
+ new osm_map_values(Navit.T("Kent"), "-0.02", "50.81", "1.65", "51.53", 145482562L, 2),
+ new osm_map_values(Navit.T("Lancashire"), "-3.20", "53.43", "-2.00", "54.29", 148964975L, 2),
+ new osm_map_values(Navit.T("Leicestershire"), "-1.65", "52.34", "-0.61", "53.03", 154199956L, 2),
+ new osm_map_values(Navit.T("Norfolk"), "0.10", "52.30", "2.04", "53.41", 146017009L, 2),
+ new osm_map_values(Navit.T("Nottinghamshire"), "-1.39", "52.73", "-0.62", "53.55", 147986548L, 2),
+ new osm_map_values(Navit.T("Oxfordshire"), "-1.77", "51.41", "-0.82", "52.22", 142240992L, 2),
+ new osm_map_values(Navit.T("Shropshire"), "-3.29", "52.26", "-2.18", "53.05", 136909363L, 2),
+ new osm_map_values(Navit.T("Somerset"), "-3.89", "50.77", "-2.20", "51.40", 145186096L, 2),
+ new osm_map_values(Navit.T("South yorkshire"), "-1.88", "53.25", "-0.80", "53.71", 145902650L, 2),
+ new osm_map_values(Navit.T("Suffolk"), "0.29", "51.88", "1.81", "52.60", 143799697L, 2),
+ new osm_map_values(Navit.T("Surrey"), "-0.90", "51.02", "0.10", "51.52", 157987139L, 2),
+ new osm_map_values(Navit.T("Wiltshire"), "-2.41", "50.90", "-1.44", "51.76", 138652346L, 2),
+ new osm_map_values(Navit.T("Scotland"), "-8.13", "54.49", "-0.15", "61.40", 258853845L, 2),
+ new osm_map_values(Navit.T("Wales"), "-5.56", "51.28", "-2.60", "53.60", 193593409L, 2),
+ new osm_map_values(Navit.T("Albania"), "19.09", "39.55", "21.12", "42.72", 146199817L, 1),
+ new osm_map_values(Navit.T("Belarus"), "23.12", "51.21", "32.87", "56.23", 324470696L, 1),
+ new osm_map_values(Navit.T("Russian Federation"), "27.9", "41.5", "190.4", "77.6", 2148314279L, 1),
+ new osm_map_values(Navit.T("Bulgaria"), "24.7", "42.1", "24.8", "42.1", 109869373L, 1),
+ new osm_map_values(Navit.T("Bosnia and Herzegovina"), "15.69", "42.52", "19.67", "45.32", 187122485L, 1),
+ new osm_map_values(Navit.T("Czech Republic"), "11.91", "48.48", "19.02", "51.17", 904838442L, 1),
+ new osm_map_values(Navit.T("Croatia"), "13.4", "42.1", "19.4", "46.9", 460854751L, 1),
+ new osm_map_values(Navit.T("Estonia"), "21.5", "57.5", "28.2", "59.6", 173378927L, 1),
+ new osm_map_values(Navit.T("Greece"), "28.9", "37.8", "29.0", "37.8", 109435051L, 1),
+ new osm_map_values(Navit.T("Crete"), "23.3", "34.5", "26.8", "36.0", 115985063L, 1),
+ new osm_map_values(Navit.T("Hungary"), "16.08", "45.57", "23.03", "48.39", 350318541L, 1),
+ new osm_map_values(Navit.T("Latvia"), "20.7", "55.6", "28.3", "58.1", 188188140L, 1),
+ new osm_map_values(Navit.T("Lithuania"), "20.9", "53.8", "26.9", "56.5", 217852597L, 1),
+ new osm_map_values(Navit.T("Poland"), "13.6", "48.8", "24.5", "55.0", 1464968657L, 1),
+ new osm_map_values(Navit.T("Romania"), "20.3", "43.5", "29.9", "48.4", 347931565L, 1),
+ new osm_map_values(Navit.T("Ukraine"), "22.0", "44.3", "40.4", "52.4", 793611912L, 1),
+ new osm_map_values(Navit.T("North America"), "-178.1", "6.5", "-10.4", "84.0", 5601866516L, 0),
+ new osm_map_values(Navit.T("Alaska"), "-179.5", "49.5", "-129", "71.6", 207746039L, 1),
+ new osm_map_values(Navit.T("Canada"), "-141.3", "41.5", "-52.2", "70.2", 2635719651L, 1),
+ new osm_map_values(Navit.T("Hawaii"), "-161.07", "18.49", "-154.45", "22.85", 115016656L, 1),
+ new osm_map_values(Navit.T("USA")+Navit.T(" (except Alaska and Hawaii)"), "-125.4", "24.3", "-66.5", "49.3", 4060487198L, 1),
+ new osm_map_values(Navit.T("Midwest"), "-104.11", "35.92", "-80.46", "49.46", 1145596450L, 2),
+ new osm_map_values(Navit.T("Michigan"), "-90.47", "41.64", "-79.00", "49.37", 538247019L, 2),
+ new osm_map_values(Navit.T("Ohio"), "-84.87", "38.05", "-79.85", "43.53", 277022336L, 2),
+ new osm_map_values(Navit.T("Northeast"), "-80.58", "38.72", "-66.83", "47.53", 1017160709L, 2),
+ new osm_map_values(Navit.T("Massachusetts"), "-73.56", "40.78", "-68.67", "42.94", 340055487L, 2),
+ new osm_map_values(Navit.T("Vermont"), "-73.49", "42.68", "-71.41", "45.07", 139626067L, 2),
+ new osm_map_values(Navit.T("Pacific"), "-180.05", "15.87", "-129.75", "73.04", 207090640L, 2),
+ new osm_map_values(Navit.T("South"), "-106.70", "23.98", "-71.46", "40.70", 1747935356L, 2),
+ new osm_map_values(Navit.T("Arkansas"), "-94.67", "32.95", "-89.59", "36.60", 155658661L, 2),
+ new osm_map_values(Navit.T("District of Columbia"), "-77.17", "38.74", "-76.86", "39.05", 129235755L, 2),
+ new osm_map_values(Navit.T("Florida"), "-88.75", "23.63", "-77.67", "31.05", 224022108L, 2),
+ new osm_map_values(Navit.T("Louisiana"), "-94.09", "28.09", "-88.62", "33.07", 210120605L, 2),
+ new osm_map_values(Navit.T("Maryland"), "-79.54", "37.83", "-74.99", "40.22", 276462622L, 2),
+ new osm_map_values(Navit.T("Mississippi"), "-91.71", "29.99", "-88.04", "35.05", 177858031L, 2),
+ new osm_map_values(Navit.T("Oklahoma"), "-103.41", "33.56", "-94.38", "37.38", 200061473L, 2),
+ new osm_map_values(Navit.T("Texas"), "-106.96", "25.62", "-92.97", "36.58", 430089141L, 2),
+ new osm_map_values(Navit.T("Virginia"), "-83.73", "36.49", "-74.25", "39.52", 384187569L, 2),
+ new osm_map_values(Navit.T("West Virginia"), "-82.70", "37.15", "-77.66", "40.97", 220552071L, 2),
+ new osm_map_values(Navit.T("West"), "-133.11", "31.28", "-101.99", "49.51", 1152909162L, 2),
+ new osm_map_values(Navit.T("Arizona"), "-114.88", "30.01", "-108.99", "37.06", 182826833L, 2),
+ new osm_map_values(Navit.T("California"), "-125.94", "32.43", "-114.08", "42.07", 586923326L, 2),
+ new osm_map_values(Navit.T("Colorado"), "-109.11", "36.52", "-100.41", "41.05", 228623724L, 2),
+ new osm_map_values(Navit.T("Idaho"), "-117.30", "41.93", "-110.99", "49.18", 170684507L, 2),
+ new osm_map_values(Navit.T("Montana"), "-116.10", "44.31", "-102.64", "49.74", 176229800L, 2),
+ new osm_map_values(Navit.T("New Mexico"), "-109.10", "26.98", "-96.07", "37.05", 361793070L, 2),
+ new osm_map_values(Navit.T("Nevada"), "-120.2", "35.0", "-113.8", "42.1", 200614482L, 2),
+ new osm_map_values(Navit.T("Oregon"), "-124.8", "41.8", "-116.3", "46.3", 211462685L, 2),
+ new osm_map_values(Navit.T("Utah"), "-114.11", "36.95", "-108.99", "42.05", 151590197L, 2),
+ new osm_map_values(Navit.T("Washington State"), "-125.0", "45.5", "-116.9", "49.0", 222553768L, 2),
+ new osm_map_values(Navit.T("South+Middle America"), "-83.5", "-56.3", "-30.8", "13.7", 958895383L, 0),
+ new osm_map_values(Navit.T("Argentina"), "-73.9", "-57.3", "-51.6", "-21.0", 376857648L, 1),
+ new osm_map_values(Navit.T("Argentina")+"+"+Navit.T("Chile"), "-77.2", "-56.3", "-52.7", "-16.1", 420275812L, 1),
+ new osm_map_values(Navit.T("Bolivia"), "-70.5", "-23.1", "-57.3", "-9.3", 175937824L, 1),
+ new osm_map_values(Navit.T("Brazil"), "-71.4", "-34.7", "-32.8", "5.4", 664872975L, 1),
+ new osm_map_values(Navit.T("Chile"), "-81.77", "-58.50", "-65.46", "-17.41", 241657330L, 1),
+ new osm_map_values(Navit.T("Cuba"), "-85.3", "19.6", "-74.0", "23.6", 129043575L, 1),
+ new osm_map_values(Navit.T("Colombia"), "-79.1", "-4.0", "-66.7", "12.6", 212016580L, 1),
+ new osm_map_values(Navit.T("Ecuador"), "-82.6", "-5.4", "-74.4", "2.3", 158857591L, 1),
+ new osm_map_values(Navit.T("Guyana")+"+"+Navit.T("Suriname")+"+"+Navit.T("Guyane Francaise"), "-62.0", "1.0", "-51.2", "8.9", 123000072L, 1),
+ new osm_map_values(Navit.T("Haiti")+"+"+Navit.T("Dominican Republic"), "-74.8", "17.3", "-68.2", "20.1", 149925689L, 1),
+ new osm_map_values(Navit.T("Jamaica"), "-78.6", "17.4", "-75.9", "18.9", 113961998L, 1),
+ new osm_map_values(Navit.T("Mexico"), "-117.6", "14.1", "-86.4", "32.8", 551307973L, 1),
+ new osm_map_values(Navit.T("Paraguay"), "-63.8", "-28.1", "-53.6", "-18.8", 159498397L, 1),
+ new osm_map_values(Navit.T("Peru"), "-82.4", "-18.1", "-67.5", "0.4", 212490557L, 1),
+ new osm_map_values(Navit.T("Uruguay"), "-59.2", "-36.5", "-51.7", "-29.7", 157482719L, 1),
+ new osm_map_values(Navit.T("Venezuela"), "-73.6", "0.4", "-59.7", "12.8", 167295729L, 1)
+ };
+
+ private String map_filename_path;
+
+ public static NavitMap[] getAvailableMaps() {
+ class filterMaps implements FilenameFilter {
+ public boolean accept(File dir, String filename) {
+ return (filename.endsWith(".bin"));
+ }
+ }
+ NavitMap maps[] = new NavitMap[0];
+ File map_dir = new File(Navit.map_filename_path);
+ String map_file_names[] = map_dir.list(new filterMaps());
+ if (map_file_names != null) {
+ maps = new NavitMap[map_file_names.length];
+ for (int map_file_index = 0; map_file_index < map_file_names.length; map_file_index++) {
+ maps[map_file_index] = new NavitMap(Navit.map_filename_path, map_file_names[map_file_index]);
+ }
+ }
+ return maps;
+ }
+ private Boolean stop_me = false;
+ private osm_map_values map_values;
+ private int map_id;
+ private long uiLastUpdated = -1;
+
+ private Boolean retryDownload = false; //Download failed, but
+ //we should try to resume
+ private static final int SOCKET_CONNECT_TIMEOUT = 60000; // 60 secs.
+ private static final int SOCKET_READ_TIMEOUT = 120000; // 120 secs.
+ private static final int MAP_WRITE_FILE_BUFFER = 1024 * 64;
+ private static final int MAP_WRITE_MEM_BUFFER = 1024 * 64;
+ private static final int MAP_READ_FILE_BUFFER = 1024 * 64;
+ private static final int UPDATE_PROGRESS_TIME_NS = 1000 * 1000000; // 1ns=1E-9s
+ private static final int MAX_RETRIES = 5;
+ private static final String TAG = "NavitMapDownloader";
+
+ private int retry_counter = 0;
+
+ NavitMapDownloader(int map_id) {
+ this.map_values = osm_maps[map_id];
+ this.map_id=map_id;
+ this.map_filename_path=Navit.map_filename_path;
+ }
+
+ public void run() {
+ stop_me = false;
+ retry_counter = 0;
+
+ Log.v(TAG, "start download " + map_values.map_name);
+ updateProgress(0, map_values.est_size_bytes, Navit.T("downloading") + ": " + map_values.map_name);
+
+ boolean success;
+ do {
+ try {
+ Thread.sleep(10 + retry_counter * 1000);
+ } catch (InterruptedException e1) {}
+ retryDownload = false;
+ success = download_osm_map();
+ } while ( !success
+ && retryDownload
+ && retry_counter < MAX_RETRIES
+ && !stop_me);
+
+ if (success) {
+ toast(map_values.map_name + " " + Navit.T("ready"));
+ getMapInfoFile().delete();
+ Log.d(TAG, "success");
+ }
+
+ if (success || stop_me ) {
+ NavitDialogs.sendDialogMessage( NavitDialogs.MSG_MAP_DOWNLOAD_FINISHED
+ , map_filename_path + map_values.map_name + ".bin", null, -1, success ? 1 : 0 , map_id );
+ }
+ }
+
+ public void stop_thread() {
+ stop_me = true;
+ Log.d(TAG, "stop_me -> true");
+ }
+
+ private boolean checkFreeSpace(long needed_bytes) {
+ long free_space = getFreeSpace();
+
+ if ( needed_bytes <= 0 )
+ needed_bytes = MAP_WRITE_FILE_BUFFER;
+
+ if (free_space < needed_bytes ) {
+ String msg;
+ Log.e(TAG, "Not enough free space or media not available. Please free at least " + needed_bytes / 1024 /1024 + "Mb.");
+ if(free_space<0)
+ msg=Navit.T("Media selected for map storage is not available");
+ else
+ msg=Navit.T("Not enough free space");
+ updateProgress(free_space, needed_bytes, Navit.T("Error downloading map!") + "\n" + msg);
+ return false;
+ }
+ return true;
+ }
+
+ private boolean deleteMap() {
+ File finalOutputFile = getMapFile();
+
+ if (finalOutputFile.exists()) {
+ Message msg =
+ Message.obtain(Navit.getInstance().getNavitGraphics().callback_handler,
+ NavitGraphics.msg_type.CLB_DELETE_MAP.ordinal());
+ Bundle b = new Bundle();
+ b.putString("title", finalOutputFile.getAbsolutePath());
+ msg.setData(b);
+ msg.sendToTarget();
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * @param map_values
+ * @return
+ */
+ private boolean download_osm_map() {
+ long already_read = 0;
+ long real_size_bytes = 0;
+ boolean resume = true;
+
+ File outputFile = getDestinationFile();
+ long old_download_size = outputFile.length();
+
+ URL url = null;
+ if (old_download_size > 0) {
+ url = readFileInfo();
+ }
+
+ if (url == null) {
+ resume = false;
+ url = getDownloadURL();
+ }
+
+ // URL url = new URL("http://192.168.2.101:8080/zweibruecken.bin");
+ URLConnection c = initConnection(url);
+ if (c != null) {
+
+ if (resume) {
+ c.setRequestProperty("Range", "bytes=" + old_download_size + "-");
+ already_read = old_download_size;
+ }
+ try {
+ real_size_bytes=Long.parseLong(c.getHeaderField("Content-Length")) + already_read;
+ } catch(Exception e) {
+ real_size_bytes=-1;
+ }
+
+ long fileTime = c.getLastModified();
+
+ if (!resume) {
+ outputFile.delete();
+ writeFileInfo(c, real_size_bytes);
+ }
+
+ if (real_size_bytes <= 0)
+ real_size_bytes = map_values.est_size_bytes;
+
+ Log.d(TAG, "size: " + real_size_bytes + ", read: " + already_read + ", timestamp: " + fileTime
+ + ", Connection ref: " + c.getURL());
+
+ if (checkFreeSpace(real_size_bytes - already_read)
+ && downloadData(c, already_read, real_size_bytes, resume, outputFile)) {
+
+ File finalOutputFile = getMapFile();
+ // delete an already existing file first
+ finalOutputFile.delete();
+ // rename file to its final name
+ outputFile.renameTo(finalOutputFile);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private File getDestinationFile() {
+ File outputFile = new File(map_filename_path, map_values.map_name + ".tmp");
+ outputFile.getParentFile().mkdir();
+ return outputFile;
+ }
+
+ private boolean downloadData(URLConnection c, long already_read, long real_size_bytes
+ , boolean resume,File outputFile) {
+ boolean success = false;
+ BufferedOutputStream buf = getOutputStream(outputFile, resume);
+ BufferedInputStream bif = getInputStream(c);
+
+ if (buf != null && bif != null) {
+ success = readData(buf, bif, already_read, real_size_bytes);
+ // always cleanup, as we might get errors when trying to resume
+ try {
+ buf.flush();
+ buf.close();
+
+ bif.close();
+ } catch (IOException e) {
+ }
+ }
+ return success;
+ }
+
+ private URL getDownloadURL() {
+ URL url = null;
+ try {
+ url =
+ new URL("http://maps.navit-project.org/api/map/?bbox=" + map_values.lon1 + "," + map_values.lat1
+ + "," + map_values.lon2 + "," + map_values.lat2);
+ } catch (MalformedURLException e) {
+ Log.e(TAG, "We failed to create a URL to " + map_values.map_name);
+ e.printStackTrace();
+ return null;
+ }
+ Log.v(TAG, "connect to " + url.toString());
+ return url;
+ }
+
+ private long getFreeSpace() {
+ try {
+ StatFs fsInfo = new StatFs(map_filename_path);
+ return (long)fsInfo.getAvailableBlocks() * fsInfo.getBlockSize();
+ } catch(Exception e) {
+ return -1;
+ }
+ }
+
+ private BufferedInputStream getInputStream(URLConnection c) {
+ BufferedInputStream bif = null;
+ try {
+ bif = new BufferedInputStream(c.getInputStream(), MAP_READ_FILE_BUFFER);
+ } catch (FileNotFoundException e) {
+ Log.e(TAG, "File not found on server: " + e);
+ if (retry_counter > 0) {
+ getMapInfoFile().delete();
+ }
+ enableRetry();
+ bif = null;
+ } catch (IOException e) {
+ Log.e(TAG, "Error reading from server: " + e);
+ enableRetry();
+ bif = null;
+ }
+ return bif;
+ }
+
+ private File getMapFile() {
+ return new File(map_filename_path, map_values.map_name + ".bin");
+ }
+
+ private File getMapInfoFile() {
+ return new File(map_filename_path, map_values.map_name + ".tmp.info");
+ }
+
+ private BufferedOutputStream getOutputStream(File outputFile, boolean resume) {
+ BufferedOutputStream buf = null;
+ try {
+ buf = new BufferedOutputStream(new FileOutputStream(outputFile, resume), MAP_WRITE_FILE_BUFFER);
+ } catch (FileNotFoundException e) {
+ Log.e(TAG, "Could not open output file for writing: " + e);
+ buf = null;
+ }
+ return buf;
+ }
+
+ private URLConnection initConnection(URL url) {
+ HttpURLConnection c = null;
+ try {
+ c = (HttpURLConnection) url.openConnection();
+ c.setRequestMethod("GET");
+ } catch (Exception e) {
+ Log.e(TAG, "Failed connecting server: " + e);
+ enableRetry();
+ return null;
+ }
+
+ c.setReadTimeout(SOCKET_READ_TIMEOUT);
+ c.setConnectTimeout(SOCKET_CONNECT_TIMEOUT);
+ return c;
+ }
+
+ private boolean readData(OutputStream buf, InputStream bif, long already_read, long real_size_bytes) {
+ long start_timestamp = System.nanoTime();
+ byte[] buffer = new byte[MAP_WRITE_MEM_BUFFER];
+ int len1 = 0;
+ long mapFileSize = real_size_bytes;
+ long startOffset = already_read;
+ boolean success = false;
+
+ try {
+ while (!stop_me && (len1 = bif.read(buffer)) != -1) {
+ already_read += len1;
+ updateProgress(start_timestamp, startOffset, already_read, mapFileSize);
+
+ try {
+ buf.write(buffer, 0, len1);
+ } catch (IOException e) {
+ Log.d(TAG, "Error: " + e);
+ if ( !checkFreeSpace(real_size_bytes - already_read + MAP_WRITE_FILE_BUFFER)) {
+ if (deleteMap()) {
+ enableRetry();
+ } else {
+ updateProgress(already_read, real_size_bytes, Navit.T("Error downloading map!") + "\n"
+ + Navit.T("Not enough free space"));
+ }
+ } else {
+ updateProgress(already_read, real_size_bytes, Navit.T("Error writing map!"));
+ }
+
+ return false;
+ }
+ }
+
+ if (stop_me) {
+ toast(Navit.T("Map download aborted!"));
+ } else if ( already_read < real_size_bytes ) {
+ Log.d(TAG, "Server send only " + already_read + " bytes of " + real_size_bytes);
+ enableRetry();
+ } else {
+ success = true;
+ }
+ } catch (IOException e) {
+ Log.d(TAG, "Error: " + e);
+
+ enableRetry();
+ updateProgress(already_read, real_size_bytes, Navit.T("Error downloading map!"));
+ }
+
+ return success;
+ }
+
+ private URL readFileInfo() {
+ URL url = null;
+ try {
+ ObjectInputStream infoStream = new ObjectInputStream(new FileInputStream(getMapInfoFile()));
+ String resume_proto = infoStream.readUTF();
+ infoStream.readUTF(); // read the host name (unused for now)
+ String resume_file = infoStream.readUTF();
+ infoStream.close();
+ // looks like the same file, try to resume
+ Log.v(TAG, "Try to resume download");
+ url = new URL(resume_proto + "://" + "maps.navit-project.org" + resume_file);
+ } catch (Exception e) {
+ getMapInfoFile().delete();
+ }
+ return url;
+ }
+
+ private void toast(String message) {
+ NavitDialogs.sendDialogMessage(NavitDialogs.MSG_TOAST, null, message, -1, 0, 0);
+ }
+
+ private void updateProgress(long startTime, long offsetBytes, long readBytes, long maxBytes) {
+ long currentTime = System.nanoTime();
+
+ if ((currentTime > uiLastUpdated + UPDATE_PROGRESS_TIME_NS) && startTime!=currentTime) {
+ float per_second_overall = (readBytes - offsetBytes) / ((currentTime - startTime) / 1000000000f);
+ long bytes_remaining = maxBytes - readBytes;
+ int eta_seconds = (int) (bytes_remaining / per_second_overall);
+
+ String eta_string;
+ if (eta_seconds > 60) {
+ eta_string = (int) (eta_seconds / 60f) + " m";
+ } else {
+ eta_string = eta_seconds + " s";
+ }
+ String info =
+ String.format("%s: %s\n %dMb / %dMb\n %.1f kb/s %s: %s", Navit.T("downloading")
+ , map_values.map_name, readBytes / 1024 / 1024, maxBytes / 1024 / 1024,
+ per_second_overall / 1024f, Navit.T("ETA"), eta_string);
+
+ if (retry_counter > 0) {
+ info += "\n Retry " + retry_counter + "/" + MAX_RETRIES;
+ }
+ Log.e(TAG, "info: " + info);
+
+ updateProgress(readBytes, maxBytes, info);
+ uiLastUpdated = currentTime;
+ }
+ }
+
+ private void updateProgress(long positionBytes, long maximumBytes, String infoText) {
+ NavitDialogs.sendDialogMessage(NavitDialogs.MSG_PROGRESS_BAR, Navit.T("Map download"), infoText
+ , NavitDialogs.DIALOG_MAPDOWNLOAD, (int) (maximumBytes / 1024),
+ (int) (positionBytes / 1024));
+ }
+
+ private void writeFileInfo(URLConnection c, long sizeInBytes) {
+ ObjectOutputStream infoStream;
+ try {
+ infoStream = new ObjectOutputStream(new FileOutputStream(getMapInfoFile()));
+ infoStream.writeUTF(c.getURL().getProtocol());
+ infoStream.writeUTF(c.getURL().getHost());
+ infoStream.writeUTF(c.getURL().getFile());
+ infoStream.writeLong(sizeInBytes);
+ infoStream.close();
+ } catch (Exception e) {
+ Log.e(TAG, "Could not write info file for map download. Resuming will not be possible. (" + e.getMessage() + ")");
+ }
+ }
+
+ private void enableRetry() {
+ retryDownload = true;
+ retry_counter++;
+ }
+ // dialog send helper methods
+}
diff --git a/navit/android/src/org/navitproject/navit/NavitSpeech2.java b/navit/android/src/org/navitproject/navit/NavitSpeech2.java
index b4ec85d4e..77b79c3c2 100644
--- a/navit/android/src/org/navitproject/navit/NavitSpeech2.java
+++ b/navit/android/src/org/navitproject/navit/NavitSpeech2.java
@@ -20,7 +20,6 @@
package org.navitproject.navit;
import android.content.Intent;
-import android.content.Context;
import android.content.DialogInterface;
import android.content.pm.PackageManager;
import android.app.AlertDialog;
@@ -31,17 +30,17 @@ import android.util.Log;
public class NavitSpeech2 implements TextToSpeech.OnInitListener, NavitActivityResult {
private TextToSpeech mTts;
private Navit navit;
- int MY_DATA_CHECK_CODE=1;
+ private int MY_DATA_CHECK_CODE=1;
public void onInit(int status)
{
- Log.e("NavitSpeech2","Status "+status);
+ Log.d("NavitSpeech2","Status "+status);
}
public void onActivityResult(int requestCode, int resultCode, Intent data)
{
- Log.e("NavitSpeech2","onActivityResult "+requestCode+" "+resultCode);
+ Log.d("NavitSpeech2","onActivityResult "+requestCode+" "+resultCode);
if (requestCode == MY_DATA_CHECK_CODE) {
if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
// success, create the TTS instance
diff --git a/navit/android/src/org/navitproject/navit/NavitTextTranslations.java b/navit/android/src/org/navitproject/navit/NavitTextTranslations.java
index 93aa5fe76..5deaca305 100644
--- a/navit/android/src/org/navitproject/navit/NavitTextTranslations.java
+++ b/navit/android/src/org/navitproject/navit/NavitTextTranslations.java
@@ -1,204 +1,204 @@
-/**
- * Navit, a modular navigation system.
- * Copyright (C) 2005-2008 Navit Team
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-package org.navitproject.navit;
-
-import java.util.HashMap;
-
-import android.util.Log;
-
-public class NavitTextTranslations
-{
- static String main_language = "en";
- static String sub_language = "EN";
- static String fallback_language = "en";
- static String fallback_sub_language = "EN";
- private static HashMap<String, HashMap<String, String>> Navit_text_lookup = new HashMap<String, HashMap<String, String>>();
-
- public static void init()
- {
- Log.e("NavitTextTranslations", "initializing translated text ...");
- String k = null;
- String[] v = null;
-/*
- k = "exit navit";
- v = new String[]{"en", "Exit Navit", "de", "Navit beenden", "nl", "Navit afsluiten", "fr","Quittez Navit"};
- p(k, v);
-
- k = "zoom in";
- v = new String[]{"en", "Zoom in", "fr", "Zoom-avant"};
- p(k, v);
-
- k = "zoom out";
- v = new String[]{"en", "Zoom out", "fr", "Zoom-arrière", "nl", "Zoom uit"};
- p(k, v);
-
- k = "address search";
- v = new String[]{"en", "Address search", "de", "Adresse suchen", "nl", "Zoek adres", "fr","Cherchez adresse"};
- p(k, v);
-
- k = "Mapdownload";
- v = new String[]{"en", "Mapdownload", "de", "Kartendownload"};
- p(k, v);
-
- k = "downloading";
- v = new String[]{"en", "downloading"};
- p(k, v);
-
- k = "Downloaded maps";
- v = new String[]{"en", "Downloaded maps", "de", "Heruntergeladene Karten", "nl", "Gedownloade kaarten", "fr","Cartes téléchargées" };
- p(k, v);
-
- k = "ETA";
- v = new String[]{"en", "ETA", "de", "fertig in"};
- p(k, v);
-
- k = "Error downloading map";
- v = new String[]{"en", "Error downloading map!", "de", "Fehler beim Kartendownload"};
- p(k, v);
-
- k = "ready";
- v = new String[]{"en", "ready", "de", "fertig"};
- p(k, v);
-
- k = "Ok";
- v = new String[]{"en", "OK"};
- p(k, v);
-
- k = "No address found";
- v = new String[]{"en", "No address found", "de", "Keine Adresse gefunden"};
- p(k, v);
-
- k = "Enter: City and Street";
- v = new String[]{"en", "Enter: City, Street", "de", "Stadt und Straße:"};
- p(k, v);
-
- k = "No search string entered";
- v = new String[]{"en", "No text entered", "de", "Keine Eingabe"};
- p(k, v);
-
- k = "setting destination to";
- v = new String[]{"en", "Setting destination to:", "de", "neues Fahrziel"};
- p(k, v);
-
- k = "getting search results";
- v = new String[]{"en", "getting search results", "de", "lade Suchergebnisse"};
- p(k, v);
-
- k = "searching ...";
- v = new String[]{"en", "searching ...", "de", "Suche läuft ..."};
- p(k, v);
-
- k = "No Results found!";
- v = new String[]{"en", "No Results found!", "de", "Suche liefert kein Ergebnis!"};
- p(k, v);
-
- k = "Map data (c) OpenStreetMap contributors, CC-BY-SA";
- v = new String[]{"en", "Map data (c) OpenStreetMap contributors, CC-BY-SA"};
- p(k, v);
-
- k = "partial match";
- v = new String[]{"en", "partial match", "de", "ungefähr"};
- p(k, v);
-
- k = "Search";
- v = new String[]{"en", "Search", "de", "suchen"};
- p(k, v);
-
- k = "drive here";
- v = new String[]{"en", "Route to here", "de", "Ziel setzen"};
- p(k, v);
-
- k = "loading search results";
- v = new String[]{"en", "Loading search results", "de", "lade Suchergebnisse"};
- p(k, v);
-
- k = "towns";
- v = new String[]{"en", "Towns", "de", "Städte"};
- p(k, v);
-*/
- Log.e("NavitTextTranslations", "... ready");
- }
-
- private static void p(String key, String[] values)
- {
- HashMap<String, String> t = new HashMap<String, String>();
- //Log.e("NavitTextTranslations", "trying: " + key);
- try
- {
- for (int i = 0; i < (int) (values.length / 2); i++)
- {
- t.put(values[i * 2], values[(i * 2) + 1]);
- }
- Navit_text_lookup.put(key, t);
- }
- catch (Exception e)
- {
- Log.e("NavitTextTranslations", "!!Error in translationkey: " + key);
- }
- }
-
- public static String get_text(String in)
- {
- String out = null;
- //Log.e("NavitTextTranslations", "lookup L:" + main_language + " T:" + in);
- try
- {
- out = Navit_text_lookup.get(in).get(main_language);
- }
- catch (Exception e)
- {
- // most likely there is not translation yet
- //Log.e("NavitTextTranslations", "lookup: exception");
- out = null;
- }
-
- if (out == null)
- {
- // always return a string for output (use fallback language)
- //Log.e("NavitTextTranslations", "using default language");
- try
- {
- out = Navit_text_lookup.get(in).get(fallback_language);
- }
- catch (Exception e)
- {
- //Log.e("NavitTextTranslations", "using default language: exception");
- // most likely there is not translation yet
- out = null;
- }
- }
-
- if (out == null)
- {
- // if we still dont have any text, use the ".mo" file and call the c-function gettext(in)
- out = NavitGraphics.getLocalizedString(in);
- if (out != null)
- {
- HashMap<String, String> langmap = new HashMap<String, String>();
- langmap.put(main_language, out);
- Navit_text_lookup.put(in, langmap);
- }
-
- //Log.e("NavitTextTranslations", "return the value from gettext() = " + out);
- }
- return out;
- }
-
-}
+/**
+ * Navit, a modular navigation system.
+ * Copyright (C) 2005-2008 Navit Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+package org.navitproject.navit;
+
+import java.util.HashMap;
+
+import android.util.Log;
+
+public class NavitTextTranslations
+{
+ static String main_language = "en";
+ static String sub_language = "EN";
+ static String fallback_language = "en";
+ static String fallback_sub_language = "EN";
+ private static HashMap<String, HashMap<String, String>> Navit_text_lookup = new HashMap<String, HashMap<String, String>>();
+
+ public static void init()
+ {
+ Log.e("NavitTextTranslations", "initializing translated text ...");
+ String k = null;
+ String[] v = null;
+/*
+ k = "exit navit";
+ v = new String[]{"en", "Exit Navit", "de", "Navit beenden", "nl", "Navit afsluiten", "fr","Quittez Navit"};
+ p(k, v);
+
+ k = "zoom in";
+ v = new String[]{"en", "Zoom in", "fr", "Zoom-avant"};
+ p(k, v);
+
+ k = "zoom out";
+ v = new String[]{"en", "Zoom out", "fr", "Zoom-arrière", "nl", "Zoom uit"};
+ p(k, v);
+
+ k = "address search";
+ v = new String[]{"en", "Address search", "de", "Adresse suchen", "nl", "Zoek adres", "fr","Cherchez adresse"};
+ p(k, v);
+
+ k = "Mapdownload";
+ v = new String[]{"en", "Mapdownload", "de", "Kartendownload"};
+ p(k, v);
+
+ k = "downloading";
+ v = new String[]{"en", "downloading"};
+ p(k, v);
+
+ k = "Downloaded maps";
+ v = new String[]{"en", "Downloaded maps", "de", "Heruntergeladene Karten", "nl", "Gedownloade kaarten", "fr","Cartes téléchargées" };
+ p(k, v);
+
+ k = "ETA";
+ v = new String[]{"en", "ETA", "de", "fertig in"};
+ p(k, v);
+
+ k = "Error downloading map";
+ v = new String[]{"en", "Error downloading map!", "de", "Fehler beim Kartendownload"};
+ p(k, v);
+
+ k = "ready";
+ v = new String[]{"en", "ready", "de", "fertig"};
+ p(k, v);
+
+ k = "Ok";
+ v = new String[]{"en", "OK"};
+ p(k, v);
+
+ k = "No address found";
+ v = new String[]{"en", "No address found", "de", "Keine Adresse gefunden"};
+ p(k, v);
+
+ k = "Enter: City and Street";
+ v = new String[]{"en", "Enter: City, Street", "de", "Stadt und Straße:"};
+ p(k, v);
+
+ k = "No search string entered";
+ v = new String[]{"en", "No text entered", "de", "Keine Eingabe"};
+ p(k, v);
+
+ k = "setting destination to";
+ v = new String[]{"en", "Setting destination to:", "de", "neues Fahrziel"};
+ p(k, v);
+
+ k = "getting search results";
+ v = new String[]{"en", "getting search results", "de", "lade Suchergebnisse"};
+ p(k, v);
+
+ k = "searching ...";
+ v = new String[]{"en", "searching ...", "de", "Suche läuft ..."};
+ p(k, v);
+
+ k = "No Results found!";
+ v = new String[]{"en", "No Results found!", "de", "Suche liefert kein Ergebnis!"};
+ p(k, v);
+
+ k = "Map data (c) OpenStreetMap contributors, CC-BY-SA";
+ v = new String[]{"en", "Map data (c) OpenStreetMap contributors, CC-BY-SA"};
+ p(k, v);
+
+ k = "partial match";
+ v = new String[]{"en", "partial match", "de", "ungefähr"};
+ p(k, v);
+
+ k = "Search";
+ v = new String[]{"en", "Search", "de", "suchen"};
+ p(k, v);
+
+ k = "drive here";
+ v = new String[]{"en", "Route to here", "de", "Ziel setzen"};
+ p(k, v);
+
+ k = "loading search results";
+ v = new String[]{"en", "Loading search results", "de", "lade Suchergebnisse"};
+ p(k, v);
+
+ k = "towns";
+ v = new String[]{"en", "Towns", "de", "Städte"};
+ p(k, v);
+*/
+ Log.e("NavitTextTranslations", "... ready");
+ }
+
+ private static void p(String key, String[] values)
+ {
+ HashMap<String, String> t = new HashMap<String, String>();
+ //Log.e("NavitTextTranslations", "trying: " + key);
+ try
+ {
+ for (int i = 0; i < (int) (values.length / 2); i++)
+ {
+ t.put(values[i * 2], values[(i * 2) + 1]);
+ }
+ Navit_text_lookup.put(key, t);
+ }
+ catch (Exception e)
+ {
+ Log.e("NavitTextTranslations", "!!Error in translationkey: " + key);
+ }
+ }
+
+ public static String get_text(String in)
+ {
+ String out = null;
+ //Log.e("NavitTextTranslations", "lookup L:" + main_language + " T:" + in);
+ try
+ {
+ out = Navit_text_lookup.get(in).get(main_language);
+ }
+ catch (Exception e)
+ {
+ // most likely there is not translation yet
+ //Log.e("NavitTextTranslations", "lookup: exception");
+ out = null;
+ }
+
+ if (out == null)
+ {
+ // always return a string for output (use fallback language)
+ //Log.e("NavitTextTranslations", "using default language");
+ try
+ {
+ out = Navit_text_lookup.get(in).get(fallback_language);
+ }
+ catch (Exception e)
+ {
+ //Log.e("NavitTextTranslations", "using default language: exception");
+ // most likely there is not translation yet
+ out = null;
+ }
+ }
+
+ if (out == null)
+ {
+ // if we still dont have any text, use the ".mo" file and call the c-function gettext(in)
+ out = NavitGraphics.getLocalizedString(in);
+ if (out != null)
+ {
+ HashMap<String, String> langmap = new HashMap<String, String>();
+ langmap.put(main_language, out);
+ Navit_text_lookup.put(in, langmap);
+ }
+
+ //Log.e("NavitTextTranslations", "return the value from gettext() = " + out);
+ }
+ return out;
+ }
+
+}
diff --git a/navit/android/src/org/navitproject/navit/NavitVehicle.java b/navit/android/src/org/navitproject/navit/NavitVehicle.java
index e1a9c70f1..583d044c1 100644
--- a/navit/android/src/org/navitproject/navit/NavitVehicle.java
+++ b/navit/android/src/org/navitproject/navit/NavitVehicle.java
@@ -20,7 +20,6 @@
package org.navitproject.navit;
import java.util.List;
-import android.Manifest;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@@ -40,7 +39,7 @@ import android.support.v4.content.ContextCompat;
public class NavitVehicle {
- public static final String GPS_FIX_CHANGE = "android.location.GPS_FIX_CHANGE";
+ private static final String GPS_FIX_CHANGE = "android.location.GPS_FIX_CHANGE";
public static Location lastLocation = null;
diff --git a/navit/attr.c b/navit/attr.c
index 18ad79f64..863ab08ae 100644
--- a/navit/attr.c
+++ b/navit/attr.c
@@ -153,7 +153,7 @@ attr_new_from_text(const char *name, const char *value)
int min,max,count;
ret=g_new0(struct attr, 1);
- dbg(lvl_debug,"enter name='%s' value='%s'\n", name, value);
+ dbg(lvl_debug,"enter name='%s' value='%s'", name, value);
attr=attr_from_name(name);
ret->type=attr;
switch (attr) {
@@ -171,7 +171,7 @@ attr_new_from_text(const char *name, const char *value)
ret->u.item_types[count++]=item_type;
ret->u.item_types[count]=type_none;
} else {
- dbg(lvl_error,"Unknown item type '%s' ignored.\n",tok);
+ dbg(lvl_error,"Unknown item type '%s' ignored.",tok);
}
str=NULL;
}
@@ -251,13 +251,13 @@ attr_new_from_text(const char *name, const char *value)
}
if (value_is_relative) {
if ((ret->u.num > ATTR_REL_MAXREL) || (ret->u.num < ATTR_REL_MINREL)) {
- dbg(lvl_error, "Relative possibly-relative attribute with value out of range: %li\n", ret->u.num);
+ dbg(lvl_error, "Relative possibly-relative attribute with value out of range: %li", ret->u.num);
}
ret->u.num += ATTR_REL_RELSHIFT;
} else {
if ((ret->u.num > ATTR_REL_MAXABS) || (ret->u.num < ATTR_REL_MINABS)) {
- dbg(lvl_error, "Non-relative possibly-relative attribute with value out of range: %li\n", ret->u.num);
+ dbg(lvl_error, "Non-relative possibly-relative attribute with value out of range: %li", ret->u.num);
}
}
break;
@@ -291,7 +291,7 @@ attr_new_from_text(const char *name, const char *value)
color->b = (b << 8) | b;
color->a = (a << 8) | a;
} else {
- dbg(lvl_error,"color %s has unknown format\n",value);
+ dbg(lvl_error,"color %s has unknown format",value);
}
break;
}
@@ -302,7 +302,7 @@ attr_new_from_text(const char *name, const char *value)
transform_to_geo(projection_mg, &c, g);
break;
}
- dbg(lvl_debug,"unknown attribute\n");
+ dbg(lvl_debug,"unknown attribute");
g_free(ret);
ret=NULL;
}
@@ -515,9 +515,9 @@ attr_to_text(struct attr *attr, struct map *map, int pretty)
struct attr *
attr_search(struct attr **attrs, struct attr *last, enum attr_type attr)
{
- dbg(lvl_info, "enter attrs=%p\n", attrs);
+ dbg(lvl_info, "enter attrs=%p", attrs);
while (*attrs) {
- dbg(lvl_debug,"*attrs=%p\n", *attrs);
+ dbg(lvl_debug,"*attrs=%p", *attrs);
if ((*attrs)->type == attr) {
return *attrs;
}
@@ -615,7 +615,7 @@ attr_generic_set_attr(struct attr **attrs, struct attr *attr)
{
struct attr **curr=attrs;
int i,count=0;
- dbg(lvl_debug, "enter, attrs=%p, attr=%p (%s)\n", attrs, attr, attr_to_name(attr->type));
+ dbg(lvl_debug, "enter, attrs=%p, attr=%p (%s)", attrs, attr, attr_to_name(attr->type));
while (curr && *curr) {
if ((*curr)->type == attr->type) {
attr_free(*curr);
@@ -648,7 +648,7 @@ attr_generic_add_attr(struct attr **attrs, struct attr *attr)
{
struct attr **curr=attrs;
int i,count=0;
- dbg(lvl_debug, "enter, attrs=%p, attr=%p (%s)\n", attrs, attr, attr_to_name(attr->type));
+ dbg(lvl_debug, "enter, attrs=%p, attr=%p (%s)", attrs, attr, attr_to_name(attr->type));
while (curr && *curr) {
curr++;
count++;
@@ -796,7 +796,7 @@ attr_data_size(struct attr *attr)
while (attr->u.attr_types[i++] != attr_none);
return i*sizeof(enum attr_type);
}
- dbg(lvl_error,"size for %s unknown\n", attr_to_name(attr->type));
+ dbg(lvl_error,"size for %s unknown", attr_to_name(attr->type));
return 0;
}
@@ -956,7 +956,7 @@ attr_from_line(char *line, char *name, int *pos, char *val_ret, char *name_ret)
int len=0,quoted;
char *p,*e,*n;
- dbg(lvl_debug,"get_tag %s from %s\n", name, line);
+ dbg(lvl_debug,"get_tag %s from %s", name, line);
if (name)
len=strlen(name);
if (pos)
diff --git a/navit/autoload/osso/osso.c b/navit/autoload/osso/osso.c
index f6672090c..d14229f05 100644
--- a/navit/autoload/osso/osso.c
+++ b/navit/autoload/osso/osso.c
@@ -33,7 +33,7 @@ osso_display_on(struct navit *this_)
static gboolean
osso_cb_hw_state_idle(struct cb_hw_state_trail * params)
{
- dbg(lvl_debug, "(inact=%d, save=%d, shut=%d, memlow=%d, state=%d)\n",
+ dbg(lvl_debug, "(inact=%d, save=%d, shut=%d, memlow=%d, state=%d)",
params->state->system_inactivity_ind,
params->state->save_unsaved_data_ind, params->state->shutdown_ind,
params->state->memory_low_ind, params->state->sig_device_mode_ind);
@@ -69,10 +69,10 @@ osso_cb_hw_state(osso_hw_state_t * state, gpointer data)
static void
osso_navit(struct navit *nav, int add)
{
- dbg(lvl_debug, "Installing osso context for org.navit_project.navit\n");
+ dbg(lvl_debug, "Installing osso context for org.navit_project.navit");
osso_context = osso_initialize("org.navit_project.navit", version, TRUE, NULL);
if (osso_context == NULL) {
- dbg(lvl_error, "error initiating osso context\n");
+ dbg(lvl_error, "error initiating osso context");
}
osso_hw_set_event_cb(osso_context, NULL, osso_cb_hw_state, nav);
@@ -87,7 +87,7 @@ plugin_init(void)
{
//struct callback *cb;
- dbg(lvl_info, "enter\n");
+ dbg(lvl_info, "enter");
callback.u.callback = callback_new_attr_0(callback_cast(osso_navit), attr_navit);
config_add_attr(config, &callback);
diff --git a/navit/binding/dbus/binding_dbus.c b/navit/binding/dbus/binding_dbus.c
index 86f4cb869..6242c27ed 100644
--- a/navit/binding/dbus/binding_dbus.c
+++ b/navit/binding/dbus/binding_dbus.c
@@ -85,7 +85,7 @@ object_new(char *type, void *object)
{
int id;
char *ret;
- dbg(lvl_debug,"enter %s\n", type);
+ dbg(lvl_debug,"enter %s", type);
if ((ret=g_hash_table_lookup(object_hash_rev, object)))
return ret;
id=GPOINTER_TO_INT(g_hash_table_lookup(object_count, type));
@@ -93,7 +93,7 @@ object_new(char *type, void *object)
ret=g_strdup_printf("%s/%s/%d", object_path, type, id);
g_hash_table_insert(object_hash, ret, object);
g_hash_table_insert(object_hash_rev, object, ret);
- dbg(lvl_debug,"return %s\n", ret);
+ dbg(lvl_debug,"return %s", ret);
return (ret);
}
@@ -135,7 +135,7 @@ resolve_object(const char *opath, char *type)
struct attr attr;
if (strncmp(opath, object_path, strlen(object_path))) {
- dbg(lvl_error,"wrong object path %s\n",opath);
+ dbg(lvl_error,"wrong object path %s",opath);
return NULL;
}
prefix=g_strdup_printf("%s/%s/", object_path, type);
@@ -152,7 +152,7 @@ resolve_object(const char *opath, char *type)
if (!config_get_attr(config, attr_navit, &navit, NULL))
return NULL;
if (!oprefix[0]) {
- dbg(lvl_debug,"default_navit\n");
+ dbg(lvl_debug,"default_navit");
return navit.u.navit;
}
if (!strncmp(oprefix,def_graphics,strlen(def_graphics))) {
@@ -389,42 +389,42 @@ dbus_dump_iter(char *prefix, DBusMessageIter *iter)
switch (arg) {
case DBUS_TYPE_INT32:
dbus_message_iter_get_basic(iter, &vali);
- dbg(lvl_debug,"%sDBUS_TYPE_INT32: %d\n",prefix,vali);
+ dbg(lvl_debug,"%sDBUS_TYPE_INT32: %d",prefix,vali);
break;
case DBUS_TYPE_STRING:
dbus_message_iter_get_basic(iter, &vals);
- dbg(lvl_debug,"%sDBUS_TYPE_STRING: %s\n",prefix,vals);
+ dbg(lvl_debug,"%sDBUS_TYPE_STRING: %s",prefix,vals);
break;
case DBUS_TYPE_STRUCT:
- dbg(lvl_debug,"%sDBUS_TYPE_STRUCT:\n",prefix);
+ dbg(lvl_debug,"%sDBUS_TYPE_STRUCT:",prefix);
prefixr=g_strdup_printf("%s ",prefix);
dbus_message_iter_recurse(iter, &iterr);
dbus_dump_iter(prefixr, &iterr);
g_free(prefixr);
break;
case DBUS_TYPE_VARIANT:
- dbg(lvl_debug,"%sDBUS_TYPE_VARIANT:\n",prefix);
+ dbg(lvl_debug,"%sDBUS_TYPE_VARIANT:",prefix);
prefixr=g_strdup_printf("%s ",prefix);
dbus_message_iter_recurse(iter, &iterr);
dbus_dump_iter(prefixr, &iterr);
g_free(prefixr);
break;
case DBUS_TYPE_DICT_ENTRY:
- dbg(lvl_debug,"%sDBUS_TYPE_DICT_ENTRY:\n",prefix);
+ dbg(lvl_debug,"%sDBUS_TYPE_DICT_ENTRY:",prefix);
prefixr=g_strdup_printf("%s ",prefix);
dbus_message_iter_recurse(iter, &iterr);
dbus_dump_iter(prefixr, &iterr);
g_free(prefixr);
break;
case DBUS_TYPE_ARRAY:
- dbg(lvl_debug,"%sDBUS_TYPE_ARRAY:\n",prefix);
+ dbg(lvl_debug,"%sDBUS_TYPE_ARRAY:",prefix);
prefixr=g_strdup_printf("%s ",prefix);
dbus_message_iter_recurse(iter, &iterr);
dbus_dump_iter(prefixr, &iterr);
g_free(prefixr);
break;
default:
- dbg(lvl_debug,"%c\n",arg);
+ dbg(lvl_debug,"%c",arg);
}
dbus_message_iter_next(iter);
}
@@ -524,7 +524,7 @@ decode_attr_type_from_iter(DBusMessageIter *iter)
dbus_message_iter_get_basic(iter, &attr_type);
dbus_message_iter_next(iter);
ret=attr_from_name(attr_type);
- dbg(lvl_debug, "attr value: 0x%x string: %s\n", ret, attr_type);
+ dbg(lvl_debug, "attr value: 0x%x string: %s", ret, attr_type);
return ret;
}
@@ -541,7 +541,7 @@ decode_attr_from_iter(DBusMessageIter *iter, struct attr *attr)
dbus_message_iter_recurse(iter, &iterattr);
dbus_message_iter_next(iter);
- dbg(lvl_debug, "seems valid. signature: %s\n", dbus_message_iter_get_signature(&iterattr));
+ dbg(lvl_debug, "seems valid. signature: %s", dbus_message_iter_get_signature(&iterattr));
if (attr->type >= attr_type_item_begin && attr->type <= attr_type_item_end)
return 0;
@@ -823,9 +823,9 @@ request_set_add_remove_attr(DBusConnection *connection, DBusMessage *message, ch
destroy_attr(&attr);
if (ret)
return empty_reply(connection, message);
- dbg(lvl_error,"failed to set/add/remove attr\n");
+ dbg(lvl_error,"failed to set/add/remove attr");
} else {
- dbg(lvl_error,"failed to decode attr\n");
+ dbg(lvl_error,"failed to decode attr");
}
return dbus_error_invalid_parameter(connection, message);
}
@@ -1007,7 +1007,7 @@ request_map_dump(DBusConnection *connection, DBusMessage *message)
char *file;
FILE *f;
dbus_message_iter_get_basic(&iter, &file);
- /* dbg(0,"File '%s'\n",file); */
+ /* dbg(0,"File '%s'",file); */
f=fopen(file,"w");
map_dump_filedesc(map,f);
fclose(f);
@@ -1157,7 +1157,7 @@ point_get_from_message(DBusMessage *message, DBusMessageIter *iter, struct point
{
DBusMessageIter iter2;
- dbg(lvl_debug,"%s\n", dbus_message_iter_get_signature(iter));
+ dbg(lvl_debug,"%s", dbus_message_iter_get_signature(iter));
dbus_message_iter_recurse(iter, &iter2);
@@ -1171,7 +1171,7 @@ point_get_from_message(DBusMessage *message, DBusMessageIter *iter, struct point
return 0;
dbus_message_iter_get_basic(&iter2, &p->y);
- dbg(lvl_debug, " x -> %x y -> %x\n", p->x, p->y);
+ dbg(lvl_debug, " x -> %x y -> %x", p->x, p->y);
dbus_message_iter_next(&iter2);
@@ -1300,7 +1300,7 @@ request_navit_set_layout(DBusConnection *connection, DBusMessage *message)
static DBusHandlerResult
request_navit_quit(DBusConnection *connection, DBusMessage *message)
{
- dbg(lvl_debug,"Got a quit request from DBUS\n");
+ dbg(lvl_debug,"Got a quit request from DBUS");
struct attr navit;
navit.type=attr_navit;
struct navit *nav;
@@ -1329,7 +1329,7 @@ request_navit_zoom(DBusConnection *connection, DBusMessage *message)
return dbus_error_invalid_object_path(connection, message);
dbus_message_iter_init(message, &iter);
- dbg(lvl_debug,"%s\n", dbus_message_iter_get_signature(&iter));
+ dbg(lvl_debug,"%s", dbus_message_iter_get_signature(&iter));
dbus_message_iter_get_basic(&iter, &factor);
@@ -1361,7 +1361,7 @@ request_navit_zoom_to_route(DBusConnection *connection, DBusMessage *message)
return dbus_error_invalid_object_path(connection, message);
dbus_message_iter_init(message, &iter);
- dbg(lvl_debug,"%s\n", dbus_message_iter_get_signature(&iter));
+ dbg(lvl_debug,"%s", dbus_message_iter_get_signature(&iter));
navit_zoom_to_route(navit,0);
@@ -1396,7 +1396,7 @@ request_navit_route_export_gpx(DBusConnection *connection, DBusMessage *message)
return dbus_error_navigation_not_configured(connection, message);
}
- dbg(lvl_debug,"Dumping route from dbus to %s\n", filename);
+ dbg(lvl_debug,"Dumping route from dbus to %s", filename);
struct map * map=NULL;
struct map_rect * mr=NULL;
@@ -1465,7 +1465,7 @@ request_navit_route_export_geojson(DBusConnection *connection, DBusMessage *mess
return dbus_error_invalid_parameter(connection, message);
}
- dbg(lvl_debug,"Dumping route from dbus to %s\n", filename);
+ dbg(lvl_debug,"Dumping route from dbus to %s", filename);
struct map * map=NULL;
struct navigation * nav = NULL;
@@ -1557,7 +1557,7 @@ request_navit_resize(DBusConnection *connection, DBusMessage *message)
return dbus_error_invalid_object_path(connection, message);
dbus_message_iter_init(message, &iter);
- dbg(lvl_debug,"%s\n", dbus_message_iter_get_signature(&iter));
+ dbg(lvl_debug,"%s", dbus_message_iter_get_signature(&iter));
if (dbus_message_iter_get_arg_type(&iter) != DBUS_TYPE_INT32)
return dbus_error_invalid_parameter(connection, message);
@@ -1569,7 +1569,7 @@ request_navit_resize(DBusConnection *connection, DBusMessage *message)
return dbus_error_invalid_parameter(connection, message);
dbus_message_iter_get_basic(&iter, &h);
- dbg(lvl_debug, " w -> %i h -> %i\n", w, h);
+ dbg(lvl_debug, " w -> %i h -> %i", w, h);
navit_handle_resize(navit, w, h);
@@ -1668,7 +1668,7 @@ request_navit_set_destination(DBusConnection *connection, DBusMessage *message)
dbus_message_iter_next(&iter);
dbus_message_iter_get_basic(&iter, &description);
- dbg(lvl_debug, " destination -> %s\n", description);
+ dbg(lvl_debug, " destination -> %s", description);
navit_set_destination(navit, &pc, description, 1);
return empty_reply(connection, message);
@@ -2034,7 +2034,7 @@ introspect_path(const char *object)
if (strncmp(object, object_path, strlen(object_path)))
return NULL;
ret=g_strdup(object+strlen(object_path));
- dbg(lvl_debug,"path=%s\n",ret);
+ dbg(lvl_debug,"path=%s",ret);
for (i = strlen(ret)-1 ; i >= 0 ; i--) {
if (ret[i] == '/' || (ret[i] >= '0' && ret[i] <= '9'))
ret[i]='\0';
@@ -2062,7 +2062,7 @@ generate_navitintrospectxml(const char *object)
char *path=introspect_path(object);
if (!path)
return NULL;
- dbg(lvl_debug,"path=%s\n",path);
+ dbg(lvl_debug,"path=%s",path);
// write header and make navit introspectable
navitintrospectxml = g_strdup_printf("%s%s%s\n", navitintrospectxml_head1, object, navitintrospectxml_head2);
@@ -2105,11 +2105,11 @@ navit_handler_func(DBusConnection *connection, DBusMessage *message, void *user_
{
int i;
char *path;
- dbg(lvl_debug,"type=%s interface=%s path=%s member=%s signature=%s\n", dbus_message_type_to_string(dbus_message_get_type(message)), dbus_message_get_interface(message), dbus_message_get_path(message), dbus_message_get_member(message), dbus_message_get_signature(message));
+ dbg(lvl_debug,"type=%s interface=%s path=%s member=%s signature=%s", dbus_message_type_to_string(dbus_message_get_type(message)), dbus_message_get_interface(message), dbus_message_get_path(message), dbus_message_get_member(message), dbus_message_get_signature(message));
if (dbus_message_is_method_call (message, "org.freedesktop.DBus.Introspectable", "Introspect")) {
DBusMessage *reply;
char *navitintrospectxml = generate_navitintrospectxml(dbus_message_get_path(message));
- dbg(lvl_debug,"Introspect %s:Result:%s\n",dbus_message_get_path(message), navitintrospectxml);
+ dbg(lvl_debug,"Introspect %s:Result:%s",dbus_message_get_path(message), navitintrospectxml);
if (navitintrospectxml) {
reply = dbus_message_new_method_return(message);
dbus_message_append_args(reply, DBUS_TYPE_STRING, &navitintrospectxml, DBUS_TYPE_INVALID);
@@ -2143,7 +2143,7 @@ static DBusObjectPathVTable dbus_navit_vtable = {
DBusHandlerResult
filter(DBusConnection *connection, DBusMessage *message, void *user_data)
{
- dbg(lvl_debug,"type=%s interface=%s path=%s member=%s signature=%s\n", dbus_message_type_to_string(dbus_message_get_type(message)), dbus_message_get_interface(message), dbus_message_get_path(message), dbus_message_get_member(message), dbus_message_get_signature(message));
+ dbg(lvl_debug,"type=%s interface=%s path=%s member=%s signature=%s", dbus_message_type_to_string(dbus_message_get_type(message)), dbus_message_get_interface(message), dbus_message_get_path(message), dbus_message_get_member(message), dbus_message_get_signature(message));
if (dbus_message_is_signal(message, DBUS_INTERFACE_DBUS, "NameOwnerChanged")) {
}
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
@@ -2156,7 +2156,7 @@ dbus_cmd_send_signal(struct navit *navit, char *command, struct attr **in, struc
DBusMessage* msg;
char *opath=object_new("navit",navit);
char *interface=g_strdup_printf("%s%s", service_name, ".navit");
- dbg(lvl_debug,"enter %s %s %s\n",opath,command,interface);
+ dbg(lvl_debug,"enter %s %s %s",opath,command,interface);
msg = dbus_message_new_signal(opath, interface, "signal");
if (msg) {
DBusMessageIter iter1,iter2,iter3;
@@ -2211,7 +2211,7 @@ void plugin_init(void)
object_hash=g_hash_table_new(g_str_hash, g_str_equal);
object_hash_rev=g_hash_table_new(NULL, NULL);
object_count=g_hash_table_new(g_str_hash, g_str_equal);
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
dbus_error_init(&error);
#ifdef DBUS_USE_SYSTEM_BUS
connection = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
@@ -2219,7 +2219,7 @@ void plugin_init(void)
connection = dbus_bus_get(DBUS_BUS_SESSION, &error);
#endif
if (!connection) {
- dbg(lvl_error,"Failed to open connection to session message bus: %s\n", error.message);
+ dbg(lvl_error,"Failed to open connection to session message bus: %s", error.message);
dbus_error_free(&error);
return;
}
diff --git a/navit/binding/python/config.c b/navit/binding/python/config.c
index c3f04c4df..9d5b1ae87 100644
--- a/navit/binding/python/config.c
+++ b/navit/binding/python/config.c
@@ -66,7 +66,7 @@ config_py(PyObject *self, PyObject *args)
{
configObject *ret;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
ret=PyObject_NEW(configObject, &config_Type);
return (PyObject *)ret;
}
diff --git a/navit/binding/python/navit.c b/navit/binding/python/navit.c
index 2fde44cbe..2ee7c3126 100644
--- a/navit/binding/python/navit.c
+++ b/navit/binding/python/navit.c
@@ -44,10 +44,10 @@ navit_get_attr_py(navitObject *self, PyObject *args)
if (!PyArg_ParseTuple(args, "s", &name))
return NULL;
if (!navit_get_attr(self->navit, attr_from_name(name), &attr, NULL)) {
- dbg(lvl_error,"get_attr not ok\n");
+ dbg(lvl_error,"get_attr not ok");
Py_RETURN_NONE;
}
- dbg(lvl_debug,"get_attr ok\n");
+ dbg(lvl_debug,"get_attr ok");
return python_object_from_attr(&attr);
}
@@ -131,7 +131,7 @@ navit_py(PyObject *self, PyObject *args)
{
navitObject *ret;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
ret=PyObject_NEW(navitObject, &navit_Type);
return (PyObject *)ret;
}
@@ -139,7 +139,7 @@ navit_py(PyObject *self, PyObject *args)
PyObject *
navit_py_ref(struct navit *navit)
{
- dbg(lvl_debug,"navit=%p\n", navit);
+ dbg(lvl_debug,"navit=%p", navit);
navitObject *ret=PyObject_NEW(navitObject, &navit_Type);
ret->navit=navit;
return (PyObject *)ret;
diff --git a/navit/binding/python/pcoord.c b/navit/binding/python/pcoord.c
index 4fe734a70..1588067bd 100644
--- a/navit/binding/python/pcoord.c
+++ b/navit/binding/python/pcoord.c
@@ -76,7 +76,7 @@ pcoord_py(PyObject *self, PyObject *args)
ret->pc.pro=pro;
ret->pc.x=c.x;
ret->pc.y=c.y;
- dbg(lvl_debug,"0x%x,0x%x\n", c.x, c.y);
+ dbg(lvl_debug,"0x%x,0x%x", c.x, c.y);
return (PyObject *)ret;
}
diff --git a/navit/binding/win32/binding_win32.c b/navit/binding/win32/binding_win32.c
index c6d3295cc..e44aff66b 100644
--- a/navit/binding/win32/binding_win32.c
+++ b/navit/binding/win32/binding_win32.c
@@ -60,10 +60,10 @@ struct win32_binding_private {
static int
win32_cmd_send_signal(struct navit *navit, char *command, struct attr **in, struct attr ***out)
{
- dbg(lvl_error,"this function is a stub\n");
+ dbg(lvl_error,"this function is a stub");
if (in) {
while (*in) {
- dbg(lvl_debug,"another attribute to be sent\n");
+ dbg(lvl_debug,"another attribute to be sent");
in++;
}
}
@@ -84,23 +84,23 @@ win32_wm_copydata(struct win32_binding_private *this, int *hwndSender, COPYDATAS
navit.type=attr_navit;
navit.u.navit=this->navit;
if(cpd->dwData!=NAVIT_BINDING_W32_DWDATA) {
- dbg(lvl_error,"COPYDATA message came with wrong DWDATA value, expected %d, got %d.\n",NAVIT_BINDING_W32_DWDATA,cpd->dwData);
+ dbg(lvl_error,"COPYDATA message came with wrong DWDATA value, expected %d, got %d.",NAVIT_BINDING_W32_DWDATA,cpd->dwData);
return;
}
if(cpd->cbData<sizeof(*msg)) {
- dbg(lvl_error,"COPYDATA message too short, expected >=%d, got %d.\n",sizeof(*msg),cpd->cbData);
+ dbg(lvl_error,"COPYDATA message too short, expected >=%d, got %d.",sizeof(*msg),cpd->cbData);
return;
}
msg=cpd->lpData;
if(cpd->dwData!=NAVIT_BINDING_W32_VERSION) {
- dbg(lvl_error,"Got request with wrong version number, expected %d, got %d.\n",NAVIT_BINDING_W32_VERSION,msg->version);
+ dbg(lvl_error,"Got request with wrong version number, expected %d, got %d.",NAVIT_BINDING_W32_VERSION,msg->version);
return;
}
if(strcmp(NAVIT_BINDING_W32_MAGIC,msg->magic)) {
- dbg(lvl_error,"Got request with wrong MAGIC, expected %s, got %*s.\n",NAVIT_BINDING_W32_MAGIC, msg->magic,sizeof(msg->magic));
+ dbg(lvl_error,"Got request with wrong MAGIC, expected %s, got %*s.",NAVIT_BINDING_W32_MAGIC, msg->magic,sizeof(msg->magic));
return;
}
- dbg(lvl_debug,"Running command %s\n", msg->text);
+ dbg(lvl_debug,"Running command %s", msg->text);
command_evaluate(&navit, msg->text);
}
@@ -120,9 +120,9 @@ static void
win32_main_navit(struct win32_binding_private *this, struct navit *navit, int added)
{
struct attr attr;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (added==1) {
- dbg(lvl_debug,"enter2\n");
+ dbg(lvl_debug,"enter2");
this->navit=navit;
command_add_table_attr(commands, sizeof(commands)/sizeof(struct command_table), navit, &attr);
navit_add_attr(navit, &attr);
@@ -137,7 +137,7 @@ void plugin_init(void)
{
struct attr callback;
struct win32_binding_private *this=g_new0(struct win32_binding_private,1);
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
callback.type=attr_callback;
callback.u.callback=callback_new_attr_1(callback_cast(win32_main_navit),attr_navit,this);
config_add_attr(config, &callback);
diff --git a/navit/bookmarks.c b/navit/bookmarks.c
index aa180e947..7f1ce8661 100644
--- a/navit/bookmarks.c
+++ b/navit/bookmarks.c
@@ -83,7 +83,7 @@ struct bookmark_item_priv {
void bookmarks_move_root(struct bookmarks *this_) {
this_->current=this_->root;
this_->current->iter=g_list_first(this_->current->children);
- dbg(lvl_info,"Root list have %u entries\n",g_list_length(this_->current->children));
+ dbg(lvl_info,"Root list have %u entries",g_list_length(this_->current->children));
return;
}
void bookmarks_move_up(struct bookmarks *this_) {
@@ -103,7 +103,7 @@ int bookmarks_move_down(struct bookmarks *this_,const char* name) {
if (!strcmp(data->label,name)) {
this_->current=(struct bookmark_item_priv*)this_->current->iter->data;
this_->current->iter=g_list_first(this_->current->children);
- dbg(lvl_info,"%s list have %u entries\n",this_->current->label,g_list_length(this_->current->children));
+ dbg(lvl_info,"%s list have %u entries",this_->current->label,g_list_length(this_->current->children));
return 1;
}
this_->current->iter=g_list_next(this_->current->iter);
@@ -207,7 +207,7 @@ bookmarks_load_hash(struct bookmarks *this_) {
finder=b_item->label;
while ((pos=strchr(finder,'/'))) {
*pos=0x00;
- dbg(lvl_debug,"Found path entry: %s\n",finder);
+ dbg(lvl_debug,"Found path entry: %s",finder);
if (!bookmarks_move_down(this_,finder)) {
struct bookmark_item_priv *path_item=g_new0(struct bookmark_item_priv,1);
path_item->type=type_bookmark_folder;
@@ -231,7 +231,7 @@ bookmarks_load_hash(struct bookmarks *this_) {
this_->bookmarks_list=g_list_append(this_->bookmarks_list,b_item);
this_->current->children=g_list_append(this_->current->children,b_item);
this_->current->children=g_list_first(this_->current->children);
- dbg(lvl_debug,"Added %s to %s and current list now %u long\n",b_item->label,this_->current->label,g_list_length(this_->current->children));
+ dbg(lvl_debug,"Added %s to %s and current list now %u long",b_item->label,this_->current->label,g_list_length(this_->current->children));
}
bookmarks_move_root(this_);
}
@@ -327,7 +327,7 @@ bookmarks_store_bookmarks_to_file(struct bookmarks *this_, int limit,int replac
g_free(fullname);
fullname=g_strdup(pathHelper);
g_free(pathHelper);
- dbg(lvl_debug,"full name: %s\n",fullname);
+ dbg(lvl_debug,"full name: %s",fullname);
}
}
@@ -760,7 +760,7 @@ write_former_destinations(GList* former_destinations, char *former_destination_f
}
fclose(f);
} else {
- dbg(lvl_error, "Error updating destinations file %s: %s\n", former_destination_file, strerror(errno));
+ dbg(lvl_error, "Error updating destinations file %s: %s", former_destination_file, strerror(errno));
}
}
/**
diff --git a/navit/cache.c b/navit/cache.c
index 180b165c0..6c618c9fc 100644
--- a/navit/cache.c
+++ b/navit/cache.c
@@ -33,13 +33,13 @@ static void
cache_entry_dump(struct cache *cache, struct cache_entry *entry)
{
int i,size;
- dbg(lvl_debug,"Usage: %d size %d\n",entry->usage, entry->size);
+ dbg(lvl_debug,"Usage: %d size %d",entry->usage, entry->size);
if (cache)
size=cache->id_size;
else
size=5;
for (i = 0 ; i < size ; i++) {
- dbg(lvl_debug,"0x%x\n", entry->id[i]);
+ dbg(lvl_debug,"0x%x", entry->id[i]);
}
}
@@ -47,7 +47,7 @@ static void
cache_list_dump(char *str, struct cache *cache, struct cache_entry_list *list)
{
struct cache_entry *first=list->first;
- dbg(lvl_debug,"dump %s %d\n",str, list->size);
+ dbg(lvl_debug,"dump %s %d",str, list->size);
while (first) {
cache_entry_dump(cache, first);
first=first->next;
@@ -106,7 +106,7 @@ cache_new(int id_size, int size)
cache->hash=g_hash_table_new(cache_hash20, cache_equal20);
break;
default:
- dbg(lvl_error,"cache with id_size of %d not supported\n", id_size);
+ dbg(lvl_error,"cache with id_size of %d not supported", id_size);
g_free(cache);
cache=NULL;
}
@@ -152,7 +152,7 @@ cache_remove_from_list(struct cache_entry_list *list, struct cache_entry *entry)
static void
cache_remove(struct cache *cache, struct cache_entry *entry)
{
- dbg(lvl_debug,"remove 0x%x 0x%x 0x%x 0x%x 0x%x\n", entry->id[0], entry->id[1], entry->id[2], entry->id[3], entry->id[4]);
+ dbg(lvl_debug,"remove 0x%x 0x%x 0x%x 0x%x 0x%x", entry->id[0], entry->id[1], entry->id[2], entry->id[3], entry->id[4]);
g_hash_table_remove(cache->hash, (gpointer)(entry->id));
g_slice_free1(entry->size, entry);
}
@@ -185,7 +185,7 @@ cache_remove_lru(struct cache *cache, struct cache_entry_list *list)
last=list->last;
if (! last || last->usage || seen >= list->size)
return NULL;
- dbg(lvl_debug,"removing %d\n", last->id[0]);
+ dbg(lvl_debug,"removing %d", last->id[0]);
cache_remove_lru_helper(list);
if (cache) {
cache_remove(cache, last);
@@ -211,7 +211,7 @@ void
cache_entry_destroy(struct cache *cache, void *data)
{
struct cache_entry *entry=(struct cache_entry *)((char *)data-cache->entry_size);
- dbg(lvl_debug,"destroy 0x%x 0x%x 0x%x 0x%x 0x%x\n", entry->id[0], entry->id[1], entry->id[2], entry->id[3], entry->id[4]);
+ dbg(lvl_debug,"destroy 0x%x 0x%x 0x%x 0x%x 0x%x", entry->id[0], entry->id[1], entry->id[2], entry->id[3], entry->id[4]);
entry->usage--;
}
@@ -219,8 +219,8 @@ static struct cache_entry *
cache_trim(struct cache *cache, struct cache_entry *entry)
{
struct cache_entry *new_entry;
- dbg(lvl_debug,"trim 0x%x 0x%x 0x%x 0x%x 0x%x\n", entry->id[0], entry->id[1], entry->id[2], entry->id[3], entry->id[4]);
- dbg(lvl_debug,"Trim %x from %d -> %d\n", entry->id[0], entry->size, cache->size);
+ dbg(lvl_debug,"trim 0x%x 0x%x 0x%x 0x%x 0x%x", entry->id[0], entry->id[1], entry->id[2], entry->id[3], entry->id[4]);
+ dbg(lvl_debug,"Trim %x from %d -> %d", entry->id[0], entry->size, cache->size);
if ( cache->entry_size < entry->size )
{
g_hash_table_remove(cache->hash, (gpointer)(entry->id));
@@ -256,11 +256,11 @@ static int
cache_replace(struct cache *cache)
{
if (cache->t1.size >= MAX(1,cache->t1_target)) {
- dbg(lvl_debug,"replace 12\n");
+ dbg(lvl_debug,"replace 12");
if (!cache_move(cache, &cache->t1, &cache->b1))
cache_move(cache, &cache->t2, &cache->b2);
} else {
- dbg(lvl_debug,"replace t2\n");
+ dbg(lvl_debug,"replace t2");
if (!cache_move(cache, &cache->t2, &cache->b2))
cache_move(cache, &cache->t1, &cache->b1);
}
@@ -298,17 +298,17 @@ void *
cache_lookup(struct cache *cache, void *id) {
struct cache_entry *entry;
- dbg(lvl_debug,"get %d\n", ((int *)id)[0]);
+ dbg(lvl_debug,"get %d", ((int *)id)[0]);
entry=g_hash_table_lookup(cache->hash, id);
if (entry == NULL) {
cache->insert=&cache->t1;
#ifdef DEBUG_CACHE
fprintf(stderr,"-");
#endif
- dbg(lvl_debug,"not in cache\n");
+ dbg(lvl_debug,"not in cache");
return NULL;
}
- dbg(lvl_debug,"found 0x%x 0x%x 0x%x 0x%x 0x%x\n", entry->id[0], entry->id[1], entry->id[2], entry->id[3], entry->id[4]);
+ dbg(lvl_debug,"found 0x%x 0x%x 0x%x 0x%x 0x%x", entry->id[0], entry->id[1], entry->id[2], entry->id[3], entry->id[4]);
if (entry->where == &cache->t1 || entry->where == &cache->t2) {
cache->hits+=entry->size;
#ifdef DEBUG_CACHE
@@ -317,7 +317,7 @@ cache_lookup(struct cache *cache, void *id) {
else
fprintf(stderr,"H");
#endif
- dbg(lvl_debug,"in cache %s\n", entry->where == &cache->t1 ? "T1" : "T2");
+ dbg(lvl_debug,"in cache %s", entry->where == &cache->t1 ? "T1" : "T2");
cache_remove_from_list(entry->where, entry);
cache_insert_mru(NULL, &cache->t2, entry);
entry->usage++;
@@ -327,18 +327,18 @@ cache_lookup(struct cache *cache, void *id) {
#ifdef DEBUG_CACHE
fprintf(stderr,"m");
#endif
- dbg(lvl_debug,"in phantom cache B1\n");
+ dbg(lvl_debug,"in phantom cache B1");
cache->t1_target=MIN(cache->t1_target+MAX(cache->b2.size/cache->b1.size, 1),cache->size);
cache_remove_from_list(&cache->b1, entry);
} else if (entry->where == &cache->b2) {
#ifdef DEBUG_CACHE
fprintf(stderr,"M");
#endif
- dbg(lvl_debug,"in phantom cache B2\n");
+ dbg(lvl_debug,"in phantom cache B2");
cache->t1_target=MAX(cache->t1_target-MAX(cache->b1.size/cache->b2.size, 1),0);
cache_remove_from_list(&cache->b2, entry);
} else {
- dbg(lvl_error,"**ERROR** invalid where\n");
+ dbg(lvl_error,"**ERROR** invalid where");
}
cache_replace(cache);
cache_remove(cache, entry);
@@ -351,7 +351,7 @@ void
cache_insert(struct cache *cache, void *data)
{
struct cache_entry *entry=(struct cache_entry *)((char *)data-cache->entry_size);
- dbg(lvl_debug,"insert 0x%x 0x%x 0x%x 0x%x 0x%x\n", entry->id[0], entry->id[1], entry->id[2], entry->id[3], entry->id[4]);
+ dbg(lvl_debug,"insert 0x%x 0x%x 0x%x 0x%x 0x%x", entry->id[0], entry->id[1], entry->id[2], entry->id[3], entry->id[4]);
if (cache->insert == &cache->t1) {
if (cache->t1.size + cache->b1.size >= cache->size) {
if (cache->t1.size < cache->size) {
@@ -382,8 +382,8 @@ cache_insert_new(struct cache *cache, void *id, int size)
static void
cache_stats(struct cache *cache)
{
- dbg(lvl_debug,"hits %d misses %d hitratio %d size %d entry_size %d id_size %d T1 target %d\n", cache->hits, cache->misses, cache->hits*100/(cache->hits+cache->misses), cache->size, cache->entry_size, cache->id_size, cache->t1_target);
- dbg(lvl_debug,"T1:%d B1:%d T2:%d B2:%d\n", cache->t1.size, cache->b1.size, cache->t2.size, cache->b2.size);
+ dbg(lvl_debug,"hits %d misses %d hitratio %d size %d entry_size %d id_size %d T1 target %d", cache->hits, cache->misses, cache->hits*100/(cache->hits+cache->misses), cache->size, cache->entry_size, cache->id_size, cache->t1_target);
+ dbg(lvl_debug,"T1:%d B1:%d T2:%d B2:%d", cache->t1.size, cache->b1.size, cache->t2.size, cache->b2.size);
cache->hits=0;
cache->misses=0;
}
@@ -396,6 +396,6 @@ cache_dump(struct cache *cache)
cache_list_dump("B1", cache, &cache->b1);
cache_list_dump("T2", cache, &cache->t2);
cache_list_dump("B2", cache, &cache->b2);
- dbg(lvl_debug,"dump end\n");
+ dbg(lvl_debug,"dump end");
}
diff --git a/navit/callback.c b/navit/callback.c
index 293fab0af..e66f13b99 100644
--- a/navit/callback.c
+++ b/navit/callback.c
@@ -145,13 +145,13 @@ callback_call(struct callback *cb, int pcount, void **p)
if (! cb)
return;
if (cb->pcount + pcount <= 8) {
- dbg(lvl_debug,"cb->pcount=%d\n", cb->pcount);
+ dbg(lvl_debug,"cb->pcount=%d", cb->pcount);
if (cb->pcount && cb->p)
- dbg(lvl_debug,"cb->p[0]=%p\n", cb->p[0]);
- dbg(lvl_debug,"pcount=%d\n", pcount);
+ dbg(lvl_debug,"cb->p[0]=%p", cb->p[0]);
+ dbg(lvl_debug,"pcount=%d", pcount);
if (pcount) {
dbg_assert(p!=NULL);
- dbg(lvl_debug,"p[0]=%p\n", p[0]);
+ dbg(lvl_debug,"p[0]=%p", p[0]);
}
for (i = 0 ; i < cb->pcount ; i++)
pf[i]=cb->p[i];
@@ -195,7 +195,7 @@ callback_call(struct callback *cb, int pcount, void **p)
break;
}
} else {
- dbg(lvl_error,"too many parameters for callback (%d+%d)\n", cb->pcount, pcount);
+ dbg(lvl_error,"too many parameters for callback (%d+%d)", cb->pcount, pcount);
}
}
diff --git a/navit/command.c b/navit/command.c
index 3a7d8b154..a982606fa 100644
--- a/navit/command.c
+++ b/navit/command.c
@@ -217,8 +217,8 @@ dump(struct result *res)
if (res->attrn)
strncpy(attribute, res->attrn, res->attrnlen);
attribute[res->attrnlen]='\0';
- dbg(lvl_debug,"type:%s\n", attr_to_name(res->attr.type));
- dbg(lvl_debug,"attribute '%s' from '%s'\n", attribute, object);
+ dbg(lvl_debug,"type:%s", attr_to_name(res->attr.type));
+ dbg(lvl_debug,"attribute '%s' from '%s'", attribute, object);
#endif
}
@@ -254,14 +254,14 @@ command_object_get_attr(struct context *ctx, struct attr *object, enum attr_type
struct attr dup;
struct object_func *func=object_func_lookup(object->type);
if (!object->u.data || !func || !func->get_attr) {
- dbg(lvl_warning, "cannot retrieve attributes from %s (%p), func=%p\n", attr_to_name(object->type), object->u.data, func)
+ dbg(lvl_warning, "cannot retrieve attributes from %s (%p), func=%p", attr_to_name(object->type), object->u.data, func)
return 0;
}
r=func->get_attr(object->u.data, attr_type, &dup, NULL);
if(r)
attr_dup_content(&dup,ret);
else
- dbg(lvl_warning, "%s (%p) has no attribute %s\n", attr_to_name(object->type), object->u.data, attr_to_name(attr_type))
+ dbg(lvl_warning, "%s (%p) has no attribute %s", attr_to_name(object->type), object->u.data, attr_to_name(attr_type))
return r;
}
@@ -319,11 +319,11 @@ command_get_attr(struct context *ctx, struct result *res)
*res=tmp;
res->allocated=1;
if (result) {
- dbg(lvl_debug, "successfully retrieved '%s' from '%s'\n", attr_to_name(attr_type), attr_to_name(parent_type));
+ dbg(lvl_debug, "successfully retrieved '%s' from '%s'", attr_to_name(attr_type), attr_to_name(parent_type));
res->var=res->attrn;
res->varlen=res->attrnlen;
} else {
- dbg(lvl_warning, "could not retrieve '%s' from '%s'\n", attr_to_name(attr_type), attr_to_name(parent_type));
+ dbg(lvl_warning, "could not retrieve '%s' from '%s'", attr_to_name(attr_type), attr_to_name(parent_type));
result_free(res);
res->attr.type=attr_none;
res->var=NULL;
@@ -455,7 +455,7 @@ get_int_bool(struct context *ctx, int is_bool, struct result *res)
return res->attr.u.data != NULL;
if (is_bool && ATTR_IS_STRING(res->attr.type))
return res->attr.u.data != NULL;
- dbg(lvl_debug,"bool %d %s\n",is_bool,attr_to_name(res->attr.type));
+ dbg(lvl_debug,"bool %d %s",is_bool,attr_to_name(res->attr.type));
ctx->error=wrong_type;
return 0;
}
@@ -621,7 +621,7 @@ result_op(struct context *ctx, enum op_type op_type, const char *op, struct resu
default:
break;
}
- dbg(lvl_error,"Unknown op %d %s\n",op_type,op);
+ dbg(lvl_error,"Unknown op %d %s",op_type,op);
ctx->error=internal;
}
@@ -658,7 +658,7 @@ result_set(struct context *ctx, enum set_type set_type, const char *op, int len,
default:
break;
}
- dbg(lvl_error,"unknown set type %d %s\n",set_type,op);
+ dbg(lvl_error,"unknown set type %d %s",set_type,op);
ctx->error=internal;
}
@@ -780,7 +780,7 @@ eval_value(struct context *ctx, struct result *res) {
* If we get here, ctx->expr does not begin with a variable or a literal value. This is not an
* error if this function is being called to test if an expression begins with a value.
*/
- dbg(lvl_debug, "character 0x%x is illegal in a value\n",*op);
+ dbg(lvl_debug, "character 0x%x is illegal in a value",*op);
ctx->error=illegal_character;
}
}
@@ -854,7 +854,7 @@ command_call_function(struct context *ctx, struct result *res)
if (res->attrn)
strncpy(function, res->attrn, res->attrnlen);
function[res->attrnlen]='\0';
- dbg(lvl_debug,"function=%s\n", function);
+ dbg(lvl_debug,"function=%s", function);
if (ctx->expr[0] != ')') {
list=eval_list(ctx);
if (ctx->error) {
@@ -883,7 +883,7 @@ command_call_function(struct context *ctx, struct result *res)
res->attr.u.num=list[0]->u.num;
res->allocated=0;
} else {
- dbg(lvl_error,"don't know how to create int of args\n");
+ dbg(lvl_error,"don't know how to create int of args");
}
} else if (ATTR_IS_STRING(attr_type)) {
if (list && list[0] && ATTR_IS_STRING(list[0]->type)) {
@@ -891,7 +891,7 @@ command_call_function(struct context *ctx, struct result *res)
res->attr.u.str=g_strdup(list[0]->u.str);
res->allocated=1;
} else {
- dbg(lvl_error,"don't know how to create string of args\n");
+ dbg(lvl_error,"don't know how to create string of args");
}
} else if (ATTR_IS_OBJECT(attr_type)) {
struct object_func *func=object_func_lookup(attr_type);
@@ -903,7 +903,7 @@ command_call_function(struct context *ctx, struct result *res)
res->allocated=1;
}
} else {
- dbg(lvl_error,"don't know how to create %s (%s)\n",attr_to_name(attr_type),function+4);
+ dbg(lvl_error,"don't know how to create %s (%s)",attr_to_name(attr_type),function+4);
}
} else if (!strcmp(function,"add_attr")) {
command_object_add_attr(ctx, &res->attr, list[0]);
@@ -913,11 +913,11 @@ command_call_function(struct context *ctx, struct result *res)
if (command_object_get_attr(ctx, &res->attr, attr_callback_list, &cbl)) {
int valid =0;
struct attr **out=NULL;
- dbg(lvl_debug,"function call %s from %s\n",function, attr_to_name(res->attr.type));
+ dbg(lvl_debug,"function call %s from %s",function, attr_to_name(res->attr.type));
callback_list_call_attr_4(cbl.u.callback_list, attr_command, function, list, &out, &valid);
if (valid!=1){
dbg(lvl_error, "invalid command ignored: \"%s\"; see http://wiki.navit-project.org/index.php/"
- "OSD#Navit_commands for valid commands.\n", function);
+ "OSD#Navit_commands for valid commands.", function);
}
if (out && out[0]) {
result_free(res);
@@ -967,15 +967,15 @@ eval_postfix(struct context *ctx, struct result *res)
enum attr_type attr_type=command_attr_type(res);
void *obj=res->attr.u.data;
if (!obj) {
- dbg(lvl_error,"no object\n");
+ dbg(lvl_error,"no object");
return;
}
if (!obj_func) {
- dbg(lvl_error,"no object func\n");
+ dbg(lvl_error,"no object func");
return;
}
if (!obj_func->iter_new || !obj_func->iter_destroy) {
- dbg(lvl_error,"no iter func\n");
+ dbg(lvl_error,"no iter func");
return;
}
iter = obj_func->iter_new(NULL);
@@ -998,7 +998,7 @@ eval_postfix(struct context *ctx, struct result *res)
return;
}
} else if (op[0] == '(') {
- dbg(lvl_debug,"function call\n");
+ dbg(lvl_debug,"function call");
resolve_object(ctx, res);
command_call_function(ctx, res);
}
@@ -1186,7 +1186,7 @@ eval_conditional(struct context *ctx, struct result *res)
memset(&tmp,0,sizeof(tmp));
if (!get_op(ctx,0,":",NULL)) {
- dbg(lvl_debug,"ctxerr\n");
+ dbg(lvl_debug,"ctxerr");
ctx->error=missing_colon;
return;
}
@@ -1307,7 +1307,7 @@ command_evaluate_to_attr(struct attr *attr, char *expr, int *error, struct attr
return attr_none;
resolve_object(&ctx, &res);
*ret=res.attr;
- dbg(lvl_debug,"type %s\n",attr_to_name(command_attr_type(&res)));
+ dbg(lvl_debug,"type %s",attr_to_name(command_attr_type(&res)));
return command_attr_type(&res);
}
@@ -1477,15 +1477,15 @@ command_evaluate_single(struct context *ctx)
}
end=ctx->expr;
if (!obj) {
- dbg(lvl_error,"no object\n");
+ dbg(lvl_error,"no object");
return 0;
}
if (!obj_func) {
- dbg(lvl_error,"no object func\n");
+ dbg(lvl_error,"no object func");
return 0;
}
if (!obj_func->iter_new || !obj_func->iter_destroy) {
- dbg(lvl_error,"no iter func\n");
+ dbg(lvl_error,"no iter func");
return 0;
}
iter = obj_func->iter_new(NULL);
@@ -1571,7 +1571,7 @@ command_evaluate(struct attr *attr, const char *expr)
strncpy(expr, ctx.expr, 32);
expr[31]='\0';
err = command_error_to_text(ctx.error);
- dbg(lvl_error, "error %s starting at %s\n", err, expr);
+ dbg(lvl_error, "error %s starting at %s", err, expr);
g_free(err);
}
g_free(expr_dup);
@@ -1660,7 +1660,7 @@ command_saved_error (struct command_saved *cs)
static void
command_saved_evaluate_idle (struct command_saved *cs)
{
- dbg(lvl_debug, "enter: cs=%p, cs->command=%s\n", cs, cs->command);
+ dbg(lvl_debug, "enter: cs=%p, cs->command=%s", cs, cs->command);
// Only run once at a time
if (cs->idle_ev) {
event_remove_idle(cs->idle_ev);
@@ -1694,7 +1694,7 @@ command_saved_evaluate_idle (struct command_saved *cs)
static void
command_saved_evaluate(struct command_saved *cs)
{
- dbg(lvl_debug, "enter: cs=%p, cs->async=%d, cs->command=%s\n", cs, cs->async, cs->command);
+ dbg(lvl_debug, "enter: cs=%p, cs->async=%d, cs->command=%s", cs, cs->async, cs->command);
if (!cs->async) {
command_saved_evaluate_idle(cs);
return;
@@ -1724,7 +1724,7 @@ command_saved_callbacks_changed(struct command_saved *cs)
struct object_func *func;
struct attr attr;
- dbg(lvl_debug, "enter: cs=%p, cs->async=%d, cs->command=%s\n", cs, cs->async, cs->command);
+ dbg(lvl_debug, "enter: cs=%p, cs->async=%d, cs->command=%s", cs, cs->async, cs->command);
if (cs->register_ev) {
event_remove_idle(cs->register_ev);
@@ -1737,7 +1737,7 @@ command_saved_callbacks_changed(struct command_saved *cs)
func = object_func_lookup(cs->cbs[i].attr.type);
if (!func->remove_attr) {
- dbg(lvl_error, "Could not remove command-evaluation callback because remove_attr is missing for type %i!\n", cs->cbs[i].attr.type);
+ dbg(lvl_error, "Could not remove command-evaluation callback because remove_attr is missing for type %i!", cs->cbs[i].attr.type);
continue;
}
@@ -1784,7 +1784,7 @@ command_register_callbacks(struct command_saved *cs)
* we can figure out offsets by using simple pointer arithmetics.
*/
- dbg(lvl_debug, "enter: cs=%p, cs->async=%d, cs->command=%s\n", cs, cs->async, cs->command);
+ dbg(lvl_debug, "enter: cs=%p, cs->async=%d, cs->command=%s", cs, cs->async, cs->command);
cs->ctx.expr = cs->command;
prev = cs->context_attr;
@@ -1796,11 +1796,15 @@ command_register_callbacks(struct command_saved *cs)
if (cs->ctx.error) {
/* An error occurred while parsing the command */
tmpoffset = cs->ctx.expr - cs->command;
- dbg(lvl_error, "parsing error: cs=%p, cs->ctx.error=%d\n\t%s\n\t%*s\n", cs, cs->ctx.error, cs->command, tmpoffset + 1, "^");
+ dbg(lvl_error, "parsing error: cs=%p, cs->ctx.error=%d", cs, cs->ctx.error);
+ dbg(lvl_error, "\t%s", cs->command);
+ dbg(lvl_error, "\t%*s", tmpoffset + 1, "^");
return 0;
} else if (cs->res.attr.type == attr_none) {
/* We could not resolve an object, perhaps because it has not been created */
- dbg(lvl_error, "could not resolve object in cs=%p:\n\t%s\n\t%*s\n", cs, cs->command, tmpoffset + 1, "^");
+ dbg(lvl_error, "could not resolve object in cs=%p:", cs);
+ dbg(lvl_error, "\t%s", cs->command);
+ dbg(lvl_error, "\t%*s", tmpoffset + 1, "^");
return 0;
}
@@ -1814,7 +1818,7 @@ command_register_callbacks(struct command_saved *cs)
cb = callback_new_attr_1(callback_cast(command_saved_evaluate), cs->res.attr.type, (void*)cs);
cs->ctx.attr = &cs->context_attr;
} else {
- dbg(lvl_error, "Error: Strange status returned from get_next_object()\n");
+ dbg(lvl_error, "Error: Strange status returned from get_next_object()");
}
cs->num_cbs++;
@@ -1828,7 +1832,7 @@ command_register_callbacks(struct command_saved *cs)
func->add_attr(prev.u.data, &cb_attr);
} else {
- dbg(lvl_error, "Could not add callback because add_attr is missing for type %i\n", prev.type);
+ dbg(lvl_error, "Could not add callback because add_attr is missing for type %i", prev.type);
}
}
@@ -1841,7 +1845,7 @@ command_register_callbacks(struct command_saved *cs)
command_saved_evaluate_idle(cs);
- dbg(lvl_debug, "done: cs=%p, cs->command=%s\n", cs, cs->command);
+ dbg(lvl_debug, "done: cs=%p, cs->command=%s", cs, cs->command);
return 1;
}
@@ -1860,7 +1864,7 @@ command_saved_attr_new(char *command, struct attr *attr, struct callback *cb, in
struct command_saved *ret;
ret = g_new0(struct command_saved, 1);
- dbg(lvl_debug, "enter, ret=%p, command=%s\n", ret, command);
+ dbg(lvl_debug, "enter, ret=%p, command=%s", ret, command);
ret->command = g_strdup(command);
ret->context_attr = *attr;
ret->cb = cb;
@@ -1869,7 +1873,7 @@ command_saved_attr_new(char *command, struct attr *attr, struct callback *cb, in
if (!command_register_callbacks(ret)) {
// We try this as an idle call again
- dbg(lvl_debug, "could not register callbacks, will retry as an idle call\n");
+ dbg(lvl_debug, "could not register callbacks, will retry as an idle call");
ret->register_cb = callback_new_1(callback_cast(command_saved_callbacks_changed), ret);
ret->register_ev = event_add_idle(300, ret->register_cb);
}
diff --git a/navit/config_.c b/navit/config_.c
index 9f4bd5860..f658d8a20 100644
--- a/navit/config_.c
+++ b/navit/config_.c
@@ -60,7 +60,7 @@ config_destroy(struct config *this_)
static void
config_terminate(int sig)
{
- dbg(lvl_debug,"terminating\n");
+ dbg(lvl_debug,"terminating");
config_destroy(config);
}
@@ -142,11 +142,11 @@ struct config *
config_new(struct attr *parent, struct attr **attrs)
{
if (configured) {
- dbg(lvl_error,"only one config allowed\n");
+ dbg(lvl_error,"only one config allowed");
return config;
}
if (parent) {
- dbg(lvl_error,"no parent in config allowed\n");
+ dbg(lvl_error,"no parent in config allowed");
return NULL;
}
if (!config)
@@ -156,7 +156,7 @@ config_new(struct attr *parent, struct attr **attrs)
config->attrs=attr_generic_add_attr_list(config->attrs, attrs);
while (*attrs) {
if (!config_set_attr_int(config,*attrs)) {
- dbg(lvl_error,"failed to set attribute '%s'\n",attr_to_name((*attrs)->type));
+ dbg(lvl_error,"failed to set attribute '%s'",attr_to_name((*attrs)->type));
config_destroy(config);
config=NULL;
break;
diff --git a/navit/coord.c b/navit/coord.c
index 2bc169d46..4874a49ed 100644
--- a/navit/coord.c
+++ b/navit/coord.c
@@ -104,7 +104,7 @@ coord_rect_overlap(struct coord_rect *r1, struct coord_rect *r2)
dbg_assert(r1->lu.y >= r1->rl.y);
dbg_assert(r2->lu.x <= r2->rl.x);
dbg_assert(r2->lu.y >= r2->rl.y);
- dbg(lvl_debug,"0x%x,0x%x - 0x%x,0x%x vs 0x%x,0x%x - 0x%x,0x%x\n", r1->lu.x, r1->lu.y, r1->rl.x, r1->rl.y, r2->lu.x, r2->lu.y, r2->rl.x, r2->rl.y);
+ dbg(lvl_debug,"0x%x,0x%x - 0x%x,0x%x vs 0x%x,0x%x - 0x%x,0x%x", r1->lu.x, r1->lu.y, r1->rl.x, r1->rl.y, r2->lu.x, r2->lu.y, r2->rl.x, r2->rl.y);
if (r1->lu.x > r2->rl.x)
return 0;
if (r1->rl.x < r2->lu.x)
@@ -171,14 +171,14 @@ coord_parse(const char *coord_input, enum projection output_projection, struct c
struct coord c,offset;
enum projection str_pro=projection_none;
- dbg(lvl_debug,"enter('%s',%d,%p)\n", coord_input, output_projection, result);
+ dbg(lvl_debug,"enter('%s',%d,%p)", coord_input, output_projection, result);
s=strchr(str,' ');
co=strchr(str,':');
if (co && co < s) {
proj=malloc(co-str+1);
strncpy(proj, str, co-str);
proj[co-str]='\0';
- dbg(lvl_debug,"projection=%s\n", proj);
+ dbg(lvl_debug,"projection=%s", proj);
str=co+1;
s=strchr(str,' ');
if (!strcmp(proj, "geo"))
@@ -186,7 +186,7 @@ coord_parse(const char *coord_input, enum projection output_projection, struct c
else {
str_pro = projection_from_name(proj,&offset);
if (str_pro == projection_none) {
- dbg(lvl_error, "Unknown projection: %s\n", proj);
+ dbg(lvl_error, "Unknown projection: %s", proj);
goto out;
}
}
@@ -202,8 +202,8 @@ coord_parse(const char *coord_input, enum projection output_projection, struct c
args=sscanf(str, "%i %i%n",&c.x, &c.y, &ret);
if (args < 2)
goto out;
- dbg(lvl_debug,"str='%s' x=0x%x y=0x%x c=%d\n", str, c.x, c.y, ret);
- dbg(lvl_debug,"rest='%s'\n", str+ret);
+ dbg(lvl_debug,"str='%s' x=0x%x y=0x%x c=%d", str, c.x, c.y, ret);
+ dbg(lvl_debug,"rest='%s'", str+ret);
if (str_pro == projection_none)
str_pro=projection_mg;
@@ -215,13 +215,13 @@ coord_parse(const char *coord_input, enum projection output_projection, struct c
} else if (*s == 'N' || *s == 'n' || *s == 'S' || *s == 's') {
double lng, lat;
char ns, ew;
- dbg(lvl_debug,"str='%s'\n", str);
+ dbg(lvl_debug,"str='%s'", str);
args=sscanf(str, "%lf %c %lf %c%n", &lat, &ns, &lng, &ew, &ret);
- dbg(lvl_debug,"args=%d\n", args);
- dbg(lvl_debug,"lat=%f %c lon=%f %c\n", lat, ns, lng, ew);
+ dbg(lvl_debug,"args=%d", args);
+ dbg(lvl_debug,"lat=%f %c lon=%f %c", lat, ns, lng, ew);
if (args < 4)
goto out;
- dbg(lvl_debug,"projection=%d str_pro=%d projection_none=%d\n", output_projection, str_pro, projection_none);
+ dbg(lvl_debug,"projection=%d str_pro=%d projection_none=%d", output_projection, str_pro, projection_none);
if (str_pro == projection_none) {
g.lat=floor(lat/100);
lat-=g.lat*100;
@@ -235,10 +235,10 @@ coord_parse(const char *coord_input, enum projection output_projection, struct c
g.lng=-g.lng;
dbg(lvl_debug,"transform_from_geo(%f,%f)",g.lat,g.lng);
transform_from_geo(output_projection, &g, result);
- dbg(lvl_debug,"result 0x%x,0x%x\n", result->x,result->y);
+ dbg(lvl_debug,"result 0x%x,0x%x", result->x,result->y);
}
- dbg(lvl_debug,"str='%s' x=%f ns=%c y=%f ew=%c c=%d\n", str, lng, ns, lat, ew, ret);
- dbg(lvl_debug,"rest='%s'\n", str+ret);
+ dbg(lvl_debug,"str='%s' x=%f ns=%c y=%f ew=%c c=%d", str, lng, ns, lat, ew, ret);
+ dbg(lvl_debug,"rest='%s'", str+ret);
} else if (str_pro == projection_utm) {
double x,y;
args=sscanf(str, "%lf %lf%n", &x, &y, &ret);
@@ -256,14 +256,14 @@ coord_parse(const char *coord_input, enum projection output_projection, struct c
args=sscanf(str, "%lf %lf%n", &lng, &lat, &ret);
if (args < 2)
goto out;
- dbg(lvl_debug,"str='%s' x=%f y=%f c=%d\n", str, lng, lat, ret);
- dbg(lvl_debug,"rest='%s'\n", str+ret);
+ dbg(lvl_debug,"str='%s' x=%f y=%f c=%d", str, lng, lat, ret);
+ dbg(lvl_debug,"rest='%s'", str+ret);
g.lng=lng;
g.lat=lat;
transform_from_geo(output_projection, &g, result);
}
ret+=str-coord_input;
- dbg(lvl_info, "ret=%d delta=%d ret_str='%s'\n", ret, GPOINTER_TO_INT(str-coord_input), coord_input+ret);
+ dbg(lvl_info, "ret=%d delta=%d ret_str='%s'", ret, GPOINTER_TO_INT(str-coord_input), coord_input+ret);
out:
free(proj);
return ret;
diff --git a/navit/debug.c b/navit/debug.c
index 6d1bd4c95..2d6e8fdc5 100644
--- a/navit/debug.c
+++ b/navit/debug.c
@@ -155,12 +155,12 @@ parse_dbg_level(struct attr *dbg_level_attr, struct attr *level_attr)
if(!strcmp(dbg_level_attr->u.str,"debug")){
return lvl_debug;
}
- dbg(lvl_error, "Invalid debug level in config: '%s'\n", dbg_level_attr->u.str);
+ dbg(lvl_error, "Invalid debug level in config: '%s'", dbg_level_attr->u.str);
} else if (level_attr) {
if (level_attr->u.num>= lvl_error &&
level_attr->u.num<= lvl_debug)
return level_attr->u.num;
- dbg(lvl_error, "Invalid debug level in config: %ld\n", level_attr->u.num);
+ dbg(lvl_error, "Invalid debug level in config: %ld", level_attr->u.num);
}
return lvl_unset;
}
@@ -308,7 +308,14 @@ debug_vprintf(dbg_level level, const char *module, const int mlen, const char *f
#if defined HAVE_API_WIN32_CE
#define vsnprintf _vsnprintf
#endif
- vsnprintf(debug_message+strlen(debug_message),4095-strlen(debug_message),fmt,ap);
+ vsnprintf(debug_message+strlen(debug_message),sizeof(debug_message)-1-strlen(debug_message),fmt,ap);
+#ifdef HAVE_API_WIN32_BASE
+ if (strlen(debug_message)<sizeof(debug_message))
+ debug_message[strlen(debug_message)] = '\r'; /* For Windows platforms, add \r at the end of the buffer (if any room) */
+#endif
+ if (strlen(debug_message)<sizeof(debug_message))
+ debug_message[strlen(debug_message)] = '\n'; /* Add \n at the end of the buffer (if any room) */
+ debug_message[sizeof(debug_message)-1] = '\0'; /* Force NUL-termination of the string (if buffer size contraints did not allow for full string to fit */
#ifdef DEBUG_WIN32_CE_MESSAGEBOX
mbstowcs(muni, debug_message, strlen(debug_message)+1);
MessageBoxW(NULL, muni, TEXT("Navit - Error"), MB_APPLMODAL|MB_OK|MB_ICONERROR);
@@ -391,14 +398,11 @@ debug_dump_mallocs(void)
{
struct malloc_head *head=malloc_heads;
int i;
- dbg(lvl_debug,"mallocs %d\n",mallocs);
+ dbg(lvl_debug,"mallocs %d",mallocs);
while (head) {
fprintf(stderr,"unfreed malloc from %s of size %d\n",head->where,head->size);
for (i = 0 ; i < 8 ; i++)
fprintf(stderr,"\tlist *%p\n",head->return_address[i]);
-#if 0
- fprintf(stderr,"%s\n",head+1);
-#endif
head=head->next;
}
}
@@ -414,7 +418,7 @@ debug_malloc(const char *where, int line, const char *func, int size)
debug_malloc_size+=size;
if (debug_malloc_size/(1024*1024) != debug_malloc_size_m) {
debug_malloc_size_m=debug_malloc_size/(1024*1024);
- dbg(lvl_debug,"malloced %d kb\n",debug_malloc_size/1024);
+ dbg(lvl_debug,"malloced %d kb",debug_malloc_size/1024);
}
head=malloc(size+sizeof(*head)+sizeof(*tail));
head->magic=0xdeadbeef;
diff --git a/navit/event.c b/navit/event.c
index 5aee40689..313680f4e 100644
--- a/navit/event.c
+++ b/navit/event.c
@@ -31,7 +31,7 @@ static int has_quit;
#define require_method_helper(m)\
if(!event_methods.m) {\
- dbg(lvl_error, "Can't find event system method %s. Event system is %s%s\n",\
+ dbg(lvl_error, "Can't find event system method %s. Event system is %s%s",\
#m ,e_system?"set to ":"not set.", e_system?e_system:"");\
#define require_method(m)\
@@ -133,14 +133,14 @@ event_request_system(const char *system, const char *requestor)
void (*event_type_new)(struct event_methods *meth);
if (e_system) {
if (strcmp(e_system, system)) {
- dbg(lvl_error,"system '%s' already requested by '%s', can't set to '%s' as requested from '%s'\n", e_system, e_requestor, system, requestor);
+ dbg(lvl_error,"system '%s' already requested by '%s', can't set to '%s' as requested from '%s'", e_system, e_requestor, system, requestor);
return 0;
}
return 1;
}
event_type_new=plugin_get_category_event(system);
if (! event_type_new) {
- dbg(lvl_error,"unsupported event system '%s' requested from '%s'\n", system, requestor);
+ dbg(lvl_error,"unsupported event system '%s' requested from '%s'", system, requestor);
return 0;
}
event_type_new(&event_methods);
diff --git a/navit/file.c b/navit/file.c
index 8363b6a8b..393c54642 100644
--- a/navit/file.c
+++ b/navit/file.c
@@ -83,7 +83,7 @@ file_socket_connect(char *host, char *service)
hints.ai_protocol = 0;
s = getaddrinfo(host, service, &hints, &result);
if (s != 0) {
- dbg(lvl_error,"getaddrinfo error %s\n",gai_strerror(s));
+ dbg(lvl_error,"getaddrinfo error %s",gai_strerror(s));
return -1;
}
for (rp = result; rp != NULL; rp = rp->ai_next) {
@@ -104,7 +104,7 @@ file_http_request(struct file *file, char *method, char *host, char *path, char
{
char *request=g_strdup_printf("%s %s HTTP/1.0\r\nUser-Agent: navit %s\r\nHost: %s\r\n%s%s%s\r\n",method,path,version,host,persistent?"Connection: Keep-Alive\r\n":"",header?header:"",header?"\r\n":"");
write(file->fd, request, strlen(request));
- dbg(lvl_debug,"%s\n",request);
+ dbg(lvl_debug,"%s",request);
file->requests++;
}
@@ -141,7 +141,7 @@ file_request_do(struct file *file, struct attr **options, int connect)
host[path-name-7]='\0';
if (port)
*port++='\0';
- dbg(lvl_debug,"host=%s path=%s\n",host,path);
+ dbg(lvl_debug,"host=%s path=%s",host,path);
if (connect)
file->fd=file_socket_connect(host,port?port:"80");
file_http_request(file,method,host,path,header,persistent);
@@ -215,11 +215,11 @@ file_create(char *name, struct attr **options)
g_free(file);
return NULL;
}
- dbg(lvl_debug,"fd=%d\n", file->fd);
+ dbg(lvl_debug,"fd=%d", file->fd);
file->size=lseek(file->fd, 0, SEEK_END);
if (file->size < 0)
file->size=0;
- dbg(lvl_debug,"size="LONGLONG_FMT"\n", file->size);
+ dbg(lvl_debug,"size="LONGLONG_FMT"", file->size);
file->name_id = (long)atom(name);
}
#ifdef CACHE_SIZE
@@ -274,7 +274,7 @@ int file_mkdir(char *name, int pflag)
char *buffer=g_alloca(sizeof(char)*(strlen(name)+1));
int ret;
char *next;
- dbg(lvl_debug,"enter %s %d\n",name,pflag);
+ dbg(lvl_debug,"enter %s %d",name,pflag);
if (!pflag) {
if (file_is_dir(name))
return 0;
@@ -372,7 +372,7 @@ file_process_headers(struct file *file, unsigned char *headers)
if (*sep == ' ')
sep++;
strtolower(tok, tok);
- dbg(lvl_debug,"header '%s'='%s'\n",tok,sep);
+ dbg(lvl_debug,"header '%s'='%s'",tok,sep);
g_hash_table_insert(file->headers, tok, sep);
headers=NULL;
}
@@ -416,10 +416,10 @@ file_data_read_special(struct file *file, int size, int *size_ret)
eof=1;
}
if (file->requests) {
- dbg(lvl_debug,"checking header\n");
+ dbg(lvl_debug,"checking header");
if ((hdr=file_http_header_end(file->buffer, file->buffer_len))) {
hdr[-1]='\0';
- dbg(lvl_debug,"found %s\n",file->buffer);
+ dbg(lvl_debug,"found %s",file->buffer);
file_process_headers(file, file->buffer);
file_shift_buffer(file, hdr-file->buffer);
file->requests--;
@@ -453,7 +453,7 @@ file_data_flush(struct file *file, long long offset, int size)
if (file->cache) {
struct file_cache_id id={offset,size,file->name_id,0};
cache_flush(file_cache,&id);
- dbg(lvl_debug,"Flushing "LONGLONG_FMT" %d bytes\n",offset,size);
+ dbg(lvl_debug,"Flushing "LONGLONG_FMT" %d bytes",offset,size);
}
}
@@ -537,7 +537,7 @@ file_data_read_compressed(struct file *file, long long offset, int size, int siz
ret=NULL;
} else {
if (uncompress_int(ret, &destLen, (Bytef *)buffer, size) != Z_OK) {
- dbg(lvl_error,"uncompress failed\n");
+ dbg(lvl_error,"uncompress failed");
g_free(ret);
ret=NULL;
}
@@ -749,7 +749,7 @@ file_wordexp_new(const char *pattern)
ret->pattern=g_strdup(pattern);
ret->err=wordexp(pattern, &ret->we, 0);
if (ret->err)
- dbg(lvl_debug,"wordexp('%s') returned %d\n", pattern, ret->err);
+ dbg(lvl_debug,"wordexp('%s') returned %d", pattern, ret->err);
return ret;
}
@@ -803,7 +803,7 @@ file_version(struct file *file, int mode)
file->mtime=st.st_mtime;
file->ctime=st.st_ctime;
file->version++;
- dbg(lvl_debug,"%s now version %d\n", file->name, file->version);
+ dbg(lvl_debug,"%s now version %d", file->name, file->version);
}
}
return file->version;
@@ -837,6 +837,6 @@ file_init(void)
file_cache=cache_new(sizeof(struct file_cache_id), CACHE_SIZE);
#endif
if(sizeof(off_t)<8)
- dbg(lvl_error,"Maps larger than 2GB are not supported by this binary, sizeof(off_t)=%zu\n",sizeof(off_t));
+ dbg(lvl_error,"Maps larger than 2GB are not supported by this binary, sizeof(off_t)=%zu",sizeof(off_t));
}
diff --git a/navit/font/freetype/font_freetype.c b/navit/font/freetype/font_freetype.c
index 0508c5870..c651ee72c 100644
--- a/navit/font/freetype/font_freetype.c
+++ b/navit/font/freetype/font_freetype.c
@@ -354,21 +354,21 @@ static FT_Error face_requester( FTC_FaceID face_id, FT_Library library, FT_Point
if (! face_id)
return FT_Err_Invalid_Handle;
fontfile=g_strdup((char *)face_id);
- dbg(lvl_debug,"fontfile=%s\n", fontfile);
+ dbg(lvl_debug,"fontfile=%s", fontfile);
fontindex=strrchr(fontfile,'/');
if (! fontindex) {
g_free(fontfile);
return FT_Err_Invalid_Handle;
}
*fontindex++='\0';
- dbg(lvl_debug,"new face %s %d\n", fontfile, atoi(fontindex));
+ dbg(lvl_debug,"new face %s %d", fontfile, atoi(fontindex));
ret = FT_New_Face( library, fontfile, atoi(fontindex), aface );
if(ret) {
- dbg(lvl_error,"Error while creating freetype face: %d\n", ret);
+ dbg(lvl_error,"Error while creating freetype face: %d", ret);
return ret;
}
if((ret = FT_Select_Charmap(*aface, FT_ENCODING_UNICODE))) {
- dbg(lvl_error,"Error while creating freetype face: %d\n", ret);
+ dbg(lvl_error,"Error while creating freetype face: %d", ret);
}
return 0;
}
@@ -405,7 +405,7 @@ font_freetype_font_new(struct graphics_priv *gr,
}
font->size=size;
#ifdef HAVE_FONTCONFIG
- dbg(lvl_info, " about to search for fonts, preferred = %s\n", fontfamily);
+ dbg(lvl_info, " about to search for fonts, preferred = %s", fontfamily);
family = g_malloc(sizeof(fontfamilies) + sizeof(fontfamily));
if (fontfamily) {
memcpy(family, &fontfamily, sizeof(fontfamily));
@@ -419,7 +419,7 @@ font_freetype_font_new(struct graphics_priv *gr,
while (*family && !found) {
- dbg(lvl_info, "Looking for font family %s. exact=%d\n",
+ dbg(lvl_info, "Looking for font family %s. exact=%d",
*family, exact);
FcPattern *required =
FcPatternBuild(NULL, FC_FAMILY, FcTypeString,
@@ -450,7 +450,7 @@ font_freetype_font_new(struct graphics_priv *gr,
&& (r2 == FcResultMatch)
&& (FcValueEqual(v1, v2) || !exact)) {
dbg(lvl_info,
- "About to load font from file %s index %d\n",
+ "About to load font from file %s index %d",
fontfile, fontindex);
#if USE_CACHING
idstr=g_strdup_printf("%s/%d", fontfile, fontindex);
@@ -521,7 +521,7 @@ font_freetype_font_new(struct graphics_priv *gr,
g_free(name);
#endif /* HAVE_FONTCONFIG */
if (!found) {
- dbg(lvl_error,"Failed to load font, no labelling\n");
+ dbg(lvl_error,"Failed to load font, no labelling");
g_free(font);
return NULL;
}
diff --git a/navit/geom.c b/navit/geom.c
index 65ea4986b..0f40e2dac 100644
--- a/navit/geom.c
+++ b/navit/geom.c
@@ -93,19 +93,10 @@ geom_poly_area(struct coord *c, int count)
{
long long area=0;
int i,j=0;
-#if 0
- fprintf(stderr,"count=%d\n",count);
-#endif
for (i=0; i<count; i++) {
if (++j == count)
j=0;
-#if 0
- fprintf(stderr,"(%d+%d)*(%d-%d)=%d*%d="LONGLONG_FMT"\n",c[i].x,c[j].x,c[i].y,c[j].y,c[i].x+c[j].x,c[i].y-c[j].y,(long long)(c[i].x+c[j].x)*(c[i].y-c[j].y));
-#endif
area+=(long long)(c[i].x+c[j].x)*(c[i].y-c[j].y);
-#if 0
- fprintf(stderr,"area="LONGLONG_FMT"\n",area);
-#endif
}
return area/2;
}
@@ -205,12 +196,6 @@ geom_poly_point_inside(struct coord *cp, int count, struct coord *c)
while (cp < last) {
if ((cp[0].y > c->y) != (cp[1].y > c->y) &&
c->x < ((long long)cp[1].x-cp[0].x)*(c->y-cp[0].y)/(cp[1].y-cp[0].y)+cp[0].x) {
-#if 0
- fprintf(stderr," cross 0x%x,0x%x-0x%x,0x%x %dx%d",cp,cp[0].x,cp[0].y,cp[1].x,cp[1].y,cp[1].x-cp[0].x,c->y-cp[0].y);
- printf("type=selected_line\n");
- coord_print(projection_mg, &cp[0], stdout);
- coord_print(projection_mg, &cp[1], stdout);
-#endif
ret=!ret;
}
cp++;
@@ -236,15 +221,6 @@ geom_poly_segments_insert(GList *list, struct geom_poly_segment *first, struct g
count+=(first->last-first->first);
if (third)
count+=(third->last-third->first);
-#if 0
- fprintf(stderr,"count=%d first=%p second=%p third=%p\n",count,first,second,third);
- if (first)
- fprintf(stderr,"first:0x%x,0x%x-0x%x,0x%x (%d)\n",first->first->x,first->first->y,first->last->x,first->last->y, first->last-first->first+1);
- if (second)
- fprintf(stderr,"second:0x%x,0x%x-0x%x,0x%x (%d)\n",second->first->x,second->first->y,second->last->x,second->last->y, second->last-second->first+1);
- if (third)
- fprintf(stderr,"third:0x%x,0x%x-0x%x,0x%x (%d)\n",third->first->x,third->first->y,third->last->x,third->last->y, third->last-third->first+1);
-#endif
ret->first=g_new(struct coord, count);
pos=ret->first;
if (first) {
@@ -262,13 +238,7 @@ geom_poly_segments_insert(GList *list, struct geom_poly_segment *first, struct g
pos+=count;
}
ret->last=pos-1;
-#if 0
- fprintf(stderr,"result:0x%x,0x%x-0x%x,0x%x (%d)\n",ret->first->x,ret->first->y,ret->last->x,ret->last->y, ret->last-ret->first+1);
-#endif
list=g_list_prepend(list, ret);
-#if 0
- fprintf(stderr,"List=%p\n",list);
-#endif
return list;
}
@@ -361,30 +331,17 @@ int
geom_poly_segments_point_inside(GList *in, struct coord *c)
{
int open_matches=0,closed_matches=0;
-#if 0
- fprintf(stderr,"try 0x%x,0x%x:",c->x,c->y);
-#endif
while (in) {
struct geom_poly_segment *seg=in->data;
if (geom_poly_point_inside(seg->first, seg->last-seg->first+1, c)) {
-#if 0
- fprintf(stderr," inside");
-#endif
if (coord_is_equal(*seg->first,*seg->last))
closed_matches++;
else
open_matches++;
} else {
-#if 0
- fprintf(stderr," outside");
-#endif
}
in=g_list_next(in);
}
-#if 0
- fprintf(stderr,"\n");
- fprintf(stderr,"open_matches %d closed_matches %d\n",open_matches,closed_matches);
-#endif
if (closed_matches) {
if (closed_matches & 1)
return 1;
diff --git a/navit/graphics.c b/navit/graphics.c
index 378f177fb..ed10d88c4 100644
--- a/navit/graphics.c
+++ b/navit/graphics.c
@@ -242,7 +242,7 @@ graphics_set_attr(struct graphics *gra, struct attr *attr)
{
int ret=1;
/* FIXME if gra->meth doesn't have a setter, we don't even try the generic attrs - is that what we want? */
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (gra->meth.set_attr)
ret=gra->meth.set_attr(gra->priv, attr);
if (!ret)
@@ -270,13 +270,13 @@ struct graphics * graphics_new(struct attr *parent, struct attr **attrs)
struct graphics_priv * (*graphicstype_new)(struct navit *nav, struct graphics_methods *meth, struct attr **attrs, struct callback_list *cbl);
if (! (type_attr=attr_search(attrs, NULL, attr_type))) {
- dbg(lvl_error,"Graphics plugin type is not set.\n");
+ dbg(lvl_error,"Graphics plugin type is not set.");
return NULL;
}
graphicstype_new=plugin_get_category_graphics(type_attr->u.str);
if (! graphicstype_new) {
- dbg(lvl_error,"Failed to load graphics plugin %s.\n", type_attr->u.str);
+ dbg(lvl_error,"Failed to load graphics plugin %s.", type_attr->u.str);
return NULL;
}
this_=g_new0(struct graphics, 1);
@@ -758,7 +758,7 @@ image_new_helper(struct graphics *gra, struct graphics_image *this_, char *path,
this_->width=width;
this_->height=height;
- dbg(lvl_debug,"Trying to load image '%s' for '%s' at %dx%d\n", new_name, path, width, height);
+ dbg(lvl_debug,"Trying to load image '%s' for '%s' at %dx%d", new_name, path, width, height);
if (zip) {
unsigned char *start;
int len;
@@ -774,7 +774,7 @@ image_new_helper(struct graphics *gra, struct graphics_image *this_, char *path,
this_->priv=gra->meth.image_new(gra->priv, &this_->meth, new_name, &this_->width, &this_->height, &this_->hot, rotate);
}
if (this_->priv) {
- dbg(lvl_info,"Using image '%s' for '%s' at %dx%d\n", new_name, path, width, height);
+ dbg(lvl_info,"Using image '%s' for '%s' at %dx%d", new_name, path, width, height);
g_free(new_name);
break;
}
@@ -803,7 +803,7 @@ struct graphics_image * graphics_image_new_scaled_rotated(struct graphics *gra,
if ( g_hash_table_lookup_extended( gra->image_cache_hash, hash_key, NULL, (gpointer)&this_) ) {
g_free(hash_key);
- dbg(lvl_debug,"Found cached image%sfor '%s'\n",this_?" ":" miss ",path);
+ dbg(lvl_debug,"Found cached image%sfor '%s'",this_?" ":" miss ",path);
return this_;
}
@@ -882,7 +882,7 @@ struct graphics_image * graphics_image_new_scaled_rotated(struct graphics *gra,
file_wordexp_destroy(we);
if (! this_->priv) {
- dbg(lvl_error,"No image for '%s'\n", path);
+ dbg(lvl_error,"No image for '%s'", path);
g_free(this_);
this_=NULL;
}
@@ -1117,7 +1117,7 @@ int graphics_show_native_keyboard (struct graphics *this_, struct graphics_keybo
ret = -1;
else
ret = this_->meth.show_native_keyboard(kbd);
- dbg(lvl_debug, "return %d\n", ret);
+ dbg(lvl_debug, "return %d", ret);
return ret;
}
@@ -1331,11 +1331,11 @@ intersection(struct point * a1, int adx, int ady, struct point * b1, int bdx, in
struct point * res)
{
int n, a, b;
- dbg(lvl_debug,"%d,%d - %d,%d x %d,%d-%d,%d\n",a1->x,a1->y,a1->x+adx,a1->y+ady,b1->x,b1->y,b1->x+bdx,b1->y+bdy);
+ dbg(lvl_debug,"%d,%d - %d,%d x %d,%d-%d,%d",a1->x,a1->y,a1->x+adx,a1->y+ady,b1->x,b1->y,b1->x+bdx,b1->y+bdy);
n = bdy * adx - bdx * ady;
a = bdx * (a1->y - b1->y) - bdy * (a1->x - b1->x);
b = adx * (a1->y - b1->y) - ady * (a1->x - b1->x);
- dbg(lvl_debug,"a %d b %d n %d\n",a,b,n);
+ dbg(lvl_debug,"a %d b %d n %d",a,b,n);
if (n < 0) {
n = -n;
a = -a;
@@ -1345,7 +1345,7 @@ intersection(struct point * a1, int adx, int ady, struct point * b1, int bdx, in
return 0;
res->x = a1->x + a * adx / n;
res->y = a1->y + a * ady / n;
- dbg(lvl_debug,"%d,%d\n",res->x,res->y);
+ dbg(lvl_debug,"%d,%d",res->x,res->y);
return 1;
}
@@ -1574,10 +1574,6 @@ draw_shape(struct draw_polyline_context *ctx, struct point *pnt, int wi)
struct draw_polyline_shape *shape=&ctx->shape;
struct draw_polyline_shape *prev=&ctx->prev_shape;
-#if 0
- dbg(lvl_debug,"enter %d,%d - %d,%d %d\n",pnt[0].x,pnt[0].y,pnt[1].x,pnt[1].y,wi);
-#endif
-
*prev=*shape;
if (prev->wi != wi && prev->l) {
prev->wi=wi;
@@ -1592,9 +1588,6 @@ draw_shape(struct draw_polyline_context *ctx, struct point *pnt, int wi)
shape->step=8;
else
shape->step=16;
-#if 0
- l = int_sqrt(dx * dx * lscale * lscale + dy * dy * lscale * lscale);
-#else
dxs=shape->dx*shape->dx;
dys=shape->dy*shape->dy;
lscales=lscale*lscale;
@@ -1602,9 +1595,9 @@ draw_shape(struct draw_polyline_context *ctx, struct point *pnt, int wi)
l = int_sqrt(dxs+dys)*lscale;
else
l = int_sqrt((dxs+dys)*lscales);
-#endif
+
shape->fow=fowler(-shape->dy, shape->dx);
- dbg(lvl_debug,"fow=%d\n",shape->fow);
+ dbg(lvl_debug,"fow=%d",shape->fow);
if (! l)
l=1;
if (wi*lscale > 10000)
@@ -1653,7 +1646,7 @@ draw_middle(struct draw_polyline_context *ctx, struct point *p)
draw_point(&ctx->shape, p, &ctx->res[ctx->ppos++], 1);
return 1;
}
- dbg(lvl_debug,"delta %d\n",delta);
+ dbg(lvl_debug,"delta %d",delta);
if (delta > 0) {
struct point pos,poso;
draw_point(&ctx->shape, p, &pos, 1);
@@ -1712,11 +1705,6 @@ graphics_draw_polyline_as_polygon(struct graphics_priv *gra_priv, struct graphic
int max_circle_points=20;
if (count < 2)
return;
-#if 0
- dbg(lvl_debug,"count=%d\n",count);
- for (i = 0 ; i < count ; i++)
- dbg(lvl_debug,"%d,%d width %d\n",pnt[i].x,pnt[i].y,width[i]);
-#endif
ctx.shape.l=0;
ctx.shape.wi=0;
ctx.res=g_alloca(sizeof(struct point)*maxpoints);
@@ -1875,10 +1863,10 @@ graphics_draw_polyline_clipped(struct graphics *gra, struct graphics_gc *gc, str
segment_end.x=pa[i].x;
segment_end.y=pa[i].y;
segment_end.w=width[i];
- dbg(lvl_debug, "Segment: [%d, %d] - [%d, %d]...\n", segment_start.x, segment_start.y, segment_end.x, segment_end.y);
+ dbg(lvl_debug, "Segment: [%d, %d] - [%d, %d]...", segment_start.x, segment_start.y, segment_end.x, segment_end.y);
clip_result=clip_line(&segment_start, &segment_end, &r);
if (clip_result != CLIPRES_INVISIBLE) {
- dbg(lvl_debug, "....clipped to [%d, %d] - [%d, %d]\n", segment_start.x, segment_start.y, segment_end.x, segment_end.y);
+ dbg(lvl_debug, "....clipped to [%d, %d] - [%d, %d]", segment_start.x, segment_start.y, segment_end.x, segment_end.y);
if ((i == 1) || (clip_result & CLIPRES_START_CLIPPED)) {
points_to_draw[points_to_draw_cnt].x=segment_start.x;
points_to_draw[points_to_draw_cnt].y=segment_start.y;
@@ -1895,9 +1883,6 @@ graphics_draw_polyline_clipped(struct graphics *gra, struct graphics_gc *gc, str
if (points_to_draw_cnt > 1) {
if (poly) {
graphics_draw_polyline_as_polygon(gra->priv, gc->priv, points_to_draw, points_to_draw_cnt, w, gra->meth.draw_polygon);
-#if 0
- gra->meth.draw_lines(gra->priv, gc->priv, points_to_draw, points_to_draw_cnt);
-#endif
} else
gra->meth.draw_lines(gra->priv, gc->priv, points_to_draw, points_to_draw_cnt);
points_to_draw_cnt=0;
@@ -1967,12 +1952,6 @@ graphics_draw_polygon_clipped(struct graphics *gra, struct graphics_gc *gc, stru
struct point *pa2=g_alloca(sizeof(struct point) * (count_in < limit ? count_in*8+1:0));
int count_out,edge=3;
int i;
-#if 0
- r.lu.x+=20;
- r.lu.y+=20;
- r.rl.x-=20;
- r.rl.y-=20;
-#endif
if (count_in < limit) {
p1=pa1;
p2=pa2;
@@ -2069,7 +2048,7 @@ graphics_icon_path(const char *icon)
static char *navit_sharedir;
char *ret=NULL;
struct file_wordexp *wordexp=NULL;
- dbg(lvl_debug,"enter %s\n",icon);
+ dbg(lvl_debug,"enter %s",icon);
if (strchr(icon, '$')) {
wordexp=file_wordexp_new(icon);
if (file_wordexp_get_count(wordexp))
@@ -2082,7 +2061,7 @@ graphics_icon_path(const char *icon)
// get resources for the correct screen density
//
// this part not needed, android unpacks only the correct version into res/drawable dir!
- // dbg(lvl_debug,"android icon_path %s\n",icon);
+ // dbg(lvl_debug,"android icon_path %s",icon);
// static char *android_density;
// android_density = getenv("ANDROID_DENSITY");
// ret=g_strdup_printf("res/drawable-%s/%s",android_density ,icon);
@@ -2136,18 +2115,6 @@ displayitem_draw(struct displayitem *di, void *dummy, struct display_context *dc
count=limit_count(di->c, count);
if (dc->type == type_poly_water_tiled)
mindist=0;
-#if 0
- if (dc->e->type == element_polygon) {
- int max=1000;
- int offset=5600;
- c+=offset;
- count-=offset;
- if (count < 0)
- count=0;
- if (count > max)
- count=max;
- }
-#endif
if (dc->e->type == element_polyline)
count=transform(dc->trans, dc->pro, di->c, pa, count, mindist, e->u.polyline.width, width);
else
@@ -2189,7 +2156,7 @@ displayitem_draw(struct displayitem *di, void *dummy, struct display_context *dc
if (font)
gra->meth.draw_text(gra->priv, gc->priv, gc_background?gc_background->priv:NULL, font->priv, di->label, &p, 0x10000, 0);
else
- dbg(lvl_error,"Failed to get font with size %d\n",e->text_size);
+ dbg(lvl_error,"Failed to get font with size %d",e->text_size);
}
}
break;
@@ -2205,7 +2172,7 @@ displayitem_draw(struct displayitem *di, void *dummy, struct display_context *dc
if (font)
label_line(gra, gc, gc_background, font, pa, count, di->label);
else
- dbg(lvl_error,"Failed to get font with size %d\n",e->text_size);
+ dbg(lvl_error,"Failed to get font with size %d",e->text_size);
}
break;
case element_icon:
@@ -2228,7 +2195,7 @@ displayitem_draw(struct displayitem *di, void *dummy, struct display_context *dc
if (img)
dc->img=img;
else
- dbg(lvl_debug,"failed to load icon '%s'\n", path);
+ dbg(lvl_debug,"failed to load icon '%s'", path);
g_free(path);
}
if (img) {
@@ -2244,19 +2211,19 @@ displayitem_draw(struct displayitem *di, void *dummy, struct display_context *dc
}
break;
case element_image:
- dbg(lvl_debug,"image: '%s'\n", di->label);
+ dbg(lvl_debug,"image: '%s'", di->label);
if (gra->meth.draw_image_warp) {
img=graphics_image_new_scaled_rotated(gra, di->label, IMAGE_W_H_UNSET, IMAGE_W_H_UNSET, 0);
if (img)
gra->meth.draw_image_warp(gra->priv, gra->gc[0]->priv, pa, count, img->priv);
} else
- dbg(lvl_error,"draw_image_warp not supported by graphics driver drawing '%s'\n", di->label);
+ dbg(lvl_error,"draw_image_warp not supported by graphics driver drawing '%s'", di->label);
break;
case element_arrows:
display_draw_arrows(gra,gc,pa,count);
break;
default:
- dbg(lvl_error, "Unhandled element type %d\n", e->type);
+ dbg(lvl_error, "Unhandled element type %d", e->type);
}
di=di->next;
@@ -2321,7 +2288,7 @@ graphics_draw_itemgra(struct graphics *gra, struct itemgra *itm, struct transfor
struct element *e=es->data;
if (e->coord_count) {
if (e->coord_count > max_coord) {
- dbg(lvl_error,"maximum number of coords reached: %d > %d\n",e->coord_count,max_coord);
+ dbg(lvl_error,"maximum number of coords reached: %d > %d",e->coord_count,max_coord);
di->count=max_coord;
} else
di->count=e->coord_count;
@@ -2423,7 +2390,7 @@ displaylist_update_hash(struct displaylist *displaylist)
displaylist->max_offset=0;
clear_hash(displaylist);
displaylist_update_layers(displaylist, displaylist->layout->layers, displaylist->order);
- dbg(lvl_debug,"max offset %d\n",displaylist->max_offset);
+ dbg(lvl_debug,"max offset %d",displaylist->max_offset);
}
@@ -2527,13 +2494,10 @@ do_draw(struct displaylist *displaylist, int cancel, int flags)
count=item_coord_get_within_selection(item, ca, item->type < type_line ? 1: max, displaylist->sel);
if (! count)
continue;
-#if 0
- dbg(lvl_debug,"%s 0x%x 0x%x\n",item_to_name(item->type), item->id_hi, item->id_lo);
-#endif
if (displaylist->dc.pro != pro)
transform_from_to_count(ca, displaylist->dc.pro, ca, pro, count);
if (count == max) {
- dbg(lvl_error,"point count overflow %d for %s "ITEM_ID_FMT"\n", count,item_to_name(item->type),ITEM_ID_ARGS(*item));
+ dbg(lvl_error,"point count overflow %d for %s "ITEM_ID_FMT"", count,item_to_name(item->type),ITEM_ID_ARGS(*item));
displaylist->dc.maxlen=max*2;
}
if (item_is_custom_poi(*item)) {
@@ -2645,7 +2609,7 @@ static void graphics_load_mapset(struct graphics *gra, struct displaylist *displ
do_draw(displaylist, 1, flags);
}
xdisplay_free(displaylist);
- dbg(lvl_debug,"order=%d\n", order);
+ dbg(lvl_debug,"order=%d", order);
displaylist->dc.gra=gra;
displaylist->ms=mapset;
diff --git a/navit/graphics/android/graphics_android.c b/navit/graphics/android/graphics_android.c
index 0d6aa30d2..6cc776227 100644
--- a/navit/graphics/android/graphics_android.c
+++ b/navit/graphics/android/graphics_android.c
@@ -96,7 +96,7 @@ find_class_global(char *name, jclass *ret)
{
*ret=(*jnienv)->FindClass(jnienv, name);
if (! *ret) {
- dbg(lvl_error,"Failed to get Class %s\n",name);
+ dbg(lvl_error,"Failed to get Class %s",name);
return 0;
}
*ret = (*jnienv)->NewGlobalRef(jnienv, *ret);
@@ -108,7 +108,7 @@ find_method(jclass class, char *name, char *args, jmethodID *ret)
{
*ret = (*jnienv)->GetMethodID(jnienv, class, name, args);
if (*ret == NULL) {
- dbg(lvl_error,"Failed to get Method %s with signature %s\n",name,args);
+ dbg(lvl_error,"Failed to get Method %s with signature %s",name,args);
return 0;
}
return 1;
@@ -119,7 +119,7 @@ find_static_method(jclass class, char *name, char *args, jmethodID *ret)
{
*ret = (*jnienv)->GetStaticMethodID(jnienv, class, name, args);
if (*ret == NULL) {
- dbg(lvl_error,"Failed to get static Method %s with signature %s\n",name,args);
+ dbg(lvl_error,"Failed to get static Method %s with signature %s",name,args);
return 0;
}
return 1;
@@ -227,18 +227,18 @@ image_new(struct graphics_priv *gra, struct graphics_image_methods *meth, char *
jclass localBitmap = NULL;
int id;
- dbg(lvl_debug,"enter %s\n",path);
+ dbg(lvl_debug,"enter %s",path);
if (!strncmp(path,"res/drawable/",13)) {
jstring a=(*jnienv)->NewStringUTF(jnienv, "drawable");
char *path_noext=g_strdup(path+13);
char *pos=strrchr(path_noext, '.');
if (pos)
*pos='\0';
- dbg(lvl_debug,"path_noext=%s\n",path_noext);
+ dbg(lvl_debug,"path_noext=%s",path_noext);
string = (*jnienv)->NewStringUTF(jnienv, path_noext);
g_free(path_noext);
id=(*jnienv)->CallIntMethod(jnienv, gra->Resources, gra->Resources_getIdentifier, string, a, gra->packageName);
- dbg(lvl_debug,"id=%d\n",id);
+ dbg(lvl_debug,"id=%d",id);
if (id)
localBitmap=(*jnienv)->CallStaticObjectMethod(jnienv, gra->BitmapFactoryClass, gra->BitmapFactory_decodeResource, gra->Resources, id);
(*jnienv)->DeleteLocalRef(jnienv, a);
@@ -264,13 +264,13 @@ image_new(struct graphics_priv *gra, struct graphics_image_methods *meth, char *
ret->Bitmap = (*jnienv)->NewGlobalRef(jnienv, localBitmap);
(*jnienv)->DeleteLocalRef(jnienv, localBitmap);
- dbg(lvl_debug,"w=%d h=%d for %s\n",ret->width,ret->height,path);
+ dbg(lvl_debug,"w=%d h=%d for %s",ret->width,ret->height,path);
ret->hot.x=ret->width/2;
ret->hot.y=ret->height/2;
} else {
g_free(ret);
ret=NULL;
- dbg(lvl_warning,"Failed to open %s\n",path);
+ dbg(lvl_warning,"Failed to open %s",path);
}
(*jnienv)->DeleteLocalRef(jnienv, string);
if (ret) {
@@ -361,7 +361,7 @@ static void
draw_text(struct graphics_priv *gra, struct graphics_gc_priv *fg, struct graphics_gc_priv *bg, struct graphics_font_priv *font, char *text, struct point *p, int dx, int dy)
{
int bgcolor=0;
- dbg(lvl_debug,"enter %s\n", text);
+ dbg(lvl_debug,"enter %s", text);
initPaint(gra, fg);
if(bg)
bgcolor=(bg->a<<24)| (bg->r<<16) | (bg->g<<8) | bg->b;
@@ -373,7 +373,7 @@ draw_text(struct graphics_priv *gra, struct graphics_gc_priv *fg, struct graphic
static void
draw_image(struct graphics_priv *gra, struct graphics_gc_priv *fg, struct point *p, struct graphics_image_priv *img)
{
- dbg(lvl_debug,"enter %p\n",img);
+ dbg(lvl_debug,"enter %p",img);
initPaint(gra, fg);
(*jnienv)->CallVoidMethod(jnienv, gra->NavitGraphics, gra->NavitGraphics_draw_image, fg->gra->Paint, p->x, p->y, img->Bitmap);
@@ -396,7 +396,7 @@ draw_image_warp (struct graphics_priv *gr, struct graphics_gc_priv *fg, struct p
(*jnienv)->CallVoidMethod(jnienv, gr->NavitGraphics, gr->NavitGraphics_draw_image_warp, fg->gra->Paint,
count, p[0].x, p[0].y,p[1].x, p[1].y, p[2].x, p[2].y, img->Bitmap);
} else
- dbg(lvl_debug,"draw_image_warp is called with unsupported count parameter value %d\n", count);
+ dbg(lvl_debug,"draw_image_warp is called with unsupported count parameter value %d", count);
}
@@ -473,12 +473,12 @@ set_attr(struct graphics_priv *gra, struct attr *attr)
| (attr->u.color->r / 0x101) << 16
| (attr->u.color->g / 0x101) << 8
| (attr->u.color->b / 0x101);
- dbg(lvl_debug, "set attr_background_color %04x %04x %04x %04x (%08x)\n",
+ dbg(lvl_debug, "set attr_background_color %04x %04x %04x %04x (%08x)",
attr->u.color->r, attr->u.color->g, attr->u.color->b, attr->u.color->a, gra->bgcolor);
if (gra->NavitGraphics_setBackgroundColor != NULL)
(*jnienv)->CallVoidMethod(jnienv, gra->NavitGraphics, gra->NavitGraphics_setBackgroundColor, gra->bgcolor);
else
- dbg(lvl_error, "NavitGraphics.setBackgroundColor not found, cannot set background color\n");
+ dbg(lvl_error, "NavitGraphics.setBackgroundColor not found, cannot set background color");
return 1;
default:
return 0;
@@ -520,15 +520,15 @@ static struct graphics_methods graphics_methods = {
static void
resize_callback(struct graphics_priv *gra, int w, int h)
{
- dbg(lvl_debug,"w=%d h=%d ok\n",w,h);
- dbg(lvl_debug,"gra=%p, %d callbacks in list\n", gra, g_list_length(gra->cbl));
+ dbg(lvl_debug,"w=%d h=%d ok",w,h);
+ dbg(lvl_debug,"gra=%p, %d callbacks in list", gra, g_list_length(gra->cbl));
callback_list_call_attr_2(gra->cbl, attr_resize, (void *)w, (void *)h);
}
static void
padding_callback(struct graphics_priv *gra, int left, int top, int right, int bottom)
{
- dbg(lvl_debug, "win.padding left=%d top=%d right=%d bottom=%d ok\n", left, top, right, bottom);
+ dbg(lvl_debug, "win.padding left=%d top=%d right=%d bottom=%d ok", left, top, right, bottom);
gra->padding->left = left;
gra->padding->top = top;
gra->padding->right = right;
@@ -547,7 +547,7 @@ motion_callback(struct graphics_priv *gra, int x, int y)
static void
keypress_callback(struct graphics_priv *gra, char *s)
{
- dbg(lvl_debug,"enter %s\n",s);
+ dbg(lvl_debug,"enter %s",s);
callback_list_call_attr_1(gra->cbl, attr_keypress, s);
}
@@ -568,20 +568,20 @@ set_activity(jobject graphics)
jmethodID cid;
ActivityClass = (*jnienv)->GetObjectClass(jnienv, android_activity);
- dbg(lvl_debug,"at 5\n");
+ dbg(lvl_debug,"at 5");
if (ActivityClass == NULL) {
- dbg(lvl_debug,"no activity class found\n");
+ dbg(lvl_debug,"no activity class found");
return 0;
}
- dbg(lvl_debug,"at 6\n");
+ dbg(lvl_debug,"at 6");
cid = (*jnienv)->GetMethodID(jnienv, ActivityClass, "setContentView", "(Landroid/view/View;)V");
if (cid == NULL) {
- dbg(lvl_error,"no setContentView method found\n");
+ dbg(lvl_error,"no setContentView method found");
return 0;
}
- dbg(lvl_debug,"at 7\n");
+ dbg(lvl_debug,"at 7");
(*jnienv)->CallVoidMethod(jnienv, android_activity, cid, graphics);
- dbg(lvl_debug,"at 8\n");
+ dbg(lvl_debug,"at 8");
return 1;
}
@@ -604,7 +604,7 @@ graphics_android_init(struct graphics_priv *ret, struct graphics_priv *parent, s
struct callback *cb;
jmethodID cid, Context_getPackageName;
- dbg(lvl_debug,"at 2 jnienv=%p\n",jnienv);
+ dbg(lvl_debug,"at 2 jnienv=%p",jnienv);
if (parent)
ret->padding = parent->padding;
if (!find_class_global("android/graphics/Paint", &ret->PaintClass))
@@ -653,15 +653,15 @@ graphics_android_init(struct graphics_priv *ret, struct graphics_priv *parent, s
if (!find_class_global("org/navitproject/navit/NavitGraphics", &ret->NavitGraphicsClass))
return 0;
- dbg(lvl_debug,"at 3\n");
+ dbg(lvl_debug,"at 3");
cid = (*jnienv)->GetMethodID(jnienv, ret->NavitGraphicsClass, "<init>", "(Landroid/app/Activity;Lorg/navitproject/navit/NavitGraphics;IIIIII)V");
if (cid == NULL) {
- dbg(lvl_error,"no method found\n");
+ dbg(lvl_error,"no method found");
return 0; /* exception thrown */
}
- dbg(lvl_debug,"at 4 android_activity=%p\n",android_activity);
+ dbg(lvl_debug,"at 4 android_activity=%p",android_activity);
ret->NavitGraphics=(*jnienv)->NewObject(jnienv, ret->NavitGraphicsClass, cid, android_activity, parent ? parent->NavitGraphics : NULL, pnt ? pnt->x:0 , pnt ? pnt->y:0, w, h, wraparound, use_camera);
- dbg(lvl_debug,"result=%p\n",ret->NavitGraphics);
+ dbg(lvl_debug,"result=%p",ret->NavitGraphics);
if (ret->NavitGraphics)
ret->NavitGraphics = (*jnienv)->NewGlobalRef(jnienv, ret->NavitGraphics);
@@ -670,13 +670,13 @@ graphics_android_init(struct graphics_priv *ret, struct graphics_priv *parent, s
/* 0x101 = text kerning (default), antialiasing */
ret->Paint=(*jnienv)->NewObject(jnienv, ret->PaintClass, ret->Paint_init, 0x101);
- dbg(lvl_debug,"result=%p\n",ret->Paint);
+ dbg(lvl_debug,"result=%p",ret->Paint);
if (ret->Paint)
ret->Paint = (*jnienv)->NewGlobalRef(jnienv, ret->Paint);
cid = (*jnienv)->GetMethodID(jnienv, ret->NavitGraphicsClass, "setSizeChangedCallback", "(I)V");
if (cid == NULL) {
- dbg(lvl_error,"no SetResizeCallback method found\n");
+ dbg(lvl_error,"no SetResizeCallback method found");
return 0; /* exception thrown */
}
cb=callback_new_1(callback_cast(resize_callback), ret);
@@ -684,7 +684,7 @@ graphics_android_init(struct graphics_priv *ret, struct graphics_priv *parent, s
cid = (*jnienv)->GetMethodID(jnienv, ret->NavitGraphicsClass, "setPaddingChangedCallback", "(I)V");
if (cid == NULL) {
- dbg(lvl_error,"no SetPaddingCallback method found\n");
+ dbg(lvl_error,"no SetPaddingCallback method found");
return 0; /* exception thrown */
}
cb=callback_new_1(callback_cast(padding_callback), ret);
@@ -692,7 +692,7 @@ graphics_android_init(struct graphics_priv *ret, struct graphics_priv *parent, s
cid = (*jnienv)->GetMethodID(jnienv, ret->NavitGraphicsClass, "setButtonCallback", "(I)V");
if (cid == NULL) {
- dbg(lvl_error,"no SetButtonCallback method found\n");
+ dbg(lvl_error,"no SetButtonCallback method found");
return 0; /* exception thrown */
}
cb=callback_new_1(callback_cast(button_callback), ret);
@@ -700,7 +700,7 @@ graphics_android_init(struct graphics_priv *ret, struct graphics_priv *parent, s
cid = (*jnienv)->GetMethodID(jnienv, ret->NavitGraphicsClass, "setMotionCallback", "(I)V");
if (cid == NULL) {
- dbg(lvl_error,"no SetMotionCallback method found\n");
+ dbg(lvl_error,"no SetMotionCallback method found");
return 0; /* exception thrown */
}
cb=callback_new_1(callback_cast(motion_callback), ret);
@@ -708,7 +708,7 @@ graphics_android_init(struct graphics_priv *ret, struct graphics_priv *parent, s
cid = (*jnienv)->GetMethodID(jnienv, ret->NavitGraphicsClass, "setKeypressCallback", "(I)V");
if (cid == NULL) {
- dbg(lvl_error,"no SetKeypressCallback method found\n");
+ dbg(lvl_error,"no SetKeypressCallback method found");
return 0; /* exception thrown */
}
cb=callback_new_1(callback_cast(keypress_callback), ret);
@@ -757,7 +757,7 @@ graphics_android_fullscreen(struct window *win, int on)
static void
graphics_android_disable_suspend(struct window *win)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
(*jnienv)->CallVoidMethod(jnienv, android_activity, Navit_disableSuspend);
}
@@ -776,7 +776,7 @@ static void
graphics_android_cmd_runMenuItem(struct graphics_priv *this, char *function, struct attr **in, struct attr ***out, int *valid)
{
int ncmd=0;
- dbg(0,"Running %s\n",function);
+ dbg(0,"Running %s",function);
if(!strcmp(function,"map_download_dialog")) {
ncmd=3;
} else if(!strcmp(function,"backup_restore_dialog")) {
@@ -801,7 +801,7 @@ graphics_android_cmd_runMenuItem(struct graphics_priv *this, char *function, str
static void
graphics_android_cmd_menu(struct graphics_priv *this, char *function, struct attr **in, struct attr ***out, int *valid)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
(*jnienv)->CallVoidMethod(jnienv, android_activity, Navit_showMenu);
}
@@ -838,7 +838,7 @@ graphics_android_new(struct navit *nav, struct graphics_methods *meth, struct at
jmethodID cid;
jint android_bgcolor;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
if (!event_request_system("android","graphics_android"))
return NULL;
ret=g_new0(struct graphics_priv, 1);
@@ -859,7 +859,7 @@ graphics_android_new(struct navit *nav, struct graphics_methods *meth, struct at
| (attr->u.color->r / 0x101) << 16
| (attr->u.color->g / 0x101) << 8
| (attr->u.color->b / 0x101);
- dbg(lvl_debug, "attr_background_color %04x %04x %04x %04x (%08x)\n",
+ dbg(lvl_debug, "attr_background_color %04x %04x %04x %04x (%08x)",
attr->u.color->r, attr->u.color->g, attr->u.color->b, attr->u.color->a, ret->bgcolor);
} else {
/* default is the same as for OSD */
@@ -886,14 +886,14 @@ graphics_android_new(struct navit *nav, struct graphics_methods *meth, struct at
* the navit object (as the fact that graphics also handles input devices is not immedately obvious).
*/
navit_object_set_attr((struct navit_object *) nav, attr);
- dbg(lvl_debug, "attr_has_menu_button=%d\n", attr->u.num);
+ dbg(lvl_debug, "attr_has_menu_button=%d", attr->u.num);
g_free(attr);
}
ret->NavitGraphics_setBackgroundColor = (*jnienv)->GetMethodID(jnienv, ret->NavitGraphicsClass, "setBackgroundColor", "(I)V");
if (ret->NavitGraphics_setBackgroundColor != NULL) {
(*jnienv)->CallVoidMethod(jnienv, ret->NavitGraphics, ret->NavitGraphics_setBackgroundColor, ret->bgcolor);
}
- dbg(lvl_debug,"returning %p\n",ret);
+ dbg(lvl_debug,"returning %p",ret);
return ret;
} else {
g_free(ret);
@@ -922,7 +922,7 @@ overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct poin
struct graphics_priv *ret=g_new0(struct graphics_priv, 1);
*meth=graphics_methods;
if (graphics_android_init(ret, gr, p, w, h, wraparound, 0)) {
- dbg(lvl_debug,"returning %p\n",ret);
+ dbg(lvl_debug,"returning %p",ret);
return ret;
} else {
g_free(ret);
@@ -934,12 +934,12 @@ overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct poin
static void
event_android_main_loop_run(void)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static void event_android_main_loop_quit(void)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
(*jnienv)->CallVoidMethod(jnienv, android_activity, Navit_exit);
}
@@ -961,7 +961,7 @@ static void do_poll(JNIEnv *env, int fd, int cond)
{
struct pollfd pfd;
pfd.fd=fd;
- dbg(lvl_debug,"%p poll called for %d %d\n", fd, cond);
+ dbg(lvl_debug,"%p poll called for %d %d", fd, cond);
switch ((enum event_watch_cond)cond) {
case event_watch_cond_read:
pfd.events=POLLIN;
@@ -984,7 +984,7 @@ event_android_add_watch(int h, enum event_watch_cond cond, struct callback *cb)
{
jobject ret;
ret=(*jnienv)->NewObject(jnienv, NavitWatchClass, NavitWatch_init, (int)do_poll, h, (int) cond, (int)cb);
- dbg(lvl_debug,"result for %d,%d,%p=%p\n",h,cond,cb,ret);
+ dbg(lvl_debug,"result for %d,%d,%p=%p",h,cond,cb,ret);
if (ret)
ret = (*jnienv)->NewGlobalRef(jnienv, ret);
return (struct event_watch *)ret;
@@ -993,7 +993,7 @@ event_android_add_watch(int h, enum event_watch_cond cond, struct callback *cb)
static void
event_android_remove_watch(struct event_watch *ev)
{
- dbg(lvl_debug,"enter %p\n",ev);
+ dbg(lvl_debug,"enter %p",ev);
if (ev) {
jobject obj=(jobject )ev;
(*jnienv)->CallVoidMethod(jnienv, obj, NavitWatch_remove);
@@ -1045,9 +1045,9 @@ event_android_add_idle(int priority, struct callback *cb)
{
#if 0
jobject ret;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
ret=(*jnienv)->NewObject(jnienv, NavitIdleClass, NavitIdle_init, (int)cb);
- dbg(lvl_debug,"result for %p=%p\n",cb,ret);
+ dbg(lvl_debug,"result for %p=%p",cb,ret);
if (ret)
ret = (*jnienv)->NewGlobalRef(jnienv, ret);
return (struct event_idle *)ret;
@@ -1059,7 +1059,7 @@ static void
event_android_remove_idle(struct event_idle *ev)
{
#if 0
- dbg(lvl_debug,"enter %p\n",ev);
+ dbg(lvl_debug,"enter %p",ev);
if (ev) {
jobject obj=(jobject )ev;
(*jnienv)->CallVoidMethod(jnienv, obj, NavitIdle_remove);
@@ -1072,7 +1072,7 @@ event_android_remove_idle(struct event_idle *ev)
static void
event_android_call_callback(struct callback_list *cb)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static struct event_methods event_android_methods = {
@@ -1090,7 +1090,7 @@ static struct event_methods event_android_methods = {
static struct event_priv *
event_android_new(struct event_methods *meth)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (!find_class_global("org/navitproject/navit/NavitTimeout", &NavitTimeoutClass))
return NULL;
NavitTimeout_init = (*jnienv)->GetMethodID(jnienv, NavitTimeoutClass, "<init>", "(IZI)V");
@@ -1139,7 +1139,7 @@ event_android_new(struct event_methods *meth)
Navit_showNativeKeyboard = (*jnienv)->GetMethodID(jnienv, NavitClass, "showNativeKeyboard", "()I");
Navit_hideNativeKeyboard = (*jnienv)->GetMethodID(jnienv, NavitClass, "hideNativeKeyboard", "()V");
- dbg(lvl_debug,"ok\n");
+ dbg(lvl_debug,"ok");
*meth=event_android_methods;
return NULL;
}
@@ -1166,12 +1166,12 @@ event_android_new(struct event_methods *meth)
int show_native_keyboard (struct graphics_keyboard *kbd) {
kbd->w = -1;
if (Navit_showNativeKeyboard == NULL) {
- dbg(lvl_error, "method Navit.showNativeKeyboard() not found, cannot display keyboard\n");
+ dbg(lvl_error, "method Navit.showNativeKeyboard() not found, cannot display keyboard");
return 0;
}
kbd->h = (*jnienv)->CallIntMethod(jnienv, android_activity, Navit_showNativeKeyboard);
- dbg(lvl_error, "keyboard size is %d x %d px\n", kbd->w, kbd->h);
- dbg(lvl_error, "return\n");
+ dbg(lvl_error, "keyboard size is %d x %d px", kbd->w, kbd->h);
+ dbg(lvl_error, "return");
/* zero height means we're not showing a keyboard, therefore normalize height to boolean */
return !!(kbd->h);
}
@@ -1186,7 +1186,7 @@ int show_native_keyboard (struct graphics_keyboard *kbd) {
*/
void hide_native_keyboard (struct graphics_keyboard *kbd) {
if (Navit_hideNativeKeyboard == NULL) {
- dbg(lvl_error, "method Navit.hideNativeKeyboard() not found, cannot dismiss keyboard\n");
+ dbg(lvl_error, "method Navit.hideNativeKeyboard() not found, cannot dismiss keyboard");
return;
}
(*jnienv)->CallVoidMethod(jnienv, android_activity, Navit_hideNativeKeyboard);
@@ -1197,7 +1197,7 @@ void hide_native_keyboard (struct graphics_keyboard *kbd) {
void
plugin_init(void)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
plugin_register_category_graphics("android", graphics_android_new);
plugin_register_category_event("android", event_android_new);
}
diff --git a/navit/graphics/cocoa/graphics_cocoa.m b/navit/graphics/cocoa/graphics_cocoa.m
index 16c879bd7..8612469ac 100644
--- a/navit/graphics/cocoa/graphics_cocoa.m
+++ b/navit/graphics/cocoa/graphics_cocoa.m
@@ -112,7 +112,7 @@ struct graphics_font_priv {
#if REVERSE_Y
pc.y=graphics->h-pc.y-gr->h;
#endif
- dbg(1,"draw %dx%d at %f,%f\n",gr->w,gr->h,pc.x,pc.y);
+ dbg(1,"draw %dx%d at %f,%f",gr->w,gr->h,pc.x,pc.y);
CGContextDrawLayerAtPoint(X, pc, gr->layer);
}
gr=gr->next;
@@ -128,7 +128,7 @@ struct graphics_font_priv {
struct point p;
p.x=pc.x;
p.y=pc.y;
- dbg(1,"Enter count=%d %d %d\n",touches.count,p.x,p.y);
+ dbg(1,"Enter count=%d %d %d",touches.count,p.x,p.y);
callback_list_call_attr_3(graphics->cbl, attr_button, GINT_TO_POINTER(1), GINT_TO_POINTER(1), (void *)&p);
}
@@ -141,7 +141,7 @@ struct graphics_font_priv {
struct point p;
p.x=pc.x;
p.y=pc.y;
- dbg(1,"Enter count=%d %d %d\n",touches.count,p.x,p.y);
+ dbg(1,"Enter count=%d %d %d",touches.count,p.x,p.y);
callback_list_call_attr_3(graphics->cbl, attr_button, GINT_TO_POINTER(0), GINT_TO_POINTER(1), (void *)&p);
}
@@ -153,7 +153,7 @@ struct graphics_font_priv {
struct point p;
p.x=pc.x;
p.y=pc.y;
- dbg(1,"Enter count=%d %d %d\n",touches.count,p.x,p.y);
+ dbg(1,"Enter count=%d %d %d",touches.count,p.x,p.y);
callback_list_call_attr_3(graphics->cbl, attr_button, GINT_TO_POINTER(0), GINT_TO_POINTER(1), (void *)&p);
}
@@ -165,7 +165,7 @@ struct graphics_font_priv {
struct point p;
p.x=pc.x;
p.y=pc.y;
- dbg(1,"Enter count=%d %d %d\n",touches.count,p.x,p.y);
+ dbg(1,"Enter count=%d %d %d",touches.count,p.x,p.y);
callback_list_call_attr_1(graphics->cbl, attr_motion, (void *)&p);
}
@@ -176,7 +176,7 @@ struct graphics_font_priv {
p.x=theEvent.locationInWindow.x;
p.y=graphics->h-theEvent.locationInWindow.y;
- dbg(1,"Enter %d %d\n",p.x,p.y);
+ dbg(1,"Enter %d %d",p.x,p.y);
callback_list_call_attr_3(graphics->cbl, attr_button, GINT_TO_POINTER(1), GINT_TO_POINTER(1), (void *)&p);
}
@@ -186,7 +186,7 @@ struct graphics_font_priv {
p.x=theEvent.locationInWindow.x;
p.y=graphics->h-theEvent.locationInWindow.y;
- dbg(1,"Enter %d %d\n",p.x,p.y);
+ dbg(1,"Enter %d %d",p.x,p.y);
callback_list_call_attr_3(graphics->cbl, attr_button, GINT_TO_POINTER(0), GINT_TO_POINTER(1), (void *)&p);
}
@@ -196,7 +196,7 @@ struct graphics_font_priv {
p.x=theEvent.locationInWindow.x;
p.y=graphics->h-theEvent.locationInWindow.y;
- dbg(1,"Enter %d %d\n",p.x,p.y);
+ dbg(1,"Enter %d %d",p.x,p.y);
callback_list_call_attr_1(graphics->cbl, attr_motion, (void *)&p);
}
#endif
@@ -280,7 +280,7 @@ setup_graphics(struct graphics_priv *gr)
}
- (void)didReceiveMemoryWarning {
- dbg(0,"enter\n");
+ dbg(0,"enter");
}
- (void)viewDidUnload {
@@ -378,7 +378,7 @@ static void
draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
{
if (mode == draw_mode_end) {
- dbg(1,"end %p\n",gr);
+ dbg(1,"end %p",gr);
if (!gr->parent) {
#if USE_UIKIT
[gr->view setNeedsDisplay];
@@ -427,7 +427,7 @@ draw_rectangle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct poi
{
CGRect lr=CGRectMake(p->x, p->y, w, h);
if (p->x <= 0 && p->y <= 0 && p->x+w+1 >= gr->w && p->y+h+1 >= gr->h) {
- dbg(1,"clear %p %dx%d\n",gr,w,h);
+ dbg(1,"clear %p %dx%d",gr,w,h);
free_graphics(gr);
setup_graphics(gr);
}
@@ -571,7 +571,7 @@ image_new(struct graphics_priv *gra, struct graphics_image_methods *meth, char *
CGImageRef image = CGImageCreateWithPNGDataProvider(imgDataProvider, NULL, true, kCGRenderingIntentDefault);
CGDataProviderRelease(imgDataProvider);
- dbg(1,"size %dx%d\n",CGImageGetWidth(image),CGImageGetHeight(image));
+ dbg(1,"size %dx%d",CGImageGetWidth(image),CGImageGetHeight(image));
if (w)
*w=CGImageGetWidth(image);
if (h)
@@ -586,7 +586,7 @@ image_new(struct graphics_priv *gra, struct graphics_image_methods *meth, char *
static void *
get_data(struct graphics_priv *this, const char *type)
{
- dbg(0,"enter\n");
+ dbg(0,"enter");
if (strcmp(type,"window"))
return NULL;
return &this->win;
@@ -670,7 +670,7 @@ graphics_cocoa_new(struct navit *nav, struct graphics_methods *meth, struct attr
{
struct graphics_priv *ret;
*meth=graphics_methods;
- dbg(0,"enter\n");
+ dbg(0,"enter");
if(!event_request_system("cocoa","graphics_cocoa"))
return NULL;
ret=g_new0(struct graphics_priv, 1);
@@ -683,7 +683,7 @@ static void
event_cocoa_main_loop_run(void)
{
- dbg(0,"enter\n");
+ dbg(0,"enter");
#if 0
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
@@ -693,9 +693,9 @@ event_cocoa_main_loop_run(void)
#endif
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
#if USE_UIKIT
- dbg(0,"calling main\n");
+ dbg(0,"calling main");
int retval = UIApplicationMain(main_argc, main_argv, nil, @"NavitAppDelegate");
- dbg(0,"retval=%d\n",retval);
+ dbg(0,"retval=%d",retval);
#else
NavitAppDelegate * delegate = [[NavitAppDelegate alloc] init];
NSApplication * application = [NSApplication sharedApplication];
@@ -739,7 +739,7 @@ event_cocoa_add_timeout(int timeout, int multi, struct callback *cb)
NavitTimer *ret=[[NavitTimer alloc]init];
ret->cb=cb;
ret->timer=[NSTimer scheduledTimerWithTimeInterval:(timeout/1000.0) target:ret selector:@selector(onTimer:) userInfo:nil repeats:multi?YES:NO];
- dbg(1,"timer=%p\n",ret->timer);
+ dbg(1,"timer=%p",ret->timer);
return (struct event_timeout *)ret;
}
@@ -761,7 +761,7 @@ event_cocoa_add_idle(int priority, struct callback *cb)
ret->cb=cb;
ret->timer=[NSTimer scheduledTimerWithTimeInterval:(0.0) target:ret selector:@selector(onTimer:) userInfo:nil repeats:YES];
- dbg(1,"timer=%p\n",ret->timer);
+ dbg(1,"timer=%p",ret->timer);
return (struct event_idle *)ret;
}
@@ -790,7 +790,7 @@ static struct event_methods event_cocoa_methods = {
static struct event_priv *
event_cocoa_new(struct event_methods *meth)
{
- dbg(0,"enter\n");
+ dbg(0,"enter");
*meth=event_cocoa_methods;
return NULL;
}
@@ -799,7 +799,7 @@ event_cocoa_new(struct event_methods *meth)
void
plugin_init(void)
{
- dbg(0,"enter\n");
+ dbg(0,"enter");
plugin_register_category_graphics("cocoa", graphics_cocoa_new);
plugin_register_category_event("cocoa", event_cocoa_new);
}
diff --git a/navit/graphics/egl/graphics_egl.c b/navit/graphics/egl/graphics_egl.c
index 4d7780ff4..8a500a00e 100644
--- a/navit/graphics/egl/graphics_egl.c
+++ b/navit/graphics/egl/graphics_egl.c
@@ -492,7 +492,7 @@ image_new(struct graphics_priv *gr, struct graphics_image_methods *meth, char *n
else
{
/* TODO: debug "colour parse errors" on xpm */
- dbg(lvl_error,"image_new on '%s' failed: %s\n", name, IMG_GetError());
+ dbg(lvl_error,"image_new on '%s' failed: %s", name, IMG_GetError());
g_free(gi);
gi = NULL;
g_hash_table_insert(hImageData,
@@ -829,7 +829,7 @@ draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg,
int color = 1;
if (!font) {
- dbg(lvl_error, "no font, returning\n");
+ dbg(lvl_error, "no font, returning");
return;
}
graphics_priv_root->dirty = 1;
diff --git a/navit/graphics/gd/graphics_gd.c b/navit/graphics/gd/graphics_gd.c
index 3ef6c520b..c2d09ae46 100644
--- a/navit/graphics/gd/graphics_gd.c
+++ b/navit/graphics/gd/graphics_gd.c
@@ -511,7 +511,7 @@ draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
if (gr->flags & 2) {
struct shmem_header *next=shm_next(gr);
gr->shm_header->flag=1;
- dbg(lvl_debug,"next flag is %d\n",next->flag);
+ dbg(lvl_debug,"next flag is %d",next->flag);
if (!next->flag) {
gr->shm_header=next;
image_setup(gr);
@@ -526,15 +526,15 @@ draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
while (sockets) {
int fd=socket(PF_INET, SOCK_STREAM, 0);
if (fd < 0) {
- dbg(lvl_error,"socket failed\n");
+ dbg(lvl_error,"socket failed");
} else {
if (connect(fd, (struct sockaddr *)sockets->data, sizeof(struct sockaddr_in)) < 0) {
- dbg(lvl_error,"connect failed\n");
+ dbg(lvl_error,"connect failed");
} else {
size_written=write(fd, data, size);
- dbg(lvl_debug,"size %d vs %d\n",size, size_written);
+ dbg(lvl_debug,"size %d vs %d",size, size_written);
if (shutdown(fd, SHUT_RDWR) < 0)
- dbg(lvl_error,"shutdown failed\n");
+ dbg(lvl_error,"shutdown failed");
}
close(fd);
}
@@ -586,7 +586,7 @@ get_data(struct graphics_priv *this, char *type)
int b;
struct point p;
gdImagePtr im = this->im;
- dbg(lvl_debug,"type=%s\n",type);
+ dbg(lvl_debug,"type=%s",type);
if (!strcmp(type,"window"))
return &this->window;
if (!strcmp(type,"image_png")) {
@@ -608,11 +608,11 @@ get_data(struct graphics_priv *this, char *type)
return &this->image;
}
if (sscanf(type,"click_%d_%d_%d",&p.x,&p.y,&b) == 3) {
- dbg(lvl_debug,"click %d %d %d\n",p.x,p.y,b);
+ dbg(lvl_debug,"click %d %d %d",p.x,p.y,b);
callback_list_call_attr_3(this->cbl, attr_button, (void *)b, (void *)1, (void *)&p);
}
if (sscanf(type,"move_%d_%d",&p.x,&p.y) == 2) {
- dbg(lvl_debug,"move %d %d\n",p.x,p.y);
+ dbg(lvl_debug,"move %d %d",p.x,p.y);
callback_list_call_attr_1(this->cbl, attr_motion, (void *)&p);
}
return NULL;
@@ -629,13 +629,13 @@ image_free(struct graphics_priv *gr, struct graphics_image_priv *priv)
static void
overlay_disable(struct graphics_priv *gr, int disable)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static void
overlay_resize(struct graphics_priv *gr, struct point *p, int w, int h, int wraparound)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
struct shmem_header *
@@ -643,10 +643,10 @@ shm_next(struct graphics_priv *gr)
{
char *next=(char *)gr->shm_header+gr->shmoffset;
if (next+gr->shmoffset > (char *)gr->shm+gr->shmsize) {
- dbg(lvl_debug,"wraparound\n");
+ dbg(lvl_debug,"wraparound");
return gr->shm;
}
- dbg(lvl_debug,"next 0x%x (offset 0x%x)\n",next-(char *)gr->shm,gr->shmoffset);
+ dbg(lvl_debug,"next 0x%x (offset 0x%x)",next-(char *)gr->shm,gr->shmoffset);
return (struct shmem_header *)next;
}
@@ -667,17 +667,17 @@ image_setup(struct graphics_priv *gr)
static void
image_create(struct graphics_priv *gr)
{
- dbg(lvl_debug,"shmkey %d\n",gr->shmkey);
+ dbg(lvl_debug,"shmkey %d",gr->shmkey);
#ifdef HAVE_SHMEM
if (gr->shmkey) {
int size=gr->h*gr->w*sizeof(int);
int shmid=shmget(gr->shmkey, size, 0666);
- dbg(lvl_debug,"shmid for key 0x%x is 0x%x\n",gr->shmkey, shmid);
+ dbg(lvl_debug,"shmid for key 0x%x is 0x%x",gr->shmkey, shmid);
if (shmid < 0)
- dbg(lvl_debug,"shmget\n");
+ dbg(lvl_debug,"shmget");
gr->shm=shmat(shmid, NULL, 0);
if (!gr->shm)
- dbg(lvl_debug,"shmat\n");
+ dbg(lvl_debug,"shmat");
gr->shm_header=gr->shm;
gr->im=g_new0(gdImage,1);
gr->im->tpixels=g_new(int *,gr->h);
@@ -754,7 +754,7 @@ set_attr_do(struct graphics_priv *gr, struct attr *attr, int init)
g_list_free(gr->sockets);
gr->sockets=NULL;
c=s=g_strdup(attr->u.str);
- dbg(lvl_debug,"s=%s\n",s);
+ dbg(lvl_debug,"s=%s",s);
while (c) {
n=strchr(c,',');
if (n)
@@ -768,12 +768,12 @@ set_attr_do(struct graphics_priv *gr, struct attr *attr, int init)
if (inet_aton(c, &sin->sin_addr)) {
gr->sockets=g_list_append(gr->sockets, sin);
} else {
- dbg(lvl_error,"error in %s\n",c);
+ dbg(lvl_error,"error in %s",c);
g_free(sin);
}
- dbg(lvl_debug,"host=%s port=%s\n",c,p);
+ dbg(lvl_debug,"host=%s port=%s",c,p);
} else
- dbg(lvl_error,"error in format: %s\n",p);
+ dbg(lvl_error,"error in format: %s",p);
c=n;
}
g_free(s);
@@ -823,7 +823,7 @@ overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct poin
struct font_priv * (*font_freetype_new)(void *meth);
struct graphics_priv *ret;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
ret=g_new0(struct graphics_priv, 1);
*meth=graphics_methods;
font_freetype_new=plugin_get_category_font("freetype");
diff --git a/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c b/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c
index dbb18310a..0eb147fce 100644
--- a/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c
+++ b/navit/graphics/gtk_drawing_area/graphics_gtk_drawing_area.c
@@ -112,13 +112,13 @@ struct graphics_image_priv {
static void
graphics_destroy(struct graphics_priv *gr)
{
- dbg(lvl_debug,"enter parent %p\n",gr->parent);
+ dbg(lvl_debug,"enter parent %p",gr->parent);
gr->freetype_methods.destroy();
if (!gr->parent) {
- dbg(lvl_debug,"enter win %p\n",gr->win);
+ dbg(lvl_debug,"enter win %p",gr->win);
if (gr->win)
gtk_widget_destroy(gr->win);
- dbg(lvl_debug,"widget %p\n",gr->widget);
+ dbg(lvl_debug,"widget %p",gr->widget);
if (gr->widget)
gtk_widget_destroy(gr->widget);
g_free(gr->window_title);
@@ -401,7 +401,7 @@ draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct graphics
if (! font)
{
- dbg(lvl_error,"no font, returning\n");
+ dbg(lvl_error,"no font, returning");
return;
}
#if 0 /* Temporarily disabled because it destroys text rendering of overlays and in gui internal in some places */
@@ -458,7 +458,7 @@ draw_image_warp(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct po
unsigned char* intermediate_buffer_aligned;
Imlib_Image intermediate_image;
size_t stride;
- dbg(lvl_debug,"draw_image_warp data=%p\n", img);
+ dbg(lvl_debug,"draw_image_warp data=%p", img);
w = img->w;
h = img->h;
if (!img->image) {
@@ -466,7 +466,7 @@ draw_image_warp(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct po
img->image=imlib_create_image(w, h);
imlib_context_set_image(img->image);
if (gdk_pixbuf_get_colorspace(img->pixbuf) != GDK_COLORSPACE_RGB || gdk_pixbuf_get_bits_per_sample(img->pixbuf) != 8) {
- dbg(lvl_error,"implement me\n");
+ dbg(lvl_error,"implement me");
} else if (gdk_pixbuf_get_has_alpha(img->pixbuf) && gdk_pixbuf_get_n_channels(img->pixbuf) == 4) {
for (y=0 ; y < h ; y++) {
unsigned int *dst=imlib_image_get_data()+y*w;
@@ -486,7 +486,7 @@ draw_image_warp(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct po
}
}
} else {
- dbg(lvl_error,"implement me\n");
+ dbg(lvl_error,"implement me");
}
}
@@ -601,7 +601,7 @@ configure(GtkWidget * widget, GdkEventConfigure * event, gpointer user_data)
if (! gra->visible)
return TRUE;
#ifndef _WIN32
- dbg(lvl_debug,"window=%lu\n", GDK_WINDOW_XID(widget->window));
+ dbg(lvl_debug,"window=%lu", GDK_WINDOW_XID(widget->window));
#endif
gra->width=widget->allocation.width;
gra->height=widget->allocation.height;
@@ -750,7 +750,7 @@ static gint
delete(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
{
struct graphics_priv *this=user_data;
- dbg(lvl_debug,"enter this->win=%p\n",this->win);
+ dbg(lvl_debug,"enter this->win=%p",this->win);
if (this->delay & 2) {
if (this->win)
this->win=NULL;
@@ -834,7 +834,7 @@ keypress(GtkWidget *widget, GdkEventKey *event, gpointer user_data)
if (key[0])
callback_list_call_attr_1(this->cbl, attr_keypress, (void *)key);
else
- dbg(lvl_debug,"keyval 0x%x\n", event->keyval);
+ dbg(lvl_debug,"keyval 0x%x", event->keyval);
return FALSE;
}
@@ -916,7 +916,7 @@ get_data_window(struct graphics_priv *this, unsigned int xid)
if (!gtk_widget_get_parent(this->widget))
gtk_widget_ref(this->widget);
gtk_window_set_default_size(GTK_WINDOW(this->win), this->win_w, this->win_h);
- dbg(lvl_debug,"h= %i, w= %i\n",this->win_h, this->win_w);
+ dbg(lvl_debug,"h= %i, w= %i",this->win_h, this->win_w);
gtk_window_set_title(GTK_WINDOW(this->win), this->window_title);
gtk_window_set_wmclass (GTK_WINDOW (this->win), "navit", this->window_title);
gtk_widget_realize(this->win);
@@ -935,7 +935,7 @@ get_data_window(struct graphics_priv *this, unsigned int xid)
static int
set_attr(struct graphics_priv *gr, struct attr *attr)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
switch (attr->type) {
case attr_windowid:
get_data_window(gr, attr->u.num);
@@ -1010,7 +1010,7 @@ graphics_gtk_drawing_area_disable_suspend(struct window *w)
if (gr->pid)
kill(gr->pid, SIGWINCH);
#else
- dbg(lvl_warning, "failed to kill() under Windows\n");
+ dbg(lvl_warning, "failed to kill() under Windows");
#endif
}
@@ -1041,9 +1041,9 @@ get_data(struct graphics_priv *this, char const *type)
int fscanf_result;
fscanf_result = fscanf(f,"%d",&this->pid);
if ((fscanf_result == EOF) || (fscanf_result == 0)){
- dbg(lvl_warning, "Failed to open iPaq sleep file. Error-Code: %d\n" , errno);
+ dbg(lvl_warning, "Failed to open iPaq sleep file. Error-Code: %d" , errno);
}
- dbg(lvl_debug,"ipaq_sleep pid=%d\n", this->pid);
+ dbg(lvl_debug,"ipaq_sleep pid=%d", this->pid);
pclose(f);
}
#endif
diff --git a/navit/graphics/null/graphics_null.c b/navit/graphics/null/graphics_null.c
index ecac7d528..3b527800f 100644
--- a/navit/graphics/null/graphics_null.c
+++ b/navit/graphics/null/graphics_null.c
@@ -257,7 +257,7 @@ graphics_null_new(struct navit *nav, struct graphics_methods *meth, struct attr
event_loop_system = attr_search(attrs, NULL, attr_event_loop_system);
if (event_loop_system && event_loop_system->u.str) {
- dbg(lvl_debug, "event_system is %s\n", event_loop_system->u.str);
+ dbg(lvl_debug, "event_system is %s", event_loop_system->u.str);
if (!event_request_system(event_loop_system->u.str, "graphics_null"))
return NULL;
} else {
@@ -273,7 +273,7 @@ static void
event_null_main_loop_run(void)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
for (;;)
sleep(1);
@@ -281,54 +281,54 @@ event_null_main_loop_run(void)
static void event_null_main_loop_quit(void)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static struct event_watch *
event_null_add_watch(int h, enum event_watch_cond cond, struct callback *cb)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
return NULL;
}
static void
event_null_remove_watch(struct event_watch *ev)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static struct event_timeout *
event_null_add_timeout(int timeout, int multi, struct callback *cb)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
return NULL;
}
static void
event_null_remove_timeout(struct event_timeout *to)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static struct event_idle *
event_null_add_idle(int priority, struct callback *cb)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
return NULL;
}
static void
event_null_remove_idle(struct event_idle *ev)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static void
event_null_call_callback(struct callback_list *cb)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static struct event_methods event_null_methods = {
diff --git a/navit/graphics/opengl/graphics_opengl.c b/navit/graphics/opengl/graphics_opengl.c
index a0c2be2fe..c23d57204 100644
--- a/navit/graphics/opengl/graphics_opengl.c
+++ b/navit/graphics/opengl/graphics_opengl.c
@@ -527,7 +527,7 @@ image_new(struct graphics_priv *gr, struct graphics_image_methods *meth,
return gi;
}
#else
- dbg(lvl_error,"FreeImage not available - cannot load any images.\n");
+ dbg(lvl_error,"FreeImage not available - cannot load any images.");
return NULL;
#endif
}
@@ -748,7 +748,7 @@ getPrimitiveType(GLenum type)
void APIENTRY
tessBeginCB(GLenum which)
{
- dbg(lvl_debug, "glBegin( %s );\n", getPrimitiveType(which));
+ dbg(lvl_debug, "glBegin( %s );", getPrimitiveType(which));
tess_type=which;
tess_count=0;
}
@@ -758,7 +758,7 @@ tessBeginCB(GLenum which)
void APIENTRY
tessEndCB(void)
{
- dbg(lvl_debug, "glEnd();\n");
+ dbg(lvl_debug, "glEnd();");
draw_array(graphics_priv_root, tess_array, tess_count, tess_type);
}
@@ -769,14 +769,14 @@ tessVertexCB(const GLvoid * data)
{
// cast back to double type
const GLdouble *ptr = (const GLdouble *) data;
- dbg(lvl_debug, " glVertex3d();\n");
+ dbg(lvl_debug, " glVertex3d();");
tess_array[tess_count].x=ptr[0];
tess_array[tess_count].y=ptr[1];
if (tess_count < 511)
tess_count++;
else
- dbg(lvl_error,"overflow\n");
+ dbg(lvl_error,"overflow");
}
void APIENTRY
@@ -1031,7 +1031,7 @@ draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg,
int color = 1;
if (!font) {
- dbg(lvl_error, "no font, returning\n");
+ dbg(lvl_error, "no font, returning");
return;
}
@@ -1494,7 +1494,7 @@ static void
click_notify_do(struct graphics_priv *priv, int button, int state, int x, int y)
{
struct point p={x,y};
- dbg(lvl_debug,"enter state %d button %d\n",state,button);
+ dbg(lvl_debug,"enter state %d button %d",state,button);
callback_list_call_attr_3(priv->cbl, attr_button, (void *) state, (void *)button, (void *) &p);
}
#endif
@@ -1738,61 +1738,61 @@ graphics_opengl_new(struct navit *nav, struct graphics_methods *meth,
static void
event_opengl_main_loop_run(void)
{
- dbg(lvl_info, "enter\n");
+ dbg(lvl_info, "enter");
}
static void
event_opengl_main_loop_quit(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
}
static struct event_watch *
event_opengl_add_watch(int fd, enum event_watch_cond cond,
struct callback *cb)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
return NULL;
}
static void
event_opengl_remove_watch(struct event_watch *ev)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
}
static struct event_timeout *
event_opengl_add_timeout(int timeout, int multi, struct callback *cb)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
return NULL;
}
static void
event_opengl_remove_timeout(struct event_timeout *to)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
}
static struct event_idle *
event_opengl_add_idle(int priority, struct callback *cb)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
return NULL;
}
static void
event_opengl_remove_idle(struct event_idle *ev)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
}
static void
event_opengl_call_callback(struct callback_list *cb)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
}
static struct event_methods event_opengl_methods = {
diff --git a/navit/graphics/opengl/graphics_opengl_egl.c b/navit/graphics/opengl/graphics_opengl_egl.c
index cb91ac88e..64e85e700 100644
--- a/navit/graphics/opengl/graphics_opengl_egl.c
+++ b/navit/graphics/opengl/graphics_opengl_egl.c
@@ -61,21 +61,21 @@ graphics_opengl_egl_new(void *display, void *window, struct graphics_opengl_plat
*methods=&graphics_opengl_egl_methods;
ret->egldisplay = eglGetDisplay((EGLNativeDisplayType)display);
if (!ret->egldisplay) {
- dbg(lvl_error, "can't get display\n");
+ dbg(lvl_error, "can't get display");
goto error;
}
if (!eglInitialize(ret->egldisplay, &major, &minor)) {
- dbg(lvl_error, "eglInitialize failed\n");
+ dbg(lvl_error, "eglInitialize failed");
goto error;
}
- dbg(lvl_debug,"eglInitialize ok with version %d.%d\n",major,minor);
+ dbg(lvl_debug,"eglInitialize ok with version %d.%d",major,minor);
eglBindAPI(EGL_OPENGL_ES_API);
if (!eglChooseConfig(ret->egldisplay, attributeList, ret->config, sizeof(ret->config)/sizeof(EGLConfig), &nconfig)) {
- dbg(lvl_error, "eglChooseConfig failed\n");
+ dbg(lvl_error, "eglChooseConfig failed");
goto error;
}
if (nconfig != 1) {
- dbg(lvl_error, "unexpected number of configs %d\n",nconfig);
+ dbg(lvl_error, "unexpected number of configs %d",nconfig);
goto error;
}
ret->eglwindow = eglCreateWindowSurface(ret->egldisplay, ret->config[0], (NativeWindowType) window, NULL);
diff --git a/navit/graphics/opengl/graphics_opengl_x11.c b/navit/graphics/opengl/graphics_opengl_x11.c
index 8f4b02eaf..a52192406 100644
--- a/navit/graphics/opengl/graphics_opengl_x11.c
+++ b/navit/graphics/opengl/graphics_opengl_x11.c
@@ -86,29 +86,29 @@ graphics_opengl_x11_watch(struct graphics_opengl_window_system *x11)
x11->button(x11->data,event.xbutton.button,0,event.xbutton.x,event.xbutton.y);
break;
case ConfigureNotify:
- dbg(lvl_debug,"ConfigureNotify\n");
+ dbg(lvl_debug,"ConfigureNotify");
break;
case Expose:
- dbg(lvl_debug,"Expose\n");
+ dbg(lvl_debug,"Expose");
break;
case KeyPress:
- dbg(lvl_debug,"KeyPress\n");
+ dbg(lvl_debug,"KeyPress");
break;
case KeyRelease:
- dbg(lvl_debug,"KeyRelease\n");
+ dbg(lvl_debug,"KeyRelease");
break;
case MapNotify:
- dbg(lvl_debug,"MapNotify\n");
+ dbg(lvl_debug,"MapNotify");
break;
case MotionNotify:
if (x11->motion)
x11->motion(x11->data,event.xmotion.x,event.xmotion.y);
break;
case ReparentNotify:
- dbg(lvl_debug,"ReparentNotify\n");
+ dbg(lvl_debug,"ReparentNotify");
break;
default:
- dbg(lvl_debug,"type %d\n",event.type);
+ dbg(lvl_debug,"type %d",event.type);
}
}
}
@@ -126,14 +126,14 @@ graphics_opengl_x11_new(void *displayname, int w, int h, int depth, struct graph
*methods=&graphics_opengl_x11_methods;
ret->display=XOpenDisplay(displayname);
if (!ret->display) {
- dbg(lvl_error,"failed to open display\n");
+ dbg(lvl_error,"failed to open display");
goto error;
}
ret->watch=event_add_watch(ConnectionNumber(ret->display), event_watch_cond_read, ret->cb);
ret->screen=XDefaultScreen(ret->display);
ret->root_window=RootWindow(ret->display, ret->screen);
if (!XMatchVisualInfo(ret->display, ret->screen, depth, TrueColor, &ret->visual)) {
- dbg(lvl_error,"failed to find visual\n");
+ dbg(lvl_error,"failed to find visual");
goto error;
}
ret->colormap=XCreateColormap(ret->display, ret->root_window, ret->visual.visual, AllocNone);
diff --git a/navit/graphics/qt5/QNavitQuick.cpp b/navit/graphics/qt5/QNavitQuick.cpp
index 7df3e0073..ffc7a56b0 100644
--- a/navit/graphics/qt5/QNavitQuick.cpp
+++ b/navit/graphics/qt5/QNavitQuick.cpp
@@ -54,7 +54,7 @@ QNavitQuick::QNavitQuick(QQuickItem* parent)
void QNavitQuick::setGraphicContext(GraphicsPriv* gp)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
graphics_priv = gp->gp;
QObject::connect(gp, SIGNAL(update()), this, SLOT(update()));
}
@@ -68,7 +68,7 @@ static void paintOverlays(QPainter* painter, struct graphics_priv* gp, QPaintEve
if (!value->disable) {
QRect rr(value->x, value->y, value->pixmap->width(), value->pixmap->height());
if (event->rect().intersects(rr)) {
- dbg(lvl_debug, "draw overlay (%d, %d, %d, %d)\n", value->x + value->scroll_x, value->y + value->scroll_y, value->pixmap->width(), value->pixmap->height());
+ dbg(lvl_debug, "draw overlay (%d, %d, %d, %d)", value->x + value->scroll_x, value->y + value->scroll_y, value->pixmap->width(), value->pixmap->height());
painter->drawPixmap(value->x, value->y, *value->pixmap);
/* draw overlays of overlay if any by recursive calling */
paintOverlays(painter, value, event);
@@ -81,7 +81,7 @@ void QNavitQuick::paint(QPainter* painter)
{
QPaintEvent event = QPaintEvent(QRect(boundingRect().x(), boundingRect().y(), boundingRect().width(), boundingRect().height()));
- dbg(lvl_debug, "enter (%f, %f, %f, %f)\n", boundingRect().x(), boundingRect().y(), boundingRect().width(), boundingRect().height());
+ dbg(lvl_debug, "enter (%f, %f, %f, %f)", boundingRect().x(), boundingRect().y(), boundingRect().width(), boundingRect().height());
/* color background if any */
if (graphics_priv->background_graphics_gc_priv != NULL) {
@@ -97,7 +97,7 @@ void QNavitQuick::paint(QPainter* painter)
void QNavitQuick::keyPressEvent(QKeyEvent* event)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
char key[2];
int keycode;
char* text = NULL;
@@ -157,21 +157,21 @@ void QNavitQuick::keyPressEvent(QKeyEvent* event)
else if (key[0])
callback_list_call_attr_1(graphics_priv->callbacks, attr_keypress, (void*)key);
else
- dbg(lvl_debug, "keyval 0x%x\n", keycode);
+ dbg(lvl_debug, "keyval 0x%x", keycode);
}
void QNavitQuick::keyReleaseEvent(QKeyEvent* event)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
}
void QNavitQuick::geometryChanged(const QRectF& newGeometry, const QRectF& oldGeometry)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
QQuickPaintedItem::geometryChanged(newGeometry, oldGeometry);
QPainter* painter = NULL;
if (graphics_priv == NULL) {
- dbg(lvl_debug, "Context not set, aborting\n");
+ dbg(lvl_debug, "Context not set, aborting");
return;
}
if (graphics_priv->pixmap != NULL) {
@@ -186,8 +186,8 @@ void QNavitQuick::geometryChanged(const QRectF& newGeometry, const QRectF& oldGe
painter->fillRect(0, 0, width(), height(), brush);
delete painter;
}
- dbg(lvl_debug, "size %fx%f\n", width(), height());
- dbg(lvl_debug, "pixmap %p %dx%d\n", graphics_priv->pixmap, graphics_priv->pixmap->width(), graphics_priv->pixmap->height());
+ dbg(lvl_debug, "size %fx%f", width(), height());
+ dbg(lvl_debug, "pixmap %p %dx%d", graphics_priv->pixmap, graphics_priv->pixmap->width(), graphics_priv->pixmap->height());
/* if the root window got resized, tell navit about it */
if (graphics_priv->root)
resize_callback(graphics_priv, width(), height());
@@ -196,7 +196,7 @@ void QNavitQuick::geometryChanged(const QRectF& newGeometry, const QRectF& oldGe
void QNavitQuick::mouseEvent(int pressed, QMouseEvent* event)
{
struct point p;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
p.x = event->x();
p.y = event->y();
switch (event->button()) {
@@ -216,19 +216,19 @@ void QNavitQuick::mouseEvent(int pressed, QMouseEvent* event)
void QNavitQuick::mousePressEvent(QMouseEvent* event)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
mouseEvent(1, event);
}
void QNavitQuick::mouseReleaseEvent(QMouseEvent* event)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
mouseEvent(0, event);
}
void QNavitQuick::mouseMoveEvent(QMouseEvent* event)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
struct point p;
p.x = event->x();
p.y = event->y();
@@ -239,7 +239,7 @@ void QNavitQuick::wheelEvent(QWheelEvent* event)
{
struct point p;
int button;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
p.x = event->x(); // xy-coordinates of the mouse pointer
p.y = event->y();
diff --git a/navit/graphics/qt5/QNavitWidget.cpp b/navit/graphics/qt5/QNavitWidget.cpp
index 5a5bd303b..df051b557 100644
--- a/navit/graphics/qt5/QNavitWidget.cpp
+++ b/navit/graphics/qt5/QNavitWidget.cpp
@@ -70,7 +70,7 @@ static void paintOverlays(QPainter* painter, struct graphics_priv* gp, QPaintEve
if (!value->disable) {
QRect rr(value->x, value->y, value->pixmap->width(), value->pixmap->height());
if (event->rect().intersects(rr)) {
- dbg(lvl_debug, "draw overlay (%d, %d, %d, %d)\n", value->x + value->scroll_x, value->y + value->scroll_y, value->pixmap->width(), value->pixmap->height());
+ dbg(lvl_debug, "draw overlay (%d, %d, %d, %d)", value->x + value->scroll_x, value->y + value->scroll_y, value->pixmap->width(), value->pixmap->height());
painter->drawPixmap(value->x + value->scroll_x, value->y + value->scroll_y, *value->pixmap);
/* draw overlays of overlay if any by recursive calling */
paintOverlays(painter, value, event);
@@ -81,7 +81,7 @@ static void paintOverlays(QPainter* painter, struct graphics_priv* gp, QPaintEve
void QNavitWidget::paintEvent(QPaintEvent* event)
{
- dbg(lvl_debug, "enter (%d, %d, %d, %d)\n", event->rect().x(), event->rect().y(), event->rect().width(), event->rect().height());
+ dbg(lvl_debug, "enter (%d, %d, %d, %d)", event->rect().x(), event->rect().y(), event->rect().width(), event->rect().height());
QPainter painter(this);
/* color background if any */
if (graphics_priv->background_graphics_gc_priv != NULL) {
@@ -109,8 +109,8 @@ void QNavitWidget::resizeEvent(QResizeEvent* event)
painter->fillRect(0, 0, width(), height(), brush);
delete painter;
}
- dbg(lvl_debug, "size %dx%d\n", width(), height());
- dbg(lvl_debug, "pixmap %p %dx%d\n", graphics_priv->pixmap, graphics_priv->pixmap->width(), graphics_priv->pixmap->height());
+ dbg(lvl_debug, "size %dx%d", width(), height());
+ dbg(lvl_debug, "pixmap %p %dx%d", graphics_priv->pixmap, graphics_priv->pixmap->width(), graphics_priv->pixmap->height());
/* if the root window got resized, tell navit about it */
if (graphics_priv->root)
resize_callback(graphics_priv, width(), height());
@@ -119,7 +119,7 @@ void QNavitWidget::resizeEvent(QResizeEvent* event)
void QNavitWidget::mouseEvent(int pressed, QMouseEvent* event)
{
struct point p;
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
p.x = event->x();
p.y = event->y();
switch (event->button()) {
@@ -139,7 +139,7 @@ void QNavitWidget::mouseEvent(int pressed, QMouseEvent* event)
void QNavitWidget::keyPressEvent(QKeyEvent* event)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
char key[2];
int keycode;
char* text = NULL;
@@ -199,25 +199,25 @@ void QNavitWidget::keyPressEvent(QKeyEvent* event)
else if (key[0])
callback_list_call_attr_1(graphics_priv->callbacks, attr_keypress, (void*)key);
else
- dbg(lvl_debug, "keyval 0x%x\n", keycode);
+ dbg(lvl_debug, "keyval 0x%x", keycode);
}
void QNavitWidget::mousePressEvent(QMouseEvent* event)
{
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
mouseEvent(1, event);
}
void QNavitWidget::mouseReleaseEvent(QMouseEvent* event)
{
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
mouseEvent(0, event);
}
void QNavitWidget::mouseMoveEvent(QMouseEvent* event)
{
struct point p;
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
p.x = event->x();
p.y = event->y();
callback_list_call_attr_1(graphics_priv->callbacks, attr_motion, (void*)&p);
@@ -227,7 +227,7 @@ void QNavitWidget::wheelEvent(QWheelEvent* event)
{
struct point p;
int button;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
p.x = event->x(); // xy-coordinates of the mouse pointer
p.y = event->y();
diff --git a/navit/graphics/qt5/event_qt5.cpp b/navit/graphics/qt5/event_qt5.cpp
index 08fb6e525..e7cb1fd9f 100644
--- a/navit/graphics/qt5/event_qt5.cpp
+++ b/navit/graphics/qt5/event_qt5.cpp
@@ -63,7 +63,7 @@ qt5_navit_timer::qt5_navit_timer(QObject* parent)
timer_type = g_hash_table_new(NULL, NULL);
timer_callback = g_hash_table_new(NULL, NULL);
watches = g_hash_table_new(NULL, NULL);
- dbg(lvl_debug, "qt5_navit_timer object created\n");
+ dbg(lvl_debug, "qt5_navit_timer object created");
}
void qt5_navit_timer::watchEvent(int id)
@@ -71,7 +71,7 @@ void qt5_navit_timer::watchEvent(int id)
struct event_watch* ret = g_new0(struct event_watch, 1);
ret = (struct event_watch*)g_hash_table_lookup(watches, (void*)(long)id);
if (ret) {
- dbg(lvl_debug, "callback found, calling it\n");
+ dbg(lvl_debug, "callback found, calling it");
callback_call_0(ret->cb);
}
}
@@ -80,7 +80,7 @@ void qt5_navit_timer::timerEvent(QTimerEvent* event)
{
int id = event->timerId();
void* multi = NULL;
- // dbg(lvl_debug, "TimerEvent (%d)\n", id);
+ // dbg(lvl_debug, "TimerEvent (%d)", id);
struct callback* cb = (struct callback*)g_hash_table_lookup(timer_callback, (void*)(long)id);
if (cb)
callback_call_0(cb);
@@ -90,7 +90,7 @@ void qt5_navit_timer::timerEvent(QTimerEvent* event)
if (((int)(long)multi) == 0)
event_qt5_remove_timeout((struct event_timeout*)(long)id);
}
- // dbg(lvl_debug, "TimerEvent (%d) leave\n", id);
+ // dbg(lvl_debug, "TimerEvent (%d) leave", id);
}
qt5_navit_timer* qt5_timer = NULL;
@@ -99,21 +99,21 @@ static void
event_qt5_main_loop_run(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
if (navit_app != NULL)
navit_app->exec();
}
static void event_qt5_main_loop_quit(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
exit(0);
}
static struct event_watch*
event_qt5_add_watch(int fd, enum event_watch_cond cond, struct callback* cb)
{
- dbg(lvl_debug, "enter fd=%d\n", (int)(long)fd);
+ dbg(lvl_debug, "enter fd=%d", (int)(long)fd);
struct event_watch* ret = g_new0(struct event_watch, 1);
ret->fd = fd;
ret->cb = cb;
@@ -126,7 +126,7 @@ event_qt5_add_watch(int fd, enum event_watch_cond cond, struct callback* cb)
static void
event_qt5_remove_watch(struct event_watch* ev)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
g_hash_table_remove(qt5_timer->watches, GINT_TO_POINTER(ev->fd));
delete (ev->sn);
g_free(ev);
@@ -138,7 +138,7 @@ event_qt5_add_timeout(int timeout, int multi, struct callback* cb)
int id;
dbg(lvl_debug, "add timeout %d, mul %d, %p ==", timeout, multi, cb);
id = qt5_timer->startTimer(timeout);
- dbg(lvl_debug, "%d\n", id);
+ dbg(lvl_debug, "%d", id);
g_hash_table_insert(qt5_timer->timer_callback, (void*)(long)id, cb);
g_hash_table_insert(qt5_timer->timer_type, (void*)(long)id, (void*)(long)!!multi);
return (struct event_timeout*)(long)id;
@@ -147,7 +147,7 @@ event_qt5_add_timeout(int timeout, int multi, struct callback* cb)
static void
event_qt5_remove_timeout(struct event_timeout* to)
{
- dbg(lvl_debug, "remove timeout (%d)\n", (int)(long)to);
+ dbg(lvl_debug, "remove timeout (%d)", (int)(long)to);
qt5_timer->killTimer((int)(long)to);
g_hash_table_remove(qt5_timer->timer_callback, to);
g_hash_table_remove(qt5_timer->timer_type, to);
@@ -156,21 +156,21 @@ event_qt5_remove_timeout(struct event_timeout* to)
static struct event_idle*
event_qt5_add_idle(int priority, struct callback* cb)
{
- dbg(lvl_debug, "add idle event\n");
+ dbg(lvl_debug, "add idle event");
return (struct event_idle*)event_qt5_add_timeout(0, 1, cb);
}
static void
event_qt5_remove_idle(struct event_idle* ev)
{
- dbg(lvl_debug, "Remove idle timeout\n");
+ dbg(lvl_debug, "Remove idle timeout");
event_qt5_remove_timeout((struct event_timeout*)ev);
}
static void
event_qt5_call_callback(struct callback_list* cb)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
}
static struct event_methods event_qt5_methods = {
diff --git a/navit/graphics/qt5/graphics_qt5.cpp b/navit/graphics/qt5/graphics_qt5.cpp
index f7ac15f43..f142758ea 100644
--- a/navit/graphics/qt5/graphics_qt5.cpp
+++ b/navit/graphics/qt5/graphics_qt5.cpp
@@ -92,7 +92,7 @@ struct graphics_image_priv {
static void
graphics_destroy(struct graphics_priv* gr)
{
-// dbg(lvl_debug,"enter\n");
+// dbg(lvl_debug,"enter");
#if HAVE_FREETYPE
gr->freetype_methods.destroy();
#endif
@@ -146,7 +146,7 @@ graphics_destroy(struct graphics_priv* gr)
static void font_destroy(struct graphics_font_priv* font)
{
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
if (font->font != NULL)
delete (font->font);
g_free(font);
@@ -190,7 +190,7 @@ static struct graphics_font_priv* font_new(struct graphics_priv* gr, struct grap
{
int a = 0;
struct graphics_font_priv* font_priv;
- dbg(lvl_debug, "enter (font %s, %d, 0x%x)\n", font, size, flags);
+ dbg(lvl_debug, "enter (font %s, %d, 0x%x)", font, size, flags);
font_priv = g_new0(struct graphics_font_priv, 1);
font_priv->font = new QFont(fontfamilies[0]);
if (font != NULL)
@@ -201,7 +201,7 @@ static struct graphics_font_priv* font_new(struct graphics_priv* gr, struct grap
a++;
}
if (font_priv->font->exactMatch()) {
- dbg(lvl_debug, "Exactly matching font: %s\n", font_priv->font->family().toUtf8().data());
+ dbg(lvl_debug, "Exactly matching font: %s", font_priv->font->family().toUtf8().data());
} else {
/* set any font*/
if (font != NULL) {
@@ -209,7 +209,7 @@ static struct graphics_font_priv* font_new(struct graphics_priv* gr, struct grap
} else {
font_priv->font->setFamily(fontfamilies[0]);
}
- dbg(lvl_debug, "No matching font. Resort to: %s\n", font_priv->font->family().toUtf8().data());
+ dbg(lvl_debug, "No matching font. Resort to: %s", font_priv->font->family().toUtf8().data());
}
/* No clue why factor 20. Found this by comparing to Freetype rendering. */
@@ -227,7 +227,7 @@ static struct graphics_font_priv* font_new(struct graphics_priv* gr, struct grap
static void
gc_destroy(struct graphics_gc_priv* gc)
{
- // dbg(lvl_debug,"enter gc=%p\n", gc);
+ // dbg(lvl_debug,"enter gc=%p", gc);
delete (gc->pen);
delete (gc->brush);
g_free(gc);
@@ -236,7 +236,7 @@ gc_destroy(struct graphics_gc_priv* gc)
static void
gc_set_linewidth(struct graphics_gc_priv* gc, int w)
{
- // dbg(lvl_debug,"enter gc=%p, %d\n", gc, w);
+ // dbg(lvl_debug,"enter gc=%p, %d", gc, w);
gc->pen->setWidth(w);
}
@@ -266,7 +266,7 @@ static void
gc_set_foreground(struct graphics_gc_priv* gc, struct color* c)
{
QColor col(c->r >> 8, c->g >> 8, c->b >> 8, c->a >> 8);
- // dbg(lvl_debug,"context %p: color %02x%02x%02x\n",gc, c->r >> 8, c->g >> 8, c->b >> 8);
+ // dbg(lvl_debug,"context %p: color %02x%02x%02x",gc, c->r >> 8, c->g >> 8, c->b >> 8);
gc->pen->setColor(col);
gc->brush->setColor(col);
//gc->c=*c;
@@ -276,7 +276,7 @@ static void
gc_set_background(struct graphics_gc_priv* gc, struct color* c)
{
QColor col(c->r >> 8, c->g >> 8, c->b >> 8, c->a >> 8);
- // dbg(lvl_debug,"context %p: color %02x%02x%02x\n",gc, c->r >> 8, c->g >> 8, c->b >> 8);
+ // dbg(lvl_debug,"context %p: color %02x%02x%02x",gc, c->r >> 8, c->g >> 8, c->b >> 8);
//gc->pen->setColor(col);
//gc->brush->setColor(col);
}
@@ -292,7 +292,7 @@ static struct graphics_gc_methods gc_methods = {
static struct graphics_gc_priv* gc_new(struct graphics_priv* gr, struct graphics_gc_methods* meth)
{
struct graphics_gc_priv* graphics_gc_priv = NULL;
- // dbg(lvl_debug,"enter gr==%p\n", gr);
+ // dbg(lvl_debug,"enter gr==%p", gr);
graphics_gc_priv = g_new0(struct graphics_gc_priv, 1);
graphics_gc_priv->graphics_priv = gr;
graphics_gc_priv->pen = new QPen();
@@ -304,7 +304,7 @@ static struct graphics_gc_priv* gc_new(struct graphics_priv* gr, struct graphics
static void image_destroy(struct graphics_image_priv* img)
{
- // dbg(lvl_debug, "enter\n");
+ // dbg(lvl_debug, "enter");
if (img->pixmap != NULL)
delete (img->pixmap);
g_free(img);
@@ -318,9 +318,9 @@ static struct graphics_image_priv*
image_new(struct graphics_priv* gr, struct graphics_image_methods* meth, char* path, int* w, int* h, struct point* hot, int rotation)
{
struct graphics_image_priv* image_priv;
- // dbg(lvl_debug,"enter %s, %d %d\n", path, *w, *h);
+ // dbg(lvl_debug,"enter %s, %d %d", path, *w, *h);
if (path[0] == 0) {
- dbg(lvl_debug, "Refuse to load image without path\n");
+ dbg(lvl_debug, "Refuse to load image without path");
return NULL;
}
QString key(path);
@@ -333,11 +333,11 @@ image_new(struct graphics_priv* gr, struct graphics_image_methods* meth, char* p
*/
if (extension != "") {
/*file doesn't exist. give up */
- dbg(lvl_debug, "File %s does not exist\n", path);
+ dbg(lvl_debug, "File %s does not exist", path);
return NULL;
} else {
/* add ".svg" for renderer to try .svg file first in renderer */
- dbg(lvl_debug, "Guess extension on %s\n", path);
+ dbg(lvl_debug, "Guess extension on %s", path);
renderer_key += ".svg";
}
}
@@ -348,7 +348,7 @@ image_new(struct graphics_priv* gr, struct graphics_image_methods* meth, char* p
if (renderer_key.endsWith("svg")) {
QSvgRenderer renderer(renderer_key);
if (renderer.isValid()) {
- dbg(lvl_debug, "render %s\n", path);
+ dbg(lvl_debug, "render %s", path);
/* try to render this */
/* assume "standard" size if size is not given */
if (*w <= 0)
@@ -364,7 +364,7 @@ image_new(struct graphics_priv* gr, struct graphics_image_methods* meth, char* p
if (image_priv->pixmap == NULL) {
/*cannot be rendered. try to load it */
- dbg(lvl_debug, "cannot render %s\n", path);
+ dbg(lvl_debug, "cannot render %s", path);
image_priv->pixmap = new QPixmap(key);
}
@@ -376,7 +376,7 @@ image_new(struct graphics_priv* gr, struct graphics_image_methods* meth, char* p
/* check if we need to scale this */
if ((*w > 0) && (*h > 0)) {
if ((image_priv->pixmap->width() != *w) || (image_priv->pixmap->height() != *h)) {
- dbg(lvl_debug, "scale pixmap %s, %d->%d,%d->%d\n", path, image_priv->pixmap->width(), *w, image_priv->pixmap->height(), *h);
+ dbg(lvl_debug, "scale pixmap %s, %d->%d,%d->%d", path, image_priv->pixmap->width(), *w, image_priv->pixmap->height(), *h);
QPixmap* scaled = new QPixmap(image_priv->pixmap->scaled(*w, *h, Qt::IgnoreAspectRatio, Qt::FastTransformation));
delete (image_priv->pixmap);
image_priv->pixmap = scaled;
@@ -386,7 +386,7 @@ image_new(struct graphics_priv* gr, struct graphics_image_methods* meth, char* p
*w = image_priv->pixmap->width();
*h = image_priv->pixmap->height();
- // dbg(lvl_debug, "Got (%d,%d)\n", *w,*h);
+ // dbg(lvl_debug, "Got (%d,%d)", *w,*h);
if (hot) {
hot->x = *w / 2;
hot->y = *h / 2;
@@ -400,7 +400,7 @@ draw_lines(struct graphics_priv* gr, struct graphics_gc_priv* gc, struct point*
{
int i;
QPolygon polygon;
- // dbg(lvl_debug,"enter gr=%p, gc=%p, (%d, %d)\n", gr, gc, p->x, p->y);
+ // dbg(lvl_debug,"enter gr=%p, gc=%p, (%d, %d)", gr, gc, p->x, p->y);
if (gr->painter == NULL)
return;
@@ -415,7 +415,7 @@ draw_polygon(struct graphics_priv* gr, struct graphics_gc_priv* gc, struct point
{
int i;
QPolygon polygon;
- // dbg(lvl_debug,"enter gr=%p, gc=%p, (%d, %d)\n", gr, gc, p->x, p->y);
+ // dbg(lvl_debug,"enter gr=%p, gc=%p, (%d, %d)", gr, gc, p->x, p->y);
if (gr->painter == NULL)
return;
@@ -436,7 +436,7 @@ draw_polygon(struct graphics_priv* gr, struct graphics_gc_priv* gc, struct point
static void
draw_rectangle(struct graphics_priv* gr, struct graphics_gc_priv* gc, struct point* p, int w, int h)
{
- // dbg(lvl_debug,"gr=%p gc=%p %d,%d,%d,%d\n", gr, gc, p->x, p->y, w, h);
+ // dbg(lvl_debug,"gr=%p gc=%p %d,%d,%d,%d", gr, gc, p->x, p->y, w, h);
if (gr->painter == NULL)
return;
/* if the rectangle is transparent, we need to clear it first */
@@ -452,7 +452,7 @@ draw_rectangle(struct graphics_priv* gr, struct graphics_gc_priv* gc, struct poi
static void
draw_circle(struct graphics_priv* gr, struct graphics_gc_priv* gc, struct point* p, int r)
{
- // dbg(lvl_debug,"enter gr=%p, gc=%p, (%d,%d) r=%d\n", gr, gc, p->x, p->y, r);
+ // dbg(lvl_debug,"enter gr=%p, gc=%p, (%d,%d) r=%d", gr, gc, p->x, p->y, r);
if (gr->painter == NULL)
return;
gr->painter->setPen(*gc->pen);
@@ -475,7 +475,7 @@ draw_circle(struct graphics_priv* gr, struct graphics_gc_priv* gc, struct point*
static void
draw_text(struct graphics_priv* gr, struct graphics_gc_priv* fg, struct graphics_gc_priv* bg, struct graphics_font_priv* font, char* text, struct point* p, int dx, int dy)
{
- dbg(lvl_debug, "enter gc=%p, fg=%p, bg=%p pos(%d,%d) d(%d, %d) %s\n", gr, fg, bg, p->x, p->y, dx, dy, text);
+ dbg(lvl_debug, "enter gc=%p, fg=%p, bg=%p pos(%d,%d) d(%d, %d) %s", gr, fg, bg, p->x, p->y, dx, dy, text);
QPainter* painter = gr->painter;
if (painter == NULL)
return;
@@ -568,11 +568,11 @@ draw_text(struct graphics_priv* gr, struct graphics_gc_priv* fg, struct graphics
static void
draw_image(struct graphics_priv* gr, struct graphics_gc_priv* fg, struct point* p, struct graphics_image_priv* img)
{
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
if (gr->painter != NULL)
gr->painter->drawPixmap(p->x, p->y, *img->pixmap);
else
- dbg(lvl_debug, "Try to draw image, but no painter\n");
+ dbg(lvl_debug, "Try to draw image, but no painter");
}
/**
@@ -589,10 +589,10 @@ static void draw_drag(struct graphics_priv* gr, struct point* p)
struct point vector;
if (p != NULL) {
- dbg(lvl_debug, "enter %p (%d,%d)\n", gr, p->x, p->y);
+ dbg(lvl_debug, "enter %p (%d,%d)", gr, p->x, p->y);
vector = *p;
} else {
- dbg(lvl_debug, "enter %p (NULL)\n", gr);
+ dbg(lvl_debug, "enter %p (NULL)", gr);
vector.x = 0;
vector.y = 0;
}
@@ -624,7 +624,7 @@ static void draw_drag(struct graphics_priv* gr, struct point* p)
static void
background_gc(struct graphics_priv* gr, struct graphics_gc_priv* gc)
{
- // dbg(lvl_debug,"register context %p on %p\n", gc, gr);
+ // dbg(lvl_debug,"register context %p on %p", gc, gr);
gr->background_graphics_gc_priv = gc;
}
@@ -633,26 +633,26 @@ draw_mode(struct graphics_priv* gr, enum draw_mode_num mode)
{
switch (mode) {
case draw_mode_begin:
- dbg(lvl_debug, "Begin drawing on context %p (use == %d)\n", gr, gr->use_count);
+ dbg(lvl_debug, "Begin drawing on context %p (use == %d)", gr, gr->use_count);
gr->use_count++;
if (gr->painter == NULL)
gr->painter = new QPainter(gr->pixmap);
else
- dbg(lvl_debug, "drawing on %p already active\n", gr);
+ dbg(lvl_debug, "drawing on %p already active", gr);
break;
case draw_mode_end:
- dbg(lvl_debug, "End drawing on context %p (use == %d)\n", gr, gr->use_count);
+ dbg(lvl_debug, "End drawing on context %p (use == %d)", gr, gr->use_count);
gr->use_count--;
if (gr->use_count < 0)
gr->use_count = 0;
if (gr->use_count > 0) {
- dbg(lvl_debug, "drawing on %p still in use\n", gr);
+ dbg(lvl_debug, "drawing on %p still in use", gr);
} else if (gr->painter != NULL) {
gr->painter->end();
delete (gr->painter);
gr->painter = NULL;
} else {
- dbg(lvl_debug, "Context %p not active!\n", gr)
+ dbg(lvl_debug, "Context %p not active!", gr)
}
#if USE_QWIDGET
/* call repaint on widget */
@@ -667,7 +667,7 @@ draw_mode(struct graphics_priv* gr, enum draw_mode_num mode)
break;
default:
- dbg(lvl_debug, "Unknown drawing %d on context %p\n", mode, gr);
+ dbg(lvl_debug, "Unknown drawing %d on context %p", mode, gr);
break;
}
}
@@ -676,7 +676,7 @@ static struct graphics_priv* overlay_new(struct graphics_priv* gr, struct graphi
void resize_callback(struct graphics_priv* gr, int w, int h)
{
- // dbg(lvl_debug,"enter (%d, %d)\n", w, h);
+ // dbg(lvl_debug,"enter (%d, %d)", w, h);
callback_list_call_attr_2(gr->callbacks, attr_resize,
GINT_TO_POINTER(w), GINT_TO_POINTER(h));
}
@@ -685,7 +685,7 @@ static int
graphics_qt5_fullscreen(struct window* w, int on)
{
struct graphics_priv* gr;
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
gr = (struct graphics_priv*)w->priv;
#if USE_QML
if (gr->window != NULL) {
@@ -710,7 +710,7 @@ graphics_qt5_fullscreen(struct window* w, int on)
static void
keep_display_on(struct graphics_priv* priv)
{
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
QDBusConnection system = QDBusConnection::connectToBus(QDBusConnection::SystemBus, "system");
QDBusInterface interface("com.nokia.mce", "/com/nokia/mce/request", "com.nokia.mce.request", system);
@@ -721,7 +721,7 @@ keep_display_on(struct graphics_priv* priv)
static void
graphics_qt5_disable_suspend(struct window* w)
{
-// dbg(lvl_debug,"enter\n");
+// dbg(lvl_debug,"enter");
#ifdef SAILFISH_OS
struct graphics_priv* gr;
gr = (struct graphics_priv*)w->priv;
@@ -736,10 +736,10 @@ graphics_qt5_disable_suspend(struct window* w)
static void*
get_data(struct graphics_priv* this_priv, char const* type)
{
- // dbg(lvl_debug,"enter: %s\n", type);
+ // dbg(lvl_debug,"enter: %s", type);
if (strcmp(type, "window") == 0) {
struct window* win;
- // dbg(lvl_debug,"window detected\n");
+ // dbg(lvl_debug,"window detected");
win = g_new0(struct window, 1);
win->priv = this_priv;
win->fullscreen = graphics_qt5_fullscreen;
@@ -748,7 +748,7 @@ get_data(struct graphics_priv* this_priv, char const* type)
return win;
}
if (strcmp(type, "engine") == 0) {
- dbg(lvl_debug, "Hand over QQmlApplicationEngine\n");
+ dbg(lvl_debug, "Hand over QQmlApplicationEngine");
return (this_priv->engine);
}
return NULL;
@@ -756,7 +756,7 @@ get_data(struct graphics_priv* this_priv, char const* type)
static void image_free(struct graphics_priv* gr, struct graphics_image_priv* priv)
{
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
delete (priv->pixmap);
g_free(priv);
}
@@ -779,7 +779,7 @@ static void get_text_bbox(struct graphics_priv* gr, struct graphics_font_priv* f
struct point pt;
QString tmp = QString::fromUtf8(text);
QRect r;
- // dbg(lvl_debug,"enter %s %d %d\n", text, dx, dy);
+ // dbg(lvl_debug,"enter %s %d %d", text, dx, dy);
/* use QFontMetrix for bbox calculation as we do not always have a painter */
QFontMetrics fm(*font->font);
@@ -811,7 +811,7 @@ static void overlay_disable(struct graphics_priv* gr, int disable)
{
GHashTableIter iter;
struct graphics_priv *key, *value;
- // dbg(lvl_debug,"enter gr=%p, %d\n", gr, disable);
+ // dbg(lvl_debug,"enter gr=%p, %d", gr, disable);
g_hash_table_iter_init(&iter, gr->overlays);
while (g_hash_table_iter_next(&iter, (void**)&key, (void**)&value)) {
@@ -822,7 +822,7 @@ static void overlay_disable(struct graphics_priv* gr, int disable)
static void overlay_resize(struct graphics_priv* gr, struct point* p, int w, int h, int wraparound)
{
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
gr->x = p->x;
gr->y = p->y;
if (gr->painter != NULL) {
@@ -897,7 +897,7 @@ overlay_new(struct graphics_priv* gr, struct graphics_methods* meth, struct poin
graphics_priv->argv[0] = NULL;
/* register on parent */
g_hash_table_insert(gr->overlays, graphics_priv, graphics_priv);
- // dbg(lvl_debug,"New overlay: %p\n", graphics_priv);
+ // dbg(lvl_debug,"New overlay: %p", graphics_priv);
return graphics_priv;
}
@@ -914,7 +914,7 @@ graphics_qt5_new(struct navit* nav, struct graphics_methods* meth, struct attr**
bool use_qml = USE_QML;
bool use_qwidget = USE_QWIDGET;
- //dbg(lvl_debug,"enter\n");
+ //dbg(lvl_debug,"enter");
/* get qt widget attr */
if ((attr_widget = attr_search(attrs, NULL, attr_qt5_widget))) {
@@ -938,7 +938,7 @@ graphics_qt5_new(struct navit* nav, struct graphics_methods* meth, struct attr**
/* get event loop from config and request event loop*/
event_loop_system = attr_search(attrs, NULL, attr_event_loop_system);
if (event_loop_system && event_loop_system->u.str) {
- //dbg(lvl_debug, "event_system is %s\n", event_loop_system->u.str);
+ //dbg(lvl_debug, "event_system is %s", event_loop_system->u.str);
if (!event_request_system(event_loop_system->u.str, "graphics_qt5"))
return NULL;
} else {
@@ -952,7 +952,7 @@ graphics_qt5_new(struct navit* nav, struct graphics_methods* meth, struct attr**
/* get font plugin if present */
font_freetype_new = (struct font_priv * (*)(void*))plugin_get_category_font("freetype");
if (!font_freetype_new) {
- dbg(lvl_error, "no freetype\n");
+ dbg(lvl_error, "no freetype");
return NULL;
}
#endif
@@ -1101,7 +1101,7 @@ void plugin_init(void)
#if USE_QML
Q_INIT_RESOURCE(graphics_qt5);
#endif
- // dbg(lvl_debug,"enter\n");
+ // dbg(lvl_debug,"enter");
plugin_register_category_graphics("qt5", graphics_qt5_new);
qt5_event_init();
}
diff --git a/navit/graphics/qt_qpainter/RenderArea.cpp b/navit/graphics/qt_qpainter/RenderArea.cpp
index 1159082ed..4a20b1d54 100644
--- a/navit/graphics/qt_qpainter/RenderArea.cpp
+++ b/navit/graphics/qt_qpainter/RenderArea.cpp
@@ -86,7 +86,7 @@ bool RenderArea::event(QEvent *event)
{
#if QT_VERSION >= 0x040700
if (event->type() == QEvent::Gesture) {
- dbg(lvl_debug,"gesture\n");
+ dbg(lvl_debug,"gesture");
return true;
}
#endif
@@ -123,8 +123,8 @@ void RenderArea::do_resize(QSize size)
QPainter painter(pixmap);
QBrush brush;
painter.fillRect(0, 0, size.width(), size.height(), brush);
- dbg(lvl_debug,"size %dx%d\n", size.width(), size.height());
- dbg(lvl_debug,"pixmap %p %dx%d\n", pixmap, pixmap->width(), pixmap->height());
+ dbg(lvl_debug,"size %dx%d", size.width(), size.height());
+ dbg(lvl_debug,"pixmap %p %dx%d", pixmap, pixmap->width(), pixmap->height());
callback_list_call_attr_2(this->cbl, attr_resize, GINT_TO_POINTER(size.width()), GINT_TO_POINTER(size.height()));
}
@@ -223,9 +223,9 @@ void RenderArea::keyPressEvent(QKeyEvent *event)
{
QString str=event->text();
const char *text=str.toUtf8().constData();
- dbg(lvl_debug,"enter text='%s' 0x%x (%zu) key=%d\n", text, text[0], strlen(text), event->key());
+ dbg(lvl_debug,"enter text='%s' 0x%x (%zu) key=%d", text, text[0], strlen(text), event->key());
if (!text || !text[0] || text[0] == 0x7f) {
- dbg(lvl_debug,"special key\n");
+ dbg(lvl_debug,"special key");
switch (event->key()) {
case 4099:
{
@@ -288,7 +288,7 @@ void RenderArea::watchEvent(int fd)
{
#ifdef QT_QPAINTER_USE_EVENT_QT
struct event_watch *ev=(struct event_watch *)g_hash_table_lookup(watches, (void *)fd);
- dbg(lvl_debug,"fd=%d ev=%p cb=%p\n", fd, ev, ev->cb);
+ dbg(lvl_debug,"fd=%d ev=%p cb=%p", fd, ev, ev->cb);
callback_call_0(ev->cb);
#endif
}
diff --git a/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp b/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp
index 65163ea9d..4fd4f46f6 100644
--- a/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp
+++ b/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp
@@ -65,7 +65,7 @@ qt_qpainter_draw(struct graphics_priv *gr, const QRect *r, int paintev)
{
if (!paintev) {
#ifndef QT_QPAINTER_NO_WIDGET
- dbg(lvl_debug,"update %d,%d %d x %d\n", r->x(), r->y(), r->width(), r->height());
+ dbg(lvl_debug,"update %d,%d %d x %d", r->x(), r->y(), r->width(), r->height());
if (r->x() <= -r->width())
return;
if (r->y() <= -r->height())
@@ -74,7 +74,7 @@ qt_qpainter_draw(struct graphics_priv *gr, const QRect *r, int paintev)
return;
if (r->y() > gr->widget->pixmap->height())
return;
- dbg(lvl_debug,"update valid %d,%d %dx%d\n", r->x(), r->y(), r->width(), r->height());
+ dbg(lvl_debug,"update valid %d,%d %dx%d", r->x(), r->y(), r->width(), r->height());
gr->widget->update(*r);
#endif
return;
@@ -359,7 +359,7 @@ static void draw_polygon(struct graphics_priv *gr, struct graphics_gc_priv *gc,
//##############################################################################################################
static void draw_rectangle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *p, int w, int h)
{
- dbg(lvl_debug,"gr=%p gc=%p %d,%d,%d,%d\n", gr, gc, p->x, p->y, w, h);
+ dbg(lvl_debug,"gr=%p gc=%p %d,%d,%d,%d", gr, gc, p->x, p->y, w, h);
gr->painter->fillRect(p->x,p->y, w, h, *gc->brush);
}
@@ -496,7 +496,7 @@ static void background_gc(struct graphics_priv *gr, struct graphics_gc_priv *gc)
//##############################################################################################################
static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
{
- dbg(lvl_debug,"mode for %p %d\n", gr, mode);
+ dbg(lvl_debug,"mode for %p %d", gr, mode);
QRect r;
if (mode == draw_mode_begin) {
if (gr->widget->pixmap->paintingActive()) {
@@ -574,7 +574,7 @@ static void * get_data(struct graphics_priv *this_, const char *type)
bool ok;
if (!strcmp(type, "resize")) {
- dbg(lvl_debug,"resize %d %d\n",this_->w,this_->h);
+ dbg(lvl_debug,"resize %d %d",this_->w,this_->h);
QSize size(this_->w,this_->h);
this_->widget->do_resize(size);
}
@@ -743,14 +743,14 @@ event_qt_main_loop_run(void)
static void event_qt_main_loop_quit(void)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
exit(0);
}
static struct event_watch *
event_qt_add_watch(int fd, enum event_watch_cond cond, struct callback *cb)
{
- dbg(lvl_debug,"enter fd=%d\n",(int)(long)fd);
+ dbg(lvl_debug,"enter fd=%d",(int)(long)fd);
struct event_watch *ret=g_new0(struct event_watch, 1);
ret->fd=fd;
ret->cb=cb;
@@ -790,21 +790,21 @@ event_qt_remove_timeout(struct event_timeout *ev)
static struct event_idle *
event_qt_add_idle(int priority, struct callback *cb)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
return (struct event_idle *)event_qt_add_timeout(0, 1, cb);
}
static void
event_qt_remove_idle(struct event_idle *ev)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
event_qt_remove_timeout((struct event_timeout *) ev);
}
static void
event_qt_call_callback(struct callback_list *cb)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static struct event_methods event_qt_methods = {
@@ -825,7 +825,7 @@ struct event_priv {
struct event_priv *
event_qt_new(struct event_methods *meth)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
*meth=event_qt_methods;
return NULL;
}
@@ -842,7 +842,7 @@ static struct graphics_priv * graphics_qt_qpainter_new(struct navit *nav, struct
struct font_priv * (*font_freetype_new)(void *meth);
struct attr *attr;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
#ifdef QT_QPAINTER_USE_EVENT_QT
if (event_gr)
return NULL;
@@ -856,7 +856,7 @@ static struct graphics_priv * graphics_qt_qpainter_new(struct navit *nav, struct
#ifdef QT_QPAINTER_USE_FREETYPE
font_freetype_new=(struct font_priv *(*)(void *))plugin_get_category_font("freetype");
if (!font_freetype_new) {
- dbg(lvl_error,"no freetype\n");
+ dbg(lvl_error,"no freetype");
return NULL;
}
#endif
@@ -909,7 +909,7 @@ static struct graphics_priv * graphics_qt_qpainter_new(struct navit *nav, struct
else
ret->window_title=g_strdup("Navit");
- dbg(lvl_debug,"return\n");
+ dbg(lvl_debug,"return");
return ret;
}
diff --git a/navit/graphics/sdl/event.c b/navit/graphics/sdl/event.c
index f96b079b3..647330813 100644
--- a/navit/graphics/sdl/event.c
+++ b/navit/graphics/sdl/event.c
@@ -48,7 +48,7 @@ static void sdl_accelerometer_handler(void* param) {
int zAxis = SDL_JoystickGetAxis(accelerometer, 2);
unsigned char new_orientation;
- dbg(lvl_info, "x(%d) y(%d) z(%d) c(%d)\n", xAxis, yAxis, zAxis,
+ dbg(lvl_info, "x(%d) y(%d) z(%d) c(%d)", xAxis, yAxis, zAxis,
sdl_orientation_count);
if (zAxis > -30000) {
@@ -74,7 +74,7 @@ static void sdl_accelerometer_handler(void* param) {
sdl_orientation_count++;
if (new_orientation != orientation) {
- dbg(lvl_debug, "x(%d) y(%d) z(%d) o(%d)\n", xAxis, yAxis, zAxis,
+ dbg(lvl_debug, "x(%d) y(%d) z(%d) o(%d)", xAxis, yAxis, zAxis,
new_orientation);
orientation = new_orientation;
@@ -100,7 +100,7 @@ static void sdl_accelerometer_handler(void* param) {
static Uint32 sdl_timer_callback(Uint32 interval, void* param) {
struct event_timeout *timeout = (struct event_timeout*) param;
- dbg(lvl_debug, "timer(%p) multi(%d) interval(%d) fired\n", param, timeout->multi,
+ dbg(lvl_debug, "timer(%p) multi(%d) interval(%d) fired", param, timeout->multi,
interval);
SDL_Event event;
@@ -169,7 +169,7 @@ static void event_sdl_watch_thread(GPtrArray *watch_list) {
for (idx = 0; idx < watch_list->len; idx++) {
if (pfds[idx].revents == pfds[idx].events) { /* The requested event happened, notify mainloop! */
ew = g_ptr_array_index(watch_list, idx);
- dbg(lvl_debug, "watch(%p) event(%d) encountered\n", ew,
+ dbg(lvl_debug, "watch(%p) event(%d) encountered", ew,
pfds[idx].revents);
SDL_Event event;
@@ -194,7 +194,7 @@ static void event_sdl_watch_thread(GPtrArray *watch_list) {
}
static void event_sdl_watch_startthread(GPtrArray *watch_list) {
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
if (sdl_watch_thread)
event_sdl_watch_stopthread();
@@ -206,7 +206,7 @@ static void event_sdl_watch_startthread(GPtrArray *watch_list) {
}
static void event_sdl_watch_stopthread() {
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
if (sdl_watch_thread) {
/* Notify the watch thread that the list of FDs will change */
pthread_kill(sdl_watch_thread, SIGUSR1);
@@ -217,7 +217,7 @@ static void event_sdl_watch_stopthread() {
static struct event_watch *
event_sdl_add_watch(int fd, enum event_watch_cond cond, struct callback *cb) {
- dbg(lvl_debug, "fd(%d) cond(%x) cb(%x)\n", fd, cond, cb);
+ dbg(lvl_debug, "fd(%d) cond(%x) cb(%x)", fd, cond, cb);
event_sdl_watch_stopthread();
@@ -253,7 +253,7 @@ event_sdl_add_watch(int fd, enum event_watch_cond cond, struct callback *cb) {
}
static void event_sdl_remove_watch(struct event_watch *ew) {
- dbg(lvl_debug, "enter %p\n", ew);
+ dbg(lvl_debug, "enter %p", ew);
event_sdl_watch_stopthread();
@@ -272,7 +272,7 @@ event_sdl_add_timeout(int timeout, int multi, struct callback *cb) {
struct event_timeout * ret = g_new0(struct event_timeout, 1);
if (!ret)
return ret;
- dbg(lvl_debug, "timer(%p) multi(%d) interval(%d) cb(%p) added\n", ret, multi,
+ dbg(lvl_debug, "timer(%p) multi(%d) interval(%d) cb(%p) added", ret, multi,
timeout, cb);
ret->multi = multi;
ret->cb = cb;
@@ -282,14 +282,14 @@ event_sdl_add_timeout(int timeout, int multi, struct callback *cb) {
}
static void event_sdl_remove_timeout(struct event_timeout *to) {
- dbg(lvl_info, "enter %p\n", to);
+ dbg(lvl_info, "enter %p", to);
if (to != NULL) {
int ret = to->id ? SDL_RemoveTimer(to->id) : SDL_TRUE;
if (ret == SDL_FALSE) {
- dbg(lvl_debug, "SDL_RemoveTimer (%p) failed\n", to->id);
+ dbg(lvl_debug, "SDL_RemoveTimer (%p) failed", to->id);
} else {
g_free(to);
- dbg(lvl_debug, "timer(%p) removed\n", to);
+ dbg(lvl_debug, "timer(%p) removed", to);
}
}
}
@@ -309,7 +309,7 @@ static gint sdl_sort_idle_tasks(gconstpointer parama, gconstpointer paramb) {
static struct event_idle *
event_sdl_add_idle(int priority, struct callback *cb) {
- dbg(lvl_debug, "add idle priority(%d) cb(%p)\n", priority, cb);
+ dbg(lvl_debug, "add idle priority(%d) cb(%p)", priority, cb);
struct idle_task *task = g_new0(struct idle_task, 1);
task->priority = priority;
@@ -321,7 +321,7 @@ event_sdl_add_idle(int priority, struct callback *cb) {
SDL_Event event;
SDL_UserEvent userevent;
- dbg(lvl_debug, "poking eventloop because of new idle_events\n");
+ dbg(lvl_debug, "poking eventloop because of new idle_events");
userevent.type = SDL_USEREVENT;
userevent.code = SDL_USEREVENT_CODE_IDLE_EVENT;
@@ -340,14 +340,14 @@ event_sdl_add_idle(int priority, struct callback *cb) {
}
static void event_sdl_remove_idle(struct event_idle *task) {
- dbg(lvl_debug, "remove task(%p)\n", task);
+ dbg(lvl_debug, "remove task(%p)", task);
g_ptr_array_remove(idle_tasks, (gpointer) task);
}
/* callback */
static void event_sdl_call_callback(struct callback_list *cbl) {
- dbg(lvl_debug, "call_callback cbl(%p)\n", cbl);
+ dbg(lvl_debug, "call_callback cbl(%p)", cbl);
SDL_Event event;
SDL_UserEvent userevent;
diff --git a/navit/graphics/sdl/event_sdl.c b/navit/graphics/sdl/event_sdl.c
index 28fe4fafb..d60c2d04c 100644
--- a/navit/graphics/sdl/event_sdl.c
+++ b/navit/graphics/sdl/event_sdl.c
@@ -48,7 +48,7 @@ sdl_timer_callback(Uint32 interval, void* param)
{
struct event_timeout *timeout=(struct event_timeout*)param;
- dbg(lvl_debug,"timer(%p) multi(%d) interval(%d) fired\n", param, timeout->multi, interval);
+ dbg(lvl_debug,"timer(%p) multi(%d) interval(%d) fired", param, timeout->multi, interval);
SDL_Event event;
SDL_UserEvent userevent;
@@ -104,7 +104,7 @@ event_sdl_watch_thread (GPtrArray *watch_list)
for (idx = 0; idx < watch_list->len; idx++ ) {
if (pfds[idx].revents == pfds[idx].events) { /* The requested event happened, notify mainloop! */
ew = g_ptr_array_index (watch_list, idx);
- dbg(lvl_debug,"watch(%p) event(%d) encountered\n", ew, pfds[idx].revents);
+ dbg(lvl_debug,"watch(%p) event(%d) encountered", ew, pfds[idx].revents);
SDL_Event event;
SDL_UserEvent userevent;
@@ -130,7 +130,7 @@ event_sdl_watch_thread (GPtrArray *watch_list)
static void
event_sdl_watch_startthread(GPtrArray *watch_list)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (sdl_watch_thread)
event_sdl_watch_stopthread();
@@ -143,7 +143,7 @@ event_sdl_watch_startthread(GPtrArray *watch_list)
static void
event_sdl_watch_stopthread()
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (sdl_watch_thread) {
/* Notify the watch thread that the list of FDs will change */
pthread_kill(sdl_watch_thread, SIGUSR1);
@@ -155,7 +155,7 @@ event_sdl_watch_stopthread()
static struct event_watch *
event_sdl_add_watch(int fd, enum event_watch_cond cond, struct callback *cb)
{
- dbg(lvl_debug,"fd(%d) cond(%x) cb(%x)\n", fd, cond, cb);
+ dbg(lvl_debug,"fd(%d) cond(%x) cb(%x)", fd, cond, cb);
event_sdl_watch_stopthread();
@@ -193,7 +193,7 @@ event_sdl_add_watch(int fd, enum event_watch_cond cond, struct callback *cb)
static void
event_sdl_remove_watch(struct event_watch *ew)
{
- dbg(lvl_debug,"enter %p\n",ew);
+ dbg(lvl_debug,"enter %p",ew);
event_sdl_watch_stopthread();
@@ -212,10 +212,10 @@ event_sdl_add_timeout(int timeout, int multi, struct callback *cb)
{
struct event_timeout * ret = g_new0(struct event_timeout, 1);
if(!ret) {
- dbg(lvl_error,"g_new0 failed\n");
+ dbg(lvl_error,"g_new0 failed");
return ret;
}
- dbg(lvl_debug,"timer(%p) multi(%d) interval(%d) cb(%p) added\n",ret, multi, timeout, cb);
+ dbg(lvl_debug,"timer(%p) multi(%d) interval(%d) cb(%p) added",ret, multi, timeout, cb);
ret->multi = multi;
ret->cb = cb;
ret->id = SDL_AddTimer(timeout, sdl_timer_callback, ret);
@@ -226,17 +226,17 @@ event_sdl_add_timeout(int timeout, int multi, struct callback *cb)
static void
event_sdl_remove_timeout(struct event_timeout *to)
{
- dbg(lvl_info,"enter %p\n", to);
+ dbg(lvl_info,"enter %p", to);
if(to)
{
/* do not SDL_RemoveTimer if oneshot timer has already fired */
int ret = to->id == 0 ? SDL_TRUE : SDL_RemoveTimer(to->id);
if (ret == SDL_FALSE)
- dbg(lvl_error,"SDL_RemoveTimer (%p) failed\n", to->id);
+ dbg(lvl_error,"SDL_RemoveTimer (%p) failed", to->id);
g_free(to);
- dbg(lvl_debug,"timer(%p) removed\n", to);
+ dbg(lvl_debug,"timer(%p) removed", to);
}
}
@@ -258,7 +258,7 @@ sdl_sort_idle_tasks(gconstpointer parama, gconstpointer paramb)
static struct event_idle *
event_sdl_add_idle(int priority, struct callback *cb)
{
- dbg(lvl_debug,"add idle priority(%d) cb(%p)\n", priority, cb);
+ dbg(lvl_debug,"add idle priority(%d) cb(%p)", priority, cb);
struct idle_task *task = g_new0(struct idle_task, 1);
task->priority = priority;
@@ -271,7 +271,7 @@ event_sdl_add_idle(int priority, struct callback *cb)
SDL_Event event;
SDL_UserEvent userevent;
- dbg(lvl_debug,"poking eventloop because of new idle_events\n");
+ dbg(lvl_debug,"poking eventloop because of new idle_events");
userevent.type = SDL_USEREVENT;
userevent.code = SDL_USEREVENT_CODE_IDLE_EVENT;
@@ -292,7 +292,7 @@ event_sdl_add_idle(int priority, struct callback *cb)
static void
event_sdl_remove_idle(struct event_idle *task)
{
- dbg(lvl_debug,"remove task(%p)\n", task);
+ dbg(lvl_debug,"remove task(%p)", task);
g_ptr_array_remove(idle_tasks, (gpointer)task);
}
@@ -301,7 +301,7 @@ event_sdl_remove_idle(struct event_idle *task)
static void
event_sdl_call_callback(struct callback_list *cbl)
{
- dbg(lvl_debug,"call_callback cbl(%p)\n",cbl);
+ dbg(lvl_debug,"call_callback cbl(%p)",cbl);
SDL_Event event;
SDL_UserEvent userevent;
diff --git a/navit/graphics/sdl/graphics_sdl.c b/navit/graphics/sdl/graphics_sdl.c
index b1a9c17b9..a87805b73 100644
--- a/navit/graphics/sdl/graphics_sdl.c
+++ b/navit/graphics/sdl/graphics_sdl.c
@@ -185,7 +185,7 @@ struct graphics_image_priv {
static void
graphics_destroy(struct graphics_priv *gr)
{
- dbg(lvl_debug, "graphics_destroy %p %u\n", gr, gr->overlay_mode);
+ dbg(lvl_debug, "graphics_destroy %p %u", gr, gr->overlay_mode);
if(gr->overlay_mode)
{
@@ -220,7 +220,7 @@ gc_destroy(struct graphics_gc_priv *gc)
static void
gc_set_linewidth(struct graphics_gc_priv *gc, int w)
{
- dbg(lvl_debug, "gc_set_linewidth %p %d\n", gc, w);
+ dbg(lvl_debug, "gc_set_linewidth %p %d", gc, w);
gc->linewidth = w;
}
@@ -233,7 +233,7 @@ gc_set_dashes(struct graphics_gc_priv *gc, int w, int offset, unsigned char *das
static void
gc_set_foreground(struct graphics_gc_priv *gc, struct color *c)
{
- dbg(lvl_debug, "gc_set_foreground: %p %d %d %d %d\n", gc, c->a, c->r, c->g, c->b);
+ dbg(lvl_debug, "gc_set_foreground: %p %d %d %d %d", gc, c->a, c->r, c->g, c->b);
gc->fore_r = c->r/256;
gc->fore_g = c->g/256;
gc->fore_b = c->b/256;
@@ -243,7 +243,7 @@ gc_set_foreground(struct graphics_gc_priv *gc, struct color *c)
static void
gc_set_background(struct graphics_gc_priv *gc, struct color *c)
{
- dbg(lvl_debug, "gc_set_background: %p %d %d %d %d\n", gc, c->a, c->r, c->g, c->b);
+ dbg(lvl_debug, "gc_set_background: %p %d %d %d %d", gc, c->a, c->r, c->g, c->b);
gc->back_r = c->r/256;
gc->back_g = c->g/256;
gc->back_b = c->b/256;
@@ -292,7 +292,7 @@ image_new(struct graphics_priv *gr, struct graphics_image_methods *meth, char *n
else
{
/* TODO: debug "colour parse errors" on xpm */
- dbg(lvl_error,"image_new on '%s' failed: %s\n", name, IMG_GetError());
+ dbg(lvl_error,"image_new on '%s' failed: %s", name, IMG_GetError());
g_free(gi);
gi = NULL;
}
@@ -329,7 +329,7 @@ draw_polygon(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point
vx[i] = x;
vy[i] = y;
- dbg(lvl_debug, "draw_polygon: %p %i %d,%d\n", gc, i, p[i].x, p[i].y);
+ dbg(lvl_debug, "draw_polygon: %p %i %d,%d", gc, i, p[i].x, p[i].y);
}
if(gr->aa)
@@ -360,7 +360,7 @@ draw_rectangle(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct poi
return;
}
- dbg(lvl_debug, "draw_rectangle: %d %d %d %d r=%d g=%d b=%d a=%d\n", p->x, p->y, w, h,
+ dbg(lvl_debug, "draw_rectangle: %d %d %d %d r=%d g=%d b=%d a=%d", p->x, p->y, w, h,
gc->fore_r, gc->fore_g, gc->fore_b, gc->fore_a);
if(w > gr->screen->w)
{
@@ -493,10 +493,10 @@ draw_lines(struct graphics_priv *gr, struct graphics_gc_priv *gc, struct point *
y_lw_adj = round(cos(angle)*(float)lw/2.0);
if((x_lw_adj < 0) || (y_lw_adj < 0))
{
- dbg(lvl_debug, "i=%d\n", i);
- dbg(lvl_debug, " %d,%d->%d,%d\n", p[i].x, p[i].y, p[i+1].x, p[i+1].y);
- dbg(lvl_debug, " lw=%d angle=%f\n", lw, 180.0 * angle / M_PI);
- dbg(lvl_debug, " x_lw_adj=%d y_lw_adj=%d\n", x_lw_adj, y_lw_adj);
+ dbg(lvl_debug, "i=%d", i);
+ dbg(lvl_debug, " %d,%d->%d,%d", p[i].x, p[i].y, p[i+1].x, p[i+1].y);
+ dbg(lvl_debug, " lw=%d angle=%f", lw, 180.0 * angle / M_PI);
+ dbg(lvl_debug, " x_lw_adj=%d y_lw_adj=%d", x_lw_adj, y_lw_adj);
}
}
@@ -586,7 +586,7 @@ resize_ft_buffer (unsigned int new_size)
if (new_size > ft_buffer_size) {
g_free (ft_buffer);
ft_buffer = g_malloc (new_size);
- dbg(lvl_debug, "old_size(%u) new_size(%u) ft_buffer(%p)\n", ft_buffer_size, new_size, ft_buffer);
+ dbg(lvl_debug, "old_size(%u) new_size(%u) ft_buffer(%p)", ft_buffer_size, new_size, ft_buffer);
ft_buffer_size = new_size;
}
}
@@ -744,7 +744,7 @@ draw_text(struct graphics_priv *gr, struct graphics_gc_priv *fg,
int color = 1;
if (!font) {
- dbg(lvl_error, "no font, returning\n");
+ dbg(lvl_error, "no font, returning");
return;
}
t = gr->freetype_methods.text_new(text,
@@ -780,7 +780,7 @@ draw_image(struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *
static void
background_gc(struct graphics_priv *gr, struct graphics_gc_priv *gc)
{
- dbg(lvl_debug, "background_gc\n");
+ dbg(lvl_debug, "background_gc");
}
@@ -797,7 +797,7 @@ draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
}
else
{
- dbg(lvl_debug, "draw_mode: %d\n", mode);
+ dbg(lvl_debug, "draw_mode: %d", mode);
if(mode == draw_mode_end)
{
@@ -927,11 +927,11 @@ overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct poin
}
if(i == OVERLAY_MAX)
{
- dbg(lvl_error, "too many overlays! increase OVERLAY_MAX\n");
+ dbg(lvl_error, "too many overlays! increase OVERLAY_MAX");
return NULL;
}
- dbg(lvl_debug, "overlay_new %d %d %d %u %u (%x, %x, %x ,%x, %d)\n", i,
+ dbg(lvl_debug, "overlay_new %d %d %d %u %u (%x, %x, %x ,%x, %d)", i,
p->x,
p->y,
w,
@@ -1025,7 +1025,7 @@ static gboolean graphics_sdl_idle(void *data)
gr = the_graphics;
}
else {
- dbg(lvl_error,"graphics_idle: graphics not set!\n");
+ dbg(lvl_error,"graphics_idle: graphics not set!");
return FALSE;
}
}
@@ -1070,7 +1070,7 @@ static gboolean graphics_sdl_idle(void *data)
if (idle_tasks_idx >= idle_tasks->len)
idle_tasks_idx = 0;
- dbg(lvl_debug,"idle_tasks_idx(%d)\n",idle_tasks_idx);
+ dbg(lvl_debug,"idle_tasks_idx(%d)",idle_tasks_idx);
task = (struct idle_task *)g_ptr_array_index(idle_tasks,idle_tasks_idx);
if (idle_tasks_idx == 0) // only execute tasks with lowest priority value
@@ -1095,7 +1095,7 @@ static gboolean graphics_sdl_idle(void *data)
}
#ifdef USE_WEBOS
- dbg(lvl_debug,"SDL_Event %d\n", ev.type);
+ dbg(lvl_debug,"SDL_Event %d", ev.type);
#endif
switch(ev.type)
{
@@ -1220,7 +1220,7 @@ static gboolean graphics_sdl_idle(void *data)
key_mod &= ~(WEBOS_KEY_MOD_ORANGE_STICKY);
}
else {
- dbg(lvl_error,"Unknown key sym: %x\n", ev.key.keysym.sym);
+ dbg(lvl_error,"Unknown key sym: %x", ev.key.keysym.sym);
}
#else
/* return unicode chars when they can be converted to ascii */
@@ -1230,7 +1230,7 @@ static gboolean graphics_sdl_idle(void *data)
}
}
- dbg(lvl_info,"key mod: 0x%x\n", key_mod);
+ dbg(lvl_info,"key mod: 0x%x", key_mod);
if (keybuf[0]) {
callback_list_call_attr_1(gr->cbl, attr_keypress, (void *)keybuf);
@@ -1245,7 +1245,7 @@ static gboolean graphics_sdl_idle(void *data)
case SDL_MOUSEBUTTONDOWN:
{
- dbg(lvl_debug, "SDL_MOUSEBUTTONDOWN %d %d %d %d %d\n",
+ dbg(lvl_debug, "SDL_MOUSEBUTTONDOWN %d %d %d %d %d",
ev.button.which,
ev.button.button,
ev.button.state,
@@ -1260,7 +1260,7 @@ static gboolean graphics_sdl_idle(void *data)
case SDL_MOUSEBUTTONUP:
{
- dbg(lvl_debug, "SDL_MOUSEBUTTONUP %d %d %d %d %d\n",
+ dbg(lvl_debug, "SDL_MOUSEBUTTONUP %d %d %d %d %d",
ev.button.which,
ev.button.button,
ev.button.state,
@@ -1302,7 +1302,7 @@ static gboolean graphics_sdl_idle(void *data)
case SDL_USEREVENT:
{
SDL_UserEvent userevent = ev.user;
- dbg(lvl_info,"received SDL_USEREVENT type(%x) code(%x)\n",userevent.type,userevent.code);
+ dbg(lvl_info,"received SDL_USEREVENT type(%x) code(%x)",userevent.type,userevent.code);
if (userevent.type != SDL_USEREVENT)
break;
@@ -1322,28 +1322,28 @@ static gboolean graphics_sdl_idle(void *data)
else if(userevent.code == SDL_USEREVENT_CODE_TIMER)
{
struct callback *cb = (struct callback *)userevent.data1;
- dbg(lvl_debug, "SDL_USEREVENT timer received cb(%p)\n", cb);
+ dbg(lvl_debug, "SDL_USEREVENT timer received cb(%p)", cb);
callback_call_0(cb);
}
else if(userevent.code == SDL_USEREVENT_CODE_WATCH)
{
struct callback *cb = (struct callback *)userevent.data1;
- dbg(lvl_debug, "SDL_USEREVENT watch received cb(%p)\n", cb);
+ dbg(lvl_debug, "SDL_USEREVENT watch received cb(%p)", cb);
callback_call_0(cb);
}
else if(userevent.code == SDL_USEREVENT_CODE_CALL_CALLBACK)
{
struct callback_list *cbl = (struct callback_list *)userevent.data1;
- dbg(lvl_debug, "SDL_USEREVENT call_callback received cbl(%p)\n", cbl);
+ dbg(lvl_debug, "SDL_USEREVENT call_callback received cbl(%p)", cbl);
callback_list_call_0(cbl);
}
else if(userevent.code == SDL_USEREVENT_CODE_IDLE_EVENT) {
- dbg(lvl_debug, "SDL_USEREVENT idle_event received\n");
+ dbg(lvl_debug, "SDL_USEREVENT idle_event received");
}
#ifdef USE_WEBOS_ACCELEROMETER
else if(userevent.code == SDL_USEREVENT_CODE_ROTATE)
{
- dbg(lvl_debug, "SDL_USEREVENT rotate received\n");
+ dbg(lvl_debug, "SDL_USEREVENT rotate received");
switch(gr->orientation)
{
case WEBOS_ORIENTATION_PORTRAIT:
@@ -1366,14 +1366,14 @@ static gboolean graphics_sdl_idle(void *data)
}
#endif
else
- dbg(lvl_warning, "unknown SDL_USEREVENT\n");
+ dbg(lvl_warning, "unknown SDL_USEREVENT");
break;
}
#endif
default:
{
- dbg(lvl_debug, "SDL_Event %d\n", ev.type);
+ dbg(lvl_debug, "SDL_Event %d", ev.type);
break;
}
}
@@ -1423,7 +1423,7 @@ graphics_sdl_new(struct navit *nav, struct graphics_methods *meth, struct attr *
int)) this->freetype_methods.font_new;
meth->get_text_bbox = (void*) this->freetype_methods.get_text_bbox;
- dbg(lvl_debug,"Calling SDL_Init\n");
+ dbg(lvl_debug,"Calling SDL_Init");
#ifdef USE_WEBOS
# ifdef USE_WEBOS_ACCELEROMETER
ret = SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER|SDL_INIT_JOYSTICK);
@@ -1435,18 +1435,18 @@ graphics_sdl_new(struct navit *nav, struct graphics_methods *meth, struct attr *
#endif
if(ret < 0)
{
- dbg(lvl_error,"SDL_Init failed %d\n", ret);
+ dbg(lvl_error,"SDL_Init failed %d", ret);
this->freetype_methods.destroy();
g_free(this);
return NULL;
}
#ifdef USE_WEBOS
- dbg(lvl_debug,"Calling PDL_Init(0)\n");
+ dbg(lvl_debug,"Calling PDL_Init(0)");
ret = PDL_Init(0);
if(ret < 0)
{
- dbg(lvl_error,"PDL_Init failed %d\n", ret);
+ dbg(lvl_error,"PDL_Init failed %d", ret);
this->freetype_methods.destroy();
g_free(this);
return NULL;
@@ -1489,7 +1489,7 @@ graphics_sdl_new(struct navit *nav, struct graphics_methods *meth, struct attr *
if(this->screen == NULL)
{
- dbg(lvl_error,"SDL_SetVideoMode failed\n");
+ dbg(lvl_error,"SDL_SetVideoMode failed");
this->freetype_methods.destroy();
g_free(this);
#ifdef USE_WEBOS
@@ -1503,7 +1503,7 @@ graphics_sdl_new(struct navit *nav, struct graphics_methods *meth, struct attr *
w = this->screen->w;
h = this->screen->h;
- dbg(lvl_debug, "using screen %ix%i@%i\n",
+ dbg(lvl_debug, "using screen %ix%i@%i",
this->screen->w, this->screen->h,
this->screen->format->BytesPerPixel * 8);
#ifdef USE_WEBOS_ACCELEROMETER
@@ -1530,7 +1530,7 @@ graphics_sdl_new(struct navit *nav, struct graphics_methods *meth, struct attr *
#ifdef USE_WEBOS
if(the_graphics!=NULL) {
- dbg(lvl_debug,"graphics_sdl_new: graphics struct already set: %d!\n", the_graphics_count);
+ dbg(lvl_debug,"graphics_sdl_new: graphics struct already set: %d!", the_graphics_count);
}
the_graphics = this;
the_graphics_count++;
@@ -1556,7 +1556,7 @@ sdl_timer_callback(Uint32 interval, void* param)
{
struct event_timeout *timeout=(struct event_timeout*)param;
- dbg(lvl_debug,"timer(%p) multi(%d) interval(%d) fired\n", param, timeout->multi, interval);
+ dbg(lvl_debug,"timer(%p) multi(%d) interval(%d) fired", param, timeout->multi, interval);
SDL_Event event;
SDL_UserEvent userevent;
@@ -1613,7 +1613,7 @@ event_sdl_watch_thread (GPtrArray *watch_list)
for (idx = 0; idx < watch_list->len; idx++ ) {
if (pfds[idx].revents == pfds[idx].events) { /* The requested event happened, notify mainloop! */
ew = g_ptr_array_index (watch_list, idx);
- dbg(lvl_debug,"watch(%p) event(%d) encountered\n", ew, pfds[idx].revents);
+ dbg(lvl_debug,"watch(%p) event(%d) encountered", ew, pfds[idx].revents);
SDL_Event event;
SDL_UserEvent userevent;
@@ -1639,7 +1639,7 @@ event_sdl_watch_thread (GPtrArray *watch_list)
static void
event_sdl_watch_startthread(GPtrArray *watch_list)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (sdl_watch_thread)
event_sdl_watch_stopthread();
@@ -1652,7 +1652,7 @@ event_sdl_watch_startthread(GPtrArray *watch_list)
static void
event_sdl_watch_stopthread()
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (sdl_watch_thread) {
/* Notify the watch thread that the list of FDs will change */
pthread_kill(sdl_watch_thread, SIGUSR1);
@@ -1664,7 +1664,7 @@ event_sdl_watch_stopthread()
static struct event_watch *
event_sdl_add_watch(int fd, enum event_watch_cond cond, struct callback *cb)
{
- dbg(lvl_debug,"fd(%d) cond(%x) cb(%x)\n", fd, cond, cb);
+ dbg(lvl_debug,"fd(%d) cond(%x) cb(%x)", fd, cond, cb);
event_sdl_watch_stopthread();
@@ -1702,7 +1702,7 @@ event_sdl_add_watch(int fd, enum event_watch_cond cond, struct callback *cb)
static void
event_sdl_remove_watch(struct event_watch *ew)
{
- dbg(lvl_debug,"enter %p\n",ew);
+ dbg(lvl_debug,"enter %p",ew);
event_sdl_watch_stopthread();
@@ -1721,10 +1721,10 @@ event_sdl_add_timeout(int timeout, int multi, struct callback *cb)
{
struct event_timeout * ret = g_new0(struct event_timeout, 1);
if(!ret) {
- dbg(lvl_error,"g_new0 failed\n");
+ dbg(lvl_error,"g_new0 failed");
return ret;
}
- dbg(lvl_debug,"timer(%p) multi(%d) interval(%d) cb(%p) added\n",ret, multi, timeout, cb);
+ dbg(lvl_debug,"timer(%p) multi(%d) interval(%d) cb(%p) added",ret, multi, timeout, cb);
ret->multi = multi;
ret->cb = cb;
ret->id = SDL_AddTimer(timeout, sdl_timer_callback, ret);
@@ -1735,17 +1735,17 @@ event_sdl_add_timeout(int timeout, int multi, struct callback *cb)
static void
event_sdl_remove_timeout(struct event_timeout *to)
{
- dbg(lvl_info,"enter %p\n", to);
+ dbg(lvl_info,"enter %p", to);
if(to)
{
/* do not SDL_RemoveTimer if oneshot timer has already fired */
int ret = to->id == 0 ? SDL_TRUE : SDL_RemoveTimer(to->id);
if (ret == SDL_FALSE)
- dbg(lvl_error,"SDL_RemoveTimer (%p) failed\n", to->id);
+ dbg(lvl_error,"SDL_RemoveTimer (%p) failed", to->id);
g_free(to);
- dbg(lvl_debug,"timer(%p) removed\n", to);
+ dbg(lvl_debug,"timer(%p) removed", to);
}
}
@@ -1767,7 +1767,7 @@ sdl_sort_idle_tasks(gconstpointer parama, gconstpointer paramb)
static struct event_idle *
event_sdl_add_idle(int priority, struct callback *cb)
{
- dbg(lvl_debug,"add idle priority(%d) cb(%p)\n", priority, cb);
+ dbg(lvl_debug,"add idle priority(%d) cb(%p)", priority, cb);
struct idle_task *task = g_new0(struct idle_task, 1);
task->priority = priority;
@@ -1780,7 +1780,7 @@ event_sdl_add_idle(int priority, struct callback *cb)
SDL_Event event;
SDL_UserEvent userevent;
- dbg(lvl_debug,"poking eventloop because of new idle_events\n");
+ dbg(lvl_debug,"poking eventloop because of new idle_events");
userevent.type = SDL_USEREVENT;
userevent.code = SDL_USEREVENT_CODE_IDLE_EVENT;
@@ -1801,7 +1801,7 @@ event_sdl_add_idle(int priority, struct callback *cb)
static void
event_sdl_remove_idle(struct event_idle *task)
{
- dbg(lvl_debug,"remove task(%p)\n", task);
+ dbg(lvl_debug,"remove task(%p)", task);
g_ptr_array_remove(idle_tasks, (gpointer)task);
}
@@ -1810,7 +1810,7 @@ event_sdl_remove_idle(struct event_idle *task)
static void
event_sdl_call_callback(struct callback_list *cbl)
{
- dbg(lvl_debug,"call_callback cbl(%p)\n",cbl);
+ dbg(lvl_debug,"call_callback cbl(%p)",cbl);
SDL_Event event;
SDL_UserEvent userevent;
diff --git a/navit/graphics/win32/graphics_win32.c b/navit/graphics/win32/graphics_win32.c
index 3d8fa351d..a450789c4 100644
--- a/navit/graphics/win32/graphics_win32.c
+++ b/navit/graphics/win32/graphics_win32.c
@@ -274,7 +274,7 @@ static void create_memory_dc(struct graphics_priv *gr)
hdc = GetDC( gr->wnd_handle );
// Creates memory DC
gr->hMemDC = CreateCompatibleDC(hdc);
- dbg(lvl_debug, "resize memDC to: %d %d \n", gr->width, gr->height );
+ dbg(lvl_debug, "resize memDC to: %d %d ", gr->width, gr->height );
#ifndef FAST_TRANSPARENCY
@@ -311,7 +311,7 @@ static void HandleKeyChar(struct graphics_priv *gra_priv, WPARAM wParam)
TCHAR key = (TCHAR) wParam;
char *s=NULL;
char k[]={0,0};
- dbg(lvl_debug,"HandleKey %d\n",key);
+ dbg(lvl_debug,"HandleKey %d",key);
switch (key) {
default:
k[0]=key;
@@ -330,7 +330,7 @@ static void HandleKeyDown(struct graphics_priv *gra_priv, WPARAM wParam)
char left[]={NAVIT_KEY_LEFT,0};
char right[]={NAVIT_KEY_RIGHT,0};
char *s=NULL;
- dbg(lvl_debug,"HandleKey %d\n",key);
+ dbg(lvl_debug,"HandleKey %d",key);
switch (key) {
case 37:
s=left;
@@ -410,7 +410,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
gra_priv->width = LOWORD( lParam );
gra_priv->height = HIWORD( lParam );
create_memory_dc(gra_priv);
- dbg(lvl_debug, "resize gfx to: %d %d \n", gra_priv->width, gra_priv->height );
+ dbg(lvl_debug, "resize gfx to: %d %d ", gra_priv->width, gra_priv->height );
callback_list_call_attr_2(gra_priv->cbl, attr_resize, (void *)gra_priv->width, (void *)gra_priv->height);
}
break;
@@ -434,7 +434,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
PAINTSTRUCT ps = { 0 };
HDC hdc;
profile(0, NULL);
- dbg(lvl_debug, "WM_PAINT\n");
+ dbg(lvl_debug, "WM_PAINT");
overlay = gra_priv->overlays;
#ifndef FAST_TRANSPARENCY
@@ -535,13 +535,13 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
case WM_LBUTTONDOWN:
{
- dbg(lvl_debug, "LBUTTONDOWN\n");
+ dbg(lvl_debug, "LBUTTONDOWN");
HandleButtonClick( gra_priv, 1, 1, lParam);
}
break;
case WM_LBUTTONUP:
{
- dbg(lvl_debug, "LBUTTONUP\n");
+ dbg(lvl_debug, "LBUTTONUP");
HandleButtonClick( gra_priv, 0, 1, lParam);
}
break;
@@ -552,7 +552,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
HandleButtonClick( gra_priv, 0, 3,lParam );
break;
case WM_LBUTTONDBLCLK:
- dbg(lvl_debug, "LBUTTONDBLCLK\n");
+ dbg(lvl_debug, "LBUTTONDBLCLK");
HandleButtonClick( gra_priv, 1, 6,lParam );
break;
case WM_CHAR:
@@ -562,7 +562,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
HandleKeyDown( gra_priv, wParam);
break;
case WM_COPYDATA:
- dbg(lvl_debug,"got WM_COPYDATA\n");
+ dbg(lvl_debug,"got WM_COPYDATA");
callback_list_call_attr_2(gra_priv->cbl, attr_wm_copydata, (void *)wParam, (void*)lParam);
break;
#ifdef HAVE_API_WIN32_CE
@@ -689,7 +689,7 @@ static HANDLE CreateGraphicsWindows( struct graphics_priv* gr, HMENU hMenu )
if (!RegisterClassEx(&wc))
#endif
{
- dbg(lvl_error, "Window registration failed\n");
+ dbg(lvl_error, "Window registration failed");
return NULL;
}
@@ -732,7 +732,7 @@ static HANDLE CreateGraphicsWindows( struct graphics_priv* gr, HMENU hMenu )
#endif
if (hwnd == NULL)
{
- dbg(lvl_error, "Window creation failed: %d\n", GetLastError());
+ dbg(lvl_error, "Window creation failed: %d", GetLastError());
return NULL;
}
/* For Vista, we need here ChangeWindowMessageFilter(WM_COPYDATA,MSGFLT_ADD); since Win7 we need above one or ChangeWindowMessageFilterEx (MSDN), both are
@@ -932,7 +932,7 @@ static void draw_drag(struct graphics_priv *gr, struct point *p)
static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
{
- dbg(lvl_debug, "set draw_mode to %x, %d\n", gr, (int)mode );
+ dbg(lvl_debug, "set draw_mode to %x, %d", gr, (int)mode );
if ( mode == draw_mode_begin )
{
@@ -944,7 +944,7 @@ static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
{
if ( gr->hMemDC )
{
- dbg(lvl_debug, "Erase dc: %x, w: %d, h: %d, bg_color: %x\n", gr, gr->width, gr->height, gr->bg_color);
+ dbg(lvl_debug, "Erase dc: %x, w: %d, h: %d, bg_color: %x", gr, gr->width, gr->height, gr->bg_color);
#ifdef FAST_TRANSPARENCY
if ( gr->hPrebuildDC )
{
@@ -1136,11 +1136,11 @@ pngdecode(struct graphics_priv *gr, char *name, struct graphics_image_priv *img)
BITMAPINFO pnginfo;
HDC dc;
- dbg(lvl_debug,"enter %s\n",name);
+ dbg(lvl_debug,"enter %s",name);
png_file=fopen(name, "rb");
if (!png_file)
{
- dbg(lvl_warning,"failed to open %s\n",name);
+ dbg(lvl_warning,"failed to open %s",name);
return FALSE;
}
@@ -1278,7 +1278,7 @@ pngdecode(struct graphics_priv *gr, char *name, struct graphics_image_priv *img)
g_free (row_pointers);
img->hot.x=img->width/2-1;
img->hot.y=img->height/2-1;
- dbg(lvl_debug,"ok\n");
+ dbg(lvl_debug,"ok");
fclose(png_file);
return TRUE;
@@ -1426,7 +1426,7 @@ static struct graphics_image_priv *image_new(struct graphics_priv *gr, struct gr
if (len >= 4)
{
char *ext;
- dbg(lvl_info, "loading image '%s'\n", name );
+ dbg(lvl_info, "loading image '%s'", name );
ret = g_new0( struct graphics_image_priv, 1 );
ext = name+len-4;
if (!strcmp(ext,".xpm")) {
@@ -1436,7 +1436,7 @@ static struct graphics_image_priv *image_new(struct graphics_priv *gr, struct gr
}
}
if (!rc) {
- dbg(lvl_warning, "failed loading '%s'\n", name );
+ dbg(lvl_warning, "failed loading '%s'", name );
g_free(ret);
ret=NULL;
}
@@ -1479,7 +1479,7 @@ static struct graphics_priv *
static void overlay_resize(struct graphics_priv *gr, struct point *p, int w, int h, int wraparound)
{
- dbg(lvl_debug, "resize overlay: %x, x: %d, y: %d, w: %d, h: %d, wraparound: %d\n", gr, p->x, p->y, w, h, wraparound);
+ dbg(lvl_debug, "resize overlay: %x, x: %d, y: %d, w: %d, h: %d, wraparound: %d", gr, p->x, p->y, w, h, wraparound);
if ( gr->width != w || gr->height != h )
{
@@ -1497,7 +1497,7 @@ static struct graphics_priv *
overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h, int wraparound)
{
struct graphics_priv *this=graphics_win32_new_helper(meth);
- dbg(lvl_debug, "overlay: %x, x: %d, y: %d, w: %d, h: %d, wraparound: %d\n", this, p->x, p->y, w, h, wraparound);
+ dbg(lvl_debug, "overlay: %x, x: %d, y: %d, w: %d, h: %d, wraparound: %d", this, p->x, p->y, w, h, wraparound);
this->width = w;
this->height = h;
this->parent = gr;
@@ -1531,7 +1531,7 @@ static struct graphics_priv *
static void overlay_disable(struct graphics_priv *gr, int disable)
{
- dbg(lvl_debug, "overlay: %x, disable: %d\n", gr, disable);
+ dbg(lvl_debug, "overlay: %x, disable: %d", gr, disable);
gr->disabled = disable;
}
@@ -1543,7 +1543,7 @@ static void get_text_bbox(struct graphics_priv *gr, struct graphics_font_priv *f
int yMax = 13*font->size/256;
int xMax = 9*font->size*len/256;
- dbg(lvl_info, "Get bbox for %s\n", text);
+ dbg(lvl_info, "Get bbox for %s", text);
ret[0].x = xMin;
ret[0].y = -yMin;
@@ -1610,7 +1610,7 @@ static void bind_late(struct graphics_priv* gra_priv)
gra_priv->AlphaBlend = (FP_AlphaBlend)GetProcAddress(gra_priv->hCoreDll, TEXT("AlphaBlend") );
if (!gra_priv->AlphaBlend)
{
- dbg(lvl_warning, "AlphaBlend not supported\n");
+ dbg(lvl_warning, "AlphaBlend not supported");
}
#if HAVE_API_WIN32_CE
gra_priv->SetStretchBltMode= (FP_SetStretchBltMode)GetProcAddress(gra_priv->hCoreDll, TEXT("SetStretchBltMode") );
@@ -1619,12 +1619,12 @@ static void bind_late(struct graphics_priv* gra_priv)
#endif
if (!gra_priv->SetStretchBltMode)
{
- dbg(lvl_warning, "SetStretchBltMode not supported\n");
+ dbg(lvl_warning, "SetStretchBltMode not supported");
}
}
else
{
- dbg(lvl_error, "Error loading coredll\n");
+ dbg(lvl_error, "Error loading coredll");
}
if(gra_priv->hUser32Dll) {
@@ -1678,7 +1678,7 @@ event_win32_main_loop_run(void)
{
MSG msg;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
while (GetMessage(&msg, 0, 0, 0))
{
TranslateMessage(&msg); /* Keyboard input. */
@@ -1694,7 +1694,7 @@ static void event_win32_main_loop_quit(void)
HWND hwndSip;
#endif
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
#ifdef HAVE_API_WIN32_CE
hwndTaskbar = FindWindow(L"HHTaskBar", NULL);
@@ -1710,14 +1710,14 @@ static void event_win32_main_loop_quit(void)
static struct event_watch *
event_win32_add_watch(int h, enum event_watch_cond cond, struct callback *cb)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
return NULL;
}
static void
event_win32_remove_watch(struct event_watch *ev)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static GList *timers;
@@ -1740,7 +1740,7 @@ static void run_timer(UINT_PTR idEvent)
if (t->timer_id == idEvent)
{
struct callback *cb = t->cb;
- dbg(lvl_info, "Timer %d (multi: %d)\n", t->timer_id, t->multi);
+ dbg(lvl_info, "Timer %d (multi: %d)", t->timer_id, t->multi);
if (!t->multi)
{
KillTimer(NULL, t->timer_id);
@@ -1752,7 +1752,7 @@ static void run_timer(UINT_PTR idEvent)
}
l = g_list_next(l);
}
- dbg(lvl_error, "timer %d not found\n", idEvent);
+ dbg(lvl_error, "timer %d not found", idEvent);
}
static VOID CALLBACK win32_timer_cb(HWND hwnd, UINT uMsg,
@@ -1773,7 +1773,7 @@ static struct event_timeout *
timers = g_list_prepend(timers, t);
t->cb = cb;
t->timer_id = SetTimer(NULL, 0, timeout, win32_timer_cb);
- dbg(lvl_debug, "Started timer %d for %d (multi: %d)\n", t->timer_id, timeout, multi);
+ dbg(lvl_debug, "Started timer %d for %d (multi: %d)", t->timer_id, timeout, multi);
return t;
}
@@ -1784,7 +1784,7 @@ event_win32_remove_timeout(struct event_timeout *to)
{
GList *l;
struct event_timeout *t=NULL;
- dbg(lvl_debug, "Try stopping timer %d\n", to->timer_id);
+ dbg(lvl_debug, "Try stopping timer %d", to->timer_id);
l = timers;
while (l)
{
@@ -1799,7 +1799,7 @@ event_win32_remove_timeout(struct event_timeout *to)
}
l = g_list_next(l);
}
- dbg(lvl_error, "Timer %d not found\n", to->timer_id);
+ dbg(lvl_error, "Timer %d not found", to->timer_id);
g_free(to);
}
}
diff --git a/navit/gui.c b/navit/gui.c
index 9b2ba4971..3e3b04269 100644
--- a/navit/gui.c
+++ b/navit/gui.c
@@ -145,12 +145,12 @@ int
gui_add_bookmark(struct gui *gui, struct pcoord *c, char *description)
{
int ret;
- dbg(lvl_info,"enter\n");
+ dbg(lvl_info,"enter");
if (! gui->meth.add_bookmark)
return 0;
ret=gui->meth.add_bookmark(gui->priv, c, description);
- dbg(lvl_info,"ret=%d\n", ret);
+ dbg(lvl_info,"ret=%d", ret);
return ret;
}
@@ -158,7 +158,7 @@ int
gui_set_graphics(struct gui *this_, struct graphics *gra)
{
if (! this_->meth.set_graphics) {
- dbg(lvl_error, "cannot set graphics, method 'set_graphics' not available\n");
+ dbg(lvl_error, "cannot set graphics, method 'set_graphics' not available");
return 1;
}
return this_->meth.set_graphics(this_->priv, gra);
diff --git a/navit/gui/gtk/datawindow.c b/navit/gui/gtk/datawindow.c
index dd71ce999..777a205e8 100644
--- a/navit/gui/gtk/datawindow.c
+++ b/navit/gui/gtk/datawindow.c
@@ -48,7 +48,7 @@ select_row(GtkTreeView *tree, GtkTreePath *path, GtkTreeViewColumn *column, stru
GtkTreeModel *model;
int i;
- dbg(lvl_debug,"win=%p\n", win);
+ dbg(lvl_debug,"win=%p", win);
model=gtk_tree_view_get_model(tree);
gtk_tree_model_get_iter(model, &iter, path);
diff --git a/navit/gui/gtk/destination.c b/navit/gui/gtk/destination.c
index 18fc58b75..a530cc559 100644
--- a/navit/gui/gtk/destination.c
+++ b/navit/gui/gtk/destination.c
@@ -164,7 +164,7 @@ static void row_activated(GtkWidget *widget, GtkTreePath *p1, GtkTreeViewColumn
char *str;
int column;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
gtk_tree_view_get_cursor(GTK_TREE_VIEW(search->treeview), &path, &focus_column);
if(!path)
return;
@@ -184,11 +184,11 @@ static void row_activated(GtkWidget *widget, GtkTreePath *p1, GtkTreeViewColumn
column=4;
break;
default:
- dbg(lvl_debug,"Unknown mode\n");
+ dbg(lvl_debug,"Unknown mode");
return;
}
gtk_tree_model_get(search->liststore2, &iter, column, &str, -1);
- dbg(lvl_debug,"str=%s\n", str);
+ dbg(lvl_debug,"str=%s", str);
search->partial=0;
gtk_entry_set_text(GTK_ENTRY(entry_widget), str);
}
@@ -222,13 +222,13 @@ static void changed(GtkWidget *widget, struct search_param *search)
printf("changed %s partial %d\n", search->attr.u.str, search->partial);
if (widget == search->entry_country) {
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (search->liststore2), 3, GTK_SORT_ASCENDING);
- dbg(lvl_debug,"country\n");
+ dbg(lvl_debug,"country");
search->attr.type=attr_country_all;
set_columns(search, 0);
}
if (widget == search->entry_postal) {
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (search->liststore2), 1, GTK_SORT_ASCENDING);
- dbg(lvl_debug,"postal\n");
+ dbg(lvl_debug,"postal");
search->attr.type=attr_town_postal;
if (strlen(search->attr.u.str) < 2)
return;
@@ -236,14 +236,14 @@ static void changed(GtkWidget *widget, struct search_param *search)
}
if (widget == search->entry_city) {
gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (search->liststore2), 2, GTK_SORT_ASCENDING);
- dbg(lvl_debug,"town\n");
+ dbg(lvl_debug,"town");
search->attr.type=attr_town_name;
if (strlen(search->attr.u.str) < 3)
return;
set_columns(search, 1);
}
if (widget == search->entry_street) {
- dbg(lvl_debug,"street\n");
+ dbg(lvl_debug,"street");
search->attr.type=attr_street_name;
// Searching for a street by just its first letter generates too many hits to be useful,
// plus it causes the GUI to become unresponsive because the search is single-threaded.
@@ -575,7 +575,7 @@ int destination_address(struct navit *nav)
gtk_entry_set_text(GTK_ENTRY(search->entry_country), country_name.u.str);
country_search_destroy(cs);
} else {
- dbg(lvl_error,"warning: no default country found\n");
+ dbg(lvl_error,"warning: no default country found");
}
search->partial=1;
return 0;
diff --git a/navit/gui/gtk/gui_gtk_action.c b/navit/gui/gtk/gui_gtk_action.c
index de5128756..469d04ec8 100644
--- a/navit/gui/gtk/gui_gtk_action.c
+++ b/navit/gui/gtk/gui_gtk_action.c
@@ -110,7 +110,7 @@ cursor_action(GtkWidget *w, struct gui_priv *gui, void *dummy)
attr.type=attr_cursor;
attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w));
if(!navit_set_attr(gui->nav, &attr)) {
- dbg(lvl_error, "Failed to set attr_cursor\n");
+ dbg(lvl_error, "Failed to set attr_cursor");
}
}
@@ -122,7 +122,7 @@ tracking_action(GtkWidget *w, struct gui_priv *gui, void *dummy)
attr.type=attr_tracking;
attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w));
if(!navit_set_attr(gui->nav, &attr)) {
- dbg(lvl_error, "Failed to set attr_tracking\n");
+ dbg(lvl_error, "Failed to set attr_tracking");
}
}
@@ -143,7 +143,7 @@ follow_vehicle_action(GtkWidget *w, struct gui_priv *gui, void *dummy)
attr.type=attr_follow_cursor;
attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w));
if(!navit_set_attr(gui->nav, &attr)) {
- dbg(lvl_error, "Failed to set attr_follow_gps\n");
+ dbg(lvl_error, "Failed to set attr_follow_gps");
}
}
@@ -155,7 +155,7 @@ orient_north_action(GtkWidget *w, struct gui_priv *gui, void *dummy)
attr.type=attr_orientation;
attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w)) ? 0:-1;
if(!navit_set_attr(gui->nav, &attr)) {
- dbg(lvl_error, "Failed to set attr_orientation\n");
+ dbg(lvl_error, "Failed to set attr_orientation");
}
}
diff --git a/navit/gui/gtk/gui_gtk_poi.c b/navit/gui/gtk/gui_gtk_poi.c
index a3578243b..d88b2de0f 100644
--- a/navit/gui/gtk/gui_gtk_poi.c
+++ b/navit/gui/gtk/gui_gtk_poi.c
@@ -35,6 +35,8 @@
#include "attr.h"
#include "util.h"
+#include "navigation.h" /* for KILOMETERS_TO_MILES */
+
static struct gtk_poi_search{
GtkWidget *entry_distance;
GtkWidget *label_distance;
@@ -55,7 +57,7 @@ geticon(const char *name){
GError *error=NULL;
icon=gdk_pixbuf_new_from_file(graphics_icon_path(name),&error);
if (error) {
- dbg(lvl_error, "failed to load icon '%s': %s\n", name, error->message);
+ dbg(lvl_error, "failed to load icon '%s': %s", name, error->message);
}
return icon;
}
@@ -108,18 +110,31 @@ model_poi (struct gtk_poi_search *search)
struct coord coord_item,center;
struct pcoord pc;
struct mapset_handle *h;
- int search_distance_meters,idist;
+ int search_distance_meters; /* distance to search the POI database, in meters, from the center of the screen. */
+ int idist; /* idist appears to be the distance in meters from the center of the screen to a POI. */
struct map *m;
struct map_rect *mr;
struct item *item;
struct point cursor_position;
enum item_type selected;
- search_distance_meters=1000*atoi((char *) gtk_entry_get_text(GTK_ENTRY(search->entry_distance)));
+ /* Respect the Imperial attribute as we enlighten the user. */
+ struct attr attr;
+ int imperial = FALSE; /* default to using metric measures. */
+ if (navit_get_attr(gtk_poi_search.nav, attr_imperial, &attr, NULL))
+ imperial=attr.u.num;
+
+ if (imperial == FALSE) {
+ /* Input is in kilometers */
+ search_distance_meters=1000*atoi((char *) gtk_entry_get_text(GTK_ENTRY(search->entry_distance)));
+ } else {
+ /* Input is in miles. */
+ search_distance_meters=atoi((char *) gtk_entry_get_text(GTK_ENTRY(search->entry_distance)))/METERS_TO_MILES;
+ }
cursor_position.x=navit_get_width(search->nav)/2;
cursor_position.y=navit_get_height(search->nav)/2;
- gtk_label_set_text(GTK_LABEL(search->label_distance),_("Distance from screen center (km)"));
+ gtk_label_set_text(GTK_LABEL(search->label_distance),_("Select a search radius from screen center"));
transform_reverse(navit_get_trans(search->nav), &cursor_position, &center);
pc.pro = transform_get_projection(navit_get_trans(search->nav));
@@ -146,6 +161,17 @@ model_poi (struct gtk_poi_search *search)
char direction[5];
gtk_list_store_append(search->store_poi, &iter);
get_compass_direction(direction,transform_get_angle_delta(&center,&coord_item,0),1);
+
+ /**
+ * If the user has selected imperial, translate idist from meters to
+ * feet. We convert to feet only, and not miles, because the code
+ * sorts on the numeric value of the distance, so it doesn't like two
+ * different units. Possible future enhancement?
+ */
+ if (imperial != FALSE) {
+ idist = idist * (FEET_PER_METER); /* convert meters to feet. */
+ }
+
gtk_list_store_set(search->store_poi, &iter, 0,direction, 1,idist,
2,g_strdup(label_attr.u.str), 3,coord_item.x, 4,coord_item.y ,-1);
}
@@ -228,7 +254,7 @@ button_destination_clicked(GtkWidget *widget, struct gtk_poi_search *search)
dest.y=lon;
dest.pro=1;
navit_set_destination(search->nav, &dest, buffer, 1);
- dbg(lvl_debug,_("Set destination to %ld, %ld \n"),lat,lon);
+ dbg(lvl_debug,_("Set destination to %ld, %ld "),lat,lon);
}
/* Show the POI's position in the map. */
@@ -251,7 +277,7 @@ button_map_clicked(GtkWidget *widget, struct gtk_poi_search *search)
dest.y=lon;
dest.pro=1;
navit_set_center(search->nav, &dest,1);
- dbg(lvl_debug,_("Set map to %ld, %ld \n"),lat,lon);
+ dbg(lvl_debug,_("Set map to %ld, %ld "),lat,lon);
}
/** Set POI as the first "visit before". */
@@ -268,7 +294,7 @@ button_visit_clicked(GtkWidget *widget, struct gtk_poi_search *search)
if(!gtk_tree_model_get_iter(GTK_TREE_MODEL(search->store_poi_sorted), &iter, path)) return;
gtk_tree_model_get(GTK_TREE_MODEL(search->store_poi_sorted), &iter, 3, &lat, -1);
gtk_tree_model_get(GTK_TREE_MODEL(search->store_poi_sorted), &iter, 4, &lon, -1);
- dbg(lvl_debug,_("Set next visit to %ld, %ld \n"),lat,lon);
+ dbg(lvl_debug,_("Set next visit to %ld, %ld "),lat,lon);
struct pcoord dest;
dest.x=lat;
diff --git a/navit/gui/gtk/gui_gtk_window.c b/navit/gui/gtk/gui_gtk_window.c
index 1741a54a0..c50aa2dcc 100644
--- a/navit/gui/gtk/gui_gtk_window.c
+++ b/navit/gui/gtk/gui_gtk_window.c
@@ -85,7 +85,7 @@ keypress(GtkWidget *widget, GdkEventKey *event, struct gui_priv *this)
struct point p;
if (event->type != GDK_KEY_PRESS)
return FALSE;
- dbg(lvl_debug,"keypress 0x%x\n", event->keyval);
+ dbg(lvl_debug,"keypress 0x%x", event->keyval);
transform_get_size(navit_get_trans(this->nav), &w, &h);
switch (event->keyval) {
case GDK_KP_Enter:
@@ -313,19 +313,19 @@ gui_gtk_toggle_init(struct gui_priv *this)
toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "CursorAction"));
gtk_toggle_action_set_active(toggle_action, attr.u.num);
} else {
- dbg(lvl_warning, "Unable to locate CursorAction\n");
+ dbg(lvl_warning, "Unable to locate CursorAction");
}
if (navit_get_attr(this->nav, attr_orientation, &attr, NULL)) {
toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "OrientationAction"));
gtk_toggle_action_set_active(toggle_action, attr.u.num != -1);
} else {
- dbg(lvl_error, "Unable to locate OrientationAction\n");
+ dbg(lvl_error, "Unable to locate OrientationAction");
}
if (navit_get_attr(this->nav, attr_tracking, &attr, NULL)) {
toggle_action = GTK_TOGGLE_ACTION(gtk_action_group_get_action(this->base_group, "TrackingAction"));
gtk_toggle_action_set_active(toggle_action, attr.u.num);
} else {
- dbg(lvl_error, "Unable to locate TrackingAction\n");
+ dbg(lvl_error, "Unable to locate TrackingAction");
}
}
@@ -478,7 +478,7 @@ gui_gtk_vehicles_update(struct gui_priv *this)
char *name;
GList *curr;
struct gui_menu_info *meninfo;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
curr = g_list_first(this->vehicle_menuitems);
diff --git a/navit/gui/internal/gui_internal.c b/navit/gui/internal/gui_internal.c
index a571a827c..d634470f0 100644
--- a/navit/gui/internal/gui_internal.c
+++ b/navit/gui/internal/gui_internal.c
@@ -134,10 +134,10 @@ image_new_scaled(struct gui_priv *this, const char *name, int w, int h)
char *full_path=NULL;
full_path=graphics_icon_path(name);
ret=graphics_image_new_scaled(this->gra, full_path, w, h);
- dbg(lvl_debug,"Trying to load image '%s' (w=%d, h=%d): %s\n", name, w, h, ret ? "OK" : "NOT FOUND");
+ dbg(lvl_debug,"Trying to load image '%s' (w=%d, h=%d): %s", name, w, h, ret ? "OK" : "NOT FOUND");
g_free(full_path);
if (!ret) {
- dbg(lvl_error,"Failed to load image for '%s' (w=%d, h=%d)\n", name, w, h);
+ dbg(lvl_error,"Failed to load image for '%s' (w=%d, h=%d)", name, w, h);
full_path=graphics_icon_path("unknown");
ret=graphics_image_new_scaled(this->gra, full_path, w, h);
g_free(full_path);
@@ -508,7 +508,7 @@ gui_internal_apply_config(struct gui_priv *this)
{
struct gui_config_settings * current_config=0;
- dbg(lvl_debug,"w=%d h=%d\n", this->root.w, this->root.h);
+ dbg(lvl_debug,"w=%d h=%d", this->root.w, this->root.h);
/*
* Select default values from profile based on the screen.
*/
@@ -593,7 +593,7 @@ static void
gui_internal_cmd_set_destination(struct gui_priv *this, struct widget *wm, void *data)
{
char *name=data;
- dbg(lvl_info,"c=%d:0x%x,0x%x\n", wm->c.pro, wm->c.x, wm->c.y);
+ dbg(lvl_info,"c=%d:0x%x,0x%x", wm->c.pro, wm->c.x, wm->c.y);
navit_set_destination(this->nav, &wm->c, name, 1);
if (this->flags & 512) {
struct attr follow;
@@ -848,13 +848,13 @@ gui_internal_cmd_view_attributes(struct gui_priv *this, struct widget *wm, void
char *text;
int count=0;
- dbg(lvl_info,"item=%p 0x%x 0x%x\n", wm->item.map,wm->item.id_hi, wm->item.id_lo);
+ dbg(lvl_info,"item=%p 0x%x 0x%x", wm->item.map,wm->item.id_hi, wm->item.id_lo);
wb=gui_internal_menu(this, "Attributes");
w=gui_internal_box_new(this, gravity_top_center|orientation_vertical|flags_expand|flags_fill);
gui_internal_widget_append(wb, w);
mr=map_rect_new(wm->item.map, NULL);
item = map_rect_get_item_byid(mr, wm->item.id_hi, wm->item.id_lo);
- dbg(lvl_info,"item=%p\n", item);
+ dbg(lvl_info,"item=%p", item);
if (item) {
text=g_strdup_printf("%s:%s", _("Item type"), item_to_name(item->type));
gui_internal_widget_append(w,
@@ -896,10 +896,10 @@ gui_internal_cmd_view_in_browser(struct gui_priv *this, struct widget *wm, void
char *cmd=NULL;
if (!wm->name) {
- dbg(lvl_info,"item=%p 0x%x 0x%x\n", wm->item.map,wm->item.id_hi, wm->item.id_lo);
+ dbg(lvl_info,"item=%p 0x%x 0x%x", wm->item.map,wm->item.id_hi, wm->item.id_lo);
mr=map_rect_new(wm->item.map, NULL);
item = map_rect_get_item_byid(mr, wm->item.id_hi, wm->item.id_lo);
- dbg(lvl_info,"item=%p\n", item);
+ dbg(lvl_info,"item=%p", item);
if (item) {
while(item_attr_get(item, attr_url_local, &attr)) {
if (! cmd)
@@ -914,7 +914,7 @@ gui_internal_cmd_view_in_browser(struct gui_priv *this, struct widget *wm, void
#ifdef HAVE_SYSTEM
system(cmd);
#else
- dbg(lvl_error,"Error: External commands were disabled during compilation, cannot call '%s'.\n",cmd);
+ dbg(lvl_error,"Error: External commands were disabled during compilation, cannot call '%s'.",cmd);
#endif
g_free(cmd);
}
@@ -1004,7 +1004,7 @@ gui_internal_cmd_results_to_map(struct gui_priv *this, struct widget *wm, void *
if(!w) {
map_rect_destroy(mr);
- dbg(lvl_warning,"Can't find the results table - only map clean up is done.\n");
+ dbg(lvl_warning,"Can't find the results table - only map clean up is done.");
return;
}
@@ -1016,7 +1016,7 @@ gui_internal_cmd_results_to_map(struct gui_priv *this, struct widget *wm, void *
struct item* it;
if(wi->name==NULL)
continue;
- dbg(lvl_info,"%s\n",wi->name);
+ dbg(lvl_info,"%s",wi->name);
it=map_rect_create_item(mr,type_found_item);
if(it) {
struct coord c;
@@ -1132,7 +1132,7 @@ gui_internal_cmd_position_do(struct gui_priv *this, struct pcoord *pc_in, struct
pc=*pc_in;
c.x=pc.x;
c.y=pc.y;
- dbg(lvl_info,"x=0x%x y=0x%x\n", c.x, c.y);
+ dbg(lvl_info,"x=0x%x y=0x%x", c.x, c.y);
transform_to_geo(pc.pro, &c, &g);
} else if (g_in) {
struct attr attr;
@@ -1576,7 +1576,7 @@ gui_internal_cmd_bookmarks(struct gui_priv *this, struct widget *wm, void *data)
while ((item=bookmarks_get_item(mattr.u.bookmarks))) {
if (!item_attr_get(item, attr_label, &attr)) continue;
label_full=map_convert_string_tmp(item->map,attr.u.str);
- dbg(lvl_info,"full_labled: %s\n",label_full);
+ dbg(lvl_info,"full_labled: %s",label_full);
// hassub == 1 if the item type is a sub-folder
if (item->type == type_bookmark_folder) {
@@ -1658,7 +1658,7 @@ gui_internal_keypress_do(struct gui_priv *this, char *key)
}
return;
} else if (*key == NAVIT_KEY_BACKSPACE) {
- dbg(lvl_debug,"backspace\n");
+ dbg(lvl_debug,"backspace");
if (wi->text && wi->text[0]) {
len=g_utf8_prev_char(wi->text+strlen(wi->text))-wi->text;
wi->text[len]='\0';
@@ -1666,11 +1666,11 @@ gui_internal_keypress_do(struct gui_priv *this, char *key)
}
} else {
if (wi->state & STATE_CLEAR) {
- dbg(lvl_info,"wi->state=0x%x\n", wi->state);
+ dbg(lvl_info,"wi->state=0x%x", wi->state);
g_free(wi->text);
wi->text=NULL;
wi->state &= ~STATE_CLEAR;
- dbg(lvl_info,"wi->state=0x%x\n", wi->state);
+ dbg(lvl_info,"wi->state=0x%x", wi->state);
}
text=g_strdup_printf("%s%s", wi->text ? wi->text : "", key);
@@ -1760,7 +1760,7 @@ gui_internal_set(char *remove, char *add)
int len=strlen(line);
if (len > 0 && line[len-1] == '\n')
line[len-1]='\0';
- dbg(lvl_debug,"line=%s\n",line);
+ dbg(lvl_debug,"line=%s",line);
if (!gui_internal_match(remove, line))
fprintf(fo,"%s\n",line);
}
@@ -1819,12 +1819,12 @@ gui_internal_cmd_map_download_do(struct gui_priv *this, struct widget *wm, void
sel.range.max=type_last;
mr=map_rect_new(map, &sel);
while ((item=map_rect_get_item(mr))) {
- dbg(lvl_info,"item\n");
+ dbg(lvl_info,"item");
}
map_rect_destroy(mr);
}
- dbg(lvl_info,"bbox=%s\n",wm->prefix);
+ dbg(lvl_info,"bbox=%s",wm->prefix);
gui_internal_menu_render(this);
}
@@ -1838,7 +1838,7 @@ gui_internal_cmd_map_download(struct gui_priv *this, struct widget *wm, void *da
char *search,buffer[256];
int found,sp_match=0;
- dbg(lvl_debug,"wm=%p prefix=%s\n",wm,wm->prefix);
+ dbg(lvl_debug,"wm=%p prefix=%s",wm,wm->prefix);
search=wm->prefix;
if (search) {
@@ -2048,14 +2048,14 @@ gui_internal_cmd_set_active_profile(struct gui_priv *this, struct
vehicle_get_attr(v, attr_name, &vehicle_name_attr, NULL);
vehicle_name = vehicle_name_attr.u.str;
- dbg(lvl_debug, "Changing vehicle %s to profile %s\n", vehicle_name,
+ dbg(lvl_debug, "Changing vehicle %s to profile %s", vehicle_name,
profilename);
// Change the profile name
profilename_attr.type = attr_profilename;
profilename_attr.u.str = profilename;
if(!vehicle_set_attr(v, &profilename_attr)) {
- dbg(lvl_error, "Unable to set the vehicle's profile name\n");
+ dbg(lvl_error, "Unable to set the vehicle's profile name");
}
navit_set_vehicleprofile_name(this->nav,profilename);
@@ -2115,7 +2115,7 @@ gui_internal_add_vehicle_profile(struct gui_priv *this, struct widget
active_profile = profile_attr.u.str;
active = active_profile != NULL && !strcmp(name, active_profile);
- dbg(lvl_debug, "Adding vehicle profile %s, active=%s/%i\n", name,
+ dbg(lvl_debug, "Adding vehicle profile %s, active=%s/%i", name,
active_profile, active);
// Build a translatable label.
@@ -2262,7 +2262,7 @@ gui_internal_set_click_coord(struct gui_priv *this, struct point *p)
if (p) {
trans=navit_get_trans(this->nav);
transform_reverse(trans, p, &c);
- dbg(lvl_debug,"x=0x%x y=0x%x\n", c.x, c.y);
+ dbg(lvl_debug,"x=0x%x y=0x%x", c.x, c.y);
this->clickp.pro=transform_get_projection(trans);
this->clickp.x=c.x;
this->clickp.y=c.y;
@@ -2303,7 +2303,7 @@ gui_internal_enter_setup(struct gui_priv *this)
void
gui_internal_cmd_menu(struct gui_priv *this, int ignore, char *href)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
gui_internal_enter(this, ignore);
gui_internal_enter_setup(this);
// draw menu
@@ -2423,7 +2423,7 @@ gui_internal_set_attr(struct gui_priv *this, struct attr *attr)
this->on_map_click=g_strdup(attr->u.str);
return 1;
default:
- dbg(lvl_error,"Unknown attribute: %s\n",attr_to_name(attr->type));
+ dbg(lvl_error,"Unknown attribute: %s",attr_to_name(attr->type));
return 1;
}
}
@@ -2491,7 +2491,7 @@ gui_internal_coordinate_parse(char *s, char plus, char minus, double *x)
sscanf(degree, "%lf", x);
if(strchr(degree, plus) || strchr(degree, minus)) {
- dbg(lvl_debug,"degree %c/%c found\n",plus,minus);
+ dbg(lvl_debug,"degree %c/%c found",plus,minus);
} else {/* DEGREES_MINUTES */
if(!minute)
return 0;
@@ -2499,7 +2499,7 @@ gui_internal_coordinate_parse(char *s, char plus, char minus, double *x)
sscanf(minute, "%lf", &tmp);
*x+=tmp/60;
if(strchr(minute, plus) || strchr(minute, minus)) {
- dbg(lvl_debug,"minute %c/%c found\n",plus,minus);
+ dbg(lvl_debug,"minute %c/%c found",plus,minus);
} else { /* DEGREES_MINUTES_SECONDS */
second=strtok(NULL,"");
if(!second)
@@ -2523,7 +2523,7 @@ gui_internal_cmd_enter_coord_do(struct gui_priv *this, struct widget *widget)
char *lat, *lng;
char *widgettext;
double latitude, longitude;
- dbg(lvl_debug,"text entered:%s\n", widget->text);
+ dbg(lvl_debug,"text entered:%s", widget->text);
/* possible entry can be identical to coord_format output but only space between lat and lng is allowed */
widgettext=g_ascii_strup(widget->text,-1);
@@ -2556,7 +2556,7 @@ gui_internal_cmd_enter_coord_do(struct gui_priv *this, struct widget *widget)
void
gui_internal_cmd_enter_coord_clicked(struct gui_priv *this, struct widget *widget, void *data)
{
- dbg(lvl_debug,"entered\n");
+ dbg(lvl_debug,"entered");
gui_internal_cmd_enter_coord_do(this, widget->data);
}
@@ -2570,18 +2570,18 @@ static void gui_internal_button(void *data, int pressed, int button, struct poin
struct gui_priv *this=data;
struct graphics *gra=this->gra;
- dbg(lvl_debug,"enter %d %d\n", pressed, button);
+ dbg(lvl_debug,"enter %d %d", pressed, button);
// if still on the map (not in the menu, yet):
- dbg(lvl_debug,"children=%p ignore_button=%d\n",this->root.children,this->ignore_button);
+ dbg(lvl_debug,"children=%p ignore_button=%d",this->root.children,this->ignore_button);
if (!this->root.children || this->ignore_button) {
this->ignore_button=0;
// check whether the position of the mouse changed during press/release OR if it is the scrollwheel
if (!navit_handle_button(this->nav, pressed, button, p, NULL)) {
- dbg(lvl_debug,"navit has handled button\n");
+ dbg(lvl_debug,"navit has handled button");
return;
}
- dbg(lvl_debug,"menu_on_map_click=%d\n",this->menu_on_map_click);
+ dbg(lvl_debug,"menu_on_map_click=%d",this->menu_on_map_click);
if (button != 1)
return;
if (this->on_map_click || this->menu_on_map_click) {
@@ -2688,7 +2688,7 @@ static void gui_internal_resize(void *data, int w, int h)
*/
if (!changed && this->gra && graphics_get_data(this->gra, "padding"))
changed = 1;
- dbg(lvl_debug,"w=%d h=%d children=%p\n", w, h, this->root.children);
+ dbg(lvl_debug,"w=%d h=%d children=%p", w, h, this->root.children);
navit_handle_resize(this->nav, w, h);
if (this->root.children) {
if (changed) {
@@ -2805,7 +2805,7 @@ gui_internal_keynav_find_closest(struct widget *wi, struct point *p, int dx, int
if (dist1 < 0)
dist1=-dist1;
}
- dbg(lvl_debug,"checking %d,%d %d %d against %d,%d-%d,%d result %d,%d\n", p->x, p->y, dx, dy, wi->p.x, wi->p.y, wi->p.x+wi->w, wi->p.y+wi->h, dist1, dist2);
+ dbg(lvl_debug,"checking %d,%d %d %d against %d,%d-%d,%d result %d,%d", p->x, p->y, dx, dy, wi->p.x, wi->p.y, wi->p.x+wi->w, wi->p.y+wi->h, dist1, dist2);
if (dist1 >= 0) {
if (dist2 < 0)
dist1-=dist2;
@@ -2855,7 +2855,7 @@ gui_internal_keynav_highlight_next(struct gui_priv *this, int dx, int dy, int ro
gui_internal_keynav_find_closest(menu, &p, 0, 0, &distance, &result);
if (result) {
gui_internal_keynav_point(result, dx, dy, &p);
- dbg(lvl_debug,"result origin=%p p=%d,%d\n", result, p.x, p.y);
+ dbg(lvl_debug,"result origin=%p p=%d,%d", result, p.x, p.y);
current_highlight = result;
}
}
@@ -2867,7 +2867,7 @@ gui_internal_keynav_highlight_next(struct gui_priv *this, int dx, int dy, int ro
gui_internal_keynav_find_prev(menu, current_highlight, &result);
else
gui_internal_keynav_find_closest(menu, &p, dx, dy, &distance, &result);
- dbg(lvl_debug,"result=%p\n", result);
+ dbg(lvl_debug,"result=%p", result);
if (! result) {
if (dx < 0) {
p.x=this->root.w;
@@ -2884,7 +2884,7 @@ gui_internal_keynav_highlight_next(struct gui_priv *this, int dx, int dy, int ro
result=NULL;
distance=INT_MAX;
gui_internal_keynav_find_closest(menu, &p, dx, dy, &distance, &result);
- dbg(lvl_debug,"wraparound result=%p\n", result);
+ dbg(lvl_debug,"wraparound result=%p", result);
}
gui_internal_highlight_do(this, result);
if (result)
@@ -2992,7 +2992,7 @@ static int gui_internal_set_graphics(struct gui_priv *this, struct graphics *gra
win=graphics_get_data(gra, "window");
if (! win) {
- dbg(lvl_error, "failed to obtain window from graphics plugin, cannot set graphics\n");
+ dbg(lvl_error, "failed to obtain window from graphics plugin, cannot set graphics");
return 1;
}
navit_ignore_graphics_events(this->nav, 1);
@@ -3156,10 +3156,10 @@ line_intersection(struct coord* a1, struct coord *a2, struct coord * b1, struct
if (a > n || b > n)
return FALSE;
if (n == 0) {
- dbg(lvl_info,"a=%d b=%d n=%d\n", a, b, n);
- dbg(lvl_info,"a1=0x%x,0x%x ad %d,%d\n", a1->x, a1->y, adx, ady);
- dbg(lvl_info,"b1=0x%x,0x%x bd %d,%d\n", b1->x, b1->y, bdx, bdy);
- dbg(lvl_info,"No intersection found, lines assumed parallel ?\n");
+ dbg(lvl_info,"a=%d b=%d n=%d", a, b, n);
+ dbg(lvl_info,"a1=0x%x,0x%x ad %d,%d", a1->x, a1->y, adx, ady);
+ dbg(lvl_info,"b1=0x%x,0x%x bd %d,%d", b1->x, b1->y, bdx, bdy);
+ dbg(lvl_info,"No intersection found, lines assumed parallel ?");
return FALSE;
}
res->x = a1->x + a * adx / n;
diff --git a/navit/gui/internal/gui_internal_bookmark.c b/navit/gui/internal/gui_internal_bookmark.c
index eed0de123..7ae4df68e 100644
--- a/navit/gui/internal/gui_internal_bookmark.c
+++ b/navit/gui/internal/gui_internal_bookmark.c
@@ -21,7 +21,7 @@ gui_internal_cmd_add_bookmark_do(struct gui_priv *this, struct widget *widget)
{
GList *l;
struct attr attr;
- dbg(lvl_debug,"text='%s'\n", widget->text);
+ dbg(lvl_debug,"text='%s'", widget->text);
if (widget->text && strlen(widget->text)){
navit_get_attr(this->nav, attr_bookmarks, &attr, NULL);
bookmarks_add_bookmark(attr.u.bookmarks, &widget->c, widget->text);
@@ -37,7 +37,7 @@ gui_internal_cmd_add_bookmark_folder_do(struct gui_priv *this, struct widget *wi
{
GList *l;
struct attr attr;
- dbg(lvl_debug,"text='%s'\n", widget->text);
+ dbg(lvl_debug,"text='%s'", widget->text);
if (widget->text && strlen(widget->text)){
navit_get_attr(this->nav, attr_bookmarks, &attr, NULL);
bookmarks_add_bookmark(attr.u.bookmarks, NULL, widget->text);
@@ -66,7 +66,7 @@ gui_internal_cmd_rename_bookmark_clicked(struct gui_priv *this, struct widget *w
struct widget *w=(struct widget*)widget->data;
GList *l;
struct attr attr;
- dbg(lvl_debug,"text='%s'\n", w->text);
+ dbg(lvl_debug,"text='%s'", w->text);
if (w->text && strlen(w->text)){
navit_get_attr(this->nav, attr_bookmarks, &attr, NULL);
bookmarks_rename_bookmark(attr.u.bookmarks, w->name, w->text);
diff --git a/navit/gui/internal/gui_internal_command.c b/navit/gui/internal/gui_internal_command.c
index 1eb1163cb..19f0550dc 100644
--- a/navit/gui/internal/gui_internal_command.c
+++ b/navit/gui/internal/gui_internal_command.c
@@ -161,11 +161,11 @@ gui_internal_cmd_escape(struct gui_priv *this, char *function, struct attr **in,
{
struct attr escaped;
if (!in || !in[0]) {
- dbg(lvl_error,"first parameter missing or wrong type\n");
+ dbg(lvl_error,"first parameter missing or wrong type");
return;
}
if (!out) {
- dbg(lvl_error,"output missing\n");
+ dbg(lvl_error,"output missing");
return;
}
if (ATTR_IS_STRING(in[0]->type)) {
@@ -175,10 +175,10 @@ gui_internal_cmd_escape(struct gui_priv *this, char *function, struct attr **in,
escaped.type=attr_type_string_begin;
escaped.u.str=g_strdup_printf("%ld",in[0]->u.num);
} else {
- dbg(lvl_error,"first parameter wrong type\n");
+ dbg(lvl_error,"first parameter wrong type");
return;
}
- dbg(lvl_debug,"in %s result %s\n",in[0]->u.str,escaped.u.str);
+ dbg(lvl_debug,"in %s result %s",in[0]->u.str,escaped.u.str);
*out=attr_generic_add_attr(*out, attr_dup(&escaped));
g_free(escaped.u.str);
}
@@ -515,14 +515,14 @@ gui_internal_cmd2_route_height_profile(struct gui_priv *this, char *function, st
while ((map=mapset_next(msh, 1))) {
struct attr data_attr;
if (map_get_attr(map, attr_data, &data_attr, NULL)){
- dbg(lvl_debug,"map name = %s\n",data_attr.u.str);
+ dbg(lvl_debug,"map name = %s",data_attr.u.str);
if (strstr(data_attr.u.str,".heightlines.bin")){
- dbg(lvl_info,"reading heightlines from map %s\n",data_attr.u.str);
+ dbg(lvl_info,"reading heightlines from map %s",data_attr.u.str);
mr=map_rect_new(map, &sel);
heightmap_installed = TRUE;
}
else {
- dbg(lvl_debug,"ignoring map %s\n",data_attr.u.str);
+ dbg(lvl_debug,"ignoring map %s",data_attr.u.str);
}
}
if (mr) {
@@ -580,7 +580,7 @@ gui_internal_cmd2_route_height_profile(struct gui_priv *this, char *function, st
diagram_point->next=diagram_points;
diagram_points=diagram_point;
diagram_points_count ++;
- dbg(lvl_debug,"%d %d\n", diagram_point->c.x, diagram_point->c.y);
+ dbg(lvl_debug,"%d %d", diagram_point->c.x, diagram_point->c.y);
max_ele=MAX(max_ele, diagram_point->c.y);
min_ele=MIN(min_ele, diagram_point->c.y);
distance=diagram_point->c.x;
@@ -629,12 +629,12 @@ gui_internal_cmd2_route_height_profile(struct gui_priv *this, char *function, st
coord_rect_extend(&dbbox, &diagram_point->c);
diagram_point=diagram_point->next;
}
- dbg(lvl_debug,"%d %d %d %d\n", dbbox.lu.x, dbbox.lu.y, dbbox.rl.x, dbbox.rl.y);
+ dbg(lvl_debug,"%d %d %d %d", dbbox.lu.x, dbbox.lu.y, dbbox.rl.x, dbbox.rl.y);
if (dbbox.rl.x > dbbox.lu.x && dbbox.lu.x*100/(dbbox.rl.x-dbbox.lu.x) <= 25)
dbbox.lu.x=0;
if (dbbox.lu.y > dbbox.rl.y && dbbox.rl.y*100/(dbbox.lu.y-dbbox.rl.y) <= 25)
dbbox.rl.y=0;
- dbg(lvl_debug,"%d,%d %dx%d\n", box->p.x, box->p.y, box->w, box->h);
+ dbg(lvl_debug,"%d,%d %dx%d", box->p.x, box->p.y, box->w, box->h);
x=dbbox.lu.x;
first=1;
if (diagram_points_count > 1 && dbbox.rl.x != dbbox.lu.x && dbbox.lu.y != dbbox.rl.y){
@@ -650,7 +650,7 @@ gui_internal_cmd2_route_height_profile(struct gui_priv *this, char *function, st
break;
p[1].x=(min->c.x-dbbox.lu.x)*(box->w-10)/(dbbox.rl.x-dbbox.lu.x)+box->p.x+5;
p[1].y=(box->h)-5-(min->c.y-dbbox.rl.y)*(box->h-10)/(dbbox.lu.y-dbbox.rl.y)+box->p.y;
- dbg(lvl_debug,"%d,%d=%d,%d\n",min->c.x, min->c.y, p[1].x,p[1].y);
+ dbg(lvl_debug,"%d,%d=%d,%d",min->c.x, min->c.y, p[1].x,p[1].y);
graphics_draw_circle(this->gra, this->foreground, &p[1], 2);
if (first)
first=0;
@@ -726,7 +726,7 @@ gui_internal_cmd2_pois(struct gui_priv *this, char *function, struct attr **in,
struct attr pro;
struct coord c;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (!in || !in[0])
return;
if (!ATTR_IS_COORD_GEO(in[0]->type))
@@ -843,7 +843,7 @@ gui_internal_cmd2_network_info(struct gui_priv *this, char *function, struct att
gui_internal_menu_render(this);
graphics_draw_mode(this->gra, draw_mode_end);
#else
- dbg(lvl_error, "Cannot show network info: ifaddr.h not found\n");
+ dbg(lvl_error, "Cannot show network info: ifaddr.h not found");
#endif
}
@@ -1019,7 +1019,7 @@ gui_internal_cmd2_position(struct gui_priv *this, char *function, struct attr **
const char *name=_("Position");
int flags=-1;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (!in || !in[0])
return;
if (!ATTR_IS_COORD_GEO(in[0]->type))
@@ -1029,7 +1029,7 @@ gui_internal_cmd2_position(struct gui_priv *this, char *function, struct attr **
if (in[2] && ATTR_IS_INT(in[2]->type))
flags=in[2]->u.num;
}
- dbg(lvl_debug,"flags=0x%x\n",flags);
+ dbg(lvl_debug,"flags=0x%x",flags);
gui_internal_cmd_position_do(this, NULL, in[0]->u.coord_geo, NULL, name, flags);
}
@@ -1052,14 +1052,14 @@ gui_internal_cmd2_set(struct gui_priv *this, char *function, struct attr **in, s
{
char *pattern,*command=NULL;
if (!in || !in[0] || !ATTR_IS_STRING(in[0]->type)) {
- dbg(lvl_error,"first parameter missing or wrong type\n");
+ dbg(lvl_error,"first parameter missing or wrong type");
return;
}
pattern=in[0]->u.str;
- dbg(lvl_debug,"pattern %s\n",pattern);
+ dbg(lvl_debug,"pattern %s",pattern);
if (in[1]) {
command=gui_internal_cmd_match_expand(pattern, in+1);
- dbg(lvl_debug,"expand %s\n",command);
+ dbg(lvl_debug,"expand %s",command);
gui_internal_set(pattern, command);
command_evaluate(&this->self, command);
g_free(command);
@@ -1103,7 +1103,7 @@ static void
gui_internal_cmd_write(struct gui_priv * this, char *function, struct attr **in, struct attr ***out, int *valid)
{
char *str=NULL;
- dbg(lvl_debug,"enter %s %p %p %p\n",function,in,out,valid);
+ dbg(lvl_debug,"enter %s %p %p %p",function,in,out,valid);
if (!in)
return;
while (*in) {
@@ -1113,7 +1113,7 @@ gui_internal_cmd_write(struct gui_priv * this, char *function, struct attr **in,
if (str) {
str=g_strdup_printf("<html>%s</html>\n",str);
#if 0
- dbg(lvl_debug,"%s\n",str);
+ dbg(lvl_debug,"%s",str);
#endif
gui_internal_html_parse_text(this, str);
}
@@ -1136,11 +1136,11 @@ gui_internal_onclick(struct attr ***in, char **onclick, char *set)
char format[4],*end=strchr(c+2,'}'),*replacement=NULL,*new_str;
int is_arg;
if (!end) {
- dbg(lvl_error,"Missing closing brace in format string %s\n",c);
+ dbg(lvl_error,"Missing closing brace in format string %s",c);
goto error;
}
if (end-c > sizeof(format)) {
- dbg(lvl_error,"Invalid format string %s\n",c);
+ dbg(lvl_error,"Invalid format string %s",c);
goto error;
}
strncpy(format, c+2, end-c-2);
@@ -1167,7 +1167,7 @@ gui_internal_onclick(struct attr ***in, char **onclick, char *set)
}
}
if (!replacement) {
- dbg(lvl_error,"Unsupported format string %s\n",format);
+ dbg(lvl_error,"Unsupported format string %s",format);
goto error;
}
new_str=g_strconcat(str, replacement, end+1, NULL);
@@ -1210,7 +1210,7 @@ gui_internal_cmd_img(struct gui_priv * this, char *function, struct attr **in, s
str=gui_internal_append_attr(str, escape_mode_string|escape_mode_html, " class=", *in, "");
in++;
} else {
- dbg(lvl_error,"argument error: class argument not string\n");
+ dbg(lvl_error,"argument error: class argument not string");
goto error;
}
if (ATTR_IS_STRING((*in)->type) && (*in)->u.str) {
@@ -1219,7 +1219,7 @@ gui_internal_cmd_img(struct gui_priv * this, char *function, struct attr **in, s
}
in++;
} else {
- dbg(lvl_error,"argument error: image argument not string\n");
+ dbg(lvl_error,"argument error: image argument not string");
goto error;
}
if (ATTR_IS_STRING((*in)->type) && (*in)->u.str) {
@@ -1230,7 +1230,7 @@ gui_internal_cmd_img(struct gui_priv * this, char *function, struct attr **in, s
}
in++;
} else {
- dbg(lvl_error,"argument error: text argument not string\n");
+ dbg(lvl_error,"argument error: text argument not string");
goto error;
}
gui_internal_onclick(&in,&onclick,NULL);
@@ -1256,16 +1256,16 @@ static void
gui_internal_cmd_debug(struct gui_priv * this, char *function, struct attr **in, struct attr ***out, int *valid)
{
char *str;
- dbg(lvl_debug,"begin\n");
+ dbg(lvl_debug,"begin");
if (in) {
while (*in) {
str=attr_to_text(*in, NULL, 0);
- dbg(lvl_debug,"%s:%s\n",attr_to_name((*in)->type),str);
+ dbg(lvl_debug,"%s:%s",attr_to_name((*in)->type),str);
in++;
g_free(str);
}
}
- dbg(lvl_debug,"done\n");
+ dbg(lvl_debug,"done");
}
static void
diff --git a/navit/gui/internal/gui_internal_gesture.c b/navit/gui/internal/gui_internal_gesture.c
index d01a80f1d..3ab0ec46b 100644
--- a/navit/gui/internal/gui_internal_gesture.c
+++ b/navit/gui/internal/gui_internal_gesture.c
@@ -61,7 +61,7 @@ gui_internal_gesture_ring_add(struct gui_priv *this, struct point *p)
}
this->gesture_ring[this->gesture_ring_last].p=*p;
this->gesture_ring[this->gesture_ring_last].msec=msec;
- dbg(lvl_info,"msec="LONGLONG_FMT" x=%d y=%d\n",msec,p->x,p->y);
+ dbg(lvl_info,"msec="LONGLONG_FMT" x=%d y=%d",msec,p->x,p->y);
};
int
@@ -89,7 +89,7 @@ gui_internal_gesture_get_vector(struct gui_priv *this, long long msec, struct po
*p0=g->p;
}
msec=g->msec;
- dbg(lvl_info,LONGLONG_FMT" %d %d\n",g->msec, g->p.x, g->p.y);
+ dbg(lvl_info,LONGLONG_FMT" %d %d",g->msec, g->p.x, g->p.y);
for(i=1;(g=gui_internal_gesture_ring_get(this,i))!=NULL;i++) {
if( msec-g->msec > 1000 )
break;
@@ -99,7 +99,7 @@ gui_internal_gesture_get_vector(struct gui_priv *this, long long msec, struct po
if(p0) {
*p0=g->p;
}
- dbg(lvl_info,LONGLONG_FMT" %d %d\n",g->msec, g->p.x, g->p.y);
+ dbg(lvl_info,LONGLONG_FMT" %d %d",g->msec, g->p.x, g->p.y);
}
return dt;
}
@@ -114,7 +114,7 @@ gui_internal_gesture_do(struct gui_priv *this)
if( abs(dx) > this->icon_s*3 && abs(dy) < this->icon_s ) {
struct widget *wt;
- dbg(lvl_debug,"horizontal dx=%d dy=%d\n",dx,dy);
+ dbg(lvl_debug,"horizontal dx=%d dy=%d",dx,dy);
/* Prevent swiping if widget was scrolled beforehand */
if(this->pressed==2)
@@ -133,11 +133,11 @@ gui_internal_gesture_do(struct gui_priv *this)
gui_internal_table_button_prev(this,NULL,wt);
return 1;
} else if( abs(dy) > this->icon_s*3 && abs(dx) < this->icon_s ) {
- dbg(lvl_debug,"vertical dx=%d dy=%d\n",dx,dy);
+ dbg(lvl_debug,"vertical dx=%d dy=%d",dx,dy);
} else if (dt>300 && abs(dx) <this->icon_s && abs(dy) <this->icon_s ) {
- dbg(lvl_debug,"longtap dx=%d dy=%d\n",dx,dy);
+ dbg(lvl_debug,"longtap dx=%d dy=%d",dx,dy);
} else {
- dbg(lvl_debug,"none dx=%d dy=%d\n",dx,dy);
+ dbg(lvl_debug,"none dx=%d dy=%d",dx,dy);
}
return 0;
diff --git a/navit/gui/internal/gui_internal_html.c b/navit/gui/internal/gui_internal_html.c
index 9b42fbdec..7035920a0 100644
--- a/navit/gui/internal/gui_internal_html.c
+++ b/navit/gui/internal/gui_internal_html.c
@@ -96,7 +96,7 @@ gui_internal_html_submit(struct gui_priv *this, struct widget *w, void *data)
struct widget *menu;
GList *l;
- dbg(lvl_debug,"enter form %p %s\n",w->form,w->form->onsubmit);
+ dbg(lvl_debug,"enter form %p %s",w->form,w->form->onsubmit);
l=g_list_last(this->root.children);
menu=l->data;
graphics_draw_mode(this->gra, draw_mode_begin);
@@ -113,7 +113,7 @@ gui_internal_html_load_href(struct gui_priv *this, char *href, int replace)
if (replace)
gui_internal_prune_menu_count(this, 1, 0);
if (href && href[0] == '#') {
- dbg(lvl_debug,"href=%s\n",href);
+ dbg(lvl_debug,"href=%s",href);
g_free(this->href);
this->href=g_strdup(href);
gui_internal_html_menu(this, this->html_text, href+1);
@@ -376,22 +376,22 @@ gui_internal_refresh_callback_called(struct gui_priv *this, struct menu_data *me
static void
gui_internal_set_refresh_callback(struct gui_priv *this, char *cond)
{
- dbg(lvl_info,"cond=%s\n",cond);
+ dbg(lvl_info,"cond=%s",cond);
if (cond) {
enum attr_type type;
struct object_func *func;
struct menu_data *menu_data=gui_internal_menu_data(this);
- dbg(lvl_info,"navit=%p\n",this->nav);
+ dbg(lvl_info,"navit=%p",this->nav);
type=command_evaluate_to_attr(&this->self, cond, NULL, &menu_data->refresh_callback_obj);
if (type == attr_none) {
- dbg(lvl_error,"can't get type of '%s'\n",cond);
+ dbg(lvl_error,"can't get type of '%s'",cond);
return;
}
func=object_func_lookup(menu_data->refresh_callback_obj.type);
if (!func)
- dbg(lvl_error,"'%s' has no functions\n",cond);
+ dbg(lvl_error,"'%s' has no functions",cond);
if (func && !func->add_attr)
- dbg(lvl_error,"'%s' has no add_attr function\n",cond);
+ dbg(lvl_error,"'%s' has no add_attr function",cond);
if (!func || !func->add_attr)
return;
menu_data->refresh_callback.type=attr_callback;
@@ -461,7 +461,7 @@ gui_internal_html_text(xml_context *dummy, const char *text, gsize len, void *da
}
break;
case html_tag_script:
- dbg(lvl_debug,"execute %s\n",text_stripped);
+ dbg(lvl_debug,"execute %s",text_stripped);
gui_internal_evaluate(this,text_stripped);
break;
default:
diff --git a/navit/gui/internal/gui_internal_keyboard.c b/navit/gui/internal/gui_internal_keyboard.c
index 7ef1c3d36..93480eb87 100644
--- a/navit/gui/internal/gui_internal_keyboard.c
+++ b/navit/gui/internal/gui_internal_keyboard.c
@@ -488,7 +488,7 @@ static void gui_internal_keyboard_hide_native(struct gui_priv *this_, struct wid
g_free(kbd->lang);
g_free(kbd->gui_priv);
} else
- dbg(lvl_warning, "no graphics_keyboard found, cleanup failed\n");
+ dbg(lvl_warning, "no graphics_keyboard found, cleanup failed");
g_free(w);
}
@@ -531,7 +531,7 @@ struct widget * gui_internal_keyboard_show_native(struct gui_priv *this, struct
switch(res) {
case -1:
- dbg(lvl_error, "graphics has no show_native_keyboard method, cannot display keyboard\n");
+ dbg(lvl_error, "graphics has no show_native_keyboard method, cannot display keyboard");
/* no break */
case 0:
g_free(kbd);
@@ -552,9 +552,9 @@ struct widget * gui_internal_keyboard_show_native(struct gui_priv *this, struct
ret->wmin = w->wmin;
} else
ret->w = kbd->w;
- dbg(lvl_error, "ret->w=%d, ret->h=%d\n", ret->w, ret->h);
+ dbg(lvl_error, "ret->w=%d, ret->h=%d", ret->w, ret->h);
ret->data = (void *) kbd;
gui_internal_widget_append(w, ret);
- dbg(lvl_error, "return\n");
+ dbg(lvl_error, "return");
return ret;
}
diff --git a/navit/gui/internal/gui_internal_menu.c b/navit/gui/internal/gui_internal_menu.c
index 33def9983..67da9c939 100644
--- a/navit/gui/internal/gui_internal_menu.c
+++ b/navit/gui/internal/gui_internal_menu.c
@@ -115,7 +115,7 @@ gui_internal_menu(struct gui_priv *this, const char *label)
if (this->gra) {
padding = graphics_get_data(this->gra, "padding");
} else
- dbg(lvl_warning, "cannot get padding: this->gra is NULL\n");
+ dbg(lvl_warning, "cannot get padding: this->gra is NULL");
gui_internal_search_idle_end(this);
topbox=gui_internal_box_new_with_label(this, 0, label);
@@ -149,7 +149,7 @@ gui_internal_menu(struct gui_priv *this, const char *label)
struct widget *wlb,*wb,*wm=w;
wm->flags=gravity_center|orientation_vertical|flags_expand|flags_fill;
w=gui_internal_box_new(this, gravity_center|orientation_horizontal|flags_expand|flags_fill);
- dbg(lvl_info,"topbox->menu_data=%p\n", topbox->menu_data);
+ dbg(lvl_info,"topbox->menu_data=%p", topbox->menu_data);
gui_internal_widget_append(wm, w);
wb=gui_internal_box_new(this, gravity_right_center|orientation_horizontal|flags_fill);
wb->bl=6;
@@ -309,7 +309,7 @@ gui_internal_top_bar(struct gui_priv *this)
use_sep=1;
else
use_sep=0;
- dbg(lvl_debug,"%d (%s) + %d + %d + %d > %d\n", wcn->w, wc->text, width_used, w->spx, use_sep ? sep_len : 0, width);
+ dbg(lvl_debug,"%d (%s) + %d + %d + %d > %d", wcn->w, wc->text, width_used, w->spx, use_sep ? sep_len : 0, width);
if (wcn->w + width_used + w->spx + (use_sep ? sep_len : 0) + (g_list_previous(l) ? dots_len : 0) > width) {
incomplete=1;
gui_internal_widget_destroy(this, wcn);
diff --git a/navit/gui/internal/gui_internal_poi.c b/navit/gui/internal/gui_internal_poi.c
index cb31ecc95..0b904c1d2 100644
--- a/navit/gui/internal/gui_internal_poi.c
+++ b/navit/gui/internal/gui_internal_poi.c
@@ -125,7 +125,7 @@ gui_internal_poi_icon(struct gui_priv *this, struct item *item)
icon=g_strdup(el->u.icon.src);
}
char *dot=g_strrstr(icon,".");
- dbg(lvl_debug,"%s %s\n", item_to_name(item->type),icon);
+ dbg(lvl_debug,"%s %s", item_to_name(item->type),icon);
if(dot)
*dot=0;
img=image_new_xs(this,icon);
@@ -601,7 +601,7 @@ dbg(lvl_debug,"POIs...");
items= g_new0( struct item_data, maxitem);
- dbg(lvl_debug, "Params: sel = %i, selnb = %i, pagenb = %i, dist = %i, filterstr = %s, AddressFilterType= %d\n",
+ dbg(lvl_debug, "Params: sel = %i, selnb = %i, pagenb = %i, dist = %i, filterstr = %s, AddressFilterType= %d",
param->sel, param->selnb, param->pagenb, param->dist, param->filterstr, param->AddressFilterType);
wb=gui_internal_menu(this, isel ? isel->name : _("POIs"));
@@ -619,7 +619,7 @@ dbg(lvl_debug,"POIs...");
while ((m=mapset_next(h, 1))) {
selm=map_selection_dup_pro(sel, pro, map_projection(m));
mr=map_rect_new(m, selm);
- dbg(lvl_debug,"mr=%p\n", mr);
+ dbg(lvl_debug,"mr=%p", mr);
if (mr) {
while ((item=map_rect_get_item(mr))) {
if (gui_internal_cmd_pois_item_selected(param, item) &&
@@ -690,10 +690,10 @@ dbg(lvl_debug,"POIs...");
struct item_data *data = fh_extractmin(fh);
if (data == NULL)
{
- dbg(lvl_debug, "Empty heap: maxitem = %i, it = %i, dist = %i\n", maxitem, it, dist);
+ dbg(lvl_debug, "Empty heap: maxitem = %i, it = %i, dist = %i", maxitem, it, dist);
break;
}
- dbg(lvl_debug, "dist1: %i, dist2: %i\n", data->dist, (-key)>>10);
+ dbg(lvl_debug, "dist1: %i, dist2: %i", data->dist, (-key)>>10);
if(i==(it-pagesize*pagenb) && data->dist>prevdist)
prevdist=data->dist;
wi=gui_internal_cmd_pois_item(this, &center, &data->item, &data->c, route.u.route, data->dist, data->label);
@@ -772,13 +772,13 @@ dbg(lvl_debug,"POIs...");
while(firstrow>=0) {
int currow=g_list_index(wtable->children, td->bottom_row->data) - firstrow;
if(currow<0) {
- dbg(lvl_debug,"Can't find bottom row in children list. Stop paging.\n");
+ dbg(lvl_debug,"Can't find bottom row in children list. Stop paging.");
break;
}
if(currow>=param->count)
break;
if(!(td->scroll_buttons.next_button->state & STATE_SENSITIVE)) {
- dbg(lvl_debug,"Reached last page but item %i not found. Stop paging.\n",param->count);
+ dbg(lvl_debug,"Reached last page but item %i not found. Stop paging.",param->count);
break;
}
gui_internal_table_button_next(this, td->scroll_buttons.next_button, NULL);
diff --git a/navit/gui/internal/gui_internal_search.c b/navit/gui/internal/gui_internal_search.c
index ceeeb7438..54fd55a57 100644
--- a/navit/gui/internal/gui_internal_search.c
+++ b/navit/gui/internal/gui_internal_search.c
@@ -87,7 +87,7 @@ gui_internal_search_cmp(gconstpointer _a, gconstpointer _b)
sa=removecase(a->text);
sb=removecase(b->text);
r=strcmp(sa,sb);
- dbg(lvl_debug,"%s %s %d\n",sa,sb,r);
+ dbg(lvl_debug,"%s %s %d",sa,sb,r);
g_free(sa);
g_free(sb);
return r;
@@ -210,7 +210,7 @@ gui_internal_find_next_possible_key(char *search_text, char *wm_name, char *poss
possible_keys[len]=trunk_name[next_char_pos];
possible_keys[len+1]='\0';
}
- dbg(lvl_info,"searching for %s, found: %s, currently possible_keys: %s \n", search_text, item_name, possible_keys);
+ dbg(lvl_info,"searching for %s, found: %s, currently possible_keys: %s ", search_text, item_name, possible_keys);
}
}
}
@@ -290,7 +290,7 @@ gui_internal_get_match_quality(char *item_name, char* search_text, int is_house_
if(!exp)
continue;
if(!strcmp(exp,folded_query)) {
- dbg(lvl_debug,"exact match for the whole string %s\n", exp);
+ dbg(lvl_debug,"exact match for the whole string %s", exp);
match_quality=full_string_match;
g_free(exp);
break;
@@ -298,7 +298,7 @@ gui_internal_get_match_quality(char *item_name, char* search_text, int is_house_
if((p=strstr(exp,folded_query))!=NULL) {
p+=strlen(folded_query);
if(!*p||strchr(LINGUISTICS_WORD_SEPARATORS_ASCII,*p)) {
- dbg(lvl_debug,"exact matching word found inside string %s\n",exp);
+ dbg(lvl_debug,"exact matching word found inside string %s",exp);
match_quality=word_match;
}
}
@@ -385,7 +385,7 @@ gui_internal_search_idle(struct gui_priv *this, char *wm_name, struct widget *se
widget_name=g_strdup(result_main_label);
}
if(!item_name) {
- dbg(lvl_error, "Skipping nameless item in search (search type: %s). Please report this as a bug.\n", wm_name);
+ dbg(lvl_error, "Skipping nameless item in search (search type: %s). Please report this as a bug.", wm_name);
return;
}
@@ -444,13 +444,13 @@ gui_internal_search_changed(struct gui_priv *this, struct widget *wm, void *data
param=(void *)5;
if (! strcmp(wm->name,"House number"))
param=(void *)6;
- dbg(lvl_debug,"%s now '%s'\n", wm->name, wm->text);
+ dbg(lvl_debug,"%s now '%s'", wm->name, wm->text);
gui_internal_search_idle_end(this);
if (wm->text && g_utf8_strlen(wm->text, -1) > 0) {
struct attr search_attr;
- dbg(lvl_debug,"process\n");
+ dbg(lvl_debug,"process");
if (! strcmp(wm->name,"Country"))
search_attr.type=attr_country_all;
if (! strcmp(wm->name,"Town"))
@@ -488,7 +488,7 @@ gui_internal_search_list_set_default_country(struct gui_priv *this)
item=country_search_get_item(cs);
if (item && item_attr_get(item, attr_country_name, &country_name)) {
search_attr.type=attr_country_all;
- dbg(lvl_debug,"country %s\n", country_name.u.str);
+ dbg(lvl_debug,"country %s", country_name.u.str);
search_attr.u.str=country_name.u.str;
search_list_search(this->sl, &search_attr, 0);
while((res=search_list_get_result(this->sl)));
@@ -501,9 +501,9 @@ gui_internal_search_list_set_default_country(struct gui_priv *this)
}
country_search_destroy(cs);
} else {
- dbg(lvl_error,"warning: no default country found\n");
+ dbg(lvl_error,"warning: no default country found");
if (this->country_iso2) {
- dbg(lvl_debug,"attempting to use country '%s'\n",this->country_iso2);
+ dbg(lvl_debug,"attempting to use country '%s'",this->country_iso2);
search_attr.type=attr_country_iso2;
search_attr.u.str=this->country_iso2;
search_list_search(this->sl, &search_attr, 0);
@@ -604,7 +604,7 @@ gui_internal_search(struct gui_priv *this, const char *what, const char *type, i
void
gui_internal_search_house_number_in_street(struct gui_priv *this, struct widget *widget, void *data)
{
- dbg(lvl_info,"id %d\n", widget->selection_id);
+ dbg(lvl_info,"id %d", widget->selection_id);
search_list_select(this->sl, attr_street_name, 0, 0);
search_list_select(this->sl, attr_street_name, widget->selection_id, 1);
gui_internal_search(this,_("House number"),"House number",0);
@@ -613,7 +613,7 @@ gui_internal_search_house_number_in_street(struct gui_priv *this, struct widget
void
gui_internal_search_street_in_town(struct gui_priv *this, struct widget *widget, void *data)
{
- dbg(lvl_info,"id %d\n", widget->selection_id);
+ dbg(lvl_info,"id %d", widget->selection_id);
search_list_select(this->sl, attr_town_or_district_name, 0, 0);
search_list_select(this->sl, attr_town_or_district_name, widget->selection_id, 1);
gui_internal_search(this,_("Street"),"Street",0);
@@ -623,7 +623,7 @@ void
gui_internal_search_town_in_country(struct gui_priv *this, struct widget *widget)
{
struct search_list_common *slc;
- dbg(lvl_info,"id %d\n", widget->selection_id);
+ dbg(lvl_info,"id %d", widget->selection_id);
search_list_select(this->sl, attr_country_all, 0, 0);
slc=search_list_select(this->sl, attr_country_all, widget->selection_id, 1);
if (slc) {
diff --git a/navit/gui/internal/gui_internal_widget.c b/navit/gui/internal/gui_internal_widget.c
index 3e1993025..98b690578 100644
--- a/navit/gui/internal/gui_internal_widget.c
+++ b/navit/gui/internal/gui_internal_widget.c
@@ -260,7 +260,7 @@ gui_internal_highlight_do(struct gui_priv *this, struct widget *found)
this->highlighted_menu=g_list_last(this->root.children)->data;
this->highlighted->state |= STATE_HIGHLIGHTED;
gui_internal_widget_render(this, this->highlighted);
- dbg(lvl_debug,"%d,%d %dx%d\n", found->p.x, found->p.y, found->w, found->h);
+ dbg(lvl_debug,"%d,%d %dx%d", found->p.x, found->p.y, found->w, found->h);
}
graphics_draw_mode(this->gra, draw_mode_end);
}
@@ -603,7 +603,7 @@ static void gui_internal_box_pack(struct gui_priv *this, struct widget *w)
w->scroll_buttons->button_box->p.x=w->p.x;
w->scroll_buttons->button_box->p.y=w->p.y+w->h-w->scroll_buttons->button_box->h;
gui_internal_widget_pack(this, w->scroll_buttons->button_box);
- dbg(lvl_debug,"needs buttons %d vs %d\n",y,w->h);
+ dbg(lvl_debug,"needs buttons %d vs %d",y,w->h);
gui_internal_box_pack(this, w);
return;
}
diff --git a/navit/gui/qml/bookmarksProxy.h b/navit/gui/qml/bookmarksProxy.h
index 03cbcbc88..de48898a0 100644
--- a/navit/gui/qml/bookmarksProxy.h
+++ b/navit/gui/qml/bookmarksProxy.h
@@ -72,7 +72,7 @@ public slots:
entries.appendChild(entry);
}
- dbg(lvl_info,"%s\n",retDoc.toString().toLocal8Bit().constData());
+ dbg(lvl_info,"%s",retDoc.toString().toLocal8Bit().constData());
return retDoc.toString();
}
QString AddFolder(QString description) {
@@ -144,7 +144,7 @@ public slots:
if (!item_attr_get(item, attr_label, &attr)) continue;
label=QString::fromLocal8Bit(attr.u.str);
- dbg(lvl_debug,"Bookmark is %s\n",bookmark.toStdString().c_str());
+ dbg(lvl_debug,"Bookmark is %s",bookmark.toStdString().c_str());
if (label.compare(bookmark)) continue;
item_coord_get(item, &c, 1);
if (this->object->currentPoint!=NULL) {
diff --git a/navit/gui/qml/gui_qml.cpp b/navit/gui/qml/gui_qml.cpp
index 3efc719dd..456c5d0be 100644
--- a/navit/gui/qml/gui_qml.cpp
+++ b/navit/gui/qml/gui_qml.cpp
@@ -161,11 +161,11 @@ static void gui_qml_button(void *data, int pressed, int button, struct point *p)
// check whether the position of the mouse changed during press/release OR if it is the scrollwheel
if (!navit_handle_button(this_->nav, pressed, button, p, NULL)) {
- dbg(lvl_debug,"navit has handled button\n");
+ dbg(lvl_debug,"navit has handled button");
return;
}
- dbg(lvl_debug,"enter %d %d\n", pressed, button);
+ dbg(lvl_debug,"enter %d %d", pressed, button);
if (this_->signal_on_map_click) {
gui_qml_dbus_signal(this_, p);
return;
@@ -278,7 +278,7 @@ static int gui_qml_set_graphics(struct gui_priv *this_, struct graphics *gra)
if (xid.length()>0) {
_mainWindow->embedInto(xid.toULong(&ok,0));
}else{
- dbg(lvl_error, "\nFATAL: Environment variable NAVIT_XID not set.\n"
+ dbg(lvl_error, "FATAL: Environment variable NAVIT_XID not set."
" Please set NAVIT_XID to the window ID of the window to embed into.\n");
exit(1);
}
@@ -322,7 +322,7 @@ static int gui_qml_set_graphics(struct gui_priv *this_, struct graphics *gra)
QString mainQml = QString(this_->source)+"/"+this_->skin+"/main.qml";
if (!QFile(mainQml).exists()){
- dbg(lvl_error, "FATAL: QML file %s not found. Navit is not installed correctly.\n", mainQml.toAscii().constData());
+ dbg(lvl_error, "FATAL: QML file %s not found. Navit is not installed correctly.", mainQml.toAscii().constData());
exit(1);
}
this_->guiWidget->setSource(QUrl::fromLocalFile(mainQml));
@@ -380,7 +380,7 @@ gui_qml_set_attr(struct gui_priv *this_, struct attr *attr)
this_->radius=attr->u.num;
return 1;
default:
- dbg(lvl_error,"unknown attr: %s\n",attr_to_name(attr->type));
+ dbg(lvl_error,"unknown attr: %s",attr_to_name(attr->type));
return 1;
}
}
diff --git a/navit/gui/qml/ngqpoint.h b/navit/gui/qml/ngqpoint.h
index 05142e5bf..b1e6312ff 100644
--- a/navit/gui/qml/ngqpoint.h
+++ b/navit/gui/qml/ngqpoint.h
@@ -248,7 +248,7 @@ public slots:
}
map_selection_destroy(sel);
mapset_close(h);
- dbg(lvl_info,"%s\n",retDoc.toString().toLocal8Bit().constData());
+ dbg(lvl_info,"%s",retDoc.toString().toLocal8Bit().constData());
return retDoc.toString();
}
protected:
diff --git a/navit/gui/qml/proxy.h b/navit/gui/qml/proxy.h
index 3243dc8cb..72a696f00 100644
--- a/navit/gui/qml/proxy.h
+++ b/navit/gui/qml/proxy.h
@@ -55,7 +55,7 @@ public slots:
struct attr attr_value;
double *helper;
- dbg(lvl_debug,"Setting %s to %s\n",attr_name.toStdString().c_str(),attr_string.toStdString().c_str());
+ dbg(lvl_debug,"Setting %s to %s",attr_name.toStdString().c_str(),attr_string.toStdString().c_str());
getAttrFunc(attr_from_name(attr_name.toStdString().c_str()), &attr_value, NULL);
if (ATTR_IS_INT(attr_value.type)) {
diff --git a/navit/gui/qml/routeProxy.h b/navit/gui/qml/routeProxy.h
index a2fb4c793..f4c5f9911 100644
--- a/navit/gui/qml/routeProxy.h
+++ b/navit/gui/qml/routeProxy.h
@@ -30,7 +30,7 @@ public slots:
QList<struct attr> destinations=this->_routeDestinations();
for (QList<struct attr>::const_iterator iter=destinations.begin();iter!=destinations.end();iter++) {
NGQPoint helperPoint(this->object,iter->u.pcoord,MapPoint);
- dbg(lvl_debug,"Added destination %s\n",helperPoint.coordString().toLocal8Bit().constData());
+ dbg(lvl_debug,"Added destination %s",helperPoint.coordString().toLocal8Bit().constData());
}
//dbg(lvl_debug,QString::number(_itemId).toStdString().c_str());
diff --git a/navit/gui/qml/searchProxy.h b/navit/gui/qml/searchProxy.h
index 579ac3dac..16f79a2a3 100644
--- a/navit/gui/qml/searchProxy.h
+++ b/navit/gui/qml/searchProxy.h
@@ -33,7 +33,7 @@ public:
item=country_search_get_item(cs);
if (item && item_attr_get(item, attr_country_name, &country_name)) {
search_attr.type=attr_country_all;
- dbg(lvl_debug,"country %s\n", country_name.u.str);
+ dbg(lvl_debug,"country %s", country_name.u.str);
this->country_name=QString::fromLocal8Bit(country_name.u.str);
search_attr.u.str=country_name.u.str;
search_list_search(this->sl, &search_attr, 0);
@@ -44,9 +44,9 @@ public:
}
country_search_destroy(cs);
} else {
- dbg(lvl_error,"warning: no default country found\n");
+ dbg(lvl_error,"warning: no default country found");
if (!this->country_iso2.isEmpty()) {
- dbg(lvl_debug,"attempting to use country '%s'\n",this->country_iso2.toStdString().c_str());
+ dbg(lvl_debug,"attempting to use country '%s'",this->country_iso2.toStdString().c_str());
search_attr.type=attr_country_iso2;
search_attr.u.str=(char*)this->country_iso2.toStdString().c_str();
search_list_search(this->sl, &search_attr, 0);
diff --git a/navit/gui/qml/skins/navit/ButtonIcon.qml b/navit/gui/qml/skins/navit/ButtonIcon.qml
index f969ebb5a..9b5d6ae3a 100644
--- a/navit/gui/qml/skins/navit/ButtonIcon.qml
+++ b/navit/gui/qml/skins/navit/ButtonIcon.qml
@@ -1,40 +1,40 @@
-import Qt 4.7
-
-Rectangle {
+import Qt 4.7
+
+Rectangle {
id: container
-
- signal clicked
- property string text: "Button"
- property string icon: "Icon.png"
-
- color: "black"; smooth: true; opacity: 0.75
- width: imgItem.width+20; height: txtItem.height + 6 + imgItem.height;
- transformOrigin: Rectangle.Center;
-
- MouseArea { id: mr; anchors.fill: parent; onClicked: container.clicked() }
-
- Image {
- id: imgItem; source: gui.iconPath+container.icon; anchors.top: container.top; anchors.horizontalCenter: container.horizontalCenter;
- width: gui.height/4; height: gui.height/4
- }
-
- Text {
- id: txtItem; text: container.text; anchors.top: imgItem.bottom; anchors.horizontalCenter: container.horizontalCenter;
- color: "White"; font.pointSize: gui.height/32; horizontalAlignment: Qt.AlignHCenter
- }
-
- states: [
- State {
- name: "Pressed"; when: mr.pressed == true
- PropertyChanges { target: container; scale: 2.0 }
- PropertyChanges { target: container; opacity: 1 }
-
- }
- ]
-
- transitions: Transition {
- NumberAnimation { properties: "scale"; easing.type: "OutExpo"; duration: 200 }
- NumberAnimation { properties: "opacity"; easing.type: "InQuad"; duration: 200 }
- }
-
-}
+
+ signal clicked
+ property string text: "Button"
+ property string icon: "Icon.png"
+
+ color: "black"; smooth: true; opacity: 0.75
+ width: imgItem.width+20; height: txtItem.height + 6 + imgItem.height;
+ transformOrigin: Rectangle.Center;
+
+ MouseArea { id: mr; anchors.fill: parent; onClicked: container.clicked() }
+
+ Image {
+ id: imgItem; source: gui.iconPath+container.icon; anchors.top: container.top; anchors.horizontalCenter: container.horizontalCenter;
+ width: gui.height/4; height: gui.height/4
+ }
+
+ Text {
+ id: txtItem; text: container.text; anchors.top: imgItem.bottom; anchors.horizontalCenter: container.horizontalCenter;
+ color: "White"; font.pointSize: gui.height/32; horizontalAlignment: Qt.AlignHCenter
+ }
+
+ states: [
+ State {
+ name: "Pressed"; when: mr.pressed == true
+ PropertyChanges { target: container; scale: 2.0 }
+ PropertyChanges { target: container; opacity: 1 }
+
+ }
+ ]
+
+ transitions: Transition {
+ NumberAnimation { properties: "scale"; easing.type: "OutExpo"; duration: 200 }
+ NumberAnimation { properties: "opacity"; easing.type: "InQuad"; duration: 200 }
+ }
+
+}
diff --git a/navit/gui/qml/skins/navit/PageSettingsRules.qml b/navit/gui/qml/skins/navit/PageSettingsRules.qml
index e5238f584..37b18c8d4 100644
--- a/navit/gui/qml/skins/navit/PageSettingsRules.qml
+++ b/navit/gui/qml/skins/navit/PageSettingsRules.qml
@@ -1,38 +1,38 @@
import Qt 4.7
import "pagenavigation.js" as Navit
-
-Rectangle {
- id: page
-
- width: gui.width; height: gui.height
- border.width: 1
- color: "Black"
- opacity: 0
-
- function pageOpen() {
- page.opacity = 1;
- }
-
- Component.onCompleted: pageOpen();
-
- Behavior on opacity {
- NumberAnimation { id: opacityAnimation; duration: 300; alwaysRunToEnd: true }
- }
-
- VisualItemModel {
- id: selectorsModel
-
- ToggleSwitch { id: trackingSw; stOn: navit.getAttr("tracking"); text: "Lock on road"; onChanged: navit.setAttr("tracking",trackingSw.stOn) }
- ToggleSwitch { id: orientationSw; stOn: navit.getAttr("orientation"); text: "Northing"; onChanged: navit.setAttr("orientation",orientationSw.stOn) }
- ToggleSwitch { id: followcursorSw; stOn: navit.getAttr("follow_cursor"); text: "Map follows Vehicle"; onChanged: navit.setAttr("follow_cursor",followcursorSw.stOn) }
- ToggleSwitch { id: autozoomSw; stOn: navit.getAttr("autozoom_active"); text: "Auto zoom"; onChanged: navit.setAttr("autozoom_active",autozoomSw.stOn) }
- }
-
- ListView {
- id: selectorsList; model: selectorsModel
- focus: true; clip: true; orientation: Qt.Vertical
- anchors.verticalCenter: parent.verticalCenter; anchors.horizontalCenter: parent.horizontalCenter;
- width: trackingSw.width*1.5; height: trackingSw.height*4
- }
- Cellar {anchors.bottom: page.bottom; anchors.horizontalCenter: page.horizontalCenter; width: page.width }
-}
+
+Rectangle {
+ id: page
+
+ width: gui.width; height: gui.height
+ border.width: 1
+ color: "Black"
+ opacity: 0
+
+ function pageOpen() {
+ page.opacity = 1;
+ }
+
+ Component.onCompleted: pageOpen();
+
+ Behavior on opacity {
+ NumberAnimation { id: opacityAnimation; duration: 300; alwaysRunToEnd: true }
+ }
+
+ VisualItemModel {
+ id: selectorsModel
+
+ ToggleSwitch { id: trackingSw; stOn: navit.getAttr("tracking"); text: "Lock on road"; onChanged: navit.setAttr("tracking",trackingSw.stOn) }
+ ToggleSwitch { id: orientationSw; stOn: navit.getAttr("orientation"); text: "Northing"; onChanged: navit.setAttr("orientation",orientationSw.stOn) }
+ ToggleSwitch { id: followcursorSw; stOn: navit.getAttr("follow_cursor"); text: "Map follows Vehicle"; onChanged: navit.setAttr("follow_cursor",followcursorSw.stOn) }
+ ToggleSwitch { id: autozoomSw; stOn: navit.getAttr("autozoom_active"); text: "Auto zoom"; onChanged: navit.setAttr("autozoom_active",autozoomSw.stOn) }
+ }
+
+ ListView {
+ id: selectorsList; model: selectorsModel
+ focus: true; clip: true; orientation: Qt.Vertical
+ anchors.verticalCenter: parent.verticalCenter; anchors.horizontalCenter: parent.horizontalCenter;
+ width: trackingSw.width*1.5; height: trackingSw.height*4
+ }
+ Cellar {anchors.bottom: page.bottom; anchors.horizontalCenter: page.horizontalCenter; width: page.width }
+}
diff --git a/navit/gui/qt5_qml/backend.cpp b/navit/gui/qt5_qml/backend.cpp
index 395fff425..efbec8cda 100644
--- a/navit/gui/qt5_qml/backend.cpp
+++ b/navit/gui/qt5_qml/backend.cpp
@@ -43,15 +43,15 @@ void Backend::showMenu(struct point *p)
struct coord co;
transform_reverse(navit_get_trans(nav), p, &co);
- dbg(lvl_debug, "Point 0x%x 0x%x\n", co.x, co.y);
- dbg(lvl_debug, "Screen coord : %d %d\n", p->x, p->y);
+ dbg(lvl_debug, "Point 0x%x 0x%x", co.x, co.y);
+ dbg(lvl_debug, "Screen coord : %d %d", p->x, p->y);
transform_to_geo(transform_get_projection(navit_get_trans(nav)), &co, &(this->g));
- dbg(lvl_debug, "%f %f\n", this->g.lat, this->g.lng);
- dbg(lvl_debug, "%p %p\n", nav, &c);
+ dbg(lvl_debug, "%f %f", this->g.lat, this->g.lng);
+ dbg(lvl_debug, "%p %p", nav, &c);
this->c.pro = transform_get_projection(navit_get_trans(nav));
this->c.x = co.x;
this->c.y = co.y;
- dbg(lvl_debug, "c : %x %x\n", this->c.x, this->c.y);
+ dbg(lvl_debug, "c : %x %x", this->c.x, this->c.y);
// As a test, set the Demo vehicle position to wherever we just clicked
navit_set_position(this->nav, &c);
@@ -115,7 +115,7 @@ void Backend::get_vehicles()
vehicle_get_attr(attr.u.vehicle, attr_name, &vattr, NULL);
navit_attr_iter_destroy(iter);
_vehicles.append(new VehicleObject(g_strdup(vattr.u.str), active_vehicle.u.vehicle, attr.u.vehicle));
- dbg(lvl_debug, "done\n");
+ dbg(lvl_debug, "done");
emit vehiclesChanged();
return;
}
@@ -126,7 +126,7 @@ void Backend::get_vehicles()
iter=navit_attr_iter_new();
while(navit_get_attr(this->nav, attr_vehicle, &attr, iter)) {
vehicle_get_attr(attr.u.vehicle, attr_name, &vattr, NULL);
- dbg(lvl_debug, "adding vehicle %s\n", vattr.u.str);
+ dbg(lvl_debug, "adding vehicle %s", vattr.u.str);
_vehicles.append(
new VehicleObject(
g_strdup(vattr.u.str),
@@ -194,11 +194,11 @@ void Backend::get_bookmarks()
bookmarks_item_rewind(mattr.u.bookmarks);
while ((item=bookmarks_get_item(mattr.u.bookmarks))) {
if (!item_attr_get(item, attr_label, &attr)) continue;
- dbg(lvl_debug,"full_label: %s\n", attr.u.str);
+ dbg(lvl_debug,"full_label: %s", attr.u.str);
if (item_coord_get(item, &c, 1)) {
pc.x = c.x;
pc.y = c.y;
- dbg(lvl_debug, "coords : %i x %i\n", pc.x, pc.y);
+ dbg(lvl_debug, "coords : %i x %i", pc.x, pc.y);
_bookmarks.append(new BookmarkObject(attr.u.str, pc));
}
}
@@ -227,13 +227,13 @@ void Backend::get_pois()
center.x = this->c.x;
center.y = this->c.y;
- dbg(lvl_debug, "center is at %x, %x\n", center.x, center.y);
+ dbg(lvl_debug, "center is at %x, %x", center.x, center.y);
h = mapset_open(navit_get_mapset(this->nav));
while ((m = mapset_next(h, 1))) {
selm = map_selection_dup_pro(sel, pro, map_projection(m));
mr = map_rect_new(m, selm);
- dbg(lvl_debug, "mr=%p\n", mr);
+ dbg(lvl_debug, "mr=%p", mr);
if (mr) {
while ((item = map_rect_get_item(mr))) {
if ( filter_pois(item) &&
@@ -319,8 +319,8 @@ QQmlListProperty<QObject> Backend::getSearchResults(){
* @returns the active POI
*/
PoiObject * Backend::activePoi() {
- dbg(lvl_debug, "name : %s\n", m_activePoi->name().toUtf8().data());
- dbg(lvl_debug, "type : %s\n", m_activePoi->type().toLatin1().data());
+ dbg(lvl_debug, "name : %s", m_activePoi->name().toUtf8().data());
+ dbg(lvl_debug, "type : %s", m_activePoi->type().toLatin1().data());
return m_activePoi;
}
@@ -340,12 +340,12 @@ BookmarkObject * Backend::currentBookmark() {
*/
VehicleObject * Backend::currentVehicle() {
struct attr attr;
- dbg(lvl_debug, "name : %s\n", m_currentVehicle->name().toUtf8().data());
+ dbg(lvl_debug, "name : %s", m_currentVehicle->name().toUtf8().data());
if (m_currentVehicle->vehicle()) {
if (vehicle_get_attr(m_currentVehicle->vehicle(), attr_position_nmea, &attr, NULL))
- dbg(lvl_debug, "NMEA : %s\n", attr.u.str);
+ dbg(lvl_debug, "NMEA : %s", attr.u.str);
} else {
- dbg(lvl_debug, "m_currentVehicle->v is null\n");
+ dbg(lvl_debug, "m_currentVehicle->v is null");
}
return m_currentVehicle;
@@ -354,7 +354,7 @@ VehicleObject * Backend::currentVehicle() {
void Backend::block_draw(){
navit_block(this->nav, 1);
- dbg(lvl_debug, "Draw operations blocked per UI request\n");
+ dbg(lvl_debug, "Draw operations blocked per UI request");
}
/**
@@ -425,7 +425,7 @@ QString Backend::get_icon_path(){
void Backend::setActivePoiAsDestination(){
struct pcoord c;
c = m_activePoi->coords();
- dbg(lvl_debug, "Destination : %s c=%d:0x%x,0x%x\n",
+ dbg(lvl_debug, "Destination : %s c=%d:0x%x,0x%x",
m_activePoi->name().toUtf8().data(),
c.pro, c.x, c.y);
navit_set_destination(this->nav, &c, m_activePoi->name().toUtf8().data(), 1);
@@ -439,9 +439,9 @@ void Backend::setActivePoiAsDestination(){
*/
void Backend::searchValidateResult(int index){
SearchObject * r = (SearchObject *)_search_results.at(index);
- dbg(lvl_debug, "Saving %s [%i] as search result\n", r->name().toUtf8().data(), index);
+ dbg(lvl_debug, "Saving %s [%i] as search result", r->name().toUtf8().data(), index);
if (r->getCoords()){
- dbg(lvl_debug, "Item is at %x x %x\n", r->getCoords()->x, r->getCoords()->y);
+ dbg(lvl_debug, "Item is at %x x %x", r->getCoords()->x, r->getCoords()->y);
}
if (_search_context == attr_country_all) {
_current_country = g_strdup(r->name().toUtf8().data());
@@ -453,7 +453,7 @@ void Backend::searchValidateResult(int index){
} else if (_search_context == attr_street_name) {
_current_street = g_strdup(r->name().toUtf8().data());
} else {
- dbg(lvl_error, "Unknown search context for '%s'\n", r->name().toUtf8().data());
+ dbg(lvl_error, "Unknown search context for '%s'", r->name().toUtf8().data());
}
// navit_set_center(this->nav, r->getCoords(), 1);
emit displayMenu("destination_address.qml");
@@ -504,12 +504,12 @@ void Backend::updateSearch(QString text){
if (search == NULL){
search=&search_param;
- dbg(lvl_debug, "search = %p\n", search);
+ dbg(lvl_debug, "search = %p", search);
search->nav=this->nav;
search->ms=navit_get_mapset(this->nav);
search->sl=search_list_new(search->ms);
search->partial = 1;
- dbg(lvl_debug,"attempting to use country '%s'\n", _country_iso2);
+ dbg(lvl_debug,"attempting to use country '%s'", _country_iso2);
search_attr.type=attr_country_iso2;
search_attr.u.str=_country_iso2;
search_list_search(search->sl, &search_attr, 0);
@@ -529,7 +529,7 @@ void Backend::updateSearch(QString text){
// while((res=search_list_get_result(search->sl)));
search->attr.u.str = text.toUtf8().data();
- dbg(lvl_error, "searching for %s partial %d\n", search->attr.u.str, search->partial);
+ dbg(lvl_error, "searching for %s partial %d", search->attr.u.str, search->partial);
search->attr.type = _search_context;
search_list_search(search->sl, &search->attr, search->partial);
@@ -571,18 +571,18 @@ void Backend::setSearchContext(QString text){
} else if (text == "street") {
_search_context = attr_street_name;
} else {
- dbg(lvl_error, "Unhandled search context '%s'\n", text.toUtf8().data());
+ dbg(lvl_error, "Unhandled search context '%s'", text.toUtf8().data());
}
}
QString Backend::currentCountry() {
- dbg(lvl_debug, "Current country : %s/%s\n", _country_iso2, _current_country);
+ dbg(lvl_debug, "Current country : %s/%s", _country_iso2, _current_country);
return QString(_current_country);
}
QString Backend::currentCountryIso2() {
- dbg(lvl_debug, "Current country : %s/%s\n", _country_iso2, _current_country);
+ dbg(lvl_debug, "Current country : %s/%s", _country_iso2, _current_country);
return QString(_country_iso2);
}
@@ -590,7 +590,7 @@ QString Backend::currentTown() {
if (_current_town == NULL) {
_current_town = "Enter City";
}
- dbg(lvl_debug, "Current town : %s\n", _current_town);
+ dbg(lvl_debug, "Current town : %s", _current_town);
return QString(_current_town);
}
@@ -598,6 +598,6 @@ QString Backend::currentStreet() {
if (_current_street == NULL) {
_current_street = "Enter Street";
}
- dbg(lvl_debug, "Current street : %s\n", _current_street);
+ dbg(lvl_debug, "Current street : %s", _current_street);
return QString(_current_street);
}
diff --git a/navit/gui/qt5_qml/gui_qt5_qml.cpp b/navit/gui/qt5_qml/gui_qt5_qml.cpp
index 1b4062d33..bd9b8a306 100644
--- a/navit/gui/qt5_qml/gui_qt5_qml.cpp
+++ b/navit/gui/qt5_qml/gui_qt5_qml.cpp
@@ -102,14 +102,14 @@ gui_qt5_qml_button(void* data, int pressed, int button, struct point* p)
/* check if navit wants to handle this */
if (!navit_handle_button(gui_priv->nav, pressed, button, p, NULL)) {
- dbg(lvl_debug, "navit has handled button\n");
+ dbg(lvl_debug, "navit has handled button");
return;
}
- dbg(lvl_debug, "enter %d %d\n", pressed, button);
+ dbg(lvl_debug, "enter %d %d", pressed, button);
/* check if user requested menu */
if (button == 1 && gui_priv->menu_on_map_click) {
- dbg(lvl_debug, "navit wants us to enter menu\n");
+ dbg(lvl_debug, "navit wants us to enter menu");
/*TODO: want to emit a signal somewhere? */
gui_priv->backend->showMenu(p);
}
@@ -119,7 +119,7 @@ static void
gui_qt5_qml_motion(void* data, struct point* p)
{
struct gui_priv* gui_priv = (struct gui_priv*)data;
- dbg(lvl_debug, "enter (%d, %d)\n", p->x, p->y);
+ dbg(lvl_debug, "enter (%d, %d)", p->x, p->y);
/* forward this to navit */
navit_handle_motion(gui_priv->nav, p);
}
@@ -128,7 +128,7 @@ static void
gui_qt5_qml_resize(void* data, int w, int h)
{
struct gui_priv* gui_priv = (struct gui_priv*)data;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
/* forward this to navit */
navit_handle_resize(gui_priv->nav, w, h);
}
@@ -142,7 +142,7 @@ gui_qml_keypress(void* data, char* key)
transform_get_size(navit_get_trans(this_->nav), &w, &h);
switch (*key) {
case NAVIT_KEY_UP:
- dbg(lvl_debug, "got KEY_UP\n");
+ dbg(lvl_debug, "got KEY_UP");
p.x = w / 2;
p.y = 0;
navit_set_center_screen(this_->nav, &p, 1);
@@ -163,7 +163,7 @@ gui_qml_keypress(void* data, char* key)
navit_set_center_screen(this_->nav, &p, 1);
break;
case NAVIT_KEY_ZOOM_IN:
- dbg(lvl_debug, "got ZOOM_IN\n");
+ dbg(lvl_debug, "got ZOOM_IN");
navit_zoom_in(this_->nav, 2, NULL);
break;
case NAVIT_KEY_ZOOM_OUT:
@@ -183,7 +183,7 @@ static int
gui_qt5_qml_set_graphics(struct gui_priv* gui_priv, struct graphics* gra)
{
struct transformation* trans;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
/* get navit transition */
trans = navit_get_trans(gui_priv->nav);
@@ -212,14 +212,14 @@ gui_qt5_qml_set_graphics(struct gui_priv* gui_priv, struct graphics* gra)
/* get main navit window */
gui_priv->win = (struct window*)graphics_get_data(gra, "window");
if (!gui_priv->win) {
- dbg(lvl_error, "failed to obtain window from graphics plugin, cannot set graphics\n");
+ dbg(lvl_error, "failed to obtain window from graphics plugin, cannot set graphics");
return 1;
}
/* expect to have qt5 graphics. So get the qml engine prepared by graphics */
gui_priv->engine = (QQmlApplicationEngine*)graphics_get_data(gra, "engine");
if (gui_priv->engine == NULL) {
- dbg(lvl_error, "Graphics doesn't seem to be qt5, or doesn't have QML. Cannot set graphics\n");
+ dbg(lvl_error, "Graphics doesn't seem to be qt5, or doesn't have QML. Cannot set graphics");
return 1;
}
@@ -233,13 +233,13 @@ gui_qt5_qml_set_graphics(struct gui_priv* gui_priv, struct graphics* gra)
/* find the loader component */
gui_priv->loader = gui_priv->engine->rootObjects().value(0)->findChild<QObject*>("navit_loader");
if (gui_priv->loader != NULL) {
- dbg(lvl_debug, "navit_loader found\n");
+ dbg(lvl_debug, "navit_loader found");
/* load our root window into the loader component */
gui_priv->loader->setProperty("source", "qrc:///skins/modern/main.qml");
}
transform_get_size(trans, &gui_priv->w, &gui_priv->h);
- dbg(lvl_debug, "navit provided geometry: (%d, %d)\n", gui_priv->w, gui_priv->h);
+ dbg(lvl_debug, "navit provided geometry: (%d, %d)", gui_priv->w, gui_priv->h);
/* Was resize callback already issued? */
// if (navit_get_ready(gui_priv->nav) & 2)
@@ -254,14 +254,14 @@ gui_qt5_qml_set_graphics(struct gui_priv* gui_priv, struct graphics* gra)
static int
gui_qt5_qml_get_attr(struct gui_priv* gui_priv, enum attr_type type, struct attr* attr)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
return 1;
}
static int
gui_qt5_qml_set_attr(struct gui_priv* gui_priv, struct attr* attr)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
return 1;
}
@@ -284,7 +284,7 @@ gui_qt5_qml_new(struct navit* nav, struct gui_methods* meth, struct attr** attrs
struct gui_priv* gui_priv;
struct attr* attr;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
/* tell navit our methods */
*meth = gui_qt5_qml_methods;
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.chevron.down.svg b/navit/gui/qt5_qml/skins/icons/appbar.chevron.down.svg
index 3917fc7cd..7dfd18eb4 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.chevron.down.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.chevron.down.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 37.8516,39.5833L 52.1016,24.9375L 52.1016,35.2292L 37.8516,50.2708L 23.6016,35.2292L 23.6016,24.9375L 37.8516,39.5833 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.chevron.up.svg b/navit/gui/qt5_qml/skins/icons/appbar.chevron.up.svg
index b737d9773..a84cb0b21 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.chevron.up.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.chevron.up.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 37.8516,35.625L 34.6849,38.7917L 23.6016,50.2708L 23.6016,39.9792L 37.8516,24.9375L 52.1016,39.9792L 52.1016,50.2708L 41.0182,38.7917L 37.8516,35.625 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.cog.svg b/navit/gui/qt5_qml/skins/icons/appbar.cog.svg
index 4ef1ef8c2..0c0590fcc 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.cog.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.cog.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 27.5314,21.8628L 33.0126,19.4224L 34.7616,23.3507C 36.6693,22.9269 38.6044,22.8903 40.4668,23.2026L 42.0083,19.1868L 47.6098,21.337L 46.0683,25.3528C 47.6612,26.3669 49.0747,27.6889 50.2088,29.2803L 54.1371,27.5313L 56.5776,33.0126L 52.6493,34.7616C 53.0731,36.6693 53.1097,38.6043 52.7974,40.4668L 56.8131,42.0083L 54.6629,47.6097L 50.6472,46.0683C 49.6331,47.6613 48.3111,49.0748 46.7197,50.2089L 48.4686,54.1372L 42.9874,56.5776L 41.2384,52.6493C 39.3307,53.0731 37.3957,53.1097 35.5333,52.7974L 33.9918,56.8131L 28.3903,54.6629L 29.9318,50.6472C 28.3388,49.6331 26.9252,48.3111 25.7911,46.7196L 21.8628,48.4686L 19.4224,42.9873L 23.3507,41.2383C 22.9269,39.3307 22.8903,37.3957 23.2026,35.5332L 19.1869,33.9918L 21.3371,28.3903L 25.3528,29.9318C 26.3669,28.3388 27.6889,26.9252 29.2804,25.7911L 27.5314,21.8628 Z M 34.3394,29.7781C 29.7985,31.7998 27.7564,37.1198 29.7781,41.6606C 31.7998,46.2015 37.1198,48.2436 41.6606,46.2219C 46.2015,44.2002 48.2436,38.8802 46.2219,34.3394C 44.2002,29.7985 38.8802,27.7564 34.3394,29.7781 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.cogs.svg b/navit/gui/qt5_qml/skins/icons/appbar.cogs.svg
index e3fdaa4ce..d8c1ab0fa 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.cogs.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.cogs.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 32.6227,68.9728C 33.1208,70.2446 33.7077,71.4719 34.3757,72.6471C 35.567,72.7702 36.7761,72.8333 38,72.8333C 40.6447,72.8333 43.2205,72.5386 45.6965,71.9802C 42.2807,68.5449 40.1698,63.8107 40.1698,58.5835C 40.1698,48.0901 48.6764,39.5835 59.1698,39.5835C 64.2047,39.5835 68.7822,41.5419 72.182,44.7385C 72.6094,42.5584 72.8333,40.3053 72.8333,38C 72.8333,36.442 72.731,34.908 72.5328,33.4041C 70.4772,32.3109 68.2718,31.4621 65.9554,30.8963L 65.6219,22.7367C 63.5664,22.3692 61.4511,22.1741 59.2916,22.1671L 57.491,30.1322C 54.2845,30.3184 51.2204,31.0348 48.3848,32.1949L 43.318,25.7887C 41.3995,26.7177 39.5749,27.8102 37.8622,29.0479L 41.0883,36.5527C 38.6742,38.5364 36.5919,40.9091 34.9373,43.575L 27.0703,41.3697C 26.073,43.2256 25.2319,45.178 24.5646,47.2093L 31.5867,51.385C 30.9883,53.6844 30.6698,56.0968 30.6698,58.5835L 30.746,60.6839L 23.0854,63.5239C 23.3743,65.6539 23.8474,67.7255 24.4881,69.7219L 32.6227,68.9728 Z M 27.0669,37.1755L 34.9338,39.3807C 35.9312,37.5248 36.7723,35.5724 37.4395,33.5412L 30.4175,29.3654C 31.0159,27.066 31.3344,24.6537 31.3344,22.1669L 31.2581,20.0665L 38.9187,17.2265C 38.6299,15.0965 38.1568,13.0249 37.5161,11.0285L 29.3815,11.7776C 28.4787,9.47258 27.2844,7.31377 25.8439,5.34655C 22.7943,6.48232 19.9467,8.03307 17.3698,9.93015C 20.1557,13.2359 21.8344,17.5054 21.8344,22.1669C 21.8344,32.5019 13.5826,40.9096 3.30816,41.1611C 3.60321,44.4411 4.35293,47.59 5.49381,50.5444C 8.34489,50.2806 11.0742,49.5968 13.6194,48.5555L 18.6861,54.9617C 20.6046,54.0327 22.4293,52.9403 24.142,51.7025L 20.9158,44.1977C 23.3299,42.2141 25.4123,39.8414 27.0669,37.1755 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.fullscreen.box.svg b/navit/gui/qt5_qml/skins/icons/appbar.fullscreen.box.svg
index 13e6840e5..a3e73f41a 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.fullscreen.box.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.fullscreen.box.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 19,57L 19,19L 57,19L 57,57L 19,57 Z M 24,29L 47,29L 47,52L 52,52L 52,24L 24,24L 24,29 Z M 24,34L 24,52L 42,52L 42,34L 24,34 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.home.variant.svg b/navit/gui/qt5_qml/skins/icons/appbar.home.variant.svg
index ea951fd19..273ff72cd 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.home.variant.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.home.variant.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76.0106" height="76.0106" viewBox="0 0 76.01 76.01" enable-background="new 0 0 76.01 76.01" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 24.0033,56.0078L 24.0033,38.0053L 22.0031,40.0056L 19.0027,35.0049L 38.0053,20.0028L 45.0063,25.5299L 45.0063,21.753L 49.0068,21.0029L 49.0068,28.6882L 57.008,35.0049L 54.0075,40.0056L 52.0073,38.0053L 52.0073,56.0078L 24.0033,56.0078 Z M 38.0053,26.9204L 27.0038,36.005L 27.0038,53.0074L 38.0045,53.0075L 38.0045,41.0061L 46.0058,41.0061L 46.0059,53.0075L 49.0068,53.0074L 49.0068,36.005L 38.0053,26.9204 Z M 30.004,41.0057L 35.0049,41.0057L 35.0049,47.0066L 30.004,47.0066L 30.004,41.0057 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.information.circle.svg b/navit/gui/qt5_qml/skins/icons/appbar.information.circle.svg
index 031bd37f5..35a156ae9 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.information.circle.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.information.circle.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 38,19C 48.4934,19 57,27.5066 57,38C 57,48.4934 48.4934,57 38,57C 27.5066,57 19,48.4934 19,38C 19,27.5066 27.5066,19 38,19 Z M 33.25,33.25L 33.25,36.4167L 36.4166,36.4167L 36.4166,47.5L 33.25,47.5L 33.25,50.6667L 44.3333,50.6667L 44.3333,47.5L 41.1666,47.5L 41.1666,36.4167L 41.1666,33.25L 33.25,33.25 Z M 38.7917,25.3333C 37.48,25.3333 36.4167,26.3967 36.4167,27.7083C 36.4167,29.02 37.48,30.0833 38.7917,30.0833C 40.1033,30.0833 41.1667,29.02 41.1667,27.7083C 41.1667,26.3967 40.1033,25.3333 38.7917,25.3333 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.layer.delete.svg b/navit/gui/qt5_qml/skins/icons/appbar.layer.delete.svg
index ddbeb21ca..5157af942 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.layer.delete.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.layer.delete.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76.0106" height="76.0106" viewBox="0 0 76.01 76.01" enable-background="new 0 0 76.01 76.01" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 18.5088,44.0374L 21.8676,40.6786L 27.4655,46.2765L 33.0634,40.6786L 36.4222,44.0374L 30.8243,49.6353L 36.4222,55.2332L 33.0634,58.592L 27.4655,52.994L 21.8676,58.592L 18.5088,55.2332L 24.1068,49.6353L 18.5088,44.0374 Z M 57.0079,38.0053L 38.0053,47.5066L 36.7482,46.8781L 39.5889,44.0374L 35.2559,39.7977L 38.0053,41.1724L 50.6737,34.8382L 57.0079,38.0053 Z M 19.0026,38.0053L 25.3369,34.8382L 32.3326,38.3361L 29.8968,40.7719L 28.1098,42.5589L 25.7193,41.3636L 21.8676,37.6052L 20.6459,38.8269L 19.0026,38.0053 Z M 38.0053,19.0027L 57.0079,28.504L 38.0053,38.0053L 19.0026,28.504L 38.0053,19.0027 Z M 57.0079,47.5066L 38.0053,57.008L 37.8778,56.9442L 39.5889,55.2332L 33.9909,49.6353L 34.6367,48.9895L 38.0053,50.6738L 50.6737,44.3395L 57.0079,47.5066 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.layer.svg b/navit/gui/qt5_qml/skins/icons/appbar.layer.svg
index 9eb28235c..b89bb2da3 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.layer.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.layer.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76.0106" height="76.0106" viewBox="0 0 76.01 76.01" enable-background="new 0 0 76.01 76.01" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 57.0079,38.0053L 38.0053,47.5066L 19.0027,38.0053L 25.3369,34.8382L 38.0053,41.1724L 50.6737,34.8382L 57.0079,38.0053 Z M 38.0053,19.0027L 57.0079,28.504L 38.0053,38.0053L 19.0026,28.504L 38.0053,19.0027 Z M 57.0079,47.5066L 38.0053,57.008L 19.0026,47.5066L 25.3369,44.3395L 38.0053,50.6737L 50.6737,44.3395L 57.0079,47.5066 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.location.checkin.svg b/navit/gui/qt5_qml/skins/icons/appbar.location.checkin.svg
index 3b21754c6..a58141d22 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.location.checkin.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.location.checkin.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-linejoin="round" d="M 38,19C 42.9706,19 47,23.0294 47,28C 47,30.5642 45.9276,32.878 38,49C 30.0724,32.878 29,30.5642 29,28C 29,23.0294 33.0294,19 38,19 Z M 38,24C 35.7909,24 34,25.7909 34,28C 34,30.2092 35.7909,32 38,32C 40.2091,32 42,30.2092 42,28C 42,25.7909 40.2091,24 38,24 Z M 19,57L 24,42L 31.5,42L 33.5,46L 27.6641,46L 25.3324,53L 50.6676,53L 48.3359,46L 42.5,46L 44.5,42L 52,42L 57,57L 19,57 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.map.svg b/navit/gui/qt5_qml/skins/icons/appbar.map.svg
index 241f71e59..0a157d0da 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.map.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.map.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 27.7083,23.75L 38.7917,26.9167L 48.2917,20.5833L 62,24L 62,51L 48.2917,47.5L 38.7917,53.8333L 27.7083,50.6667L 16,55.5L 16,28.5L 27.7083,23.75 Z M 27,46.25L 27,29L 20,31.75L 20,49L 27,46.25 Z M 49,25.5L 49,42.75L 58,45.25L 58,28L 49,25.5 Z M 39,31.5L 39,49L 48,43L 48,25.5L 39,31.5 Z M 28,28.75L 28,46L 38,48.5L 38,31.75L 28,28.75 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.power.svg b/navit/gui/qt5_qml/skins/icons/appbar.power.svg
index d3f865c0d..db23bca1f 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.power.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.power.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 36.4167,36.4167L 36.4167,17.4167L 41.1667,17.4167L 41.1667,36.4167L 36.4167,36.4167 Z M 57,39.5833C 57,50.0767 48.4934,58.5833 38,58.5833C 27.5066,58.5833 19,50.0767 19,39.5833C 19,30.7301 25.0552,23.2911 33.25,21.1819L 33.25,27.8374C 28.6079,29.7165 25.3333,34.2675 25.3333,39.5833C 25.3333,46.5789 31.0044,52.25 38,52.25C 44.9956,52.25 50.6667,46.5789 50.6667,39.5833C 50.6667,34.8949 48.1194,30.8014 44.3333,28.6113L 44.3333,21.6645C 51.7129,24.2728 57,31.3106 57,39.5833 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.rocket.svg b/navit/gui/qt5_qml/skins/icons/appbar.rocket.svg
index a8c5c273a..d3b9d0a16 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.rocket.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.rocket.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 38,19C 39.4823,20.6344 43,26.1259 43,41L 47,46L 47,55L 43,50L 33,50L 29,55L 29,46L 33,41C 33,26.1259 36.0177,20.6344 38,19 Z M 38,57.5L 35,51L 41,51L 38,57.5 Z M 38,27L 36.1552,27.4612L 35.6203,30.5949L 38,30L 40.2918,30.573L 39.6953,27.4238L 38,27 Z "/>
diff --git a/navit/gui/qt5_qml/skins/icons/appbar.transit.car.svg b/navit/gui/qt5_qml/skins/icons/appbar.transit.car.svg
index 8ea1a7c5d..3a6e7a287 100644
--- a/navit/gui/qt5_qml/skins/icons/appbar.transit.car.svg
+++ b/navit/gui/qt5_qml/skins/icons/appbar.transit.car.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 17.4167,50.6667C 16.5422,50.6667 15.8333,49.9578 15.8333,49.0833L 15.8333,39.5834C 15.8333,37.0877 17.2768,34.9292 19.3745,33.8972L 25.3333,19L 26.9167,19L 30.0833,19L 45.9167,19L 49.0833,19L 50.6667,19L 56.6255,33.8972C 58.7231,34.9292 60.1666,37.0877 60.1666,39.5834L 60.1667,49.0833C 60.1667,49.9578 59.4578,50.6667 58.5833,50.6667L 57,50.6667L 57,53.8333C 57,55.5822 55.5822,57 53.8333,57C 52.0844,57 50.6667,55.5822 50.6667,53.8333L 50.6667,50.6667L 25.3333,50.6667L 25.3333,53.8333C 25.3333,55.5822 23.9156,57 22.1667,57C 20.4178,57 19,55.5822 19,53.8333L 19,50.6667L 17.4167,50.6667 Z M 24.3833,33.25L 51.6166,33.25L 47.8166,23.75L 28.1833,23.75L 24.3833,33.25 Z M 24.1458,36.0209C 22.3969,36.0209 20.5833,37.8344 20.5833,39.5833C 20.5833,41.3322 22.3969,43.1458 24.1458,43.1458C 25.8947,43.1458 27.7083,41.3323 27.7083,39.5834C 27.7083,37.8345 25.8947,36.0209 24.1458,36.0209 Z M 51.8542,36.0208C 50.1053,36.0208 48.2917,37.8344 48.2917,39.5833C 48.2917,41.3322 50.1053,43.1458 51.8542,43.1458C 53.6031,43.1458 55.4167,41.3322 55.4167,39.5833C 55.4167,37.8344 53.6031,36.0208 51.8542,36.0208 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.book.list.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.book.list.svg
index 9dda725d2..c8e86b13f 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.book.list.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.book.list.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 22,19L 24,19L 24,57L 22,57L 22,19 Z M 26,57L 26,19.0001L 53.9999,19.0001L 53.9999,57L 26,57 Z M 30,24L 30,27L 50,27L 50,24L 30,24 Z M 30,32L 30,35L 33,35L 33,32L 30,32 Z M 36,32L 36,35L 49,35L 49,32L 36,32 Z M 30,40L 30,43L 33,43L 33,40L 30,40 Z M 36,40L 36,43L 48,43L 48,40L 36,40 Z M 30,48L 30,51L 33,51L 33,48L 30,48 Z M 36,48L 36,51L 50,51L 50,48L 36,48 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.chevron.down.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.chevron.down.svg
index 3917fc7cd..7dfd18eb4 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.chevron.down.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.chevron.down.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 37.8516,39.5833L 52.1016,24.9375L 52.1016,35.2292L 37.8516,50.2708L 23.6016,35.2292L 23.6016,24.9375L 37.8516,39.5833 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.chevron.up.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.chevron.up.svg
index b737d9773..a84cb0b21 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.chevron.up.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.chevron.up.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 37.8516,35.625L 34.6849,38.7917L 23.6016,50.2708L 23.6016,39.9792L 37.8516,24.9375L 52.1016,39.9792L 52.1016,50.2708L 41.0182,38.7917L 37.8516,35.625 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.city.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.city.svg
index f66893f7e..b23bfadeb 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.city.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.city.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 44.3333,30.0833L 57,30.0833L 57,57L 44.3333,57L 44.3333,30.0833 Z M 46.3125,35.2292L 46.3125,38L 49.0833,38L 49.0833,35.2292L 46.3125,35.2292 Z M 52.25,35.2292L 52.25,38L 55.0208,38L 55.0208,35.2292L 52.25,35.2292 Z M 46.3125,39.9792L 46.3125,42.75L 49.0833,42.75L 49.0833,39.9792L 46.3125,39.9792 Z M 52.25,39.9792L 52.25,42.75L 55.0208,42.75L 55.0208,39.9792L 52.25,39.9792 Z M 46.3125,44.7292L 46.3125,47.5L 49.0833,47.5L 49.0833,44.7292L 46.3125,44.7292 Z M 52.25,44.7292L 52.25,47.5L 55.0208,47.5L 55.0208,44.7292L 52.25,44.7292 Z M 46.3125,49.4792L 46.3125,52.25L 49.0833,52.25L 49.0833,49.4792L 46.3125,49.4792 Z M 52.25,49.4792L 52.25,52.25L 55.0208,52.25L 55.0208,49.4792L 52.25,49.4792 Z M 23.75,25.3333L 25.3333,22.1667L 26.9167,22.1667L 26.9167,18.2084L 28.5,18.2084L 28.5,22.1667L 31.6667,22.1667L 31.6667,18.2084L 33.25,18.2084L 33.25,22.1667L 34.8333,22.1667L 36.4167,25.3333L 36.4167,34.8334L 38.7917,34.8333L 41.1667,37.2083L 41.1667,57L 19,57L 19,37.2083L 21.375,34.8333L 23.75,34.8334L 23.75,25.3333 Z M 25.7291,27.3125L 25.7291,30.0834L 28.1041,30.0834L 28.1041,27.3125L 25.7291,27.3125 Z M 32.0625,27.3125L 32.0625,30.0834L 34.4375,30.0834L 34.4375,27.3125L 32.0625,27.3125 Z M 25.7291,32.0625L 25.7291,34.8334L 28.1041,34.8334L 28.1041,32.0625L 25.7291,32.0625 Z M 32.0625,32.0625L 32.0625,34.8334L 34.4375,34.8334L 34.4375,32.0625L 32.0625,32.0625 Z M 30.875,39.9792L 28.8958,39.9792L 28.8958,42.75L 30.875,42.75L 30.875,39.9792 Z M 24.5416,39.9792L 24.5416,42.75L 26.9166,42.75L 26.9166,39.9792L 24.5416,39.9792 Z M 36.0208,39.9792L 33.25,39.9792L 33.25,42.75L 36.0208,42.75L 36.0208,39.9792 Z M 30.875,44.7292L 28.8958,44.7292L 28.8958,47.5L 30.875,47.5L 30.875,44.7292 Z M 26.9166,44.7292L 24.5416,44.7292L 24.5416,47.5L 26.9166,47.5L 26.9166,44.7292 Z M 36.0208,44.7292L 33.25,44.7292L 33.25,47.5L 36.0208,47.5L 36.0208,44.7292 Z M 30.875,49.4792L 28.8958,49.4792L 28.8958,52.25L 30.875,52.25L 30.875,49.4792 Z M 26.9166,49.4792L 24.5416,49.4792L 24.5417,52.25L 26.9167,52.25L 26.9166,49.4792 Z M 36.0208,49.4792L 33.25,49.4792L 33.25,52.25L 36.0208,52.25L 36.0208,49.4792 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.cog.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.cog.svg
index 4ef1ef8c2..0c0590fcc 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.cog.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.cog.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 27.5314,21.8628L 33.0126,19.4224L 34.7616,23.3507C 36.6693,22.9269 38.6044,22.8903 40.4668,23.2026L 42.0083,19.1868L 47.6098,21.337L 46.0683,25.3528C 47.6612,26.3669 49.0747,27.6889 50.2088,29.2803L 54.1371,27.5313L 56.5776,33.0126L 52.6493,34.7616C 53.0731,36.6693 53.1097,38.6043 52.7974,40.4668L 56.8131,42.0083L 54.6629,47.6097L 50.6472,46.0683C 49.6331,47.6613 48.3111,49.0748 46.7197,50.2089L 48.4686,54.1372L 42.9874,56.5776L 41.2384,52.6493C 39.3307,53.0731 37.3957,53.1097 35.5333,52.7974L 33.9918,56.8131L 28.3903,54.6629L 29.9318,50.6472C 28.3388,49.6331 26.9252,48.3111 25.7911,46.7196L 21.8628,48.4686L 19.4224,42.9873L 23.3507,41.2383C 22.9269,39.3307 22.8903,37.3957 23.2026,35.5332L 19.1869,33.9918L 21.3371,28.3903L 25.3528,29.9318C 26.3669,28.3388 27.6889,26.9252 29.2804,25.7911L 27.5314,21.8628 Z M 34.3394,29.7781C 29.7985,31.7998 27.7564,37.1198 29.7781,41.6606C 31.7998,46.2015 37.1198,48.2436 41.6606,46.2219C 46.2015,44.2002 48.2436,38.8802 46.2219,34.3394C 44.2002,29.7985 38.8802,27.7564 34.3394,29.7781 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.cogs.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.cogs.svg
index e3fdaa4ce..d8c1ab0fa 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.cogs.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.cogs.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 32.6227,68.9728C 33.1208,70.2446 33.7077,71.4719 34.3757,72.6471C 35.567,72.7702 36.7761,72.8333 38,72.8333C 40.6447,72.8333 43.2205,72.5386 45.6965,71.9802C 42.2807,68.5449 40.1698,63.8107 40.1698,58.5835C 40.1698,48.0901 48.6764,39.5835 59.1698,39.5835C 64.2047,39.5835 68.7822,41.5419 72.182,44.7385C 72.6094,42.5584 72.8333,40.3053 72.8333,38C 72.8333,36.442 72.731,34.908 72.5328,33.4041C 70.4772,32.3109 68.2718,31.4621 65.9554,30.8963L 65.6219,22.7367C 63.5664,22.3692 61.4511,22.1741 59.2916,22.1671L 57.491,30.1322C 54.2845,30.3184 51.2204,31.0348 48.3848,32.1949L 43.318,25.7887C 41.3995,26.7177 39.5749,27.8102 37.8622,29.0479L 41.0883,36.5527C 38.6742,38.5364 36.5919,40.9091 34.9373,43.575L 27.0703,41.3697C 26.073,43.2256 25.2319,45.178 24.5646,47.2093L 31.5867,51.385C 30.9883,53.6844 30.6698,56.0968 30.6698,58.5835L 30.746,60.6839L 23.0854,63.5239C 23.3743,65.6539 23.8474,67.7255 24.4881,69.7219L 32.6227,68.9728 Z M 27.0669,37.1755L 34.9338,39.3807C 35.9312,37.5248 36.7723,35.5724 37.4395,33.5412L 30.4175,29.3654C 31.0159,27.066 31.3344,24.6537 31.3344,22.1669L 31.2581,20.0665L 38.9187,17.2265C 38.6299,15.0965 38.1568,13.0249 37.5161,11.0285L 29.3815,11.7776C 28.4787,9.47258 27.2844,7.31377 25.8439,5.34655C 22.7943,6.48232 19.9467,8.03307 17.3698,9.93015C 20.1557,13.2359 21.8344,17.5054 21.8344,22.1669C 21.8344,32.5019 13.5826,40.9096 3.30816,41.1611C 3.60321,44.4411 4.35293,47.59 5.49381,50.5444C 8.34489,50.2806 11.0742,49.5968 13.6194,48.5555L 18.6861,54.9617C 20.6046,54.0327 22.4293,52.9403 24.142,51.7025L 20.9158,44.1977C 23.3299,42.2141 25.4123,39.8414 27.0669,37.1755 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.fullscreen.box.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.fullscreen.box.svg
index 13e6840e5..a3e73f41a 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.fullscreen.box.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.fullscreen.box.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 19,57L 19,19L 57,19L 57,57L 19,57 Z M 24,29L 47,29L 47,52L 52,52L 52,24L 24,24L 24,29 Z M 24,34L 24,52L 42,52L 42,34L 24,34 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.home.variant.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.home.variant.svg
index ea951fd19..273ff72cd 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.home.variant.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.home.variant.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76.0106" height="76.0106" viewBox="0 0 76.01 76.01" enable-background="new 0 0 76.01 76.01" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 24.0033,56.0078L 24.0033,38.0053L 22.0031,40.0056L 19.0027,35.0049L 38.0053,20.0028L 45.0063,25.5299L 45.0063,21.753L 49.0068,21.0029L 49.0068,28.6882L 57.008,35.0049L 54.0075,40.0056L 52.0073,38.0053L 52.0073,56.0078L 24.0033,56.0078 Z M 38.0053,26.9204L 27.0038,36.005L 27.0038,53.0074L 38.0045,53.0075L 38.0045,41.0061L 46.0058,41.0061L 46.0059,53.0075L 49.0068,53.0074L 49.0068,36.005L 38.0053,26.9204 Z M 30.004,41.0057L 35.0049,41.0057L 35.0049,47.0066L 30.004,47.0066L 30.004,41.0057 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.information.circle.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.information.circle.svg
index 031bd37f5..35a156ae9 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.information.circle.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.information.circle.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 38,19C 48.4934,19 57,27.5066 57,38C 57,48.4934 48.4934,57 38,57C 27.5066,57 19,48.4934 19,38C 19,27.5066 27.5066,19 38,19 Z M 33.25,33.25L 33.25,36.4167L 36.4166,36.4167L 36.4166,47.5L 33.25,47.5L 33.25,50.6667L 44.3333,50.6667L 44.3333,47.5L 41.1666,47.5L 41.1666,36.4167L 41.1666,33.25L 33.25,33.25 Z M 38.7917,25.3333C 37.48,25.3333 36.4167,26.3967 36.4167,27.7083C 36.4167,29.02 37.48,30.0833 38.7917,30.0833C 40.1033,30.0833 41.1667,29.02 41.1667,27.7083C 41.1667,26.3967 40.1033,25.3333 38.7917,25.3333 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.layer.delete.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.layer.delete.svg
index ddbeb21ca..5157af942 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.layer.delete.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.layer.delete.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76.0106" height="76.0106" viewBox="0 0 76.01 76.01" enable-background="new 0 0 76.01 76.01" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 18.5088,44.0374L 21.8676,40.6786L 27.4655,46.2765L 33.0634,40.6786L 36.4222,44.0374L 30.8243,49.6353L 36.4222,55.2332L 33.0634,58.592L 27.4655,52.994L 21.8676,58.592L 18.5088,55.2332L 24.1068,49.6353L 18.5088,44.0374 Z M 57.0079,38.0053L 38.0053,47.5066L 36.7482,46.8781L 39.5889,44.0374L 35.2559,39.7977L 38.0053,41.1724L 50.6737,34.8382L 57.0079,38.0053 Z M 19.0026,38.0053L 25.3369,34.8382L 32.3326,38.3361L 29.8968,40.7719L 28.1098,42.5589L 25.7193,41.3636L 21.8676,37.6052L 20.6459,38.8269L 19.0026,38.0053 Z M 38.0053,19.0027L 57.0079,28.504L 38.0053,38.0053L 19.0026,28.504L 38.0053,19.0027 Z M 57.0079,47.5066L 38.0053,57.008L 37.8778,56.9442L 39.5889,55.2332L 33.9909,49.6353L 34.6367,48.9895L 38.0053,50.6738L 50.6737,44.3395L 57.0079,47.5066 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.layer.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.layer.svg
index 9eb28235c..b89bb2da3 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.layer.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.layer.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76.0106" height="76.0106" viewBox="0 0 76.01 76.01" enable-background="new 0 0 76.01 76.01" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 57.0079,38.0053L 38.0053,47.5066L 19.0027,38.0053L 25.3369,34.8382L 38.0053,41.1724L 50.6737,34.8382L 57.0079,38.0053 Z M 38.0053,19.0027L 57.0079,28.504L 38.0053,38.0053L 19.0026,28.504L 38.0053,19.0027 Z M 57.0079,47.5066L 38.0053,57.008L 19.0026,47.5066L 25.3369,44.3395L 38.0053,50.6737L 50.6737,44.3395L 57.0079,47.5066 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.location.checkin.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.location.checkin.svg
index 3b21754c6..a58141d22 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.location.checkin.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.location.checkin.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-linejoin="round" d="M 38,19C 42.9706,19 47,23.0294 47,28C 47,30.5642 45.9276,32.878 38,49C 30.0724,32.878 29,30.5642 29,28C 29,23.0294 33.0294,19 38,19 Z M 38,24C 35.7909,24 34,25.7909 34,28C 34,30.2092 35.7909,32 38,32C 40.2091,32 42,30.2092 42,28C 42,25.7909 40.2091,24 38,24 Z M 19,57L 24,42L 31.5,42L 33.5,46L 27.6641,46L 25.3324,53L 50.6676,53L 48.3359,46L 42.5,46L 44.5,42L 52,42L 57,57L 19,57 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.location.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.location.svg
index fff6bf3e1..22f2d7001 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.location.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.location.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 26.9167,13.8542L 50.6666,13.8542L 50.6667,39.5833L 26.9167,63.3333L 26.9167,13.8542 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.map.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.map.svg
index 241f71e59..0a157d0da 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.map.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.map.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 27.7083,23.75L 38.7917,26.9167L 48.2917,20.5833L 62,24L 62,51L 48.2917,47.5L 38.7917,53.8333L 27.7083,50.6667L 16,55.5L 16,28.5L 27.7083,23.75 Z M 27,46.25L 27,29L 20,31.75L 20,49L 27,46.25 Z M 49,25.5L 49,42.75L 58,45.25L 58,28L 49,25.5 Z M 39,31.5L 39,49L 48,43L 48,25.5L 39,31.5 Z M 28,28.75L 28,46L 38,48.5L 38,31.75L 28,28.75 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.power.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.power.svg
index d3f865c0d..db23bca1f 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.power.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.power.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 36.4167,36.4167L 36.4167,17.4167L 41.1667,17.4167L 41.1667,36.4167L 36.4167,36.4167 Z M 57,39.5833C 57,50.0767 48.4934,58.5833 38,58.5833C 27.5066,58.5833 19,50.0767 19,39.5833C 19,30.7301 25.0552,23.2911 33.25,21.1819L 33.25,27.8374C 28.6079,29.7165 25.3333,34.2675 25.3333,39.5833C 25.3333,46.5789 31.0044,52.25 38,52.25C 44.9956,52.25 50.6667,46.5789 50.6667,39.5833C 50.6667,34.8949 48.1194,30.8014 44.3333,28.6113L 44.3333,21.6645C 51.7129,24.2728 57,31.3106 57,39.5833 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.rocket.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.rocket.svg
index a8c5c273a..d3b9d0a16 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.rocket.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.rocket.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 38,19C 39.4823,20.6344 43,26.1259 43,41L 47,46L 47,55L 43,50L 33,50L 29,55L 29,46L 33,41C 33,26.1259 36.0177,20.6344 38,19 Z M 38,57.5L 35,51L 41,51L 38,57.5 Z M 38,27L 36.1552,27.4612L 35.6203,30.5949L 38,30L 40.2918,30.573L 39.6953,27.4238L 38,27 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.timer.rewind.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.timer.rewind.svg
index a02cff6b7..7aded7af0 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.timer.rewind.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.timer.rewind.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 53.8333,41.1667C 53.8333,49.9112 46.7445,57 38,57C 29.2555,57 22.1667,49.9112 22.1667,41.1667C 22.1667,32.9565 28.4156,26.2059 36.4167,25.4115L 36.4167,23.75L 31.6667,23.75L 31.6667,19L 44.3333,19L 44.3333,23.75L 39.5833,23.75L 39.5833,25.4115C 42.7678,25.7277 45.6747,26.9874 48.0205,28.907L 49.1629,27.7646L 46.9237,25.5254L 50.2825,22.1667L 57,28.8842L 53.6412,32.2429L 51.4021,30.0038L 50.2597,31.1462C 52.4932,33.8756 53.8333,37.3647 53.8333,41.1667 Z M 26.2296,39.5834L 30.0833,39.5834L 30.0833,42.75L 26.2296,42.75C 26.9347,48.0419 31.1248,52.232 36.4166,52.9371L 36.4166,49.0833L 39.5833,49.0833L 39.5833,52.9371C 44.8752,52.232 49.0653,48.0419 49.7703,42.75L 45.9166,42.75L 45.9166,39.5834L 49.7703,39.5834C 49.0652,34.2915 44.8751,30.1014 39.5833,29.3964L 39.5833,33.25L 36.4166,33.25L 36.4166,29.3964C 31.1248,30.1014 26.9347,34.2915 26.2296,39.5834 Z M 38,38C 39.7488,38 41.1666,39.4178 41.1666,41.1667C 41.1666,42.9156 39.7488,44.3334 38,44.3334L 31.6666,49.0834L 34.8333,41.1667C 34.8333,39.4178 36.2511,38 38,38 Z M 19.7917,33.25L 19.7917,26.938C 17.2963,30.5244 15.8333,34.883 15.8333,39.5833C 15.8333,51.8257 25.7577,61.75 38,61.75L 42.3542,61.75C 54.3778,61.75 64.1249,51.8257 64.125,39.5835C 64.125,54.0119 52.4284,65.7083 38,65.7083C 23.5716,65.7083 11.875,54.0118 11.875,39.5833C 11.875,33.9832 13.6371,28.7946 16.637,24.5417L 11.0833,24.5417L 15.0417,20.5834L 23.75,20.5833L 23.75,29.2917L 19.7917,33.25 Z "/>
diff --git a/navit/gui/qt5_qml/skins/modern/icons/appbar.transit.car.svg b/navit/gui/qt5_qml/skins/modern/icons/appbar.transit.car.svg
index 8ea1a7c5d..3a6e7a287 100644
--- a/navit/gui/qt5_qml/skins/modern/icons/appbar.transit.car.svg
+++ b/navit/gui/qt5_qml/skins/modern/icons/appbar.transit.car.svg
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" baseProfile="full" width="76" height="76" viewBox="0 0 76.00 76.00" enable-background="new 0 0 76.00 76.00" xml:space="preserve">
<path fill="#ffffff" fill-opacity="1" stroke-width="0.2" stroke-linejoin="round" d="M 17.4167,50.6667C 16.5422,50.6667 15.8333,49.9578 15.8333,49.0833L 15.8333,39.5834C 15.8333,37.0877 17.2768,34.9292 19.3745,33.8972L 25.3333,19L 26.9167,19L 30.0833,19L 45.9167,19L 49.0833,19L 50.6667,19L 56.6255,33.8972C 58.7231,34.9292 60.1666,37.0877 60.1666,39.5834L 60.1667,49.0833C 60.1667,49.9578 59.4578,50.6667 58.5833,50.6667L 57,50.6667L 57,53.8333C 57,55.5822 55.5822,57 53.8333,57C 52.0844,57 50.6667,55.5822 50.6667,53.8333L 50.6667,50.6667L 25.3333,50.6667L 25.3333,53.8333C 25.3333,55.5822 23.9156,57 22.1667,57C 20.4178,57 19,55.5822 19,53.8333L 19,50.6667L 17.4167,50.6667 Z M 24.3833,33.25L 51.6166,33.25L 47.8166,23.75L 28.1833,23.75L 24.3833,33.25 Z M 24.1458,36.0209C 22.3969,36.0209 20.5833,37.8344 20.5833,39.5833C 20.5833,41.3322 22.3969,43.1458 24.1458,43.1458C 25.8947,43.1458 27.7083,41.3323 27.7083,39.5834C 27.7083,37.8345 25.8947,36.0209 24.1458,36.0209 Z M 51.8542,36.0208C 50.1053,36.0208 48.2917,37.8344 48.2917,39.5833C 48.2917,41.3322 50.1053,43.1458 51.8542,43.1458C 53.6031,43.1458 55.4167,41.3322 55.4167,39.5833C 55.4167,37.8344 53.6031,36.0208 51.8542,36.0208 Z "/>
diff --git a/navit/gui/win32/ceglue.c b/navit/gui/win32/ceglue.c
index a0817f935..772eb782d 100644
--- a/navit/gui/win32/ceglue.c
+++ b/navit/gui/win32/ceglue.c
@@ -1,77 +1,77 @@
-#include <windows.h>
-#include "ceglue.h"
-
-BOOL FAR (*SHFullScreenPtr)(HWND hwnd, DWORD state) = NULL;
-
-void InitCeGlue (void)
-{
- HINSTANCE ayg = LoadLibraryW (TEXT ("aygshell.dll"));
- if (ayg != NULL) {
- SHFullScreenPtr = (BOOL (*)(HWND, DWORD))
- GetProcAddressW (ayg, TEXT ("SHFullScreen"));
- }
-}
-
-// code to turn of screen adopted from
-// http://msdn.microsoft.com/en-us/library/ms838354.aspx
-
-// GDI Escapes for ExtEscape()
-#define QUERYESCSUPPORT 8
-
-// The following are unique to CE
-#define GETVFRAMEPHYSICAL 6144
-#define GETVFRAMELEN 6145
-#define DBGDRIVERSTAT 6146
-#define SETPOWERMANAGEMENT 6147
-#define GETPOWERMANAGEMENT 6148
-
-
-typedef enum _VIDEO_POWER_STATE {
- VideoPowerOn = 1,
- VideoPowerStandBy,
- VideoPowerSuspend,
- VideoPowerOff
-} VIDEO_POWER_STATE, *PVIDEO_POWER_STATE;
-
-
-typedef struct _VIDEO_POWER_MANAGEMENT {
- ULONG Length;
- ULONG DPMSVersion;
- ULONG PowerState;
-} VIDEO_POWER_MANAGEMENT, *PVIDEO_POWER_MANAGEMENT;
-
-
-int CeEnableBacklight(int enable)
-{
- HDC gdc;
- int iESC=SETPOWERMANAGEMENT;
-
- gdc = GetDC(NULL);
- if (ExtEscape(gdc, QUERYESCSUPPORT, sizeof(int), (LPCSTR)&iESC,
- 0, NULL)==0)
- {
- MessageBox(NULL,
- L"Sorry, your Pocket PC does not support DisplayOff",
- L"Pocket PC Display Off Feature",
- MB_OK);
- ReleaseDC(NULL, gdc);
- return FALSE;
- }
- else
- {
- VIDEO_POWER_MANAGEMENT vpm;
- vpm.Length = sizeof(VIDEO_POWER_MANAGEMENT);
- vpm.DPMSVersion = 0x0001;
- if (enable) {
- vpm.PowerState = VideoPowerOn;
- } else {
- vpm.PowerState = VideoPowerOff;
- }
- // Power off the display
- ExtEscape(gdc, SETPOWERMANAGEMENT, vpm.Length, (LPCSTR) &vpm,
- 0, NULL);
- ReleaseDC(NULL, gdc);
- return TRUE;
- }
-}
-
+#include <windows.h>
+#include "ceglue.h"
+
+BOOL FAR (*SHFullScreenPtr)(HWND hwnd, DWORD state) = NULL;
+
+void InitCeGlue (void)
+{
+ HINSTANCE ayg = LoadLibraryW (TEXT ("aygshell.dll"));
+ if (ayg != NULL) {
+ SHFullScreenPtr = (BOOL (*)(HWND, DWORD))
+ GetProcAddressW (ayg, TEXT ("SHFullScreen"));
+ }
+}
+
+// code to turn of screen adopted from
+// http://msdn.microsoft.com/en-us/library/ms838354.aspx
+
+// GDI Escapes for ExtEscape()
+#define QUERYESCSUPPORT 8
+
+// The following are unique to CE
+#define GETVFRAMEPHYSICAL 6144
+#define GETVFRAMELEN 6145
+#define DBGDRIVERSTAT 6146
+#define SETPOWERMANAGEMENT 6147
+#define GETPOWERMANAGEMENT 6148
+
+
+typedef enum _VIDEO_POWER_STATE {
+ VideoPowerOn = 1,
+ VideoPowerStandBy,
+ VideoPowerSuspend,
+ VideoPowerOff
+} VIDEO_POWER_STATE, *PVIDEO_POWER_STATE;
+
+
+typedef struct _VIDEO_POWER_MANAGEMENT {
+ ULONG Length;
+ ULONG DPMSVersion;
+ ULONG PowerState;
+} VIDEO_POWER_MANAGEMENT, *PVIDEO_POWER_MANAGEMENT;
+
+
+int CeEnableBacklight(int enable)
+{
+ HDC gdc;
+ int iESC=SETPOWERMANAGEMENT;
+
+ gdc = GetDC(NULL);
+ if (ExtEscape(gdc, QUERYESCSUPPORT, sizeof(int), (LPCSTR)&iESC,
+ 0, NULL)==0)
+ {
+ MessageBox(NULL,
+ L"Sorry, your Pocket PC does not support DisplayOff",
+ L"Pocket PC Display Off Feature",
+ MB_OK);
+ ReleaseDC(NULL, gdc);
+ return FALSE;
+ }
+ else
+ {
+ VIDEO_POWER_MANAGEMENT vpm;
+ vpm.Length = sizeof(VIDEO_POWER_MANAGEMENT);
+ vpm.DPMSVersion = 0x0001;
+ if (enable) {
+ vpm.PowerState = VideoPowerOn;
+ } else {
+ vpm.PowerState = VideoPowerOff;
+ }
+ // Power off the display
+ ExtEscape(gdc, SETPOWERMANAGEMENT, vpm.Length, (LPCSTR) &vpm,
+ 0, NULL);
+ ReleaseDC(NULL, gdc);
+ return TRUE;
+ }
+}
+
diff --git a/navit/gui/win32/ceglue.h b/navit/gui/win32/ceglue.h
index b0dc79d42..bb185dbed 100644
--- a/navit/gui/win32/ceglue.h
+++ b/navit/gui/win32/ceglue.h
@@ -1,16 +1,16 @@
-#ifndef CEGLUE_H
-#define CEGLUE_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern BOOL (*SHFullScreenPtr)(HWND hwnd, DWORD state);
-void InitCeGlue (void);
-
-int CeEnableBacklight(int enable);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
+#ifndef CEGLUE_H
+#define CEGLUE_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern BOOL (*SHFullScreenPtr)(HWND hwnd, DWORD state);
+void InitCeGlue (void);
+
+int CeEnableBacklight(int enable);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/navit/gui/win32/gui_win32.c b/navit/gui/win32/gui_win32.c
index 8a8cb37b9..7c964dbb9 100644
--- a/navit/gui/win32/gui_win32.c
+++ b/navit/gui/win32/gui_win32.c
@@ -185,7 +185,7 @@ static void window_layout( HWND hwnd )
rcClient.top += iToolHeight;
- dbg(lvl_debug, "resize gui to: %d %d %d %d \n", rcClient.left, rcClient.right, rcClient.top, rcClient.bottom );
+ dbg(lvl_debug, "resize gui to: %d %d %d %d ", rcClient.left, rcClient.right, rcClient.top, rcClient.bottom );
hChild = GetDlgItem(hwnd, ID_CHILD_GFX);
@@ -285,7 +285,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
attr.type=attr_cursor;
// TODO attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w));
if(!navit_set_attr(gui->nav, &attr)) {
- dbg(lvl_error, "Failed to set attr_cursor\n");
+ dbg(lvl_error, "Failed to set attr_cursor");
}
return 0;
}
@@ -298,7 +298,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l
// attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w));
attr.u.num = 0; // TODO
if(!navit_set_attr(gui->nav, &attr)) {
- dbg(lvl_error, "Failed to set attr_orientation\n");
+ dbg(lvl_error, "Failed to set attr_orientation");
}
return 0;
}
diff --git a/navit/gui/win32/win32_gui_destination.c b/navit/gui/win32/win32_gui_destination.c
index 115b9058b..e4a08072f 100644
--- a/navit/gui/win32/win32_gui_destination.c
+++ b/navit/gui/win32/win32_gui_destination.c
@@ -212,7 +212,7 @@ static void notify_textchange(struct datawindow_priv *datawindow, int param1, in
(void)ListView_InsertItem(datawindow->hwndList, &lvI);
ListView_SetItemText(datawindow->hwndList, listIndex, 1, tcharBuffer);
g_free(tcharBuffer);
- dbg(lvl_debug,"%s\n", res->country->name);
+ dbg(lvl_debug,"%s", res->country->name);
listIndex++;
}
}
@@ -307,7 +307,7 @@ BOOL register_destination_window()
if (!RegisterClass(&wc))
{
- dbg(lvl_error, "Window Registration Failed!\n");
+ dbg(lvl_error, "Window Registration Failed!");
return FALSE;
}
return TRUE;
@@ -339,7 +339,7 @@ HANDLE create_destination_window( struct navit *nav )
if (this_->hwnd == NULL)
{
- dbg(lvl_error, "Window Creation Failed!\n");
+ dbg(lvl_error, "Window Creation Failed!");
return 0;
}
diff --git a/navit/icons/gui_layers.svg b/navit/icons/gui_layers.svg
index 810b5a1d6..44bb0a32e 100644
--- a/navit/icons/gui_layers.svg
+++ b/navit/icons/gui_layers.svg
@@ -1,33 +1,33 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="18.02128" height="18" id="svg5952">
- <defs id="defs5954">
- <linearGradient id="linearGradient2485-94">
- <stop id="stop2486-7" style="stop-color:#ffffff;stop-opacity:1" offset="0"/>
- <stop id="stop2487-83" style="stop-color:#aaaaaa;stop-opacity:1" offset="1"/>
- </linearGradient>
- <linearGradient id="linearGradient5704-5">
- <stop id="stop5706-120" style="stop-color:#5a5a5a;stop-opacity:1" offset="0"/>
- <stop id="stop5708-16" style="stop-color:#000000;stop-opacity:1" offset="1"/>
- </linearGradient>
- <linearGradient x1="974.19751" y1="182.46863" x2="979.80444" y2="184.8026" id="linearGradient4351" xlink:href="#linearGradient2485-94" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-173.95451)"/>
- <linearGradient x1="968.88806" y1="178.31856" x2="977.93347" y2="181.70978" id="linearGradient4353" xlink:href="#linearGradient5704-5" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-173.95451)"/>
- <linearGradient x1="974.19751" y1="182.46863" x2="979.80444" y2="184.8026" id="linearGradient4356" xlink:href="#linearGradient2485-94" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-170.95451)"/>
- <linearGradient x1="968.88806" y1="178.31856" x2="977.93347" y2="181.70978" id="linearGradient4358" xlink:href="#linearGradient5704-5" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-170.95451)"/>
- <linearGradient x1="974.19751" y1="182.46863" x2="979.80444" y2="184.8026" id="linearGradient4362" xlink:href="#linearGradient2485-94" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-167.95454)"/>
- <linearGradient x1="968.88806" y1="178.31856" x2="977.93347" y2="181.70978" id="linearGradient4364" xlink:href="#linearGradient5704-5" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-167.95454)"/>
- </defs>
- <metadata id="metadata5957">
- <rdf:RDF>
- <cc:Work rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
- <dc:title/>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <use transform="translate(-961.86731,-168.04527)" id="use13602" x="0" y="0" width="1250" height="1250" xlink:href="#rect12856"/>
- <path d="m 5.5212776,14.545453 11.0000004,0 -4,-4.9999999 -11.0000004,0 4,4.9999999 z" id="use8977" style="color:#000000;fill:url(#linearGradient4362);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4364);stroke-width:0.99994743;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;display:inline"/>
- <path d="m 5.5212776,11.545483 11.0000004,0 -4,-4.9999999 -11.0000004,0 4,4.9999999 z" id="use8059" style="color:#000000;fill:url(#linearGradient4356);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4358);stroke-width:0.99994743;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;display:inline"/>
- <path d="m 5.5212776,8.5454831 11.0000004,0 -4,-5 -11.0000004,0 4,5 z" id="use8061" style="color:#000000;fill:url(#linearGradient4351);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4353);stroke-width:0.99994743;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;display:inline"/>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="18.02128" height="18" id="svg5952">
+ <defs id="defs5954">
+ <linearGradient id="linearGradient2485-94">
+ <stop id="stop2486-7" style="stop-color:#ffffff;stop-opacity:1" offset="0"/>
+ <stop id="stop2487-83" style="stop-color:#aaaaaa;stop-opacity:1" offset="1"/>
+ </linearGradient>
+ <linearGradient id="linearGradient5704-5">
+ <stop id="stop5706-120" style="stop-color:#5a5a5a;stop-opacity:1" offset="0"/>
+ <stop id="stop5708-16" style="stop-color:#000000;stop-opacity:1" offset="1"/>
+ </linearGradient>
+ <linearGradient x1="974.19751" y1="182.46863" x2="979.80444" y2="184.8026" id="linearGradient4351" xlink:href="#linearGradient2485-94" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-173.95451)"/>
+ <linearGradient x1="968.88806" y1="178.31856" x2="977.93347" y2="181.70978" id="linearGradient4353" xlink:href="#linearGradient5704-5" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-173.95451)"/>
+ <linearGradient x1="974.19751" y1="182.46863" x2="979.80444" y2="184.8026" id="linearGradient4356" xlink:href="#linearGradient2485-94" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-170.95451)"/>
+ <linearGradient x1="968.88806" y1="178.31856" x2="977.93347" y2="181.70978" id="linearGradient4358" xlink:href="#linearGradient5704-5" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-170.95451)"/>
+ <linearGradient x1="974.19751" y1="182.46863" x2="979.80444" y2="184.8026" id="linearGradient4362" xlink:href="#linearGradient2485-94" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-167.95454)"/>
+ <linearGradient x1="968.88806" y1="178.31856" x2="977.93347" y2="181.70978" id="linearGradient4364" xlink:href="#linearGradient5704-5" gradientUnits="userSpaceOnUse" gradientTransform="translate(-963.97872,-167.95454)"/>
+ </defs>
+ <metadata id="metadata5957">
+ <rdf:RDF>
+ <cc:Work rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+ <dc:title/>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <use transform="translate(-961.86731,-168.04527)" id="use13602" x="0" y="0" width="1250" height="1250" xlink:href="#rect12856"/>
+ <path d="m 5.5212776,14.545453 11.0000004,0 -4,-4.9999999 -11.0000004,0 4,4.9999999 z" id="use8977" style="color:#000000;fill:url(#linearGradient4362);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4364);stroke-width:0.99994743;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;display:inline"/>
+ <path d="m 5.5212776,11.545483 11.0000004,0 -4,-4.9999999 -11.0000004,0 4,4.9999999 z" id="use8059" style="color:#000000;fill:url(#linearGradient4356);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4358);stroke-width:0.99994743;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;display:inline"/>
+ <path d="m 5.5212776,8.5454831 11.0000004,0 -4,-5 -11.0000004,0 4,5 z" id="use8061" style="color:#000000;fill:url(#linearGradient4351);fill-opacity:1;fill-rule:evenodd;stroke:url(#linearGradient4353);stroke-width:0.99994743;stroke-linecap:square;stroke-linejoin:round;stroke-miterlimit:0;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;display:inline"/>
</svg> \ No newline at end of file
diff --git a/navit/item.c b/navit/item.c
index 2e00ea1fa..5f58a169e 100644
--- a/navit/item.c
+++ b/navit/item.c
@@ -488,7 +488,7 @@ item_hash_insert(struct item_hash *h, struct item *item, void *val)
{
struct item *hitem=g_new(struct item, 1);
*hitem=*item;
- dbg(lvl_info,"inserting (0x%x,0x%x) into %p\n", item->id_hi, item->id_lo, h->h);
+ dbg(lvl_info,"inserting (0x%x,0x%x) into %p", item->id_hi, item->id_lo, h->h);
g_hash_table_insert(h->h, hitem, val);
}
@@ -497,9 +497,9 @@ item_hash_remove(struct item_hash *h, struct item *item)
{
int ret;
- dbg(lvl_info,"removing (0x%x,0x%x) from %p\n", item->id_hi, item->id_lo, h->h);
+ dbg(lvl_info,"removing (0x%x,0x%x) from %p", item->id_hi, item->id_lo, h->h);
ret=g_hash_table_remove(h->h, item);
- dbg(lvl_info,"ret=%d\n", ret);
+ dbg(lvl_info,"ret=%d", ret);
return ret;
}
diff --git a/navit/layout.c b/navit/layout.c
index c78e7c79d..8a05096a3 100644
--- a/navit/layout.c
+++ b/navit/layout.c
@@ -202,7 +202,7 @@ cursor_new(struct attr *parent, struct attr **attrs)
else {
this->sequence_range=NULL;
}
- dbg(lvl_info,"ret=%p\n", this);
+ dbg(lvl_info,"ret=%p", this);
return this;
}
@@ -252,7 +252,7 @@ layer_set_attr_do(struct layer *l, struct attr *attr, int init)
l->ref=NULL;
obj=(struct navit_object *)l->navit;
if (obj==NULL){
- dbg(lvl_error, "Invalid layer reference '%s': Only layers inside a layout can use references.\n", attr->u.str);
+ dbg(lvl_error, "Invalid layer reference '%s': Only layers inside a layout can use references.", attr->u.str);
return 0;
}
iter=obj->func->iter_new(obj);
@@ -263,7 +263,7 @@ layer_set_attr_do(struct layer *l, struct attr *attr, int init)
}
}
if (l->ref==NULL){
- dbg(lvl_error, "Ignoring reference to unknown layer '%s' in layer '%s'.\n", attr->u.str, l->name);
+ dbg(lvl_error, "Ignoring reference to unknown layer '%s' in layer '%s'.", attr->u.str, l->name);
}
obj->func->iter_destroy(iter);
default:
@@ -287,7 +287,7 @@ struct layer * layer_new(struct attr *parent, struct attr **attrs)
layer_set_attr_do(l, *attrs, 1);
}
if (l->name==NULL){
- dbg(lvl_error, "Ignoring layer without name.\n");
+ dbg(lvl_error, "Ignoring layer without name.");
g_free(l);
return NULL;
}
@@ -397,7 +397,7 @@ itemgra_add_attr(struct itemgra *itemgra, struct attr *attr)
itemgra->elements = g_list_append(itemgra->elements, attr->u.element);
return 1;
default:
- dbg(lvl_error,"unknown: %s\n", attr_to_name(attr->type));
+ dbg(lvl_error,"unknown: %s", attr_to_name(attr->type));
return 0;
}
}
diff --git a/navit/linguistics.c b/navit/linguistics.c
index 82513b016..43c75cb77 100644
--- a/navit/linguistics.c
+++ b/navit/linguistics.c
@@ -317,7 +317,7 @@ linguistics_casefold(const char *in)
}
*dest=0;
if(*src)
- dbg(lvl_error,"Casefolded string for '%s' needs extra space, result is truncated to '%s'.\n",in,ret);
+ dbg(lvl_error,"Casefolded string for '%s' needs extra space, result is truncated to '%s'.",in,ret);
return ret;
}
@@ -423,7 +423,7 @@ linguistics_expand_special(const char *str, int mode)
out=new_ret+(out-ret);
ret=new_ret;
}
- dbg(lvl_debug,"found %s %s %d %s %d\n",in,spc[0],len,replace,replace_len);
+ dbg(lvl_debug,"found %s %s %d %s %d",in,spc[0],len,replace,replace_len);
strcpy(out, replace);
out+=replace_len;
match=1;
diff --git a/navit/log.c b/navit/log.c
index 2bca13425..5daca2eeb 100644
--- a/navit/log.c
+++ b/navit/log.c
@@ -349,7 +349,7 @@ log_timer(struct log *this_)
int delta;
gettimeofday(&tv, NULL);
delta=(tv.tv_sec-this_->last_flush.tv_sec)*1000+(tv.tv_usec-this_->last_flush.tv_usec)/1000;
- dbg(lvl_debug,"delta=%d flush_time=%d\n", delta, this_->flush_time);
+ dbg(lvl_debug,"delta=%d flush_time=%d", delta, this_->flush_time);
if (this_->flush_time && delta >= this_->flush_time*1000)
log_flush(this_,0);
#endif
@@ -386,7 +386,7 @@ log_new(struct attr * parent,struct attr **attrs)
struct file_wordexp *wexp;
char *filename, **wexp_data;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
ret->func=&log_func;
navit_object_ref((struct navit_object *)ret);
data=attr_search(attrs, NULL, attr_data);
@@ -418,7 +418,7 @@ log_new(struct attr * parent,struct attr **attrs)
if (flush_time)
ret->flush_time=flush_time->u.num;
if (ret->flush_time) {
- dbg(lvl_debug,"interval %d\n", ret->flush_time*1000);
+ dbg(lvl_debug,"interval %d", ret->flush_time*1000);
ret->timer_callback=callback_new_1(callback_cast(log_timer), ret);
ret->timer=event_add_timeout(ret->flush_time*1000, 1, ret->timer_callback);
}
@@ -492,7 +492,7 @@ log_set_trailer(struct log *this_, char *data, int len)
void
log_write(struct log *this_, char *data, int len, enum log_flags flags)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (log_change_required(this_)) {
dbg(lvl_debug,"log_change");
log_change(this_);
@@ -500,7 +500,7 @@ log_write(struct log *this_, char *data, int len, enum log_flags flags)
if (flags & log_flag_replace_buffer)
this_->data.len=0;
if (this_->data.len + len > this_->data.max_len) {
- dbg(lvl_info,"overflow\n");
+ dbg(lvl_info,"overflow");
this_->data.max_len+=16384; // FIXME: what if len exceeds this->data.max_len by more than 16384 bytes?
this_->data.data=g_realloc(this_->data.data,this_->data.max_len);
}
@@ -561,7 +561,7 @@ log_printf(struct log *this_, char *fmt, ...)
void
log_destroy(struct log *this_)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
attr_list_free(this_->attrs);
callback_destroy(this_->timer_callback);
event_remove_timeout(this_->timer);
diff --git a/navit/main.c b/navit/main.c
index 25dcb5267..322a5d886 100644
--- a/navit/main.c
+++ b/navit/main.c
@@ -315,13 +315,13 @@ win_set_nls(void)
#endif
while (nls_table[i][0]) {
if (!strcmp(nls_table[i][0], lang) && !(strcmp(nls_table[i][1], country))) {
- dbg(lvl_info,"Setting LANG=%s for Lang %s Country %s\n",nls_table[i][2], lang, country);
+ dbg(lvl_info,"Setting LANG=%s for Lang %s Country %s",nls_table[i][2], lang, country);
setenv("LANG",nls_table[i][2],0);
return;
}
i++;
}
- dbg(lvl_error,"Lang %s Country %s not found\n",lang,country);
+ dbg(lvl_error,"Lang %s Country %s not found",lang,country);
}
#endif
diff --git a/navit/map.c b/navit/map.c
index 2736da9f8..c1629e42a 100644
--- a/navit/map.c
+++ b/navit/map.c
@@ -96,12 +96,12 @@ map_new(struct attr *parent, struct attr **attrs)
struct attr *type=attr_search(attrs, NULL, attr_type);
if (! type) {
- dbg(lvl_error,"missing type\n");
+ dbg(lvl_error,"missing type");
return NULL;
}
maptype_new=plugin_get_category_map(type->u.str);
if (! maptype_new) {
- dbg(lvl_error,"invalid type '%s'\n", type->u.str);
+ dbg(lvl_error,"invalid type '%s'", type->u.str);
return NULL;
}
@@ -227,7 +227,7 @@ map_convert_string_tmp(struct map *this_, char *str)
return str;
map_converted_string_tmp=g_convert(str, -1, "utf-8", this_->meth.charset, NULL, NULL, NULL);
if(!map_converted_string_tmp) {
- dbg(lvl_error,"Error converting '%s' from %s to utf-8\n", str, this_->meth.charset);
+ dbg(lvl_error,"Error converting '%s' from %s to utf-8", str, this_->meth.charset);
return str;
}
return map_converted_string_tmp;
@@ -442,8 +442,8 @@ struct map_search *
map_search_new(struct map *m, struct item *item, struct attr *search_attr, int partial)
{
struct map_search *this_;
- dbg(lvl_debug,"enter(%p,%p,%p,%d)\n", m, item, search_attr, partial);
- dbg(lvl_debug,"0x%x 0x%x 0x%x\n", attr_country_all, search_attr->type, attr_country_name);
+ dbg(lvl_debug,"enter(%p,%p,%p,%d)", m, item, search_attr, partial);
+ dbg(lvl_debug,"0x%x 0x%x 0x%x", attr_country_all, search_attr->type, attr_country_name);
this_=g_new0(struct map_search,1);
this_->m=m;
this_->search_attr=*search_attr;
@@ -712,7 +712,7 @@ map_dump_file(struct map *map, const char *file)
map_dump_filedesc(map, f);
fclose(f);
} else
- dbg(lvl_error,"failed to open file '%s'\n",file);
+ dbg(lvl_error,"failed to open file '%s'",file);
}
void
diff --git a/navit/map/binfile/binfile.c b/navit/map/binfile/binfile.c
index 93cbbd466..cd6fec8dc 100644
--- a/navit/map/binfile/binfile.c
+++ b/navit/map/binfile/binfile.c
@@ -240,9 +240,9 @@ binfile_read_eoc(struct file *fi)
eoc=(struct zip_eoc *)file_data_read(fi,fi->size-sizeof(struct zip_eoc), sizeof(struct zip_eoc));
if (eoc) {
eoc_to_cpu(eoc);
- dbg(lvl_debug,"sig 0x%x\n", eoc->zipesig);
+ dbg(lvl_debug,"sig 0x%x", eoc->zipesig);
if (eoc->zipesig != zip_eoc_sig) {
- dbg(lvl_error,"map file %s: eoc signature check failed: 0x%x vs 0x%x\n", fi->name, eoc->zipesig,zip_eoc_sig);
+ dbg(lvl_error,"map file %s: eoc signature check failed: 0x%x vs 0x%x", fi->name, eoc->zipesig,zip_eoc_sig);
file_data_free(fi,(unsigned char *)eoc);
eoc=NULL;
}
@@ -258,20 +258,20 @@ binfile_read_eoc64(struct file *fi)
eocl=(struct zip64_eocl *)file_data_read(fi,fi->size-sizeof(struct zip_eoc)-sizeof(struct zip64_eocl), sizeof(struct zip64_eocl));
if (!eocl)
return NULL;
- dbg(lvl_debug,"sig 0x%x\n", eocl->zip64lsig);
+ dbg(lvl_debug,"sig 0x%x", eocl->zip64lsig);
if (eocl->zip64lsig != zip64_eocl_sig) {
file_data_free(fi,(unsigned char *)eocl);
- dbg(lvl_warning,"map file %s: eocl wrong\n", fi->name);
+ dbg(lvl_warning,"map file %s: eocl wrong", fi->name);
return NULL;
}
eoc=(struct zip64_eoc *)file_data_read(fi,eocl->zip64lofst, sizeof(struct zip64_eoc));
if (eoc) {
if (eoc->zip64esig != zip64_eoc_sig) {
file_data_free(fi,(unsigned char *)eoc);
- dbg(lvl_warning,"map file %s: eoc wrong\n", fi->name);
+ dbg(lvl_warning,"map file %s: eoc wrong", fi->name);
eoc=NULL;
}
- dbg(lvl_debug,"eoc64 ok 0x"LONGLONG_HEX_FMT " 0x"LONGLONG_HEX_FMT "\n",eoc->zip64eofst,eoc->zip64ecsz);
+ dbg(lvl_debug,"eoc64 ok 0x"LONGLONG_HEX_FMT " 0x"LONGLONG_HEX_FMT "",eoc->zip64eofst,eoc->zip64ecsz);
}
file_data_free(fi,(unsigned char *)eocl);
return eoc;
@@ -296,9 +296,9 @@ binfile_read_cd(struct map_priv *m, int offset, int len)
}
cd=(struct zip_cd *)file_data_read(m->fi,cdoffset+offset, sizeof(*cd)+len);
if (cd) {
- dbg(lvl_debug,"cd at "LONGLONG_FMT" %zu bytes\n",cdoffset+offset, sizeof(*cd)+len);
+ dbg(lvl_debug,"cd at "LONGLONG_FMT" %zu bytes",cdoffset+offset, sizeof(*cd)+len);
cd_to_cpu(cd);
- dbg(lvl_debug,"sig 0x%x\n", cd->zipcensig);
+ dbg(lvl_debug,"sig 0x%x", cd->zipcensig);
if (cd->zipcensig != zip_cd_sig) {
file_data_free(m->fi,(unsigned char *)cd);
cd=NULL;
@@ -375,7 +375,7 @@ binfile_read_content(struct map_priv *m, struct file *fi, long long offset, stru
ret=file_data_read_compressed(fi,offset, lfh->zipsize, lfh->zipuncmp);
break;
default:
- dbg(lvl_error,"map file %s: unknown compression method %d\n", fi->name, lfh->zipmthd);
+ dbg(lvl_error,"map file %s: unknown compression method %d", fi->name, lfh->zipmthd);
}
return ret;
}
@@ -389,7 +389,7 @@ binfile_search_cd(struct map_priv *m, int offset, char *name, int partial, int s
long long cdoffset=m->eoc64?m->eoc64->zip64eofst:m->eoc->zipeofst;
struct zip_cd *cd;
#if 0
- dbg(lvl_debug,"end=%d\n",end);
+ dbg(lvl_debug,"end=%d",end);
#endif
while (offset < end) {
cd=(struct zip_cd *)(m->search_data+offset-m->search_offset);
@@ -399,7 +399,7 @@ binfile_search_cd(struct map_priv *m, int offset, char *name, int partial, int s
offset-m->search_offset+sizeof(*cd)+cd->zipcfnl+cd->zipcxtl > m->search_size
) {
#if 0
- dbg(lvl_debug,"reload %p %d %d\n", m->search_data, m->search_offset, offset);
+ dbg(lvl_debug,"reload %p %d %d", m->search_data, m->search_offset, offset);
#endif
if (m->search_data)
file_data_free(m->fi,m->search_data);
@@ -411,8 +411,8 @@ binfile_search_cd(struct map_priv *m, int offset, char *name, int partial, int s
cd=(struct zip_cd *)m->search_data;
}
#if 0
- dbg(lvl_debug,"offset=%d search_offset=%d search_size=%d search_data=%p cd=%p\n", offset, m->search_offset, m->search_size, m->search_data, cd);
- dbg(lvl_debug,"offset=%d fn='%s'\n",offset,cd->zipcfn);
+ dbg(lvl_debug,"offset=%d search_offset=%d search_size=%d search_data=%p cd=%p", offset, m->search_offset, m->search_size, m->search_data, cd);
+ dbg(lvl_debug,"offset=%d fn='%s'",offset,cd->zipcfn);
#endif
if (!skip &&
(partial || cd->zipcfnl == len) &&
@@ -428,7 +428,7 @@ binfile_search_cd(struct map_priv *m, int offset, char *name, int partial, int s
static void
map_destroy_binfile(struct map_priv *m)
{
- dbg(lvl_debug,"map_destroy_binfile\n");
+ dbg(lvl_debug,"map_destroy_binfile");
if (m->fi)
map_binfile_close(m);
map_binfile_destroy(m);
@@ -523,7 +523,7 @@ binfile_extract(struct map_priv *m, char *dir, char *filename, int partial)
if (full[len-2] != '/') {
lfh=binfile_read_lfh(m->fi, binfile_cd_offset(cd));
start=binfile_read_content(m, m->fi, binfile_cd_offset(cd), lfh);
- dbg(lvl_debug,"fopen '%s'\n", full);
+ dbg(lvl_debug,"fopen '%s'", full);
f=fopen(full,"w");
fwrite(start, lfh->zipuncmp, 1, f);
fclose(f);
@@ -569,7 +569,7 @@ binfile_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
mr->label_attr[4]=t->pos_attr;
if (type == attr_type || attr_type == attr_any) {
if (attr_type == attr_any) {
- dbg(lvl_debug,"pos %p attr %s size %d\n", t->pos_attr-1, attr_to_name(type), size);
+ dbg(lvl_debug,"pos %p attr %s size %d", t->pos_attr-1, attr_to_name(type), size);
}
attr->type=type;
if (ATTR_IS_GROUP(type)) {
@@ -647,13 +647,13 @@ binfile_item_dup(struct map_priv *m, struct item *item, struct tile *t, int exte
entry->id.id_hi=item->id_hi;
entry->id.id_lo=item->id_lo;
entry->flags=1;
- dbg(lvl_debug,"id 0x%x,0x%x\n",entry->id.id_hi,entry->id.id_lo);
+ dbg(lvl_debug,"id 0x%x,0x%x",entry->id.id_hi,entry->id.id_lo);
memcpy(ret, t->pos, (size+1)*sizeof(int));
if (!m->changes)
m->changes=g_hash_table_new_full(binfile_hash_entry_hash, binfile_hash_entry_equal, g_free, NULL);
g_hash_table_replace(m->changes, entry, entry);
- dbg(lvl_debug,"ret %p\n",ret);
+ dbg(lvl_debug,"ret %p",ret);
return ret;
}
@@ -668,15 +668,15 @@ binfile_coord_set(void *priv_data, struct coord *c, int count, enum change_mode
{
int *i=t->pos,j=0;
- dbg(lvl_debug,"Before: pos_coord=%td\n",t->pos_coord-i);
+ dbg(lvl_debug,"Before: pos_coord=%td",t->pos_coord-i);
while (i < t->pos_next)
- dbg(lvl_debug,"%d:0x%x\n",j++,*i++);
+ dbg(lvl_debug,"%d:0x%x",j++,*i++);
}
aoffset=t->pos_attr-t->pos_attr_start;
coffset=t->pos_coord-t->pos_coord_start-2;
clen=t->pos_attr_start-t->pos_coord+2;
- dbg(lvl_debug,"coffset=%d clen=%d\n",coffset,clen);
+ dbg(lvl_debug,"coffset=%d clen=%d",coffset,clen);
switch (mode) {
case change_mode_delete:
if (count*2 > clen)
@@ -713,7 +713,7 @@ binfile_coord_set(void *priv_data, struct coord *c, int count, enum change_mode
default:
return 0;
}
- dbg(lvl_debug,"delta %d\n",delta);
+ dbg(lvl_debug,"delta %d",delta);
data=binfile_item_dup(mr->m, &mr->item, t, delta > 0 ? delta:0);
data[0]=cpu_to_le32(le32_to_cpu(data[0])+delta);
data[2]=cpu_to_le32(le32_to_cpu(data[2])+delta);
@@ -725,18 +725,18 @@ binfile_coord_set(void *priv_data, struct coord *c, int count, enum change_mode
tn=mr->t;
tn->pos_coord=tn->pos_coord_start+coffset;
tn->pos_attr=tn->pos_attr_start+aoffset;
- dbg(lvl_debug,"moving %d ints from offset %td to %td\n",move_len,tn->pos_coord_start+move_offset-data,tn->pos_coord_start+move_offset+delta-data);
+ dbg(lvl_debug,"moving %d ints from offset %td to %td",move_len,tn->pos_coord_start+move_offset-data,tn->pos_coord_start+move_offset+delta-data);
memmove(tn->pos_coord_start+move_offset+delta, tn->pos_coord_start+move_offset, move_len*4);
{
int *i=tn->pos,j=0;
- dbg(lvl_debug,"After move: pos_coord=%td\n",tn->pos_coord-i);
+ dbg(lvl_debug,"After move: pos_coord=%td",tn->pos_coord-i);
while (i < tn->pos_next)
- dbg(lvl_debug,"%d:0x%x\n",j++,*i++);
+ dbg(lvl_debug,"%d:0x%x",j++,*i++);
}
if (mode != change_mode_append)
tn->pos_coord+=move_offset;
if (mode != change_mode_delete) {
- dbg(lvl_debug,"writing %d ints at offset %td\n",count*2,write_offset+tn->pos_coord_start-data);
+ dbg(lvl_debug,"writing %d ints at offset %td",count*2,write_offset+tn->pos_coord_start-data);
for (i = 0 ; i < count ; i++) {
tn->pos_coord_start[write_offset++]=c[i].x;
tn->pos_coord_start[write_offset++]=c[i].y;
@@ -745,9 +745,9 @@ binfile_coord_set(void *priv_data, struct coord *c, int count, enum change_mode
}
{
int *i=tn->pos,j=0;
- dbg(lvl_debug,"After: pos_coord=%td\n",tn->pos_coord-i);
+ dbg(lvl_debug,"After: pos_coord=%td",tn->pos_coord-i);
while (i < tn->pos_next)
- dbg(lvl_debug,"%d:0x%x\n",j++,*i++);
+ dbg(lvl_debug,"%d:0x%x",j++,*i++);
}
return 1;
}
@@ -764,9 +764,9 @@ binfile_attr_set(void *priv_data, struct attr *attr, enum change_mode mode)
{
int *i=t->pos,j=0;
- dbg(lvl_debug,"Before: pos_attr=%td\n",t->pos_attr-i);
+ dbg(lvl_debug,"Before: pos_attr=%td",t->pos_attr-i);
while (i < t->pos_next)
- dbg(lvl_debug,"%d:0x%x\n",j++,*i++);
+ dbg(lvl_debug,"%d:0x%x",j++,*i++);
}
@@ -777,7 +777,7 @@ binfile_attr_set(void *priv_data, struct attr *attr, enum change_mode mode)
oattr_len=0;
if (!naoffset) {
if (mode == change_mode_delete || mode == change_mode_modify) {
- dbg(lvl_error,"no attribute selected\n");
+ dbg(lvl_error,"no attribute selected");
return 0;
}
if (mode == change_mode_append)
@@ -785,7 +785,7 @@ binfile_attr_set(void *priv_data, struct attr *attr, enum change_mode mode)
}
while (offset < naoffset) {
oattr_len=le32_to_cpu(t->pos_attr_start[offset])+1;
- dbg(lvl_debug,"len %d\n",oattr_len);
+ dbg(lvl_debug,"len %d",oattr_len);
write_offset=offset;
offset+=oattr_len;
}
@@ -818,7 +818,7 @@ binfile_attr_set(void *priv_data, struct attr *attr, enum change_mode mode)
delta=nattr_len-oattr_len;
else
delta=nattr_len;
- dbg(lvl_debug,"delta %d oattr_len %d nattr_len %d\n",delta,oattr_len, nattr_len);
+ dbg(lvl_debug,"delta %d oattr_len %d nattr_len %d",delta,oattr_len, nattr_len);
data=binfile_item_dup(mr->m, &mr->item, t, delta > 0 ? delta:0);
data[0]=cpu_to_le32(le32_to_cpu(data[0])+delta);
new.pos=new.start=data;
@@ -829,20 +829,20 @@ binfile_attr_set(void *priv_data, struct attr *attr, enum change_mode mode)
tn=mr->t;
tn->pos_coord=tn->pos_coord_start+coffset;
tn->pos_attr=tn->pos_attr_start+offset;
- dbg(lvl_debug,"attr start %td offset %d\n",tn->pos_attr_start-data,offset);
- dbg(lvl_debug,"moving %d ints from offset %td to %td\n",move_len,tn->pos_attr_start+move_offset-data,tn->pos_attr_start+move_offset+delta-data);
+ dbg(lvl_debug,"attr start %td offset %d",tn->pos_attr_start-data,offset);
+ dbg(lvl_debug,"moving %d ints from offset %td to %td",move_len,tn->pos_attr_start+move_offset-data,tn->pos_attr_start+move_offset+delta-data);
memmove(tn->pos_attr_start+move_offset+delta, tn->pos_attr_start+move_offset, move_len*4);
if (mode != change_mode_append)
tn->pos_attr+=delta;
{
int *i=tn->pos,j=0;
- dbg(lvl_debug,"After move: pos_attr=%td\n",tn->pos_attr-i);
+ dbg(lvl_debug,"After move: pos_attr=%td",tn->pos_attr-i);
while (i < tn->pos_next)
- dbg(lvl_debug,"%d:0x%x\n",j++,*i++);
+ dbg(lvl_debug,"%d:0x%x",j++,*i++);
}
if (nattr_len) {
int *nattr=tn->pos_attr_start+write_offset;
- dbg(lvl_debug,"writing %d ints at %td\n",nattr_len,nattr-data);
+ dbg(lvl_debug,"writing %d ints at %td",nattr_len,nattr-data);
nattr[0]=cpu_to_le32(nattr_len-1);
nattr[1]=cpu_to_le32(attr->type);
memcpy(nattr+2, attr_data_get(attr), nattr_size);
@@ -850,11 +850,11 @@ binfile_attr_set(void *priv_data, struct attr *attr, enum change_mode mode)
}
{
int *i=tn->pos,j=0;
- dbg(lvl_debug,"After: pos_attr=%td\n",tn->pos_attr-i);
+ dbg(lvl_debug,"After: pos_attr=%td",tn->pos_attr-i);
while (i < tn->pos_next)
- dbg(lvl_debug,"After: pos_attr=%td\n",tn->pos_attr-i);
+ dbg(lvl_debug,"After: pos_attr=%td",tn->pos_attr-i);
while (i < tn->pos_next)
- dbg(lvl_debug,"%d:0x%x\n",j++,*i++);
+ dbg(lvl_debug,"%d:0x%x",j++,*i++);
}
return 1;
}
@@ -891,7 +891,7 @@ pop_tile(struct map_rect_priv *mr)
file_data_free(mr->m->fi, (unsigned char *)(mr->t->start));
#ifdef DEBUG_SIZE
#if DEBUG_SIZE > 0
- dbg(lvl_debug,"leave %d\n",mr->t->zipfile_num);
+ dbg(lvl_debug,"leave %d",mr->t->zipfile_num);
#endif
#endif
mr->t=&mr->tiles[--mr->tile_depth-1];
@@ -906,8 +906,8 @@ zipfile_to_tile(struct map_priv *m, struct zip_cd *cd, struct tile *t)
struct zip_lfh *lfh;
char *zipfn;
struct file *fi;
- dbg(lvl_debug,"enter %p %p %p\n", m, cd, t);
- dbg(lvl_debug,"cd->zipofst=0x"LONGLONG_HEX_FMT "\n", binfile_cd_offset(cd));
+ dbg(lvl_debug,"enter %p %p %p", m, cd, t);
+ dbg(lvl_debug,"cd->zipofst=0x"LONGLONG_HEX_FMT "", binfile_cd_offset(cd));
t->start=NULL;
t->mode=1;
if (m->fis)
@@ -938,7 +938,7 @@ map_binfile_handle_redirect(struct map_priv *m)
if (m->redirect)
return 0;
m->redirect=1;
- dbg(lvl_debug,"redirected from %s to %s\n",m->url,location);
+ dbg(lvl_debug,"redirected from %s to %s",m->url,location);
g_free(m->url);
m->url=g_strdup(location);
file_destroy(m->http);
@@ -987,7 +987,7 @@ map_binfile_download_size(struct map_priv *m)
} while (map_binfile_handle_redirect(m));
ret=file_size(m->http);
- dbg(lvl_debug,"file size "LONGLONG_FMT"\n",ret);
+ dbg(lvl_debug,"file size "LONGLONG_FMT"",ret);
return ret;
}
@@ -1033,7 +1033,7 @@ map_binfile_download_range(struct map_priv *m, long long offset, int size)
ret=file_data_read_special(http, size, &size_ret);
if (size_ret != size) {
- dbg(lvl_debug,"size %d vs %d\n",size,size_ret);
+ dbg(lvl_debug,"size %d vs %d",size,size_ret);
g_free(ret);
return NULL;
}
@@ -1047,7 +1047,7 @@ download_cd(struct map_download *download)
struct zip64_eoc *zip64_eoc=(struct zip64_eoc *)file_data_read(m->fi, 0, sizeof(*zip64_eoc));
struct zip_cd *cd=(struct zip_cd *)map_binfile_download_range(m, zip64_eoc->zip64eofst+download->zipfile*m->cde_size,m->cde_size);
file_data_free(m->fi, (unsigned char *)zip64_eoc);
- dbg(lvl_debug,"needed cd, result %p\n",cd);
+ dbg(lvl_debug,"needed cd, result %p",cd);
return cd;
}
@@ -1061,7 +1061,7 @@ download_request(struct map_download *download)
if(!download->m->download_enabled)
{
- dbg(lvl_error,"Tried downloading while it's not allowed\n");
+ dbg(lvl_error,"Tried downloading while it's not allowed");
return 0;
}
attrs[0]=&url;
@@ -1080,7 +1080,7 @@ download_request(struct map_download *download)
attrs[3]=NULL;
download->dl_size=size;
}
- dbg(lvl_debug,"encountered missing tile %d %s(%s), Downloading %d bytes at "LONGLONG_FMT"\n",download->zipfile, url.u.str,(char *)(download->cd_copy+1), download->dl_size, download->offset);
+ dbg(lvl_debug,"encountered missing tile %d %s(%s), Downloading %d bytes at "LONGLONG_FMT"",download->zipfile, url.u.str,(char *)(download->cd_copy+1), download->dl_size, download->offset);
map_binfile_http_request(download->m, attrs);
g_free(url.u.str);
download->http=download->m->http;
@@ -1128,7 +1128,7 @@ download_download(struct map_download *download)
return 0;
}
- dbg(lvl_debug,"got %d bytes writing at offset "LONGLONG_FMT"\n",size_ret,download->offset);
+ dbg(lvl_debug,"got %d bytes writing at offset "LONGLONG_FMT"",size_ret,download->offset);
if (size_ret <= 0) {
g_free(data);
return 1;
@@ -1170,7 +1170,7 @@ download_finish(struct map_download *download)
g_free(download->cd_copy);
download->cd=(struct zip_cd *)(file_data_read(download->file, download->m->eoc->zipeofst + download->zipfile*download->m->cde_size, download->m->cde_size));
cd_to_cpu(download->cd);
- dbg(lvl_debug,"Offset %d\n",download->cd->zipofst);
+ dbg(lvl_debug,"Offset %d",download->cd->zipofst);
return 1;
}
@@ -1178,7 +1178,7 @@ static int
download_planet_size(struct map_download *download)
{
download->size=map_binfile_download_size(download->m);
- dbg(lvl_debug,"Planet size "LONGLONG_FMT"\n",download->size);
+ dbg(lvl_debug,"Planet size "LONGLONG_FMT"",download->size);
if (!download->size)
return 0;
return 1;
@@ -1194,7 +1194,7 @@ download_eoc(struct map_download *download)
download->zip_eoc=(struct zip_eoc *)(download->zip64_eocl+1);
if (download->zip64_eoc->zip64esig != zip64_eoc_sig || download->zip64_eocl->zip64lsig != zip64_eocl_sig || download->zip_eoc->zipesig != zip_eoc_sig)
{
- dbg(lvl_error,"wrong signature on zip64_eoc downloaded from "LONGLONG_FMT"\n",download->size-98);
+ dbg(lvl_error,"wrong signature on zip64_eoc downloaded from "LONGLONG_FMT"",download->size-98);
g_free(download->zip64_eoc);
return 0;
}
@@ -1221,11 +1221,11 @@ download_directory_do(struct map_download *download)
struct zip_cd *cd;
cd=(struct zip_cd *)file_data_read_special(download->http, sizeof(*cd), &size_ret);
cd->zipcunc=0;
- dbg(lvl_debug,"size_ret=%d\n",size_ret);
+ dbg(lvl_debug,"size_ret=%d",size_ret);
if (!size_ret)
return 0;
if (size_ret != sizeof(*cd) || cd->zipcensig != zip_cd_sig) {
- dbg(lvl_error,"error1 size=%d vs %zu\n",size_ret, sizeof(*cd));
+ dbg(lvl_error,"error1 size=%d vs %zu",size_ret, sizeof(*cd));
return 0;
}
file_data_write(download->file, download->offset, sizeof(*cd), (unsigned char *)cd);
@@ -1233,7 +1233,7 @@ download_directory_do(struct map_download *download)
cd_xlen=cd->zipcfnl+cd->zipcxtl;
cd_data=file_data_read_special(download->http, cd_xlen, &size_ret);
if (size_ret != cd_xlen) {
- dbg(lvl_error,"error2 size=%d vs %d\n",size_ret,cd_xlen);
+ dbg(lvl_error,"error2 size=%d vs %d",size_ret,cd_xlen);
return 0;
}
file_data_write(download->file, download->offset, cd_xlen, cd_data);
@@ -1278,14 +1278,14 @@ push_zipfile_tile_do(struct map_rect_priv *mr, struct zip_cd *cd, int zipfile, i
struct map_priv *m=mr->m;
struct file *f=m->fi;
- dbg(lvl_debug,"enter %p %d\n", mr, zipfile);
+ dbg(lvl_debug,"enter %p %d", mr, zipfile);
#ifdef DEBUG_SIZE
#if DEBUG_SIZE > 0
{
char filename[cd->zipcfnl+1];
memcpy(filename, cd+1, cd->zipcfnl);
filename[cd->zipcfnl]='\0';
- dbg(lvl_debug,"enter %d (%s) %d\n",zipfile, filename, cd->zipcunc);
+ dbg(lvl_debug,"enter %d (%s) %d",zipfile, filename, cd->zipcunc);
}
#endif
mr->size+=cd->zipcunc;
@@ -1341,10 +1341,10 @@ download(struct map_priv *m, struct map_rect_priv *mr, struct zip_cd *cd, int zi
return NULL;
}
for (;;) {
- dbg(lvl_debug,"state=%d\n",download->state);
+ dbg(lvl_debug,"state=%d",download->state);
switch (download->state) {
case 0:
- dbg(lvl_error,"error\n");
+ dbg(lvl_error,"error");
break;
case 1:
if (download_start(download))
@@ -1394,7 +1394,7 @@ download(struct map_priv *m, struct map_rect_priv *mr, struct zip_cd *cd, int zi
if (download_eoc(download))
download->state=6;
else {
- dbg(lvl_error,"download of eoc failed\n");
+ dbg(lvl_error,"download of eoc failed");
download->state=0;
}
break;
@@ -1443,7 +1443,7 @@ push_zipfile_tile(struct map_rect_priv *mr, int zipfile, int offset, int length,
struct file *f=m->fi;
long long cdoffset=m->eoc64?m->eoc64->zip64eofst:m->eoc->zipeofst;
struct zip_cd *cd=(struct zip_cd *)(file_data_read(f, cdoffset + zipfile*m->cde_size, m->cde_size));
- dbg(lvl_debug,"read from "LONGLONG_FMT" %d bytes\n",cdoffset + zipfile*m->cde_size, m->cde_size);
+ dbg(lvl_debug,"read from "LONGLONG_FMT" %d bytes",cdoffset + zipfile*m->cde_size, m->cde_size);
cd_to_cpu(cd);
if (!cd->zipcunc && m->url) {
cd=download(m, mr, cd, zipfile, offset, length, async);
@@ -1460,7 +1460,7 @@ map_rect_new_binfile_int(struct map_priv *map, struct map_selection *sel)
struct map_rect_priv *mr;
binfile_check_version(map);
- dbg(lvl_debug,"map_rect_new_binfile\n");
+ dbg(lvl_debug,"map_rect_new_binfile");
if (!map->fi && !map->url)
return NULL;
map_binfile_http_close(map);
@@ -1548,7 +1548,7 @@ map_rect_new_binfile(struct map_priv *map, struct map_selection *sel)
{
struct map_rect_priv *mr=map_rect_new_binfile_int(map, sel);
struct tile t;
- dbg(lvl_debug,"zip_members=%d\n", map->zip_members);
+ dbg(lvl_debug,"zip_members=%d", map->zip_members);
if (map->url && map->fi && sel && sel->order == 255) {
map_download_selection(map, mr, sel);
}
@@ -1580,7 +1580,7 @@ write_changes_do(gpointer key, gpointer value, gpointer user_data)
if (entry->flags) {
entry->flags=0;
fwrite(entry, sizeof(*entry)+(le32_to_cpu(entry->data[0])+1)*4, 1, out);
- dbg(lvl_debug,"yes\n");
+ dbg(lvl_debug,"yes");
}
}
@@ -1633,7 +1633,7 @@ map_rect_destroy_binfile(struct map_rect_priv *mr)
write_changes(mr->m);
while (pop_tile(mr));
#ifdef DEBUG_SIZE
- dbg(lvl_debug,"size=%d kb\n",mr->size/1024);
+ dbg(lvl_debug,"size=%d kb",mr->size/1024);
#endif
if (mr->tiles[0].fi && mr->tiles[0].start)
file_data_free(mr->tiles[0].fi, (unsigned char *)(mr->tiles[0].start));
@@ -1649,11 +1649,11 @@ setup_pos(struct map_rect_priv *mr)
struct tile *t=mr->t;
size=le32_to_cpu(t->pos[0]);
if (size > 1024*1024 || size < 0) {
- dbg(lvl_debug,"size=0x%x\n", size);
+ dbg(lvl_debug,"size=0x%x", size);
#if 0
fprintf(stderr,"offset=%d\n", (unsigned char *)(mr->pos)-mr->m->f->begin);
#endif
- dbg(lvl_debug,"size error\n");
+ dbg(lvl_debug,"size error");
}
t->pos_next=t->pos+size+1;
mr->item.type=le32_to_cpu(t->pos[1]);
@@ -1671,7 +1671,7 @@ selection_contains(struct map_selection *sel, struct coord_rect *r, struct range
while (sel) {
if (coord_rect_overlap(r, &sel->u.c_rect)) {
order=sel->order;
- dbg(lvl_debug,"min %d max %d order %d\n", mima->min, mima->max, order);
+ dbg(lvl_debug,"min %d max %d order %d", mima->min, mima->max, order);
if (!mima->min && !mima->max)
return 1;
if (order >= mima->min && order <= mima->max)
@@ -1703,13 +1703,13 @@ map_parse_country_binfile(struct map_rect_priv *mr)
struct attr af, al;
if(binfile_attr_get(mr->item.priv_data, attr_first_key, &af)) {
if(linguistics_compare(af.u.str,search->u.str,linguistics_cmp_partial)>0) {
- dbg(lvl_debug,"Skipping index item with first_key='%s'\n", af.u.str);
+ dbg(lvl_debug,"Skipping index item with first_key='%s'", af.u.str);
return;
}
}
if(binfile_attr_get(mr->item.priv_data, attr_last_key, &al)) {
if(linguistics_compare(al.u.str,search->u.str,linguistics_cmp_partial)<0) {
- dbg(lvl_debug,"Skipping index item with first_key='%s', last_key='%s'\n", af.u.str, al.u.str);
+ dbg(lvl_debug,"Skipping index item with first_key='%s', last_key='%s'", af.u.str, al.u.str);
return;
}
}
@@ -1744,7 +1744,7 @@ map_parse_submap(struct map_rect_priv *mr, int async)
return 0;
if (!binfile_attr_get(mr->item.priv_data, attr_zipfile_ref, &at))
return 0;
- dbg(lvl_debug,"pushing zipfile %ld from %d\n", at.u.num, mr->t->zipfile_num);
+ dbg(lvl_debug,"pushing zipfile %ld from %d", at.u.num, mr->t->zipfile_num);
return push_zipfile_tile(mr, at.u.num, 0, 0, async);
}
@@ -2110,12 +2110,12 @@ binmap_search_new(struct map_priv *map, struct item *item, struct attr *search,
if (town)
msp->mr = binmap_search_street_by_place(map, town, &c, &msp->ms, &msp->boundaries);
if (msp->boundaries)
- dbg(lvl_debug, "using map town boundaries\n");
+ dbg(lvl_debug, "using map town boundaries");
if (!msp->boundaries && town)
{
binmap_get_estimated_boundaries(town, &msp->boundaries);
if (msp->boundaries)
- dbg(lvl_debug, "using estimated boundaries\n");
+ dbg(lvl_debug, "using estimated boundaries");
}
map_rect_destroy_binfile(map_rec);
/* start searching in area around the street segment even if town boundaries are available */
@@ -2124,7 +2124,7 @@ binmap_search_new(struct map_priv *map, struct item *item, struct attr *search,
msp->rect_new=msp->ms.u.c_rect;
if(item_attr_get(msp->item, attr_street_name, &attr))
msp->parent_name=g_strdup(attr.u.str);
- dbg(lvl_debug,"pn=%s\n",msp->parent_name);
+ dbg(lvl_debug,"pn=%s",msp->parent_name);
}
}
if (idx != 3) {
@@ -2435,7 +2435,7 @@ binmap_search_get_item(struct map_search_priv *map_search)
map_search->ms.u.c_rect=map_search->rect_new;
map_rect_destroy_binfile(map_search->mr);
map_search->mr=map_rect_new_binfile(map_search->map, &map_search->ms);
- dbg(lvl_debug,"Extended house number search region to %d x %d, restarting...\n",map_search->ms.u.c_rect.rl.x - map_search->ms.u.c_rect.lu.x, map_search->ms.u.c_rect.lu.y-map_search->ms.u.c_rect.rl.y);
+ dbg(lvl_debug,"Extended house number search region to %d x %d, restarting...",map_search->ms.u.c_rect.rl.x - map_search->ms.u.c_rect.lu.x, map_search->ms.u.c_rect.lu.y-map_search->ms.u.c_rect.rl.y);
continue;
}
}
@@ -2567,7 +2567,7 @@ map_binfile_zip_setup(struct map_priv *m, char *filename, int mmap)
struct zip_cd *first_cd;
int i;
if (!(m->eoc=binfile_read_eoc(m->fi))) {
- dbg(lvl_error,"map file %s: unable to read eoc\n", filename);
+ dbg(lvl_error,"map file %s: unable to read eoc", filename);
return 0;
}
dbg_assert(m->eoc->zipedsk == m->eoc->zipecen);
@@ -2583,20 +2583,20 @@ map_binfile_zip_setup(struct map_priv *m, char *filename, int mmap)
m->fis[m->eoc->zipedsk-1]=m->fi;
g_free(tmpfilename);
}
- dbg(lvl_debug,"num_disk %d\n",m->eoc->zipedsk);
+ dbg(lvl_debug,"num_disk %d",m->eoc->zipedsk);
m->eoc64=binfile_read_eoc64(m->fi);
if (!binfile_get_index(m)) {
- dbg(lvl_error,"map file %s: no index found\n", filename);
+ dbg(lvl_error,"map file %s: no index found", filename);
return 0;
}
if (!(first_cd=binfile_read_cd(m, 0, 0))) {
- dbg(lvl_error,"map file %s: unable to get first cd\n", filename);
+ dbg(lvl_error,"map file %s: unable to get first cd", filename);
return 0;
}
m->cde_size=sizeof(struct zip_cd)+first_cd->zipcfnl+first_cd->zipcxtl;
m->zip_members=m->index_offset/m->cde_size+1;
- dbg(lvl_debug,"cde_size %d\n", m->cde_size);
- dbg(lvl_debug,"members %d\n",m->zip_members);
+ dbg(lvl_debug,"cde_size %d", m->cde_size);
+ dbg(lvl_debug,"members %d",m->zip_members);
file_data_free(m->fi, (unsigned char *)first_cd);
if (mmap)
file_mmap(m->fi);
@@ -2695,12 +2695,12 @@ map_binfile_open(struct map_priv *m)
struct attr readwrite={attr_readwrite, {(void *)1}};
struct attr *attrs[]={&readwrite, NULL};
- dbg(lvl_debug,"file_create %s\n", m->filename);
+ dbg(lvl_debug,"file_create %s", m->filename);
m->fi=file_create(m->filename, m->url?attrs:NULL);
if (! m->fi && m->url)
return 0;
if (! m->fi) {
- dbg(lvl_error,"Failed to load '%s'\n", m->filename);
+ dbg(lvl_error,"Failed to load '%s'", m->filename);
return 0;
}
if (m->check_version)
@@ -2714,13 +2714,13 @@ map_binfile_open(struct map_priv *m)
*magic = le32_to_cpu(*magic);
if (*magic == zip_lfh_sig || *magic == zip_split_sig || *magic == zip_cd_sig || *magic == zip64_eoc_sig) {
if (!map_binfile_zip_setup(m, m->filename, m->flags & 1)) {
- dbg(lvl_error,"invalid file format for '%s'\n", m->filename);
+ dbg(lvl_error,"invalid file format for '%s'", m->filename);
file_destroy(m->fi);
m->fi=NULL;
return 0;
}
} else if (*magic == zip_lfh_sig_rev || *magic == zip_split_sig_rev || *magic == zip_cd_sig_rev || *magic == zip64_eoc_sig_rev) {
- dbg(lvl_error,"endianness mismatch for '%s'\n", m->filename);
+ dbg(lvl_error,"endianness mismatch for '%s'", m->filename);
file_destroy(m->fi);
m->fi=NULL;
return 0;
@@ -2738,7 +2738,7 @@ map_binfile_open(struct map_priv *m)
if (binfile_attr_get(item->priv_data, attr_map_release, &attr))
m->map_release=g_strdup(attr.u.str);
if (m->url && binfile_attr_get(item->priv_data, attr_url, &attr)) {
- dbg(lvl_debug,"url config %s map %s\n",m->url,attr.u.str);
+ dbg(lvl_debug,"url config %s map %s",m->url,attr.u.str);
if (strcmp(m->url, attr.u.str))
m->update_available=1;
g_free(m->url);
@@ -2747,7 +2747,7 @@ map_binfile_open(struct map_priv *m)
}
map_rect_destroy_binfile(mr);
if (m->map_version >= 16) {
- dbg(lvl_error,"%s: This map is incompatible with your navit version. Please update navit. (map version %d)\n",
+ dbg(lvl_error,"%s: This map is incompatible with your navit version. Please update navit. (map version %d)",
m->filename, m->map_version);
return 0;
}
@@ -2811,7 +2811,7 @@ map_new_binfile(struct map_methods *meth, struct attr **attrs, struct callback_l
wexp=file_wordexp_new(data->u.str);
wexp_data=file_wordexp_get_array(wexp);
- dbg(lvl_debug,"map_new_binfile %s\n", data->u.str);
+ dbg(lvl_debug,"map_new_binfile %s", data->u.str);
*meth=map_methods_binfile;
m=g_new0(struct map_priv, 1);
@@ -2844,9 +2844,9 @@ map_new_binfile(struct map_methods *meth, struct attr **attrs, struct callback_l
void
plugin_init(void)
{
- dbg(lvl_debug,"binfile: plugin_init\n");
+ dbg(lvl_debug,"binfile: plugin_init");
if (sizeof(struct zip_cd) != 46) {
- dbg(lvl_error,"error: sizeof(struct zip_cd)=%zu\n",sizeof(struct zip_cd));
+ dbg(lvl_error,"error: sizeof(struct zip_cd)=%zu",sizeof(struct zip_cd));
}
plugin_register_category_map("binfile", map_new_binfile);
}
diff --git a/navit/map/csv/csv.c b/navit/map/csv/csv.c
index 0477f7fdf..3ee2d6239 100644
--- a/navit/map/csv/csv.c
+++ b/navit/map/csv/csv.c
@@ -127,11 +127,11 @@ save_map_csv(struct map_priv *m)
} else if(ATTR_IS_STRING(*at)) {
tmpstr = g_strdup(found_attr->u.str);
} else {
- dbg(lvl_error,"Cant represent attribute %s\n",attr_to_name(*at));
+ dbg(lvl_error,"Cant represent attribute %s",attr_to_name(*at));
tmpstr=g_strdup("");
}
} else {
- dbg(lvl_debug,"No value defined for the attribute %s, assuming empty string\n",attr_to_name(*at));
+ dbg(lvl_debug,"No value defined for the attribute %s, assuming empty string",attr_to_name(*at));
tmpstr=g_strdup("");
}
}
@@ -150,7 +150,7 @@ save_map_csv(struct map_priv *m)
if(m->charset) {
tmpstr=g_convert(csv_line, -1,m->charset,"utf-8",NULL,NULL,NULL);
if(!tmpstr)
- dbg(lvl_error,"Error converting '%s' to %s\n",csv_line, m->charset);
+ dbg(lvl_error,"Error converting '%s' to %s",csv_line, m->charset);
} else
tmpstr=csv_line;
@@ -182,7 +182,7 @@ static const int zoom_max = 18;
static void
map_destroy_csv(struct map_priv *m)
{
- dbg(lvl_debug,"map_destroy_csv\n");
+ dbg(lvl_debug,"map_destroy_csv");
/*save if changed */
save_map_csv(m);
g_hash_table_destroy(m->qitem_hash);
@@ -356,10 +356,10 @@ static int
csv_type_set(void *priv_data, enum item_type type)
{
struct map_rect_priv* mr = (struct map_rect_priv*)priv_data;
- dbg(lvl_debug,"Enter %d\n", type);
+ dbg(lvl_debug,"Enter %d", type);
if(!mr || !mr->qitem) {
- dbg(lvl_debug,"Nothing to do\n");
+ dbg(lvl_debug,"Nothing to do");
return 0;
}
@@ -367,7 +367,7 @@ csv_type_set(void *priv_data, enum item_type type)
return 0;
mr->qitem->deleted=1;
- dbg(lvl_debug,"Item %p is deleted\n",mr->qitem);
+ dbg(lvl_debug,"Item %p is deleted",mr->qitem);
return 1;
}
@@ -396,7 +396,7 @@ csv_coord_set(void *priv_data, struct coord *c, int count, enum change_mode mode
struct map_priv* m;
struct quadtree_item* qi;
GList* new_it;
- dbg(lvl_debug,"Set coordinates %d %d\n", c->x, c->y);
+ dbg(lvl_debug,"Set coordinates %d %d", c->x, c->y);
/* for now we only support coord modification only */
if( ! change_mode_modify) {
@@ -431,7 +431,7 @@ csv_coord_set(void *priv_data, struct coord *c, int count, enum change_mode mode
qi->longitude = cg.lng;
qi->latitude = cg.lat;
quadtree_add( m->tree_root, qi, mr->qiter);
- dbg(lvl_debug,"Set coordinates %f %f\n", cg.lng, cg.lat);
+ dbg(lvl_debug,"Set coordinates %f %f", cg.lng, cg.lat);
m->new_items = g_list_remove_link(m->new_items,new_it);
m->dirty=1;
save_map_csv(m);
@@ -494,11 +494,11 @@ static void map_csv_debug_dump_hash_item(gpointer key, gpointer value, gpointer
{
struct quadtree_item *qi=value;
GList *attrs;
- dbg(lvl_debug,"%p del=%d ref=%d\n", qi,qi->deleted, qi->ref_count);
+ dbg(lvl_debug,"%p del=%d ref=%d", qi,qi->deleted, qi->ref_count);
attrs=((struct quadtree_data *)qi->data)->attr_list;
while(attrs) {
if(((struct attr*)attrs->data)->type==attr_label)
- dbg(lvl_debug,"... %s\n",((struct attr*)attrs->data)->u.str);
+ dbg(lvl_debug,"... %s",((struct attr*)attrs->data)->u.str);
attrs=g_list_next(attrs);
}
}
@@ -519,7 +519,7 @@ map_rect_new_csv(struct map_priv *map, struct map_selection *sel)
struct coord_geo lu;
struct coord_geo rl;
struct quadtree_iter *res = NULL;
- dbg(lvl_debug,"map_rect_new_csv\n");
+ dbg(lvl_debug,"map_rect_new_csv");
if(debug_level_get("map_csv")>2) {
map_csv_debug_dump(map);
}
@@ -726,7 +726,7 @@ map_new_csv(struct map_methods *meth, struct attr **attrs, struct callback_list
charset = attr_search(attrs, NULL, attr_charset);
if(charset) {
- dbg(lvl_debug,"charset:%s\n",charset->u.str);
+ dbg(lvl_debug,"charset:%s",charset->u.str);
m->charset=g_strdup(charset->u.str);
} else {
m->charset=g_strdup(map_methods_csv.charset);
@@ -758,7 +758,7 @@ map_new_csv(struct map_methods *meth, struct attr **attrs, struct callback_list
FILE *fp;
wexp=file_wordexp_new(data->u.str);
wexp_data=file_wordexp_get_array(wexp);
- dbg(lvl_debug,"map_new_csv %s\n", data->u.str);
+ dbg(lvl_debug,"map_new_csv %s", data->u.str);
m->filename=g_strdup(wexp_data[0]);
file_wordexp_destroy(wexp);
@@ -775,7 +775,7 @@ map_new_csv(struct map_methods *meth, struct attr **attrs, struct callback_list
int col_cnt=0;
char *tok;
if(!line) {
- dbg(lvl_error,"Error converting '%s' to utf-8 from %s\n",linebuf, m->charset);
+ dbg(lvl_error,"Error converting '%s' to utf-8 from %s",linebuf, m->charset);
continue;
}
if(line[strlen(line)-1]=='\n' || line[strlen(line)-1]=='\r') {
@@ -848,7 +848,7 @@ map_new_csv(struct map_methods *meth, struct attr **attrs, struct callback_list
*pID = m->next_item_idx;
g_hash_table_insert(m->qitem_hash, pID,qi);
++m->next_item_idx;
- dbg(lvl_debug,"%s\n",line);
+ dbg(lvl_debug,"%s",line);
}
else {
g_free(curr_item);
@@ -856,7 +856,7 @@ map_new_csv(struct map_methods *meth, struct attr **attrs, struct callback_list
}
else {
- dbg(lvl_error,"ERROR: Non-matching attr count and column count: %d %d SKIPPING line: %s\n",col_cnt, attr_cnt,line);
+ dbg(lvl_error,"ERROR: Non-matching attr count and column count: %d %d SKIPPING line: %s",col_cnt, attr_cnt,line);
}
g_free(line);
g_free(line2);
@@ -865,21 +865,21 @@ map_new_csv(struct map_methods *meth, struct attr **attrs, struct callback_list
fclose(fp);
}
else {
- dbg(lvl_error,"Error opening csv map file '%s': %s\n", m->filename, strerror(errno));
+ dbg(lvl_error,"Error opening csv map file '%s': %s", m->filename, strerror(errno));
return NULL;
}
} else {
- dbg(lvl_debug,"No data attribute, starting with in-memory map\n");
+ dbg(lvl_debug,"No data attribute, starting with in-memory map");
}
- dbg(lvl_info,"%p\n",tree_root);
+ dbg(lvl_info,"%p",tree_root);
return m;
}
void
plugin_init(void)
{
- dbg(lvl_debug,"csv: plugin_init\n");
+ dbg(lvl_debug,"csv: plugin_init");
plugin_register_category_map("csv", map_new_csv);
}
diff --git a/navit/map/csv/quadtree.c b/navit/map/csv/quadtree.c
index ca6068541..32d075a3d 100644
--- a/navit/map/csv/quadtree.c
+++ b/navit/map/csv/quadtree.c
@@ -379,7 +379,7 @@ void quadtree_node_drop_garbage(struct quadtree_node* node, struct quadtree_iter
{
int i,j;
int node_num=node->node_num;
- dbg(lvl_debug,"Processing unreferenced subnode children...\n");
+ dbg(lvl_debug,"Processing unreferenced subnode children...");
for(i=0,j=0;i<node_num;i++) {
if(node->items[i]->deleted && !node->items[i]->ref_count) {
if(iter->item_free) {
@@ -426,7 +426,7 @@ quadtree_add(struct quadtree_node* this_, struct quadtree_item* item, struct qua
}
if (bSame) {
//FIXME: memleak and items thrown away if more than QUADTREE_NODE_CAPACITY-1 items with same coordinates added.
- dbg(lvl_error,"Unable to add another item with same coordinates. Throwing item to the ground. Will leak %p.\n",item);
+ dbg(lvl_error,"Unable to add another item with same coordinates. Throwing item to the ground. Will leak %p.",item);
return;
}
this_->items[this_->node_num++] = item;
@@ -561,7 +561,7 @@ struct quadtree_iter *quadtree_query(struct quadtree_node *this_, double dXMin,
ret->xmax=dXMax;
ret->ymin=dYMin;
ret->ymax=dYMax;
- dbg(lvl_debug,"%f %f %f %f\n",dXMin,dXMax,dYMin,dYMax)
+ dbg(lvl_debug,"%f %f %f %f",dXMin,dXMax,dYMin,dYMax)
ret->item_free=item_free;
ret->item_free_context=item_free_context;
n->node=this_;
@@ -577,7 +577,7 @@ struct quadtree_iter *quadtree_query(struct quadtree_node *this_, double dXMin,
}
this_->ref_count++;
- dbg(lvl_debug,"Query %p \n",this_)
+ dbg(lvl_debug,"Query %p ",this_)
return ret;
}
@@ -627,16 +627,16 @@ struct quadtree_item * quadtree_item_next(struct quadtree_iter *iter)
if(iter_node->is_leaf) {
/* Try to find undeleted item in the current node */
- dbg(lvl_debug,"find item %p %p ...\n",iter->iter_nodes,iter->iter_nodes->data);
+ dbg(lvl_debug,"find item %p %p ...",iter->iter_nodes,iter->iter_nodes->data);
while(iter_node->item<iter_node->node_num) {
- dbg(lvl_debug,"%d %d\n",iter_node->item,iter_node->items[iter_node->item]->deleted);
+ dbg(lvl_debug,"%d %d",iter_node->item,iter_node->items[iter_node->item]->deleted);
if(iter_node->items[iter_node->item]->deleted) {
iter_node->item++;
continue;
}
iter->item=iter_node->items[iter_node->item];
iter_node->item++;
- dbg(lvl_debug,"Returning %p\n",iter->item);
+ dbg(lvl_debug,"Returning %p",iter->item);
iter->item->ref_count++;
return iter->item;
}
@@ -654,13 +654,13 @@ struct quadtree_item * quadtree_item_next(struct quadtree_iter *iter)
i=iter_node->subnode;
if(!nodes[i] || !rects_overlap(nodes[i]->xmin, nodes[i]->ymin, nodes[i]->xmax, nodes[i]->ymax, iter->xmin, iter->ymin, iter->xmax, iter->ymax))
continue;
- dbg(lvl_debug,"%f %f %f %f\n",nodes[i]->xmin, nodes[i]->xmax, nodes[i]->ymin, nodes[i]->ymax)
+ dbg(lvl_debug,"%f %f %f %f",nodes[i]->xmin, nodes[i]->xmax, nodes[i]->ymin, nodes[i]->ymax)
subnode=nodes[i];
}
if(subnode) {
/* Go one level deeper */
- dbg(lvl_debug,"Go one level deeper...\n");
+ dbg(lvl_debug,"Go one level deeper...");
iter_node=g_new0(struct quadtree_iter_node, 1);
iter_node->node=subnode;
iter_node->is_leaf=subnode->is_leaf;
@@ -692,7 +692,7 @@ struct quadtree_item * quadtree_item_next(struct quadtree_iter *iter)
/* 2. remove empty leaf subnode if it's unreferenced */
if(!subnode->ref_count && !subnode->node_num && subnode->is_leaf ) {
- dbg(lvl_debug,"Going to delete an empty unreferenced leaf subnode...\n");
+ dbg(lvl_debug,"Going to delete an empty unreferenced leaf subnode...");
if(subnode->parent) {
if(subnode->parent->aa==subnode) {
@@ -704,19 +704,19 @@ struct quadtree_item * quadtree_item_next(struct quadtree_iter *iter)
} else if(subnode->parent->bb==subnode) {
subnode->parent->bb=NULL;
} else {
- dbg(lvl_error,"Found Quadtree structure corruption while trying to free an empty node.\n");
+ dbg(lvl_error,"Found Quadtree structure corruption while trying to free an empty node.");
}
if(!subnode->parent->aa && !subnode->parent->ab && !subnode->parent->ba && !subnode->parent->bb )
subnode->parent->is_leaf=1;
g_free(subnode);
} else
- dbg(lvl_debug,"Quadtree is empty. NOT deleting the root subnode...\n");
+ dbg(lvl_debug,"Quadtree is empty. NOT deleting the root subnode...");
}
/* Go one step towards root */
- dbg(lvl_info,"Going towards root...\n");
+ dbg(lvl_info,"Going towards root...");
g_free(iter->iter_nodes->data);
iter->iter_nodes=g_list_delete_link(iter->iter_nodes,iter->iter_nodes);
}
diff --git a/navit/map/filter/filter.c b/navit/map/filter/filter.c
index cecae7fc0..78d09e5b9 100644
--- a/navit/map/filter/filter.c
+++ b/navit/map/filter/filter.c
@@ -319,7 +319,7 @@ map_filter_rect_get_item(struct map_rect_priv *mr)
static struct item *
map_filter_rect_get_item_byid(struct map_rect_priv *mr, int id_hi, int id_lo)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
mr->parent_item=map_rect_get_item_byid(mr->parent, id_hi, id_lo);
if (!mr->parent_item)
return NULL;
@@ -332,21 +332,21 @@ map_filter_rect_get_item_byid(struct map_rect_priv *mr, int id_hi, int id_lo)
static struct map_search_priv *
map_filter_search_new(struct map_priv *map, struct item *item, struct attr *search, int partial)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
return NULL;
}
static struct item *
map_filter_search_get_item(struct map_search_priv *map_search)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
return NULL;
}
static void
map_filter_search_destroy(struct map_search_priv *ms)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
}
static void
@@ -429,7 +429,7 @@ map_filter_new(struct map_methods *meth, struct attr **attrs, struct callback_li
void
plugin_init(void)
{
- dbg(lvl_debug,"filter: plugin_init\n");
+ dbg(lvl_debug,"filter: plugin_init");
plugin_register_category_map("filter", map_filter_new);
}
diff --git a/navit/map/garmin/garmin.c b/navit/map/garmin/garmin.c
index 2e7263081..4ef32a28e 100644
--- a/navit/map/garmin/garmin.c
+++ b/navit/map/garmin/garmin.c
@@ -814,17 +814,6 @@ garmin_get_selection(struct map_rect_priv *map, struct map_selection *sel)
}
return -1;
}
-#if 0
- sl = (18-(gm->maxlevel - gm->minlevel))/2;
- el = sl + (gm->maxlevel - gm->minlevel);
- if (level < sl)
- level = sl;
- if (level > el)
- level = el;
- level = level - sl;
- level = (gm->maxlevel - gm->minlevel) - level;
- dlog(3, "sl=%d el=%d level=%d\n", sl, el, level);
-#endif
sl = (18-gm->zoomlevels)/2;
el = sl + gm->zoomlevels;
if (level < sl)
diff --git a/navit/map/mg/block.c b/navit/map/mg/block.c
index b2bb64ac0..747e49b15 100644
--- a/navit/map/mg/block.c
+++ b/navit/map/mg/block.c
@@ -77,7 +77,7 @@ block_get_byid(struct file *file, int id, unsigned char **p_ret)
int
block_get_byindex(struct file *file, int idx, struct block_priv *blk)
{
- dbg(lvl_debug,"idx=%d\n", idx);
+ dbg(lvl_debug,"idx=%d", idx);
blk->b=block_get_byid(file, idx, &blk->p);
blk->block_start=(unsigned char *)(blk->b);
blk->p_start=blk->p;
@@ -177,7 +177,7 @@ block_next_lin(struct map_rect_priv *mr)
else
mr->b.p=mr->b.block_start+block_get_blocks(mr->b.b)*512;
if (mr->b.p >= mr->file->end) {
- dbg(lvl_debug,"end of blocks %p vs %p\n", mr->b.p, mr->file->end);
+ dbg(lvl_debug,"end of blocks %p vs %p", mr->b.p, mr->file->end);
return 0;
}
mr->b.block_start=mr->b.p;
@@ -185,17 +185,17 @@ block_next_lin(struct map_rect_priv *mr)
mr->b.p_start=mr->b.p;
mr->b.end=mr->b.block_start+block_get_size(mr->b.b);
if (block_get_count(mr->b.b) == -1) {
- dbg(lvl_warning,"empty blocks\n");
+ dbg(lvl_warning,"empty blocks");
return 0;
}
block_get_r(mr->b.b, &r);
if (!mr->cur_sel || coord_rect_overlap(&mr->cur_sel->u.c_rect, &r)) {
block_active_count++;
block_active_mem+=block_get_blocks(mr->b.b)*512-sizeof(struct block *);
- dbg(lvl_debug,"block ok\n");
+ dbg(lvl_debug,"block ok");
return 1;
}
- dbg(lvl_info,"block not in cur_sel\n");
+ dbg(lvl_info,"block not in cur_sel");
}
}
@@ -210,21 +210,15 @@ block_next(struct map_rect_priv *mr)
return block_next_lin(mr);
for (;;) {
if (! bt->p) {
- dbg(lvl_debug,"block 0x%x\n", bt->next);
+ dbg(lvl_debug,"block 0x%x", bt->next);
if (bt->next == -1)
return 0;
bt->b=block_get_byid(mr->file, bt->next, &bt->p);
bt->end=(unsigned char *)mr->b.bt.b+block_get_size(mr->b.bt.b);
bt->next=block_get_next(bt->b);
bt->order=0;
- dbg(lvl_debug,"size 0x%x next 0x%x\n", block_get_size(bt->b), block_get_next(bt->b));
+ dbg(lvl_debug,"size 0x%x next 0x%x", block_get_size(bt->b), block_get_next(bt->b));
if (! mr->b.bt.block_count) {
-#if 0
- if (debug) {
- printf("idx rect ");
- block_rect_print(&mr->b.bt.b->r);
- }
-#endif
block_get_r(bt->b, &bt->r);
bt->r_curr=bt->r;
coord=get_u32(&mr->b.bt.p);
@@ -243,13 +237,6 @@ block_next(struct map_rect_priv *mr)
r_w=bt->r_curr.rl.x-bt->r_curr.lu.x;
r_h=bt->r_curr.lu.y-bt->r_curr.rl.y;
-#if 0
- if (debug) {
- printf(" rect1 ");
- block_rect_print(&bt->r_curr);
- printf(" %dx%d", r_w, r_h);
- }
-#endif
mr->b.b=NULL;
if (blk_num != -1) {
block_mem+=8;
diff --git a/navit/map/mg/map.c b/navit/map/mg/map.c
index 13561e154..81d28a8f3 100644
--- a/navit/map/mg/map.c
+++ b/navit/map/mg/map.c
@@ -289,7 +289,7 @@ map_rect_get_item_mg(struct map_rect_priv *mr)
}
if (file_next(mr))
continue;
- dbg(lvl_debug,"lin_count %d idx_count %d active_count %d %d kB (%d kB)\n", block_lin_count, block_idx_count, block_active_count, (block_mem+block_active_mem)/1024, block_active_mem/1024);
+ dbg(lvl_debug,"lin_count %d idx_count %d active_count %d %d kB (%d kB)", block_lin_count, block_idx_count, block_active_count, (block_mem+block_active_mem)/1024, block_active_mem/1024);
return NULL;
}
}
@@ -361,7 +361,7 @@ map_search_mg_convert_special(char *str)
*c++='u';
break;
default:
- dbg(lvl_debug,"0x%x\n", *str);
+ dbg(lvl_debug,"0x%x", *str);
*c++=*str;
break;
}
@@ -375,11 +375,11 @@ static int
map_search_setup(struct map_rect_priv *mr)
{
char *prefix;
- dbg(lvl_debug,"%s\n", attr_to_name(mr->search_type));
+ dbg(lvl_debug,"%s", attr_to_name(mr->search_type));
switch (mr->search_type) {
case attr_town_postal:
if (mr->search_item.type != type_country_label) {
- dbg(lvl_error,"wrong parent type %s\n", item_to_name(mr->search_item.type));
+ dbg(lvl_error,"wrong parent type %s", item_to_name(mr->search_item.type));
return 0;
}
prefix=mg_country_postal_prefix(mr->search_item.id_lo);
@@ -388,12 +388,12 @@ map_search_setup(struct map_rect_priv *mr)
tree_search_init(mr->m->dirname, "town.b1", &mr->ts, 0);
mr->current_file=file_town_twn;
mr->search_str=g_strdup_printf("%s%s",prefix,mr->search_attr->u.str);
- dbg(lvl_debug,"search_str='%s'\n",mr->search_str);
+ dbg(lvl_debug,"search_str='%s'",mr->search_str);
mr->search_country=mg_country_from_isonum(mr->search_item.id_lo);
break;
case attr_town_name:
if (mr->search_item.type != type_country_label) {
- dbg(lvl_error,"wrong parent type %s\n", item_to_name(mr->search_item.type));
+ dbg(lvl_error,"wrong parent type %s", item_to_name(mr->search_item.type));
return 0;
}
tree_search_init(mr->m->dirname, "town.b2", &mr->ts, 0x1000);
@@ -403,7 +403,7 @@ map_search_setup(struct map_rect_priv *mr)
break;
case attr_district_name:
if (mr->search_item.type != type_country_label) {
- dbg(lvl_error,"wrong parent type %s\n", item_to_name(mr->search_item.type));
+ dbg(lvl_error,"wrong parent type %s", item_to_name(mr->search_item.type));
return 0;
}
tree_search_init(mr->m->dirname, "town.b3", &mr->ts, 0x1000);
@@ -434,11 +434,11 @@ map_search_setup(struct map_rect_priv *mr)
return 0;
}
} else {
- dbg(lvl_error,"wrong parent type %s %p 0x%x 0x%x\n", item_to_name(mr->search_item.type), item, mr->search_item.id_hi, mr->search_item.id_lo);
+ dbg(lvl_error,"wrong parent type %s %p 0x%x 0x%x", item_to_name(mr->search_item.type), item, mr->search_item.id_hi, mr->search_item.id_lo);
return 0;
}
}
- dbg(lvl_debug,"street_assoc=0x%x\n", mr->search_item.id_lo);
+ dbg(lvl_debug,"street_assoc=0x%x", mr->search_item.id_lo);
tree_search_init(mr->m->dirname, "strname.b1", &mr->ts, 0);
mr->current_file=file_strname_stn;
mr->search_str=g_strdup(mr->search_attr->u.str);
@@ -447,12 +447,12 @@ map_search_setup(struct map_rect_priv *mr)
if (!map_priv_is(mr->search_item.map, mr->m))
return 0;
if (!housenumber_search_setup(mr)) {
- dbg(lvl_error,"failed to search for attr_house_number\n");
+ dbg(lvl_error,"failed to search for attr_house_number");
return 0;
}
break;
default:
- dbg(lvl_error,"unknown search %s\n",attr_to_name(mr->search_type));
+ dbg(lvl_error,"unknown search %s",attr_to_name(mr->search_type));
return 0;
}
mr->file=mr->m->file[mr->current_file];
@@ -467,9 +467,9 @@ static struct map_search_priv *
map_search_new_mg(struct map_priv *map, struct item *item, struct attr *search, int partial)
{
struct map_rect_priv *mr=g_new0(struct map_rect_priv, 1);
- dbg(lvl_debug,"searching for %s '%s'\n", attr_to_name(search->type), search->u.str);
- dbg(lvl_debug,"id_lo=0x%x\n", item->id_lo);
- dbg(lvl_debug,"search=%s\n", search->u.str);
+ dbg(lvl_debug,"searching for %s '%s'", attr_to_name(search->type), search->u.str);
+ dbg(lvl_debug,"id_lo=0x%x", item->id_lo);
+ dbg(lvl_debug,"search=%s", search->u.str);
mr->m=map;
mr->search_attr=attr_dup(search);
mr->search_type=search->type;
@@ -480,7 +480,7 @@ map_search_new_mg(struct map_priv *map, struct item *item, struct attr *search,
mr->search_type_next=attr_district_name;
}
if (!map_search_setup(mr)) {
- dbg(lvl_warning,"map_search_new_mg failed\n");
+ dbg(lvl_warning,"map_search_new_mg failed");
g_free(mr);
return NULL;
}
@@ -507,7 +507,7 @@ map_search_destroy_mg(struct map_search_priv *ms)
{
struct map_rect_priv *mr=(struct map_rect_priv *)ms;
- dbg(lvl_debug,"mr=%p\n", mr);
+ dbg(lvl_debug,"mr=%p", mr);
if (! mr)
return;
map_search_cleanup(mr);
@@ -538,7 +538,7 @@ map_search_get_item_mg(struct map_search_priv *ms)
ret=housenumber_search_get_item(mr);
break;
default:
- dbg(lvl_error,"unknown search %s\n",attr_to_name(mr->search_type));
+ dbg(lvl_error,"unknown search %s",attr_to_name(mr->search_type));
break;
}
if (!ret && mr->search_type_next != attr_none) {
@@ -595,7 +595,7 @@ map_new_mg(struct map_methods *meth, struct attr **attrs, struct callback_list *
if (! m->file[i]) {
maybe_missing=(i == file_border_ply || i == file_height_ply || i == file_sea_ply);
if (! maybe_missing)
- dbg(lvl_error,"Failed to load %s\n", filename);
+ dbg(lvl_error,"Failed to load %s", filename);
} else
file_mmap(m->file[i]);
g_free(filename);
diff --git a/navit/map/mg/poly.c b/navit/map/mg/poly.c
index 7c73d4587..b759301e3 100644
--- a/navit/map/mg/poly.c
+++ b/navit/map/mg/poly.c
@@ -225,7 +225,7 @@ poly_get(struct map_rect_priv *mr, struct poly_priv *poly, struct item *item)
item->type=type_rail;
break;
default:
- dbg(lvl_error,"Unknown poly type 0x%x '%s' 0x%x,0x%x\n", poly->type,poly->name,r.lu.x,r.lu.y);
+ dbg(lvl_error,"Unknown poly type 0x%x '%s' 0x%x,0x%x", poly->type,poly->name,r.lu.x,r.lu.y);
item->type=type_street_unkn;
}
if (!map_selection_contains_item(mr->cur_sel, 0, item->type)) {
@@ -235,10 +235,10 @@ poly_get(struct map_rect_priv *mr, struct poly_priv *poly, struct item *item)
}
} else
mr->b.p=poly->subpoly_next;
- dbg(lvl_debug,"%d %d %s\n", poly->subpoly_num_all, mr->b.block_num, poly->name);
+ dbg(lvl_debug,"%d %d %s", poly->subpoly_num_all, mr->b.block_num, poly->name);
item->id_lo=poly->subpoly_num_all | (mr->b.block_num << 16);
item->id_hi=(mr->current_file << 16);
- dbg(lvl_debug,"0x%x 0x%x\n", item->id_lo, item->id_hi);
+ dbg(lvl_debug,"0x%x 0x%x", item->id_lo, item->id_hi);
poly->subpoly_next=mr->b.p+L(poly->count[poly->subpoly_num])*sizeof(struct coord);
poly->subpoly_num++;
poly->subpoly_num_all++;
diff --git a/navit/map/mg/street.c b/navit/map/mg/street.c
index 6aad6e5a0..cffd599ae 100644
--- a/navit/map/mg/street.c
+++ b/navit/map/mg/street.c
@@ -61,10 +61,6 @@ street_name_debug(struct street_name *sn, FILE *out)
static void
street_name_get(struct street_name *name, unsigned char **p)
{
-#if 0
- static FILE *out;
- static GHashTable *hash;
-#endif
unsigned char *start=*p;
name->len=get_u16_unal(p);
name->country=get_u16_unal(p);
@@ -79,18 +75,6 @@ street_name_get(struct street_name *name, unsigned char **p)
name->tmp_len=name->aux_len;
name->tmp_data=name->aux_data;
*p=start+name->len;
-#if 0
- if (! out) {
- out=fopen("hn.txt","a");
- }
- if (! hash) {
- hash=g_hash_table_new(NULL,NULL);
- }
- if (! g_hash_table_lookup(hash, *p)) {
- g_hash_table_insert(hash, *p, (void *)1);
- street_name_debug(name, out);
- }
-#endif
}
static int
@@ -208,7 +192,7 @@ static int street_get_coord(unsigned char **pos, int bytes, struct coord_rect *r
if (f) {
f->x=ref->lu.x+x;
f->y=ref->rl.y+y;
- dbg(lvl_debug,"0x%x,0x%x + 0x%x,0x%x = 0x%x,0x%x\n", x, y, ref->lu.x, ref->rl.y, f->x, f->y);
+ dbg(lvl_debug,"0x%x,0x%x + 0x%x,0x%x = 0x%x,0x%x", x, y, ref->lu.x, ref->rl.y, f->x, f->y);
}
*pos=p;
return flags;
@@ -282,14 +266,14 @@ street_coord_get(void *priv_data, struct coord *c, int count)
if (segid == 0x15)
debug=1;
if (debug) {
- dbg(lvl_debug,"enter 0x%x\n",segid);
+ dbg(lvl_debug,"enter 0x%x",segid);
}
#endif
while (count > 0) {
if (street_coord_get_helper(street, c)) {
#ifdef DEBUG_COORD_GET
if (debug) {
- dbg(lvl_debug,"0x%x,0x%x\n", c->x, c->y);
+ dbg(lvl_debug,"0x%x,0x%x", c->x, c->y);
}
#endif
c++;
@@ -316,7 +300,7 @@ street_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
struct street_priv *street=priv_data;
int nameid;
- dbg(lvl_debug,"segid 0x%x\n", street_str_get_segid(street->str));
+ dbg(lvl_debug,"segid 0x%x", street_str_get_segid(street->str));
attr->type=attr_type;
switch (attr_type) {
case attr_any:
@@ -414,13 +398,6 @@ street_get(struct map_rect_priv *mr, struct street_priv *street, struct item *it
struct coord c;
street_coord_get(street, &c, 1);
}
-#if 0
- if (street->housenumber) {
- if (street_get_housenumber(mr, street, item))
- return 1;
- street->housenumber=0;
- }
-#endif
if (mr->b.p == mr->b.p_start) {
street_get_data(street, &mr->b.p);
street->name_file=mr->m->file[file_strname_stn];
@@ -445,16 +422,8 @@ street_get(struct map_rect_priv *mr, struct street_priv *street, struct item *it
return 0;
if (street_str_get_segid(street->str) < 0)
street->type++;
-#if 0
- dbg_assert(street->p != NULL);
-#endif
street->next=NULL;
street->status_rewind=street->status=street_str_get_segid(&street->str[1]) >= 0 ? 0:1;
-#if 0
- if (street->type->country != 0x31) {
- printf("country=0x%x\n", street->type->country);
- }
-#endif
item->id_hi=street_type_get_country(street->type) | (mr->current_file << 16);
item->id_lo=street_str_get_segid(street->str) > 0 ? street_str_get_segid(street->str) : -street_str_get_segid(street->str);
switch(street_str_get_type(street->str) & 0x1f) {
@@ -516,7 +485,7 @@ street_get(struct map_rect_priv *mr, struct street_priv *street, struct item *it
break;
default:
item->type=type_street_unkn;
- dbg(lvl_error,"unknown type 0x%x\n",street_str_get_type(street->str));
+ dbg(lvl_error,"unknown type 0x%x",street_str_get_type(street->str));
}
flags=item_get_default_flags(item->type);
if (flags)
@@ -530,13 +499,6 @@ street_get(struct map_rect_priv *mr, struct street_priv *street, struct item *it
street->flags|=(street_str_get_limit(street->str) & 0x30) ? AF_ONEWAY:0;
street->flags|=(street_str_get_limit(street->str) & 0x03) ? AF_ONEWAYREV:0;
}
-#if 0
- coord_debug=(street->str->unknown2 != 0x40 || street->str->unknown3 != 0x40);
- if (coord_debug) {
- item->type=type_street_unkn;
- printf("%d %02x %02x %02x %02x\n", street->str->segid, street->str->type, street->str->limit, street->str->unknown2, street->str->unknown3);
- }
-#endif
street->p_rewind=street->p;
street->name.len=0;
street->attr_next=attr_label;
@@ -557,12 +519,12 @@ street_get_byid(struct map_rect_priv *mr, struct street_priv *street, int id_hi,
int country=id_hi & 0xffff;
int res;
struct coord_rect r;
- dbg(lvl_debug,"enter(%p,%p,0x%x,0x%x,%p)\n", mr, street, id_hi, id_lo, item);
+ dbg(lvl_debug,"enter(%p,%p,0x%x,0x%x,%p)", mr, street, id_hi, id_lo, item);
if (! country)
return 0;
if (! tree_search_hv(mr->m->dirname, "street", (id_lo >> 8) | (country << 24), id_lo & 0xff, &res))
return 0;
- dbg(lvl_debug,"res=0x%x (blk=0x%x)\n", res, res >> 12);
+ dbg(lvl_debug,"res=0x%x (blk=0x%x)", res, res >> 12);
block_get_byindex(mr->m->file[mr->current_file], res >> 12, &mr->b);
street_get_data(street, &mr->b.p);
street->name_file=mr->m->file[file_strname_stn];
@@ -578,14 +540,8 @@ street_get_byid(struct map_rect_priv *mr, struct street_priv *street, int id_hi,
item->meth=&street_meth;
item->priv_data=street;
street->str+=(res & 0xfff)-1;
- dbg(lvl_debug,"segid 0x%x\n", street_str_get_segid(&street->str[1]));
+ dbg(lvl_debug,"segid 0x%x", street_str_get_segid(&street->str[1]));
return street_get(mr, street, item);
-#if 0
- mr->b.p=mr->b.block_start+(res & 0xffff);
- return town_get(mr, twn, item);
-#endif
-
- return 0;
}
struct street_name_index {
@@ -620,7 +576,7 @@ latin1_tolower_ascii(unsigned char c)
return 'u';
default:
if (ret >= 0x80)
- dbg(lvl_debug,"ret=0x%x\n",c);
+ dbg(lvl_debug,"ret=0x%x",c);
return ret;
}
}
@@ -663,26 +619,26 @@ street_search_compare_do(struct map_rect_priv *mr, int country, int town_assoc,
int d,len;
dbg(lvl_debug,"enter");
- dbg(lvl_debug,"country 0x%x town_assoc 0x%x name '%s'\n", country, town_assoc, name);
+ dbg(lvl_debug,"country 0x%x town_assoc 0x%x name '%s'", country, town_assoc, name);
d=(mr->search_item.id_hi & 0xffff)-country;
- dbg(lvl_debug,"country %d (%d vs %d)\n", d, mr->search_item.id_hi & 0xffff, country);
+ dbg(lvl_debug,"country %d (%d vs %d)", d, mr->search_item.id_hi & 0xffff, country);
if (!d) {
if (mr->search_item.id_lo == town_assoc ) {
- dbg(lvl_debug,"town_assoc match (0x%x)\n", town_assoc);
+ dbg(lvl_debug,"town_assoc match (0x%x)", town_assoc);
len=mr->search_partial ? strlen(mr->search_str):INT_MAX;
d=strncasecmp_latin1(mr->search_str, name, len);
if (!strncasecmp_latin1_ascii(mr->search_str, name, len))
d=0;
- dbg(lvl_debug,"string %d\n", d);
+ dbg(lvl_debug,"string %d", d);
} else {
if (town_assoc < mr->search_item.id_lo)
d=1;
else
d=-1;
- dbg(lvl_debug,"assoc %d 0x%x-0x%x\n",d, mr->search_item.id_lo, town_assoc);
+ dbg(lvl_debug,"assoc %d 0x%x-0x%x",d, mr->search_item.id_lo, town_assoc);
}
}
- dbg(lvl_debug,"d=%d\n", d);
+ dbg(lvl_debug,"d=%d", d);
return d;
}
@@ -692,11 +648,11 @@ street_search_compare(unsigned char **p, struct map_rect_priv *mr)
struct street_name_index *i;
int ret;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
i=(struct street_name_index *)(*p);
*p+=sizeof(*i)+strlen(i->name)+1;
- dbg(lvl_debug,"block 0x%x\n", i->block);
+ dbg(lvl_debug,"block 0x%x", i->block);
ret=street_search_compare_do(mr, i->country, i->town_assoc, i->name);
if (ret <= 0)
@@ -725,7 +681,7 @@ street_name_coord_get(void *priv_data, struct coord *c, int count)
struct street_name_numbers snns;
unsigned char *p=mr->street.name.aux_data;
- dbg(lvl_debug,"aux_data=%p\n", p);
+ dbg(lvl_debug,"aux_data=%p", p);
if (count) {
street_name_numbers_get(&snns, &p);
street_name_numbers_get_coord(&snns, c);
@@ -801,7 +757,7 @@ street_name_attr_get(void *priv_data, enum attr_type attr_type, struct attr *att
return 0;
return item_attr_get(mr->search_item_tmp, attr_type, attr);
default:
- dbg(lvl_error,"unknown attr %s\n",attr_to_name(attr_type));
+ dbg(lvl_error,"unknown attr %s",attr_to_name(attr_type));
return 0;
}
}
@@ -830,7 +786,7 @@ street_name_get_byid(struct map_rect_priv *mr, struct street_priv *street, int i
item->map=NULL;
item->priv_data=mr;
mr->b.p=street->name_file->begin+item->id_lo;
- dbg(lvl_debug,"last %p map %p file %d begin %p\n", mr->b.p, mr->m, mr->current_file, mr->m->file[mr->current_file]->begin);
+ dbg(lvl_debug,"last %p map %p file %d begin %p", mr->b.p, mr->m, mr->current_file, mr->m->file[mr->current_file]->begin);
street_name_get(&street->name, &mr->b.p);
return 1;
}
@@ -841,30 +797,30 @@ street_search_get_item_street_name(struct map_rect_priv *mr)
int dir=1,leaf;
unsigned char *last;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (! mr->search_blk_count) {
- dbg(lvl_debug,"partial 0x%x '%s' ***\n", mr->town.street_assoc, mr->search_str);
+ dbg(lvl_debug,"partial 0x%x '%s' ***", mr->town.street_assoc, mr->search_str);
if (mr->search_linear)
return NULL;
- dbg(lvl_debug,"tree_search_next\n");
+ dbg(lvl_debug,"tree_search_next");
mr->search_block=-1;
while ((leaf=tree_search_next(&mr->ts, &mr->search_p, dir)) != -1) {
dir=street_search_compare(&mr->search_p, mr);
}
- dbg(lvl_debug,"dir=%d mr->search_block=0x%x\n", dir, mr->search_block);
+ dbg(lvl_debug,"dir=%d mr->search_block=0x%x", dir, mr->search_block);
if (mr->search_block == -1)
return NULL;
mr->search_blk_count=1;
block_get_byindex(mr->m->file[file_strname_stn], mr->search_block, &mr->b);
mr->b.p=mr->b.block_start+12;
}
- dbg(lvl_debug,"name id %td\n", mr->b.p-mr->m->file[file_strname_stn]->begin);
+ dbg(lvl_debug,"name id %td", mr->b.p-mr->m->file[file_strname_stn]->begin);
if (! mr->search_blk_count)
return NULL;
for (;;) {
if (mr->b.p >= mr->b.end) {
if (!block_next_lin(mr)) {
- dbg(lvl_debug,"end of blocks in %p, %p\n", mr->m->file[file_strname_stn]->begin, mr->m->file[file_strname_stn]->end);
+ dbg(lvl_debug,"end of blocks in %p, %p", mr->m->file[file_strname_stn]->begin, mr->m->file[file_strname_stn]->end);
return NULL;
}
mr->b.p=mr->b.block_start+12;
@@ -873,23 +829,23 @@ street_search_get_item_street_name(struct map_rect_priv *mr)
last=mr->b.p;
street_name_get(&mr->street.name, &mr->b.p);
dir=street_search_compare_do(mr, mr->street.name.country, mr->street.name.townassoc, mr->street.name.name2);
- dbg(lvl_debug,"country 0x%x assoc 0x%x name1 '%s' name2 '%s' dir=%d\n", mr->street.name.country, mr->street.name.townassoc, mr->street.name.name1, mr->street.name.name2, dir);
+ dbg(lvl_debug,"country 0x%x assoc 0x%x name1 '%s' name2 '%s' dir=%d", mr->street.name.country, mr->street.name.townassoc, mr->street.name.name1, mr->street.name.name2, dir);
if (dir < 0) {
- dbg(lvl_debug,"end of data\n");
+ dbg(lvl_debug,"end of data");
mr->search_blk_count=0;
return NULL;
}
if (!dir) {
- dbg(lvl_debug,"result country 0x%x assoc 0x%x name1 '%s' name2 '%s' dir=%d aux_data=%p len=0x%x\n", mr->street.name.country, mr->street.name.townassoc, mr->street.name.name1, mr->street.name.name2, dir, mr->street.name.aux_data, mr->street.name.aux_len);
+ dbg(lvl_debug,"result country 0x%x assoc 0x%x name1 '%s' name2 '%s' dir=%d aux_data=%p len=0x%x", mr->street.name.country, mr->street.name.townassoc, mr->street.name.name1, mr->street.name.name2, dir, mr->street.name.aux_data, mr->street.name.aux_len);
mr->item.type = type_street_name;
mr->item.id_hi=(file_strname_stn << 16);
mr->item.id_lo=last-mr->m->file[file_strname_stn]->begin;
- dbg(lvl_debug,"id 0x%x 0x%x last %p map %p file %d begin %p\n", mr->item.id_hi, mr->item.id_lo, last, mr->m, mr->current_file, mr->m->file[mr->current_file]->begin);
+ dbg(lvl_debug,"id 0x%x 0x%x last %p map %p file %d begin %p", mr->item.id_hi, mr->item.id_lo, last, mr->m, mr->current_file, mr->m->file[mr->current_file]->begin);
mr->item.meth=&street_name_meth;
mr->item.map=NULL;
mr->item.priv_data=mr;
/* debug(mr); */
- dbg(lvl_debug,"last %p\n",last);
+ dbg(lvl_debug,"last %p",last);
return &mr->item;
}
}
@@ -920,7 +876,7 @@ street_name_numbers_next(struct map_rect_priv *mr)
{
if (street_name_eod(&mr->street.name))
return 0;
- dbg(lvl_debug,"%p vs %p\n",mr->street.name.tmp_data, mr->street.name.aux_data);
+ dbg(lvl_debug,"%p vs %p",mr->street.name.tmp_data, mr->street.name.aux_data);
street_name_numbers_get(&mr->street.name_numbers, &mr->street.name.tmp_data);
return 1;
}
@@ -975,7 +931,7 @@ housenumber_attr_get(void *priv_data, enum attr_type attr_type, struct attr *att
return 0;
return item_attr_get(mr->search_item_tmp, attr_type, attr);
default:
- dbg(lvl_error,"unknown attr %s\n",attr_to_name(attr_type));
+ dbg(lvl_error,"unknown attr %s",attr_to_name(attr_type));
return 0;
}
}
@@ -991,20 +947,17 @@ static struct item_methods housenumber_meth = {
int
housenumber_search_setup(struct map_rect_priv *mr)
{
- dbg(lvl_debug,"enter (0x%x,0x%x)\n",mr->search_item.id_hi,mr->search_item.id_lo);
+ dbg(lvl_debug,"enter (0x%x,0x%x)",mr->search_item.id_hi,mr->search_item.id_lo);
int id=mr->search_item.id_hi & 0xff;
mr->current_file=file_strname_stn;
mr->street.name_file=mr->m->file[mr->current_file];
mr->b.p=mr->street.name_file->begin+mr->search_item.id_lo;
mr->search_str=g_strdup(mr->search_attr->u.str);
- dbg(lvl_debug,"last %p\n",mr->b.p);
+ dbg(lvl_debug,"last %p",mr->b.p);
street_name_get(&mr->street.name, &mr->b.p);
-#if 0
- debug(mr);
-#endif
while (id > 0) {
id--;
- dbg(lvl_debug,"loop\n");
+ dbg(lvl_debug,"loop");
if (!street_name_numbers_next(mr))
return 0;
}
@@ -1015,10 +968,10 @@ housenumber_search_setup(struct map_rect_priv *mr)
if (!id)
mr->item.id_hi+=1;
mr->item.id_lo=mr->search_item.id_lo;
- dbg(lvl_debug,"getting name_number %p vs %p + %d\n",mr->street.name_numbers.tmp_data,mr->street.name_numbers.aux_data, mr->street.name_numbers.aux_len);
+ dbg(lvl_debug,"getting name_number %p vs %p + %d",mr->street.name_numbers.tmp_data,mr->street.name_numbers.aux_data, mr->street.name_numbers.aux_len);
if (!street_name_number_next(mr))
return 0;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
// debug(mr);
return 1;
}
@@ -1055,7 +1008,7 @@ struct item *
housenumber_search_get_item(struct map_rect_priv *mr)
{
int d;
- dbg(lvl_debug,"enter %s %s\n",mr->street.first_number,mr->street.last_number);
+ dbg(lvl_debug,"enter %s %s",mr->street.first_number,mr->street.last_number);
for (;;) {
if (!house_number_next(mr->street.current_number, mr->street.first_number, mr->street.last_number, 0, NULL)) {
if (!street_name_number_next(mr))
diff --git a/navit/map/mg/town.c b/navit/map/mg/town.c
index 0fd19be0d..ace353a1d 100644
--- a/navit/map/mg/town.c
+++ b/navit/map/mg/town.c
@@ -105,7 +105,7 @@ town_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
twn->attr_next=attr_none;
return 1;
default:
- dbg(lvl_warning, "Don't know about attribute %d[%04X]=%s yet\n",
+ dbg(lvl_warning, "Don't know about attribute %d[%04X]=%s yet",
attr_type, attr_type, attr_to_name(attr_type));
return 0;
}
@@ -137,9 +137,6 @@ town_get_data(struct town_priv *twn, unsigned char **p)
twn->unknown3=get_u8(p);
twn->postal_code2=get_string(p);
twn->unknown4=get_u32_unal(p);
-#if 0
- printf("%s\t%s\t%s\t%d\t%d\t%d\n",twn->name,twn->district,twn->postal_code1,twn->order, twn->country, twn->type);
-#endif
}
/*0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 */
static unsigned char limit[]={0,1,2,2,4,6,8,10,11,13,14,14,14,20,20,20,20,20,20};
@@ -237,7 +234,7 @@ town_search_compare(unsigned char **p, struct map_rect_priv *mr)
else
d=strcasecmp(mr->search_str, name);
}
- dbg(lvl_debug,"%d \n",d);
+ dbg(lvl_debug,"%d ",d);
return d;
}
@@ -250,7 +247,7 @@ town_search_get_item(struct map_rect_priv *mr)
int dir=1,leaf;
if (! mr->search_blk_count) {
- dbg(lvl_debug,"partial %d 0x%x '%s' ***\n", mr->search_partial, mr->search_country, mr->search_str);
+ dbg(lvl_debug,"partial %d 0x%x '%s' ***", mr->search_partial, mr->search_country, mr->search_str);
if (! mr->search_linear) {
while ((leaf=tree_search_next(&mr->ts, &mr->search_p, dir)) != -1) {
dir=town_search_compare(&mr->search_p, mr);
@@ -261,23 +258,23 @@ town_search_get_item(struct map_rect_priv *mr)
}
}
if (! mr->search_linear) {
- dbg(lvl_warning,"not found\n");
+ dbg(lvl_warning,"not found");
return NULL;
}
}
if (! tree_search_next_lin(&mr->ts, &mr->search_p)) {
- dbg(lvl_debug,"linear not found\n");
+ dbg(lvl_debug,"linear not found");
return NULL;
}
if (town_search_compare(&mr->search_p, mr)) {
- dbg(lvl_debug,"no match\n");
+ dbg(lvl_debug,"no match");
return NULL;
}
- dbg(lvl_debug,"found %d blocks\n",mr->search_blk_count);
+ dbg(lvl_debug,"found %d blocks",mr->search_blk_count);
}
if (! mr->search_blk_count)
return NULL;
- dbg(lvl_debug,"block 0x%x offset 0x%x\n", block_offset_get_block(mr->search_blk_off), block_offset_get_offset(mr->search_blk_off));
+ dbg(lvl_debug,"block 0x%x offset 0x%x", block_offset_get_block(mr->search_blk_off), block_offset_get_offset(mr->search_blk_off));
block_get_byindex(mr->m->file[mr->current_file], block_offset_get_block(mr->search_blk_off), &mr->b);
mr->b.p=mr->b.block_start+block_offset_get_offset(mr->search_blk_off);
town_get(mr, &mr->town, &mr->item);
diff --git a/navit/map/mg/tree.c b/navit/map/mg/tree.c
index e456ca87c..4774cf610 100644
--- a/navit/map/mg/tree.c
+++ b/navit/map/mg/tree.c
@@ -78,22 +78,22 @@ tree_search_h(struct file *file, unsigned int search)
struct tree_hdr_h *thdr;
struct tree_leaf_h *tleaf;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
while (i++ < 1000) {
thdr=(struct tree_hdr_h *)p;
p+=sizeof(*thdr);
end=p+tree_hdr_h_get_size(thdr);
- dbg(lvl_debug,"@%td\n", p-file->begin);
+ dbg(lvl_debug,"@%td", p-file->begin);
last=0;
while (p < end) {
tleaf=(struct tree_leaf_h *)p;
p+=sizeof(*tleaf);
- dbg(lvl_debug,"low:0x%x high:0x%x match:0x%x val:0x%x search:0x%x\n", tree_leaf_h_get_lower(tleaf), tree_leaf_h_get_higher(tleaf), tree_leaf_h_get_match(tleaf), tree_leaf_h_get_value(tleaf), search);
+ dbg(lvl_debug,"low:0x%x high:0x%x match:0x%x val:0x%x search:0x%x", tree_leaf_h_get_lower(tleaf), tree_leaf_h_get_higher(tleaf), tree_leaf_h_get_match(tleaf), tree_leaf_h_get_value(tleaf), search);
value=tree_leaf_h_get_value(tleaf);
if (value == search)
return tree_leaf_h_get_match(tleaf);
if (value > search) {
- dbg(lvl_debug,"lower\n");
+ dbg(lvl_debug,"lower");
lower=tree_leaf_h_get_lower(tleaf);
if (lower)
last=lower;
@@ -119,11 +119,11 @@ tree_search_v(struct file *file, int offset, int search)
thdr=(struct tree_hdr_v *)p;
p+=sizeof(*thdr);
count=tree_hdr_v_get_count(thdr);
- dbg(lvl_debug,"offset=%td count=0x%x\n", p-file->begin, count);
+ dbg(lvl_debug,"offset=%td count=0x%x", p-file->begin, count);
while (count--) {
tleaf=(struct tree_leaf_v *)p;
p+=sizeof(*tleaf);
- dbg(lvl_debug,"0x%x 0x%x\n", tleaf->key, search);
+ dbg(lvl_debug,"0x%x 0x%x", tleaf->key, search);
if (tleaf->key == search)
return tree_leaf_v_get_value(tleaf);
}
@@ -142,32 +142,32 @@ tree_search_hv(char *dirname, char *filename, unsigned int search_h, unsigned in
char buffer[4096];
int h,v;
- dbg(lvl_debug,"enter(%s, %s, 0x%x, 0x%x, %p)\n",dirname, filename, search_h, search_v, result);
+ dbg(lvl_debug,"enter(%s, %s, 0x%x, 0x%x, %p)",dirname, filename, search_h, search_v, result);
sprintf(buffer, "%s/%s.h1", dirname, filename);
f_idx_h=file_create_caseinsensitive(buffer, 0);
if ((!f_idx_h) || (!file_mmap(f_idx_h)))
return 0;
sprintf(buffer, "%s/%s.v1", dirname, filename);
f_idx_v=file_create_caseinsensitive(buffer, 0);
- dbg(lvl_debug,"%p %p\n", f_idx_h, f_idx_v);
+ dbg(lvl_debug,"%p %p", f_idx_h, f_idx_v);
if ((!f_idx_v) || (!file_mmap(f_idx_v))) {
file_destroy(f_idx_h);
return 0;
}
if ((h=tree_search_h(f_idx_h, search_h))) {
- dbg(lvl_debug,"h=0x%x\n", h);
+ dbg(lvl_debug,"h=0x%x", h);
if ((v=tree_search_v(f_idx_v, h, search_v))) {
- dbg(lvl_debug,"v=0x%x\n", v);
+ dbg(lvl_debug,"v=0x%x", v);
*result=v;
file_destroy(f_idx_v);
file_destroy(f_idx_h);
- dbg(lvl_debug,"return 1\n");
+ dbg(lvl_debug,"return 1");
return 1;
}
}
file_destroy(f_idx_v);
file_destroy(f_idx_h);
- dbg(lvl_debug,"return 0\n");
+ dbg(lvl_debug,"return 0");
return 0;
}
@@ -183,7 +183,7 @@ tree_search_enter(struct tree_search *ts, int offset)
tsn->end=p+tree_hdr_get_size(tsn->hdr);
tsn->low=tree_hdr_get_low(tsn->hdr);
tsn->high=tree_hdr_get_low(tsn->hdr);
- dbg(lvl_debug,"pos %td addr 0x%ux size 0x%ux low 0x%ux end %tu\n", p-ts->f->begin, tree_hdr_get_addr(tsn->hdr), tree_hdr_get_size(tsn->hdr), tree_hdr_get_low(tsn->hdr), tsn->end-ts->f->begin);
+ dbg(lvl_debug,"pos %td addr 0x%ux size 0x%ux low 0x%ux end %tu", p-ts->f->begin, tree_hdr_get_addr(tsn->hdr), tree_hdr_get_size(tsn->hdr), tree_hdr_get_low(tsn->hdr), tsn->end-ts->f->begin);
return tsn;
}
@@ -193,17 +193,17 @@ int tree_search_next(struct tree_search *ts, unsigned char **p, int dir)
if (! *p)
*p=tsn->p;
- dbg(lvl_debug,"next *p=%p dir=%d\n", *p, dir);
- dbg(lvl_debug,"low1=0x%x high1=0x%x\n", tsn->low, tsn->high);
+ dbg(lvl_debug,"next *p=%p dir=%d", *p, dir);
+ dbg(lvl_debug,"low1=0x%x high1=0x%x", tsn->low, tsn->high);
if (dir <= 0) {
- dbg(lvl_debug,"down 0x%x\n", tsn->low);
+ dbg(lvl_debug,"down 0x%x", tsn->low);
if (tsn->low != 0xffffffff) {
tsn=tree_search_enter(ts, tsn->low);
*p=tsn->p;
tsn->high=get_u32(p);
ts->last_node=ts->curr_node;
- dbg(lvl_debug,"saving last2 %d %td\n", ts->curr_node, tsn->last-ts->f->begin);
- dbg(lvl_debug,"high2=0x%x\n", tsn->high);
+ dbg(lvl_debug,"saving last2 %d %td", ts->curr_node, tsn->last-ts->f->begin);
+ dbg(lvl_debug,"high2=0x%x", tsn->high);
return 0;
}
return -1;
@@ -211,18 +211,18 @@ int tree_search_next(struct tree_search *ts, unsigned char **p, int dir)
tsn->low=tsn->high;
tsn->last=*p;
tsn->high=get_u32_unal(p);
- dbg(lvl_debug,"saving last3 %d %p\n", ts->curr_node, tsn->last);
+ dbg(lvl_debug,"saving last3 %d %p", ts->curr_node, tsn->last);
if (*p < tsn->end)
return (tsn->low == 0xffffffff ? 1 : 0);
- dbg(lvl_debug,"end reached high=0x%x\n",tsn->high);
+ dbg(lvl_debug,"end reached high=0x%x",tsn->high);
if (tsn->low != 0xffffffff) {
- dbg(lvl_debug,"low 0x%x\n", tsn->low);
+ dbg(lvl_debug,"low 0x%x", tsn->low);
tsn=tree_search_enter(ts, tsn->low);
*p=tsn->p;
tsn->high=get_u32_unal(p);
ts->last_node=ts->curr_node;
- dbg(lvl_debug,"saving last4 %d %td\n", ts->curr_node, tsn->last-ts->f->begin);
- dbg(lvl_debug,"high4=0x%x\n", tsn->high);
+ dbg(lvl_debug,"saving last4 %d %td", ts->curr_node, tsn->last-ts->f->begin);
+ dbg(lvl_debug,"high4=0x%x", tsn->high);
return 0;
}
return -1;
@@ -233,7 +233,7 @@ int tree_search_next_lin(struct tree_search *ts, unsigned char **p)
struct tree_search_node *tsn=&ts->nodes[ts->curr_node];
int high;
- dbg(lvl_debug,"pos=%d %td\n", ts->curr_node, *p-ts->f->begin);
+ dbg(lvl_debug,"pos=%d %td", ts->curr_node, *p-ts->f->begin);
if (*p)
ts->nodes[ts->last_node].last=*p;
*p=tsn->last;
@@ -243,12 +243,12 @@ int tree_search_next_lin(struct tree_search *ts, unsigned char **p)
ts->last_node=ts->curr_node;
while (high != 0xffffffff) {
tsn=tree_search_enter(ts, high);
- dbg(lvl_debug,"reload %d\n",ts->curr_node);
+ dbg(lvl_debug,"reload %d",ts->curr_node);
high=tsn->low;
}
return 1;
}
- dbg(lvl_debug,"eon %d %td %td\n", ts->curr_node, *p-ts->f->begin, tsn->end-ts->f->begin);
+ dbg(lvl_debug,"eon %d %td %td", ts->curr_node, *p-ts->f->begin, tsn->end-ts->f->begin);
if (! ts->curr_node)
break;
ts->curr_node--;
diff --git a/navit/map/shapefile/shapefile.c b/navit/map/shapefile/shapefile.c
index e3eb4b723..68c44272d 100644
--- a/navit/map/shapefile/shapefile.c
+++ b/navit/map/shapefile/shapefile.c
@@ -76,7 +76,7 @@ struct map_rect_priv {
static void
map_destroy_shapefile(struct map_priv *m)
{
- dbg(lvl_debug,"map_destroy_shapefile\n");
+ dbg(lvl_debug,"map_destroy_shapefile");
g_free(m);
}
@@ -328,7 +328,7 @@ build_match(struct longest_match *lm, struct longest_match_list *lml, char *line
{
struct longest_match_list_item *lmli;
char *kvl=NULL,*i=NULL,*p,*kv;
- dbg(lvl_debug,"line=%s\n",line);
+ dbg(lvl_debug,"line=%s",line);
kvl=line;
p=strchr(line,'\t');
if (p) {
@@ -424,7 +424,7 @@ attr_resolve(struct map_rect_priv *mr, enum attr_type attr_type, struct attr *at
}
if (!value[0])
return -1;
- dbg(lvl_debug,"name=%s value=%s\n",name,value);
+ dbg(lvl_debug,"name=%s value=%s",name,value);
attr_free(mr->attr);
mr->attr=attr_new_from_text(name,value);
if (mr->attr) {
@@ -524,14 +524,14 @@ map_rect_new_shapefile(struct map_priv *map, struct map_selection *sel)
}
file_destroy(file);
} else {
- dbg(lvl_error,"Failed to open %s\n",dbfmapfile);
+ dbg(lvl_error,"Failed to open %s",dbfmapfile);
if (map->dbfmap_data) {
changed=1;
g_free(map->dbfmap_data);
map->dbfmap_data=NULL;
}
}
- dbg(lvl_debug,"%s changed %d old %p\n",dbfmapfile,changed,map->dbfmap_data);
+ dbg(lvl_debug,"%s changed %d old %p",dbfmapfile,changed,map->dbfmap_data);
if (changed) {
longest_match_destroy(map->lm,1);
map->lm=NULL;
@@ -539,7 +539,7 @@ map_rect_new_shapefile(struct map_priv *map, struct map_selection *sel)
build_matches(map,map->dbfmap_data);
}
}
- dbg(lvl_debug,"map_rect_new_shapefile\n");
+ dbg(lvl_debug,"map_rect_new_shapefile");
mr=g_new0(struct map_rect_priv, 1);
mr->m=map;
mr->idx=0;
@@ -595,12 +595,12 @@ map_rect_get_item_shapefile(struct map_rect_priv *mr)
if (count) {
mr->line=lines[0];
if (attr_from_line(mr->line,"type",NULL,type,NULL)) {
- dbg(lvl_debug,"type='%s'\n", type);
+ dbg(lvl_debug,"type='%s'", type);
mr->item.type=item_from_name(type);
if (mr->item.type == type_none && strcmp(type,"none"))
- dbg(lvl_error,"Warning: type '%s' unknown\n", type);
+ dbg(lvl_error,"Warning: type '%s' unknown", type);
} else {
- dbg(lvl_debug,"failed to get attribute type\n");
+ dbg(lvl_debug,"failed to get attribute type");
}
} else
mr->line=NULL;
@@ -649,7 +649,7 @@ map_new_shapefile(struct map_methods *meth, struct attr **attrs, struct callback
char *shapefile,*dbffile;
if (! data)
return NULL;
- dbg(lvl_debug,"map_new_shapefile %s\n", data->u.str);
+ dbg(lvl_debug,"map_new_shapefile %s", data->u.str);
wdata=g_strdup(data->u.str);
wexp=file_wordexp_new(wdata);
wexp_data=file_wordexp_get_array(wexp);
@@ -665,7 +665,7 @@ map_new_shapefile(struct map_methods *meth, struct attr **attrs, struct callback
m->hDBF=DBFOpen(dbffile, "rb");
m->nFields=DBFGetFieldCount(m->hDBF);
g_free(dbffile);
- dbg(lvl_debug,"map_new_shapefile %s %s\n", m->filename, wdata);
+ dbg(lvl_debug,"map_new_shapefile %s %s", m->filename, wdata);
if (charset) {
m->charset=g_strdup(charset->u.str);
meth->charset=m->charset;
@@ -681,7 +681,7 @@ map_new_shapefile(struct map_methods *meth, struct attr **attrs, struct callback
void
plugin_init(void)
{
- dbg(lvl_debug,"shapefile: plugin_init\n");
+ dbg(lvl_debug,"shapefile: plugin_init");
plugin_register_category_map("shapefile", map_new_shapefile);
}
@@ -759,7 +759,7 @@ static int VSI_SHP_Close( SAFile file )
static void VSI_SHP_Error( const char *message )
{
- dbg(lvl_error,"error:%s\n", message);
+ dbg(lvl_error,"error:%s", message);
}
/************************************************************************/
diff --git a/navit/map/textfile/textfile.c b/navit/map/textfile/textfile.c
index 43be12368..2dbcc1ab4 100644
--- a/navit/map/textfile/textfile.c
+++ b/navit/map/textfile/textfile.c
@@ -54,11 +54,11 @@ get_line(struct map_rect_priv *mr)
else
mr->pos+=mr->lastlen;
fgets(mr->line, TEXTFILE_LINE_SIZE, mr->f);
- dbg(lvl_debug,"read textfile line: %s\n", mr->line);
+ dbg(lvl_debug,"read textfile line: %s", mr->line);
remove_comment_line(mr->line);
mr->lastlen=strlen(mr->line)+1;
if (strlen(mr->line) >= TEXTFILE_LINE_SIZE-1)
- dbg(lvl_error, "line too long: %s\n", mr->line);
+ dbg(lvl_error, "line too long: %s", mr->line);
}
}
@@ -94,12 +94,12 @@ textfile_coord_get(void *priv_data, struct coord *c, int count)
{
struct map_rect_priv *mr=priv_data;
int ret=0;
- dbg(lvl_warning,"enter, count: %d\n",count);
+ dbg(lvl_warning,"enter, count: %d",count);
while (count--) {
if (mr->f && !feof(mr->f) && (!mr->item.id_hi || !mr->eoc) && parse_line(mr, mr->item.id_hi)) {
if (c){
*c=mr->c;
- dbg(lvl_debug,"c=0x%x,0x%x\n", c->x, c->y);
+ dbg(lvl_debug,"c=0x%x,0x%x", c->x, c->y);
c++;
}
ret++;
@@ -138,7 +138,7 @@ textfile_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
char *str=NULL;
dbg(lvl_debug,"mr=%p attrs='%s' ", mr, mr->attrs);
if (attr_type != mr->attr_last) {
- dbg(lvl_debug,"reset attr_pos\n");
+ dbg(lvl_debug,"reset attr_pos");
mr->attr_pos=0;
mr->attr_last=attr_type;
}
@@ -146,7 +146,7 @@ textfile_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
dbg(lvl_debug,"attr_any");
if (attr_from_line(mr->attrs,NULL,&mr->attr_pos,mr->attr, mr->attr_name)) {
attr_type=attr_from_name(mr->attr_name);
- dbg(lvl_debug,"found attr '%s' 0x%x\n", mr->attr_name, attr_type);
+ dbg(lvl_debug,"found attr '%s' 0x%x", mr->attr_name, attr_type);
attr->type=attr_type;
textfile_encode_attr(mr->attr, attr_type, attr);
return 1;
@@ -156,11 +156,11 @@ textfile_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
dbg(lvl_debug,"attr='%s' ",str);
if (attr_from_line(mr->attrs,str,&mr->attr_pos,mr->attr, NULL)) {
textfile_encode_attr(mr->attr, attr_type, attr);
- dbg(lvl_debug,"found\n");
+ dbg(lvl_debug,"found");
return 1;
}
}
- dbg(lvl_debug,"not found\n");
+ dbg(lvl_debug,"not found");
return 0;
}
@@ -176,7 +176,7 @@ map_rect_new_textfile(struct map_priv *map, struct map_selection *sel)
{
struct map_rect_priv *mr;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
mr=g_new0(struct map_rect_priv, 1);
mr->m=map;
mr->sel=sel;
@@ -204,20 +204,20 @@ map_rect_new_textfile(struct map_priv *map, struct map_selection *sel)
}
sel=sel->next;
}
- dbg(lvl_debug,"popen args %s\n", args);
+ dbg(lvl_debug,"popen args %s", args);
mr->args=args;
mr->f=popen(mr->args, "r");
mr->pos=0;
mr->lastlen=0;
#else
- dbg(lvl_error,"unable to work with pipes %s\n",map->filename);
+ dbg(lvl_error,"unable to work with pipes %s",map->filename);
#endif
} else {
mr->f=fopen(map->filename, "r");
}
if(!mr->f) {
if (!(errno == ENOENT && map->no_warning_if_map_file_missing)) {
- dbg(lvl_error, "error opening textfile %s: %s\n", map->filename, strerror(errno));
+ dbg(lvl_error, "error opening textfile %s: %s", map->filename, strerror(errno));
}
}
get_line(mr);
@@ -255,7 +255,7 @@ map_rect_get_item_textfile(struct map_rect_priv *mr)
}
for(;;) {
if (feof(mr->f)) {
- dbg(lvl_debug,"map_rect_get_item_textfile: eof %d\n",mr->item.id_hi);
+ dbg(lvl_debug,"map_rect_get_item_textfile: eof %d",mr->item.id_hi);
if (mr->m->flags & 1) {
if (!mr->item.id_hi)
return NULL;
@@ -286,7 +286,7 @@ map_rect_get_item_textfile(struct map_rect_priv *mr)
get_line(mr);
continue;
}
- dbg(lvl_debug,"map_rect_get_item_textfile: point found\n");
+ dbg(lvl_debug,"map_rect_get_item_textfile: point found");
mr->eoc=0;
mr->item.id_lo=mr->pos;
} else {
@@ -294,7 +294,7 @@ map_rect_get_item_textfile(struct map_rect_priv *mr)
get_line(mr);
continue;
}
- dbg(lvl_debug,"map_rect_get_item_textfile: line found\n");
+ dbg(lvl_debug,"map_rect_get_item_textfile: line found");
if (! mr->line[0]) {
get_line(mr);
continue;
@@ -302,21 +302,21 @@ map_rect_get_item_textfile(struct map_rect_priv *mr)
mr->item.id_lo=mr->pos;
strcpy(mr->attrs, mr->line);
get_line(mr);
- dbg(lvl_debug,"mr=%p attrs=%s\n", mr, mr->attrs);
+ dbg(lvl_debug,"mr=%p attrs=%s", mr, mr->attrs);
}
- dbg(lvl_debug,"get_attrs %s\n", mr->attrs);
+ dbg(lvl_debug,"get_attrs %s", mr->attrs);
if (attr_from_line(mr->attrs,"type",NULL,type,NULL)) {
- dbg(lvl_debug,"type='%s'\n", type);
+ dbg(lvl_debug,"type='%s'", type);
mr->item.type=item_from_name(type);
if (mr->item.type == type_none)
- dbg(lvl_error, "Warning: type '%s' unknown\n", type);
+ dbg(lvl_error, "Warning: type '%s' unknown", type);
} else {
get_line(mr);
continue;
}
mr->attr_last=attr_none;
mr->more=1;
- dbg(lvl_debug,"return attr='%s'\n", mr->attrs);
+ dbg(lvl_debug,"return attr='%s'", mr->attrs);
return &mr->item;
}
}
@@ -362,7 +362,7 @@ map_new_textfile(struct map_methods *meth, struct attr **attrs, struct callback_
char **wexp_data;
if (! data)
return NULL;
- dbg(lvl_debug,"map_new_textfile %s\n", data->u.str);
+ dbg(lvl_debug,"map_new_textfile %s", data->u.str);
wdata=g_strdup(data->u.str);
len=strlen(wdata);
if (len && wdata[len-1] == '|') {
@@ -380,7 +380,7 @@ map_new_textfile(struct map_methods *meth, struct attr **attrs, struct callback_
m->no_warning_if_map_file_missing=(no_warn!=NULL) && (no_warn->u.num);
if (flags)
m->flags=flags->u.num;
- dbg(lvl_debug,"map_new_textfile %s %s\n", m->filename, wdata);
+ dbg(lvl_debug,"map_new_textfile %s %s", m->filename, wdata);
if (charset) {
m->charset=g_strdup(charset->u.str);
meth->charset=m->charset;
@@ -393,7 +393,7 @@ map_new_textfile(struct map_methods *meth, struct attr **attrs, struct callback_
void
plugin_init(void)
{
- dbg(lvl_debug,"textfile: plugin_init\n");
+ dbg(lvl_debug,"textfile: plugin_init");
plugin_register_category_map("textfile", map_new_textfile);
}
diff --git a/navit/maps.c b/navit/maps.c
index 628713dd2..91a85bcd5 100644
--- a/navit/maps.c
+++ b/navit/maps.c
@@ -32,14 +32,14 @@ maps_new(struct attr *parent, struct attr **attrs)
{
struct attr *data,**attrs_dup;
if (!parent) {
- dbg(lvl_error,"No parent\n");
+ dbg(lvl_error,"No parent");
return NULL;
}
if (parent->type != attr_mapset) {
- dbg(lvl_error,"Parent must be mapset\n");
+ dbg(lvl_error,"Parent must be mapset");
return NULL;
}
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
attrs_dup=attr_list_dup(attrs);
data=attr_search(attrs_dup, NULL, attr_data);
if (data) {
@@ -79,7 +79,7 @@ maps_new(struct attr *parent, struct attr **attrs)
}
file_wordexp_destroy(wexp);
} else {
- dbg(lvl_error,"no data attribute\n");
+ dbg(lvl_error,"no data attribute");
}
attr_list_free(attrs_dup);
return NULL;
diff --git a/navit/mapset.c b/navit/mapset.c
index 6c3d0b5d1..82ab30edf 100644
--- a/navit/mapset.c
+++ b/navit/mapset.c
@@ -310,7 +310,7 @@ struct mapset_search *
mapset_search_new(struct mapset *ms, struct item *item, struct attr *search_attr, int partial)
{
struct mapset_search *this;
- dbg(lvl_debug,"enter(%p,%p,%p,%d)\n", ms, item, search_attr, partial);
+ dbg(lvl_debug,"enter(%p,%p,%p,%d)", ms, item, search_attr, partial);
this=g_new0(struct mapset_search,1);
if(this != NULL && ms!=NULL )
{
diff --git a/navit/maptool/boundaries.c b/navit/maptool/boundaries.c
index 605b6fb7b..75e1d2479 100644
--- a/navit/maptool/boundaries.c
+++ b/navit/maptool/boundaries.c
@@ -308,37 +308,6 @@ process_boundaries_finish(GList *boundaries_list)
}
}
-#if 0
- printf("hierarchy\n");
-#endif
-#if 0
- boundaries_list=g_list_sort(boundaries_list, boundary_bbox_compare);
- l=boundaries_list;
- while (l) {
- struct boundary *boundary=l->data;
- GList *l2,*ln;
- ln=l2=g_list_next(l);
- while (l2) {
- struct boundary *boundary2=l2->data;
- if (bbox_contains_bbox(&boundary2->r, &boundary->r)) {
- boundaries_list=g_list_remove(boundaries_list, boundary);
- boundary2->children=g_list_append(boundary2->children, boundary);
-#if 0
- printf("found\n");
-#endif
- break;
- }
- l2=g_list_next(l2);
- }
- l=ln;
- }
- dump_hierarchy(boundaries_list,"");
-#if 0
- printf("hierarchy done\n");
- printf("test\n");
- test(boundaries_list);
-#endif
-#endif
return ret;
}
diff --git a/navit/maptool/ch.c b/navit/maptool/ch.c
index be0f22b48..59a4b7db2 100644
--- a/navit/maptool/ch.c
+++ b/navit/maptool/ch.c
@@ -262,9 +262,6 @@ ch_process_node(FILE *out, int node, int resolve)
memset(&ch_edge, 0, sizeof(ch_edge));
item_bin=init_item(type_ch_node);
oldnode=GPOINTER_TO_INT(g_hash_table_lookup(newnode_hash, GINT_TO_POINTER(node)));
-#if 0
- dbg(lvl_debug,"0x%x,0x%x\n",node_index[oldnode].x,node_index[oldnode].y);
-#endif
item_bin_add_coord(item_bin, &node_index[oldnode], 1);
fwd.first=oldnode;
rev.last=oldnode;
@@ -289,23 +286,14 @@ ch_process_node(FILE *out, int node, int resolve)
exit(1);
} else {
ch_edge.middle=*id;
-#if 0
- dbg(lvl_debug,"middle street id for is "ITEM_ID_FMT"\n",ITEM_ID_ARGS(*id));
-#endif
}
} else {
ch_edge.flags|=4;
id=g_hash_table_lookup(sgr_nodes_hash, GINT_TO_POINTER((int)edge->scmiddle));
dbg_assert(id != NULL);
ch_edge.middle=*id;
-#if 0
- dbg(lvl_debug,"middle node id for is "ITEM_ID_FMT"\n",ITEM_ID_ARGS(*id));
-#endif
}
id=g_hash_table_lookup(sgr_nodes_hash, GINT_TO_POINTER((int)edge->target));
-#if 0
- dbg(lvl_debug,"id for %d is "ITEM_ID_FMT"\n",edge->target,ITEM_ID_ARGS(*id));
-#endif
if (id == NULL) {
fprintf(stderr,"Failed to look up target %d\n",edge->target);
} else {
@@ -521,9 +509,6 @@ ch_assemble_map(char *map_suffix, char *suffix, struct zip_info *zip_info)
while (fread(&id, sizeof(id), 1, ref)) {
struct item_id *id2=g_slice_new(struct item_id);
*id2=id;
-#if 0
- dbg(lvl_debug,"%d is "ITEM_ID_FMT"\n",nodeid,ITEM_ID_ARGS(*id2));
-#endif
g_hash_table_insert(sgr_nodes_hash, GINT_TO_POINTER(nodeid), id2);
nodeid++;
}
diff --git a/navit/maptool/coastline.c b/navit/maptool/coastline.c
index 4e17fd652..5de56f5b2 100644
--- a/navit/maptool/coastline.c
+++ b/navit/maptool/coastline.c
@@ -52,11 +52,11 @@ find_next(struct rect *bbox, GList *segments, struct coord *c, int exclude, stru
for (i = 0 ; i < 2 ; i++) {
curr=segments;
- dbg(lvl_debug,"search distance %d\n",search);
+ dbg(lvl_debug,"search distance %d",search);
while (curr) {
struct geom_poly_segment *seg=curr->data;
int dist=distance_from_ll(seg->first, bbox);
- dbg(lvl_debug,"0x%x 0x%x dist %d\n",seg->first->x,seg->first->y,dist);
+ dbg(lvl_debug,"0x%x 0x%x dist %d",seg->first->x,seg->first->y,dist);
if (dist != -1 && seg->first != seg->last && dist < min && (dist >= search)) {
min=dist;
ci[0]=*seg->first;
@@ -86,14 +86,8 @@ close_polygon(struct item_bin *ib, struct coord *from, struct coord *to, int dir
fromdist=distance_from_ll(to, bbox);
todist=distance_from_ll(from, bbox);
}
-#if 0
- fprintf(stderr,"close_polygon fromdist %d todist %d full %d dir %d\n", fromdist, todist, full, dir);
-#endif
if (fromdist > todist)
todist+=full;
-#if 0
- fprintf(stderr,"close_polygon corrected fromdist %d todist %d full %d dir %d\n", fromdist, todist, full, dir);
-#endif
for (i = 0 ; i < 8 ; i++) {
if (dir > 0)
e=i;
@@ -118,14 +112,8 @@ close_polygon(struct item_bin *ib, struct coord *from, struct coord *to, int dir
dist=distance_from_ll(&c, bbox);
if (e & 4)
dist+=full;
-#if 0
- fprintf(stderr,"dist %d %d\n",e,dist);
-#endif
if (dist > fromdist && dist < todist) {
item_bin_add_coord(ib, &c, 1);
-#if 0
- fprintf(stderr,"add\n");
-#endif
}
if (dist >= fromdist && dist <= todist) {
if (!corners)
@@ -161,9 +149,6 @@ tile_data_to_segments(int *tile_data)
curr+=ib->len+1;
count++;
}
-#if 0
- fprintf(stderr,"%d segments\n",count);
-#endif
return segments;
}
@@ -181,42 +166,12 @@ tile_collector_process_tile(char *tile, int *tile_data, struct coastline_tile_da
struct item_bin *ibt=(struct item_bin *)(tile_data+1);
struct coastline_tile *ct=g_new0(struct coastline_tile, 1);
ct->wayid=item_bin_get_wayid(ibt);
-#if 0
- if (strncmp(tile,"bcdbdcabddddba",7))
- return;
-#endif
-#if 0
- if (strncmp(tile,"bcdbdcaaaaddba",14))
- return;
-#endif
-#if 0
- fprintf(stderr,"tile %s of size %d\n", tile, *tile_data);
-#endif
tile_bbox(tile, &bbox, 0);
curr=tile_data_to_segments(tile_data);
sorted_segments=geom_poly_segments_sort(curr, geom_poly_segment_type_way_right_side);
g_list_foreach(curr,(GFunc)geom_poly_segment_destroy,NULL);
g_list_free(curr);
-#if 0
-{
- GList *sort_segments=sorted_segments;
- int count=0;
- while (sort_segments) {
- struct geom_poly_segment *seg=sort_segments->data;
- struct item_bin *ib=(struct item_bin *)buffer;
- char *text=g_strdup_printf("segment %d type %d %p %s area "LONGLONG_FMT,count++,seg->type,sort_segments,coord_is_equal(*seg->first, *seg->last) ? "closed":"open",geom_poly_area(seg->first,seg->last-seg->first+1));
- item_bin_init(ib, type_rg_segment);
- item_bin_add_coord(ib, seg->first, seg->last-seg->first+1);
- item_bin_add_attr_string(ib, attr_debug, text);
- // fprintf(stderr,"%s\n",text);
- g_free(text);
- // item_bin_dump(ib, stderr);
- item_bin_write_to_sink(ib, out, NULL);
- sort_segments=g_list_next(sort_segments);
- }
-}
-#endif
flags=0;
curr=sorted_segments;
while (curr) {
@@ -243,7 +198,6 @@ tile_collector_process_tile(char *tile, int *tile_data, struct coastline_tile_da
g_hash_table_insert(data->tile_edges, g_strdup(tile), ct);
return;
}
-#if 1
end=bbox.l;
tile_start_valid=0;
poly_start_valid=0;
@@ -255,7 +209,7 @@ tile_collector_process_tile(char *tile, int *tile_data, struct coastline_tile_da
for (;;) {
search++;
// item_bin_write_debug_point_to_sink(out, &end, "Search %d",search);
- dbg(lvl_debug,"searching next polygon from 0x%x 0x%x\n",end.x,end.y);
+ dbg(lvl_debug,"searching next polygon from 0x%x 0x%x",end.x,end.y);
first=find_next(&bbox, sorted_segments, &end, exclude, cn);
exclude=1;
if (!first)
@@ -265,7 +219,7 @@ tile_collector_process_tile(char *tile, int *tile_data, struct coastline_tile_da
tile_start_valid=1;
} else {
if (cn[0].x == tile_start.x && cn[0].y == tile_start.y) {
- dbg(lvl_debug,"end of tile reached\n");
+ dbg(lvl_debug,"end of tile reached");
break;
}
}
@@ -274,7 +228,7 @@ tile_collector_process_tile(char *tile, int *tile_data, struct coastline_tile_da
continue;
}
poly_start_valid=0;
- dbg(lvl_debug,"start of polygon 0x%x 0x%x\n",cn[0].x,cn[0].y);
+ dbg(lvl_debug,"start of polygon 0x%x 0x%x",cn[0].x,cn[0].y);
for (;;) {
if (!poly_start_valid) {
poly_start=cn[0];
@@ -283,7 +237,7 @@ tile_collector_process_tile(char *tile, int *tile_data, struct coastline_tile_da
} else {
close_polygon(ib, &end, &cn[0], 1, &bbox, &edges);
if (cn[0].x == poly_start.x && cn[0].y == poly_start.y) {
- dbg(lvl_debug,"poly end reached\n");
+ dbg(lvl_debug,"poly end reached");
item_bin_add_attr_longlong(ib, attr_osm_wayid, ct->wayid);
item_bin_write_to_sink(ib, out, NULL);
end=cn[0];
@@ -296,60 +250,20 @@ tile_collector_process_tile(char *tile, int *tile_data, struct coastline_tile_da
first->type=geom_poly_segment_type_none;
end=cn[1];
if (distance_from_ll(&end, &bbox) == -1) {
- dbg(lvl_debug,"incomplete\n");
+ dbg(lvl_debug,"incomplete");
break;
}
first=find_next(&bbox, sorted_segments, &end, 1, cn);
- dbg(lvl_debug,"next segment of polygon 0x%x 0x%x\n",cn[0].x,cn[0].y);
+ dbg(lvl_debug,"next segment of polygon 0x%x 0x%x",cn[0].x,cn[0].y);
}
if (search > 55)
break;
}
g_list_foreach(sorted_segments,(GFunc)geom_poly_segment_destroy,NULL);
g_list_free(sorted_segments);
-#endif
-#if 0
- {
- int *end=tile_data+tile_data[0];
- int *curr=tile_data+1;
- while (curr < end) {
- struct item_bin *ib=(struct item_bin *)curr;
- // item_bin_dump(ib);
- ib->type=type_rg_segment;
- item_bin_write_to_sink(ib, out, NULL);
- curr+=ib->len+1;
-#if 0
- {
- struct coord *c[2];
- int i;
- char *s;
- c[0]=(struct coord *)(ib+1);
- c[1]=c[0]+ib->clen/2-1;
- for (i = 0 ; i < 2 ; i++) {
- s=coord_to_str(c[i]);
- item_bin_write_debug_point_to_sink(out, c[i], "%s",s);
- g_free(s);
- }
-
- }
-#endif
- }
- }
-#endif
ct->edges=edges;
g_hash_table_insert(data->tile_edges, g_strdup(tile), ct);
-#if 0
- item_bin_init(ib, type_border_country);
- item_bin_bbox(ib, &bbox);
- item_bin_add_attr_string(ib, attr_debug, tile);
- item_bin_write_to_sink(ib, out, NULL);
-#endif
-#if 0
- c.x=(bbox.l.x+bbox.h.x)/2;
- c.y=(bbox.l.y+bbox.h.y)/2;
- item_bin_write_debug_point_to_sink(out, &c, "%s %d",tile,edges);
-#endif
}
static void
@@ -377,20 +291,6 @@ ocean_tile(GHashTable *hash, char *tile, char c, osmid wayid, struct item_bin_si
ct->edges=15;
ct->wayid=wayid;
g_hash_table_insert(hash, g_strdup(tile2), ct);
-#if 0
- item_bin_init(ib, type_border_country);
- item_bin_bbox(ib, &bbox);
- item_bin_add_attr_string(ib, attr_debug, tile2);
- item_bin_write_to_sink(ib, out, NULL);
-#endif
-#if 0
- {
- struct coord co;
- co.x=(bbox.l.x+bbox.h.x)/2;
- co.y=(bbox.l.y+bbox.h.y)/2;
- item_bin_write_debug_point_to_sink(out, &co, "%s 15",tile2);
- }
-#endif
}
/* ba */
@@ -404,10 +304,6 @@ tile_collector_add_siblings(char *tile, struct coastline_tile *ct, struct coastl
struct item_bin_sink *out=data->sink->priv_data[1];
int edges=ct->edges;
int debug=0;
-#if 0
- if (!strncmp(tile,"bcacccaadbdcd",10))
- debug=1;
-#endif
if (debug)
fprintf(stderr,"%s (%c) has %d edges active\n",tile,t,edges);
if (t == 'a' && (edges & 1))
@@ -489,10 +385,6 @@ tile_collector_add_siblings2(char *tile, struct coastline_tile *ct, struct coast
char t=tile[len-1];
strcpy(tile2, tile);
tile2[len-1]='\0';
-#if 0
- if (!strncmp(tile,"bcacccaadbdcd",10))
- debug=1;
-#endif
if (debug)
fprintf(stderr,"len of %s %d vs %d\n",tile,len,data->level);
@@ -593,15 +485,6 @@ tile_collector_finish(struct item_bin_sink_func *tile_collector)
foreach_tile(&data, tile_collector_add_siblings2);
fprintf(stderr,"*\n");
}
-#if 0
- data.level=13;
- g_hash_table_foreach(data.tile_edges, tile_collector_add_siblings, &data);
- g_hash_table_foreach(data.tile_edges, tile_collector_add_siblings, &data);
- g_hash_table_foreach(data.tile_edges, tile_collector_add_siblings2, &data);
- data.level=12;
- g_hash_table_foreach(data.tile_edges, tile_collector_add_siblings, &data);
- g_hash_table_foreach(data.tile_edges, tile_collector_add_siblings, &data);
-#endif
item_bin_sink_func_destroy(tile_collector);
fprintf(stderr,"tile_collector_finish done\n");
return 0;
@@ -611,14 +494,6 @@ tile_collector_finish(struct item_bin_sink_func *tile_collector)
static int
coastline_processor_process(struct item_bin_sink_func *func, struct item_bin *ib, struct tile_data *tile_data)
{
-#if 0
- int i;
- struct coord *c=(struct coord *)(ib+1);
- for (i = 0 ; i < 19 ; i++) {
- c[i]=c[i+420];
- }
- ib->clen=(i-1)*2;
-#endif
item_bin_write_clipped(ib, func->priv_data[0], func->priv_data[1]);
return 0;
}
diff --git a/navit/maptool/itembin.c b/navit/maptool/itembin.c
index 98b0c52a6..0c62eb205 100644
--- a/navit/maptool/itembin.c
+++ b/navit/maptool/itembin.c
@@ -520,19 +520,8 @@ item_bin_sort_compare(const void *p1, const void *p2)
if(ret)
return ret;
}
-#if 0
- dbg_assert(ib1->clen==2);
- dbg_assert(ib2->clen==2);
- attr1=(struct attr_bin *)((int *)(ib1+1)+ib1->clen);
- attr2=(struct attr_bin *)((int *)(ib2+1)+ib1->clen);
-#else
attr1=item_bin_get_attr_bin_last(ib1);
attr2=item_bin_get_attr_bin_last(ib2);
-#endif
-#if 0
- dbg_assert(attr1->type == attr_town_name || attr1->type == attr_town_name_match);
- dbg_assert(attr2->type == attr_town_name || attr2->type == attr_town_name_match);
-#endif
s1=(char *)(attr1+1);
s2=(char *)(attr2+1);
if (attr1->type == attr_house_number && attr2->type == attr_house_number) {
@@ -554,9 +543,6 @@ item_bin_sort_compare(const void *p1, const void *p2)
match2=(attr2->type == attr_town_name_match || attr2->type == attr_district_name_match);
ret=match1-match2;
}
-#if 0
- fprintf(stderr,"sort_countries_compare p1=%p p2=%p %s %s\n",p1,p2,s1,s2);
-#endif
return ret;
}
diff --git a/navit/maptool/osm.c b/navit/maptool/osm.c
index 1613f2e56..c6d1fa6df 100644
--- a/navit/maptool/osm.c
+++ b/navit/maptool/osm.c
@@ -1470,10 +1470,6 @@ node_item_find_index_in_ordered_list(osmid id)
if (node_buffer_base[node_count-1].nd_id < id)
return -1;
while (node_buffer_base[search_index].nd_id != id) {
-#if 0
- fprintf(stderr,"search_index=%d node_count=%d search_step=%d id=%d node_buffer_base[search_index].id=%d\n",
- search_index, node_count, search_step, id, node_buffer_base[search_index].id);
-#endif
if (node_buffer_base[search_index].nd_id < id) {
search_index+=search_step;
if (search_step == 1) {
@@ -1721,9 +1717,6 @@ static void
relation_add_tag(char *k, char *v)
{
int add_tag=1;
-#if 0
- fprintf(stderr,"add tag %s %s\n",k,v);
-#endif
if (!strcmp(k,"type")) {
g_strlcpy(relation_type, v, sizeof(relation_type));
add_tag=0;
@@ -3201,17 +3194,9 @@ write_item_way_subsection(FILE *out, FILE *out_index, FILE *out_graph, struct it
new.len=new.clen+attr_len+2;
if (out_index)
write_item_way_subsection_index(out, out_index, out_graph, orig, last_id);
-#if 0
- fprintf(stderr,"first %d last %d type 0x%x len %d clen %d attr_len %d\n", first, last, new.type, new.len, new.clen, attr_len);
-#endif
dbg_assert(fwrite(&new, sizeof(new), 1, out)==1);
dbg_assert(fwrite(c+first, new.clen*4, 1, out)==1);
dbg_assert(fwrite(attr, attr_len*4, 1, out)==1);
-#if 0
- fwrite(&new, sizeof(new), 1, out_graph);
- fwrite(c+first, new.clen*4, 1, out_graph);
- fwrite(attr, attr_len*4, 1, out_graph);
-#endif
}
void
@@ -3302,9 +3287,6 @@ map_resolve_coords_and_split_at_intersections(FILE *in, FILE *out, FILE *out_ind
processed_nodes=processed_nodes_out=processed_ways=processed_relations=processed_tiles=0;
sig_alrm(0);
while ((ib=read_item(in))) {
-#if 0
- fprintf(stderr,"type 0x%x len %d clen %d\n", ib->type, ib->len, ib->clen);
-#endif
ccount=ib->clen/2;
if (ccount <= 1)
continue;
diff --git a/navit/maptool/osm_protobuf.c b/navit/maptool/osm_protobuf.c
index 1b4294a70..d75bca8b5 100644
--- a/navit/maptool/osm_protobuf.c
+++ b/navit/maptool/osm_protobuf.c
@@ -184,15 +184,9 @@ process_tag(OSMPBF__PrimitiveBlock *primitive_block, int key, int val)
{
char keybuff[1024];
char valbuff[1024];
-#if 0
- get_string(keybuff, sizeof(keybuff), primitive_block, key, 1);
- get_string(valbuff, sizeof(valbuff), primitive_block, val, 1);
- printf("\t\t<tag k=\"%s\" v=\"%s\" />\n",keybuff,valbuff);
-#else
get_string(keybuff, sizeof(keybuff), primitive_block, key, 0);
get_string(valbuff, sizeof(valbuff), primitive_block, val, 0);
osm_add_tag(keybuff, valbuff);
-#endif
}
@@ -216,26 +210,12 @@ process_dense(OSMPBF__PrimitiveBlock *primitive_block, OSMPBF__DenseNodes *dense
timestamp+=dense->denseinfo->timestamp[i];
has_tags=dense->keys_vals && dense->keys_vals[j];
osm_add_node(id, lat/latlon_scale,lon/latlon_scale);
-#if 0
- printf("\t<node id=\"%Ld\" lat=\"%.7f\" lon=\"%.7f\" version=\"%d\" changeset=\"%Ld\"",id,lat/latlon_scale,lon/latlon_scale,dense->denseinfo->version[i],changeset);
- process_user(primitive_block, user_sid, uid, 0);
- process_timestamp(timestamp);
-#endif
if (has_tags) {
-#if 0
- printf(">\n");
-#endif
while (dense->keys_vals[j]) {
process_tag(primitive_block, dense->keys_vals[j], dense->keys_vals[j+1]);
j+=2;
}
-#if 0
- printf("\t</node>\n");
- } else
- printf("/>\n");
-#else
}
-#endif
osm_end_node(osm);
j++;
}
@@ -258,25 +238,12 @@ process_way(OSMPBF__PrimitiveBlock *primitive_block, OSMPBF__Way *way, struct ma
long long ref=0;
osm_add_way(way->id);
-#if 0
- printf("\t<way id=\"%Ld\"",way->id);
- process_info(primitive_block, way->info);
- printf(">\n");
-#else
-#endif
for (i = 0 ; i < way->n_refs ; i++) {
ref+=way->refs[i];
osm_add_nd(ref);
-#if 0
- printf("\t\t<nd ref=\"%Ld\"/>\n",ref);
-#else
-#endif
}
for (i = 0 ; i < way->n_keys ; i++)
process_tag(primitive_block, way->keys[i], way->vals[i]);
-#if 0
- printf("\t</way>\n");
-#endif
osm_end_way(osm);
}
@@ -287,45 +254,15 @@ process_relation(OSMPBF__PrimitiveBlock *primitive_block, OSMPBF__Relation *rela
long long ref=0;
char rolebuff[1024];
-#if 0
- printf("\t<relation id=\"%Ld\"",relation->id);
- process_info(primitive_block, relation->info);
- printf(">\n");
-#endif
osm_add_relation(relation->id);
for (i = 0 ; i < relation->n_roles_sid ; i++) {
-#if 0
- printf("\t\t<member type=\"");
- switch (relation->types[i]) {
- case 0:
- printf("node");
- break;
- case 1:
- printf("way");
- break;
- case 2:
- printf("relation");
- break;
- default:
- printf("unknown");
- break;
- }
-#endif
ref+=relation->memids[i];
get_string(rolebuff, sizeof(rolebuff), primitive_block, relation->roles_sid[i], 1);
-#if 0
- printf("\" ref=\"%Ld\" role=\"%s\"/>\n",ref,rolebuff);
-#else
osm_add_member(relation->types[i]+1,ref,rolebuff);
-#endif
}
for (i = 0 ; i < relation->n_keys ; i++)
process_tag(primitive_block, relation->keys[i], relation->vals[i]);
-#if 0
- printf("\t</relation>\n");
-#else
osm_end_relation(osm);
-#endif
}
static void
@@ -341,9 +278,6 @@ process_osmdata(OSMPBF__Blob *blob, unsigned char *data, struct maptool_osm *osm
process_way(primitive_block, primitive_group->ways[j], osm);
for (j = 0 ; j < primitive_group->n_relations ; j++)
process_relation(primitive_block, primitive_group->relations[j], osm);
-#if 0
- printf("Group %p %d %d %d %d\n",primitive_group->dense,primitive_group->n_nodes,primitive_group->n_ways,primitive_group->n_relations,primitive_group->n_changesets);
-#endif
}
osmpbf__primitive_block__free_unpacked(primitive_block, &protobuf_c_system_allocator);
}
@@ -357,10 +291,6 @@ map_collect_data_osm_protobuf(FILE *in, struct maptool_osm *osm)
unsigned char *data;
unsigned char *buffer=g_malloc(MAX_BLOB_LENGTH);
-#if 0
- printf("<?xml version='1.0' encoding='UTF-8'?>\n");
- printf("<osm version=\"0.6\" generator=\"pbf2osm\">\n");
-#endif
while ((header=read_header(in))) {
blob=read_blob(header, in, buffer);
data=uncompress_blob(blob);
@@ -378,8 +308,5 @@ map_collect_data_osm_protobuf(FILE *in, struct maptool_osm *osm)
osmpbf__blob_header__free_unpacked(header, &protobuf_c_system_allocator);
}
g_free(buffer);
-#if 0
- printf("</osm>\n");
-#endif
return 1;
}
diff --git a/navit/maptool/osm_protobufdb.c b/navit/maptool/osm_protobufdb.c
index 463817037..51cdceae4 100644
--- a/navit/maptool/osm_protobufdb.c
+++ b/navit/maptool/osm_protobufdb.c
@@ -464,86 +464,13 @@ osm_protobufdb_start_file(struct osm_protobufdb_context *ctx, int type, int num)
static void
test(void)
{
-#if 0
- struct node n,o;
- long long id=1;
- long long lat=0;
- long long lon=0;
- long long timestamp=0;
- long long changeset=0;
- int version=1;
- int user_sid=0;
- int uid=0;
- int p;
- n.id=1;
-#endif
-#if 0
- OSMPBF__DenseInfo di=OSMPBF__DENSE_INFO__INIT;
- OSMPBF__DenseNodes dn=OSMPBF__DENSE_NODES__INIT;
-#endif
-
context.current_file=-1;
-
-#if 0
- context.di=g_malloc(sizeof(*context.di));
- *context.di=di;
- context.dn=g_malloc(sizeof(*context.dn));
- *context.dn=dn;
-#endif
-
-#if 0
- di.n_version=1;
- di.version=&version;
- di.n_timestamp=1;
- di.timestamp=&timestamp;
- di.n_changeset=1;
- di.changeset=&changeset;
- di.n_user_sid=1;
- di.user_sid=&user_sid;
- di.n_uid=1;
- di.uid=&uid;
-#endif
-#if 0
- n.id=1;
- n.lat=1;
- n.lon=1;
- n.timestamp=1;
- n.changeset=1;
- n.version=1;
- n.user_sid=0;
- n.uid=0;
- p=osm_protobufdb_insert_densenode(&n.id, &o, &dn);
- osm_protobufdb_modify(&n, &o, p, &dn);
- p=osm_protobufdb_insert_densenode(&n.id, &o, &dn);
- osm_protobufdb_modify(&n, &o, p, &dn);
-#endif
-
-
-#if 0
- dn.n_id=1;
- dn.id=&id;
- dn.n_lat=1;
- dn.lat=&lat;
- dn.n_lon=1;
- dn.lon=&lon;
-#endif
-#if 0
- st.n_s=1;
- data.data="Test";
- data.len=4;
- st.s=&data;
-#endif
}
static void
finish(void)
{
osm_protobufdb_finish_file(&context);
-#if 0
- osm_protobufdb_write_primitive_group(context.pg, context.pb);
- osm_protobufdb_write_primitive_block(context.pb, context.blob);
- osm_protobufdb_write_blob_to_file();
-#endif
}
static long long
@@ -632,16 +559,8 @@ static int
osm_protobufdb_end_node(struct osm_protobufdb_context *ctx)
{
int p;
-#if 0
- OSMPBF__Node *n=&ctx->n,offset;
- OSMPBF__Info *i=&ctx->i,offseti;
- osm_protobufdb_start_densenode(ctx);
- p=osm_protobufdb_insert_densenode(n->id, &offset, &offseti, context.dn);
- osm_protobufdb_modify_densenode(n, i, &offset, &offseti, p, context.dn);
-#else
p=osm_protobufdb_insert_node(ctx->n.id, ctx->pg);
osm_protobufdb_modify_node(&ctx->n, &ctx->i, p, ctx->pg);
-#endif
ctx->in_node=0;
return 1;
}
diff --git a/navit/maptool/tile.c b/navit/maptool/tile.c
index 6f61b9471..fc8f39076 100644
--- a/navit/maptool/tile.c
+++ b/navit/maptool/tile.c
@@ -424,9 +424,6 @@ add_tile_hash(struct tile_head *th)
int idx,len,maxnamelen=0;
char **data;
-#if 0
- g_hash_table_insert(tile_hash2, string_hash_lookup( th->name ), th);
-#endif
for( idx = 0; idx < th->num_subtiles; idx++ ) {
data = th_get_subtile( th, idx );
@@ -502,13 +499,7 @@ load_tilesdir(FILE *in)
th->zipnum=zipnum++;
th->zip_data=NULL;
th->name=string_hash_lookup(tile);
-#if 0
- printf("tile '%s' %d\n",tile,size);
-#endif
while (fscanf(in,":%[^:\n]",subtile) == 1) {
-#if 0
- printf("subtile '%s'\n",subtile);
-#endif
th=g_realloc(th, sizeof(struct tile_head)+(th->num_subtiles+1)*sizeof(char*));
*th_get_subtile( th, th->num_subtiles ) = string_hash_lookup(subtile);
th->num_subtiles++;
@@ -548,9 +539,6 @@ write_tilesdir(struct tile_info *info, struct zip_info *zip_info, FILE *out)
}
len=maxlen;
while (len >= 0) {
-#if 0
- fprintf(stderr,"PROGRESS: collecting tiles with len=%d\n", len);
-#endif
next=g_list_first(tiles_list);
while (next) {
if (strlen(next->data) == len) {
diff --git a/navit/navigation.c b/navit/navigation.c
index a31ee8459..b8fb16e6d 100644
--- a/navit/navigation.c
+++ b/navit/navigation.c
@@ -420,14 +420,14 @@ static int
is_same_street2(char *old_name, char *old_name_systematic, char *new_name, char *new_name_systematic)
{
if (old_name && new_name && !strcmp(old_name, new_name)) {
- dbg(lvl_debug,"is_same_street: '%s' '%s' vs '%s' '%s' yes (1.)\n", old_name_systematic, new_name_systematic, old_name, new_name);
+ dbg(lvl_debug,"is_same_street: '%s' '%s' vs '%s' '%s' yes (1.)", old_name_systematic, new_name_systematic, old_name, new_name);
return 1;
}
if (old_name_systematic && new_name_systematic && !strcmp(old_name_systematic, new_name_systematic)) {
- dbg(lvl_debug,"is_same_street: '%s' '%s' vs '%s' '%s' yes (2.)\n", old_name_systematic, new_name_systematic, old_name, new_name);
+ dbg(lvl_debug,"is_same_street: '%s' '%s' vs '%s' '%s' yes (2.)", old_name_systematic, new_name_systematic, old_name, new_name);
return 1;
}
- dbg(lvl_debug,"is_same_street: '%s' '%s' vs '%s' '%s' no\n", old_name_systematic, new_name_systematic, old_name, new_name);
+ dbg(lvl_debug,"is_same_street: '%s' '%s' vs '%s' '%s' no", old_name_systematic, new_name_systematic, old_name, new_name);
return 0;
}
@@ -502,7 +502,7 @@ split_string_to_list(struct navigation_way *way, char* raw_string, char sep)
int count = 0;
free_list(way->destination); /*in case this is a retry with a different separator.*/
- dbg(lvl_debug,"raw_string=%s split with %c\n",raw_string, sep);
+ dbg(lvl_debug,"raw_string=%s split with %c",raw_string, sep);
if (strlen(raw_string)>0)
{
count = 1;
@@ -518,7 +518,7 @@ split_string_to_list(struct navigation_way *way, char* raw_string, char sep)
pos2++;
new_street_destination->destination = g_strdup(pos2+1);
new_street_destination->rank=0;
- dbg(lvl_debug,"splitted_off_string=%s\n",new_street_destination->destination);
+ dbg(lvl_debug,"splitted_off_string=%s",new_street_destination->destination);
count++;
}
else
@@ -528,7 +528,7 @@ split_string_to_list(struct navigation_way *way, char* raw_string, char sep)
new_street_destination->destination = g_strdup(pos1);
new_street_destination->rank=0;
pos1 = NULL;
- dbg(lvl_debug,"head_of_string=%s\n",new_street_destination->destination);
+ dbg(lvl_debug,"head_of_string=%s",new_street_destination->destination);
}
way->destination = next_street_destination_remember;
}
@@ -681,7 +681,7 @@ select_announced_destinations(struct navigation_command *current_command)
current_destination = current_destination->next;
}
- dbg(lvl_debug,"%s, max hits =%i\n",current_destination->destination,max_hits);
+ dbg(lvl_debug,"%s, max hits =%i",current_destination->destination,max_hits);
set_highrank(current_destination,current_command);
}
}
@@ -738,7 +738,7 @@ navigation_get_attr(struct navigation *this_, enum attr_type type, struct attr *
{
struct map_rect *mr;
struct item *item;
- dbg(lvl_debug,"enter %s\n", attr_to_name(type));
+ dbg(lvl_debug,"enter %s", attr_to_name(type));
switch (type) {
case attr_map:
attr->u.map=this_->map;
@@ -860,7 +860,7 @@ navigation_get_announce_level(struct navigation *this_, enum item_type type, int
if (type < route_item_first || type > route_item_last)
{
- dbg(lvl_error," item outside routable range\n");
+ dbg(lvl_error," item outside routable range");
return level_error;
}
for (level = level_now ; level < level_follow ; level++) {
@@ -899,7 +899,7 @@ static int
road_angle(struct coord *c1, struct coord *c2, int dir)
{
int ret=transform_get_angle_delta(c1, c2, dir);
- dbg(lvl_debug, "road_angle(0x%x,0x%x - 0x%x,0x%x)=%d\n", c1->x, c1->y, c2->x, c2->y, ret);
+ dbg(lvl_debug, "road_angle(0x%x,0x%x - 0x%x,0x%x)=%d", c1->x, c1->y, c2->x, c2->y, ret);
return ret;
}
@@ -1006,7 +1006,7 @@ round_distance_reduced( int dist )
break;
i++;
}
- dbg(lvl_debug,"converted %d to %d with factor %d\n",dist,distances[m],factor);
+ dbg(lvl_debug,"converted %d to %d with factor %d",dist,distances[m],factor);
return distances[m] * factor;
}
@@ -1152,7 +1152,7 @@ navigation_way_init(struct navigation_way *w)
realitem = map_rect_get_item_byid(mr, w->item.id_hi, w->item.id_lo);
if (!realitem) {
- dbg(lvl_warning,"Item from segment not found on map!\n");
+ dbg(lvl_warning,"Item from segment not found on map!");
map_rect_destroy(mr);
return;
}
@@ -1176,7 +1176,7 @@ navigation_way_init(struct navigation_way *w)
if (w->dir < 0) {
if (item_coord_get(realitem, cbuf, 2) != 2) {
- dbg(lvl_warning,"Using calculate_angle() with a less-than-two-coords-item?\n");
+ dbg(lvl_warning,"Using calculate_angle() with a less-than-two-coords-item?");
map_rect_destroy(mr);
return;
}
@@ -1188,7 +1188,7 @@ navigation_way_init(struct navigation_way *w)
} else {
if (item_coord_get(realitem, cbuf, 2) != 2) {
- dbg(lvl_warning,"Using calculate_angle() with a less-than-two-coords-item?\n");
+ dbg(lvl_warning,"Using calculate_angle() with a less-than-two-coords-item?");
map_rect_destroy(mr);
return;
}
@@ -1249,7 +1249,7 @@ navigation_way_get_max_delta(struct navigation_way *w, enum projection pro, int
realitem = map_rect_get_item_byid(mr, w->item.id_hi, w->item.id_lo);
if (!realitem) {
- dbg(lvl_warning,"Item from segment not found on map!\n");
+ dbg(lvl_warning,"Item from segment not found on map!");
map_rect_destroy(mr);
return ret;
}
@@ -1260,7 +1260,7 @@ navigation_way_get_max_delta(struct navigation_way *w, enum projection pro, int
}
if (item_coord_get(realitem, &cbuf[1], 1) != 1) {
- dbg(lvl_warning,"item has no coords\n");
+ dbg(lvl_warning,"item has no coords");
map_rect_destroy(mr);
return ret;
}
@@ -1285,7 +1285,7 @@ navigation_way_get_max_delta(struct navigation_way *w, enum projection pro, int
item_coord_rewind(realitem);
if (item_coord_get(realitem, &cbuf[1], 1) != 1) {
- dbg(lvl_warning,"item has no more coords after rewind\n");
+ dbg(lvl_warning,"item has no more coords after rewind");
map_rect_destroy(mr);
return ret;
}
@@ -1348,7 +1348,7 @@ navigation_itm_ways_update(struct navigation_itm *itm, struct map *graph_map)
struct attr sitem_attr,direction_attr;
struct navigation_way *w, *l, *h;
- dbg(lvl_debug, "entering for item: %s %s %s\n", item_to_name(itm->way.item.type), itm->way.name_systematic, itm->way.name);
+ dbg(lvl_debug, "entering for item: %s %s %s", item_to_name(itm->way.item.type), itm->way.name_systematic, itm->way.name);
navigation_itm_ways_clear(itm);
@@ -1380,7 +1380,7 @@ navigation_itm_ways_update(struct navigation_itm *itm, struct map *graph_map)
}
if (!item_attr_get(i,attr_street_item,&sitem_attr)) {
- dbg(lvl_warning, "Got no street item for route graph item in entering_straight()\n");
+ dbg(lvl_warning, "Got no street item for route graph item in entering_straight()");
continue;
}
@@ -1403,7 +1403,7 @@ navigation_itm_ways_update(struct navigation_itm *itm, struct map *graph_map)
w->next = l;
navigation_way_init(w); /* calculate and set w->angle2 */
- dbg(lvl_debug, "- retrieved way: %s %s %s\n", item_to_name(w->item.type), w->name_systematic, w->name);
+ dbg(lvl_debug, "- retrieved way: %s %s %s", item_to_name(w->item.type), w->name_systematic, w->name);
/* check if w is already in the list */
h = l;
@@ -1411,7 +1411,7 @@ navigation_itm_ways_update(struct navigation_itm *itm, struct map *graph_map)
if (is_same_way(w, h)) {
g_free(w);
w = l;
- dbg(lvl_debug, " - way is already in list, discarding\n");
+ dbg(lvl_debug, " - way is already in list, discarding");
}
h = h->next;
}
@@ -1438,12 +1438,12 @@ navigation_destroy_itms_cmds(struct navigation *this_, struct navigation_itm *en
{
struct navigation_itm *itm;
struct navigation_command *cmd;
- dbg(lvl_info,"enter this_=%p this_->first=%p this_->cmd_first=%p end=%p\n", this_, this_->first, this_->cmd_first, end);
+ dbg(lvl_info,"enter this_=%p this_->first=%p this_->cmd_first=%p end=%p", this_, this_->first, this_->cmd_first, end);
if (this_->cmd_first)
- dbg(lvl_info,"this_->cmd_first->itm=%p\n", this_->cmd_first->itm);
+ dbg(lvl_info,"this_->cmd_first->itm=%p", this_->cmd_first->itm);
while (this_->first && this_->first != end) {
itm=this_->first;
- dbg(lvl_debug,"destroying %p\n", itm);
+ dbg(lvl_debug,"destroying %p", itm);
item_hash_remove(this_->hash, &itm->way.item);
this_->first=itm->next;
if (this_->first)
@@ -1470,8 +1470,8 @@ navigation_destroy_itms_cmds(struct navigation *this_, struct navigation_itm *en
if (! this_->first)
this_->last=NULL;
if (! this_->first && end)
- dbg(lvl_error,"end wrong\n");
- dbg(lvl_info,"ret this_->first=%p this_->cmd_first=%p\n",this_->first, this_->cmd_first);
+ dbg(lvl_error,"end wrong");
+ dbg(lvl_info,"ret this_->first=%p this_->cmd_first=%p",this_->first, this_->cmd_first);
}
static void
@@ -1480,19 +1480,19 @@ navigation_itm_update(struct navigation_itm *itm, struct item *ritem)
struct attr length, time, speed;
if (! item_attr_get(ritem, attr_length, &length)) {
- dbg(lvl_error,"no length\n");
+ dbg(lvl_error,"no length");
return;
}
if (! item_attr_get(ritem, attr_time, &time)) {
- dbg(lvl_error,"no time\n");
+ dbg(lvl_error,"no time");
return;
}
if (! item_attr_get(ritem, attr_speed, &speed)) {
- dbg(lvl_error,"no speed\n");
+ dbg(lvl_error,"no speed");
return;
}
- dbg(lvl_debug,"length=%ld time=%ld speed=%ld\n", length.u.num, time.u.num, speed.u.num);
+ dbg(lvl_debug,"length=%ld time=%ld speed=%ld", length.u.num, time.u.num, speed.u.num);
itm->length=length.u.num;
itm->time=time.u.num;
itm->speed=speed.u.num;
@@ -1530,7 +1530,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem)
if (routeitem) {
ret->streetname_told=0;
if (! item_attr_get(routeitem, attr_street_item, &street_item)) {
- dbg(lvl_warning, "no street item\n");
+ dbg(lvl_warning, "no street item");
g_free(ret);
ret = NULL;
return ret;
@@ -1569,7 +1569,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem)
{
char *destination_raw;
destination_raw=map_convert_string(streetitem->map,attr.u.str);
- dbg(lvl_debug,"destination_raw =%s\n",destination_raw);
+ dbg(lvl_debug,"destination_raw =%s",destination_raw);
split_string_to_list(&(ret->way),destination_raw, ';');
g_free(destination_raw);
}
@@ -1582,7 +1582,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem)
{
char *destination_raw;
destination_raw=map_convert_string(streetitem->map,attr.u.str);
- dbg(lvl_debug,"destination_raw forward =%s\n",destination_raw);
+ dbg(lvl_debug,"destination_raw forward =%s",destination_raw);
split_string_to_list(&(ret->way),destination_raw, ';');
g_free(destination_raw);
}
@@ -1594,7 +1594,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem)
{
char *destination_raw;
destination_raw=map_convert_string(streetitem->map,attr.u.str);
- dbg(lvl_debug,"destination_raw backward =%s\n",destination_raw);
+ dbg(lvl_debug,"destination_raw backward =%s",destination_raw);
split_string_to_list(&(ret->way),destination_raw, ';');
g_free(destination_raw);
}
@@ -1604,7 +1604,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem)
while (item_coord_get(routeitem, &c[i], 1))
{
- dbg(lvl_debug, "coord %d 0x%x 0x%x\n", i, c[i].x ,c[i].y);
+ dbg(lvl_debug, "coord %d 0x%x 0x%x", i, c[i].x ,c[i].y);
if (i < 4)
i++;
else
@@ -1647,7 +1647,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem)
{
struct map_selection mselexit;
struct item *rampitem;
- dbg(lvl_debug,"test ramp\n");
+ dbg(lvl_debug,"test ramp");
mselexit.next = NULL;
mselexit.u.c_rect.lu = c[0] ;
mselexit.u.c_rect.rl = c[0] ;
@@ -1666,12 +1666,12 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem)
{
if (attr.type && attr.type == attr_label)
{
- dbg(lvl_debug,"exit_label=%s\n",attr.u.str);
+ dbg(lvl_debug,"exit_label=%s",attr.u.str);
ret->way.exit_label= map_convert_string(tmap,attr.u.str);
}
if (attr.type == attr_ref)
{
- dbg(lvl_debug,"exit_ref=%s\n",attr.u.str);
+ dbg(lvl_debug,"exit_ref=%s",attr.u.str);
ret->way.exit_ref= map_convert_string(tmap,attr.u.str);
}
if (attr.type == attr_exit_to)
@@ -1687,7 +1687,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem)
&& (!(this_->last->way.item.type == type_ramp))) {
char *destination_raw;
destination_raw=map_convert_string(tmap,attr.u.str);
- dbg(lvl_debug,"destination_raw from exit_to =%s\n",destination_raw);
+ dbg(lvl_debug,"destination_raw from exit_to =%s",destination_raw);
if ((split_string_to_list(&(ret->way),destination_raw, ';')) < 2)
/*
* if a first try did not result in an actual splitting
@@ -1703,7 +1703,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem)
}
}
}
- dbg(lvl_debug,"i=%d start %d end %d '%s' \n", i, ret->way.angle2, ret->angle_end, ret->way.name_systematic);
+ dbg(lvl_debug,"i=%d start %d end %d '%s' ", i, ret->way.angle2, ret->angle_end, ret->way.name_systematic);
map_rect_destroy(mr);
} else {
if (this_->last)
@@ -1715,7 +1715,7 @@ navigation_itm_new(struct navigation *this_, struct item *routeitem)
this_->last->next=ret;
ret->prev=this_->last;
}
- dbg(lvl_debug,"ret=%p\n", ret);
+ dbg(lvl_debug,"ret=%p", ret);
this_->last=ret;
return ret;
}
@@ -1786,21 +1786,21 @@ calculate_dest_distance(struct navigation *this_, int incr)
{
int len=0, time=0, count=0;
struct navigation_itm *next,*itm=this_->last;
- dbg(lvl_debug, "enter this_=%p, incr=%d\n", this_, incr);
+ dbg(lvl_debug, "enter this_=%p, incr=%d", this_, incr);
if (incr) {
if (itm) {
- dbg(lvl_info, "old values: (%p) time=%d lenght=%d\n", itm, itm->dest_length, itm->dest_time);
+ dbg(lvl_info, "old values: (%p) time=%d lenght=%d", itm, itm->dest_length, itm->dest_time);
} else {
- dbg(lvl_info, "old values: itm is null\n");
+ dbg(lvl_info, "old values: itm is null");
}
itm=this_->first;
next=itm->next;
- dbg(lvl_info, "itm values: time=%d lenght=%d\n", itm->length, itm->time);
- dbg(lvl_info, "next values: (%p) time=%d lenght=%d\n", next, next->dest_length, next->dest_time);
+ dbg(lvl_info, "itm values: time=%d lenght=%d", itm->length, itm->time);
+ dbg(lvl_info, "next values: (%p) time=%d lenght=%d", next, next->dest_length, next->dest_time);
itm->dest_length=next->dest_length+itm->length;
itm->dest_count=next->dest_count+1;
itm->dest_time=next->dest_time+itm->time;
- dbg(lvl_info, "new values: time=%d lenght=%d\n", itm->dest_length, itm->dest_time);
+ dbg(lvl_info, "new values: time=%d lenght=%d", itm->dest_length, itm->dest_time);
return;
}
while (itm) {
@@ -1811,7 +1811,7 @@ calculate_dest_distance(struct navigation *this_, int incr)
itm->dest_count=count++;
itm=itm->prev;
}
- dbg(lvl_debug,"len %d time %d\n", len, time);
+ dbg(lvl_debug,"len %d time %d", len, time);
}
@@ -1981,10 +1981,7 @@ maneuver_required2 (struct navigation *nav, struct navigation_itm *old, struct n
dc = m.delta;
- dbg(lvl_debug,"enter %p %p %p\n",old, new, maneuver);
-#if 0
- dbg(lvl_debug, "old=%s %s, new=%s %s, angle old=%d, angle new=%d, d=%i\n ", old->way.name, old->way.name_systematic, new->way.name, new->way.name_systematic, old->angle_end, new->way.angle2, d);
-#endif
+ dbg(lvl_debug,"enter %p %p %p",old, new, maneuver);
if (!new->way.next || (new->way.next && (new->way.next->angle2 == new->way.angle2) && !new->way.next->next)) {
/* No announcement necessary (with extra magic to eliminate duplicate ways) */
r="no: Only one possibility";
@@ -2019,7 +2016,7 @@ maneuver_required2 (struct navigation *nav, struct navigation_itm *old, struct n
if ((w->angle2 != new->way.angle2) || (w == &(new->way))) {
dw=angle_delta(old->angle_end, w->angle2);
if (is_way_allowed(nav,w,1)) {
- dbg(lvl_debug, "- Examining allowed way: %s %s %s, delta=%i\n", item_to_name(w->item.type), w->name_systematic, w->name, dw);
+ dbg(lvl_debug, "- Examining allowed way: %s %s %s, delta=%i", item_to_name(w->item.type), w->name_systematic, w->name, dw);
m.num_options++;
/* ways of similar category */
if (maneuver_category(w->item.type) == m.old_cat) {
@@ -2248,7 +2245,7 @@ maneuver_required2 (struct navigation *nav, struct navigation_itm *old, struct n
m.is_unambiguous = 0;
/* if another way is within +/-min_turn_limit and on the same side as new, the maneuver is ambiguous */
if (dc != m.delta) {
- dbg(lvl_debug, "m.delta %d vs dc %d\n", m.delta, dc);
+ dbg(lvl_debug, "m.delta %d vs dc %d", m.delta, dc);
m.is_unambiguous=0;
}
if (!m.is_same_street && m.is_unambiguous < 1) { /* FIXME: why < 1? */
@@ -2340,7 +2337,7 @@ maneuver_required2 (struct navigation *nav, struct navigation_itm *old, struct n
memcpy(*maneuver, &m, sizeof(struct navigation_maneuver));
}
if (r)
- dbg(lvl_debug, "%s %s %s -> %s %s %s: %s, delta=%i, merge_or_exit=%i\n", item_to_name(old->way.item.type), old->way.name_systematic, old->way.name, item_to_name(new->way.item.type), new->way.name_systematic, new->way.name, r, m.delta, m.merge_or_exit);
+ dbg(lvl_debug, "%s %s %s -> %s %s %s: %s, delta=%i, merge_or_exit=%i", item_to_name(old->way.item.type), old->way.name_systematic, old->way.name, item_to_name(new->way.item.type), new->way.name_systematic, new->way.name, r, m.delta, m.merge_or_exit);
return ret;
}
@@ -2358,11 +2355,11 @@ maneuver_required2 (struct navigation *nav, struct navigation_itm *old, struct n
*/
static int adjust_delta(int delta, int reference) {
if ((delta >= 0) && (delta - reference) > 180) {
- dbg(lvl_debug,"adjusting delta from %d to %d\n", delta, delta - 360);
+ dbg(lvl_debug,"adjusting delta from %d to %d", delta, delta - 360);
return delta - 360;
}
else if ((delta <= 0) && (reference - delta) > 180) {
- dbg(lvl_debug,"adjusting delta from %d to %d\n", delta, delta + 360);
+ dbg(lvl_debug,"adjusting delta from %d to %d", delta, delta + 360);
return delta + 360;
}
else
@@ -2437,10 +2434,10 @@ static void navigation_analyze_roundabout(struct navigation *this_, struct navig
*/
dtsir = angle_delta(itm->prev->angle_end, w->angle2);
- dbg(lvl_debug,"delta to stay in roundabout %d\n", dtsir);
+ dbg(lvl_debug,"delta to stay in roundabout %d", dtsir);
exit_tangent = angle_median(itm->prev->angle_end, w->angle2);
- dbg(lvl_debug,"exit %d median from %d, %d\n", exit_tangent, itm->prev->angle_end, w->angle2);
+ dbg(lvl_debug,"exit %d median from %d, %d", exit_tangent, itm->prev->angle_end, w->angle2);
/* Move back to where we enter the roundabout, calculate length in roundabout */
itm2=itm;
@@ -2459,14 +2456,14 @@ static void navigation_analyze_roundabout(struct navigation *this_, struct navig
/* Calculate entry angle */
if (itm2 && w2) {
entry_tangent = angle_median(angle_opposite(itm2->way.angle2), w2->angle2);
- dbg(lvl_debug, "entry %d median from %d (%d), %d\n", entry_tangent, angle_opposite(itm2->way.angle2), itm2->way.angle2, itm2->way.next->angle2);
+ dbg(lvl_debug, "entry %d median from %d (%d), %d", entry_tangent, angle_opposite(itm2->way.angle2), itm2->way.angle2, itm2->way.next->angle2);
} else {
entry_tangent = angle_opposite(angle);
} /* endif itm2 && w2 */
- dbg(lvl_debug, "entry %d exit %d\n", entry_tangent, exit_tangent);
+ dbg(lvl_debug, "entry %d exit %d", entry_tangent, exit_tangent);
delta2 = angle_delta(entry_tangent, exit_tangent);
- dbg(lvl_debug, "delta2 %d\n", delta2);
+ dbg(lvl_debug, "delta2 %d", delta2);
if (itm2->prev) {
/* If there are V-shaped approach segments and we are turning around or making a sharp turn,
@@ -2495,25 +2492,25 @@ static void navigation_analyze_roundabout(struct navigation *this_, struct navig
dbg(lvl_error,"central_angle in roundabout_length computation lead to divide by zero (delta1 = %d, delta2 = %d, cmd->delta = %d, dtsir = %d, len = %d)",delta1,delta2,cmd->delta,dtsir,len);
roundabout_length = len;
}
- dbg(lvl_debug,"roundabout_length = %dm (for central_angle = %d degrees)\n", roundabout_length, central_angle);
+ dbg(lvl_debug,"roundabout_length = %dm (for central_angle = %d degrees)", roundabout_length, central_angle);
/* in the case of separate carriageways, approach roads become hard to identify, thus we keep a cap on distance.
* Currently this is at most half the length of the roundabout, which has worked well in tests but can be tweaked
* to further improve results. */
dist_left = roundabout_length / 2;
- dbg(lvl_debug,"examining roads for up to %dm\n", dist_left);
+ dbg(lvl_debug,"examining roads for up to %dm", dist_left);
/* examine items before roundabout */
itm3 = itm2->prev; /* last segment before roundabout */
abort = 0;
while (itm3->prev) {
if ((itm3->next && is_ramp(&(itm3->next->way)) && !is_ramp(&(itm3->way))) || !(itm3->way.flags & AF_ONEWAYMASK)) {
- dbg(lvl_debug,"items before roundabout: break because ramp or oneway ends, %dm left\n", dist_left);
+ dbg(lvl_debug,"items before roundabout: break because ramp or oneway ends, %dm left", dist_left);
dist_left = 0; /* to make sure we don't examine the following way in depth */
break;
}
if (dist_left <= itm3->length) {
- dbg(lvl_debug,"items before roundabout: maximum distance reached, %dm left, item length %dm\n", dist_left, itm3->length);
+ dbg(lvl_debug,"items before roundabout: maximum distance reached, %dm left, item length %dm", dist_left, itm3->length);
break;
}
d = navigation_way_get_max_delta(&(itm3->way), map_projection(this_->map), itm2->prev->angle_end, dist_left, -1);
@@ -2531,7 +2528,7 @@ static void navigation_analyze_roundabout(struct navigation *this_, struct navig
w2 = w2->next;
}
if (abort) {
- dbg(lvl_debug,"items before roundabout: break because of potential turn maneuver, %dm left\n", dist_left);
+ dbg(lvl_debug,"items before roundabout: break because of potential turn maneuver, %dm left", dist_left);
dist_left = itm3->length;
break;
}
@@ -2550,7 +2547,7 @@ static void navigation_analyze_roundabout(struct navigation *this_, struct navig
if ((d != invalid_angle) && (abs(d) > abs(dmax)))
dmax = d;
entry_road_angle = (itm2->prev->angle_end + dmax) % 360;
- dbg(lvl_debug,"entry_road_angle %d (%d + %d)\n", entry_road_angle, itm2->prev->angle_end, dmax);
+ dbg(lvl_debug,"entry_road_angle %d (%d + %d)", entry_road_angle, itm2->prev->angle_end, dmax);
/* examine items after roundabout */
dmax = 0;
@@ -2559,12 +2556,12 @@ static void navigation_analyze_roundabout(struct navigation *this_, struct navig
abort = 0;
while (itm3->next) {
if ((itm3->prev && is_ramp(&(itm3->prev->way)) && !is_ramp(&(itm3->way))) || !(itm3->way.flags & AF_ONEWAYMASK)) {
- dbg(lvl_debug,"items after roundabout: break because ramp or oneway ends, %dm left\n", dist_left);
+ dbg(lvl_debug,"items after roundabout: break because ramp or oneway ends, %dm left", dist_left);
dist_left = 0; /* to make sure we don't examine the following way in depth */
break;
}
if (dist_left <= itm3->length) {
- dbg(lvl_debug,"items after roundabout: maximum distance reached, %dm left, item length %dm\n", dist_left, itm3->length);
+ dbg(lvl_debug,"items after roundabout: maximum distance reached, %dm left, item length %dm", dist_left, itm3->length);
break;
}
d = navigation_way_get_max_delta(&(itm3->way), map_projection(this_->map), itm->way.angle2, dist_left, 1);
@@ -2582,7 +2579,7 @@ static void navigation_analyze_roundabout(struct navigation *this_, struct navig
w2 = w2->next;
}
if (abort) {
- dbg(lvl_debug,"items after roundabout: break because of potential turn maneuver, %dm left\n", dist_left);
+ dbg(lvl_debug,"items after roundabout: break because of potential turn maneuver, %dm left", dist_left);
dist_left = itm3->length;
break;
}
@@ -2602,15 +2599,15 @@ static void navigation_analyze_roundabout(struct navigation *this_, struct navig
dmax = d;
exit_road_angle = (itm->way.angle2 + dmax) % 360;
- dbg(lvl_debug,"exit_road_angle %d (%d + %d)\n", exit_road_angle, itm->way.angle2, dmax);
+ dbg(lvl_debug,"exit_road_angle %d (%d + %d)", exit_road_angle, itm->way.angle2, dmax);
- dbg(lvl_debug,"delta1 %d\n", delta1);
+ dbg(lvl_debug,"delta1 %d", delta1);
delta3 = adjust_delta(angle_delta(entry_road_angle, exit_road_angle), delta2);
- dbg(lvl_debug,"delta3 %d\n", delta3);
+ dbg(lvl_debug,"delta3 %d", delta3);
cmd->roundabout_delta = delta3;
- dbg(lvl_debug,"roundabout_delta %d\n", cmd->roundabout_delta);
+ dbg(lvl_debug,"roundabout_delta %d", cmd->roundabout_delta);
} else {
/* we don't know where we entered the roundabout, so we can't calculate delta1 */
cmd->roundabout_delta = delta2;
@@ -2654,14 +2651,14 @@ static void navigation_analyze_roundabout(struct navigation *this_, struct navig
l = type_nav_roundabout_l8;
break;
}
- dbg(lvl_debug,"delta %d\n", cmd->delta);
+ dbg(lvl_debug,"delta %d", cmd->delta);
/* if delta to leave the roundabout (cmd->delta) is less than delta to stay in roundabout (dtsir),
* we're exiting to the left, so we're probably in a clockwise roundabout, and vice versa */
if (cmd->delta < dtsir)
cmd->maneuver->type = l;
else
cmd->maneuver->type = r;
- dbg(lvl_debug,"type %s\n", item_to_name(cmd->maneuver->type));
+ dbg(lvl_debug,"type %s", item_to_name(cmd->maneuver->type));
}
@@ -2690,7 +2687,7 @@ command_new(struct navigation *this_, struct navigation_itm *itm, struct navigat
int turn_no_of_route_way = 0; /* The number of the route way of all ways that turn to the same direction.
Count direction from abs(0 degree) up to abs(180 degree). Strengthening criterion. */
- dbg(lvl_debug,"enter this_=%p itm=%p maneuver=%p delta=%d\n", this_, itm, maneuver, maneuver->delta);
+ dbg(lvl_debug,"enter this_=%p itm=%p maneuver=%p delta=%d", this_, itm, maneuver, maneuver->delta);
ret->maneuver = maneuver;
ret->delta=maneuver->delta;
ret->itm=itm;
@@ -3163,7 +3160,7 @@ show_maneuver(struct navigation *nav, struct navigation_itm *itm, struct navigat
}
}
navigation_set_turnaround(nav, 0);
- dbg(lvl_debug,"distance=%d level=%d type=0x%x\n", distance, level, itm->way.item.type);
+ dbg(lvl_debug,"distance=%d level=%d type=0x%x", distance, level, itm->way.item.type);
}
@@ -3254,7 +3251,7 @@ show_maneuver(struct navigation *nav, struct navigation_itm *itm, struct navigat
/* TRANSLATORS: first arg. is the manieth exit, second arg. is the destination to follow */
return g_strdup_printf(_("Leave the roundabout at the %1$s %2$s"), get_exit_count_str(count_roundabout),street_destination_announce);
default :
- dbg(lvl_error,"unexpected announcement level %d\n", level);
+ dbg(lvl_error,"unexpected announcement level %d", level);
return g_strdup_printf("internal error");
}
}
@@ -3507,7 +3504,7 @@ show_maneuver(struct navigation *nav, struct navigation_itm *itm, struct navigat
instruction=g_strdup_printf(_("You have reached your destination %s"), d);
break;
default:
- dbg(lvl_error,"unhandled instruction\n");
+ dbg(lvl_error,"unhandled instruction");
break;
}
}
@@ -3531,7 +3528,7 @@ show_maneuver(struct navigation *nav, struct navigation_itm *itm, struct navigat
break;
default :
ret= g_strdup_printf(("%1$s %2$s"),instruction,street_destination_announce);
- dbg(lvl_error,"unexpected announcement level %d\n", level);
+ dbg(lvl_error,"unexpected announcement level %d", level);
break;
}
@@ -3636,10 +3633,10 @@ navigation_call_callbacks(struct navigation *this_, int force_speech)
if (!this_->cmd_first)
return;
callback_list_call(this_->callback, 1, &p);
- dbg(lvl_debug,"force_speech=%d turn_around=%d turn_around_limit=%d\n", force_speech, this_->turn_around, this_->turn_around_limit);
+ dbg(lvl_debug,"force_speech=%d turn_around=%d turn_around_limit=%d", force_speech, this_->turn_around, this_->turn_around_limit);
distance=this_->first->dest_length-this_->cmd_first->itm->dest_length;
if (this_->turn_around_limit && this_->turn_around == this_->turn_around_limit) {
- dbg(lvl_debug,"distance=%d distance_turn=%d\n", distance, this_->distance_turn);
+ dbg(lvl_debug,"distance=%d distance_turn=%d", distance, this_->distance_turn);
while (distance > this_->distance_turn) {
this_->level_last=4;
level=4;
@@ -3657,8 +3654,8 @@ navigation_call_callbacks(struct navigation *this_, int force_speech)
/* only tell if the level is valid for more than 3 seconds */
int speed_distance=this_->first->speed*30/36;
if (distance < speed_distance || navigation_get_announce_level_cmd(this_, this_->first, this_->cmd_first, distance-speed_distance) == level) {
- dbg(lvl_debug,"distance %d speed_distance %d\n",distance,speed_distance);
- dbg(lvl_debug,"level %d < %d\n", level, this_->level_last);
+ dbg(lvl_debug,"distance %d speed_distance %d",distance,speed_distance);
+ dbg(lvl_debug,"level %d < %d", level, this_->level_last);
this_->level_last=level;
force_speech=3;
}
@@ -3680,7 +3677,7 @@ navigation_call_callbacks(struct navigation *this_, int force_speech)
if (force_speech) {
this_->level_last=level;
this_->curr_delay=0;
- dbg(lvl_debug,"force_speech=%d distance=%d level=%d type=0x%x\n", force_speech, distance, level, this_->first->way.item.type);
+ dbg(lvl_debug,"force_speech=%d distance=%d level=%d type=0x%x", force_speech, distance, level, this_->first->way.item.type);
callback_list_call(this_->callback_speech, 1, &p);
}
}
@@ -3783,11 +3780,11 @@ navigation_update_idle(struct navigation *this_) {
if (!item_attr_get(ritem, attr_direction, &street_direction))
street_direction.u.num = 0;
sitem = street_item.u.item;
- dbg(lvl_debug,"sitem=%p\n", sitem);
+ dbg(lvl_debug,"sitem=%p", sitem);
itm = item_hash_lookup(this_->hash, sitem);
- dbg(lvl_info,"itm for item with id (0x%x,0x%x) is %p\n", sitem->id_hi, sitem->id_lo, itm);
+ dbg(lvl_info,"itm for item with id (0x%x,0x%x) is %p", sitem->id_hi, sitem->id_lo, itm);
if (itm && itm->way.dir != street_direction.u.num) {
- dbg(lvl_info,"wrong direction\n");
+ dbg(lvl_info,"wrong direction");
itm = NULL;
}
navigation_destroy_itms_cmds(this_, itm);
@@ -3795,7 +3792,7 @@ navigation_update_idle(struct navigation *this_) {
navigation_itm_update(itm, ritem);
break;
}
- dbg(lvl_debug,"not on track\n");
+ dbg(lvl_debug,"not on track");
}
navigation_itm_new(this_, ritem);
count--;
@@ -3828,7 +3825,7 @@ navigation_update(struct navigation *this_, struct route *route, struct attr *at
if (attr->type != attr_route_status)
return;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
nav_status.type = attr_nav_status;
switch(attr->u.num) {
@@ -3870,7 +3867,7 @@ navigation_update(struct navigation *this_, struct route *route, struct attr *at
this_->vehicleprofile=vehicleprofile.u.vehicleprofile;
else
this_->vehicleprofile=NULL;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
this_->status_int = status_busy;
if (route_get_flags(this_->route) & route_path_flag_async) {
@@ -4366,7 +4363,7 @@ navigation_map_get_item(struct map_rect_priv *priv)
navigation_map_item_attr_rewind(priv);
ret->id_lo=priv->itm->dest_count;
- dbg(lvl_debug,"type=%d\n", ret->type);
+ dbg(lvl_debug,"type=%d", ret->type);
return ret;
}
diff --git a/navit/navit.c b/navit/navit.c
index a32de161e..b1617bcca 100644
--- a/navit/navit.c
+++ b/navit/navit.c
@@ -218,7 +218,7 @@ navit_get_mapset(struct navit *this_)
if(this_->mapsets){
return this_->mapsets->data;
} else {
- dbg(lvl_error,"No mapsets enabled! Is it on purpose? Navit can't draw a map. Please check your navit.xml\n");
+ dbg(lvl_error,"No mapsets enabled! Is it on purpose? Navit can't draw a map. Please check your navit.xml");
}
return NULL;
}
@@ -244,9 +244,9 @@ navit_get_user_data_directory(int create) {
char *dir;
dir = getenv("NAVIT_USER_DATADIR");
if (create && !file_exists(dir)) {
- dbg(lvl_debug,"creating dir %s\n", dir);
+ dbg(lvl_debug,"creating dir %s", dir);
if (file_mkdir(dir,0)) {
- dbg(lvl_error,"failed creating dir %s\n", dir);
+ dbg(lvl_error,"failed creating dir %s", dir);
return NULL;
}
}
@@ -450,7 +450,7 @@ update_transformation(struct transformation *tr, struct point *old, struct point
center_new.x=center_old->x+coord_old.x-coord_new.x;
center_new.y=center_old->y+coord_old.y-coord_new.y;
navit_restrict_map_center_to_world_boundingbox(tr, &center_new);
- dbg(lvl_debug,"change center from 0x%x,0x%x to 0x%x,0x%x\n", center_old->x, center_old->y, center_new.x, center_new.y);
+ dbg(lvl_debug,"change center from 0x%x,0x%x to 0x%x,0x%x", center_old->x, center_old->y, center_new.x, center_new.y);
transform_set_center(tr, &center_new);
}
@@ -468,7 +468,7 @@ navit_handle_button(struct navit *this_, int pressed, int button, struct point *
{
int border=16;
- dbg(lvl_debug,"button %d %s (ignore: %d)\n",button,pressed?"pressed":"released",this_->ignore_button);
+ dbg(lvl_debug,"button %d %s (ignore: %d)",button,pressed?"pressed":"released",this_->ignore_button);
callback_list_call_attr_4(this_->attr_cbl, attr_button, this_, GINT_TO_POINTER(pressed), GINT_TO_POINTER(button), p);
if (this_->ignore_button) {
this_->ignore_button=0;
@@ -512,7 +512,7 @@ navit_handle_button(struct navit *this_, int pressed, int button, struct point *
this_->motion_timeout=NULL;
}
if (this_->moved) {
- dbg(lvl_debug, "mouse drag (%d, %d)->(%d, %d)\n", this_->pressed.x, this_->pressed.y, p->x, p->y);
+ dbg(lvl_debug, "mouse drag (%d, %d)->(%d, %d)", this_->pressed.x, this_->pressed.y, p->x, p->y);
update_transformation(this_->trans, &this_->pressed, p);
graphics_draw_drag(this_->gra, NULL);
transform_copy(this_->trans, this_->trans_cursor);
@@ -530,7 +530,7 @@ static void
navit_button(void *data, int pressed, int button, struct point *p)
{
struct navit *this=data;
- dbg(lvl_debug,"enter %d %d ignore %d\n",pressed,button,this->ignore_graphics_events);
+ dbg(lvl_debug,"enter %d %d ignore %d",pressed,button,this->ignore_graphics_events);
if (!this->ignore_graphics_events) {
if (! this->popup_callback)
this->popup_callback=callback_new_1(callback_cast(navit_popup), this);
@@ -835,7 +835,7 @@ navit_cmd_set_attr_var(struct navit *this, char *function, struct attr **in, str
key = g_strdup(in[0]->u.str);
g_hash_table_insert(cmd_attr_var_hash, key, val);
} else {
- dbg(lvl_warning, "Wrong parameters for set_attr_var() command function\n");
+ dbg(lvl_warning, "Wrong parameters for set_attr_var() command function");
}
}
@@ -906,12 +906,12 @@ navit_cmd_map_add_curr_pos(struct navit *this, char *function, struct attr **in,
) {
if(!(ms=navit_get_mapset(this))) {
- dbg(lvl_error, "Command function map_add_curr_pos(): there is no active mapset\n");
+ dbg(lvl_error, "Command function map_add_curr_pos(): there is no active mapset");
return;
}
if((item_type = item_from_name(in[1]->u.str))==type_none) {
- dbg(lvl_error, "Command function map_add_curr_pos(): unknown item type\n");
+ dbg(lvl_error, "Command function map_add_curr_pos(): unknown item type");
return;
}
@@ -919,7 +919,7 @@ navit_cmd_map_add_curr_pos(struct navit *this, char *function, struct attr **in,
//no map with the given name found
if( ! curr_map) {
- dbg(lvl_error, "Command function map_add_curr_pos(): map not found\n");
+ dbg(lvl_error, "Command function map_add_curr_pos(): map not found");
return;
}
@@ -928,11 +928,11 @@ navit_cmd_map_add_curr_pos(struct navit *this, char *function, struct attr **in,
if(vehicle_get_attr(this->vehicle->vehicle,attr_position_coord_geo,&pos_attr,NULL)) {
transform_from_geo(projection_mg, pos_attr.u.coord_geo, &curr_coord);
} else {
- dbg(lvl_error, "Command function map_add_curr_pos(): vehicle position is not accessible\n");
+ dbg(lvl_error, "Command function map_add_curr_pos(): vehicle position is not accessible");
return;
}
} else {
- dbg(lvl_error, "Command function map_add_curr_pos(): no vehicle\n");
+ dbg(lvl_error, "Command function map_add_curr_pos(): no vehicle");
return;
}
@@ -1018,11 +1018,11 @@ navit_cmd_map_item_set_attr(struct navit *this, char *function, struct attr **in
}
map_rect_destroy(mr);
} else {
- dbg(lvl_debug,"Error in command function item_set_attr()\n");
- dbg(lvl_debug,"Command function item_set_attr(): map cond: %d\n",(in[0] && ATTR_IS_STRING(in[0]->type) && in[0]->u.str)?1:0);
- dbg(lvl_debug,"Command function item_set_attr(): item cond: %d\n",(in[1] && ATTR_IS_ITEM(in[1]->type))?1:0);
- dbg(lvl_debug,"Command function item_set_attr(): attr type cond: %d\n",(in[2] && ATTR_IS_STRING(in[2]->type) && in[2]->u.str)?1:0);
- dbg(lvl_debug,"Command function item_set_attr(): attr val cond: %d\n",(in[3] && ATTR_IS_STRING(in[3]->type) && in[3]->u.str)?1:0);
+ dbg(lvl_debug,"Error in command function item_set_attr()");
+ dbg(lvl_debug,"Command function item_set_attr(): map cond: %d",(in[0] && ATTR_IS_STRING(in[0]->type) && in[0]->u.str)?1:0);
+ dbg(lvl_debug,"Command function item_set_attr(): item cond: %d",(in[1] && ATTR_IS_ITEM(in[1]->type))?1:0);
+ dbg(lvl_debug,"Command function item_set_attr(): attr type cond: %d",(in[2] && ATTR_IS_STRING(in[2]->type) && in[2]->u.str)?1:0);
+ dbg(lvl_debug,"Command function item_set_attr(): attr val cond: %d",(in[3] && ATTR_IS_STRING(in[3]->type) && in[3]->u.str)?1:0);
}
}
@@ -1349,7 +1349,7 @@ navit_cmd_spawn(struct navit *this, char *function, struct attr **in, struct att
if(in[i]->type!=attr_none ) {
argv[j++]=attr_to_text(in[i],NULL,1);
} else {
- dbg(lvl_debug,"Parameter #%i is attr_none - skipping\n",i);
+ dbg(lvl_debug,"Parameter #%i is attr_none - skipping",i);
}
}
argv[j]=NULL;
@@ -1358,15 +1358,15 @@ navit_cmd_spawn(struct navit *this, char *function, struct attr **in, struct att
// spawn_process() testing suite - uncomment following code to test.
//sleep(3);
// example of non-blocking wait
- //int st=spawn_process_check_status(pi,0);dbg(lvl_debug,"status %i\n",st);
+ //int st=spawn_process_check_status(pi,0);dbg(lvl_debug,"status %i",st);
// example of blocking wait
- //st=spawn_process_check_status(pi,1);dbg(lvl_debug,"status %i\n",st);
+ //st=spawn_process_check_status(pi,1);dbg(lvl_debug,"status %i",st);
// example of wait after process is finished and status is
// already tested
- //st=spawn_process_check_status(pi,1);dbg(lvl_debug,"status %i\n",st);
+ //st=spawn_process_check_status(pi,1);dbg(lvl_debug,"status %i",st);
// example of wait after process is finished and status is
// already tested - unblocked
- //st=spawn_process_check_status(pi,0);dbg(lvl_debug,"status %i\n",st);
+ //st=spawn_process_check_status(pi,0);dbg(lvl_debug,"status %i",st);
// End testing suite
spawn_process_info_free(pi);
@@ -1469,7 +1469,7 @@ navit_new(struct attr *parent, struct attr **attrs)
this_->messages = messagelist_new(attrs);
- dbg(lvl_debug,"return %p\n",this_);
+ dbg(lvl_debug,"return %p",this_);
return this_;
}
@@ -1560,7 +1560,7 @@ navit_mark_navigation_stopped(char *former_destination_file){
fprintf(f,"%s", TEXTFILE_COMMENT_NAVI_STOPPED);
fclose(f);
}else{
- dbg(lvl_error, "Error setting mark in destination file %s: %s\n", former_destination_file, strerror(errno));
+ dbg(lvl_error, "Error setting mark in destination file %s: %s", former_destination_file, strerror(errno));
}
}
@@ -1583,7 +1583,7 @@ navit_set_destination(struct navit *this_, struct pcoord *c, const char *descrip
this_->destination=*c;
this_->destination_valid=1;
- dbg(lvl_debug, "c=(%i,%i)\n", c->x,c->y);
+ dbg(lvl_debug, "c=(%i,%i)", c->x,c->y);
bookmarks_append_destinations(this_->former_destination, destination_file, c, 1, type_former_destination, description, this_->recentdest_count);
} else {
this_->destination_valid=0;
@@ -1868,7 +1868,7 @@ navit_say(struct navit *this_, const char *text)
if(this_->speech) {
if (!speech_get_attr(this_->speech, attr_active, &attr, NULL))
attr.u.num = 1;
- dbg(lvl_debug, "this_.speech->active %ld\n", attr.u.num);
+ dbg(lvl_debug, "this_.speech->active %ld", attr.u.num);
if(attr.u.num)
speech_say(this_->speech, text);
}
@@ -1915,7 +1915,7 @@ navit_speak(struct navit *this_)
if (!speech_get_attr(this_->speech, attr_active, &attr, NULL))
attr.u.num = 1;
- dbg(lvl_debug, "this_.speech->active %ld\n", attr.u.num);
+ dbg(lvl_debug, "this_.speech->active %ld", attr.u.num);
if(!attr.u.num)
return;
@@ -1952,24 +1952,24 @@ navit_window_roadbook_update(struct navit *this_)
if (navit_get_attr(this_, attr_imperial, &attr, NULL))
imperial=attr.u.num;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
datawindow_mode(this_->roadbook_window, 1);
if (nav)
map=navigation_get_map(nav);
if (map)
mr=map_rect_new(map, NULL);
- dbg(lvl_debug,"nav=%p map=%p mr=%p\n", nav, map, mr);
+ dbg(lvl_debug,"nav=%p map=%p mr=%p", nav, map, mr);
if (mr) {
- dbg(lvl_debug,"while loop\n");
+ dbg(lvl_debug,"while loop");
while ((item=map_rect_get_item(mr))) {
- dbg(lvl_debug,"item=%p\n", item);
+ dbg(lvl_debug,"item=%p", item);
attr.u.str=NULL;
if (item->type != type_nav_position) {
item_attr_get(item, attr_navigation_long, &attr);
if (attr.u.str == NULL) {
continue;
}
- dbg(lvl_info, "Command='%s'\n", attr.u.str);
+ dbg(lvl_info, "Command='%s'", attr.u.str);
param[0].value=g_strdup(attr.u.str);
} else
param[0].value=_("Position");
@@ -1977,7 +1977,7 @@ navit_window_roadbook_update(struct navit *this_)
/* Distance to the next maneuver. */
item_attr_get(item, attr_length, &attr);
- dbg(lvl_info, "Length=%ld in meters\n", attr.u.num);
+ dbg(lvl_info, "Length=%ld in meters", attr.u.num);
param[1].name=_("Length");
if ( attr.u.num >= 2000 )
@@ -1997,7 +1997,7 @@ navit_window_roadbook_update(struct navit *this_)
/* Time to next maneuver. */
item_attr_get(item, attr_time, &attr);
- dbg(lvl_info, "Time=%ld\n", attr.u.num);
+ dbg(lvl_info, "Time=%ld", attr.u.num);
secs=attr.u.num/10;
param[2].name=_("Time");
if ( secs >= 3600 )
@@ -2011,7 +2011,7 @@ navit_window_roadbook_update(struct navit *this_)
/* Distance from next maneuver to destination. */
item_attr_get(item, attr_destination_length, &attr);
- dbg(lvl_info, "Destlength=%ld in meters.\n", attr.u.num);
+ dbg(lvl_info, "Destlength=%ld in meters.", attr.u.num);
param[3].name=_("Destination Length");
if ( attr.u.num >= 2000 )
{
@@ -2030,7 +2030,7 @@ navit_window_roadbook_update(struct navit *this_)
/* Time from next maneuver to destination. */
item_attr_get(item, attr_destination_time, &attr);
- dbg(lvl_info, "Desttime=%ld\n", attr.u.num);
+ dbg(lvl_info, "Desttime=%ld", attr.u.num);
secs=attr.u.num/10;
param[4].name=_("Destination Time");
if ( secs >= 3600 )
@@ -2051,7 +2051,7 @@ navit_window_roadbook_update(struct navit *this_)
void
navit_window_roadbook_destroy(struct navit *this_)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
navigation_unregister_callback(this_->navigation, attr_navigation_long, this_->roadbook_callback);
callback_destroy(this_->roadbook_callback);
this_->roadbook_window=NULL;
@@ -2078,22 +2078,22 @@ navit_init(struct navit *this_)
int callback;
char *center_file;
- dbg(lvl_info,"enter gui %p graphics %p\n",this_->gui,this_->gra);
+ dbg(lvl_info,"enter gui %p graphics %p",this_->gui,this_->gra);
if (!this_->gui && !(this_->flags & 2)) {
- dbg(lvl_error,"FATAL: No GUI available.\n");
+ dbg(lvl_error,"FATAL: No GUI available.");
exit(1);
}
if (!this_->gra && !(this_->flags & 1)) {
- dbg(lvl_error,"FATAL: No graphics subsystem available.\n");
+ dbg(lvl_error,"FATAL: No graphics subsystem available.");
exit(1);
}
- dbg(lvl_info,"Connecting gui to graphics\n");
+ dbg(lvl_info,"Connecting gui to graphics");
if (this_->gui && this_->gra && gui_set_graphics(this_->gui, this_->gra)) {
struct attr attr_type_gui, attr_type_graphics;
gui_get_attr(this_->gui, attr_type, &attr_type_gui, NULL);
graphics_get_attr(this_->gra, attr_type, &attr_type_graphics, NULL);
- dbg(lvl_error,"FATAL: Failed to connect graphics '%s' to gui '%s'\n", attr_type_graphics.u.str, attr_type_gui.u.str);
+ dbg(lvl_error,"FATAL: Failed to connect graphics '%s' to gui '%s'", attr_type_graphics.u.str, attr_type_gui.u.str);
dbg(lvl_error,"Please see http://wiki.navit-project.org/index.php/Failed_to_connect_graphics_to_gui "
"for explanations and solutions\n");
exit(1);
@@ -2104,10 +2104,10 @@ navit_init(struct navit *this_)
speech.u.speech=this_->speech;
navigation_set_attr(this_->navigation, &speech);
}
- dbg(lvl_info,"Initializing graphics\n");
- dbg(lvl_info,"Setting Vehicle\n");
+ dbg(lvl_info,"Initializing graphics");
+ dbg(lvl_info,"Setting Vehicle");
navit_set_vehicle(this_, this_->vehicle);
- dbg(lvl_info,"Adding dynamic maps to mapset %p\n",this_->mapsets);
+ dbg(lvl_info,"Adding dynamic maps to mapset %p",this_->mapsets);
if (this_->mapsets) {
struct mapset_handle *msh;
ms=this_->mapsets->data;
@@ -2168,7 +2168,7 @@ navit_init(struct navit *this_)
}
navit_add_former_destinations_from_file(this_);
} else {
- dbg(lvl_error, "FATAL: No mapset available. Please add a (valid) mapset to your configuration.\n");
+ dbg(lvl_error, "FATAL: No mapset available. Please add a (valid) mapset to your configuration.");
exit(1);
}
if (this_->route) {
@@ -2186,7 +2186,7 @@ navit_init(struct navit *this_)
if (this_->route)
navigation_set_route(this_->navigation, this_->route);
}
- dbg(lvl_info,"Setting Center\n");
+ dbg(lvl_info,"Setting Center");
center_file = bookmarks_get_center_file(FALSE);
bookmarks_set_center_from_file(this_->bookmarks, center_file);
g_free(center_file);
@@ -2199,7 +2199,7 @@ navit_init(struct navit *this_)
callback_list_call_attr_1(this_->attr_cbl, attr_navit, this_);
callback=(this_->ready == 2);
this_->ready|=1;
- dbg(lvl_info,"ready=%d\n",this_->ready);
+ dbg(lvl_info,"ready=%d",this_->ready);
if (this_->ready == 3)
navit_draw_async(this_, 1);
if (callback)
@@ -2216,15 +2216,15 @@ navit_zoom_to_rect(struct navit *this_, struct coord_rect *r)
c.y=(r->rl.y+r->lu.y)/2;
transform_set_center(this_->trans, &c);
transform_get_size(this_->trans, &w, &h);
- dbg(lvl_debug,"center 0x%x,0x%x w %d h %d\n",c.x,c.y,w,h);
- dbg(lvl_debug,"%x,%x-%x,%x\n", r->lu.x,r->lu.y,r->rl.x,r->rl.y);
+ dbg(lvl_debug,"center 0x%x,0x%x w %d h %d",c.x,c.y,w,h);
+ dbg(lvl_debug,"%x,%x-%x,%x", r->lu.x,r->lu.y,r->rl.x,r->rl.y);
while (scale < 1<<20) {
struct point p1,p2;
transform_set_scale(this_->trans, scale);
transform_setup_source_rect(this_->trans);
transform(this_->trans, transform_get_projection(this_->trans), &r->lu, &p1, 1, 0, 0, NULL);
transform(this_->trans, transform_get_projection(this_->trans), &r->rl, &p2, 1, 0, 0, NULL);
- dbg(lvl_debug,"%d,%d-%d,%d\n",p1.x,p1.y,p2.x,p2.y);
+ dbg(lvl_debug,"%d,%d-%d,%d",p1.x,p1.y,p2.x,p2.y);
if (p1.x < 0 || p2.x < 0 || p1.x > w || p2.x > w ||
p1.y < 0 || p2.y < 0 || p1.y > h || p2.y > h)
scale*=2;
@@ -2232,7 +2232,7 @@ navit_zoom_to_rect(struct navit *this_, struct coord_rect *r)
break;
}
- dbg(lvl_debug,"scale=%d (0x%x) of %d (0x%x)\n",scale,scale,1<<20,1<<20);
+ dbg(lvl_debug,"scale=%d (0x%x) of %d (0x%x)",scale,scale,1<<20,1<<20);
if (this_->ready == 3)
navit_draw_async(this_,0);
}
@@ -2248,17 +2248,17 @@ navit_zoom_to_route(struct navit *this_, int orientation)
int count=0;
if (! this_->route)
return;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
map=route_get_map(this_->route);
- dbg(lvl_debug,"map=%p\n",map);
+ dbg(lvl_debug,"map=%p",map);
if (map)
mr=map_rect_new(map, NULL);
- dbg(lvl_debug,"mr=%p\n",mr);
+ dbg(lvl_debug,"mr=%p",mr);
if (mr) {
while ((item=map_rect_get_item(mr))) {
- dbg(lvl_debug,"item=%s\n", item_to_name(item->type));
+ dbg(lvl_debug,"item=%s", item_to_name(item->type));
while (item_coord_get(item, &c, 1)) {
- dbg(lvl_debug,"coord\n");
+ dbg(lvl_debug,"coord");
if (!count)
r.lu=r.rl=c;
else
@@ -2396,15 +2396,15 @@ navit_get_cursor_pnt(struct navit *this_, struct point *p, int keep_orientation,
if (this_->gra) {
padding = graphics_get_data(this_->gra, "padding");
} else
- dbg(lvl_warning, "cannot get padding: this->gra is NULL\n");
+ dbg(lvl_warning, "cannot get padding: this->gra is NULL");
transform_get_size(this_->trans, &width, &height);
- dbg(lvl_debug, "width=%d height=%d\n", width, height);
+ dbg(lvl_debug, "width=%d height=%d", width, height);
if (padding) {
width -= (padding->left + padding->right);
height -= (padding->top + padding->bottom);
- dbg(lvl_debug, "corrected for padding: width=%d height=%d\n", width, height);
+ dbg(lvl_debug, "corrected for padding: width=%d height=%d", width, height);
}
if (this_->orientation == -1 || keep_orientation) {
@@ -2431,7 +2431,7 @@ navit_get_cursor_pnt(struct navit *this_, struct point *p, int keep_orientation,
p->y += padding->top;
}
- dbg(lvl_debug, "x=%d y=%d, offset=%f\n", p->x, p->y, offset);
+ dbg(lvl_debug, "x=%d y=%d, offset=%f", p->x, p->y, offset);
return 1;
}
@@ -2521,7 +2521,7 @@ navit_set_attr_do(struct navit *this_, struct attr *attr, int init)
active.type=attr_active;
active.u.num=0;
- dbg(lvl_debug, "enter, this_=%p, attr=%p (%s), init=%d\n", this_, attr, attr_to_name(attr->type), init);
+ dbg(lvl_debug, "enter, this_=%p, attr=%p (%s), init=%d", this_, attr, attr_to_name(attr->type), init);
switch (attr->type) {
case attr_autozoom:
@@ -2534,7 +2534,7 @@ navit_set_attr_do(struct navit *this_, struct attr *attr, int init)
break;
case attr_center:
transform_from_geo(transform_get_projection(this_->trans), attr->u.coord_geo, &co);
- dbg(lvl_debug,"0x%x,0x%x\n",co.x,co.y);
+ dbg(lvl_debug,"0x%x,0x%x",co.x,co.y);
transform_set_center(this_->trans, &co);
break;
case attr_drag_bitmap:
@@ -2610,7 +2610,7 @@ navit_set_attr_do(struct navit *this_, struct attr *attr, int init)
}
break;
case attr_osd_configuration:
- dbg(lvl_debug,"setting osd_configuration to %ld (was %d)\n", attr->u.num, this_->osd_configuration);
+ dbg(lvl_debug,"setting osd_configuration to %ld (was %d)", attr->u.num, this_->osd_configuration);
attr_updated=(this_->osd_configuration != attr->u.num);
this_->osd_configuration=attr->u.num;
break;
@@ -2715,7 +2715,7 @@ navit_set_attr_do(struct navit *this_, struct attr *attr, int init)
this_->waypoints_flag=!!attr->u.num;
break;
default:
- dbg(lvl_debug, "calling generic setter method for attribute type %s\n", attr_to_name(attr->type))
+ dbg(lvl_debug, "calling generic setter method for attribute type %s", attr_to_name(attr->type))
return navit_object_set_attr((struct navit_object *) this_, attr);
}
if (attr_updated && !init) {
@@ -2933,7 +2933,7 @@ navit_get_attr(struct navit *this_, enum attr_type type, struct attr *attr, stru
attr->u.num=this_->waypoints_flag;
break;
default:
- dbg(lvl_debug, "calling generic getter method for attribute type %s\n", attr_to_name(type))
+ dbg(lvl_debug, "calling generic getter method for attribute type %s", attr_to_name(type))
return navit_object_get_attr((struct navit_object *) this_, type, attr, iter);
}
attr->type=type;
@@ -3433,9 +3433,9 @@ navit_layout_switch(struct navit *n)
//Check that we aren't calculating too fast
if (vehicle_get_attr(n->vehicle->vehicle, attr_position_time_iso8601,&iso8601_attr,NULL)==1) {
currTs=iso8601_to_secs(iso8601_attr.u.str);
- dbg(lvl_debug,"currTs: %u:%u\n",currTs%86400/3600,((currTs%86400)%3600)/60);
+ dbg(lvl_debug,"currTs: %u:%u",currTs%86400/3600,((currTs%86400)%3600)/60);
}
- dbg(lvl_debug,"prevTs: %u:%u\n",n->prevTs%86400/3600,((n->prevTs%86400)%3600)/60);
+ dbg(lvl_debug,"prevTs: %u:%u",n->prevTs%86400/3600,((n->prevTs%86400)%3600)/60);
if (n->auto_switch == FALSE)
return;
@@ -3456,17 +3456,17 @@ navit_layout_switch(struct navit *n)
}
//We calculate sunrise anyway, cause it is needed both for day and for night
if (__sunriset__(year,month,day,geo_attr.u.coord_geo->lng,geo_attr.u.coord_geo->lat,-5,1,&trise,&tset)!=0) {
- dbg(lvl_debug,"near the pole sun never rises/sets, so we should never switch profiles\n");
- dbg(lvl_debug,"trise: %u:%u\n",HOURS(trise),MINUTES(trise));
- dbg(lvl_debug,"tset: %u:%u\n",HOURS(tset),MINUTES(tset));
+ dbg(lvl_debug,"near the pole sun never rises/sets, so we should never switch profiles");
+ dbg(lvl_debug,"trise: %u:%u",HOURS(trise),MINUTES(trise));
+ dbg(lvl_debug,"tset: %u:%u",HOURS(tset),MINUTES(tset));
n->prevTs=currTs;
return;
}
trise_actual=trise;
- dbg(lvl_debug,"trise: %u:%u\n",HOURS(trise),MINUTES(trise));
- dbg(lvl_debug,"tset: %u:%u\n",HOURS(tset),MINUTES(tset));
- dbg(lvl_debug,"dayname = %s, name =%s \n",l->dayname, l->name);
- dbg(lvl_debug,"nightname = %s, name = %s \n",l->nightname, l->name);
+ dbg(lvl_debug,"trise: %u:%u",HOURS(trise),MINUTES(trise));
+ dbg(lvl_debug,"tset: %u:%u",HOURS(tset),MINUTES(tset));
+ dbg(lvl_debug,"dayname = %s, name =%s ",l->dayname, l->name);
+ dbg(lvl_debug,"nightname = %s, name = %s ",l->nightname, l->name);
if (HOURS(trise)*60+MINUTES(trise)<(currTs%86400)/60) {
after_sunrise = TRUE;
}
@@ -3477,10 +3477,10 @@ navit_layout_switch(struct navit *n)
}
if (after_sunrise && !after_sunset && l->dayname) {
navit_set_layout_by_name(n,l->dayname);
- dbg(lvl_debug,"layout set to day\n");
+ dbg(lvl_debug,"layout set to day");
}else if (after_sunset && l->nightname) {
navit_set_layout_by_name(n,l->nightname);
- dbg(lvl_debug,"layout set to night\n");
+ dbg(lvl_debug,"layout set to night");
}
n->prevTs=currTs;
}
@@ -3514,7 +3514,7 @@ void navit_cmd_switch_layout_day_night(struct navit *this_, char *function, stru
return;
}
- dbg(lvl_debug," called with mode =%s\n",in[0]->u.str);
+ dbg(lvl_debug," called with mode =%s",in[0]->u.str);
if (!this_->layout_current)
return;
@@ -3534,26 +3534,26 @@ void navit_cmd_switch_layout_day_night(struct navit *this_, char *function, stru
if (this_->layout_current->dayname) {
navit_set_layout_by_name(this_,this_->layout_current->dayname);
this_->auto_switch = FALSE;
- dbg(lvl_debug,"toggeled layout to = %s\n",this_->layout_current->name);
+ dbg(lvl_debug,"toggeled layout to = %s",this_->layout_current->name);
}
else if (this_->layout_current->nightname) {
navit_set_layout_by_name(this_,this_->layout_current->nightname);
this_->auto_switch = FALSE;
- dbg(lvl_debug,"toggeled layout to = %s\n",this_->layout_current->name);
+ dbg(lvl_debug,"toggeled layout to = %s",this_->layout_current->name);
}
}
else if (!strcmp(in[0]->u.str,"manual_day") && this_->layout_current->dayname) {
navit_set_layout_by_name(this_,this_->layout_current->dayname);
this_->auto_switch = FALSE;
- dbg(lvl_debug,"switched layout to = %s\n",this_->layout_current->name);
+ dbg(lvl_debug,"switched layout to = %s",this_->layout_current->name);
}
else if (!strcmp(in[0]->u.str,"manual_night") && this_->layout_current->nightname) {
navit_set_layout_by_name(this_,this_->layout_current->nightname);
this_->auto_switch = FALSE;
- dbg(lvl_debug,"switched layout to = %s\n",this_->layout_current->name);
+ dbg(lvl_debug,"switched layout to = %s",this_->layout_current->name);
}
- dbg(lvl_debug,"auto = %i\n",this_->auto_switch);
+ dbg(lvl_debug,"auto = %i",this_->auto_switch);
return;
}
@@ -3668,7 +3668,7 @@ int navit_get_blocked(struct navit *this_)
void
navit_destroy(struct navit *this_)
{
- dbg(lvl_debug,"enter %p\n",this_);
+ dbg(lvl_debug,"enter %p",this_);
graphics_draw_cancel(this_->gra, this_->displaylist);
callback_list_call_attr_1(this_->attr_cbl, attr_destroy, this_);
attr_list_free(this_->attrs);
diff --git a/navit/osd.c b/navit/osd.c
index f2ac701d1..32269700e 100644
--- a/navit/osd.c
+++ b/navit/osd.c
@@ -54,7 +54,7 @@ osd_new(struct attr *parent, struct attr **attrs)
return NULL;
new=plugin_get_category_osd(type->u.str);
if (! new) {
- dbg(lvl_error, "invalid OSD type '%s'\n", type->u.str);
+ dbg(lvl_error, "invalid OSD type '%s'", type->u.str);
return NULL;
}
o=g_new0(struct osd, 1);
@@ -72,7 +72,7 @@ osd_new(struct attr *parent, struct attr **attrs)
g_free(o);
o=NULL;
}
- dbg(lvl_debug,"new osd %p\n",o);
+ dbg(lvl_debug,"new osd %p",o);
return o;
}
@@ -131,7 +131,7 @@ osd_evaluate_command(struct osd_item *this, struct navit *nav)
struct attr navit;
navit.type=attr_navit;
navit.u.navit=nav;
- dbg(lvl_debug, "calling command '%s'\n", this->command);
+ dbg(lvl_debug, "calling command '%s'", this->command);
command_evaluate(&navit, this->command);
}
@@ -192,14 +192,14 @@ osd_std_calculate_sizes(struct osd_item *item, int w, int h)
if (item->gr) {
padding = graphics_get_data(item->gr, "padding");
if (padding) {
- dbg(lvl_debug, "Got padding=%p for item=%p (item->gr=%p): left=%d top=%d right=%d bottom=%d\n",
+ dbg(lvl_debug, "Got padding=%p for item=%p (item->gr=%p): left=%d top=%d right=%d bottom=%d",
padding, item, item->gr, padding->left, padding->top, padding->right, padding->bottom);
} else {
- dbg(lvl_debug, "Got padding=%p for item=%p (item->gr=%p)\n",
+ dbg(lvl_debug, "Got padding=%p for item=%p (item->gr=%p)",
padding, item, item->gr);
}
} else
- dbg(lvl_warning, "cannot get padding for item=%p: item->gr is NULL\n", item);
+ dbg(lvl_warning, "cannot get padding for item=%p: item->gr is NULL", item);
/* reduce w and h by total padding in the respective dimension */
if (padding) {
@@ -260,12 +260,12 @@ osd_std_keypress(struct osd_item *item, struct navit *nav, char *key)
{
#if 0
int i;
- dbg(lvl_debug,"key=%s\n",key);
+ dbg(lvl_debug,"key=%s",key);
for (i = 0 ; i < strlen(key) ; i++) {
- dbg(lvl_debug,"key:0x%02x\n",key[i]);
+ dbg(lvl_debug,"key:0x%02x",key[i]);
}
for (i = 0 ; i < strlen(item->accesskey) ; i++) {
- dbg(lvl_debug,"accesskey:0x%02x\n",item->accesskey[i]);
+ dbg(lvl_debug,"accesskey:0x%02x",item->accesskey[i]);
}
#endif
if ( ! graphics_is_disabled(item->gr) && item->accesskey && key && !strcmp(key, item->accesskey))
@@ -289,14 +289,14 @@ osd_std_reconfigure(struct osd_item *item, struct command_saved *cs)
{
char *err = NULL; /* Error description */
- dbg(lvl_debug, "enter, item=%p, cs=%p\n", item, cs);
+ dbg(lvl_debug, "enter, item=%p, cs=%p", item, cs);
if (!command_saved_error(cs)) {
item->configured = !! command_saved_get_int(cs);
if (item->gr && !(item->flags & DISABLE_OVERLAY))
graphics_overlay_disable(item->gr, !item->configured);
} else {
err = command_error_to_text(command_saved_error(cs));
- dbg(lvl_error, "Error in saved command: %s, cs=%p.\n", err, cs);
+ dbg(lvl_error, "Error in saved command: %s, cs=%p.", err, cs);
g_free(err);
}
}
@@ -387,7 +387,7 @@ osd_std_config(struct osd_item *item, struct navit *navit)
struct attr attr;
char *err = NULL; /* Error description */
- dbg(lvl_debug, "enter, item=%p, enable_cs=%p\n", item, item->enable_cs);
+ dbg(lvl_debug, "enter, item=%p, enable_cs=%p", item, item->enable_cs);
if (item->enable_cs) {
item->reconfig_cb = callback_new_1(callback_cast(osd_std_reconfigure), item);
command_saved_set_cb(item->enable_cs, item->reconfig_cb);
@@ -396,7 +396,7 @@ osd_std_config(struct osd_item *item, struct navit *navit)
item->configured = !! command_saved_get_int(item->enable_cs);
} else {
err = command_error_to_text(command_saved_error(item->enable_cs));
- dbg(lvl_error, "Error in saved command: %s, item=%p.\n", err, item);
+ dbg(lvl_error, "Error in saved command: %s, item=%p.", err, item);
g_free(err);
}
} else {
@@ -412,7 +412,7 @@ osd_std_config(struct osd_item *item, struct navit *navit)
void
osd_set_std_config(struct navit *nav, struct osd_item *item)
{
- dbg(lvl_debug, "enter, item=%p\n", item);
+ dbg(lvl_debug, "enter, item=%p", item);
item->cb = callback_new_attr_2(callback_cast(osd_std_config), attr_osd_configuration, item, nav);
navit_add_callback(nav, item->cb);
osd_std_config(item, nav);
@@ -422,7 +422,7 @@ void
osd_set_keypress(struct navit *nav, struct osd_item *item)
{
struct graphics *navit_gr = navit_get_graphics(nav);
- dbg(lvl_info,"accesskey %s\n",item->accesskey);
+ dbg(lvl_info,"accesskey %s",item->accesskey);
if (item->accesskey) {
item->keypress_cb=callback_new_attr_2(callback_cast(osd_std_keypress), attr_keypress, item, nav);
graphics_add_callback(navit_gr, item->keypress_cb);
@@ -453,12 +453,12 @@ osd_set_std_graphic(struct navit *nav, struct osd_item *item, struct osd_priv *p
padding = graphics_get_data(navit_gr, "padding");
if (padding) {
- dbg(lvl_debug, "Got padding=%p for item=%p: left=%d top=%d right=%d bottom=%d\n",
+ dbg(lvl_debug, "Got padding=%p for item=%p: left=%d top=%d right=%d bottom=%d",
padding, item, padding->left, padding->top, padding->right, padding->bottom);
w -= (padding->left + padding->right);
h -= (padding->top + padding->bottom);
} else
- dbg(lvl_debug, "Padding is NULL\n");
+ dbg(lvl_debug, "Padding is NULL");
osd_std_calculate_sizes(item, w, h);
diff --git a/navit/osd/core/osd_core.c b/navit/osd/core/osd_core.c
index aca868f1d..7e3a0d737 100644
--- a/navit/osd/core/osd_core.c
+++ b/navit/osd/core/osd_core.c
@@ -785,7 +785,7 @@ static void draw_aligned_osd_text(char *buffer, int align, struct osd_item *osd_
last++;
}
- dbg(lvl_debug,"align=%d\n", align);
+ dbg(lvl_debug,"align=%d", align);
switch (align & 51) {
case 1:
p.y=0;
@@ -1688,7 +1688,7 @@ osd_button_draw(struct osd_priv_common *opc, struct navit *nav)
this->img = graphics_image_new_scaled(gra, this->src, opc->osd_item.w, opc->osd_item.h);
if (!this->img) {
- dbg(lvl_warning, "failed to load '%s'\n", this->src);
+ dbg(lvl_warning, "failed to load '%s'", this->src);
return;
}
@@ -1721,16 +1721,16 @@ osd_button_init(struct osd_priv_common *opc, struct navit *nav)
opc->osd_item.w = -1;
opc->osd_item.h = -1;
}
- dbg(lvl_debug, "enter\n");
- dbg(lvl_debug, "Get: %s, %d, %d, %d, %d\n", this->src, opc->osd_item.rel_w, opc->osd_item.rel_h, opc->osd_item.w, opc->osd_item.h);
+ dbg(lvl_debug, "enter");
+ dbg(lvl_debug, "Get: %s, %d, %d, %d, %d", this->src, opc->osd_item.rel_w, opc->osd_item.rel_h, opc->osd_item.w, opc->osd_item.h);
this->img = graphics_image_new_scaled(gra, this->src, opc->osd_item.w, opc->osd_item.h);
if (!this->img) {
- dbg(lvl_warning, "failed to load '%s'\n", this->src);
+ dbg(lvl_warning, "failed to load '%s'", this->src);
return;
}
else
{
- dbg(lvl_debug,"Got %s: %d, %d\n", this->src, this->img->width, this->img->height);
+ dbg(lvl_debug,"Got %s: %d, %d", this->src, this->img->width, this->img->height);
}
osd_button_adjust_sizes(opc, this->img);
if (this->use_overlay) {
@@ -1784,7 +1784,7 @@ osd_button_set_attr(struct osd_priv_common *opc, struct attr* attr)
gra = navit_get_graphics(nav);
this_->img = graphics_image_new_scaled(gra, this_->src, opc->osd_item.w, opc->osd_item.h);
if (!this_->img) {
- dbg(lvl_warning, "failed to load '%s'\n", this_->src);
+ dbg(lvl_warning, "failed to load '%s'", this_->src);
return 0;
}
@@ -1825,7 +1825,7 @@ osd_button_new(struct navit *nav, struct osd_methods *meth,
osd_set_std_attr(attrs, &opc->osd_item, this->use_overlay ? TRANSPARENT_BG:(TRANSPARENT_BG|DISABLE_OVERLAY));
if (!opc->osd_item.command) {
- dbg(lvl_error, "no command\n");
+ dbg(lvl_error, "no command");
goto error;
}
attr = attr_search(attrs, NULL, attr_src_dir);
@@ -1835,7 +1835,7 @@ osd_button_new(struct navit *nav, struct osd_methods *meth,
this->src_dir=NULL;
attr = attr_search(attrs, NULL, attr_src);
if (!attr) {
- dbg(lvl_error, "no src\n");
+ dbg(lvl_error, "no src");
goto error;
}
@@ -1861,10 +1861,10 @@ osd_image_init(struct osd_priv_common *opc, struct navit *nav)
struct osd_button *this = (struct osd_button *)opc->data;
struct graphics *gra = navit_get_graphics(nav);
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
this->img = graphics_image_new(gra, this->src);
if (!this->img) {
- dbg(lvl_warning, "failed to load '%s'\n", this->src);
+ dbg(lvl_warning, "failed to load '%s'", this->src);
return;
}
osd_button_adjust_sizes(opc, this->img);
@@ -1914,7 +1914,7 @@ osd_image_new(struct navit *nav, struct osd_methods *meth,
attr = attr_search(attrs, NULL, attr_src);
if (!attr) {
- dbg(lvl_error, "no src\n");
+ dbg(lvl_error, "no src");
goto error;
}
@@ -1974,13 +1974,13 @@ static void osd_navigation_status_draw_do(struct osd_priv_common *opc, int statu
if (do_draw) {
osd_fill_with_bgcolor(&opc->osd_item);
image = g_strdup_printf(this->icon_src, nav_status_to_text(status2));
- dbg(lvl_debug, "image=%s\n", image);
+ dbg(lvl_debug, "image=%s", image);
gr_image =
graphics_image_new_scaled(opc->osd_item.gr,
image, this->icon_w,
this->icon_h);
if (!gr_image) {
- dbg(lvl_error,"failed to load %s in %dx%d\n",image,this->icon_w,this->icon_h);
+ dbg(lvl_error,"failed to load %s in %dx%d",image,this->icon_w,this->icon_h);
g_free(image);
image = graphics_icon_path("unknown.png");
gr_image =
@@ -1991,7 +1991,7 @@ static void osd_navigation_status_draw_do(struct osd_priv_common *opc, int statu
this->
icon_h);
}
- dbg(lvl_debug, "gr_image=%p\n", gr_image);
+ dbg(lvl_debug, "gr_image=%p", gr_image);
if (gr_image) {
p.x =
(opc->osd_item.w -
@@ -2049,7 +2049,7 @@ static void osd_navigation_status_init(struct osd_priv_common *opc, struct navit
struct navigation *nav = NULL;
struct attr attr;
- dbg(lvl_debug, "enter, opc=%p\n", opc);
+ dbg(lvl_debug, "enter, opc=%p", opc);
osd_set_std_graphic(navit, &opc->osd_item, (struct osd_priv *)opc);
if (navit)
nav = navit_get_navigation(navit);
@@ -2059,7 +2059,7 @@ static void osd_navigation_status_init(struct osd_priv_common *opc, struct navit
osd_navigation_status_draw_do(opc, attr.u.num);
}
else
- dbg(lvl_error, "navigation instance is NULL, OSD will never update\n");
+ dbg(lvl_error, "navigation instance is NULL, OSD will never update");
//navit_add_callback(nav, callback_new_attr_1(callback_cast(osd_std_click), attr_button, &opc->osd_item)); // FIXME do we need this?
}
@@ -2159,7 +2159,7 @@ osd_nav_next_turn_draw(struct osd_priv_common *opc, struct navit *navit,
&& (item->type == type_nav_position || item->type == type_nav_none || level-- > 0));
if (item) {
name = item_to_name(item->type);
- dbg(lvl_debug, "name=%s\n", name);
+ dbg(lvl_debug, "name=%s", name);
if (this->active != 1 || this->last_name != name) {
this->active = 1;
this->last_name = name;
@@ -2178,13 +2178,13 @@ osd_nav_next_turn_draw(struct osd_priv_common *opc, struct navit *navit,
osd_fill_with_bgcolor(&opc->osd_item);
if (this->active) {
image = g_strdup_printf(this->icon_src, name);
- dbg(lvl_debug, "image=%s\n", image);
+ dbg(lvl_debug, "image=%s", image);
gr_image =
graphics_image_new_scaled(opc->osd_item.gr,
image, this->icon_w,
this->icon_h);
if (!gr_image) {
- dbg(lvl_error,"failed to load %s in %dx%d\n",image,this->icon_w,this->icon_h);
+ dbg(lvl_error,"failed to load %s in %dx%d",image,this->icon_w,this->icon_h);
g_free(image);
image = graphics_icon_path("unknown.png");
gr_image =
@@ -2195,7 +2195,7 @@ osd_nav_next_turn_draw(struct osd_priv_common *opc, struct navit *navit,
this->
icon_h);
}
- dbg(lvl_debug, "gr_image=%p\n", gr_image);
+ dbg(lvl_debug, "gr_image=%p", gr_image);
if (gr_image) {
p.x =
(opc->osd_item.w -
@@ -2302,7 +2302,7 @@ osd_nav_toggle_announcer_draw(struct osd_priv_common *opc, struct navit *navit,
if (!navit_get_attr(navit, attr_speech, &speechattr, NULL))
{
- dbg(lvl_error, "No speech plugin available, toggle_announcer disabled.\n");
+ dbg(lvl_error, "No speech plugin available, toggle_announcer disabled.");
return;
}
if (!speech_get_attr(speechattr.u.speech, attr_active, &attr, NULL))
@@ -2335,7 +2335,7 @@ osd_nav_toggle_announcer_draw(struct osd_priv_common *opc, struct navit *navit,
gr_image = graphics_image_new_scaled(opc->osd_item.gr, path, this->icon_w, this->icon_h);
}
- dbg(lvl_debug, "gr_image=%p\n", gr_image);
+ dbg(lvl_debug, "gr_image=%p", gr_image);
if (gr_image)
{
@@ -3258,8 +3258,8 @@ osd_text_draw(struct osd_priv_common *opc, struct navit *navit, struct vehicle *
}
if (item) {
- dbg(lvl_debug,"name %s\n", item_to_name(item->type));
- dbg(lvl_debug,"type %s\n", attr_to_name(oti->attr_typ));
+ dbg(lvl_debug,"name %s", item_to_name(item->type));
+ dbg(lvl_debug,"type %s", attr_to_name(oti->attr_typ));
if (item_attr_get(item, oti->attr_typ, &attr))
value=osd_text_format_attr(&attr, oti->format, imperial);
}
@@ -3371,7 +3371,7 @@ osd_text_draw(struct osd_priv_common *opc, struct navit *navit, struct vehicle *
last++;
}
- dbg(lvl_debug,"this->align=%d\n", this->align);
+ dbg(lvl_debug,"this->align=%d", this->align);
switch (this->align & 51) {
case 1:
p.y=0;
@@ -3654,7 +3654,7 @@ osd_gps_status_draw(struct osd_priv_common *opc, struct navit *navit,
case 2:
strength=2;
if (vehicle_get_attr(vehicle_attr.u.vehicle, attr_position_sats_used, &attr, NULL)) {
- dbg(lvl_debug,"num=%ld\n", attr.u.num);
+ dbg(lvl_debug,"num=%ld", attr.u.num);
if (attr.u.num >= 3)
strength=attr.u.num-1;
if (strength > 5)
@@ -4043,7 +4043,7 @@ osd_auxmap_draw(struct osd_priv_common *opc)
memset(&sel, 0, sizeof(sel));
sel.u.p_rect.rl.x=opc->osd_item.w;
sel.u.p_rect.rl.y=opc->osd_item.h;
- dbg(lvl_debug,"osd_auxmap_draw: sel.u.p_rect.rl=(%d, %d)\n", opc->osd_item.w, opc->osd_item.h);
+ dbg(lvl_debug,"osd_auxmap_draw: sel.u.p_rect.rl=(%d, %d)", opc->osd_item.w, opc->osd_item.h);
transform_set_screen_selection(this->trans, &sel);
graphics_set_rect(opc->osd_item.gr, &sel.u.p_rect);
}
diff --git a/navit/plugin.c b/navit/plugin.c
index aae09c470..2b4749efb 100644
--- a/navit/plugin.c
+++ b/navit/plugin.c
@@ -177,20 +177,20 @@ plugin_load(struct plugin *pl)
GModule *mod;
if (pl->mod) {
- dbg(lvl_debug,"'%s' already loaded, returning\n", pl->name);
+ dbg(lvl_debug,"'%s' already loaded, returning", pl->name);
return 1;
}
mod=g_module_open(pl->name, G_MODULE_BIND_LOCAL | (pl->lazy ? G_MODULE_BIND_LAZY : 0));
if (! mod) {
- dbg(lvl_error,"can't load '%s', Error '%s'\n", pl->name, g_module_error());
+ dbg(lvl_error,"can't load '%s', Error '%s'", pl->name, g_module_error());
return 0;
}
if (!g_module_symbol(mod, "plugin_init", &init)) {
- dbg(lvl_error,"can't load '%s', plugin_init not found\n", pl->name);
+ dbg(lvl_error,"can't load '%s', plugin_init not found", pl->name);
g_module_close(mod);
return 0;
} else {
- dbg(lvl_debug, "loaded module %s\n", pl->name);
+ dbg(lvl_debug, "loaded module %s", pl->name);
pl->mod=mod;
pl->init=init;
}
@@ -285,7 +285,7 @@ plugin_new(struct attr *parent, struct attr **attrs) {
pls=parent->u.plugins;
if (! (path_attr=attr_search(attrs, NULL, attr_path))) {
- dbg(lvl_error,"missing path\n");
+ dbg(lvl_error,"missing path");
return NULL;
}
if ( (attr=attr_search(attrs, NULL, attr_active))) {
@@ -297,20 +297,20 @@ plugin_new(struct attr *parent, struct attr **attrs) {
if ( (attr=attr_search(attrs, NULL, attr_ondemand))) {
ondemand=attr->u.num;
}
- dbg(lvl_debug, "path=\"%s\", active=%d, lazy=%d, ondemand=%d\n",path_attr->u.str, active, lazy, ondemand);
+ dbg(lvl_debug, "path=\"%s\", active=%d, lazy=%d, ondemand=%d",path_attr->u.str, active, lazy, ondemand);
we=file_wordexp_new(path_attr->u.str);
count=file_wordexp_get_count(we);
array=file_wordexp_get_array(we);
- dbg(lvl_info,"expanded to %d words\n",count);
+ dbg(lvl_info,"expanded to %d words",count);
if (count != 1 || file_exists(array[0])) {
for (i = 0 ; i < count ; i++) {
name=array[i];
- dbg(lvl_info,"found plugin module file [%d]: '%s'\n", i, name);
+ dbg(lvl_info,"found plugin module file [%d]: '%s'", i, name);
if (! (pls && (pl=g_hash_table_lookup(pls->hash, name)))) {
pl=plugin_new_from_path(name);
if (! pl) {
- dbg(lvl_error,"failed to create plugin from file '%s'\n", name);
+ dbg(lvl_error,"failed to create plugin from file '%s'", name);
continue;
}
if (pls) {
@@ -362,7 +362,7 @@ plugins_init(struct plugins *pls)
l=g_list_next(l);
}
} else {
- dbg(lvl_error, "Warning: No plugins found. Is Navit installed correctly?\n");
+ dbg(lvl_error, "Warning: No plugins found. Is Navit installed correctly?");
}
#endif
}
@@ -405,7 +405,7 @@ plugin_get_category(enum plugin_category category, const char *category_name, co
char *mod_name, *filename=NULL, *corename=NULL;
void *result=NULL;
- dbg(lvl_debug, "category=\"%s\", name=\"%s\"\n", category_name, name);
+ dbg(lvl_debug, "category=\"%s\", name=\"%s\"", category_name, name);
if ((result=find_by_name(category, name))) {
return result;
@@ -422,7 +422,7 @@ plugin_get_category(enum plugin_category category, const char *category_name, co
else
mod_name=pl->name;
if (!g_ascii_strncasecmp(mod_name, filename, strlen(filename)) || !g_ascii_strncasecmp(mod_name, corename, strlen(corename))) {
- dbg(lvl_debug, "Loading module \"%s\"\n",pl->name) ;
+ dbg(lvl_debug, "Loading module \"%s\"",pl->name) ;
if (plugin_get_active(pl))
if (!plugin_load(pl))
plugin_set_active(pl, 0);
diff --git a/navit/plugin/j1850/j1850.c b/navit/plugin/j1850/j1850.c
index 26e18057d..046087fbe 100644
--- a/navit/plugin/j1850/j1850.c
+++ b/navit/plugin/j1850/j1850.c
@@ -112,7 +112,7 @@ void write_to_serial_port(unsigned char *cmd, int device)
n_written += write( device, &cmd[n_written], 1 );
}
while (cmd[n_written-1] != '\r' && n_written > 0);
- dbg(lvl_info,"sent %s to the serial port\n",cmd);
+ dbg(lvl_info,"sent %s to the serial port",cmd);
}
/**
@@ -152,7 +152,7 @@ j1850_idle(struct j1850 *j1850)
// Make sure we sent all init commands before trying to read
if ( init_string[j1850->init_string_index])
{
- dbg(lvl_info,"Sending next init command : %s\n",init_string[j1850->init_string_index]);
+ dbg(lvl_info,"Sending next init command : %s",init_string[j1850->init_string_index]);
if (j1850->device > 0 ){
write_to_serial_port(init_string[j1850->init_string_index++],j1850->device);
}
@@ -177,9 +177,9 @@ j1850_idle(struct j1850 *j1850)
n = read( j1850->device, &buf, 1 );
if(n == -1) {
- dbg(lvl_debug,"x\n");
+ dbg(lvl_debug,"x");
} else if (n==0) {
- dbg(lvl_debug,".\n");
+ dbg(lvl_debug,".");
} else {
if( buf == 13 ) {
gettimeofday(&tv, NULL);
@@ -205,25 +205,25 @@ j1850_idle(struct j1850 *j1850)
if (strcmp(j1850->message, "3D110000EE") == 0) {
// noise
} else if (strcmp(j1850->message, "3D1120009B") == 0) {
- dbg(lvl_error,"L1\n");
+ dbg(lvl_error,"L1");
command_evaluate(&navit, "gui.spotify_volume_up()" );
} else if (strcmp(j1850->message, "3D110080C8") == 0) {
- dbg(lvl_error,"L2\n");
+ dbg(lvl_error,"L2");
command_evaluate(&navit, "gui.spotify_volume_toggle()" );
} else if (strcmp(j1850->message, "3D1110005A") == 0) {
- dbg(lvl_error,"L3\n");
+ dbg(lvl_error,"L3");
command_evaluate(&navit, "gui.spotify_volume_down()" );
} else if (strcmp(j1850->message, "3D110400C3") == 0) {
- dbg(lvl_error,"R1\n");
+ dbg(lvl_error,"R1");
command_evaluate(&navit, "gui.spotify_next_track()" );
} else if (strcmp(j1850->message, "3D110002D4") == 0) {
- dbg(lvl_error,"R2\n");
+ dbg(lvl_error,"R2");
command_evaluate(&navit, "gui.spotify_toggle()" );
} else if (strcmp(j1850->message, "3D11020076") == 0) {
- dbg(lvl_error,"R3\n");
+ dbg(lvl_error,"R3");
command_evaluate(&navit, "gui.spotify_previous_track()" );
} else {
- dbg(lvl_error,"Got button from %s\n", j1850->message);
+ dbg(lvl_error,"Got button from %s", j1850->message);
}
} else if( strncmp(header,"72",2)==0 ) {
char * data=strndup(j1850->message+2, 8);
@@ -375,11 +375,11 @@ void send_and_read(unsigned char *cmd, int USB)
while( buf != '\r' && n > 0);
if (n < 0) {
- dbg(lvl_error,"Read error\n");
+ dbg(lvl_error,"Read error");
} else if (n == 0) {
- dbg(lvl_error,"Nothing to read?\n");
+ dbg(lvl_error,"Nothing to read?");
} else {
- dbg(lvl_error,"Response : \n");
+ dbg(lvl_error,"Response : ");
}
}
@@ -400,7 +400,7 @@ j1850_init_serial_port(struct j1850 *j1850)
j1850->device = open( "/dev/ttyUSB0", O_RDWR| O_NOCTTY );
if ( j1850->device < 0 )
{
- dbg(lvl_error,"Can't open port\n");
+ dbg(lvl_error,"Can't open port");
j1850->idle=event_add_timeout(100, 1, j1850->callback);
return;
}
@@ -412,7 +412,7 @@ j1850_init_serial_port(struct j1850 *j1850)
/* Error Handling */
if ( tcgetattr ( j1850->device, &tty ) != 0 )
{
- dbg(lvl_error,"Error\n");
+ dbg(lvl_error,"Error");
return;
}
@@ -441,11 +441,11 @@ j1850_init_serial_port(struct j1850 *j1850)
tcflush( j1850->device, TCIFLUSH );
if ( tcsetattr ( j1850->device, TCSANOW, &tty ) != 0)
{
- dbg(lvl_error,"Flush error\n");
+ dbg(lvl_error,"Flush error");
return;
}
- dbg(lvl_error,"Port init ok\n");
+ dbg(lvl_error,"Port init ok");
// For the init part, we want to wait 1sec before each init string
j1850->idle=event_add_timeout(1000, 1, j1850->callback);
}
@@ -470,7 +470,7 @@ osd_j1850_new(struct navit *nav, struct osd_methods *meth,
time_t current_time = time(NULL);
// FIXME : make sure that the directory we log to exists!
this->filename=g_strdup_printf("/home/navit/.navit/obd/%ld.log",(long)current_time);
- dbg(lvl_error,"Will log to %s\n", this->filename);
+ dbg(lvl_error,"Will log to %s", this->filename);
this->init_string_index=0;
struct attr *attr;
this->osd_item.p.x = 120;
diff --git a/navit/plugin/pedestrian/pedestrian.c b/navit/plugin/pedestrian/pedestrian.c
index 7e5a4361d..93ba527d2 100644
--- a/navit/plugin/pedestrian/pedestrian.c
+++ b/navit/plugin/pedestrian/pedestrian.c
@@ -92,13 +92,13 @@ pedestrian_rocket_idle(struct rocket *rocket)
transform_set_hog(rocket->trans, rocket->hog);
graphics_displaylist_draw(rocket->gra, rocket->dl, rocket->trans, rocket->layout, 0);
rocket->v+=rocket->a-rocket->g;
- dbg(lvl_debug,"enter v=%d\n",rocket->v);
+ dbg(lvl_debug,"enter v=%d",rocket->v);
if (rocket->t > 0)
rocket->t--;
else
rocket->a=0;
rocket->hog+=rocket->v/rocket->vscale;
- dbg(lvl_debug,"hog=%d\n",rocket->hog);
+ dbg(lvl_debug,"hog=%d",rocket->hog);
if (rocket->hog < 0) {
transform_set_hog(rocket->trans, 0);
transform_set_order_base(rocket->trans, 14);
@@ -192,7 +192,7 @@ osd_rocket_init(struct navit *nav)
if (navit_get_attr(nav, attr_layout, &attr, NULL))
rocket->layout=attr.u.layout;
if (navit_get_attr(nav, attr_callback_list, &attr, NULL)) {
- dbg(lvl_debug,"ok\n");
+ dbg(lvl_debug,"ok");
command_add_table(attr.u.callback_list, commands, sizeof(commands)/sizeof(struct command_table), rocket);
}
}
@@ -207,7 +207,7 @@ osd_marker_draw(struct marker *this, struct navit *nav)
#if 0
struct attr graphics;
struct point p;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (!navit_get_attr(nav, attr_graphics, &graphics, NULL))
return;
p.x=40;
@@ -401,7 +401,7 @@ static void
map_route_occluded_check_buildings(struct coord *c0)
{
struct building *b=buildings;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
int i,count;
struct coord *c;
#if 1
@@ -414,7 +414,7 @@ map_route_occluded_check_buildings(struct coord *c0)
count=b->sd->count;
if (c[count-1].x == c[0].x && c[count-1].y == c[0].y) {
#if 0
- dbg(lvl_debug,"closed\n");
+ dbg(lvl_debug,"closed");
#endif
count--;
}
@@ -457,11 +457,11 @@ intersect(struct coord *p1, struct coord *p2, struct coord *p3, struct coord *p4
num=-num;
den=-den;
}
- dbg(lvl_debug,"num=%f den=%f\n", num, den);
+ dbg(lvl_debug,"num=%f den=%f", num, den);
if (i) {
i->x=p1->x+(num/den)*(p2->x-p1->x)+0.5;
i->y=p1->y+(num/den)*(p2->y-p1->y)+0.5;
- dbg(lvl_debug,"i=0x%x,0x%x\n", i->x, i->y);
+ dbg(lvl_debug,"i=0x%x,0x%x", i->x, i->y);
if (debug2)
fprintf(debug2, "0x%x 0x%x type=town_label_5e3\n", i->x, i->y);
}
@@ -489,18 +489,18 @@ is_visible_line(struct coord *c0, struct coord *c1, struct coord *c2)
struct building *b=buildings;
struct coord cn;
#ifdef DEBUG_VISIBLE
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
#endif
while (b) {
if (side(&b->left, &b->right, c1) < 0 || side(&b->left, &b->right, c2) < 0) {
#ifdef DEBUG_VISIBLE
- dbg(lvl_debug,"sides left: start %d end %d right: start %d end %d\n", side(c0, &b->left, c1), side(c0, &b->left, c2), side(c0, &b->right, c1), side(c0, &b->right, c2));
+ dbg(lvl_debug,"sides left: start %d end %d right: start %d end %d", side(c0, &b->left, c1), side(c0, &b->left, c2), side(c0, &b->right, c1), side(c0, &b->right, c2));
#endif
for (;;) {
if (side(c0, &b->left, c1) <= 0) {
if (side(c0, &b->left, c2) > 0) {
#ifdef DEBUG_VISIBLE
- dbg(lvl_debug,"visible: start is left of left corner and end is right of left corner, clipping end\n");
+ dbg(lvl_debug,"visible: start is left of left corner and end is right of left corner, clipping end");
#endif
res=intersect(c0, &b->left, c1, c2, &cn);
if (res < 256)
@@ -516,7 +516,7 @@ is_visible_line(struct coord *c0, struct coord *c1, struct coord *c2)
if (side(c0, &b->right, c1) >= 0) {
if (side(c0, &b->right, c2) < 0) {
#ifdef DEBUG_VISIBLE
- dbg(lvl_debug,"visible: start is right of right corner and end is left of right corner, clipping end\n");
+ dbg(lvl_debug,"visible: start is right of right corner and end is left of right corner, clipping end");
#endif
res=intersect(c0, &b->right, c1, c2, &cn);
if (res < 256)
@@ -532,7 +532,7 @@ is_visible_line(struct coord *c0, struct coord *c1, struct coord *c2)
if (side(c0, &b->left, c2) <= 0) {
if (side(c0, &b->left, c1) > 0) {
#ifdef DEBUG_VISIBLE
- dbg(lvl_debug,"visible: end is left of left corner and start is right of left corner, clipping start\n");
+ dbg(lvl_debug,"visible: end is left of left corner and start is right of left corner, clipping start");
#endif
res=intersect(c0, &b->left, c1, c2, &cn);
if (res < 256)
@@ -548,7 +548,7 @@ is_visible_line(struct coord *c0, struct coord *c1, struct coord *c2)
if (side(c0, &b->right, c2) >= 0) {
if (side(c0, &b->right, c1) < 0) {
#ifdef DEBUG_VISIBLE
- dbg(lvl_debug,"visible: end is right of right corner and start is left of right corner, clipping start\n");
+ dbg(lvl_debug,"visible: end is right of right corner and start is left of right corner, clipping start");
#endif
res=intersect(c0, &b->right, c1, c2, &cn);
if (res < 256)
@@ -562,7 +562,7 @@ is_visible_line(struct coord *c0, struct coord *c1, struct coord *c2)
break;
}
#ifdef DEBUG_VISIBLE
- dbg(lvl_debug,"visible: not visible\n");
+ dbg(lvl_debug,"visible: not visible");
#endif
return 4;
}
@@ -570,7 +570,7 @@ is_visible_line(struct coord *c0, struct coord *c1, struct coord *c2)
b=b->next;
}
#ifdef DEBUG_VISIBLE
- dbg(lvl_debug,"return %d\n",ret);
+ dbg(lvl_debug,"return %d",ret);
#endif
return ret;
}
@@ -579,7 +579,7 @@ static void
map_route_occluded_coord_rewind(void *priv_data)
{
struct map_rect_priv *mr = priv_data;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
mr->idx=mr->idx_base;
mr->first=1;
mr->lseg_done=mr->lseg_done_base;
@@ -594,7 +594,7 @@ static void
map_route_occluded_attr_rewind(void *priv_data)
{
struct map_rect_priv *mr=priv_data;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
item_attr_rewind(mr->route_item);
}
@@ -602,7 +602,7 @@ static int
map_route_occluded_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
{
struct map_rect_priv *mr=priv_data;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
return item_attr_get(mr->route_item, attr_type, attr);
}
@@ -625,7 +625,7 @@ map_route_occluded_coord_get(void *priv_data, struct coord *c, int count)
char buffer[4096];
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
#endif
dbg_assert(count >= 2);
if (! mr->checked) {
@@ -635,11 +635,11 @@ map_route_occluded_coord_get(void *priv_data, struct coord *c, int count)
}
while (ret < count && !mr->last) {
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"coord first %d lseg_done %d\n",mr->first,mr->lseg_done);
+ dbg(lvl_debug,"coord first %d lseg_done %d",mr->first,mr->lseg_done);
#endif
if (mr->lseg_done) {
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"loading %d of %d from id_lo %d\n", mr->idx, mr->sd->count, mr->sd->item.id_lo);
+ dbg(lvl_debug,"loading %d of %d from id_lo %d", mr->idx, mr->sd->count, mr->sd->item.id_lo);
#endif
if (!mr->idx) {
if (coord_next(mr, &mr->lseg[0])) {
@@ -663,7 +663,7 @@ map_route_occluded_coord_get(void *priv_data, struct coord *c, int count)
l0=mr->c_next;
l1=mr->lseg[1];
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"line (0x%x,0x%x)-(0x%x,0x%x)\n", l0.x,l0.y,l1.x,l1.y);
+ dbg(lvl_debug,"line (0x%x,0x%x)-(0x%x,0x%x)", l0.x,l0.y,l1.x,l1.y);
#endif
vis=is_visible_line(&mr->c0, &l0, &l1);
if (debug) {
@@ -672,7 +672,7 @@ map_route_occluded_coord_get(void *priv_data, struct coord *c, int count)
fprintf(debug,"0x%x 0x%x\n", l1.x, l1.y);
}
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"vis=%d line (0x%x,0x%x)-(0x%x,0x%x)\n", vis, l0.x,l0.y,l1.x,l1.y);
+ dbg(lvl_debug,"vis=%d line (0x%x,0x%x)-(0x%x,0x%x)", vis, l0.x,l0.y,l1.x,l1.y);
#endif
mr->idx_base=mr->idx;
mr->c_next_base=mr->c_next;
@@ -683,11 +683,11 @@ map_route_occluded_coord_get(void *priv_data, struct coord *c, int count)
case 0:
mr->c_next_base=mr->c_next;
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x\n", l0.x, l1.y);
+ dbg(lvl_debug,"out 0x%x,0x%x", l0.x, l1.y);
#endif
c[ret++]=l0;
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x\n", l1.x, l1.y);
+ dbg(lvl_debug,"out 0x%x,0x%x", l1.x, l1.y);
#endif
c[ret++]=l1;
mr->lseg_done_base=mr->lseg_done=1;
@@ -695,12 +695,12 @@ map_route_occluded_coord_get(void *priv_data, struct coord *c, int count)
break;
case 1:
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"begin clipped\n");
- dbg(lvl_debug,"out 0x%x,0x%x\n", l0.x, l1.y);
+ dbg(lvl_debug,"begin clipped");
+ dbg(lvl_debug,"out 0x%x,0x%x", l0.x, l1.y);
#endif
c[ret++]=l0;
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x\n", l1.x, l1.y);
+ dbg(lvl_debug,"out 0x%x,0x%x", l1.x, l1.y);
#endif
c[ret++]=l1;
mr->c_next_base=mr->c_next=l1;
@@ -708,15 +708,15 @@ map_route_occluded_coord_get(void *priv_data, struct coord *c, int count)
break;
case 2:
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"end clipped\n");
+ dbg(lvl_debug,"end clipped");
#endif
mr->c_next_base=mr->c_next;
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x\n", l0.x, l1.y);
+ dbg(lvl_debug,"out 0x%x,0x%x", l0.x, l1.y);
#endif
c[ret++]=l0;
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x\n", l1.x, l1.y);
+ dbg(lvl_debug,"out 0x%x,0x%x", l1.x, l1.y);
#endif
c[ret++]=l1;
mr->c_next_base=mr->c_next=l1;
@@ -724,15 +724,15 @@ map_route_occluded_coord_get(void *priv_data, struct coord *c, int count)
break;
case 3:
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"both clipped\n");
+ dbg(lvl_debug,"both clipped");
#endif
mr->c_next_base=mr->c_next;
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x\n", l0.x, l1.y);
+ dbg(lvl_debug,"out 0x%x,0x%x", l0.x, l1.y);
#endif
c[ret++]=l0;
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"out 0x%x,0x%x\n", l1.x, l1.y);
+ dbg(lvl_debug,"out 0x%x,0x%x", l1.x, l1.y);
#endif
c[ret++]=l1;
mr->c_next_base=mr->c_next=l1;
@@ -745,21 +745,21 @@ map_route_occluded_coord_get(void *priv_data, struct coord *c, int count)
#if 0
case 2:
- dbg(lvl_debug,"visible up to 0x%x,0x%x\n",l1.x,l1.y);
+ dbg(lvl_debug,"visible up to 0x%x,0x%x",l1.x,l1.y);
if (mr->first) {
mr->first=0;
c[ret++]=mr->c_out;
- dbg(lvl_debug,"out 0x%x,0x%x\n", mr->c_out.x, mr->c_out.y);
+ dbg(lvl_debug,"out 0x%x,0x%x", mr->c_out.x, mr->c_out.y);
}
c[ret++]=mr->c_out=l1;
- dbg(lvl_debug,"out 0x%x,0x%x\n", l1.x, l1.y);
+ dbg(lvl_debug,"out 0x%x,0x%x", l1.x, l1.y);
mr->last=1;
mr->route_item_done=1;
break;
case 1:
case 3:
case 4:
- dbg(lvl_debug,"invisible\n");
+ dbg(lvl_debug,"invisible");
mr->c_out=l1;
mr->idx++;
mr->last=1;
@@ -772,7 +772,7 @@ map_route_occluded_coord_get(void *priv_data, struct coord *c, int count)
}
}
#ifdef DEBUG_COORD_GET
- dbg(lvl_debug,"ret=%d last=%d\n", ret, mr->last);
+ dbg(lvl_debug,"ret=%d last=%d", ret, mr->last);
#endif
return ret;
}
@@ -801,16 +801,16 @@ map_route_occluded_rect_new(struct map_priv *priv, struct map_selection *sel)
struct map_rect *route_map_rect;
struct coord_rect r;
if (!navit_get_attr(priv->navit, attr_route, &route, NULL)) {
- dbg(lvl_debug,"no route in navit\n");
+ dbg(lvl_debug,"no route in navit");
return NULL;
}
if (!route_get_attr(route.u.route, attr_map, &route_map, NULL)) {
- dbg(lvl_debug,"no map in route\n");
+ dbg(lvl_debug,"no map in route");
return NULL;
}
route_map_rect=map_rect_new(route_map.u.map, sel);
if (!route_map_rect) {
- dbg(lvl_debug,"no route map rect\n");
+ dbg(lvl_debug,"no route map rect");
return NULL;
}
map_dump_file(route_map.u.map, "route.txt");
@@ -865,17 +865,17 @@ map_route_occluded_rect_destroy(struct map_rect_priv *mr)
static struct item *
map_route_occluded_get_item(struct map_rect_priv *mr)
{
- dbg(lvl_debug,"enter last=%d\n",mr->last);
+ dbg(lvl_debug,"enter last=%d",mr->last);
while (!mr->last) {
struct coord c[128];
map_route_occluded_coord_get(mr, c, 128);
}
if (mr->route_item_done) {
- dbg(lvl_debug,"next route item\n");
+ dbg(lvl_debug,"next route item");
do {
mr->route_item=map_rect_get_item(mr->route_map_rect);
} while (mr->route_item && mr->route_item->type != type_street_route);
- dbg(lvl_debug,"item %p\n", mr->route_item);
+ dbg(lvl_debug,"item %p", mr->route_item);
if (!mr->route_item)
return NULL;
mr->item.type=type_street_route_occluded;
@@ -889,7 +889,7 @@ map_route_occluded_get_item(struct map_rect_priv *mr)
return NULL;
#endif
map_route_occluded_coord_rewind(mr);
- dbg(lvl_debug,"type %s\n", item_to_name(mr->route_item->type));
+ dbg(lvl_debug,"type %s", item_to_name(mr->route_item->type));
return &mr->item;
}
@@ -921,14 +921,14 @@ map_route_occluded_new(struct map_methods *meth, struct attr **attrs)
{
struct map_priv *ret;
struct attr *navit;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
navit=attr_search(attrs, NULL, attr_navit);
if (! navit)
return NULL;
ret=g_new0(struct map_priv, 1);
*meth=map_route_occluded_methods;
ret->navit=navit->u.navit;
- dbg(lvl_debug,"m=%p navit=%p\n", ret, ret->navit);
+ dbg(lvl_debug,"m=%p navit=%p", ret, ret->navit);
return ret;
}
@@ -977,16 +977,16 @@ pedestrian_draw_arrows(struct graphics *gra)
if (orientation == 2)
return;
if (!navit_get_attr(pedestrian_data.nav, attr_route, &route, NULL)) {
- dbg(lvl_debug,"no route in navit\n");
+ dbg(lvl_debug,"no route in navit");
return;
}
if (!route_get_attr(route.u.route, attr_map, &route_map, NULL)) {
- dbg(lvl_debug,"no map in route\n");
+ dbg(lvl_debug,"no map in route");
return;
}
route_map_rect=map_rect_new(route_map.u.map, NULL);
if (!route_map_rect) {
- dbg(lvl_debug,"no route map rect\n");
+ dbg(lvl_debug,"no route map rect");
return;
}
while ((item=map_rect_get_item(route_map_rect))) {
@@ -1041,7 +1041,7 @@ pedestrian_write_tilt(int fd, int axis)
ret=write(fd, buffer+axis, 1);
if (ret != 2) {
- dbg(lvl_debug,"ret=%d\n",ret);
+ dbg(lvl_debug,"ret=%d",ret);
}
}
@@ -1061,7 +1061,7 @@ pedestrian_read_tilt(int fd, struct navit *nav, struct tilt_data *data)
data->len=0;
if (navit_get_attr(nav, attr_transformation, &attr, NULL)) {
struct transformation *trans=attr.u.transformation;
- dbg(lvl_debug,"ok axis=%d val=0x%x\n", data->axis, val);
+ dbg(lvl_debug,"ok axis=%d val=0x%x", data->axis, val);
if (data->axis != 1) {
transform_set_pitch(trans, 90+(val-0x80));
} else {
@@ -1092,7 +1092,7 @@ pedestrian_setup_tilt(struct navit *nav)
char buffer[32];
fd=open("/dev/tiltsensor",O_RDWR);
if (fd == -1) {
- dbg(lvl_error,"Failed to set up tilt sensor, error %d\n",errno);
+ dbg(lvl_error,"Failed to set up tilt sensor, error %d",errno);
return;
}
tcgetattr(fd, &t);
@@ -1125,7 +1125,7 @@ android_sensors(struct navit *nav, int sensor, float *x, float *y, float *z)
sensors[sensor-1][2]=*z;
if (sensors_locked)
return;
- dbg(lvl_debug,"enter %d %f %f %f\n",sensor,*x,*y,*z);
+ dbg(lvl_debug,"enter %d %f %f %f",sensor,*x,*y,*z);
if (sensor == 1) {
if (*x > 7.5)
orientation=1; /* landscape */
@@ -1133,7 +1133,7 @@ android_sensors(struct navit *nav, int sensor, float *x, float *y, float *z)
orientation=0; /* portrait */
if (*z > 7.5)
orientation=2; /* flat */
- dbg(lvl_debug,"orientation=%d\n",orientation);
+ dbg(lvl_debug,"orientation=%d",orientation);
}
if ((orientation_old == 2) != (orientation == 2)) {
struct attr attr, flags_graphics, osd_configuration;
@@ -1178,7 +1178,7 @@ android_sensors(struct navit *nav, int sensor, float *x, float *y, float *z)
if (orientation != 2)
pitch+=2.0;
transform_set_pitch(trans, (int)pitch);
- dbg(lvl_debug,"pich %d %f\n",orientation,pitch);
+ dbg(lvl_debug,"pich %d %f",orientation,pitch);
} else {
struct attr attr;
attr.type=attr_orientation;
@@ -1187,7 +1187,7 @@ android_sensors(struct navit *nav, int sensor, float *x, float *y, float *z)
attr.u.num+=360;
pedestrian_data.yaw=attr.u.num;
navit_set_attr(nav, &attr);
- dbg(lvl_debug,"yaw %d %f\n",orientation,yaw);
+ dbg(lvl_debug,"yaw %d %f",orientation,yaw);
if (orientation == 2)
navit_set_center_cursor(nav, 1, 0);
}
@@ -1219,7 +1219,7 @@ vehicle_changed(struct vehicle *v, struct transformation *trans)
struct attr attr;
if (vehicle_get_attr(v, attr_position_direction, &attr, NULL)) {
int dir=(int)(*attr.u.numd);
- dbg(lvl_debug,"enter %d\n",dir);
+ dbg(lvl_debug,"enter %d",dir);
transform_set_pitch(trans, 90);
transform_set_yaw(trans, dir);
}
@@ -1244,15 +1244,15 @@ pedestrian_navit_init(struct navit *nav)
jmethodID cid;
jobject navitsensors;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (android_find_class_global("org/navitproject/navit/NavitSensors", &navitsensorsclass)) {
- dbg(lvl_debug,"class found\n");
+ dbg(lvl_debug,"class found");
cid = (*jnienv)->GetMethodID(jnienv, navitsensorsclass, "<init>", "(Landroid/content/Context;I)V");
- dbg(lvl_debug,"cid=%p\n",cid);
+ dbg(lvl_debug,"cid=%p",cid);
if (cid) {
cb=callback_new_1(callback_cast(android_sensors), nav);
navitsensors=(*jnienv)->NewObject(jnienv, navitsensorsclass, cid, android_activity, cb);
- dbg(lvl_debug,"object=%p\n",navitsensors);
+ dbg(lvl_debug,"object=%p",navitsensors);
if (navitsensors)
navitsensors = (*jnienv)->NewGlobalRef(jnienv, navitsensors);
}
@@ -1287,14 +1287,14 @@ pedestrian_navit_init(struct navit *nav)
return;
if (!route_get_attr(route.u.route, attr_map, &route_map, NULL))
return;
- dbg(lvl_debug,"enter 1\n");
+ dbg(lvl_debug,"enter 1");
#if 0
struct attr active;
active.type=attr_active;
active.u.num=0;
if (!map_set_attr(route_map.u.map, &active))
return;
- dbg(lvl_debug,"enter 2\n");
+ dbg(lvl_debug,"enter 2");
#endif
if (!navit_get_attr(nav, attr_mapset, &mapset, NULL))
return;
@@ -1317,7 +1317,7 @@ pedestrian_navit_init(struct navit *nav)
iter=navit_attr_iter_new();
while(navit_get_attr(nav, attr_layout, &attr, iter)) {
if (!strcmp(attr.u.layout->name, "Route")) {
- dbg(lvl_debug,"found %s\n",attr_to_name(attr.type));
+ dbg(lvl_debug,"found %s",attr_to_name(attr.type));
main_layout=attr;
#if 1
navit_set_attr(nav, &attr);
@@ -1343,7 +1343,7 @@ pedestrian_navit_init(struct navit *nav)
static void
pedestrian_navit(struct navit *nav, int add)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
struct attr callback;
if (add) {
callback.type=attr_callback;
@@ -1362,10 +1362,10 @@ plugin_init(void)
jmethodID Activity_setRequestedOrientation;
if (!android_find_class_global("android/app/Activity", &ActivityClass))
- dbg(lvl_error,"failed to get class android/app/Activity\n");
+ dbg(lvl_error,"failed to get class android/app/Activity");
Activity_setRequestedOrientation = (*jnienv)->GetMethodID(jnienv, ActivityClass, "setRequestedOrientation", "(I)V");
if (Activity_setRequestedOrientation == NULL)
- dbg(lvl_error,"failed to get method setRequestedOrientation from android/app/Activity\n");
+ dbg(lvl_error,"failed to get method setRequestedOrientation from android/app/Activity");
(*jnienv)->CallVoidMethod(jnienv, android_activity, Activity_setRequestedOrientation, 0);
#endif
diff --git a/navit/popup.c b/navit/popup.c
index 71b82b1d9..beaf9a000 100644
--- a/navit/popup.c
+++ b/navit/popup.c
@@ -99,7 +99,7 @@ popup_traffic_distortion(struct item *item, char *attr)
static void
popup_traffic_distortion_blocked(struct item *item)
{
- dbg(lvl_debug,"item=%p\n",item);
+ dbg(lvl_debug,"item=%p",item);
popup_traffic_distortion(item, "maxspeed=0");
}
@@ -180,7 +180,7 @@ extern void *vehicle;
static void
popup_set_position(struct navit *nav, struct pcoord *pc)
{
- dbg(lvl_debug,"%p %p\n", nav, pc);
+ dbg(lvl_debug,"%p %p", nav, pc);
navit_set_position(nav, pc);
}
@@ -214,7 +214,7 @@ popup_printf_cb(void *menu, enum menu_type type, struct callback *cb, const char
va_start(ap, fmt);
str=g_strdup_vprintf(fmt, ap);
- dbg(lvl_debug,"%s\n", str);
+ dbg(lvl_debug,"%s", str);
us=str;
while (*us) {
if (*us == '_')
@@ -310,7 +310,7 @@ popup_item_dump(struct item *item)
struct map_rect *mr;
mr=map_rect_new(item->map,NULL);
item=map_rect_get_item_byid(mr, item->id_hi, item->id_lo);
- dbg(lvl_debug,"item=%p\n",item);
+ dbg(lvl_debug,"item=%p",item);
item_dump_filedesc(item,item->map,stdout);
map_rect_destroy(mr);
}
@@ -349,7 +349,7 @@ popup_show_item(struct navit *nav, void *popup, struct displayitem *di)
if (diitem->map) {
mr=map_rect_new(diitem->map,NULL);
item=map_rect_get_item_byid(mr, diitem->id_hi, diitem->id_lo);
- dbg(lvl_debug,"item=%p\n", item);
+ dbg(lvl_debug,"item=%p", item);
if (item) {
popup_show_attrs(item->map, menu_item, item);
popup_printf_cb(menu_item, menu_type_menu, callback_new_1(callback_cast(popup_item_dump), diitem), "Dump");
@@ -425,7 +425,7 @@ popup(struct navit *nav, int button, struct point *p)
coord_format(g.lat,g.lng,DEGREES_MINUTES_SECONDS,buffer,sizeof(buffer));
popup_printf(men, menu_type_menu, "%s", buffer);
popup_printf(men, menu_type_menu, "%f %f", g.lat, g.lng);
- dbg(lvl_debug,"%p %p\n", nav, &c);
+ dbg(lvl_debug,"%p %p", nav, &c);
c.pro = transform_get_projection(navit_get_trans(nav));
c.x = co.x;
c.y = co.y;
diff --git a/navit/profile_option.c b/navit/profile_option.c
index 8a1049068..7baeee7b5 100644
--- a/navit/profile_option.c
+++ b/navit/profile_option.c
@@ -34,7 +34,7 @@ profile_option_new(struct attr *parent, struct attr **attrs)
po->func=&profile_option_func;
navit_object_ref((struct navit_object *)po);
po->attrs=attr_list_dup(attrs);
- dbg(lvl_debug,"return %p\n",po);
+ dbg(lvl_debug,"return %p",po);
return po;
}
diff --git a/navit/projection.c b/navit/projection.c
index d916689ee..3c9a7810a 100644
--- a/navit/projection.c
+++ b/navit/projection.c
@@ -77,20 +77,20 @@ projection_from_name(const char *name, struct coord *utm_offset)
if (sscanf(name,"utmref%d%c%c%c",&zone,&zone_field,&square_x,&square_y)) {
i=utmref_letter(zone_field);
if (i < 2 || i > 21) {
- dbg(lvl_error,"invalid zone field '%c' in '%s'\n",zone_field,name);
+ dbg(lvl_error,"invalid zone field '%c' in '%s'",zone_field,name);
return projection_none;
}
i-=12;
- dbg(lvl_debug,"zone_field %d\n",i);
+ dbg(lvl_debug,"zone_field %d",i);
baserow=i*887.6/100;
utm_offset->x=zone*1000000;
i=utmref_letter(square_x);
utm_offset->x+=((i%8)+1)*100000;
i=utmref_letter(square_y);
- dbg(lvl_debug,"baserow %d\n",baserow);
+ dbg(lvl_debug,"baserow %d",baserow);
if (!(zone % 2))
i-=5;
- dbg(lvl_debug,"i=%d\n",i);
+ dbg(lvl_debug,"i=%d",i);
i=(i-baserow+100)%20+baserow;
utm_offset->y=i*100000;
return projection_utm;
diff --git a/navit/route.c b/navit/route.c
index 3e3bb02ea..acccf3f7c 100644
--- a/navit/route.c
+++ b/navit/route.c
@@ -43,11 +43,6 @@
#include <stdlib.h>
#include <string.h>
#include <math.h>
-#if 0
-#include <assert.h>
-#include <unistd.h>
-#include <sys/time.h>
-#endif
#include "navit_nls.h"
#include "glib_slice.h"
#include "config.h"
@@ -828,7 +823,7 @@ route_path_update_done(struct route *this, int new_graph)
/* FIXME */
int seg_time=route_time_seg(this->vehicleprofile, seg->data, NULL);
if (seg_time == INT_MAX) {
- dbg(lvl_debug,"error\n");
+ dbg(lvl_debug,"error");
} else
path_time+=seg_time;
path_len+=seg->data->len;
@@ -877,10 +872,10 @@ route_path_update_done(struct route *this, int new_graph)
static void
route_path_update_flags(struct route *this, enum route_path_flags flags)
{
- dbg(lvl_debug,"enter %d\n", flags);
+ dbg(lvl_debug,"enter %d", flags);
this->flags = flags;
if (! this->pos || ! this->destinations) {
- dbg(lvl_debug,"destroy\n");
+ dbg(lvl_debug,"destroy");
route_path_destroy(this->path2,1);
this->path2 = NULL;
return;
@@ -892,21 +887,21 @@ route_path_update_flags(struct route *this, enum route_path_flags flags)
/* the graph is destroyed when setting the destination */
if (this->graph) {
if (this->graph->busy) {
- dbg(lvl_debug,"busy building graph\n");
+ dbg(lvl_debug,"busy building graph");
return;
}
// we can try to update
- dbg(lvl_debug,"try update\n");
+ dbg(lvl_debug,"try update");
route_path_update_done(this, 0);
} else {
route_path_destroy(this->path2,1);
this->path2 = NULL;
}
if (!this->graph || (!this->path2 && !(flags & route_path_flag_no_rebuild))) {
- dbg(lvl_debug,"rebuild graph %p %p\n",this->graph,this->path2);
+ dbg(lvl_debug,"rebuild graph %p %p",this->graph,this->path2);
if (! this->route_graph_flood_done_cb)
this->route_graph_flood_done_cb=callback_new_2(callback_cast(route_path_update_done), this, (long)1);
- dbg(lvl_debug,"route_graph_update\n");
+ dbg(lvl_debug,"route_graph_update");
route_graph_update(this, this->route_graph_flood_done_cb, !!(flags & route_path_flag_async));
}
}
@@ -972,7 +967,7 @@ route_set_position_flags(struct route *this, struct pcoord *pos, enum route_path
if (!this->pos) return 0;
this->pos->street_direction=0;
- dbg(lvl_debug,"this->pos=%p\n", this->pos);
+ dbg(lvl_debug,"this->pos=%p", this->pos);
route_info_distances(this->pos, pos->pro);
route_path_update_flags(this, flags);
return 1;
@@ -1006,7 +1001,7 @@ route_set_position_from_tracking(struct route *this, struct tracking *tracking,
struct route_info *ret;
struct street_data *sd;
- dbg(lvl_info,"enter\n");
+ dbg(lvl_info,"enter");
c=tracking_get_pos(tracking);
ret=g_new0(struct route_info, 1);
if (!ret) {
@@ -1025,13 +1020,13 @@ route_set_position_from_tracking(struct route *this, struct tracking *tracking,
ret->street=street_data_dup(sd);
route_info_distances(ret, pro);
}
- dbg(lvl_debug,"position 0x%x,0x%x item 0x%x,0x%x direction %d pos %d lenpos %d lenneg %d\n",c->x,c->y,sd?sd->item.id_hi:0,sd?sd->item.id_lo:0,ret->street_direction,ret->pos,ret->lenpos,ret->lenneg);
- dbg(lvl_debug,"c->x=0x%x, c->y=0x%x pos=%d item=(0x%x,0x%x)\n", c->x, c->y, ret->pos, ret->street?ret->street->item.id_hi:0, ret->street?ret->street->item.id_lo:0);
- dbg(lvl_debug,"street 0=(0x%x,0x%x) %d=(0x%x,0x%x)\n", ret->street?ret->street->c[0].x:0, ret->street?ret->street->c[0].y:0, ret->street?ret->street->count-1:0, ret->street?ret->street->c[ret->street->count-1].x:0, ret->street?ret->street->c[ret->street->count-1].y:0);
+ dbg(lvl_debug,"position 0x%x,0x%x item 0x%x,0x%x direction %d pos %d lenpos %d lenneg %d",c->x,c->y,sd?sd->item.id_hi:0,sd?sd->item.id_lo:0,ret->street_direction,ret->pos,ret->lenpos,ret->lenneg);
+ dbg(lvl_debug,"c->x=0x%x, c->y=0x%x pos=%d item=(0x%x,0x%x)", c->x, c->y, ret->pos, ret->street?ret->street->item.id_hi:0, ret->street?ret->street->item.id_lo:0);
+ dbg(lvl_debug,"street 0=(0x%x,0x%x) %d=(0x%x,0x%x)", ret->street?ret->street->c[0].x:0, ret->street?ret->street->c[0].y:0, ret->street?ret->street->count-1:0, ret->street?ret->street->c[ret->street->count-1].x:0, ret->street?ret->street->c[ret->street->count-1].y:0);
this->pos=ret;
if (this->destinations)
route_path_update(this, 0, 1);
- dbg(lvl_info,"ret\n");
+ dbg(lvl_info,"ret");
}
/* Used for debuging of route_rect, what routing sees */
@@ -1052,7 +1047,7 @@ route_rect(int order, struct coord *c1, struct coord *c2, int rel, int abs)
sel->order=order;
sel->range.min=route_item_first;
sel->range.max=route_item_last;
- dbg(lvl_debug,"%p %p\n", c1, c2);
+ dbg(lvl_debug,"%p %p", c1, c2);
dx=c1->x-c2->x;
dy=c1->y-c2->y;
if (dx < 0) {
@@ -1809,7 +1804,7 @@ route_path_add_line(struct route_path *this, struct coord *start, struct coord *
struct route_path_segment *segment;
int seg_size,seg_dat_size;
- dbg(lvl_debug,"line from 0x%x,0x%x-0x%x,0x%x\n", start->x, start->y, end->x, end->y);
+ dbg(lvl_debug,"line from 0x%x,0x%x-0x%x,0x%x", start->x, start->y, end->x, end->y);
seg_size=sizeof(*segment) + sizeof(struct coord) * ccnt;
seg_dat_size=sizeof(struct route_segment_data);
segment=g_malloc0(seg_size + seg_dat_size);
@@ -1852,7 +1847,7 @@ route_path_add_item_from_graph(struct route_path *this, struct route_path *oldpa
if (rgs->data.flags & AF_SEGMENTED)
offset=RSD_OFFSET(&rgs->data);
- dbg(lvl_debug,"enter (0x%x,0x%x) dir=%d pos=%p dst=%p\n", rgs->data.item.id_hi, rgs->data.item.id_lo, dir, pos, dst);
+ dbg(lvl_debug,"enter (0x%x,0x%x) dir=%d pos=%p dst=%p", rgs->data.item.id_hi, rgs->data.item.id_lo, dir, pos, dst);
if (oldpath) {
segment=item_hash_lookup(oldpath->path_hash, &rgs->data.item);
if (segment && segment->direction == dir) {
@@ -1882,9 +1877,9 @@ route_path_add_item_from_graph(struct route_path *this, struct route_path *oldpa
}
} else {
extra=1;
- dbg(lvl_debug,"pos dir=%d\n", dir);
- dbg(lvl_debug,"pos pos=%d\n", pos->pos);
- dbg(lvl_debug,"pos count=%d\n", pos->street->count);
+ dbg(lvl_debug,"pos dir=%d", dir);
+ dbg(lvl_debug,"pos pos=%d", pos->pos);
+ dbg(lvl_debug,"pos count=%d", pos->street->count);
if (dir > 0) {
c=pos->street->c+pos->pos+1;
ccnt=pos->street->count-pos->pos-1;
@@ -1898,8 +1893,8 @@ route_path_add_item_from_graph(struct route_path *this, struct route_path *oldpa
pos->dir=dir;
} else if (dst) {
extra=1;
- dbg(lvl_debug,"dst dir=%d\n", dir);
- dbg(lvl_debug,"dst pos=%d\n", dst->pos);
+ dbg(lvl_debug,"dst dir=%d", dir);
+ dbg(lvl_debug,"dst pos=%d", dst->pos);
if (dir > 0) {
c=dst->street->c;
ccnt=dst->pos+1;
@@ -2142,9 +2137,6 @@ route_value_seg(struct vehicleprofile *profile, struct route_graph_point *from,
{
int ret;
struct route_traffic_distortion dist,*distp=NULL;
-#if 0
- dbg(lvl_debug,"flags 0x%x mask 0x%x flags 0x%x\n", over->flags, dir >= 0 ? profile->flags_forward_mask : profile->flags_reverse_mask, profile->flags);
-#endif
if ((over->data.flags & (dir >= 0 ? profile->flags_forward_mask : profile->flags_reverse_mask)) != profile->flags)
return INT_MAX;
if (dir > 0 && (over->start->flags & RP_TURN_RESTRICTION))
@@ -2278,14 +2270,14 @@ route_process_turn_restriction(struct route_graph *this, struct item *item)
count=item_coord_get(item, c, 5);
if (count != 3 && count != 4) {
- dbg(lvl_debug,"wrong count %d\n",count);
+ dbg(lvl_debug,"wrong count %d",count);
return;
}
if (count == 4)
return;
for (i = 0 ; i < count ; i++)
pnt[i]=route_graph_add_point(this,&c[i]);
- dbg(lvl_debug,"%s: (0x%x,0x%x)-(0x%x,0x%x)-(0x%x,0x%x) %p-%p-%p\n",item_to_name(item->type),c[0].x,c[0].y,c[1].x,c[1].y,c[2].x,c[2].y,pnt[0],pnt[1],pnt[2]);
+ dbg(lvl_debug,"%s: (0x%x,0x%x)-(0x%x,0x%x)-(0x%x,0x%x) %p-%p-%p",item_to_name(item->type),c[0].x,c[0].y,c[1].x,c[1].y,c[2].x,c[2].y,pnt[0],pnt[1],pnt[2]);
data.item=item;
data.flags=0;
data.len=0;
@@ -2580,7 +2572,7 @@ route_graph_flood(struct route_graph *this, struct route_info *dst, struct vehic
}
fh_deleteheap(heap);
callback_call_0(cb);
- dbg(lvl_debug,"return\n");
+ dbg(lvl_debug,"return");
}
/**
@@ -2691,7 +2683,7 @@ route_path_new(struct route_graph *this, struct route_path *oldpath, struct rout
struct route_path *ret;
if (! pos->street || ! dst->street) {
- dbg(lvl_error,"pos or dest not set\n");
+ dbg(lvl_error,"pos or dest not set");
return NULL;
}
@@ -2701,12 +2693,12 @@ route_path_new(struct route_graph *this, struct route_path *oldpath, struct rout
val=route_value_seg(profile, NULL, s, 2);
if (val != INT_MAX && s->end->value != INT_MAX) {
val=val*(100-pos->percent)/100;
- dbg(lvl_debug,"val1 %d\n",val);
+ dbg(lvl_debug,"val1 %d",val);
if (route_graph_segment_match(s,this->avoid_seg) && pos->street_direction < 0)
val+=profile->turn_around_penalty;
- dbg(lvl_debug,"val1 %d\n",val);
+ dbg(lvl_debug,"val1 %d",val);
val1_new=s->end->value+val;
- dbg(lvl_debug,"val1 +%d=%d\n",s->end->value,val1_new);
+ dbg(lvl_debug,"val1 +%d=%d",s->end->value,val1_new);
if (val1_new < val1) {
val1=val1_new;
s1=s;
@@ -2715,12 +2707,12 @@ route_path_new(struct route_graph *this, struct route_path *oldpath, struct rout
val=route_value_seg(profile, NULL, s, -2);
if (val != INT_MAX && s->start->value != INT_MAX) {
val=val*pos->percent/100;
- dbg(lvl_debug,"val2 %d\n",val);
+ dbg(lvl_debug,"val2 %d",val);
if (route_graph_segment_match(s,this->avoid_seg) && pos->street_direction > 0)
val+=profile->turn_around_penalty;
- dbg(lvl_debug,"val2 %d\n",val);
+ dbg(lvl_debug,"val2 %d",val);
val2_new=s->start->value+val;
- dbg(lvl_debug,"val2 +%d=%d\n",s->start->value,val2_new);
+ dbg(lvl_debug,"val2 +%d=%d",s->start->value,val2_new);
if (val2_new < val2) {
val2=val2_new;
s2=s;
@@ -2728,7 +2720,7 @@ route_path_new(struct route_graph *this, struct route_path *oldpath, struct rout
}
}
if (val1 == INT_MAX && val2 == INT_MAX) {
- dbg(lvl_error,"no route found, pos blocked\n");
+ dbg(lvl_error,"no route found, pos blocked");
return NULL;
}
if (val1 == val2) {
@@ -2746,7 +2738,7 @@ route_path_new(struct route_graph *this, struct route_path *oldpath, struct rout
}
if (pos->street_direction && dir != pos->street_direction && profile->turn_around_penalty) {
if (!route_graph_segment_match(this->avoid_seg,s)) {
- dbg(lvl_debug,"avoid current segment\n");
+ dbg(lvl_debug,"avoid current segment");
if (this->avoid_seg)
route_graph_set_traffic_distortion(this, this->avoid_seg, 0);
this->avoid_seg=s;
@@ -2766,9 +2758,6 @@ route_path_new(struct route_graph *this, struct route_path *oldpath, struct rout
posinfo=pos;
while (s && !dstinfo) { /* following start->seg, which indicates the least costly way to reach our destination */
segs++;
-#if 0
- printf("start->value=%d 0x%x,0x%x\n", start->value, start->c.x, start->c.y);
-#endif
if (s->start == start) {
if (item_is_equal(s->data.item, dst->street->item) && (s->end->seg == s || !posinfo))
dstinfo=dst;
@@ -2787,7 +2776,7 @@ route_path_new(struct route_graph *this, struct route_path *oldpath, struct rout
}
if (dst->lenextra)
route_path_add_line(ret, &dst->lp, &dst->c, dst->lenextra);
- dbg(lvl_debug, "%d segments\n", segs);
+ dbg(lvl_debug, "%d segments", segs);
return ret;
}
@@ -2827,29 +2816,29 @@ is_turn_allowed(struct route_graph_point *p, struct route_graph_segment *from, s
(tmp1->data.item.type == type_street_turn_restriction_no ||
tmp1->data.item.type == type_street_turn_restriction_only)) {
tmp2=p->start;
- dbg(lvl_debug,"found %s (0x%x,0x%x) (0x%x,0x%x)-(0x%x,0x%x) %p-%p\n",item_to_name(tmp1->data.item.type),tmp1->data.item.id_hi,tmp1->data.item.id_lo,tmp1->start->c.x,tmp1->start->c.y,tmp1->end->c.x,tmp1->end->c.y,tmp1->start,tmp1->end);
+ dbg(lvl_debug,"found %s (0x%x,0x%x) (0x%x,0x%x)-(0x%x,0x%x) %p-%p",item_to_name(tmp1->data.item.type),tmp1->data.item.id_hi,tmp1->data.item.id_lo,tmp1->start->c.x,tmp1->start->c.y,tmp1->end->c.x,tmp1->end->c.y,tmp1->start,tmp1->end);
while (tmp2) {
- dbg(lvl_debug,"compare %s (0x%x,0x%x) (0x%x,0x%x)-(0x%x,0x%x) %p-%p\n",item_to_name(tmp2->data.item.type),tmp2->data.item.id_hi,tmp2->data.item.id_lo,tmp2->start->c.x,tmp2->start->c.y,tmp2->end->c.x,tmp2->end->c.y,tmp2->start,tmp2->end);
+ dbg(lvl_debug,"compare %s (0x%x,0x%x) (0x%x,0x%x)-(0x%x,0x%x) %p-%p",item_to_name(tmp2->data.item.type),tmp2->data.item.id_hi,tmp2->data.item.id_lo,tmp2->start->c.x,tmp2->start->c.y,tmp2->end->c.x,tmp2->end->c.y,tmp2->start,tmp2->end);
if (item_is_equal(tmp1->data.item, tmp2->data.item))
break;
tmp2=tmp2->start_next;
}
- dbg(lvl_debug,"tmp2=%p\n",tmp2);
+ dbg(lvl_debug,"tmp2=%p",tmp2);
if (tmp2) {
- dbg(lvl_debug,"%s tmp2->end=%p next=%p\n",item_to_name(tmp1->data.item.type),tmp2->end,next);
+ dbg(lvl_debug,"%s tmp2->end=%p next=%p",item_to_name(tmp1->data.item.type),tmp2->end,next);
}
if (tmp1->data.item.type == type_street_turn_restriction_no && tmp2 && tmp2->end->c.x == next->c.x && tmp2->end->c.y == next->c.y) {
- dbg(lvl_debug,"from 0x%x,0x%x over 0x%x,0x%x to 0x%x,0x%x not allowed (no)\n",prev->c.x,prev->c.y,p->c.x,p->c.y,next->c.x,next->c.y);
+ dbg(lvl_debug,"from 0x%x,0x%x over 0x%x,0x%x to 0x%x,0x%x not allowed (no)",prev->c.x,prev->c.y,p->c.x,p->c.y,next->c.x,next->c.y);
return 0;
}
if (tmp1->data.item.type == type_street_turn_restriction_only && tmp2 && (tmp2->end->c.x != next->c.x || tmp2->end->c.y != next->c.y)) {
- dbg(lvl_debug,"from 0x%x,0x%x over 0x%x,0x%x to 0x%x,0x%x not allowed (only)\n",prev->c.x,prev->c.y,p->c.x,p->c.y,next->c.x,next->c.y);
+ dbg(lvl_debug,"from 0x%x,0x%x over 0x%x,0x%x to 0x%x,0x%x not allowed (only)",prev->c.x,prev->c.y,p->c.x,p->c.y,next->c.x,next->c.y);
return 0;
}
}
tmp1=tmp1->end_next;
}
- dbg(lvl_debug,"from 0x%x,0x%x over 0x%x,0x%x to 0x%x,0x%x allowed\n",prev->c.x,prev->c.y,p->c.x,p->c.y,next->c.x,next->c.y);
+ dbg(lvl_debug,"from 0x%x,0x%x over 0x%x,0x%x to 0x%x,0x%x allowed",prev->c.x,prev->c.y,p->c.x,p->c.y,next->c.x,next->c.y);
return 1;
}
@@ -2867,7 +2856,7 @@ route_graph_clone_segment(struct route_graph *this, struct route_graph_segment *
data.maxspeed=RSD_MAXSPEED(&s->data);
if (s->data.flags & AF_SEGMENTED)
data.offset=RSD_OFFSET(&s->data);
- dbg(lvl_debug,"cloning segment from %p (0x%x,0x%x) to %p (0x%x,0x%x)\n",start,start->c.x,start->c.y, end, end->c.x, end->c.y);
+ dbg(lvl_debug,"cloning segment from %p (0x%x,0x%x) to %p (0x%x,0x%x)",start,start->c.x,start->c.y, end, end->c.x, end->c.y);
route_graph_add_segment(this, start, end, &data);
}
@@ -2881,19 +2870,19 @@ route_graph_process_restriction_segment(struct route_graph *this, struct route_g
int dy=0;
c.x+=dx;
c.y+=dy;
- dbg(lvl_debug,"From %s %d,%d\n",item_to_name(s->data.item.type),dx,dy);
+ dbg(lvl_debug,"From %s %d,%d",item_to_name(s->data.item.type),dx,dy);
pn=route_graph_point_new(this, &c);
if (dir > 0) { /* going away */
- dbg(lvl_debug,"other 0x%x,0x%x\n",s->end->c.x,s->end->c.y);
+ dbg(lvl_debug,"other 0x%x,0x%x",s->end->c.x,s->end->c.y);
if (s->data.flags & AF_ONEWAY) {
- dbg(lvl_debug,"Not possible\n");
+ dbg(lvl_debug,"Not possible");
return;
}
route_graph_clone_segment(this, s, pn, s->end, AF_ONEWAYREV);
} else { /* coming in */
- dbg(lvl_debug,"other 0x%x,0x%x\n",s->start->c.x,s->start->c.y);
+ dbg(lvl_debug,"other 0x%x,0x%x",s->start->c.x,s->start->c.y);
if (s->data.flags & AF_ONEWAYREV) {
- dbg(lvl_debug,"Not possible\n");
+ dbg(lvl_debug,"Not possible");
return;
}
route_graph_clone_segment(this, s, s->start, pn, AF_ONEWAY);
@@ -2904,7 +2893,7 @@ route_graph_process_restriction_segment(struct route_graph *this, struct route_g
tmp->data.item.type != type_street_turn_restriction_only &&
!(tmp->data.flags & AF_ONEWAYREV) && is_turn_allowed(p, s, tmp)) {
route_graph_clone_segment(this, tmp, pn, tmp->end, AF_ONEWAY);
- dbg(lvl_debug,"To start %s\n",item_to_name(tmp->data.item.type));
+ dbg(lvl_debug,"To start %s",item_to_name(tmp->data.item.type));
}
tmp=tmp->start_next;
}
@@ -2914,7 +2903,7 @@ route_graph_process_restriction_segment(struct route_graph *this, struct route_g
tmp->data.item.type != type_street_turn_restriction_only &&
!(tmp->data.flags & AF_ONEWAY) && is_turn_allowed(p, s, tmp)) {
route_graph_clone_segment(this, tmp, tmp->start, pn, AF_ONEWAYREV);
- dbg(lvl_debug,"To end %s\n",item_to_name(tmp->data.item.type));
+ dbg(lvl_debug,"To end %s",item_to_name(tmp->data.item.type));
}
tmp=tmp->end_next;
}
@@ -2925,7 +2914,7 @@ route_graph_process_restriction_point(struct route_graph *this, struct route_gra
{
struct route_graph_segment *tmp;
tmp=p->start;
- dbg(lvl_debug,"node 0x%x,0x%x\n",p->c.x,p->c.y);
+ dbg(lvl_debug,"node 0x%x,0x%x",p->c.x,p->c.y);
while (tmp) {
if (tmp->data.item.type != type_street_turn_restriction_no &&
tmp->data.item.type != type_street_turn_restriction_only)
@@ -2947,7 +2936,7 @@ route_graph_process_restrictions(struct route_graph *this)
{
struct route_graph_point *curr;
int i;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
for (i = 0 ; i < HASH_SIZE ; i++) {
curr=this->hash[i];
while (curr) {
@@ -2970,7 +2959,7 @@ route_graph_process_restrictions(struct route_graph *this)
static void
route_graph_build_done(struct route_graph *rg, int cancel)
{
- dbg(lvl_debug,"cancel=%d\n",cancel);
+ dbg(lvl_debug,"cancel=%d",cancel);
if (rg->idle_ev)
event_remove_idle(rg->idle_ev);
if (rg->idle_cb)
@@ -3039,7 +3028,7 @@ route_graph_build(struct mapset *ms, struct coord *c, int count, struct callback
{
struct route_graph *ret=g_new0(struct route_graph, 1);
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
ret->sel=route_calc_selection(c, count, profile);
ret->h=mapset_open(ms);
@@ -3244,7 +3233,7 @@ route_find_nearest_street(struct vehicleprofile *vehicleprofile, struct mapset *
ret->lp=lp;
ret->pos=pos;
ret->street=sd;
- dbg(lvl_debug,"dist=%d id 0x%x 0x%x pos=%d\n", dist, item->id_hi, item->id_lo, pos);
+ dbg(lvl_debug,"dist=%d id 0x%x 0x%x pos=%d", dist, item->id_hi, item->id_lo, pos);
} else {
street_data_free(sd);
}
@@ -3258,7 +3247,7 @@ route_find_nearest_street(struct vehicleprofile *vehicleprofile, struct mapset *
if (!ret->street || mindist > max_dist*max_dist) {
if (ret->street) {
street_data_free(ret->street);
- dbg(lvl_debug,"Much too far %d > %d\n", mindist, max_dist);
+ dbg(lvl_debug,"Much too far %d > %d", mindist, max_dist);
}
g_free(ret);
ret = NULL;
@@ -3297,34 +3286,6 @@ route_info_street(struct route_info *rinf)
return rinf->street;
}
-#if 0
-struct route_crossings *
-route_crossings_get(struct route *this, struct coord *c)
-{
- struct route_point *pnt;
- struct route_segment *seg;
- int crossings=0;
- struct route_crossings *ret;
-
- pnt=route_graph_get_point(this, c);
- seg=pnt->start;
- while (seg) {
- printf("start: 0x%x 0x%x\n", seg->item.id_hi, seg->item.id_lo);
- crossings++;
- seg=seg->start_next;
- }
- seg=pnt->end;
- while (seg) {
- printf("end: 0x%x 0x%x\n", seg->item.id_hi, seg->item.id_lo);
- crossings++;
- seg=seg->end_next;
- }
- ret=g_malloc(sizeof(struct route_crossings)+crossings*sizeof(struct route_crossing));
- ret->count=crossings;
- return ret;
-}
-#endif
-
/**
* @brief Implementation-specific map rect data
@@ -3482,7 +3443,7 @@ rm_coord_get(void *priv_data, struct coord *c, int count)
c[i] = seg->c[mr->last_coord++];
rc++;
}
- dbg(lvl_debug,"return %d\n",rc);
+ dbg(lvl_debug,"return %d",rc);
return rc;
}
@@ -3512,7 +3473,7 @@ rp_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr)
switch (attr_type) {
case attr_any: // works only with rg_points for now
while (mr->attr_next != attr_none) {
- dbg(lvl_debug,"querying %s\n", attr_to_name(mr->attr_next));
+ dbg(lvl_debug,"querying %s", attr_to_name(mr->attr_next));
if (rp_attr_get(priv_data, mr->attr_next, attr))
return 1;
}
@@ -3707,17 +3668,7 @@ static struct map_rect_priv *
rm_rect_new(struct map_priv *priv, struct map_selection *sel)
{
struct map_rect_priv * mr;
- dbg(lvl_debug,"enter\n");
-#if 0
- if (! route_get_pos(priv->route))
- return NULL;
- if (! route_get_dst(priv->route))
- return NULL;
-#endif
-#if 0
- if (! priv->route->path2)
- return NULL;
-#endif
+ dbg(lvl_debug,"enter");
mr=g_new0(struct map_rect_priv, 1);
mr->mpriv = priv;
mr->item.priv_data = mr;
@@ -3751,7 +3702,7 @@ rp_rect_new(struct map_priv *priv, struct map_selection *sel)
{
struct map_rect_priv * mr;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (! priv->route->graph)
return NULL;
mr=g_new0(struct map_rect_priv, 1);
@@ -4115,7 +4066,7 @@ route_set_attr(struct route *this_, struct attr *attr)
}
break;
default:
- dbg(lvl_error,"unsupported attribute: %s\n",attr_to_name(attr->type));
+ dbg(lvl_error,"unsupported attribute: %s",attr_to_name(attr->type));
return 0;
}
if (attr_updated)
@@ -4138,7 +4089,7 @@ route_add_attr(struct route *this_, struct attr *attr)
int
route_remove_attr(struct route *this_, struct attr *attr)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
switch (attr->type) {
case attr_callback:
callback_list_remove(this_->cbl2, attr->u.callback);
@@ -4186,7 +4137,7 @@ route_get_attr(struct route *this_, enum attr_type type, struct attr *attr, stru
case attr_vehicle:
attr->u.vehicle=this_->v;
ret=(this_->v != NULL);
- dbg(lvl_debug,"get vehicle %p\n",this_->v);
+ dbg(lvl_debug,"get vehicle %p",this_->v);
break;
case attr_vehicleprofile:
attr->u.vehicleprofile=this_->vehicleprofile;
@@ -4203,7 +4154,7 @@ route_get_attr(struct route *this_, enum attr_type type, struct attr *attr, stru
attr->u.num+=path->path_time;
path=path->next;
}
- dbg(lvl_debug,"path_time %ld\n",attr->u.num);
+ dbg(lvl_debug,"path_time %ld",attr->u.num);
} else
ret=0;
break;
diff --git a/navit/script.c b/navit/script.c
index 2c6719cdc..e0e05e4be 100644
--- a/navit/script.c
+++ b/navit/script.c
@@ -40,10 +40,10 @@ script_run(struct script *scr)
struct attr *xml_text=attr_search(scr->attrs, NULL, attr_xml_text);
int error;
if (!xml_text || !xml_text->u.str) {
- dbg(lvl_error,"no text\n");
+ dbg(lvl_error,"no text");
return;
}
- dbg(lvl_debug,"running '%s'\n",xml_text->u.str);
+ dbg(lvl_debug,"running '%s'",xml_text->u.str);
command_evaluate_to_void(&scr->parent, xml_text->u.str, &error);
}
@@ -52,7 +52,7 @@ script_set_attr_int(struct script *scr, struct attr *attr)
{
switch (attr->type) {
case attr_refresh_cond:
- dbg(lvl_debug,"refresh_cond\n");
+ dbg(lvl_debug,"refresh_cond");
if (scr->cs)
command_saved_destroy(scr->cs);
scr->cs=command_saved_attr_new(attr->u.str, &scr->parent, scr->cb, 0);
@@ -79,14 +79,14 @@ script_new(struct attr *parent, struct attr **attrs)
scr->parent=*parent;
while (attrs && *attrs)
script_set_attr_int(scr, *attrs++);
- dbg(lvl_debug,"return %p\n",scr);
+ dbg(lvl_debug,"return %p",scr);
return scr;
}
static void
script_destroy(struct script *scr)
{
- dbg(lvl_debug,"enter %p\n",scr);
+ dbg(lvl_debug,"enter %p",scr);
if (scr->timeout)
event_remove_timeout(scr->timeout);
if (scr->cs)
diff --git a/navit/script/download_index.html b/navit/script/download_index.html
index fed33e179..7439f4b6a 100644
--- a/navit/script/download_index.html
+++ b/navit/script/download_index.html
@@ -1,145 +1,145 @@
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>Planet Extraction</title>
- <style type="text/css">
- html, body {
- margin: 0;
- padding: 1em;
- font: 0.9em Verdana, Arial, sans serif;
- }
- input, select, textarea {
- font: 1em Verdana, Arial, sans serif;
- }
- .input {
- border: none;
- width: 100px;
- }
- .bbox {
- font-size: 12px;
- color: #000;
- background-color: #fff;
- width: 300px;
- border: 1px solid gray;
- }
- .button {
- width: 200px;
- height: 50px;
- font-weight: bold;
- }
- #map {
- float: left;
- width: 500px;
- height: 500px;
- border: 1px solid gray;
- }
- #controls {
- float: left;
-
- }
- </style>
- <script src="http://openlayers.org/dev/lib/OpenLayers.js"></script>
- <script type="text/javascript">
- var map, polygonControl, polygonLayer, bbox_set;
-
- OpenLayers.Util.onImageLoadErrorColor = "transparent";
- function init(){
- map = new OpenLayers.Map('map');
-
- var wmsLayer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
- "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'});
-
- polygonLayer = new OpenLayers.Layer.Vector("Polygon Layer");
-
- map.addLayers([wmsLayer, polygonLayer]);
- map.addControl(new OpenLayers.Control.LayerSwitcher());
- map.addControl(new OpenLayers.Control.MousePosition());
-
- polyOptions = {sides: 4, irregular: true};
- polygonControl = new OpenLayers.Control.DrawFeature(polygonLayer,
- OpenLayers.Handler.RegularPolygon,
- {handlerOptions: polyOptions});
- //alert(polygonControl);
-
- map.addControl(polygonControl);
-
- polygonControl.featureAdded=featureInsert;
-
- map.setCenter(new OpenLayers.LonLat(0, 0), 3);
-
- document.getElementById('noneToggle').checked = true;
- //document.getElementById('irregularToggle').checked = false;
-
- //var polyOptions = {sides: 4, irregular: true};
- //polygonControl.handler.setOptions(polyOptions);
- }
-
- function featureInsert(feature){
- var old=[];
- for (var i = 0; i < polygonLayer.features.length; i++) {
- if (polygonLayer.features[i] != feature) {
- old.push(polygonLayer.features[i]);
- }
- }
- polygonLayer.destroyFeatures(old);
-
- var bounds = feature.geometry.getBounds();
-
- document.form.bounds_top.value = bounds.top;
- document.form.bounds_right.value = bounds.right;
- document.form.bounds_btm.value = bounds.bottom;
- document.form.bounds_left.value = bounds.left;
- bbox_set=true;
- }
- function download() {
- var bbox = document.form.bounds_left.value + "," +
- document.form.bounds_btm.value + "," +
- document.form.bounds_right.value + "," +
- document.form.bounds_top.value;
- if (bbox_set) {
- location.href="http://maps.navit-project.org/api/map?bbox=" + bbox;
- } else {
- alert("Please select a bounding box first\n");
- }
- }
- function setOptions(options) {
- polygonControl.handler.setOptions(options);
- }
- function setSize(fraction) {
- var radius = fraction * map.getExtent().getHeight();
- polygonControl.handler.setOptions({radius: radius,
- angle: 0});
- }
- </script>
- </head>
- <body onload="init()">
- <h2>Planet extract</h2>
- <div id="map"></div>
- <div id="controls">
- <ul style="list-style:none;"><b>Map Controls</b>
- <li>
- <input type="radio" name="type"
- value="none" id="noneToggle"
- onclick="polygonControl.deactivate()"
- checked="checked" />
- <label for="noneToggle">navigate</label>
- </li>
- <li>
- <input type="radio" name="type"
- value="polygon" id="polygonToggle"
- onclick="polygonControl.activate()" />
- <label for="polygonToggle">select</label>
- </li>
- </ul>
- <ul style="list-style:none"><b>Fetch box</b>
- <form name="form">
- <li>Top Right: <input type="text" name="bounds_top" class="input">,
- <input type="text" name="bounds_right" class="input"></li>
- <li>Bottom left: <input type="text" name="bounds_btm" class="input">,
- <input type="text" name="bounds_left" class="input"></li>
- </form>
- <li>&nbsp;</li>
- <li><input type="button" class="button" value="Get map!" onclick="javascript:download()"></li>
- </ul>
- </div>
- </body>
-</html>
+<html xmlns="http://www.w3.org/1999/xhtml">
+ <head>
+ <title>Planet Extraction</title>
+ <style type="text/css">
+ html, body {
+ margin: 0;
+ padding: 1em;
+ font: 0.9em Verdana, Arial, sans serif;
+ }
+ input, select, textarea {
+ font: 1em Verdana, Arial, sans serif;
+ }
+ .input {
+ border: none;
+ width: 100px;
+ }
+ .bbox {
+ font-size: 12px;
+ color: #000;
+ background-color: #fff;
+ width: 300px;
+ border: 1px solid gray;
+ }
+ .button {
+ width: 200px;
+ height: 50px;
+ font-weight: bold;
+ }
+ #map {
+ float: left;
+ width: 500px;
+ height: 500px;
+ border: 1px solid gray;
+ }
+ #controls {
+ float: left;
+
+ }
+ </style>
+ <script src="http://openlayers.org/dev/lib/OpenLayers.js"></script>
+ <script type="text/javascript">
+ var map, polygonControl, polygonLayer, bbox_set;
+
+ OpenLayers.Util.onImageLoadErrorColor = "transparent";
+ function init(){
+ map = new OpenLayers.Map('map');
+
+ var wmsLayer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
+ "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'});
+
+ polygonLayer = new OpenLayers.Layer.Vector("Polygon Layer");
+
+ map.addLayers([wmsLayer, polygonLayer]);
+ map.addControl(new OpenLayers.Control.LayerSwitcher());
+ map.addControl(new OpenLayers.Control.MousePosition());
+
+ polyOptions = {sides: 4, irregular: true};
+ polygonControl = new OpenLayers.Control.DrawFeature(polygonLayer,
+ OpenLayers.Handler.RegularPolygon,
+ {handlerOptions: polyOptions});
+ //alert(polygonControl);
+
+ map.addControl(polygonControl);
+
+ polygonControl.featureAdded=featureInsert;
+
+ map.setCenter(new OpenLayers.LonLat(0, 0), 3);
+
+ document.getElementById('noneToggle').checked = true;
+ //document.getElementById('irregularToggle').checked = false;
+
+ //var polyOptions = {sides: 4, irregular: true};
+ //polygonControl.handler.setOptions(polyOptions);
+ }
+
+ function featureInsert(feature){
+ var old=[];
+ for (var i = 0; i < polygonLayer.features.length; i++) {
+ if (polygonLayer.features[i] != feature) {
+ old.push(polygonLayer.features[i]);
+ }
+ }
+ polygonLayer.destroyFeatures(old);
+
+ var bounds = feature.geometry.getBounds();
+
+ document.form.bounds_top.value = bounds.top;
+ document.form.bounds_right.value = bounds.right;
+ document.form.bounds_btm.value = bounds.bottom;
+ document.form.bounds_left.value = bounds.left;
+ bbox_set=true;
+ }
+ function download() {
+ var bbox = document.form.bounds_left.value + "," +
+ document.form.bounds_btm.value + "," +
+ document.form.bounds_right.value + "," +
+ document.form.bounds_top.value;
+ if (bbox_set) {
+ location.href="http://maps.navit-project.org/api/map?bbox=" + bbox;
+ } else {
+ alert("Please select a bounding box first\n");
+ }
+ }
+ function setOptions(options) {
+ polygonControl.handler.setOptions(options);
+ }
+ function setSize(fraction) {
+ var radius = fraction * map.getExtent().getHeight();
+ polygonControl.handler.setOptions({radius: radius,
+ angle: 0});
+ }
+ </script>
+ </head>
+ <body onload="init()">
+ <h2>Planet extract</h2>
+ <div id="map"></div>
+ <div id="controls">
+ <ul style="list-style:none;"><b>Map Controls</b>
+ <li>
+ <input type="radio" name="type"
+ value="none" id="noneToggle"
+ onclick="polygonControl.deactivate()"
+ checked="checked" />
+ <label for="noneToggle">navigate</label>
+ </li>
+ <li>
+ <input type="radio" name="type"
+ value="polygon" id="polygonToggle"
+ onclick="polygonControl.activate()" />
+ <label for="polygonToggle">select</label>
+ </li>
+ </ul>
+ <ul style="list-style:none"><b>Fetch box</b>
+ <form name="form">
+ <li>Top Right: <input type="text" name="bounds_top" class="input">,
+ <input type="text" name="bounds_right" class="input"></li>
+ <li>Bottom left: <input type="text" name="bounds_btm" class="input">,
+ <input type="text" name="bounds_left" class="input"></li>
+ </form>
+ <li>&nbsp;</li>
+ <li><input type="button" class="button" value="Get map!" onclick="javascript:download()"></li>
+ </ul>
+ </div>
+ </body>
+</html>
diff --git a/navit/script/mapextract.php b/navit/script/mapextract.php
index 004b63caf..33441ba95 100644
--- a/navit/script/mapextract.php
+++ b/navit/script/mapextract.php
@@ -1,225 +1,225 @@
-#!/usr/local/bin/php &#8211;q
-<?php
-function getmercator($sx,$sy,$ex,$ey) {
-
- $sx = $sx*6371000.0*M_PI/180;
- $sy = log(tan(M_PI_4+$sy*M_PI/360))*6371000.0;
-
- $ex = $ex*6371000.0*M_PI/180;
- $ey = log(tan(M_PI_4+$ey*M_PI/360))*6371000.0;
-
- return array(
- 'l' => array(
- 'x' => $sx,
- 'y' => $sy
- ),
- 'h' => array(
- 'x' => $ex,
- 'y' => $ey
- )
- );
-
-}
-function contains_bbox($c, &$r) {
- if ($c['l']['x'] > $r['h']['x'])
- return false;
- elseif ($c['h']['x'] < $r['l']['x'])
- return false;
- elseif ($c['l']['y'] > $r['h']['y'])
- return false;
- elseif ($c['h']['y'] < $r['l']['y'])
- return false;
- else
- return true;
-}
-
-$fetch_bbox = getmercator(11.3, 47.9, 11.4, 48.0);
-
-$files = array();
-$files['input'] = '/home/burner/carputer/navit/src/maps/osm_bbox_11.3,47.9,11.7,48.2.bin';
-$files['output'] = 'myarea.bin';
-
-$formats = array();
-$formats['ziphpack'] = "lssssslLLSS";
-$formats['zipheader'] = "l" . "ziplocsig"; # Signature (is always the same)
-$formats['zipheader'] .= "/s" . "zipver"; # zip version needed
-$formats['zipheader'] .= "/s" . "zipgenfld";# type of os that generated the file
-$formats['zipheader'] .= "/s" . "zipmthd"; #
-$formats['zipheader'] .= "/s" . "ziptime"; # time
-$formats['zipheader'] .= "/s" . "zipdate"; # date
-$formats['zipheader'] .= "/l" . "zipcrc"; # crc checksum
-$formats['zipheader'] .= "/L" . "zipsize"; # data size
-$formats['zipheader'] .= "/L" . "zipuncmp"; # uncompressed size
-$formats['zipheader'] .= "/S" . "zipfnln"; # length of filename
-$formats['zipheader'] .= "/S" . "zipxtraln";# length of extra data (always 0)
-
-$formats['zipcd'] = "".
- "i" . "zipcensig/".
- "c" . "zipcver/".
- "c" . "zipcos/".
- "c" . "zipcvxt/".
- "c" . "zipcexos/".
- "s" . "zipcflg/".
- "s" . "zipcmthd/".
- "s" . "ziptim/".
- "s" . "zipdat/".
- "i" . "zipccrc/".
- "I" . "zipcsiz/".
- "I" . "zipcunc/".
- "S" . "zipcfnl/".
- "S" . "zipcxtl/".
- "S" . "zipccml/".
- "S" . "zipdsk/".
- "S" . "zipint/".
- "I" . "zipext/".
- "I" . "zipofst/".
-$formats['zipcdpack'] = "iccccssssiIISSSSSII";
-
-$formats['zipcontent'] = "i5x/i5y/ii";
-
-$world_bbox = array();
-$world_bbox['l']['x'] = -20000000;
-$world_bbox['l']['y'] = -20000000;
-$world_bbox['h']['x'] = 20000000;
-$world_bbox['h']['y'] = 20000000;
-
-$fp = fopen($files['input'], 'r');
-$sp = fopen($files['output'], 'w');
-
-$files = array();
-$offset = 0;
-
-/**
- * Read through zipheaders
- *
- */
-while (!feof($fp)) {
-
- $buffer = fread($fp, 30);
- $tileinfo = unpack($formats['zipheader'], $buffer);
-
- if ($tileinfo['zipfnln'] <= 0)
- break;
-
- $filename = fread($fp, $tileinfo['zipfnln']);
- $x=0;
- $done=false;
-
- $r = $world_bbox;
-
- while (!$done) {
- $c['x'] = floor( ($r['l']['x'] + $r['h']['x'])/2 );
- $c['y'] = floor( ($r['l']['y'] + $r['h']['y'])/2 );
-
- switch($filename[$x]) {
- case 'a':
- $r['l']['x'] = $c['x'];
- $r['l']['y'] = $c['y'];
- break;
- case 'b':
- $r['h']['x'] = $c['x'];
- $r['l']['y'] = $c['y'];
- break;
- case 'c':
- $r['l']['x'] = $c['x'];
- $r['h']['y'] = $c['y'];
- break;
- case 'd':
- $r['h']['x'] = $c['x'];
- $r['h']['y'] = $c['y'];
- break;
- default:
- $done=true;
- }
- $x++;
- }
-
- $tilecontent = fread($fp, $tileinfo['zipsize']);
-
- /* Area inside box, save it! */
- if (contains_bbox($fetch_bbox, $r)) {
- #echo "In box. ";
- #echo $filename . " ";
- $zipheader = $buffer;
- #echo "\n";
-
- /* Area outside of box, set zipcontent=0 */
- } else {
- $tileinfo['zipmthd'] = $tileinfo['zipcrc'] = $tileinfo['zipsize'] = $tileinfo['zipuncmp'] = 0;
- #echo "Out of box";
- $zipheader = $tileinfo;
- $tilecontent = '';
- $zipheader = pack($formats['ziphpack'],
- $tileinfo['ziplocsig'],
- $tileinfo['zipver'],
- $tileinfo['zipgenfld'],
- $tileinfo['zipmthd'],
- $tileinfo['ziptime'],
- $tileinfo['zipdate'],
- $tileinfo['zipcrc'],
- $tileinfo['zipsize'],
- $tileinfo['zipuncmp'],
- $tileinfo['zipfnln'],
- $tileinfo['zipxtraln']
- );
- }
-
- $put = $zipheader.$filename.$tilecontent;
- $files[$filename]['header'] = $tileinfo;
- $files[$filename]['size'] = strlen($put);
-
- $zipcd = array();
- $zipcd['zipcensig'] = 0x02014b50;
- $zipcd['zipcver'] = $tileinfo['zipver'];
- $zipcd['zipcos'] = 0x00;
- $zipcd['zipcvxt'] = 0x0a;
- $zipcd['zipcexos'] = 0x00;
- $zipcd['zipcflg'] = 0x00;
- $zipcd['zipcmthd'] = $tileinfo['zipmthd'];
- $zipcd['ziptim'] = $tileinfo['ziptime'];
- $zipcd['zipdat'] = $tileinfo['zipdate'];
- $zipcd['zipccrc'] = $tileinfo['zipcrc'];
- $zipcd['zipcsiz'] = $tileinfo['zipsize'];
- $zipcd['zipcunc'] = $tileinfo['zipuncmp'];
- $zipcd['zipcfnl'] = $tileinfo['zipfnln'];
- $zipcd['zipcxtl'] = 0x00;
- $zipcd['zipccml'] = 0x00;
- $zipcd['zipdsk'] = 0x00;
- $zipcd['zipint'] = 0x00;
- $zipcd['zipext'] = 0x00;
- $zipcd['zipofst'] = $offset;
-
- $zipcd_data .= pack($formats['zipcdpack'],
- $zipcd['zipcensig'],
- $zipcd['zipcver'],
- $zipcd['zipcos'],
- $zipcd['zipcvxt'],
- $zipcd['zipcexos'],
- $zipcd['zipcflg'],
- $zipcd['zipcmthd'],
- $zipcd['ziptim'],
- $zipcd['zipdat'],
- $zipcd['zipccrc'],
- $zipcd['zipcsiz'],
- $zipcd['zipcunc'],
- $zipcd['zipcfnl'],
- $zipcd['zipcxtl'],
- $zipcd['zipccml'],
- $zipcd['zipdsk'],
- $zipcd['zipint'],
- $zipcd['zipext'],
- $zipcd['zipofst']
- ) . $filename;
-
-
- fwrite($sp, $put);
- $offset += strlen($put);
-
-}
-
-fwrite($sp, $zipcd_data);
-
-fclose($fp);
-fclose($sp);
-
-?>
+#!/usr/local/bin/php &#8211;q
+<?php
+function getmercator($sx,$sy,$ex,$ey) {
+
+ $sx = $sx*6371000.0*M_PI/180;
+ $sy = log(tan(M_PI_4+$sy*M_PI/360))*6371000.0;
+
+ $ex = $ex*6371000.0*M_PI/180;
+ $ey = log(tan(M_PI_4+$ey*M_PI/360))*6371000.0;
+
+ return array(
+ 'l' => array(
+ 'x' => $sx,
+ 'y' => $sy
+ ),
+ 'h' => array(
+ 'x' => $ex,
+ 'y' => $ey
+ )
+ );
+
+}
+function contains_bbox($c, &$r) {
+ if ($c['l']['x'] > $r['h']['x'])
+ return false;
+ elseif ($c['h']['x'] < $r['l']['x'])
+ return false;
+ elseif ($c['l']['y'] > $r['h']['y'])
+ return false;
+ elseif ($c['h']['y'] < $r['l']['y'])
+ return false;
+ else
+ return true;
+}
+
+$fetch_bbox = getmercator(11.3, 47.9, 11.4, 48.0);
+
+$files = array();
+$files['input'] = '/home/burner/carputer/navit/src/maps/osm_bbox_11.3,47.9,11.7,48.2.bin';
+$files['output'] = 'myarea.bin';
+
+$formats = array();
+$formats['ziphpack'] = "lssssslLLSS";
+$formats['zipheader'] = "l" . "ziplocsig"; # Signature (is always the same)
+$formats['zipheader'] .= "/s" . "zipver"; # zip version needed
+$formats['zipheader'] .= "/s" . "zipgenfld";# type of os that generated the file
+$formats['zipheader'] .= "/s" . "zipmthd"; #
+$formats['zipheader'] .= "/s" . "ziptime"; # time
+$formats['zipheader'] .= "/s" . "zipdate"; # date
+$formats['zipheader'] .= "/l" . "zipcrc"; # crc checksum
+$formats['zipheader'] .= "/L" . "zipsize"; # data size
+$formats['zipheader'] .= "/L" . "zipuncmp"; # uncompressed size
+$formats['zipheader'] .= "/S" . "zipfnln"; # length of filename
+$formats['zipheader'] .= "/S" . "zipxtraln";# length of extra data (always 0)
+
+$formats['zipcd'] = "".
+ "i" . "zipcensig/".
+ "c" . "zipcver/".
+ "c" . "zipcos/".
+ "c" . "zipcvxt/".
+ "c" . "zipcexos/".
+ "s" . "zipcflg/".
+ "s" . "zipcmthd/".
+ "s" . "ziptim/".
+ "s" . "zipdat/".
+ "i" . "zipccrc/".
+ "I" . "zipcsiz/".
+ "I" . "zipcunc/".
+ "S" . "zipcfnl/".
+ "S" . "zipcxtl/".
+ "S" . "zipccml/".
+ "S" . "zipdsk/".
+ "S" . "zipint/".
+ "I" . "zipext/".
+ "I" . "zipofst/".
+$formats['zipcdpack'] = "iccccssssiIISSSSSII";
+
+$formats['zipcontent'] = "i5x/i5y/ii";
+
+$world_bbox = array();
+$world_bbox['l']['x'] = -20000000;
+$world_bbox['l']['y'] = -20000000;
+$world_bbox['h']['x'] = 20000000;
+$world_bbox['h']['y'] = 20000000;
+
+$fp = fopen($files['input'], 'r');
+$sp = fopen($files['output'], 'w');
+
+$files = array();
+$offset = 0;
+
+/**
+ * Read through zipheaders
+ *
+ */
+while (!feof($fp)) {
+
+ $buffer = fread($fp, 30);
+ $tileinfo = unpack($formats['zipheader'], $buffer);
+
+ if ($tileinfo['zipfnln'] <= 0)
+ break;
+
+ $filename = fread($fp, $tileinfo['zipfnln']);
+ $x=0;
+ $done=false;
+
+ $r = $world_bbox;
+
+ while (!$done) {
+ $c['x'] = floor( ($r['l']['x'] + $r['h']['x'])/2 );
+ $c['y'] = floor( ($r['l']['y'] + $r['h']['y'])/2 );
+
+ switch($filename[$x]) {
+ case 'a':
+ $r['l']['x'] = $c['x'];
+ $r['l']['y'] = $c['y'];
+ break;
+ case 'b':
+ $r['h']['x'] = $c['x'];
+ $r['l']['y'] = $c['y'];
+ break;
+ case 'c':
+ $r['l']['x'] = $c['x'];
+ $r['h']['y'] = $c['y'];
+ break;
+ case 'd':
+ $r['h']['x'] = $c['x'];
+ $r['h']['y'] = $c['y'];
+ break;
+ default:
+ $done=true;
+ }
+ $x++;
+ }
+
+ $tilecontent = fread($fp, $tileinfo['zipsize']);
+
+ /* Area inside box, save it! */
+ if (contains_bbox($fetch_bbox, $r)) {
+ #echo "In box. ";
+ #echo $filename . " ";
+ $zipheader = $buffer;
+ #echo "\n";
+
+ /* Area outside of box, set zipcontent=0 */
+ } else {
+ $tileinfo['zipmthd'] = $tileinfo['zipcrc'] = $tileinfo['zipsize'] = $tileinfo['zipuncmp'] = 0;
+ #echo "Out of box";
+ $zipheader = $tileinfo;
+ $tilecontent = '';
+ $zipheader = pack($formats['ziphpack'],
+ $tileinfo['ziplocsig'],
+ $tileinfo['zipver'],
+ $tileinfo['zipgenfld'],
+ $tileinfo['zipmthd'],
+ $tileinfo['ziptime'],
+ $tileinfo['zipdate'],
+ $tileinfo['zipcrc'],
+ $tileinfo['zipsize'],
+ $tileinfo['zipuncmp'],
+ $tileinfo['zipfnln'],
+ $tileinfo['zipxtraln']
+ );
+ }
+
+ $put = $zipheader.$filename.$tilecontent;
+ $files[$filename]['header'] = $tileinfo;
+ $files[$filename]['size'] = strlen($put);
+
+ $zipcd = array();
+ $zipcd['zipcensig'] = 0x02014b50;
+ $zipcd['zipcver'] = $tileinfo['zipver'];
+ $zipcd['zipcos'] = 0x00;
+ $zipcd['zipcvxt'] = 0x0a;
+ $zipcd['zipcexos'] = 0x00;
+ $zipcd['zipcflg'] = 0x00;
+ $zipcd['zipcmthd'] = $tileinfo['zipmthd'];
+ $zipcd['ziptim'] = $tileinfo['ziptime'];
+ $zipcd['zipdat'] = $tileinfo['zipdate'];
+ $zipcd['zipccrc'] = $tileinfo['zipcrc'];
+ $zipcd['zipcsiz'] = $tileinfo['zipsize'];
+ $zipcd['zipcunc'] = $tileinfo['zipuncmp'];
+ $zipcd['zipcfnl'] = $tileinfo['zipfnln'];
+ $zipcd['zipcxtl'] = 0x00;
+ $zipcd['zipccml'] = 0x00;
+ $zipcd['zipdsk'] = 0x00;
+ $zipcd['zipint'] = 0x00;
+ $zipcd['zipext'] = 0x00;
+ $zipcd['zipofst'] = $offset;
+
+ $zipcd_data .= pack($formats['zipcdpack'],
+ $zipcd['zipcensig'],
+ $zipcd['zipcver'],
+ $zipcd['zipcos'],
+ $zipcd['zipcvxt'],
+ $zipcd['zipcexos'],
+ $zipcd['zipcflg'],
+ $zipcd['zipcmthd'],
+ $zipcd['ziptim'],
+ $zipcd['zipdat'],
+ $zipcd['zipccrc'],
+ $zipcd['zipcsiz'],
+ $zipcd['zipcunc'],
+ $zipcd['zipcfnl'],
+ $zipcd['zipcxtl'],
+ $zipcd['zipccml'],
+ $zipcd['zipdsk'],
+ $zipcd['zipint'],
+ $zipcd['zipext'],
+ $zipcd['zipofst']
+ ) . $filename;
+
+
+ fwrite($sp, $put);
+ $offset += strlen($put);
+
+}
+
+fwrite($sp, $zipcd_data);
+
+fclose($fp);
+fclose($sp);
+
+?>
diff --git a/navit/search.c b/navit/search.c
index 139feef58..34b7be0fc 100644
--- a/navit/search.c
+++ b/navit/search.c
@@ -138,7 +138,7 @@ search_list_level(enum attr_type attr_type)
case attr_postal:
return -1;
default:
- dbg(lvl_error,"unknown search '%s'\n",attr_to_name(attr_type));
+ dbg(lvl_error,"unknown search '%s'",attr_to_name(attr_type));
return -1;
}
}
@@ -225,10 +225,10 @@ search_phrase_used(struct phrase *p, GList *used_phrases)
{
while (used_phrases) {
struct phrase *pu=used_phrases->data;
- dbg(lvl_debug,"'%s'-'%s' vs '%s'-'%s'\n",p->start,p->end,pu->start,pu->end);
+ dbg(lvl_debug,"'%s'-'%s' vs '%s'-'%s'",p->start,p->end,pu->start,pu->end);
if (p->start < pu->end && p->end > pu->start)
return 1;
- dbg(lvl_debug,"unused\n");
+ dbg(lvl_debug,"unused");
used_phrases=g_list_next(used_phrases);
}
return 0;
@@ -255,7 +255,7 @@ search_by_address_attr(GList *results, struct search_list *sl, GList *phrases, G
int count=0,wordcount_all=wordcount+p->wordcount;
struct search_list_result *slr;
attr.u.str=search_phrase_str(p);
- dbg(lvl_debug,"%s phrase '%s'\n",attr_to_name(attr_type),attr.u.str);
+ dbg(lvl_debug,"%s phrase '%s'",attr_to_name(attr_type),attr.u.str);
search_list_search(sl, &attr, 0);
while ((slr=search_list_get_result(sl))) {
if (attr_type != attr_country_all) {
@@ -265,7 +265,7 @@ search_by_address_attr(GList *results, struct search_list *sl, GList *phrases, G
}
count++;
}
- dbg(lvl_debug,"%d results wordcount %d\n",count,wordcount_all);
+ dbg(lvl_debug,"%d results wordcount %d",count,wordcount_all);
if (count) {
GList *used=g_list_prepend(g_list_copy(exclude), tmp->data);
enum attr_type new_attr_type=attr_none;
@@ -348,7 +348,7 @@ search_list_search(struct search_list *this_, struct attr *search_attr, int part
{
struct search_list_level *le;
int level;
- dbg(lvl_info,"Starting search for '=%s' of type %s\n", search_attr->u.str, attr_to_name(search_attr->type));
+ dbg(lvl_info,"Starting search for '=%s' of type %s", search_attr->u.str, attr_to_name(search_attr->type));
search_address_results_free(this_);
if (search_attr->type == attr_address) {
search_by_address(this_, search_attr->u.str);
@@ -392,7 +392,7 @@ search_list_select(struct search_list *this_, enum attr_type attr_type, int id,
curr=le->list;
if (mode > 0 || !id)
le->selected=mode;
- //dbg(lvl_debug,"enter level=%d %d %d %p\n", level, id, mode, curr);
+ //dbg(lvl_debug,"enter level=%d %d %d %p", level, id, mode, curr);
num = 0;
while (curr) {
num++;
@@ -401,13 +401,13 @@ search_list_select(struct search_list *this_, enum attr_type attr_type, int id,
slc->selected=mode;
if (id) {
le->last=curr;
- //dbg(lvl_debug,"found\n");
+ //dbg(lvl_debug,"found");
return slc;
}
}
curr=g_list_next(curr);
}
- //dbg(lvl_debug,"not found\n");
+ //dbg(lvl_debug,"not found");
return NULL;
}
@@ -566,7 +566,7 @@ search_list_town_new(struct item *item)
ret->itemt=*item;
ret->common.item=ret->common.unique=*item;
if (item_attr_get(item, attr_town_streets_item, &attr)) {
- dbg(lvl_debug,"town_assoc 0x%x 0x%x\n", attr.u.item->id_hi, attr.u.item->id_lo);
+ dbg(lvl_debug,"town_assoc 0x%x 0x%x", attr.u.item->id_hi, attr.u.item->id_lo);
ret->common.unique=*attr.u.item;
}
search_list_common_new(item, &ret->common);
@@ -760,7 +760,7 @@ search_postal_merge(char *mask, char *new)
{
int i;
char *ret=NULL;
- dbg(lvl_debug,"enter %s %s\n", mask, new);
+ dbg(lvl_debug,"enter %s %s", mask, new);
if (!new)
return NULL;
if (!mask)
@@ -777,7 +777,7 @@ search_postal_merge(char *mask, char *new)
while (mask[i])
ret[i++]='.';
}
- dbg(lvl_debug,"merged %s with %s as %s\n", mask, new, ret);
+ dbg(lvl_debug,"merged %s with %s as %s", mask, new, ret);
return ret;
}
@@ -861,21 +861,21 @@ search_list_get_result(struct search_list *this_)
return ret;
}
- //dbg(lvl_debug,"enter\n");
+ //dbg(lvl_debug,"enter");
le=&this_->levels[level];
- //dbg(lvl_debug,"le=%p\n", le);
+ //dbg(lvl_debug,"le=%p", le);
for (;;)
{
- //dbg(lvl_debug,"le->search=%p\n", le->search);
+ //dbg(lvl_debug,"le->search=%p", le->search);
if (! le->search)
{
- //dbg(lvl_debug,"partial=%d level=%d\n", le->partial, level);
+ //dbg(lvl_debug,"partial=%d level=%d", le->partial, level);
if (! level)
le->parent=NULL;
else
{
leu=&this_->levels[level-1];
- //dbg(lvl_debug,"leu->curr=%p\n", leu->curr);
+ //dbg(lvl_debug,"leu->curr=%p", leu->curr);
for (;;)
{
//dbg(lvl_debug,"*********########");
@@ -897,23 +897,23 @@ search_list_get_result(struct search_list *this_)
}
if (le->parent)
{
- //dbg(lvl_debug,"mapset_search_new with item(%d,%d)\n", le->parent->item.id_hi, le->parent->item.id_lo);
+ //dbg(lvl_debug,"mapset_search_new with item(%d,%d)", le->parent->item.id_hi, le->parent->item.id_lo);
}
- //dbg(lvl_debug,"############## attr=%s\n", attr_to_name(le->attr->type));
+ //dbg(lvl_debug,"############## attr=%s", attr_to_name(le->attr->type));
le->search=mapset_search_new(this_->ms, &le->parent->item, le->attr, le->partial);
le->hash=g_hash_table_new(search_item_hash_hash, search_item_hash_equal);
}
- //dbg(lvl_debug,"le->search=%p\n", le->search);
+ //dbg(lvl_debug,"le->search=%p", le->search);
if (!this_->item)
{
//dbg(lvl_debug,"sssss 1");
this_->item=mapset_search_get_item(le->search);
- //dbg(lvl_debug,"sssss 1 %p\n",this_->item);
+ //dbg(lvl_debug,"sssss 1 %p",this_->item);
}
if (this_->item)
{
void *p=NULL;
- //dbg(lvl_debug,"id_hi=%d id_lo=%d\n", this_->item->id_hi, this_->item->id_lo);
+ //dbg(lvl_debug,"id_hi=%d id_lo=%d", this_->item->id_hi, this_->item->id_lo);
if (this_->postal)
{
struct attr postal;
@@ -929,7 +929,7 @@ search_list_get_result(struct search_list *this_)
this_->result.town=NULL;
this_->result.street=NULL;
this_->result.c=NULL;
- //dbg(lvl_debug,"case x LEVEL start %d\n",level);
+ //dbg(lvl_debug,"case x LEVEL start %d",level);
switch (level)
{
case 0:
@@ -965,13 +965,13 @@ search_list_get_result(struct search_list *this_)
this_->item=NULL;
break;
case 3:
- dbg(lvl_debug,"case 3 HOUSENUMBER\n");
+ dbg(lvl_debug,"case 3 HOUSENUMBER");
has_street_name=0;
// if this housenumber has a streetname tag, set the name now
if (item_attr_get(this_->item, attr_street_name, &attr2))
{
- dbg(lvl_debug,"streetname: %s\n",attr2.u.str);
+ dbg(lvl_debug,"streetname: %s",attr2.u.str);
has_street_name=1;
}
@@ -988,7 +988,7 @@ search_list_get_result(struct search_list *this_)
{
this_->item=NULL;
} else {
- dbg(lvl_debug,"interpolation!\n");
+ dbg(lvl_debug,"interpolation!");
}
if(le->parent && has_street_name) {
diff --git a/navit/search_houseno_interpol.c b/navit/search_houseno_interpol.c
index 604fcf93c..fe575b73d 100644
--- a/navit/search_houseno_interpol.c
+++ b/navit/search_houseno_interpol.c
@@ -79,7 +79,7 @@ house_number_interpolation_clear_all(struct house_number_interpolation *inter)
static char *
search_next_house_number_curr_interpol_with_ends(struct house_number_interpolation *inter)
{
- dbg(lvl_debug,"interpolate %s-%s %s\n",inter->first,inter->last,inter->curr);
+ dbg(lvl_debug,"interpolate %s-%s %s",inter->first,inter->last,inter->curr);
if (!inter->first || !inter->last)
return NULL;
if (!inter->curr)
@@ -97,7 +97,7 @@ search_next_house_number_curr_interpol_with_ends(struct house_number_interpolati
inter->curr=NULL;
}
}
- dbg(lvl_debug,"interpolate result %s\n",inter->curr);
+ dbg(lvl_debug,"interpolate result %s",inter->curr);
return inter->curr;
}
@@ -141,7 +141,7 @@ search_house_number_interpolation_split(char *str, struct house_number_interpola
strncpy(first, str, len);
first[len]='\0';
last=g_strdup(pos+1);
- dbg(lvl_debug,"%s = %s - %s\n",str, first, last);
+ dbg(lvl_debug,"%s = %s - %s",str, first, last);
if (atoi(first) > atoi(last)) {
inter->first=last;
inter->last=first;
@@ -158,7 +158,7 @@ search_house_number_coordinate(struct item *item, struct house_number_interpolat
{
struct pcoord *ret=g_new(struct pcoord, 1);
ret->pro = map_projection(item->map);
- dbg(lvl_debug,"%s\n",item_to_name(item->type));
+ dbg(lvl_debug,"%s",item_to_name(item->type));
if (!inter) {
struct coord c;
if (item_coord_get(item, &c, 1)) {
@@ -183,29 +183,29 @@ search_house_number_coordinate(struct item *item, struct house_number_interpolat
if (count) {
int i,distance_sum=0,hn_distance;
int *distances=g_alloca(sizeof(int)*(count-1));
- dbg(lvl_debug,"count=%d hn_length=%d hn_pos=%d (%s of %s-%s)\n",count,hn_length,hn_pos,inter->curr,inter->first,inter->last);
+ dbg(lvl_debug,"count=%d hn_length=%d hn_pos=%d (%s of %s-%s)",count,hn_length,hn_pos,inter->curr,inter->first,inter->last);
if (!hn_length) {
hn_length=2;
hn_pos=1;
}
if (count == max)
- dbg(lvl_error,"coordinate overflow\n");
+ dbg(lvl_error,"coordinate overflow");
for (i = 0 ; i < count-1 ; i++) {
distances[i]=navit_sqrt(transform_distance_sq(&c[i],&c[i+1]));
distance_sum+=distances[i];
- dbg(lvl_debug,"distance[%d]=%d\n",i,distances[i]);
+ dbg(lvl_debug,"distance[%d]=%d",i,distances[i]);
}
- dbg(lvl_debug,"sum=%d\n",distance_sum);
+ dbg(lvl_debug,"sum=%d",distance_sum);
#if 0
hn_distance=distance_sum*hn_pos/hn_length;
#else
hn_distance=(distance_sum*hn_pos+distance_sum*inter_increment/2)/(hn_length+inter_increment);
#endif
- dbg(lvl_debug,"hn_distance=%d\n",hn_distance);
+ dbg(lvl_debug,"hn_distance=%d",hn_distance);
i=0;
while (i < count-1 && hn_distance > distances[i])
hn_distance-=distances[i++];
- dbg(lvl_debug,"remaining distance=%d from %d\n",hn_distance,distances[i]);
+ dbg(lvl_debug,"remaining distance=%d from %d",hn_distance,distances[i]);
ret->x=(c[i+1].x-c[i].x)*hn_distance/distances[i]+c[i].x;
ret->y=(c[i+1].y-c[i].y)*hn_distance/distances[i]+c[i].y;
}
diff --git a/navit/speech.c b/navit/speech.c
index cabd998dc..d1ebcc276 100644
--- a/navit/speech.c
+++ b/navit/speech.c
@@ -41,25 +41,25 @@ speech_new(struct attr *parent, struct attr **attrs)
attr=attr_search(attrs, NULL, attr_type);
if (! attr) {
- dbg(lvl_error,"type missing\n");
+ dbg(lvl_error,"type missing");
return NULL;
}
- dbg(lvl_debug,"type='%s'\n", attr->u.str);
+ dbg(lvl_debug,"type='%s'", attr->u.str);
speech_new=plugin_get_category_speech(attr->u.str);
- dbg(lvl_debug,"new=%p\n", speech_new);
+ dbg(lvl_debug,"new=%p", speech_new);
if (! speech_new) {
- dbg(lvl_error,"wrong type '%s'\n", attr->u.str);
+ dbg(lvl_error,"wrong type '%s'", attr->u.str);
return NULL;
}
this_=(struct speech *)navit_object_new(attrs, &speech_func, sizeof(struct speech));
this_->priv=speech_new(&this_->meth, this_->attrs, parent);
- dbg(lvl_debug, "say=%p\n", this_->meth.say);
- dbg(lvl_debug,"priv=%p\n", this_->priv);
+ dbg(lvl_debug, "say=%p", this_->meth.say);
+ dbg(lvl_debug,"priv=%p", this_->priv);
if (! this_->priv) {
speech_destroy(this_);
return NULL;
}
- dbg(lvl_debug,"return %p\n", this_);
+ dbg(lvl_debug,"return %p", this_);
return this_;
}
@@ -75,7 +75,7 @@ speech_destroy(struct speech *this_)
int
speech_say(struct speech *this_, const char *text)
{
- dbg(lvl_debug, "this_=%p text='%s' calling %p\n", this_, text, this_->meth.say);
+ dbg(lvl_debug, "this_=%p text='%s' calling %p", this_, text, this_->meth.say);
return (this_->meth.say)(this_->priv, text);
}
diff --git a/navit/speech/android/speech_android.c b/navit/speech/android/speech_android.c
index e9a206ebf..901abbc26 100644
--- a/navit/speech/android/speech_android.c
+++ b/navit/speech/android/speech_android.c
@@ -41,7 +41,7 @@ speech_android_say(struct speech_priv *this, const char *text)
int i;
string = (*jnienv)->NewStringUTF(jnienv, str);
- dbg(lvl_debug,"enter %s\n",str);
+ dbg(lvl_debug,"enter %s",str);
(*jnienv)->CallVoidMethod(jnienv, this->NavitSpeech, this->NavitSpeech_say, string);
(*jnienv)->DeleteLocalRef(jnienv, string);
g_free(str);
@@ -66,20 +66,20 @@ speech_android_init(struct speech_priv *ret)
char *class="org/navitproject/navit/NavitSpeech2";
if (!android_find_class_global(class, &ret->NavitSpeechClass)) {
- dbg(lvl_error,"No class found\n");
+ dbg(lvl_error,"No class found");
return 0;
}
- dbg(lvl_debug,"at 3\n");
+ dbg(lvl_debug,"at 3");
cid = (*jnienv)->GetMethodID(jnienv, ret->NavitSpeechClass, "<init>", "(Lorg/navitproject/navit/Navit;)V");
if (cid == NULL) {
- dbg(lvl_error,"no method found\n");
+ dbg(lvl_error,"no method found");
return 0; /* exception thrown */
}
if (!android_find_method(ret->NavitSpeechClass, "say", "(Ljava/lang/String;)V", &ret->NavitSpeech_say))
return 0;
- dbg(lvl_debug,"at 4 android_activity=%p\n",android_activity);
+ dbg(lvl_debug,"at 4 android_activity=%p",android_activity);
ret->NavitSpeech=(*jnienv)->NewObject(jnienv, ret->NavitSpeechClass, cid, android_activity);
- dbg(lvl_debug,"result=%p\n",ret->NavitSpeech);
+ dbg(lvl_debug,"result=%p",ret->NavitSpeech);
if (!ret->NavitSpeech)
return 0;
if (ret->NavitSpeech)
@@ -96,7 +96,7 @@ speech_android_new(struct speech_methods *meth, struct attr **attrs, struct attr
if (android_version < 4)
this->flags=3;
if (!speech_android_init(this)) {
- dbg(lvl_error,"Failed to init speech %p\n",this->NavitSpeechClass);
+ dbg(lvl_error,"Failed to init speech %p",this->NavitSpeechClass);
g_free(this);
this=NULL;
}
diff --git a/navit/speech/cmdline/speech_cmdline.c b/navit/speech/cmdline/speech_cmdline.c
index 490811ce5..15ba15c1a 100644
--- a/navit/speech/cmdline/speech_cmdline.c
+++ b/navit/speech/cmdline/speech_cmdline.c
@@ -63,7 +63,7 @@ speech_cmdline_search(GList *samples, int suffix_len, const char *text, int deco
{
GList *loop_samples=samples,*result=NULL,*recursion_result;
int shortest_result_length=INT_MAX;
- dbg(lvl_debug,"searching samples for text: '%s'\n",text);
+ dbg(lvl_debug,"searching samples for text: '%s'",text);
while (loop_samples) {
char *sample_name=loop_samples->data;
int sample_name_len;
@@ -77,7 +77,7 @@ speech_cmdline_search(GList *samples, int suffix_len, const char *text, int deco
const char *remaining_text=text+sample_name_len;
while (*remaining_text == ' ' || *remaining_text == ',')
remaining_text++;
- dbg(lvl_debug,"sample '%s' matched; remaining text: '%s'\n",sample_name,remaining_text);
+ dbg(lvl_debug,"sample '%s' matched; remaining text: '%s'",sample_name,remaining_text);
if (*remaining_text) {
recursion_result=speech_cmdline_search(samples, suffix_len, remaining_text, decode);
if (recursion_result && g_list_length(recursion_result) < shortest_result_length) {
@@ -102,15 +102,6 @@ speech_cmdline_search(GList *samples, int suffix_len, const char *text, int deco
}
return result;
}
-#if 0
-
- r=search(l, strlen(path)+1, suffix_len, argv[1]);
- while (r) {
- printf("%s/%s\n",path,r->data);
- r=g_list_next(r);
- }
- return 0;
-#endif
struct speech_priv {
char *cmdline;
@@ -141,15 +132,15 @@ speechd_say(struct speech_priv *this, const char *text)
argl=speech_cmdline_search(this->samples, strlen(this->sample_suffix), text, !!(this->flags & 1));
samplesmode=1;
listlen=g_list_length(argl);
- dbg(lvl_debug,"For text: '%s', found %d samples.\n",text,listlen);
+ dbg(lvl_debug,"For text: '%s', found %d samples.",text,listlen);
if (!listlen){
- dbg(lvl_error,"No matching samples found. Cannot speak text: '%s'\n",text);
+ dbg(lvl_error,"No matching samples found. Cannot speak text: '%s'",text);
}
} else {
listlen=1;
}
if(listlen>0) {
- dbg(lvl_debug,"Speaking text '%s'\n",text);
+ dbg(lvl_debug,"Speaking text '%s'",text);
int argc;
char**argv;
int j;
@@ -168,7 +159,7 @@ speechd_say(struct speech_priv *this, const char *text)
while(l) {
char *new_arg;
new_arg=g_strdup_printf("%s/%s",this->sample_dir,(char *)l->data);
- dbg(lvl_debug,"new_arg %s\n",new_arg);
+ dbg(lvl_debug,"new_arg %s",new_arg);
argv[j++]=g_strdup_printf(cmdv[i],new_arg);
g_free(new_arg);
l=g_list_next(l);
@@ -246,7 +237,7 @@ speechd_new(struct speech_methods *meth, struct attr **attrs, struct attr *paren
int len=strlen(name);
if (len > suffix_len) {
if (!strcmp(name+len-suffix_len, this->sample_suffix)) {
- dbg(lvl_debug,"found %s\n",name);
+ dbg(lvl_debug,"found %s",name);
this->samples=g_list_prepend(this->samples, g_strdup(name));
}
}
diff --git a/navit/speech/espeak/speak.c b/navit/speech/espeak/speak.c
index 329a05d01..301b4b37e 100644
--- a/navit/speech/espeak/speak.c
+++ b/navit/speech/espeak/speak.c
@@ -166,11 +166,11 @@ static BOOL initialise(void)
{
if(result == -1)
{
- dbg(lvl_error, "Failed to load espeak-data\n");
+ dbg(lvl_error, "Failed to load espeak-data");
return FALSE;
}
else
- dbg(lvl_error, "Wrong version of espeak-data 0x%x (expects 0x%x) at %s\n",result,version_phdata,path_home);
+ dbg(lvl_error, "Wrong version of espeak-data 0x%x (expects 0x%x) at %s",result,version_phdata,path_home);
}
LoadConfig();
SetVoiceStack(NULL);
@@ -214,7 +214,7 @@ static void start_speaking(struct speech_priv* sp_priv)
static LRESULT CALLBACK speech_message_handler( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
{
- dbg(lvl_debug, "message_handler called\n");
+ dbg(lvl_debug, "message_handler called");
switch (uMsg)
{
@@ -234,7 +234,7 @@ static LRESULT CALLBACK speech_message_handler( HWND hwnd, UINT uMsg, WPARAM wPa
{
WAVEHDR *WaveHeader = (WAVEHDR *)lParam;
struct speech_priv* sp_priv;
- dbg(lvl_info, "Wave buffer done\n");
+ dbg(lvl_info, "Wave buffer done");
sp_priv = (struct speech_priv*)WaveHeader->dwUser;
sp_priv->free_buffers = g_list_append(sp_priv->free_buffers, WaveHeader);
@@ -282,7 +282,7 @@ static void speech_message_dispatcher( struct speech_priv * sp_priv)
{
if (bRet == -1)
{
- dbg(lvl_error, "Error getting message from queue\n");
+ dbg(lvl_error, "Error getting message from queue");
break;
}
else
@@ -336,7 +336,7 @@ static DWORD startThread( LPVOID sp_priv)
if (!RegisterClass(&wc))
{
- dbg(lvl_error, "Window registration for message queue failed\n");
+ dbg(lvl_error, "Window registration for message queue failed");
return 1;
}
@@ -361,7 +361,7 @@ static DWORD startThread( LPVOID sp_priv)
if (hwnd == NULL)
{
- dbg(lvl_error, "Window creation failed: %d\n", GetLastError());
+ dbg(lvl_error, "Window creation failed: %d", GetLastError());
return 1;
}
@@ -371,7 +371,7 @@ static DWORD startThread( LPVOID sp_priv)
if(!waveout_open(this))
{
- dbg(lvl_error, "Can't open wave output\n");
+ dbg(lvl_error, "Can't open wave output");
return 1;
}
@@ -387,11 +387,11 @@ static int
espeak_say(struct speech_priv *this, const char *text)
{
char *phrase = g_strdup(text);
- dbg(lvl_debug, "Speak: '%s'\n", text);
+ dbg(lvl_debug, "Speak: '%s'", text);
if (!PostMessage(this->h_queue, msg_say, (WPARAM)this, (LPARAM)phrase))
{
- dbg(lvl_error, "PostThreadMessage 'say' failed\n");
+ dbg(lvl_error, "PostThreadMessage 'say' failed");
}
return 0;
@@ -440,7 +440,7 @@ espeak_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent
strcpy(path_home,path->u.str);
else
sprintf(path_home,"%s/espeak-data",getenv("NAVIT_SHAREDIR"));
- dbg(lvl_debug,"path_home set to %s\n",path_home);
+ dbg(lvl_debug,"path_home set to %s",path_home);
if ( !initialise() )
{
@@ -467,12 +467,12 @@ espeak_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent
}
file1=g_strdup_printf("%s/voices/%s",path_home,lang_full);
file2=g_strdup_printf("%s/voices/%s/%s",path_home,lang,lang_full);
- dbg(lvl_debug,"Testing %s and %s\n",file1,file2);
+ dbg(lvl_debug,"Testing %s and %s",file1,file2);
if (file_exists(file1) || file_exists(file2))
lang_str=g_strdup(lang_full);
else
lang_str=g_strdup(lang);
- dbg(lvl_debug,"Language full %s lang %s result %s\n",lang_full,lang,lang_str);
+ dbg(lvl_debug,"Language full %s lang %s result %s",lang_full,lang,lang_str);
g_free(lang_full);
g_free(lang);
g_free(file1);
@@ -481,12 +481,12 @@ espeak_new(struct speech_methods *meth, struct attr **attrs, struct attr *parent
}
if(lang_str && SetVoiceByName(lang_str) != EE_OK)
{
- dbg(lvl_error, "Error setting language to: '%s',falling back to default\n", lang_str);
+ dbg(lvl_error, "Error setting language to: '%s',falling back to default", lang_str);
g_free(lang_str);
lang_str=NULL;
}
if(!lang_str && SetVoiceByName("default") != EE_OK) {
- dbg(lvl_error, "Error setting language to default\n");
+ dbg(lvl_error, "Error setting language to default");
}
diff --git a/navit/speech/iphone/speech_iphone.m b/navit/speech/iphone/speech_iphone.m
index c77b6fbc2..854ae097b 100644
--- a/navit/speech/iphone/speech_iphone.m
+++ b/navit/speech/iphone/speech_iphone.m
@@ -33,11 +33,11 @@ struct speech_priv {
static int
speech_iphone_say(struct speech_priv *this, const char *text)
{
- dbg(0,"enter %s\n",text);
+ dbg(0,"enter %s",text);
NSString *s=[[NSString alloc]initWithUTF8String: text];
[this->speech startSpeakingString:s toURL:nil];
[s release];
- dbg(0,"ok\n");
+ dbg(0,"ok");
return 1;
}
@@ -60,7 +60,7 @@ speech_iphone_new(struct speech_methods *meth, struct attr **attrs, struct attr
*meth=speech_iphone_meth;
this=g_new0(struct speech_priv,1);
this->speech=[[NSClassFromString(@"VSSpeechSynthesizer") alloc] init];
- dbg(0,"this->speech=%p\n",this->speech);
+ dbg(0,"this->speech=%p",this->speech);
[this->speech setRate:(float)1.0];
return this;
}
@@ -69,6 +69,6 @@ speech_iphone_new(struct speech_methods *meth, struct attr **attrs, struct attr
void
plugin_init(void)
{
- dbg(0,"enter\n");
+ dbg(0,"enter");
plugin_register_category_speech("iphone", speech_iphone_new);
}
diff --git a/navit/speech/qt5_espeak/Qt5EspeakAudioOut.cpp b/navit/speech/qt5_espeak/Qt5EspeakAudioOut.cpp
index da2c6b3e1..1360bdcaf 100644
--- a/navit/speech/qt5_espeak/Qt5EspeakAudioOut.cpp
+++ b/navit/speech/qt5_espeak/Qt5EspeakAudioOut.cpp
@@ -41,7 +41,7 @@ Qt5EspeakAudioOut::Qt5EspeakAudioOut(int samplerate, const char* category)
QAudioDeviceInfo info(QAudioDeviceInfo::defaultOutputDevice());
if (!info.isFormatSupported(format)) {
dbg(lvl_error,
- "Raw audio format not supported by backend, cannot play audio.\n");
+ "Raw audio format not supported by backend, cannot play audio.");
return;
}
@@ -54,7 +54,7 @@ Qt5EspeakAudioOut::Qt5EspeakAudioOut(int samplerate, const char* category)
* systems with
* really low memory.*/
audio->setBufferSize((samplerate * 1 /*ch*/ * 2 /*samplezize*/) * 5 /*seconds*/);
- dbg(lvl_debug, "Buffer size is: %d\n", audio->bufferSize());
+ dbg(lvl_debug, "Buffer size is: %d", audio->bufferSize());
if (category != NULL)
audio->setCategory(QString(category));
@@ -76,7 +76,7 @@ Qt5EspeakAudioOut::~Qt5EspeakAudioOut()
void Qt5EspeakAudioOut::handleStateChanged(QAudio::State newState)
{
- dbg(lvl_debug, "Enter %d\n", newState);
+ dbg(lvl_debug, "Enter %d", newState);
switch (newState) {
case QAudio::ActiveState:
break;
@@ -88,21 +88,21 @@ void Qt5EspeakAudioOut::handleStateChanged(QAudio::State newState)
/*remove all data that was already read*/
data->remove(0, buffer->pos());
buffer->seek(0);
- dbg(lvl_debug, "Size %d\n", data->size());
+ dbg(lvl_debug, "Size %d", data->size());
break;
}
}
void Qt5EspeakAudioOut::resume(int state)
{
- dbg(lvl_debug, "Enter %d\n", state);
+ dbg(lvl_debug, "Enter %d", state);
if (audio->state() != QAudio::ActiveState)
audio->start(buffer);
}
void Qt5EspeakAudioOut::addSamples(short* wav, int numsamples)
{
- dbg(lvl_debug, "Enter (%d samples)\n", numsamples);
+ dbg(lvl_debug, "Enter (%d samples)", numsamples);
/*remove all data that was already read (if any)*/
data->remove(0, buffer->pos());
@@ -110,7 +110,7 @@ void Qt5EspeakAudioOut::addSamples(short* wav, int numsamples)
if (numsamples > 0) {
data->append((const char*)wav, numsamples * sizeof(short));
- dbg(lvl_debug, "%ld samples in buffer\n",
+ dbg(lvl_debug, "%ld samples in buffer",
(long int)(buffer->size() / sizeof(short)));
emit call_resume(numsamples);
}
diff --git a/navit/speech/qt5_espeak/qt5_espeak.cpp b/navit/speech/qt5_espeak/qt5_espeak.cpp
index 8d108eae6..266fde624 100755
--- a/navit/speech/qt5_espeak/qt5_espeak.cpp
+++ b/navit/speech/qt5_espeak/qt5_espeak.cpp
@@ -59,7 +59,7 @@ struct speech_priv {
int qt5_espeak_SynthCallback(short* wav, int numsamples, espeak_EVENT* events)
{
struct speech_priv* pr = NULL;
- dbg(lvl_debug, "Callback %d samples\n", numsamples);
+ dbg(lvl_debug, "Callback %d samples", numsamples);
if (events != NULL)
pr = (struct speech_priv*)events->user_data;
if ((pr != NULL) && (pr->audio != NULL)) {
@@ -91,7 +91,7 @@ qt5_espeak_init_espeak(struct speech_priv* sr, struct attr** attrs)
sr->path_home = NULL;
#endif
}
- dbg(lvl_debug, "path_home set to %s\n", sr->path_home);
+ dbg(lvl_debug, "path_home set to %s", sr->path_home);
#if INTERNAL_ESPEAK
/*internal espeak is configured to support only synchronous modes */
sr->sample_rate = espeak_Initialize(AUDIO_OUTPUT_SYNCHRONOUS, BUFFERLENGTH, sr->path_home, 0);
@@ -101,10 +101,10 @@ qt5_espeak_init_espeak(struct speech_priv* sr, struct attr** attrs)
sr->sample_rate = espeak_Initialize(AUDIO_OUTPUT_SYNCHRONOUS, BUFFERLENGTH, sr->path_home, 0);
#endif
if (sr->sample_rate == EE_INTERNAL_ERROR) {
- dbg(lvl_error, "Init failed %d\n", sr->sample_rate);
+ dbg(lvl_error, "Init failed %d", sr->sample_rate);
return 1;
}
- dbg(lvl_error, "Sample rate is %d\n", sr->sample_rate);
+ dbg(lvl_error, "Sample rate is %d", sr->sample_rate);
espeak_SetSynthCallback(qt5_espeak_SynthCallback);
return TRUE;
@@ -132,13 +132,13 @@ qt5_espeak_init_language(struct speech_priv* pr, struct attr** attrs)
strtolower(lang_str, lang_env);
/* extract language code from LANG environment */
- dbg(lvl_debug, "%s\n", lang_str);
+ dbg(lvl_debug, "%s", lang_str);
country = strchr(lang_str, '_');
- dbg(lvl_debug, "%s\n", country);
+ dbg(lvl_debug, "%s", country);
if (country) {
lang_str[country - lang_str] = '\0';
}
- dbg(lvl_debug, "espeak lang: %s\n", lang_str);
+ dbg(lvl_debug, "espeak lang: %s", lang_str);
}
}
/*TODO (golden water tap): expose all those values as attrs */
@@ -152,7 +152,7 @@ qt5_espeak_init_language(struct speech_priv* pr, struct attr** attrs)
if (lang_str != NULL)
g_free(lang_str);
if (error != EE_OK) {
- dbg(lvl_error, "Unable to set Language\n");
+ dbg(lvl_error, "Unable to set Language");
return false;
}
return true;
@@ -179,11 +179,11 @@ static int
qt5_espeak_say(struct speech_priv* sr, const char* text)
{
espeak_ERROR error;
- dbg(lvl_debug, "Say \"%s\"\n", text);
+ dbg(lvl_debug, "Say \"%s\"", text);
error = espeak_Synth(text, strlen(text), 0, POS_CHARACTER, 0,
espeakCHARS_UTF8, NULL, sr);
if (error != EE_OK)
- dbg(lvl_error, "Unable to speak! error == %d\n", error);
+ dbg(lvl_error, "Unable to speak! error == %d", error);
return 0;
}
@@ -192,7 +192,7 @@ qt5_espeak_say(struct speech_priv* sr, const char* text)
static void
qt5_espeak_destroy(struct speech_priv* sr)
{
- dbg(lvl_debug, "Enter\n");
+ dbg(lvl_debug, "Enter");
if (sr->path_home != NULL)
g_free(sr->path_home);
@@ -215,7 +215,7 @@ qt5_espeak_new(struct speech_methods* meth, struct attr** attrs,
struct attr* parent)
{
struct speech_priv* sr = NULL;
- dbg(lvl_debug, "Enter\n");
+ dbg(lvl_debug, "Enter");
/* allocate handle */
sr = g_new0(struct speech_priv, 1);
@@ -229,17 +229,17 @@ qt5_espeak_new(struct speech_methods* meth, struct attr** attrs,
/* init espeak library */
if (!(sr->espeak_ok = qt5_espeak_init_espeak(sr, attrs))) {
- dbg(lvl_error, "Unable to initialize espeak library\n");
+ dbg(lvl_error, "Unable to initialize espeak library");
}
/* init espeak voice and language */
if (!(sr->espeak_ok = qt5_espeak_init_language(sr, attrs))) {
- dbg(lvl_error, "Unable to initialize espeak language\n");
+ dbg(lvl_error, "Unable to initialize espeak language");
}
/* init qt5 audio using default category*/
if (!(sr->audio_ok = qt5_espeak_init_audio(sr, NULL))) {
- dbg(lvl_error, "Unable to initialize audio\n");
+ dbg(lvl_error, "Unable to initialize audio");
}
return sr;
}
@@ -247,6 +247,6 @@ qt5_espeak_new(struct speech_methods* meth, struct attr** attrs,
/* initialize this as plugin */
void plugin_init(void)
{
- dbg(lvl_debug, "Enter\n");
+ dbg(lvl_debug, "Enter");
plugin_register_category_speech("qt5_espeak", qt5_espeak_new);
}
diff --git a/navit/start_apple.m b/navit/start_apple.m
index 356d34408..ca41b5b68 100644
--- a/navit/start_apple.m
+++ b/navit/start_apple.m
@@ -30,7 +30,7 @@ main(int argc, char **argv)
NSString *appFolderPath = [[NSBundle mainBundle] resourcePath];
NSString *locale = [[NSLocale currentLocale] localeIdentifier];
char *lang=g_strdup_printf("%s.UTF-8",[locale UTF8String]);
- dbg(0,"lang %s\n",lang);
+ dbg(0,"lang %s",lang);
setenv("LANG",lang,0);
setlocale(LC_ALL, NULL);
@@ -40,7 +40,7 @@ main(int argc, char **argv)
argv[0]=g_strdup_printf("%s/bin/navit",s);
setenv("NAVIT_USER_DATADIR",user,0);
- dbg(0,"calling main_real\n");
+ dbg(0,"calling main_real");
ret=main_real(argc, argv);
g_free(argv[0]);
g_free(user);
diff --git a/navit/start_real.c b/navit/start_real.c
index 16e0d5edb..7be0e371c 100644
--- a/navit/start_real.c
+++ b/navit/start_real.c
@@ -179,12 +179,12 @@ int main_real(int argc, char * const* argv)
for (;;) {
if (li == NULL) {
// We have not found an existing config file from all possibilities
- dbg(lvl_error, "%s", _("No config file navit.xml, navit.xml.local found\n"));
+ dbg(lvl_error, "%s", _("No config file navit.xml, navit.xml.local found"));
return 4;
}
// Try the next config file possibility from the list
config_file = li->data;
- dbg(lvl_debug,"trying %s\n",config_file);
+ dbg(lvl_debug,"trying %s",config_file);
if (file_exists(config_file)) {
break;
}
@@ -192,14 +192,14 @@ int main_real(int argc, char * const* argv)
li = g_list_next(li);
}
- dbg(lvl_debug,"Loading %s\n",config_file);
+ dbg(lvl_debug,"Loading %s",config_file);
if (!config_load(config_file, &error)) {
- dbg(lvl_error, _("Error parsing config file '%s': %s\n"), config_file, error ? error->message : "");
+ dbg(lvl_error, _("Error parsing config file '%s': %s"), config_file, error ? error->message : "");
} else {
- dbg(lvl_info, _("Using config file '%s'\n"), config_file);
+ dbg(lvl_info, _("Using config file '%s'"), config_file);
}
if (! config) {
- dbg(lvl_error, _("Error: No configuration found in config file '%s'\n"), config_file);
+ dbg(lvl_error, _("Error: No configuration found in config file '%s'"), config_file);
}
while (li) {
g_free(li->data);
@@ -207,7 +207,7 @@ int main_real(int argc, char * const* argv)
}
g_list_free(list);
if (! (config && config_get_attr(config, attr_navit, &navit, NULL))) {
- dbg(lvl_error, "%s", _("Internal initialization failed, exiting. Check previous error messages.\n"));
+ dbg(lvl_error, "%s", _("Internal initialization failed, exiting. Check previous error messages."));
exit(5);
}
conf.type=attr_config;
@@ -222,7 +222,7 @@ int main_real(int argc, char * const* argv)
}
fclose_ret = fclose(f);
if (fclose_ret != 0) {
- dbg(lvl_error, "Could not close the specified startup file: %s\n", startup_file);
+ dbg(lvl_error, "Could not close the specified startup file: %s", startup_file);
}
} else {
dbg(lvl_error, "Could not open the specified startup file: %s", startup_file);
diff --git a/navit/support/espeak/espeak-data/voices/!v/m7 b/navit/support/espeak/espeak-data/voices/!v/m7
index 9a8370622..05f5b3e86 100755
--- a/navit/support/espeak/espeak-data/voices/!v/m7
+++ b/navit/support/espeak/espeak-data/voices/!v/m7
@@ -1,18 +1,18 @@
-language variant
-gender male 35
-name male5
-
-formant 0 120 150 220
-
-formant 1 100 100 100
-formant 2 100 100 100
-formant 3 100 100 100
-
-formant 4 100 80 100
-formant 5 100 100 100
-
-formant 6 80 200 80
-formant 7 80 200 100
-
-pitch 80 118
-tone 600 150 255 50 100 100
+language variant
+gender male 35
+name male5
+
+formant 0 120 150 220
+
+formant 1 100 100 100
+formant 2 100 100 100
+formant 3 100 100 100
+
+formant 4 100 80 100
+formant 5 100 100 100
+
+formant 6 80 200 80
+formant 7 80 200 100
+
+pitch 80 118
+tone 600 150 255 50 100 100
diff --git a/navit/support/libc/stat.c b/navit/support/libc/stat.c
index 586dcf714..e66a90737 100644
--- a/navit/support/libc/stat.c
+++ b/navit/support/libc/stat.c
@@ -120,13 +120,13 @@ _stat (const char *path, struct _stat *st)
size_t len;
int exec;
- dbg(lvl_debug,"path=%s\n",path);
+ dbg(lvl_debug,"path=%s",path);
mbstowcs (pathw, path, MAX_PATH);
- dbg(lvl_debug,"wide path=%S\n",pathw);
+ dbg(lvl_debug,"wide path=%S",pathw);
if((h = FindFirstFileW (pathw, &fd)) == INVALID_HANDLE_VALUE)
{
DWORD dwError = GetLastError ();
- dbg(lvl_error,"no file\n");
+ dbg(lvl_error,"no file");
if(dwError == ERROR_NO_MORE_FILES)
/* Convert error to something more sensible. */
SetLastError (ERROR_FILE_NOT_FOUND);
@@ -139,7 +139,7 @@ _stat (const char *path, struct _stat *st)
exec = (len >= 4
&& strcasecmp (path + len - 4, ".exe") == 0);
ret = __stat_by_file_info (&sfi, st, exec);
- dbg(lvl_debug,"ret=%d\n",ret);
+ dbg(lvl_debug,"ret=%d",ret);
FindClose (h);
return ret;
}
diff --git a/navit/support/win32/X11/XF86keysym.h b/navit/support/win32/X11/XF86keysym.h
index ff4980457..ee783c2fc 100644
--- a/navit/support/win32/X11/XF86keysym.h
+++ b/navit/support/win32/X11/XF86keysym.h
@@ -1,189 +1,189 @@
-/* $XFree86: xc/include/XF86keysym.h,v 1.16 2003/02/11 02:51:10 dawes Exp $ */
-
-/*
- * XFree86 vendor specific keysyms.
- *
- * The XFree86 keysym range is 0x10080001 - 0x1008FFFF.
- *
- * When adding new entries, the xc/lib/XKeysymDB file should also be
- * updated to make the new entries visible to Xlib.
- */
-
-/*
- * ModeLock
- *
- * This one is old, and not really used any more since XKB offers this
- * functionality.
- */
-
-#define XF86XK_ModeLock 0x1008FF01 /* Mode Switch Lock */
-
-/*
- * Note, 0x1008FF02 - 0x1008FF0F are free and should be used for misc new
- * keysyms that don't fit into any of the groups below.
- *
- * 0x1008FF64, 0x1008FF6F, 0x1008FF71, 0x1008FF83 are no longer used,
- * and should be used first for new keysyms.
- *
- * Check in keysymdef.h for generic symbols before adding new XFree86-specific
- * symbols here.
- */
-
-
-/*
- * Keys found on some "Internet" keyboards.
- */
-#define XF86XK_Standby 0x1008FF10
-#define XF86XK_AudioLowerVolume 0x1008FF11
-#define XF86XK_AudioMute 0x1008FF12
-#define XF86XK_AudioRaiseVolume 0x1008FF13
-#define XF86XK_AudioPlay 0x1008FF14
-#define XF86XK_AudioStop 0x1008FF15
-#define XF86XK_AudioPrev 0x1008FF16
-#define XF86XK_AudioNext 0x1008FF17
-#define XF86XK_HomePage 0x1008FF18
-#define XF86XK_Mail 0x1008FF19
-#define XF86XK_Start 0x1008FF1A
-#define XF86XK_Search 0x1008FF1B
-#define XF86XK_AudioRecord 0x1008FF1C
-
-/* These are sometimes found on PDA's (e.g. Palm, PocketPC or elsewhere) */
-#define XF86XK_Calculator 0x1008FF1D
-#define XF86XK_Memo 0x1008FF1E
-#define XF86XK_ToDoList 0x1008FF1F
-#define XF86XK_Calendar 0x1008FF20
-#define XF86XK_PowerDown 0x1008FF21
-#define XF86XK_ContrastAdjust 0x1008FF22
-#define XF86XK_RockerUp 0x1008FF23
-#define XF86XK_RockerDown 0x1008FF24
-#define XF86XK_RockerEnter 0x1008FF25
-
-/* Some more "Internet" keyboard symbols */
-#define XF86XK_Back 0x1008FF26
-#define XF86XK_Forward 0x1008FF27
-#define XF86XK_Stop 0x1008FF28
-#define XF86XK_Refresh 0x1008FF29
-#define XF86XK_PowerOff 0x1008FF2A
-#define XF86XK_WakeUp 0x1008FF2B
-#define XF86XK_Eject 0x1008FF2C
-#define XF86XK_ScreenSaver 0x1008FF2D
-#define XF86XK_WWW 0x1008FF2E
-#define XF86XK_Sleep 0x1008FF2F
-#define XF86XK_Favorites 0x1008FF30
-#define XF86XK_AudioPause 0x1008FF31
-#define XF86XK_AudioMedia 0x1008FF32
-#define XF86XK_MyComputer 0x1008FF33
-#define XF86XK_VendorHome 0x1008FF34
-#define XF86XK_LightBulb 0x1008FF35
-#define XF86XK_Shop 0x1008FF36
-#define XF86XK_History 0x1008FF37
-#define XF86XK_OpenURL 0x1008FF38
-#define XF86XK_AddFavorite 0x1008FF39
-#define XF86XK_HotLinks 0x1008FF3A
-#define XF86XK_BrightnessAdjust 0x1008FF3B
-#define XF86XK_Finance 0x1008FF3C
-#define XF86XK_Community 0x1008FF3D
-#define XF86XK_AudioRewind 0x1008FF3E
-#define XF86XK_XF86BackForward 0x1008FF3F
-#define XF86XK_Launch0 0x1008FF40
-#define XF86XK_Launch1 0x1008FF41
-#define XF86XK_Launch2 0x1008FF42
-#define XF86XK_Launch3 0x1008FF43
-#define XF86XK_Launch4 0x1008FF44
-#define XF86XK_Launch5 0x1008FF45
-#define XF86XK_Launch6 0x1008FF46
-#define XF86XK_Launch7 0x1008FF47
-#define XF86XK_Launch8 0x1008FF48
-#define XF86XK_Launch9 0x1008FF49
-#define XF86XK_LaunchA 0x1008FF4A
-#define XF86XK_LaunchB 0x1008FF4B
-#define XF86XK_LaunchC 0x1008FF4C
-#define XF86XK_LaunchD 0x1008FF4D
-#define XF86XK_LaunchE 0x1008FF4E
-#define XF86XK_LaunchF 0x1008FF4F
-
-#define XF86XK_ApplicationLeft 0x1008FF50
-#define XF86XK_ApplicationRight 0x1008FF51
-#define XF86XK_Book 0x1008FF52
-#define XF86XK_CD 0x1008FF53
-#define XF86XK_Calculater 0x1008FF54
-#define XF86XK_Clear 0x1008FF55
-#define XF86XK_Close 0x1008FF56
-#define XF86XK_Copy 0x1008FF57
-#define XF86XK_Cut 0x1008FF58
-#define XF86XK_Display 0x1008FF59
-#define XF86XK_DOS 0x1008FF5A
-#define XF86XK_Documents 0x1008FF5B
-#define XF86XK_Excel 0x1008FF5C
-#define XF86XK_Explorer 0x1008FF5D
-#define XF86XK_Game 0x1008FF5E
-#define XF86XK_Go 0x1008FF5F
-#define XF86XK_iTouch 0x1008FF60
-#define XF86XK_LogOff 0x1008FF61
-#define XF86XK_Market 0x1008FF62
-#define XF86XK_Meeting 0x1008FF63
-#define XF86XK_MenuKB 0x1008FF65
-#define XF86XK_MenuPB 0x1008FF66
-#define XF86XK_MySites 0x1008FF67
-#define XF86XK_New 0x1008FF68
-#define XF86XK_News 0x1008FF69
-#define XF86XK_OfficeHome 0x1008FF6A
-#define XF86XK_Open 0x1008FF6B
-#define XF86XK_Option 0x1008FF6C
-#define XF86XK_Paste 0x1008FF6D
-#define XF86XK_Phone 0x1008FF6E
-#define XF86XK_Q 0x1008FF70
-#define XF86XK_Reply 0x1008FF72
-#define XF86XK_Reload 0x1008FF73
-#define XF86XK_RotateWindows 0x1008FF74
-#define XF86XK_RotationPB 0x1008FF75
-#define XF86XK_RotationKB 0x1008FF76
-#define XF86XK_Save 0x1008FF77
-#define XF86XK_ScrollUp 0x1008FF78
-#define XF86XK_ScrollDown 0x1008FF79
-#define XF86XK_ScrollClick 0x1008FF7A
-#define XF86XK_Send 0x1008FF7B
-#define XF86XK_Spell 0x1008FF7C
-#define XF86XK_SplitScreen 0x1008FF7D
-#define XF86XK_Support 0x1008FF7E
-#define XF86XK_TaskPane 0x1008FF7F
-#define XF86XK_Terminal 0x1008FF80
-#define XF86XK_Tools 0x1008FF81
-#define XF86XK_Travel 0x1008FF82
-#define XF86XK_UserPB 0x1008FF84
-#define XF86XK_User1KB 0x1008FF85
-#define XF86XK_User2KB 0x1008FF86
-#define XF86XK_Video 0x1008FF87
-#define XF86XK_WheelButton 0x1008FF88
-#define XF86XK_Word 0x1008FF89
-#define XF86XK_Xfer 0x1008FF8A
-#define XF86XK_ZoomIn 0x1008FF8B
-#define XF86XK_ZoomOut 0x1008FF8C
-
-#define XF86XK_Away 0x1008FF8D
-#define XF86XK_Messenger 0x1008FF8E
-#define XF86XK_WebCam 0x1008FF8F
-#define XF86XK_MailForward 0x1008FF90
-#define XF86XK_Pictures 0x1008FF91
-#define XF86XK_Music 0x1008FF92
-
-/* Keys for special action keys (hot keys) */
-#define XF86XK_Switch_VT_1 0x1008FE01
-#define XF86XK_Switch_VT_2 0x1008FE02
-#define XF86XK_Switch_VT_3 0x1008FE03
-#define XF86XK_Switch_VT_4 0x1008FE04
-#define XF86XK_Switch_VT_5 0x1008FE05
-#define XF86XK_Switch_VT_6 0x1008FE06
-#define XF86XK_Switch_VT_7 0x1008FE07
-#define XF86XK_Switch_VT_8 0x1008FE08
-#define XF86XK_Switch_VT_9 0x1008FE09
-#define XF86XK_Switch_VT_10 0x1008FE0A
-#define XF86XK_Switch_VT_11 0x1008FE0B
-#define XF86XK_Switch_VT_12 0x1008FE0C
-
-#define XF86XK_Ungrab 0x1008FE20
-#define XF86XK_ClearGrab 0x1008FE21
-#define XF86XK_Next_VMode 0x1008FE22
-#define XF86XK_Prev_VMode 0x1008FE23
-
-
+/* $XFree86: xc/include/XF86keysym.h,v 1.16 2003/02/11 02:51:10 dawes Exp $ */
+
+/*
+ * XFree86 vendor specific keysyms.
+ *
+ * The XFree86 keysym range is 0x10080001 - 0x1008FFFF.
+ *
+ * When adding new entries, the xc/lib/XKeysymDB file should also be
+ * updated to make the new entries visible to Xlib.
+ */
+
+/*
+ * ModeLock
+ *
+ * This one is old, and not really used any more since XKB offers this
+ * functionality.
+ */
+
+#define XF86XK_ModeLock 0x1008FF01 /* Mode Switch Lock */
+
+/*
+ * Note, 0x1008FF02 - 0x1008FF0F are free and should be used for misc new
+ * keysyms that don't fit into any of the groups below.
+ *
+ * 0x1008FF64, 0x1008FF6F, 0x1008FF71, 0x1008FF83 are no longer used,
+ * and should be used first for new keysyms.
+ *
+ * Check in keysymdef.h for generic symbols before adding new XFree86-specific
+ * symbols here.
+ */
+
+
+/*
+ * Keys found on some "Internet" keyboards.
+ */
+#define XF86XK_Standby 0x1008FF10
+#define XF86XK_AudioLowerVolume 0x1008FF11
+#define XF86XK_AudioMute 0x1008FF12
+#define XF86XK_AudioRaiseVolume 0x1008FF13
+#define XF86XK_AudioPlay 0x1008FF14
+#define XF86XK_AudioStop 0x1008FF15
+#define XF86XK_AudioPrev 0x1008FF16
+#define XF86XK_AudioNext 0x1008FF17
+#define XF86XK_HomePage 0x1008FF18
+#define XF86XK_Mail 0x1008FF19
+#define XF86XK_Start 0x1008FF1A
+#define XF86XK_Search 0x1008FF1B
+#define XF86XK_AudioRecord 0x1008FF1C
+
+/* These are sometimes found on PDA's (e.g. Palm, PocketPC or elsewhere) */
+#define XF86XK_Calculator 0x1008FF1D
+#define XF86XK_Memo 0x1008FF1E
+#define XF86XK_ToDoList 0x1008FF1F
+#define XF86XK_Calendar 0x1008FF20
+#define XF86XK_PowerDown 0x1008FF21
+#define XF86XK_ContrastAdjust 0x1008FF22
+#define XF86XK_RockerUp 0x1008FF23
+#define XF86XK_RockerDown 0x1008FF24
+#define XF86XK_RockerEnter 0x1008FF25
+
+/* Some more "Internet" keyboard symbols */
+#define XF86XK_Back 0x1008FF26
+#define XF86XK_Forward 0x1008FF27
+#define XF86XK_Stop 0x1008FF28
+#define XF86XK_Refresh 0x1008FF29
+#define XF86XK_PowerOff 0x1008FF2A
+#define XF86XK_WakeUp 0x1008FF2B
+#define XF86XK_Eject 0x1008FF2C
+#define XF86XK_ScreenSaver 0x1008FF2D
+#define XF86XK_WWW 0x1008FF2E
+#define XF86XK_Sleep 0x1008FF2F
+#define XF86XK_Favorites 0x1008FF30
+#define XF86XK_AudioPause 0x1008FF31
+#define XF86XK_AudioMedia 0x1008FF32
+#define XF86XK_MyComputer 0x1008FF33
+#define XF86XK_VendorHome 0x1008FF34
+#define XF86XK_LightBulb 0x1008FF35
+#define XF86XK_Shop 0x1008FF36
+#define XF86XK_History 0x1008FF37
+#define XF86XK_OpenURL 0x1008FF38
+#define XF86XK_AddFavorite 0x1008FF39
+#define XF86XK_HotLinks 0x1008FF3A
+#define XF86XK_BrightnessAdjust 0x1008FF3B
+#define XF86XK_Finance 0x1008FF3C
+#define XF86XK_Community 0x1008FF3D
+#define XF86XK_AudioRewind 0x1008FF3E
+#define XF86XK_XF86BackForward 0x1008FF3F
+#define XF86XK_Launch0 0x1008FF40
+#define XF86XK_Launch1 0x1008FF41
+#define XF86XK_Launch2 0x1008FF42
+#define XF86XK_Launch3 0x1008FF43
+#define XF86XK_Launch4 0x1008FF44
+#define XF86XK_Launch5 0x1008FF45
+#define XF86XK_Launch6 0x1008FF46
+#define XF86XK_Launch7 0x1008FF47
+#define XF86XK_Launch8 0x1008FF48
+#define XF86XK_Launch9 0x1008FF49
+#define XF86XK_LaunchA 0x1008FF4A
+#define XF86XK_LaunchB 0x1008FF4B
+#define XF86XK_LaunchC 0x1008FF4C
+#define XF86XK_LaunchD 0x1008FF4D
+#define XF86XK_LaunchE 0x1008FF4E
+#define XF86XK_LaunchF 0x1008FF4F
+
+#define XF86XK_ApplicationLeft 0x1008FF50
+#define XF86XK_ApplicationRight 0x1008FF51
+#define XF86XK_Book 0x1008FF52
+#define XF86XK_CD 0x1008FF53
+#define XF86XK_Calculater 0x1008FF54
+#define XF86XK_Clear 0x1008FF55
+#define XF86XK_Close 0x1008FF56
+#define XF86XK_Copy 0x1008FF57
+#define XF86XK_Cut 0x1008FF58
+#define XF86XK_Display 0x1008FF59
+#define XF86XK_DOS 0x1008FF5A
+#define XF86XK_Documents 0x1008FF5B
+#define XF86XK_Excel 0x1008FF5C
+#define XF86XK_Explorer 0x1008FF5D
+#define XF86XK_Game 0x1008FF5E
+#define XF86XK_Go 0x1008FF5F
+#define XF86XK_iTouch 0x1008FF60
+#define XF86XK_LogOff 0x1008FF61
+#define XF86XK_Market 0x1008FF62
+#define XF86XK_Meeting 0x1008FF63
+#define XF86XK_MenuKB 0x1008FF65
+#define XF86XK_MenuPB 0x1008FF66
+#define XF86XK_MySites 0x1008FF67
+#define XF86XK_New 0x1008FF68
+#define XF86XK_News 0x1008FF69
+#define XF86XK_OfficeHome 0x1008FF6A
+#define XF86XK_Open 0x1008FF6B
+#define XF86XK_Option 0x1008FF6C
+#define XF86XK_Paste 0x1008FF6D
+#define XF86XK_Phone 0x1008FF6E
+#define XF86XK_Q 0x1008FF70
+#define XF86XK_Reply 0x1008FF72
+#define XF86XK_Reload 0x1008FF73
+#define XF86XK_RotateWindows 0x1008FF74
+#define XF86XK_RotationPB 0x1008FF75
+#define XF86XK_RotationKB 0x1008FF76
+#define XF86XK_Save 0x1008FF77
+#define XF86XK_ScrollUp 0x1008FF78
+#define XF86XK_ScrollDown 0x1008FF79
+#define XF86XK_ScrollClick 0x1008FF7A
+#define XF86XK_Send 0x1008FF7B
+#define XF86XK_Spell 0x1008FF7C
+#define XF86XK_SplitScreen 0x1008FF7D
+#define XF86XK_Support 0x1008FF7E
+#define XF86XK_TaskPane 0x1008FF7F
+#define XF86XK_Terminal 0x1008FF80
+#define XF86XK_Tools 0x1008FF81
+#define XF86XK_Travel 0x1008FF82
+#define XF86XK_UserPB 0x1008FF84
+#define XF86XK_User1KB 0x1008FF85
+#define XF86XK_User2KB 0x1008FF86
+#define XF86XK_Video 0x1008FF87
+#define XF86XK_WheelButton 0x1008FF88
+#define XF86XK_Word 0x1008FF89
+#define XF86XK_Xfer 0x1008FF8A
+#define XF86XK_ZoomIn 0x1008FF8B
+#define XF86XK_ZoomOut 0x1008FF8C
+
+#define XF86XK_Away 0x1008FF8D
+#define XF86XK_Messenger 0x1008FF8E
+#define XF86XK_WebCam 0x1008FF8F
+#define XF86XK_MailForward 0x1008FF90
+#define XF86XK_Pictures 0x1008FF91
+#define XF86XK_Music 0x1008FF92
+
+/* Keys for special action keys (hot keys) */
+#define XF86XK_Switch_VT_1 0x1008FE01
+#define XF86XK_Switch_VT_2 0x1008FE02
+#define XF86XK_Switch_VT_3 0x1008FE03
+#define XF86XK_Switch_VT_4 0x1008FE04
+#define XF86XK_Switch_VT_5 0x1008FE05
+#define XF86XK_Switch_VT_6 0x1008FE06
+#define XF86XK_Switch_VT_7 0x1008FE07
+#define XF86XK_Switch_VT_8 0x1008FE08
+#define XF86XK_Switch_VT_9 0x1008FE09
+#define XF86XK_Switch_VT_10 0x1008FE0A
+#define XF86XK_Switch_VT_11 0x1008FE0B
+#define XF86XK_Switch_VT_12 0x1008FE0C
+
+#define XF86XK_Ungrab 0x1008FE20
+#define XF86XK_ClearGrab 0x1008FE21
+#define XF86XK_Next_VMode 0x1008FE22
+#define XF86XK_Prev_VMode 0x1008FE23
+
+
diff --git a/navit/support/win32/addwinsock.c b/navit/support/win32/addwinsock.c
index 63ae968d5..55f8d2167 100644
--- a/navit/support/win32/addwinsock.c
+++ b/navit/support/win32/addwinsock.c
@@ -1,8 +1,8 @@
-#include "addwinsock.h"
-
-int inet_aton(const char *cp, struct in_addr *inp)
-{
- unsigned long addr = inet_addr(cp);
- inp->S_un.S_addr = addr;
- return addr != -1;
-}
+#include "addwinsock.h"
+
+int inet_aton(const char *cp, struct in_addr *inp)
+{
+ unsigned long addr = inet_addr(cp);
+ inp->S_un.S_addr = addr;
+ return addr != -1;
+}
diff --git a/navit/support/win32/addwinsock.h b/navit/support/win32/addwinsock.h
index 49dfdc0cb..f55aceaf1 100644
--- a/navit/support/win32/addwinsock.h
+++ b/navit/support/win32/addwinsock.h
@@ -1,8 +1,8 @@
-#ifndef ADD_WINSOCK
-#define ADD_WINSOCK
-
-#include <winsock2.h>
-
-int inet_aton(const char *cp, struct in_addr *inp);
-
-#endif
+#ifndef ADD_WINSOCK
+#define ADD_WINSOCK
+
+#include <winsock2.h>
+
+int inet_aton(const char *cp, struct in_addr *inp);
+
+#endif
diff --git a/navit/support/win32/serial_io.c b/navit/support/win32/serial_io.c
index 2eba8ece1..56966bcf7 100644
--- a/navit/support/win32/serial_io.c
+++ b/navit/support/win32/serial_io.c
@@ -51,7 +51,7 @@ int serial_io_init( const char* port, const char* strsettings )
0,
NULL
);
- dbg(lvl_warning, "return (fd) : '-1' : serial_io_init error : '%s'\n", lpMsgBuf);
+ dbg(lvl_warning, "return (fd) : '-1' : serial_io_init error : '%s'", lpMsgBuf);
LocalFree( lpMsgBuf ); // Free the buffer.
return -1;
@@ -72,7 +72,7 @@ int serial_io_init( const char* port, const char* strsettings )
SetCommTimeouts(hCom, &sCT);
- dbg(lvl_debug, "serial_io_init return (fd) : '%d'\n", (int)hCom);
+ dbg(lvl_debug, "serial_io_init return (fd) : '%d'", (int)hCom);
return (int)hCom;
}
@@ -94,12 +94,12 @@ int serial_io_init( const char* port, const char* strsettings )
int serial_io_read( int fd, char * buffer, int buffer_size )
{
DWORD dwBytesIn = 0;
- dbg(lvl_debug, "serial_io_read fd = %d buffer_size = %d\n", fd, buffer_size);
+ dbg(lvl_debug, "serial_io_read fd = %d buffer_size = %d", fd, buffer_size);
if (fd <= 0)
{
- dbg(lvl_debug, "serial_io_read return (dwBytesIn) : '0'\n");
+ dbg(lvl_debug, "serial_io_read return (dwBytesIn) : '0'");
*buffer = 0;
return 0;
}
@@ -117,11 +117,11 @@ int serial_io_read( int fd, char * buffer, int buffer_size )
}
if (dwBytesIn > 0)
{
- dbg(lvl_debug,"GPS < %s\n",buffer );
+ dbg(lvl_debug,"GPS < %s",buffer );
}
buffer[buffer_size - 1] = 0;
- dbg(lvl_info, "serial_io_read return (dwBytesIn) : '%d'\n", dwBytesIn);
+ dbg(lvl_info, "serial_io_read return (dwBytesIn) : '%d'", dwBytesIn);
return dwBytesIn;
}
@@ -139,7 +139,7 @@ int serial_io_read( int fd, char * buffer, int buffer_size )
int serial_io_write(int fd, const char * buffer)
{
DWORD dwBytesOut = 0;
- dbg(lvl_debug, "serial_io_write fd = %d buffer = '%s'\n",fd, buffer);
+ dbg(lvl_debug, "serial_io_write fd = %d buffer = '%s'",fd, buffer);
WriteFile((HANDLE)fd, buffer, strlen(buffer), &dwBytesOut, NULL);
@@ -157,7 +157,7 @@ int serial_io_write(int fd, const char * buffer)
**/
void serial_io_shutdown(int fd )
{
- dbg(lvl_debug, "serial_io_shutdown fd = %d\n",fd);
+ dbg(lvl_debug, "serial_io_shutdown fd = %d",fd);
if (fd > 0)
{
diff --git a/navit/support/wordexp/glob.c b/navit/support/wordexp/glob.c
index 8337367dd..fabceb6f2 100644
--- a/navit/support/wordexp/glob.c
+++ b/navit/support/wordexp/glob.c
@@ -130,7 +130,7 @@ glob_recursive(const char *path1, const char *path2, const char *pattern, int fl
strcat(path, "/");
strcat(path, path2);
if (!strlen(pattern)) {
- dbg(lvl_debug,"found %s\n",path);
+ dbg(lvl_debug,"found %s",path);
pglob->gl_pathv=realloc(pglob->gl_pathv, (pglob->gl_pathc+1)*sizeof(char *));
if (!pglob->gl_pathv) {
pglob->gl_pathc=0;
@@ -139,7 +139,7 @@ glob_recursive(const char *path1, const char *path2, const char *pattern, int fl
pglob->gl_pathv[pglob->gl_pathc++]=path;
return 0;
}
- dbg(lvl_debug,"searching for %s in %s\n",pattern,path);
+ dbg(lvl_debug,"searching for %s in %s",pattern,path);
flen=strcspn(pattern,"/");
next=pattern+flen;
if (*next == '/')
@@ -150,7 +150,7 @@ glob_recursive(const char *path1, const char *path2, const char *pattern, int fl
if (glob_requires_match(fname, 0)) {
DIR *dh;
struct dirent *de;
- dbg(lvl_debug,"in dir %s search for %s\n",path,fname);
+ dbg(lvl_debug,"in dir %s search for %s",path,fname);
dh=opendir(path);
if (dh) {
while ((de=readdir(dh))) {
diff --git a/navit/support/xgetopt/XGetopt.c b/navit/support/xgetopt/XGetopt.c
index d6174d826..60bc0f474 100644
--- a/navit/support/xgetopt/XGetopt.c
+++ b/navit/support/xgetopt/XGetopt.c
@@ -1,216 +1,216 @@
-// XGetopt.cpp Version 1.2
-//
-// Author: Hans Dietrich
-// hdietrich2@hotmail.com
-//
-// Description:
-// XGetopt.cpp implements getopt(), a function to parse command lines.
-//
-// History
-// Version 1.2 - 2003 May 17
-// - Added Unicode support
-//
-// Version 1.1 - 2002 March 10
-// - Added example to XGetopt.cpp module header
-//
-// This software is released into the public domain.
-// You are free to use it in any way you like.
-//
-// This software is provided "as is" with no expressed
-// or implied warranty. I accept no liability for any
-// damage or loss of business that this software may cause.
-//
-///////////////////////////////////////////////////////////////////////////////
-
-
-
-///////////////////////////////////////////////////////////////////////////////
-// if you are not using precompiled headers then include these lines:
-#include <windows.h>
-#include <stdio.h>
-///////////////////////////////////////////////////////////////////////////////
-
-
-#include "XGetopt.h"
-
-
-///////////////////////////////////////////////////////////////////////////////
-//
-// X G e t o p t . c p p
-//
-//
-// NAME
-// getopt -- parse command line options
-//
-// SYNOPSIS
-// int getopt(int argc, char *argv[], char *optstring)
-//
-// extern char *optarg;
-// extern int optind;
-//
-// DESCRIPTION
-// The getopt() function parses the command line arguments. Its
-// arguments argc and argv are the argument count and array as
-// passed into the application on program invocation. In the case
-// of Visual C++ programs, argc and argv are available via the
-// variables __argc and __argv (double underscores), respectively.
-// getopt returns the next option letter in argv that matches a
-// letter in optstring. (Note: Unicode programs should use
-// __targv instead of __argv. Also, all character and string
-// literals should be enclosed in _T( ) ).
-//
-// optstring is a string of recognized option letters; if a letter
-// is followed by a colon, the option is expected to have an argument
-// that may or may not be separated from it by white space. optarg
-// is set to point to the start of the option argument on return from
-// getopt.
-//
-// Option letters may be combined, e.g., "-ab" is equivalent to
-// "-a -b". Option letters are case sensitive.
-//
-// getopt places in the external variable optind the argv index
-// of the next argument to be processed. optind is initialized
-// to 0 before the first call to getopt.
-//
-// When all options have been processed (i.e., up to the first
-// non-option argument), getopt returns EOF, optarg will point
-// to the argument, and optind will be set to the argv index of
-// the argument. If there are no non-option arguments, optarg
-// will be set to NULL.
-//
-// The special option "--" may be used to delimit the end of the
-// options; EOF will be returned, and "--" (and everything after it)
-// will be skipped.
-//
-// RETURN VALUE
-// For option letters contained in the string optstring, getopt
-// will return the option letter. getopt returns a question mark (?)
-// when it encounters an option letter not included in optstring.
-// EOF is returned when processing is finished.
-//
-// BUGS
-// 1) Long options are not supported.
-// 2) The GNU double-colon extension is not supported.
-// 3) The environment variable POSIXLY_CORRECT is not supported.
-// 4) The + syntax is not supported.
-// 5) The automatic permutation of arguments is not supported.
-// 6) This implementation of getopt() returns EOF if an error is
-// encountered, instead of -1 as the latest standard requires.
-//
-// EXAMPLE
-// BOOL CMyApp::ProcessCommandLine(int argc, char *argv[])
-// {
-// int c;
-//
-// while ((c = getopt(argc, argv, "aBn:")) != EOF)
-// {
-// switch (c)
-// {
-// case 'a':
-// TRACE("option a\n");
-// //
-// // set some flag here
-// //
-// break;
-//
-// case 'B':
-// TRACE( "option B\n");
-// //
-// // set some other flag here
-// //
-// break;
-//
-// case 'n':
-// TRACE("option n: value=%d\n", atoi(optarg));
-// //
-// // do something with value here
-// //
-// break;
-//
-// case '?':
-// TRACE("ERROR: illegal option %s\n", argv[optind-1]);
-// return FALSE;
-// break;
-//
-// default:
-// TRACE("WARNING: no handler for option %c\n", c);
-// return FALSE;
-// break;
-// }
-// }
-// //
-// // check for non-option args here
-// //
-// return TRUE;
-// }
-//
-///////////////////////////////////////////////////////////////////////////////
-
-char *optarg; // global argument pointer
-int optind = 0; // global argv index
-
-int getopt(int argc, char *argv[], char *optstring)
-{
- static char *next = NULL;
- char c;
- char *cp;
-
- if (optind == 0)
- next = NULL;
-
- optarg = NULL;
-
- if (next == NULL || *next == '\0')
- {
- if (optind == 0)
- optind++;
-
- if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0')
- {
- optarg = NULL;
- if (optind < argc)
- optarg = argv[optind];
- return EOF;
- }
-
- if (strcmp(argv[optind], "--") == 0)
- {
- optind++;
- optarg = NULL;
- if (optind < argc)
- optarg = argv[optind];
- return EOF;
- }
-
- next = argv[optind];
- next++; // skip past -
- optind++;
- }
-
- c = *next++;
- cp = strchr(optstring, c);
-
- if (cp == NULL || c == ':')
- return '?';
-
- cp++;
- if (*cp == ':')
- {
- if (*next != '\0')
- {
- optarg = next;
- next = NULL;
- }
- else if (optind < argc)
- {
- optarg = argv[optind];
- optind++;
- }
- else
- {
- return '?';
- }
- }
-
- return c;
-}
+// XGetopt.cpp Version 1.2
+//
+// Author: Hans Dietrich
+// hdietrich2@hotmail.com
+//
+// Description:
+// XGetopt.cpp implements getopt(), a function to parse command lines.
+//
+// History
+// Version 1.2 - 2003 May 17
+// - Added Unicode support
+//
+// Version 1.1 - 2002 March 10
+// - Added example to XGetopt.cpp module header
+//
+// This software is released into the public domain.
+// You are free to use it in any way you like.
+//
+// This software is provided "as is" with no expressed
+// or implied warranty. I accept no liability for any
+// damage or loss of business that this software may cause.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+
+
+///////////////////////////////////////////////////////////////////////////////
+// if you are not using precompiled headers then include these lines:
+#include <windows.h>
+#include <stdio.h>
+///////////////////////////////////////////////////////////////////////////////
+
+
+#include "XGetopt.h"
+
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// X G e t o p t . c p p
+//
+//
+// NAME
+// getopt -- parse command line options
+//
+// SYNOPSIS
+// int getopt(int argc, char *argv[], char *optstring)
+//
+// extern char *optarg;
+// extern int optind;
+//
+// DESCRIPTION
+// The getopt() function parses the command line arguments. Its
+// arguments argc and argv are the argument count and array as
+// passed into the application on program invocation. In the case
+// of Visual C++ programs, argc and argv are available via the
+// variables __argc and __argv (double underscores), respectively.
+// getopt returns the next option letter in argv that matches a
+// letter in optstring. (Note: Unicode programs should use
+// __targv instead of __argv. Also, all character and string
+// literals should be enclosed in _T( ) ).
+//
+// optstring is a string of recognized option letters; if a letter
+// is followed by a colon, the option is expected to have an argument
+// that may or may not be separated from it by white space. optarg
+// is set to point to the start of the option argument on return from
+// getopt.
+//
+// Option letters may be combined, e.g., "-ab" is equivalent to
+// "-a -b". Option letters are case sensitive.
+//
+// getopt places in the external variable optind the argv index
+// of the next argument to be processed. optind is initialized
+// to 0 before the first call to getopt.
+//
+// When all options have been processed (i.e., up to the first
+// non-option argument), getopt returns EOF, optarg will point
+// to the argument, and optind will be set to the argv index of
+// the argument. If there are no non-option arguments, optarg
+// will be set to NULL.
+//
+// The special option "--" may be used to delimit the end of the
+// options; EOF will be returned, and "--" (and everything after it)
+// will be skipped.
+//
+// RETURN VALUE
+// For option letters contained in the string optstring, getopt
+// will return the option letter. getopt returns a question mark (?)
+// when it encounters an option letter not included in optstring.
+// EOF is returned when processing is finished.
+//
+// BUGS
+// 1) Long options are not supported.
+// 2) The GNU double-colon extension is not supported.
+// 3) The environment variable POSIXLY_CORRECT is not supported.
+// 4) The + syntax is not supported.
+// 5) The automatic permutation of arguments is not supported.
+// 6) This implementation of getopt() returns EOF if an error is
+// encountered, instead of -1 as the latest standard requires.
+//
+// EXAMPLE
+// BOOL CMyApp::ProcessCommandLine(int argc, char *argv[])
+// {
+// int c;
+//
+// while ((c = getopt(argc, argv, "aBn:")) != EOF)
+// {
+// switch (c)
+// {
+// case 'a':
+// TRACE("option a\n");
+// //
+// // set some flag here
+// //
+// break;
+//
+// case 'B':
+// TRACE( "option B\n");
+// //
+// // set some other flag here
+// //
+// break;
+//
+// case 'n':
+// TRACE("option n: value=%d\n", atoi(optarg));
+// //
+// // do something with value here
+// //
+// break;
+//
+// case '?':
+// TRACE("ERROR: illegal option %s\n", argv[optind-1]);
+// return FALSE;
+// break;
+//
+// default:
+// TRACE("WARNING: no handler for option %c\n", c);
+// return FALSE;
+// break;
+// }
+// }
+// //
+// // check for non-option args here
+// //
+// return TRUE;
+// }
+//
+///////////////////////////////////////////////////////////////////////////////
+
+char *optarg; // global argument pointer
+int optind = 0; // global argv index
+
+int getopt(int argc, char *argv[], char *optstring)
+{
+ static char *next = NULL;
+ char c;
+ char *cp;
+
+ if (optind == 0)
+ next = NULL;
+
+ optarg = NULL;
+
+ if (next == NULL || *next == '\0')
+ {
+ if (optind == 0)
+ optind++;
+
+ if (optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0')
+ {
+ optarg = NULL;
+ if (optind < argc)
+ optarg = argv[optind];
+ return EOF;
+ }
+
+ if (strcmp(argv[optind], "--") == 0)
+ {
+ optind++;
+ optarg = NULL;
+ if (optind < argc)
+ optarg = argv[optind];
+ return EOF;
+ }
+
+ next = argv[optind];
+ next++; // skip past -
+ optind++;
+ }
+
+ c = *next++;
+ cp = strchr(optstring, c);
+
+ if (cp == NULL || c == ':')
+ return '?';
+
+ cp++;
+ if (*cp == ':')
+ {
+ if (*next != '\0')
+ {
+ optarg = next;
+ next = NULL;
+ }
+ else if (optind < argc)
+ {
+ optarg = argv[optind];
+ optind++;
+ }
+ else
+ {
+ return '?';
+ }
+ }
+
+ return c;
+}
diff --git a/navit/support/xgetopt/XGetopt.h b/navit/support/xgetopt/XGetopt.h
index b975026c1..4bf8c8779 100644
--- a/navit/support/xgetopt/XGetopt.h
+++ b/navit/support/xgetopt/XGetopt.h
@@ -1,29 +1,29 @@
-// XGetopt.h Version 1.2
-//
-// Author: Hans Dietrich
-// hdietrich2@hotmail.com
-//
-// This software is released into the public domain.
-// You are free to use it in any way you like.
-//
-// This software is provided "as is" with no expressed
-// or implied warranty. I accept no liability for any
-// damage or loss of business that this software may cause.
-//
-///////////////////////////////////////////////////////////////////////////////
-
-#ifndef XGETOPT_H
-#define XGETOPT_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern int optind, opterr;
-extern char *optarg;
-
-int getopt(int argc, char *argv[], char *optstring);
-#ifdef __cplusplus
-}
-#endif
-#endif //XGETOPT_H
+// XGetopt.h Version 1.2
+//
+// Author: Hans Dietrich
+// hdietrich2@hotmail.com
+//
+// This software is released into the public domain.
+// You are free to use it in any way you like.
+//
+// This software is provided "as is" with no expressed
+// or implied warranty. I accept no liability for any
+// damage or loss of business that this software may cause.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef XGETOPT_H
+#define XGETOPT_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int optind, opterr;
+extern char *optarg;
+
+int getopt(int argc, char *argv[], char *optstring);
+#ifdef __cplusplus
+}
+#endif
+#endif //XGETOPT_H
diff --git a/navit/tools/latlon2bookmark/latlon2bookmark.c b/navit/tools/latlon2bookmark/latlon2bookmark.c
index 9f0eff79a..4f5fe54cb 100644
--- a/navit/tools/latlon2bookmark/latlon2bookmark.c
+++ b/navit/tools/latlon2bookmark/latlon2bookmark.c
@@ -1,140 +1,140 @@
-/**
- * Navit, a modular navigation system.
- * Copyright (C) 2005-2009 Navit Team
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * version 2 as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-/**
- * this program is free software, please use it as you like.
- * i am not a programmer, so please have this code reviewed
- * to make sure it has nog bugs or ill side efects.
- * use at your own risk
- * compile it with: gcc -l m -o latlon2bookmark latlon2bookmark.c
- * Credits for this work goes to edje in #navit
-**/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-int main( int argc, char **argv )
-{
- char description[256];
- char lngsign[10];
- char latsign[10];
- float lat;
- float lng;
- long intlat;
- long intlng;
- int i;
- int n;
-
- if ( argc < 4 )
- {
- printf("\n");
- printf("This program converts a lat/lon coordinates pair\n");
- printf("into a bookmark you can use with navit.\n");
- printf("This program expects 3 arguments in the following order:\n");
- printf("Lat, Lon and a description\n");
- printf("and will print a bookmark.\n");
- printf("for example: latlon2bookmark 51.980344 4.358005 this is my house \n");
- printf("\n");
- return 1;
- }
-
- lat=atof(argv[1]);
- lng=atof(argv[2]);
-
- /* concatenate all parts of the description string */
- strcpy(description, argv[3]);
- n=0;
- for (i=4; i < argc; i++)
- {
- /* add spaces between the parts of the description */
- if ( i < argc )
- {
- strcat(description, " ");
- }
- strcat(description, argv[i]);
- n=n+1;
- }
-
- if ( lat < -90 )
- {
- printf("\n");
- printf("The first argument must be the lattitude\n");
- printf("and can't be smaller then -90 (southpole)\n");
- printf("\n");
- return 2;
- }
-
- if ( lat > 90 )
- {
- printf("\n");
- printf("The first argument must be the lattitude\n");
- printf("and can't be bigger then 90 (northpole)\n");
- printf("\n");
- return 3;
- }
-
- if ( lng < -180 )
- {
- printf("\n");
- printf("The second argument must be the longitude\n");
- printf("and can't be smaller then -180 (oposite the 0 meridian)\n");
- printf("\n");
- return 4;
- }
-
- if ( lng > 180 )
- {
- printf("\n");
- printf("The first argument must be the longitude\n");
- printf("and can't be bigger then 180 (oposite the 0 meridian)\n");
- printf("\n");
- return 5;
- }
-
- /* convert the longitude to an integer */
- intlng=lng*6371000.0*M_PI/180;
-
- /* aparently if inlng < 0 , inlng needs to be inverted and a - sign used in the output */
- strcpy(lngsign, "0x");
- if ( intlng < 0)
- {
- intlng=(intlng ^ 0xffffffff);
- strcpy(lngsign, "-0x");
- }
-
- /* and the same for the latitude */
- intlat=log(tan(M_PI_4+lat*M_PI/360))*6371000.0;
-
- /* aparently if inlat < 0 , inlat needs to be inverted and a - sign used in the output */
- strcpy(latsign, "0x");
- if ( intlat < 0)
- {
- intlat=(intlat ^ 0xffffffff);
- strcpy(latsign, "-0x");
- }
-
- /* print the bookmark */
- fprintf(stderr,"\n");
- fprintf(stdout,"mg:%s%x %s%x type=bookmark label=\"%s\"\n",lngsign,intlng,latsign,intlat,description);
- fprintf(stderr,"\n");
-
- return 0;
-}
+/**
+ * Navit, a modular navigation system.
+ * Copyright (C) 2005-2009 Navit Team
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+/**
+ * this program is free software, please use it as you like.
+ * i am not a programmer, so please have this code reviewed
+ * to make sure it has nog bugs or ill side efects.
+ * use at your own risk
+ * compile it with: gcc -l m -o latlon2bookmark latlon2bookmark.c
+ * Credits for this work goes to edje in #navit
+**/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+
+int main( int argc, char **argv )
+{
+ char description[256];
+ char lngsign[10];
+ char latsign[10];
+ float lat;
+ float lng;
+ long intlat;
+ long intlng;
+ int i;
+ int n;
+
+ if ( argc < 4 )
+ {
+ printf("\n");
+ printf("This program converts a lat/lon coordinates pair\n");
+ printf("into a bookmark you can use with navit.\n");
+ printf("This program expects 3 arguments in the following order:\n");
+ printf("Lat, Lon and a description\n");
+ printf("and will print a bookmark.\n");
+ printf("for example: latlon2bookmark 51.980344 4.358005 this is my house \n");
+ printf("\n");
+ return 1;
+ }
+
+ lat=atof(argv[1]);
+ lng=atof(argv[2]);
+
+ /* concatenate all parts of the description string */
+ strcpy(description, argv[3]);
+ n=0;
+ for (i=4; i < argc; i++)
+ {
+ /* add spaces between the parts of the description */
+ if ( i < argc )
+ {
+ strcat(description, " ");
+ }
+ strcat(description, argv[i]);
+ n=n+1;
+ }
+
+ if ( lat < -90 )
+ {
+ printf("\n");
+ printf("The first argument must be the lattitude\n");
+ printf("and can't be smaller then -90 (southpole)\n");
+ printf("\n");
+ return 2;
+ }
+
+ if ( lat > 90 )
+ {
+ printf("\n");
+ printf("The first argument must be the lattitude\n");
+ printf("and can't be bigger then 90 (northpole)\n");
+ printf("\n");
+ return 3;
+ }
+
+ if ( lng < -180 )
+ {
+ printf("\n");
+ printf("The second argument must be the longitude\n");
+ printf("and can't be smaller then -180 (oposite the 0 meridian)\n");
+ printf("\n");
+ return 4;
+ }
+
+ if ( lng > 180 )
+ {
+ printf("\n");
+ printf("The first argument must be the longitude\n");
+ printf("and can't be bigger then 180 (oposite the 0 meridian)\n");
+ printf("\n");
+ return 5;
+ }
+
+ /* convert the longitude to an integer */
+ intlng=lng*6371000.0*M_PI/180;
+
+ /* aparently if inlng < 0 , inlng needs to be inverted and a - sign used in the output */
+ strcpy(lngsign, "0x");
+ if ( intlng < 0)
+ {
+ intlng=(intlng ^ 0xffffffff);
+ strcpy(lngsign, "-0x");
+ }
+
+ /* and the same for the latitude */
+ intlat=log(tan(M_PI_4+lat*M_PI/360))*6371000.0;
+
+ /* aparently if inlat < 0 , inlat needs to be inverted and a - sign used in the output */
+ strcpy(latsign, "0x");
+ if ( intlat < 0)
+ {
+ intlat=(intlat ^ 0xffffffff);
+ strcpy(latsign, "-0x");
+ }
+
+ /* print the bookmark */
+ fprintf(stderr,"\n");
+ fprintf(stdout,"mg:%s%x %s%x type=bookmark label=\"%s\"\n",lngsign,intlng,latsign,intlat,description);
+ fprintf(stderr,"\n");
+
+ return 0;
+}
diff --git a/navit/track.c b/navit/track.c
index 5c16e4261..9217b192f 100644
--- a/navit/track.c
+++ b/navit/track.c
@@ -155,7 +155,7 @@ tracking_process_cdf(struct cdf_data *cdf, struct pcoord *pin, struct pcoord *po
int speed_num,i;
if (cdf->hist_size == 0) {
- dbg(lvl_warning,"No CDF.\n");
+ dbg(lvl_warning,"No CDF.");
*pout = *pin;
*dirout = dirin;
return;
@@ -338,7 +338,7 @@ tracking_get_attr(struct tracking *_this, enum attr_type type, struct attr *attr
struct tracking_line *tl;
int result=0;
- dbg(lvl_debug,"enter %s\n",attr_to_name(type));
+ dbg(lvl_debug,"enter %s",attr_to_name(type));
if (_this->attr) {
attr_free(_this->attr);
_this->attr=NULL;
@@ -471,7 +471,7 @@ tracking_doupdate_lines(struct tracking *tr, struct coord *pc, enum projection p
struct coord_geo g;
struct coord cc;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
h=mapset_open(tr->ms);
while ((m=mapset_next(h,2))) {
cc.x = pc->x;
@@ -501,7 +501,7 @@ tracking_doupdate_lines(struct tracking *tr, struct coord *pc, enum projection p
map_rect_destroy(mr);
}
mapset_close(h);
- dbg(lvl_debug, "exit\n");
+ dbg(lvl_debug, "exit");
}
@@ -509,7 +509,7 @@ void
tracking_flush(struct tracking *tr)
{
struct tracking_line *tl=tr->lines,*next;
- dbg(lvl_debug,"enter(tr=%p)\n", tr);
+ dbg(lvl_debug,"enter(tr=%p)", tr);
while (tl) {
next=tl->next;
@@ -603,7 +603,7 @@ tracking_value(struct tracking *tr, struct tracking_line *t, int offset, struct
{
int value=0;
struct street_data *sd=t->street;
- dbg(lvl_info, "%d: (0x%x,0x%x)-(0x%x,0x%x)\n", offset, sd->c[offset].x, sd->c[offset].y, sd->c[offset+1].x, sd->c[offset+1].y);
+ dbg(lvl_info, "%d: (0x%x,0x%x)-(0x%x,0x%x)", offset, sd->c[offset].x, sd->c[offset].y, sd->c[offset+1].x, sd->c[offset+1].y);
if (flags & 1) {
struct coord c1, c2, cp;
c1.x = sd->c[offset].x;
@@ -673,7 +673,7 @@ tracking_update(struct tracking *tr, struct vehicle *v, struct vehicleprofile *v
!vehicle_get_attr(tr->vehicle, attr_position_direction, &direction_attr, NULL) ||
!vehicle_get_attr(tr->vehicle, attr_position_coord_geo, &coord_geo, NULL) ||
!vehicle_get_attr(tr->vehicle, attr_position_time_iso8601, &time_attr, NULL)) {
- dbg(lvl_error,"failed to get position data %d %d %d %d\n",
+ dbg(lvl_error,"failed to get position data %d %d %d %d",
vehicle_get_attr(tr->vehicle, attr_position_speed, &speed_attr, NULL),
vehicle_get_attr(tr->vehicle, attr_position_direction, &direction_attr, NULL),
vehicle_get_attr(tr->vehicle, attr_position_coord_geo, &coord_geo, NULL),
@@ -693,52 +693,48 @@ tracking_update(struct tracking *tr, struct vehicle *v, struct vehicleprofile *v
if (!vehicleprofile_get_attr(vehicleprofile,attr_static_speed,&static_speed,NULL) || !vehicleprofile_get_attr(vehicleprofile,attr_static_distance,&static_distance,NULL)) {
static_speed.u.num=3;
static_distance.u.num=10;
- dbg(lvl_debug,"Using defaults for static position detection\n");
+ dbg(lvl_debug,"Using defaults for static position detection");
}
- dbg(lvl_info,"Static speed: %ld, static distance: %ld\n",static_speed.u.num, static_distance.u.num);
+ dbg(lvl_info,"Static speed: %ld, static distance: %ld",static_speed.u.num, static_distance.u.num);
time=iso8601_to_secs(time_attr.u.str);
speed=*speed_attr.u.numd;
direction=*direction_attr.u.numd;
tr->valid=attr_position_valid_valid;
transform_from_geo(pro, coord_geo.u.coord_geo, &tr->curr_in);
if ((speed < static_speed.u.num && transform_distance(pro, &tr->last_in, &tr->curr_in) < static_distance.u.num )) {
- dbg(lvl_debug,"static speed %f coord 0x%x,0x%x vs 0x%x,0x%x\n",speed,tr->last_in.x,tr->last_in.y, tr->curr_in.x, tr->curr_in.y);
+ dbg(lvl_debug,"static speed %f coord 0x%x,0x%x vs 0x%x,0x%x",speed,tr->last_in.x,tr->last_in.y, tr->curr_in.x, tr->curr_in.y);
tr->valid=attr_position_valid_static;
tr->speed=0;
return;
}
if (tr->tunnel) {
tr->curr_in=tr->curr_out;
- dbg(lvl_debug,"tunnel extrapolation speed %f dir %f\n",tr->speed,tr->direction);
- dbg(lvl_debug,"old 0x%x,0x%x\n",tr->curr_in.x, tr->curr_in.y);
+ dbg(lvl_debug,"tunnel extrapolation speed %f dir %f",tr->speed,tr->direction);
+ dbg(lvl_debug,"old 0x%x,0x%x",tr->curr_in.x, tr->curr_in.y);
speed=tr->speed;
direction=tr->curr_line->angle[tr->pos];
transform_project(pro, &tr->curr_in, tr->speed*tr->tunnel_extrapolation/36, tr->direction, &tr->curr_in);
- dbg(lvl_debug,"new 0x%x,0x%x\n",tr->curr_in.x, tr->curr_in.y);
+ dbg(lvl_debug,"new 0x%x,0x%x",tr->curr_in.x, tr->curr_in.y);
} else if (vehicle_get_attr(tr->vehicle, attr_lag, &lag, NULL) && lag.u.num > 0) {
double espeed;
int edirection;
if (time-tr->time == 1) {
- dbg(lvl_debug,"extrapolating speed from %f and %f (%f)\n",tr->speed, speed, speed-tr->speed);
+ dbg(lvl_debug,"extrapolating speed from %f and %f (%f)",tr->speed, speed, speed-tr->speed);
espeed=speed+(speed-tr->speed)*lag.u.num/10;
- dbg(lvl_debug,"extrapolating angle from %f and %f (%d)\n",tr->direction, direction, tracking_angle_diff(direction,tr->direction,360));
+ dbg(lvl_debug,"extrapolating angle from %f and %f (%d)",tr->direction, direction, tracking_angle_diff(direction,tr->direction,360));
edirection=direction+tracking_angle_diff(direction,tr->direction,360)*lag.u.num/10;
} else {
- dbg(lvl_debug,"no speed and direction extrapolation\n");
+ dbg(lvl_debug,"no speed and direction extrapolation");
espeed=speed;
edirection=direction;
}
- dbg(lvl_debug,"lag %ld speed %f direction %d\n",lag.u.num,espeed,edirection);
- dbg(lvl_debug,"old 0x%x,0x%x\n",tr->curr_in.x, tr->curr_in.y);
+ dbg(lvl_debug,"lag %ld speed %f direction %d",lag.u.num,espeed,edirection);
+ dbg(lvl_debug,"old 0x%x,0x%x",tr->curr_in.x, tr->curr_in.y);
transform_project(pro, &tr->curr_in, espeed*lag.u.num/36, edirection, &tr->curr_in);
- dbg(lvl_debug,"new 0x%x,0x%x\n",tr->curr_in.x, tr->curr_in.y);
+ dbg(lvl_debug,"new 0x%x,0x%x",tr->curr_in.x, tr->curr_in.y);
}
tr->time=time;
tr->pro=pro;
-#if 0
-
- tracking_process_cdf(&tr->cdf, pc, &pcf, angle, &anglef, speed, fixtime);
-#endif
tr->curr_angle=tr->direction=direction;
tr->speed=speed;
tr->last_in=tr->curr_in;
@@ -746,11 +742,11 @@ tracking_update(struct tracking *tr, struct vehicle *v, struct vehicleprofile *v
tr->last[0]=tr->curr[0];
tr->last[1]=tr->curr[1];
if (!tr->lines || transform_distance(pro, &tr->last_updated, &tr->curr_in) > 500) {
- dbg(lvl_debug, "update\n");
+ dbg(lvl_debug, "update");
tracking_flush(tr);
tracking_doupdate_lines(tr, &tr->curr_in, pro);
tr->last_updated=tr->curr_in;
- dbg(lvl_debug,"update end\n");
+ dbg(lvl_debug,"update end");
}
tr->street_direction=0;
@@ -769,7 +765,7 @@ tracking_update(struct tracking *tr, struct vehicle *v, struct vehicleprofile *v
tr->curr[0]=sd->c[i];
tr->curr[1]=sd->c[i+1];
tr->direction_matched=t->angle[i];
- dbg(lvl_debug,"lpnt.x=0x%x,lpnt.y=0x%x pos=%d %d+%d+%d+%d=%d\n", lpnt.x, lpnt.y, i,
+ dbg(lvl_debug,"lpnt.x=0x%x,lpnt.y=0x%x pos=%d %d+%d+%d+%d=%d", lpnt.x, lpnt.y, i,
transform_distance_line_sq(&sd->c[i], &sd->c[i+1], &cin, &lpnt_tmp),
tracking_angle_delta(tr, tr->curr_angle, t->angle[i], 0)*tr->angle_pref,
tracking_is_connected(tr, tr->last, &sd->c[i]) ? tr->connected_pref : 0,
@@ -790,7 +786,7 @@ tracking_update(struct tracking *tr, struct vehicle *v, struct vehicleprofile *v
}
t=t->next;
}
- dbg(lvl_debug,"tr->curr_line=%p min=%d\n", tr->curr_line, min);
+ dbg(lvl_debug,"tr->curr_line=%p min=%d", tr->curr_line, min);
if (!tr->curr_line || min > tr->offroad_limit_pref) {
tr->curr_out=tr->curr_in;
tr->coord_geo_valid=0;
@@ -802,7 +798,7 @@ tracking_update(struct tracking *tr, struct vehicle *v, struct vehicleprofile *v
} else if (tr->tunnel) {
tr->speed=0;
}
- dbg(lvl_debug,"found 0x%x,0x%x\n", tr->curr_out.x, tr->curr_out.y);
+ dbg(lvl_debug,"found 0x%x,0x%x", tr->curr_out.x, tr->curr_out.y);
callback_list_call_attr_0(tr->callback_list, attr_position_coord_geo);
}
@@ -989,7 +985,7 @@ tracking_map_item_coord_get(void *priv_data, struct coord *c, int count)
struct map_rect_priv *this=priv_data;
enum projection pro;
int ret=0;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
while (this->ccount < 2 && count > 0) {
pro = map_projection(this->curr->street->item.map);
if (projection_mg != pro) {
@@ -998,7 +994,7 @@ tracking_map_item_coord_get(void *priv_data, struct coord *c, int count)
c ,projection_mg);
} else
*c=this->curr->street->c[this->ccount+this->coord];
- dbg(lvl_debug,"coord %d 0x%x,0x%x\n",this->ccount,c->x,c->y);
+ dbg(lvl_debug,"coord %d 0x%x,0x%x",this->ccount,c->x,c->y);
this->ccount++;
ret++;
c++;
@@ -1176,7 +1172,7 @@ tracking_map_get_item(struct map_rect_priv *priv)
priv->item.type=type_tracking_10;
else
priv->item.type=type_tracking_0;
- dbg(lvl_debug,"item %d %d points\n", priv->coord, priv->curr->street->count);
+ dbg(lvl_debug,"item %d %d points", priv->coord, priv->curr->street->count);
tracking_map_item_coord_rewind(priv);
tracking_map_item_attr_rewind(priv);
return ret;
diff --git a/navit/transform.c b/navit/transform.c
index 8a6713ab6..573eb3022 100644
--- a/navit/transform.c
+++ b/navit/transform.c
@@ -126,7 +126,7 @@ transform_setup_matrix(struct transformation *t)
int scale=t->scale;
int order_dir=-1;
- dbg(lvl_debug,"yaw=%d pitch=%d center=0x%x,0x%x\n", t->yaw, t->pitch, t->map_center.x, t->map_center.y);
+ dbg(lvl_debug,"yaw=%d pitch=%d center=0x%x,0x%x", t->yaw, t->pitch, t->map_center.x, t->map_center.y);
t->znear=1 << POST_SHIFT;
t->zfar=300*t->znear;
t->scale_shift=0;
@@ -144,7 +144,7 @@ transform_setup_matrix(struct transformation *t)
scale >>= 1;
}
fac=(1 << POST_SHIFT) * (1 << t->scale_shift) / t->scale;
- dbg(lvl_debug,"scale_shift=%d order=%d scale=%f fac=%f\n", t->scale_shift, t->order,t->scale,fac);
+ dbg(lvl_debug,"scale_shift=%d order=%d scale=%f fac=%f", t->scale_shift, t->order,t->scale,fac);
t->m00=rollc*yawc*fac;
t->m01=rollc*yaws*fac;
@@ -161,7 +161,7 @@ transform_setup_matrix(struct transformation *t)
if (t->pitch) {
t->ddd=1;
t->offz=t->screen_dist;
- dbg(lvl_debug,"near %d far %d\n",t->znear,t->zfar);
+ dbg(lvl_debug,"near %d far %d",t->znear,t->zfar);
t->xscale=t->xscale3d;
t->yscale=t->yscale3d;
t->wscale=t->wscale3d;
@@ -218,7 +218,7 @@ transform_set_hog(struct transformation *this_, int hog)
#ifdef ENABLE_ROLL
this_->hog=hog;
#else
- dbg(lvl_error,"not supported\n");
+ dbg(lvl_error,"not supported");
#endif
}
@@ -502,7 +502,7 @@ transform_rotate(struct transformation *t, struct coord c)
result.y=c.x*t->m10+c.y*t->m11+HOG(*t)*t->m12;
result.z=(c.x*t->m20+c.y*t->m21+HOG(*t)*t->m22);
result.z+=t->offz << POST_SHIFT;
- dbg(lvl_debug, "result: (%d,%d,%d)\n", result.x,result.y,result.z);
+ dbg(lvl_debug, "result: (%d,%d,%d)", result.x,result.y,result.z);
return result;
}
@@ -511,11 +511,11 @@ transform_z_clip(struct coord_3d c, struct coord_3d c_old, int zlimit)
{
struct coord_3d result;
float clip_factor = ((float)zlimit-c.z)/(c_old.z-c.z);
- dbg(lvl_debug,"in (%d,%d,%d) - (%d,%d,%d)\n", c.x,c.y,c.z, c_old.x,c_old.y,c_old.z);
+ dbg(lvl_debug,"in (%d,%d,%d) - (%d,%d,%d)", c.x,c.y,c.z, c_old.x,c_old.y,c_old.z);
result.x=c.x+(c_old.x-c.x)*clip_factor;
result.y=c.y+(c_old.y-c.y)*clip_factor;
result.z=zlimit;
- dbg(lvl_debug,"clip result: (%d,%d,%d)\n", result.x, result.y, result.z);
+ dbg(lvl_debug,"clip result: (%d,%d,%d)", result.x, result.y, result.z);
return result;
}
@@ -524,7 +524,7 @@ transform_project_onto_view_plane(struct transformation *t, struct coord_3d c)
{
struct point result;
#if 0
- dbg(lvl_debug,"z=%d\n",c.z);
+ dbg(lvl_debug,"z=%d",c.z);
#endif
result.x = (long long)c.x*t->xscale/c.z;
result.y = (long long)c.y*t->yscale/c.z;
@@ -581,9 +581,9 @@ transform(struct transformation *t, enum projection required_projection, struct
int zlimit=t->znear;
struct z_clip_result clip_result, clip_result_old={{0,0}, -1, 0, 0};
int i,result_idx = 0,result_idx_last=0;
- dbg(lvl_debug,"count=%d\n", count);
+ dbg(lvl_debug,"count=%d", count);
for (i=0; i < count; i++) {
- dbg(lvl_debug, "input coord %d: (%d, %d)\n", i, input[i].x, input[i].y);
+ dbg(lvl_debug, "input coord %d: (%d, %d)", i, input[i].x, input[i].y);
#if 0 /* doesn't work as wanted */
if (i && input[i].x == input[0].x && input[i].y == input[0].y && result_idx && !width_result) {
result[result_idx++]=result[0];
@@ -612,7 +612,7 @@ transform(struct transformation *t, enum projection required_projection, struct
}
screen_point.x+=t->offx;
screen_point.y+=t->offy;
- dbg(lvl_debug,"result: (%d, %d)\n", screen_point.x, screen_point.y);
+ dbg(lvl_debug,"result: (%d, %d)", screen_point.x, screen_point.y);
if (i != 0 && i != count-1 &&
(input[i+1].x != input[0].x || input[i+1].y != input[0].y)) {
@@ -623,7 +623,7 @@ transform(struct transformation *t, enum projection required_projection, struct
result[result_idx]=screen_point;
if (width_result) {
if (t->ddd) {
- dbg(lvl_debug,"width %d * %d / %d\n",width,t->wscale,clip_result.clipped_coord.z);
+ dbg(lvl_debug,"width %d * %d / %d",width,t->wscale,clip_result.clipped_coord.z);
width_result[result_idx]=width*t->wscale/clip_result.clipped_coord.z;
} else
width_result[result_idx]=width;
@@ -679,7 +679,7 @@ static int
transform_reverse_near_far(struct transformation *t, struct point *p, struct coord *c, int near, int far)
{
double xc,yc;
- dbg(lvl_debug,"%d,%d\n",p->x,p->y);
+ dbg(lvl_debug,"%d,%d",p->x,p->y);
if (t->ddd) {
struct coord_geo_cart nearc,farc,nears,fars,intersection;
transform_screen_to_3d(t, p, near, &nearc);
@@ -781,9 +781,9 @@ transform_get_selection(struct transformation *this_, enum projection pro, int o
dbg(lvl_debug,"%f,%f", g.lat, g.lng);
transform_to_geo(this_->pro, &curri->u.c_rect.rl, &g);
transform_from_geo(pro, &g, &curro->u.c_rect.rl);
- dbg(lvl_debug,": - %f,%f\n", g.lat, g.lng);
+ dbg(lvl_debug,": - %f,%f", g.lat, g.lng);
}
- dbg(lvl_debug,"transform rect for %d is %d,%d - %d,%d\n", pro, curro->u.c_rect.lu.x, curro->u.c_rect.lu.y, curro->u.c_rect.rl.x, curro->u.c_rect.rl.y);
+ dbg(lvl_debug,"transform rect for %d is %d,%d - %d,%d", pro, curro->u.c_rect.lu.x, curro->u.c_rect.lu.y, curro->u.c_rect.rl.x, curro->u.c_rect.rl.y);
curro->order+=order;
#if 0
curro->u.c_rect.lu.x-=500;
@@ -849,7 +849,7 @@ transform_set_roll(struct transformation *this_,int roll)
this_->roll=roll;
transform_setup_matrix(this_);
#else
- dbg(lvl_error,"not supported\n");
+ dbg(lvl_error,"not supported");
#endif
}
@@ -971,7 +971,7 @@ transform_setup_source_rect(struct transformation *t)
if (transform_zplane_intersection(&cg[edgenodes[i*2]], &cg[edgenodes[i*2+1]], HOG(*t), &tmp) == 1) {
c.x=tmp.x*(1 << t->scale_shift)+t->map_center.x;
c.y=tmp.y*(1 << t->scale_shift)+t->map_center.y;
- dbg(lvl_debug,"intersection with edge %d at 0x%x,0x%x\n",i,c.x,c.y);
+ dbg(lvl_debug,"intersection with edge %d at 0x%x,0x%x",i,c.x,c.y);
if (valid)
coord_rect_extend(&msm->u.c_rect, &c);
else {
@@ -979,20 +979,20 @@ transform_setup_source_rect(struct transformation *t)
msm->u.c_rect.rl=c;
valid=1;
}
- dbg(lvl_debug,"rect 0x%x,0x%x - 0x%x,0x%x\n",msm->u.c_rect.lu.x,msm->u.c_rect.lu.y,msm->u.c_rect.rl.x,msm->u.c_rect.rl.y);
+ dbg(lvl_debug,"rect 0x%x,0x%x - 0x%x,0x%x",msm->u.c_rect.lu.x,msm->u.c_rect.lu.y,msm->u.c_rect.rl.x,msm->u.c_rect.rl.y);
}
}
} else {
for (i = 0 ; i < 4 ; i++) {
transform_reverse(t, &screen_pnt[i], &screen[i]);
- dbg(lvl_debug,"map(%d) %d,%d=0x%x,0x%x\n", i,screen_pnt[i].x, screen_pnt[i].y, screen[i].x, screen[i].y);
+ dbg(lvl_debug,"map(%d) %d,%d=0x%x,0x%x", i,screen_pnt[i].x, screen_pnt[i].y, screen[i].x, screen[i].y);
}
msm->u.c_rect.lu.x=min4(screen[0].x,screen[1].x,screen[2].x,screen[3].x);
msm->u.c_rect.rl.x=max4(screen[0].x,screen[1].x,screen[2].x,screen[3].x);
msm->u.c_rect.rl.y=min4(screen[0].y,screen[1].y,screen[2].y,screen[3].y);
msm->u.c_rect.lu.y=max4(screen[0].y,screen[1].y,screen[2].y,screen[3].y);
}
- dbg(lvl_debug,"%dx%d\n", msm->u.c_rect.rl.x-msm->u.c_rect.lu.x,
+ dbg(lvl_debug,"%dx%d", msm->u.c_rect.rl.x-msm->u.c_rect.lu.x,
msm->u.c_rect.lu.y-msm->u.c_rect.rl.y);
*msm_last=msm;
msm_last=&msm->next;
@@ -1017,7 +1017,7 @@ transform_set_scale(struct transformation *t, long scale)
int
transform_get_order(struct transformation *t)
{
- dbg(lvl_debug,"order %d\n", t->order);
+ dbg(lvl_debug,"order %d", t->order);
return t->order;
}
@@ -1137,7 +1137,7 @@ transform_distance(enum projection pro, struct coord *c1, struct coord *c2)
} else if (pro == projection_garmin) {
return transform_distance_garmin(c1, c2);
} else {
- dbg(lvl_error,"Unknown projection: %d\n", pro);
+ dbg(lvl_error,"Unknown projection: %d", pro);
return 0;
}
}
@@ -1153,7 +1153,7 @@ transform_project(enum projection pro, struct coord *c, int distance, int angle,
res->y=c->y+distance*cos(angle*M_PI/180)*scale;
break;
default:
- dbg(lvl_error,"Unsupported projection: %d\n", pro);
+ dbg(lvl_error,"Unsupported projection: %d", pro);
return;
}
diff --git a/navit/util.c b/navit/util.c
index 79c92379e..33d663978 100644
--- a/navit/util.c
+++ b/navit/util.c
@@ -62,7 +62,7 @@ navit_utf8_strcasecmp(const char *s1, const char *s2)
s1_folded=g_utf8_casefold(s1,-1);
s2_folded=g_utf8_casefold(s2,-1);
cmpres=strcmp(s1_folded,s2_folded);
- dbg(lvl_debug,"Compared %s with %s, got %d\n",s1_folded,s2_folded,cmpres);
+ dbg(lvl_debug,"Compared %s with %s, got %d",s1_folded,s2_folded,cmpres);
g_free(s1_folded);
g_free(s2_folded);
return cmpres;
@@ -509,7 +509,7 @@ spawn_process(char **argv)
pid_t pid;
sigset_t set, old;
- dbg(lvl_debug,"spawning process for '%s'\n", argv[0]);
+ dbg(lvl_debug,"spawning process for '%s'", argv[0]);
sigemptyset(&set);
sigaddset(&set,SIGCHLD);
spawn_process_sigmask(SIG_BLOCK,&set,&old);
@@ -550,7 +550,7 @@ spawn_process(char **argv)
args=newSysString(cmdline);
cmd = newSysString(argv[0]);
dwRet=CreateProcess(cmd, args, NULL, NULL, 0, 0, NULL, NULL, NULL, &(r->pr));
- dbg(lvl_debug, "CreateProcess(%s,%s), PID=%i\n",argv[0],cmdline,r->pr.dwProcessId);
+ dbg(lvl_debug, "CreateProcess(%s,%s), PID=%i",argv[0],cmdline,r->pr.dwProcessId);
g_free(cmd);
#else
TCHAR* args;
@@ -560,7 +560,7 @@ spawn_process(char **argv)
cmdline=spawn_process_compose_cmdline(argv);
args=newSysString(cmdline);
dwRet=CreateProcess(NULL, args, NULL, NULL, 0, 0, NULL, NULL, &startupInfo, &(r->pr));
- dbg(lvl_debug, "CreateProcess(%s), PID=%i\n",cmdline,r->pr.dwProcessId);
+ dbg(lvl_debug, "CreateProcess(%s), PID=%i",cmdline,r->pr.dwProcessId);
#endif
g_free(cmdline);
g_free(args);
@@ -570,7 +570,7 @@ spawn_process(char **argv)
{
char *cmdline=spawn_process_compose_cmdline(argv);
int status;
- dbg(lvl_error,"Unblocked spawn_process isn't availiable on this platform.\n");
+ dbg(lvl_error,"Unblocked spawn_process isn't availiable on this platform.");
status=system(cmdline);
g_free(cmdline);
r->status=status;
@@ -593,7 +593,7 @@ spawn_process(char **argv)
int spawn_process_check_status(struct spawn_process_info *pi, int block)
{
if(pi==NULL) {
- dbg(lvl_error,"Trying to get process status of NULL, assuming process is terminated.\n");
+ dbg(lvl_error,"Trying to get process status of NULL, assuming process is terminated.");
return 255;
}
#ifdef HAVE_API_WIN32_BASE
@@ -633,9 +633,9 @@ int spawn_process_check_status(struct spawn_process_info *pi, int block)
pi->status=WEXITSTATUS(status);
return pi->status;
if(WIFSTOPPED(status)) {
- dbg(lvl_debug,"child is stopped by %i signal\n",WSTOPSIG(status));
+ dbg(lvl_debug,"child is stopped by %i signal",WSTOPSIG(status));
} else if (WIFSIGNALED(status)) {
- dbg(lvl_debug,"child terminated by signal %i\n",WEXITSTATUS(status));
+ dbg(lvl_debug,"child terminated by signal %i",WEXITSTATUS(status));
pi->status=255;
return 255;
}
@@ -647,12 +647,12 @@ int spawn_process_check_status(struct spawn_process_info *pi, int block)
} else {
if(pi->status!=-1) // Signal handler has changed pi->status while in this function
return pi->status;
- dbg(lvl_error,"waitpid() indicated error, reporting process termination.\n");
+ dbg(lvl_error,"waitpid() indicated error, reporting process termination.");
return 255;
}
}
#else
- dbg(lvl_error, "Non-blocking spawn_process isn't availiable for this platform, repoting process exit status.\n");
+ dbg(lvl_error, "Non-blocking spawn_process isn't availiable for this platform, repoting process exit status.");
return pi->status;
#endif
#endif
diff --git a/navit/vehicle.c b/navit/vehicle.c
index 26dc457cb..61ada2059 100644
--- a/navit/vehicle.c
+++ b/navit/vehicle.c
@@ -112,10 +112,10 @@ vehicle_new(struct attr *parent, struct attr **attrs)
char *type, *colon;
struct pcoord center;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
source = attr_search(attrs, NULL, attr_source);
if (!source) {
- dbg(lvl_error, "incomplete vehicle definition: missing attribute 'source'\n");
+ dbg(lvl_error, "incomplete vehicle definition: missing attribute 'source'");
return NULL;
}
@@ -123,11 +123,11 @@ vehicle_new(struct attr *parent, struct attr **attrs)
colon = strchr(type, ':');
if (colon)
*colon = '\0';
- dbg(lvl_debug, "source='%s' type='%s'\n", source->u.str, type);
+ dbg(lvl_debug, "source='%s' type='%s'", source->u.str, type);
vehicletype_new = plugin_get_category_vehicle(type);
if (!vehicletype_new) {
- dbg(lvl_error, "invalid source '%s': unknown type '%s'\n", source->u.str, type);
+ dbg(lvl_error, "invalid source '%s': unknown type '%s'", source->u.str, type);
g_free(type);
return NULL;
}
@@ -138,7 +138,7 @@ vehicle_new(struct attr *parent, struct attr **attrs)
this_->cbl = callback_list_new();
this_->priv = vehicletype_new(&this_->meth, this_->cbl, attrs);
if (!this_->priv) {
- dbg(lvl_error, "vehicletype_new failed\n");
+ dbg(lvl_error, "vehicletype_new failed");
callback_list_destroy(this_->cbl);
g_free(this_);
return NULL;
@@ -151,7 +151,7 @@ vehicle_new(struct attr *parent, struct attr **attrs)
this_->trans=transform_new(&center, 16, 0);
vehicle_set_default_name(this_);
- dbg(lvl_debug, "leave\n");
+ dbg(lvl_debug, "leave");
this_->log_to_cb=g_hash_table_new(NULL,NULL);
return this_;
}
@@ -164,7 +164,7 @@ vehicle_new(struct attr *parent, struct attr **attrs)
void
vehicle_destroy(struct vehicle *this_)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
if (this_->animate_callback) {
callback_destroy(this_->animate_callback);
event_remove_timeout(this_->animate_timer);
@@ -374,8 +374,8 @@ vehicle_draw(struct vehicle *this_, struct graphics *gra, struct point *pnt, int
{
if (angle < 0)
angle+=360;
- dbg(lvl_debug,"enter this=%p gra=%p pnt=%p dir=%d speed=%d\n", this_, gra, pnt, angle, speed);
- dbg(lvl_debug,"point %d,%d\n", pnt->x, pnt->y);
+ dbg(lvl_debug,"enter this=%p gra=%p pnt=%p dir=%d speed=%d", this_, gra, pnt, angle, speed);
+ dbg(lvl_debug,"point %d,%d", pnt->x, pnt->y);
this_->cursor_pnt=*pnt;
this_->angle=angle;
this_->speed=speed;
@@ -414,7 +414,7 @@ static void vehicle_set_default_name(struct vehicle *this_)
// Safe cast: attr_generic_set_attr does not modify its parameter.
default_name.u.str=(char*)_("Unnamed vehicle");
this_->attrs=attr_generic_set_attr(this_->attrs, &default_name);
- dbg(lvl_error, "Incomplete vehicle definition: missing attribute 'name'. Default name set.\n");
+ dbg(lvl_error, "Incomplete vehicle definition: missing attribute 'name'. Default name set.");
}
}
@@ -449,7 +449,7 @@ vehicle_draw_do(struct vehicle *this_)
while (*attr) {
if ((*attr)->type == attr_itemgra) {
struct itemgra *itm=(*attr)->u.itemgra;
- dbg(lvl_debug,"speed %d-%d %d\n", itm->speed_range.min, itm->speed_range.max, speed);
+ dbg(lvl_debug,"speed %d-%d %d", itm->speed_range.min, itm->speed_range.max, speed);
if (speed >= itm->speed_range.min && speed <= itm->speed_range.max &&
angle >= itm->angle_range.min && angle <= itm->angle_range.max &&
sequence >= itm->sequence_range.min && sequence <= itm->sequence_range.max) {
@@ -670,7 +670,7 @@ vehicle_log_binfile(struct vehicle *this_, struct log *log)
buffer_new=g_malloc((buffer[0]+3)*sizeof(int));
memcpy(buffer_new, buffer, (buffer[0]+1)*sizeof(int));
}
- dbg(lvl_debug,"c=0x%x,0x%x\n",c.x,c.y);
+ dbg(lvl_debug,"c=0x%x,0x%x",c.x,c.y);
buffer_new[buffer_new[0]+1]=c.x;
buffer_new[buffer_new[0]+2]=c.y;
buffer_new[0]+=2;
diff --git a/navit/vehicle/android/vehicle_android.c b/navit/vehicle/android/vehicle_android.c
index 4165b9b31..14e9d0f8a 100644
--- a/navit/vehicle/android/vehicle_android.c
+++ b/navit/vehicle/android/vehicle_android.c
@@ -72,7 +72,7 @@ struct vehicle_priv {
static void
vehicle_android_destroy(struct vehicle_priv *priv)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
g_free(priv);
}
@@ -88,7 +88,7 @@ static int
vehicle_android_position_attr_get(struct vehicle_priv *priv,
enum attr_type type, struct attr *attr)
{
- dbg(lvl_debug,"enter %s\n",attr_to_name(type));
+ dbg(lvl_debug,"enter %s",attr_to_name(type));
switch (type) {
case attr_position_fix_type:
attr->u.num = priv->fix_type;
@@ -125,7 +125,7 @@ vehicle_android_position_attr_get(struct vehicle_priv *priv,
default:
return 0;
}
- dbg(lvl_debug,"ok\n");
+ dbg(lvl_debug,"ok");
attr->type = type;
return 1;
}
@@ -147,7 +147,7 @@ static void
vehicle_android_position_callback(struct vehicle_priv *v, jobject location) {
time_t tnow;
struct tm *tm;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
v->geo.lat = (*jnienv)->CallDoubleMethod(jnienv, location, v->Location_getLatitude);
v->geo.lng = (*jnienv)->CallDoubleMethod(jnienv, location, v->Location_getLongitude);
@@ -158,7 +158,7 @@ vehicle_android_position_callback(struct vehicle_priv *v, jobject location) {
tnow=(*jnienv)->CallLongMethod(jnienv, location, v->Location_getTime)/1000;
tm = gmtime(&tnow);
strftime(v->fixiso8601, sizeof(v->fixiso8601), "%Y-%m-%dT%TZ", tm);
- dbg(lvl_debug,"lat %f lon %f time %s\n",v->geo.lat,v->geo.lng,v->fixiso8601);
+ dbg(lvl_debug,"lat %f lon %f time %s",v->geo.lat,v->geo.lng,v->fixiso8601);
if (v->valid != attr_position_valid_valid) {
v->valid = attr_position_valid_valid;
callback_list_call_attr_0(v->cbl, attr_position_valid);
@@ -240,16 +240,16 @@ vehicle_android_init(struct vehicle_priv *ret)
return 0;
if (!android_find_class_global("org/navitproject/navit/NavitVehicle", &ret->NavitVehicleClass))
return 0;
- dbg(lvl_debug,"at 3\n");
+ dbg(lvl_debug,"at 3");
cid = (*jnienv)->GetMethodID(jnienv, ret->NavitVehicleClass, "<init>", "(Landroid/content/Context;III)V");
if (cid == NULL) {
- dbg(lvl_error,"no method found\n");
+ dbg(lvl_error,"no method found");
return 0; /* exception thrown */
}
- dbg(lvl_debug, "at 4 android_activity=%p\n", android_activity);
+ dbg(lvl_debug, "at 4 android_activity=%p", android_activity);
ret->NavitVehicle=(*jnienv)->NewObject(jnienv, ret->NavitVehicleClass, cid, android_activity,
(int) ret->pcb, (int) ret->scb, (int) ret->fcb);
- dbg(lvl_debug,"result=%p\n",ret->NavitVehicle);
+ dbg(lvl_debug,"result=%p",ret->NavitVehicle);
if (!ret->NavitVehicle)
return 0;
if (ret->NavitVehicle)
@@ -273,7 +273,7 @@ vehicle_android_new_android(struct vehicle_methods *meth,
{
struct vehicle_priv *ret;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
ret = g_new0(struct vehicle_priv, 1);
ret->cbl = cbl;
ret->pcb = callback_new_1(callback_cast(vehicle_android_position_callback), ret);
@@ -284,7 +284,7 @@ vehicle_android_new_android(struct vehicle_methods *meth,
ret->sats_used = 0;
*meth = vehicle_android_methods;
vehicle_android_init(ret);
- dbg(lvl_debug, "return\n");
+ dbg(lvl_debug, "return");
return ret;
}
@@ -296,7 +296,7 @@ vehicle_android_new_android(struct vehicle_methods *meth,
void
plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("android", vehicle_android_new_android);
}
diff --git a/navit/vehicle/demo/vehicle_demo.c b/navit/vehicle/demo/vehicle_demo.c
index 1e2991300..036e97e27 100644
--- a/navit/vehicle/demo/vehicle_demo.c
+++ b/navit/vehicle/demo/vehicle_demo.c
@@ -170,7 +170,7 @@ vehicle_demo_set_attr_do(struct vehicle_priv *priv, struct attr *attr)
callback_list_call_attr_0(priv->cbl, attr_position_valid);
}
priv->position_set=1;
- dbg(lvl_debug,"position_set %f %f\n", priv->geo.lat, priv->geo.lng);
+ dbg(lvl_debug,"position_set %f %f", priv->geo.lat, priv->geo.lng);
break;
case attr_profilename:
case attr_source:
@@ -180,7 +180,7 @@ vehicle_demo_set_attr_do(struct vehicle_priv *priv, struct attr *attr)
// Ignore; used by Navit's infrastructure, but not relevant for this vehicle.
break;
default:
- dbg(lvl_error,"unsupported attribute %s\n",attr_to_name(attr->type));
+ dbg(lvl_error,"unsupported attribute %s",attr_to_name(attr->type));
return 0;
}
return 1;
@@ -209,7 +209,7 @@ vehicle_demo_timer(struct vehicle_priv *priv)
struct item *item=NULL;
len = (priv->config_speed * priv->interval / 1000)/ 3.6;
- dbg(lvl_debug, "###### Entering simulation loop\n");
+ dbg(lvl_debug, "###### Entering simulation loop");
if (!priv->config_speed)
return;
if (priv->route)
@@ -228,10 +228,10 @@ vehicle_demo_timer(struct vehicle_priv *priv)
item=map_rect_get_item(mr);
if (item && item_coord_get(item, &pos, 1)) {
priv->position_set=0;
- dbg(lvl_debug, "current pos=0x%x,0x%x\n", pos.x, pos.y);
- dbg(lvl_debug, "last pos=0x%x,0x%x\n", priv->last.x, priv->last.y);
+ dbg(lvl_debug, "current pos=0x%x,0x%x", pos.x, pos.y);
+ dbg(lvl_debug, "last pos=0x%x,0x%x", priv->last.x, priv->last.y);
if (priv->last.x == pos.x && priv->last.y == pos.y) {
- dbg(lvl_warning, "endless loop\n");
+ dbg(lvl_warning, "endless loop");
}
priv->last = pos;
while (item && priv->config_speed) {
@@ -239,9 +239,9 @@ vehicle_demo_timer(struct vehicle_priv *priv)
item=map_rect_get_item(mr);
continue;
}
- dbg(lvl_debug, "next pos=0x%x,0x%x\n", c.x, c.y);
+ dbg(lvl_debug, "next pos=0x%x,0x%x", c.x, c.y);
slen = transform_distance(projection_mg, &pos, &c);
- dbg(lvl_debug, "len=%d slen=%d\n", len, slen);
+ dbg(lvl_debug, "len=%d slen=%d", len, slen);
if (slen < len) {
len -= slen;
pos = c;
@@ -258,9 +258,9 @@ vehicle_demo_timer(struct vehicle_priv *priv)
ci.x = pos.x;
ci.y = pos.y;
priv->speed=0;
- dbg(lvl_debug,"destination reached\n");
+ dbg(lvl_debug,"destination reached");
}
- dbg(lvl_debug, "ci=0x%x,0x%x\n", ci.x, ci.y);
+ dbg(lvl_debug, "ci=0x%x,0x%x", ci.x, ci.y);
transform_to_geo(projection_mg, &ci,
&priv->geo);
if (priv->valid != attr_position_valid_valid) {
@@ -288,7 +288,7 @@ vehicle_demo_new(struct vehicle_methods
{
struct vehicle_priv *ret;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
ret = g_new0(struct vehicle_priv, 1);
ret->cbl = cbl;
ret->interval=1000;
@@ -306,7 +306,7 @@ vehicle_demo_new(struct vehicle_methods
void
plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("demo", vehicle_demo_new);
}
diff --git a/navit/vehicle/file/vehicle_file.c b/navit/vehicle/file/vehicle_file.c
index 868af4f57..114fd2874 100644
--- a/navit/vehicle/file/vehicle_file.c
+++ b/navit/vehicle/file/vehicle_file.c
@@ -154,7 +154,7 @@ static int vehicle_win32_serial_track(struct vehicle_priv *priv)
int rc = 0;
int dwBytes;
- dbg(lvl_debug, "enter, *priv='%x', priv->source='%s'\n", priv, priv->source);
+ dbg(lvl_debug, "enter, *priv='%x', priv->source='%s'", priv, priv->source);
if ( priv->no_data_count > 5 )
{
@@ -200,7 +200,7 @@ static int vehicle_win32_serial_track(struct vehicle_priv *priv)
priv->no_data_count = 0;
callback_list_call_attr_0(priv->cbl, attr_position_coord_geo);
if (rc > 1)
- dbg(lvl_error, "Can not keep with gps data delay is %d seconds\n", rc - 1);
+ dbg(lvl_error, "Can not keep with gps data delay is %d seconds", rc - 1);
}
}
@@ -208,7 +208,7 @@ static int vehicle_win32_serial_track(struct vehicle_priv *priv)
{
priv->no_data_count++;
}
- dbg(lvl_info, "leave, return '1', priv->no_data_count='%d'\n", priv->no_data_count);
+ dbg(lvl_info, "leave, return '1', priv->no_data_count='%d'", priv->no_data_count);
return 1;
}
#endif
@@ -266,7 +266,7 @@ vehicle_file_open(struct vehicle_priv *priv)
struct sockaddr_in sin;
p=strchr(s,':');
if (!p) {
- dbg(lvl_error,"port number missing in %s\n",s);
+ dbg(lvl_error,"port number missing in %s",s);
g_free(s);
return 0;
}
@@ -274,14 +274,14 @@ vehicle_file_open(struct vehicle_priv *priv)
sin.sin_family=AF_INET;
sin.sin_port=ntohs(atoi(p));
if (!inet_aton(s, &sin.sin_addr)) {
- dbg(lvl_error,"failed to parse %s\n",s);
+ dbg(lvl_error,"failed to parse %s",s);
g_free(s);
return 0;
}
priv->fd = socket(PF_INET, SOCK_STREAM, 0);
if (priv->fd != -1) {
if (connect(priv->fd, (struct sockaddr *)&sin, sizeof(sin)) < 0) {
- dbg(lvl_error,"failed to connect to %s:%s\n",s,p);
+ dbg(lvl_error,"failed to connect to %s:%s",s,p);
g_free(s);
return 0;
}
@@ -315,7 +315,7 @@ vehicle_file_open(struct vehicle_priv *priv)
g_free( raw_setting_str );
priv->file_type = file_type_serial;
// Add the callback
- dbg(lvl_info, "Add the callback ...\n", priv->source);
+ dbg(lvl_info, "Add the callback ...", priv->source);
priv->timeout_callback=callback_new_1(callback_cast(vehicle_win32_serial_track), priv);
#else
//TODO - add linux serial
@@ -332,7 +332,7 @@ vehicle_file_open(struct vehicle_priv *priv)
static void
vehicle_file_close(struct vehicle_priv *priv)
{
- dbg(lvl_debug, "enter, priv->fd='%d'\n", priv->fd);
+ dbg(lvl_debug, "enter, priv->fd='%d'", priv->fd);
vehicle_file_disable_watch(priv);
#ifdef _WIN32
if(priv->file_type == file_type_serial)
@@ -369,7 +369,7 @@ vehicle_file_close(struct vehicle_priv *priv)
static int
vehicle_file_enable_watch_timer(struct vehicle_priv *priv)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
vehicle_file_enable_watch(priv);
return FALSE;
@@ -425,10 +425,10 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer)
int valid=0;
int ret = 0;
- dbg(lvl_info, "enter: buffer='%s'\n", buffer);
+ dbg(lvl_info, "enter: buffer='%s'", buffer);
for (;;) {
if (len < 4) {
- dbg(lvl_error, "'%s' too short\n", buffer);
+ dbg(lvl_error, "'%s' too short", buffer);
return ret;
}
if (buffer[len - 1] == '\r' || buffer[len - 1] == '\n') {
@@ -439,22 +439,22 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer)
break;
}
if (buffer[0] != '$') {
- dbg(lvl_error, "no leading $ in '%s'\n", buffer);
+ dbg(lvl_error, "no leading $ in '%s'", buffer);
return ret;
}
if (buffer[len - 3] != '*') {
- dbg(lvl_error, "no *XX in '%s'\n", buffer);
+ dbg(lvl_error, "no *XX in '%s'", buffer);
return ret;
}
for (i = 1; i < len - 3; i++) {
csum ^= (unsigned char) (buffer[i]);
}
if (!sscanf(buffer + len - 2, "%x", &bcsum) && priv->checksum_ignore != 2) {
- dbg(lvl_error, "no checksum in '%s'\n", buffer);
+ dbg(lvl_error, "no checksum in '%s'", buffer);
return ret;
}
if (bcsum != csum && priv->checksum_ignore == 0) {
- dbg(lvl_error, "wrong checksum in '%s was %x should be %x'\n", buffer,bcsum,csum);
+ dbg(lvl_error, "wrong checksum in '%s was %x should be %x'", buffer,bcsum,csum);
return ret;
}
@@ -463,7 +463,7 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer)
g_free(priv->nmea_data_buf);
priv->nmea_data_buf=nmea_data_buf;
} else {
- dbg(lvl_error, "nmea buffer overflow (len %zu), discarding '%s'\n", priv->nmea_data_buf?strlen(priv->nmea_data_buf):-1,buffer);
+ dbg(lvl_error, "nmea buffer overflow (len %zu), discarding '%s'", priv->nmea_data_buf?strlen(priv->nmea_data_buf):-1,buffer);
}
i = 0;
p = buffer;
@@ -510,7 +510,7 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer)
strncpy(priv->fixtime, item[1], sizeof(priv->fixtime));
}
- dbg(lvl_info, "latitude '%2.4f' longitude %2.4f\n", priv->geo.lat, priv->geo.lng);
+ dbg(lvl_info, "latitude '%2.4f' longitude %2.4f", priv->geo.lat, priv->geo.lng);
} else {
if (priv->valid == attr_position_valid_valid)
@@ -550,7 +550,7 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer)
if (valid) {
priv->direction = g_ascii_strtod( item[1], NULL );
priv->speed = g_ascii_strtod( item[7], NULL );
- dbg(lvl_info,"direction %lf, speed %2.1lf\n", priv->direction, priv->speed);
+ dbg(lvl_info,"direction %lf, speed %2.1lf", priv->direction, priv->speed);
}
}
if (!strncmp(&buffer[3], "RMC", 3)) {
@@ -600,7 +600,7 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer)
strncpy(priv->fixtime, item[1], sizeof(priv->fixtime));
}
- dbg(lvl_info, "latitude '%2.4f' longitude %2.4f\n", priv->geo.lat, priv->geo.lng);
+ dbg(lvl_info, "latitude '%2.4f' longitude %2.4f", priv->geo.lat, priv->geo.lng);
} else {
if (priv->valid == attr_position_valid_valid)
@@ -672,7 +672,7 @@ vehicle_file_parse(struct vehicle_priv *priv, char *buffer)
*/
if (item[1]) {
priv->magnetic_direction = g_ascii_strtod( item[1], NULL );
- dbg(lvl_debug,"magnetic %d\n", priv->magnetic_direction);
+ dbg(lvl_debug,"magnetic %d", priv->magnetic_direction);
}
}
return ret;
@@ -688,7 +688,7 @@ vehicle_file_io(struct vehicle_priv *priv)
{
int size, rc = 0;
char *str, *tok;
- dbg(lvl_debug, "vehicle_file_io : enter\n");
+ dbg(lvl_debug, "vehicle_file_io : enter");
if (priv->process_statefile) {
unsigned char *data;
@@ -721,12 +721,12 @@ vehicle_file_io(struct vehicle_priv *priv)
}
priv->buffer_pos += size;
priv->buffer[priv->buffer_pos] = '\0';
- dbg(lvl_debug, "size=%d pos=%d buffer='%s'\n", size,
+ dbg(lvl_debug, "size=%d pos=%d buffer='%s'", size,
priv->buffer_pos, priv->buffer);
str = priv->buffer;
while ((tok = strchr(str, '\n'))) {
*tok++ = '\0';
- dbg(lvl_debug, "line='%s'\n", str);
+ dbg(lvl_debug, "line='%s'", str);
rc +=vehicle_file_parse(priv, str);
str = tok;
if (priv->file_type == file_type_file && rc)
@@ -737,11 +737,11 @@ vehicle_file_io(struct vehicle_priv *priv)
size = priv->buffer + priv->buffer_pos - str;
memmove(priv->buffer, str, size + 1);
priv->buffer_pos = size;
- dbg(lvl_debug, "now pos=%d buffer='%s'\n",
+ dbg(lvl_debug, "now pos=%d buffer='%s'",
priv->buffer_pos, priv->buffer);
} else if (priv->buffer_pos == buffer_size - 1) {
dbg(lvl_debug,
- "Overflow. Most likely wrong baud rate or no nmea protocol\n");
+ "Overflow. Most likely wrong baud rate or no nmea protocol");
priv->buffer_pos = 0;
}
if (rc)
@@ -756,7 +756,7 @@ vehicle_file_io(struct vehicle_priv *priv)
static void
vehicle_file_enable_watch(struct vehicle_priv *priv)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
#ifdef _WIN32
// add an event : don't use glib timers and g_timeout_add
if (priv->file_type == file_type_serial)
@@ -764,7 +764,7 @@ vehicle_file_enable_watch(struct vehicle_priv *priv)
if (priv->timeout_callback != NULL)
priv->timeout = event_add_timeout(500, 1, priv->timeout_callback);
else
- dbg(lvl_warning, "error : watch not enabled : priv->timeout_callback is null\n"); }
+ dbg(lvl_warning, "error : watch not enabled : priv->timeout_callback is null"); }
else
#endif
{
@@ -781,7 +781,7 @@ vehicle_file_enable_watch(struct vehicle_priv *priv)
static void
vehicle_file_disable_watch(struct vehicle_priv *priv)
{
- dbg(lvl_debug, "vehicle_file_disable_watch : enter\n");
+ dbg(lvl_debug, "vehicle_file_disable_watch : enter");
#ifdef _WIN32
if(priv->file_type == file_type_serial)
{
@@ -893,7 +893,7 @@ vehicle_file_position_attr_get(struct vehicle_priv *priv,
attr->u.str=priv->fixiso8601;
break;
case attr_position_sat_item:
- dbg(lvl_debug,"at here\n");
+ dbg(lvl_debug,"at here");
priv->sat_item.id_lo++;
if (priv->sat_item.id_lo > priv->current_count) {
priv->sat_item.id_lo=0;
@@ -988,7 +988,7 @@ vehicle_file_new_file(struct vehicle_methods
struct attr *checksum_ignore;
struct attr *state_file;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
source = attr_search(attrs, NULL, attr_source);
if(source == NULL){
@@ -1048,7 +1048,7 @@ vehicle_file_new_file(struct vehicle_methods
ret->on_eof=1;
if (on_eof && !g_ascii_strcasecmp(on_eof->u.str, "exit"))
ret->on_eof=2;
- dbg(lvl_debug,"on_eof=%d\n", ret->on_eof);
+ dbg(lvl_debug,"on_eof=%d", ret->on_eof);
*meth = vehicle_file_methods;
ret->cb=callback_new_1(callback_cast(vehicle_file_io), ret);
ret->cbt=callback_new_1(callback_cast(vehicle_file_enable_watch_timer), ret);
@@ -1065,15 +1065,15 @@ vehicle_file_new_file(struct vehicle_methods
ret->no_data_count = 0;
#endif
- dbg(lvl_debug, "vehicle_file_new_file:open\n");
+ dbg(lvl_debug, "vehicle_file_new_file:open");
if (!vehicle_file_open(ret)) {
- dbg(lvl_error, "Failed to open '%s'\n", ret->source);
+ dbg(lvl_error, "Failed to open '%s'", ret->source);
}
vehicle_file_enable_watch(ret);
// vehicle_file_destroy(ret);
// return NULL;
- dbg(lvl_debug, "leave\n");
+ dbg(lvl_debug, "leave");
return ret;
}
@@ -1082,7 +1082,7 @@ vehicle_file_new_file(struct vehicle_methods
*/
void plugin_init(void)
{
- dbg(lvl_debug, "vehicle_file:plugin_init:enter\n");
+ dbg(lvl_debug, "vehicle_file:plugin_init:enter");
plugin_register_category_vehicle("file", vehicle_file_new_file);
plugin_register_category_vehicle("pipe", vehicle_file_new_file);
plugin_register_category_vehicle("socket", vehicle_file_new_file);
diff --git a/navit/vehicle/gpsd/vehicle_gpsd.c b/navit/vehicle/gpsd/vehicle_gpsd.c
index 975d9c68a..285e05ccb 100644
--- a/navit/vehicle/gpsd/vehicle_gpsd.c
+++ b/navit/vehicle/gpsd/vehicle_gpsd.c
@@ -105,12 +105,12 @@ vehicle_gpsd_callback(struct gps_data_t *data, const char *buf, size_t len,
g_free(priv->nmea_data_buf);
priv->nmea_data_buf=nmea_data_buf;
} else {
- dbg(lvl_error, "nmea buffer overflow, discarding '%s'\n", buffer);
+ dbg(lvl_error, "nmea buffer overflow, discarding '%s'", buffer);
}
}
}
- dbg(lvl_debug,"data->set="LONGLONG_HEX_FMT"\n", (unsigned long long)data->set);
+ dbg(lvl_debug,"data->set="LONGLONG_HEX_FMT"", (unsigned long long)data->set);
if (data->set & SPEED_SET) {
priv->speed = data->fix.speed * MPS_TO_KPH;
if(!isnan(data->fix.speed))
@@ -178,12 +178,12 @@ vehicle_gpsd_callback(struct gps_data_t *data, const char *buf, size_t len,
}
#ifdef HAVE_LIBGPS19
if (data->set & DOP_SET) {
- dbg(lvl_debug, "pdop : %g\n", data->dop.pdop);
+ dbg(lvl_debug, "pdop : %g", data->dop.pdop);
priv->hdop = data->dop.pdop;
data->set &= ~DOP_SET;
#else
if (data->set & PDOP_SET) {
- dbg(lvl_debug, "pdop : %g\n", data->pdop);
+ dbg(lvl_debug, "pdop : %g", data->pdop);
priv->hdop = data->hdop;
data->set &= ~PDOP_SET;
#endif
@@ -191,7 +191,7 @@ vehicle_gpsd_callback(struct gps_data_t *data, const char *buf, size_t len,
if (data->set & LATLON_SET) {
priv->geo.lat = data->fix.latitude;
priv->geo.lng = data->fix.longitude;
- dbg(lvl_debug,"lat=%f lng=%f\n", priv->geo.lat, priv->geo.lng);
+ dbg(lvl_debug,"lat=%f lng=%f", priv->geo.lat, priv->geo.lng);
g_free(priv->nmea_data);
priv->nmea_data=priv->nmea_data_buf;
priv->nmea_data_buf=NULL;
@@ -201,7 +201,7 @@ vehicle_gpsd_callback(struct gps_data_t *data, const char *buf, size_t len,
if (! isnan(data->fix.speed) && priv->fix_type > 0) {
callback_list_call_attr_0(priv->cbl, attr_position_coord_geo);
}
- dbg(lvl_info,"speed ok\n");
+ dbg(lvl_info,"speed ok");
}
/**
@@ -219,7 +219,7 @@ vehicle_gpsd_try_open(struct vehicle_priv *priv)
*colon = '\0';
port=colon+1;
}
- dbg(lvl_debug,"Trying to connect to %s:%s\n",source+7,port?port:"default");
+ dbg(lvl_debug,"Trying to connect to %s:%s",source+7,port?port:"default");
#if GPSD_API_MAJOR_VERSION >= 5
/* gps_open returns 0 on success */
@@ -228,7 +228,7 @@ vehicle_gpsd_try_open(struct vehicle_priv *priv)
priv->gps = gps_open(source + 7, port);
if(!priv->gps) {
#endif
- dbg(lvl_error,"gps_open failed for '%s'. Retrying in %d seconds. Have you started gpsd?\n", priv->source, priv->retry_interval);
+ dbg(lvl_error,"gps_open failed for '%s'. Retrying in %d seconds. Have you started gpsd?", priv->source, priv->retry_interval);
g_free(source);
return TRUE;
}
@@ -252,7 +252,7 @@ vehicle_gpsd_try_open(struct vehicle_priv *priv)
if (!priv->gps->gps_fd) {
dbg(lvl_error,"Warning: gps_fd is 0, most likely you have used a gps.h incompatible to libgps");
}
- dbg(lvl_debug,"Connected to gpsd fd=%d evwatch=%p\n", priv->gps->gps_fd, priv->evwatch);
+ dbg(lvl_debug,"Connected to gpsd fd=%d evwatch=%p", priv->gps->gps_fd, priv->evwatch);
event_remove_timeout(priv->retry_timer2);
priv->retry_timer2=NULL;
return FALSE;
@@ -271,11 +271,11 @@ vehicle_gpsd_open(struct vehicle_priv *priv)
memset(&priv->context, 0, sizeof(gpsbt_t));
if(gpsbt_start(NULL, 0, 0, 0, errstr, sizeof(errstr),
0, &priv->context) < 0) {
- dbg(lvl_error,"Error connecting to GPS with gpsbt: (%d) %s (%s)\n",
+ dbg(lvl_error,"Error connecting to GPS with gpsbt: (%d) %s (%s)",
errno, strerror(errno), errstr);
}
sleep(1); /* give gpsd time to start */
- dbg(lvl_debug,"gpsbt_start: completed\n");
+ dbg(lvl_debug,"gpsbt_start: completed");
#endif
priv->retry_timer2=NULL;
if (vehicle_gpsd_try_open(priv))
@@ -324,7 +324,7 @@ vehicle_gpsd_close(struct vehicle_priv *priv)
static void
vehicle_gpsd_io(struct vehicle_priv *priv)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
if (priv->gps) {
vehicle_last = priv;
#if GPSD_API_MAJOR_VERSION >= 5
@@ -333,7 +333,7 @@ vehicle_gpsd_io(struct vehicle_priv *priv)
* No point in processing old GPS reports. */
while((read_result=gps_read(priv->gps))>0);
if(read_result==-1) {
- dbg(lvl_error,"gps_poll failed\n");
+ dbg(lvl_error,"gps_poll failed");
vehicle_gpsd_close(priv);
vehicle_gpsd_open(priv);
}
@@ -344,7 +344,7 @@ vehicle_gpsd_io(struct vehicle_priv *priv)
}
#else
if (gps_poll(priv->gps)) {
- dbg(lvl_error,"gps_poll failed\n");
+ dbg(lvl_error,"gps_poll failed");
vehicle_gpsd_close(priv);
vehicle_gpsd_open(priv);
}
@@ -445,7 +445,7 @@ vehicle_gpsd_new_gpsd(struct vehicle_methods
struct vehicle_priv *ret;
struct attr *source, *query, *retry_int;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
source = attr_search(attrs, NULL, attr_source);
ret = g_new0(struct vehicle_priv, 1);
#if GPSD_API_MAJOR_VERSION >= 5
@@ -458,16 +458,16 @@ vehicle_gpsd_new_gpsd(struct vehicle_methods
} else {
ret->gpsd_query = g_strdup("w+x\n");
}
- dbg(lvl_debug,"Format string for gpsd_query: %s\n",ret->gpsd_query);
+ dbg(lvl_debug,"Format string for gpsd_query: %s",ret->gpsd_query);
retry_int = attr_search(attrs, NULL, attr_retry_interval);
if (retry_int) {
ret->retry_interval = retry_int->u.num;
if (ret->retry_interval < MIN_RETRY_INTERVAL) {
- dbg(lvl_error, "Retry interval %d too small, setting to %d\n", ret->retry_interval, MIN_RETRY_INTERVAL);
+ dbg(lvl_error, "Retry interval %d too small, setting to %d", ret->retry_interval, MIN_RETRY_INTERVAL);
ret->retry_interval = MIN_RETRY_INTERVAL;
}
} else {
- dbg(lvl_debug, "Retry interval not defined, setting to %d\n", DEFAULT_RETRY_INTERVAL);
+ dbg(lvl_debug, "Retry interval not defined, setting to %d", DEFAULT_RETRY_INTERVAL);
ret->retry_interval = DEFAULT_RETRY_INTERVAL;
}
ret->cbl = cbl;
@@ -480,6 +480,6 @@ vehicle_gpsd_new_gpsd(struct vehicle_methods
void
plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("gpsd", vehicle_gpsd_new_gpsd);
}
diff --git a/navit/vehicle/gpsd_dbus/vehicle_gpsd_dbus.c b/navit/vehicle/gpsd_dbus/vehicle_gpsd_dbus.c
index ebdf08707..dd7b99ef0 100644
--- a/navit/vehicle/gpsd_dbus/vehicle_gpsd_dbus.c
+++ b/navit/vehicle/gpsd_dbus/vehicle_gpsd_dbus.c
@@ -122,7 +122,7 @@ vehicle_gpsd_dbus_open(struct vehicle_priv *priv)
priv->connection = dbus_bus_get(DBUS_BUS_SYSTEM, &error);
}
if (!priv->connection) {
- dbg(lvl_error,"Failed to open connection to %s message bus: %s\n", priv->address?priv->address:"session",error.message);
+ dbg(lvl_error,"Failed to open connection to %s message bus: %s", priv->address?priv->address:"session",error.message);
dbus_error_free(&error);
return 0;
}
@@ -130,12 +130,12 @@ vehicle_gpsd_dbus_open(struct vehicle_priv *priv)
dbus_bus_add_match(priv->connection,"type='signal',interface='org.gpsd'",&error);
dbus_connection_flush(priv->connection);
if (dbus_error_is_set(&error)) {
- dbg(lvl_error,"Failed to add match to connection: %s\n", error.message);
+ dbg(lvl_error,"Failed to add match to connection: %s", error.message);
vehicle_gpsd_dbus_close(priv);
return 0;
}
if (!dbus_connection_add_filter(priv->connection, vehicle_gpsd_dbus_filter, priv, NULL)) {
- dbg(lvl_error,"Failed to add filter to connection\n");
+ dbg(lvl_error,"Failed to add filter to connection");
vehicle_gpsd_dbus_close(priv);
return 0;
}
@@ -195,7 +195,7 @@ vehicle_gpsd_dbus_set_attr_do(struct vehicle_priv *priv, struct attr *attr, int
switch (attr->type) {
case attr_source:
if (strncmp(vehicle_gpsd_dbus_prefix,attr->u.str,strlen(vehicle_gpsd_dbus_prefix))) {
- dbg(lvl_error,"source must start with '%s'\n", vehicle_gpsd_dbus_prefix);
+ dbg(lvl_error,"source must start with '%s'", vehicle_gpsd_dbus_prefix);
return 0;
}
g_free(priv->source);
@@ -251,6 +251,6 @@ vehicle_gpsd_dbus_new(struct vehicle_methods
void
plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("gpsd_dbus", vehicle_gpsd_dbus_new);
}
diff --git a/navit/vehicle/gypsy/vehicle_gypsy.c b/navit/vehicle/gypsy/vehicle_gypsy.c
index 16175f2e8..db3acf588 100644
--- a/navit/vehicle/gypsy/vehicle_gypsy.c
+++ b/navit/vehicle/gypsy/vehicle_gypsy.c
@@ -292,7 +292,7 @@ vehicle_gypsy_try_open(gpointer *data)
}
vehicle_last = priv;
- dbg(lvl_debug,"gypsy connected to %d\n", source+8);
+ dbg(lvl_debug,"gypsy connected to %d", source+8);
g_free(source);
return FALSE;
}
@@ -463,11 +463,11 @@ vehicle_gypsy_new_gypsy(struct vehicle_methods *meth,
dbus_message_unref(message);
dbus_connection_unref(conn);
} else {
- dbg(lvl_error,"failed to connect to session bus\n");
+ dbg(lvl_error,"failed to connect to session bus");
}
}
#endif
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
source = attr_search(attrs, NULL, attr_source);
ret = g_new0(struct vehicle_priv, 1);
ret->have_cords = 0;
@@ -477,11 +477,11 @@ vehicle_gypsy_new_gypsy(struct vehicle_methods *meth,
if (retry_int) {
ret->retry_interval = retry_int->u.num;
if (ret->retry_interval < MIN_RETRY_INTERVAL) {
- dbg(lvl_error, "Retry interval %d too small, setting to %d\n", ret->retry_interval, MIN_RETRY_INTERVAL);
+ dbg(lvl_error, "Retry interval %d too small, setting to %d", ret->retry_interval, MIN_RETRY_INTERVAL);
ret->retry_interval = MIN_RETRY_INTERVAL;
}
} else {
- dbg(lvl_error, "Retry interval not defined, setting to %d\n", DEFAULT_RETRY_INTERVAL);
+ dbg(lvl_error, "Retry interval not defined, setting to %d", DEFAULT_RETRY_INTERVAL);
ret->retry_interval = DEFAULT_RETRY_INTERVAL;
}
ret->cbl = cbl;
@@ -498,6 +498,6 @@ vehicle_gypsy_new_gypsy(struct vehicle_methods *meth,
void
plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("gypsy", vehicle_gypsy_new_gypsy);
}
diff --git a/navit/vehicle/iphone/vehicle_iphone.c b/navit/vehicle/iphone/vehicle_iphone.c
index f8ce5b644..28ac0beff 100644
--- a/navit/vehicle/iphone/vehicle_iphone.c
+++ b/navit/vehicle/iphone/vehicle_iphone.c
@@ -127,7 +127,7 @@ vehicle_iphone_update(void *arg,
strcpy(priv->str_time, str_time);
priv->radius = radius;
- dbg(lvl_debug,"position_get lat:%f lng:%f (spd:%f dir:%f time:%s)\n", priv->geo.lat, priv->geo.lng, priv->speed, priv->direction, priv->str_time);
+ dbg(lvl_debug,"position_get lat:%f lng:%f (spd:%f dir:%f time:%s)", priv->geo.lat, priv->geo.lng, priv->speed, priv->direction, priv->str_time);
callback_list_call_attr_0(priv->cbl, attr_position_coord_geo);
}
@@ -141,7 +141,7 @@ vehicle_iphone_new(struct vehicle_methods
struct vehicle_priv *ret;
struct attr *interval,*speed,*position_coord_geo;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
ret = g_new0(struct vehicle_priv, 1);
ret->cbl = cbl;
ret->interval=1000;
@@ -154,7 +154,7 @@ vehicle_iphone_new(struct vehicle_methods
if ((position_coord_geo=attr_search(attrs, NULL, attr_position_coord_geo))) {
ret->geo=*(position_coord_geo->u.coord_geo);
ret->position_set=1;
- dbg(lvl_debug,"position_set %f %f\n", ret->geo.lat, ret->geo.lng);
+ dbg(lvl_debug,"position_set %f %f", ret->geo.lat, ret->geo.lng);
}
*meth = vehicle_iphone_methods;
ret->str_time[0] = '\0';
@@ -168,6 +168,6 @@ vehicle_iphone_new(struct vehicle_methods
void
plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("iphone", vehicle_iphone_new);
}
diff --git a/navit/vehicle/maemo/vehicle_maemo.c b/navit/vehicle/maemo/vehicle_maemo.c
index 015f1c8e3..2ff6296d5 100644
--- a/navit/vehicle/maemo/vehicle_maemo.c
+++ b/navit/vehicle/maemo/vehicle_maemo.c
@@ -72,7 +72,7 @@ static void vehicle_maemo_callback(LocationGPSDevice *device, gpointer user_data
priv->sats_used=device->satellites_in_use;
callback_list_call_attr_0(priv->cbl, attr_position_sats);
- dbg(lvl_debug,"Got update with %u/%u satellites\n",priv->sats_used,priv->sats);
+ dbg(lvl_debug,"Got update with %u/%u satellites",priv->sats_used,priv->sats);
if (device->fix) {
switch(device->fix->mode) {
@@ -91,28 +91,28 @@ static void vehicle_maemo_callback(LocationGPSDevice *device, gpointer user_data
priv->geo.lng=device->fix->longitude;
priv->hdop=device->fix->eph/100;
callback_list_call_attr_0(priv->cbl, attr_position_coord_geo);
- dbg(lvl_debug,"Position: %f %f with error %f meters\n",priv->geo.lat,priv->geo.lng,priv->hdop);
+ dbg(lvl_debug,"Position: %f %f with error %f meters",priv->geo.lat,priv->geo.lng,priv->hdop);
}
if (device->fix->fields & LOCATION_GPS_DEVICE_SPEED_SET) {
priv->speed=device->fix->speed;
callback_list_call_attr_0(priv->cbl, attr_position_speed);
- dbg(lvl_debug,"Speed: %f\n ",priv->speed);
+ dbg(lvl_debug,"Speed: %f ",priv->speed);
}
if (device->fix->fields & LOCATION_GPS_DEVICE_TRACK_SET) {
priv->direction=device->fix->track;
- dbg(lvl_debug,"Direction: %f\n",priv->direction);
+ dbg(lvl_debug,"Direction: %f",priv->direction);
}
if (device->fix->fields & LOCATION_GPS_DEVICE_TIME_SET) {
priv->fix_time=device->fix->time;
- dbg(lvl_debug,"Time: %f\n",priv->fix_time);
+ dbg(lvl_debug,"Time: %f",priv->fix_time);
}
if (device->fix->fields & LOCATION_GPS_DEVICE_ALTITUDE_SET) {
priv->height=device->fix->altitude;
- dbg(lvl_debug,"Elevation: %f\n",priv->height);
+ dbg(lvl_debug,"Elevation: %f",priv->height);
}
}
@@ -124,19 +124,19 @@ static void vehicle_maemo_error(LocationGPSDControl *control, LocationGPSDContro
{
switch (error) {
case LOCATION_ERROR_USER_REJECTED_DIALOG:
- dbg(lvl_error,"User didn't enable requested methods\n");
+ dbg(lvl_error,"User didn't enable requested methods");
break;
case LOCATION_ERROR_USER_REJECTED_SETTINGS:
- dbg(lvl_error,"User changed settings, which disabled location\n");
+ dbg(lvl_error,"User changed settings, which disabled location");
break;
case LOCATION_ERROR_BT_GPS_NOT_AVAILABLE:
- dbg(lvl_error,"Problems with BT GPS\n");
+ dbg(lvl_error,"Problems with BT GPS");
break;
case LOCATION_ERROR_METHOD_NOT_ALLOWED_IN_OFFLINE_MODE:
- dbg(lvl_error,"Requested method is not allowed in offline mode\n");
+ dbg(lvl_error,"Requested method is not allowed in offline mode");
break;
case LOCATION_ERROR_SYSTEM:
- dbg(lvl_error,"System error\n");
+ dbg(lvl_error,"System error");
break;
}
}
@@ -153,54 +153,54 @@ vehicle_maemo_open(struct vehicle_priv *priv)
if (!strcasecmp(priv->source+8,"cwp")) {
g_object_set(G_OBJECT(priv->control), "preferred-method", LOCATION_METHOD_CWP, NULL);
- dbg(lvl_debug,"Method set: CWP\n");
+ dbg(lvl_debug,"Method set: CWP");
} else if (!strcasecmp(priv->source+8,"acwp")) {
g_object_set(G_OBJECT(priv->control), "preferred-method", LOCATION_METHOD_ACWP, NULL);
- dbg(lvl_debug,"Method set: ACWP\n");
+ dbg(lvl_debug,"Method set: ACWP");
} else if (!strcasecmp(priv->source+8,"gnss")) {
g_object_set(G_OBJECT(priv->control), "preferred-method", LOCATION_METHOD_GNSS, NULL);
- dbg(lvl_debug,"Method set: GNSS\n");
+ dbg(lvl_debug,"Method set: GNSS");
} else if (!strcasecmp(priv->source+8,"agnss")) {
g_object_set(G_OBJECT(priv->control), "preferred-method", LOCATION_METHOD_AGNSS, NULL);
- dbg(lvl_debug,"Method set: AGNSS\n");
+ dbg(lvl_debug,"Method set: AGNSS");
} else {
g_object_set(G_OBJECT(priv->control), "preferred-method", LOCATION_METHOD_USER_SELECTED, NULL);
- dbg(lvl_debug,"Method set: ANY\n");
+ dbg(lvl_debug,"Method set: ANY");
}
switch (priv->retry_interval) {
case 2:
g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_2S, NULL);
- dbg(lvl_debug,"Interval set: 2s\n");
+ dbg(lvl_debug,"Interval set: 2s");
break;
case 5:
g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_5S, NULL);
- dbg(lvl_debug,"Interval set: 5s\n");
+ dbg(lvl_debug,"Interval set: 5s");
break;
case 10:
g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_10S, NULL);
- dbg(lvl_debug,"Interval set: 10s\n");
+ dbg(lvl_debug,"Interval set: 10s");
break;
case 20:
g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_20S, NULL);
- dbg(lvl_debug,"Interval set: 20s\n");
+ dbg(lvl_debug,"Interval set: 20s");
break;
case 30:
g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_30S, NULL);
- dbg(lvl_debug,"Interval set: 30s\n");
+ dbg(lvl_debug,"Interval set: 30s");
break;
case 60:
g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_60S, NULL);
- dbg(lvl_debug,"Interval set: 60s\n");
+ dbg(lvl_debug,"Interval set: 60s");
break;
case 120:
g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_120S, NULL);
- dbg(lvl_debug,"Interval set: 120s\n");
+ dbg(lvl_debug,"Interval set: 120s");
break;
case 1:
default:
g_object_set(G_OBJECT(priv->control), "preferred-interval", LOCATION_INTERVAL_1S, NULL);
- dbg(lvl_debug,"Interval set: 1s\n");
+ dbg(lvl_debug,"Interval set: 1s");
break;
}
@@ -230,41 +230,41 @@ vehicle_maemo_position_attr_get(struct vehicle_priv *priv,
struct attr * active=NULL;
switch (type) {
case attr_position_fix_type:
- dbg(lvl_debug,"Attr requested: position_fix_type\n");
+ dbg(lvl_debug,"Attr requested: position_fix_type");
attr->u.num = priv->fix_type;
break;
case attr_position_height:
- dbg(lvl_debug,"Attr requested: position_height\n");
+ dbg(lvl_debug,"Attr requested: position_height");
attr->u.numd = &priv->height;
break;
case attr_position_speed:
- dbg(lvl_debug,"Attr requested: position_speed\n");
+ dbg(lvl_debug,"Attr requested: position_speed");
attr->u.numd = &priv->speed;
break;
case attr_position_direction:
- dbg(lvl_debug,"Attr requested: position_direction\n");
+ dbg(lvl_debug,"Attr requested: position_direction");
attr->u.numd = &priv->direction;
break;
case attr_position_hdop:
- dbg(lvl_debug,"Attr requested: position_hdop\n");
+ dbg(lvl_debug,"Attr requested: position_hdop");
attr->u.numd = &priv->hdop;
break;
case attr_position_sats:
- dbg(lvl_debug,"Attr requested: position_sats\n");
+ dbg(lvl_debug,"Attr requested: position_sats");
attr->u.num = priv->sats;
break;
case attr_position_sats_used:
- dbg(lvl_debug,"Attr requested: position_sats_used\n");
+ dbg(lvl_debug,"Attr requested: position_sats_used");
attr->u.num = priv->sats_used;
break;
case attr_position_coord_geo:
- dbg(lvl_debug,"Attr requested: position_coord_geo\n");
+ dbg(lvl_debug,"Attr requested: position_coord_geo");
attr->u.coord_geo = &priv->geo;
break;
case attr_position_time_iso8601:
{
struct tm tm;
- dbg(lvl_debug,"Attr requested: position_time_iso8601\n");
+ dbg(lvl_debug,"Attr requested: position_time_iso8601");
if (!priv->fix_time)
return 0;
if (gmtime_r(&priv->fix_time, &tm)) {
@@ -276,7 +276,7 @@ vehicle_maemo_position_attr_get(struct vehicle_priv *priv,
}
break;
case attr_active:
- dbg(lvl_debug,"Attr requested: position_active\n");
+ dbg(lvl_debug,"Attr requested: position_active");
active = attr_search(priv->attrs,NULL,attr_active);
if(active != NULL) {
attr->u.num=active->u.num;
@@ -304,7 +304,7 @@ vehicle_maemo_new_maemo(struct vehicle_methods
struct vehicle_priv *ret;
struct attr *source, *retry_int;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
source = attr_search(attrs, NULL, attr_source);
ret = g_new0(struct vehicle_priv, 1);
ret->source = g_strdup(source->u.str);
@@ -312,13 +312,13 @@ vehicle_maemo_new_maemo(struct vehicle_methods
if (retry_int) {
ret->retry_interval = retry_int->u.num;
if (ret->retry_interval !=1 && ret->retry_interval !=2 && ret->retry_interval !=5 && ret->retry_interval !=10 && ret->retry_interval !=20 && ret->retry_interval !=30 && ret->retry_interval !=60 && ret->retry_interval !=120 ) {
- dbg(lvl_error, "Retry interval %d invalid, setting to 1\n", ret->retry_interval,1);
+ dbg(lvl_error, "Retry interval %d invalid, setting to 1", ret->retry_interval,1);
ret->retry_interval = 1;
}
} else {
ret->retry_interval = 1;
}
- dbg(lvl_debug,"source: %s, interval: %u\n",ret->source,ret->retry_interval);
+ dbg(lvl_debug,"source: %s, interval: %u",ret->source,ret->retry_interval);
ret->cbl = cbl;
*meth = vehicle_maemo_methods;
ret->attrs = attrs;
@@ -329,6 +329,6 @@ vehicle_maemo_new_maemo(struct vehicle_methods
void
plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("maemo", vehicle_maemo_new_maemo);
}
diff --git a/navit/vehicle/null/vehicle_null.c b/navit/vehicle/null/vehicle_null.c
index 6b723f9ff..ea990a31e 100644
--- a/navit/vehicle/null/vehicle_null.c
+++ b/navit/vehicle/null/vehicle_null.c
@@ -67,7 +67,7 @@ struct vehicle_priv {
static void
vehicle_null_destroy(struct vehicle_priv *priv)
{
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
g_free(priv);
}
@@ -83,13 +83,8 @@ static int
vehicle_null_position_attr_get(struct vehicle_priv *priv,
enum attr_type type, struct attr *attr)
{
- dbg(lvl_debug,"enter %s\n",attr_to_name(type));
+ dbg(lvl_debug,"enter %s",attr_to_name(type));
switch (type) {
-#if 0
- case attr_position_fix_type:
- attr->u.num = priv->fix_type;
- break;
-#endif
case attr_position_height:
attr->u.numd = &priv->height;
break;
@@ -102,15 +97,6 @@ vehicle_null_position_attr_get(struct vehicle_priv *priv,
case attr_position_radius:
attr->u.numd = &priv->radius;
break;
-
-#if 0
- case attr_position_qual:
- attr->u.num = priv->sats;
- break;
- case attr_position_sats_used:
- attr->u.num = priv->sats_used;
- break;
-#endif
case attr_position_coord_geo:
attr->u.coord_geo = &priv->geo;
if (!priv->have_coords)
@@ -122,7 +108,7 @@ vehicle_null_position_attr_get(struct vehicle_priv *priv,
default:
return 0;
}
- dbg(lvl_debug,"ok\n");
+ dbg(lvl_debug,"ok");
attr->type = type;
return 1;
}
@@ -170,11 +156,11 @@ vehicle_null_new_null(struct vehicle_methods *meth,
{
struct vehicle_priv *ret;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
ret = g_new0(struct vehicle_priv, 1);
ret->cbl = cbl;
*meth = vehicle_null_methods;
- dbg(lvl_debug, "return\n");
+ dbg(lvl_debug, "return");
return ret;
}
@@ -186,6 +172,6 @@ vehicle_null_new_null(struct vehicle_methods *meth,
void
plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("null", vehicle_null_new_null);
}
diff --git a/navit/vehicle/qt5/vehicle_qt5.cpp b/navit/vehicle/qt5/vehicle_qt5.cpp
index fc8a6635a..6d263a649 100644
--- a/navit/vehicle/qt5/vehicle_qt5.cpp
+++ b/navit/vehicle/qt5/vehicle_qt5.cpp
@@ -63,14 +63,14 @@ QNavitGeoReceiver::QNavitGeoReceiver(QObject* parent, struct vehicle_priv* c)
}
void QNavitGeoReceiver::satellitesInUseUpdated(const QList<QGeoSatelliteInfo>& sats)
{
- dbg(lvl_debug, "Sats in use: %d\n", sats.count());
+ dbg(lvl_debug, "Sats in use: %d", sats.count());
priv->sats_used = sats.count();
callback_list_call_attr_0(priv->cbl, attr_position_sats_used);
}
void QNavitGeoReceiver::satellitesInViewUpdated(const QList<QGeoSatelliteInfo>& sats)
{
- dbg(lvl_debug, "Sats in view: %d\n", sats.count());
+ dbg(lvl_debug, "Sats in view: %d", sats.count());
priv->sats = sats.count();
callback_list_call_attr_0(priv->cbl, attr_position_qual);
}
@@ -81,23 +81,23 @@ void QNavitGeoReceiver::positionUpdated(const QGeoPositionInfo& info)
/* ignore stale view */
if (info.coordinate().isValid()) {
if (info.timestamp().toUTC().secsTo(QDateTime::currentDateTimeUtc()) > 20) {
- dbg(lvl_debug, "Ignoring old FIX\n");
+ dbg(lvl_debug, "Ignoring old FIX");
return;
}
}
if (info.hasAttribute(QGeoPositionInfo::HorizontalAccuracy)) {
- dbg(lvl_debug, "Horizontal acc (%f)\n", info.attribute(QGeoPositionInfo::HorizontalAccuracy));
+ dbg(lvl_debug, "Horizontal acc (%f)", info.attribute(QGeoPositionInfo::HorizontalAccuracy));
priv->radius = info.attribute(QGeoPositionInfo::HorizontalAccuracy);
callback_list_call_attr_0(priv->cbl, attr_position_radius);
}
if (info.hasAttribute(QGeoPositionInfo::GroundSpeed)) {
- dbg(lvl_debug, "Got ground speed (%f)\n", info.attribute(QGeoPositionInfo::GroundSpeed));
+ dbg(lvl_debug, "Got ground speed (%f)", info.attribute(QGeoPositionInfo::GroundSpeed));
priv->speed = info.attribute(QGeoPositionInfo::GroundSpeed) * 3.6;
callback_list_call_attr_0(priv->cbl, attr_position_speed);
}
if (info.hasAttribute(QGeoPositionInfo::Direction)) {
- dbg(lvl_debug, "Direction (%f)\n", info.attribute(QGeoPositionInfo::Direction));
+ dbg(lvl_debug, "Direction (%f)", info.attribute(QGeoPositionInfo::Direction));
priv->direction = info.attribute(QGeoPositionInfo::Direction);
callback_list_call_attr_0(priv->cbl, attr_position_direction);
}
@@ -115,19 +115,19 @@ void QNavitGeoReceiver::positionUpdated(const QGeoPositionInfo& info)
}
if (info.coordinate().isValid()) {
- dbg(lvl_debug, "Got valid coordinate (lat %f, lon %f)\n", info.coordinate().latitude(), info.coordinate().longitude());
+ dbg(lvl_debug, "Got valid coordinate (lat %f, lon %f)", info.coordinate().latitude(), info.coordinate().longitude());
priv->geo.lat = info.coordinate().latitude();
priv->geo.lng = info.coordinate().longitude();
priv->have_coords = 1;
if (info.coordinate().type() == QGeoCoordinate::Coordinate3D) {
- dbg(lvl_debug, "Got valid altitude (alt %f)\n", info.coordinate().altitude());
+ dbg(lvl_debug, "Got valid altitude (alt %f)", info.coordinate().altitude());
priv->height = info.coordinate().altitude();
}
- //dbg(lvl_debug, "Time %s\n", info.timestamp().toUTC().toString().toLatin1().data());
+ //dbg(lvl_debug, "Time %s", info.timestamp().toUTC().toString().toLatin1().data());
priv->fix_time = info.timestamp().toUTC().toTime_t();
callback_list_call_attr_0(priv->cbl, attr_position_coord_geo);
} else {
- dbg(lvl_debug, "Got invalid coordinate\n");
+ dbg(lvl_debug, "Got invalid coordinate");
priv->have_coords = 0;
callback_list_call_attr_0(priv->cbl, attr_position_coord_geo);
}
@@ -142,7 +142,7 @@ void QNavitGeoReceiver::positionUpdated(const QGeoPositionInfo& info)
static void
vehicle_qt5_destroy(struct vehicle_priv* priv)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
if (priv->receiver != NULL)
delete priv->receiver;
if (priv->source != NULL)
@@ -163,7 +163,7 @@ vehicle_qt5_position_attr_get(struct vehicle_priv* priv,
enum attr_type type, struct attr* attr)
{
struct attr* active = NULL;
- dbg(lvl_debug, "enter %s\n", attr_to_name(type));
+ dbg(lvl_debug, "enter %s", attr_to_name(type));
switch (type) {
case attr_position_valid:
attr->u.num = priv->have_coords;
@@ -205,9 +205,9 @@ vehicle_qt5_position_attr_get(struct vehicle_priv* priv,
priv->fix_time = 0;
return 0;
}
- //dbg(lvl_debug,"Fix Time: %s\n", priv->fixiso8601);
+ //dbg(lvl_debug,"Fix Time: %s", priv->fixiso8601);
} else {
- //dbg(lvl_debug,"Fix Time: 0\n");
+ //dbg(lvl_debug,"Fix Time: 0");
return 0;
}
break;
@@ -224,7 +224,7 @@ vehicle_qt5_position_attr_get(struct vehicle_priv* priv,
default:
return 0;
}
- dbg(lvl_debug, "ok\n");
+ dbg(lvl_debug, "ok");
attr->type = type;
return 1;
}
@@ -271,7 +271,7 @@ vehicle_qt5_new_qt5(struct vehicle_methods* meth,
{
struct vehicle_priv* ret;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
ret = g_new0(struct vehicle_priv, 1);
ret->cbl = cbl;
*meth = vehicle_null_methods;
@@ -279,16 +279,16 @@ vehicle_qt5_new_qt5(struct vehicle_methods* meth,
ret->source = QGeoPositionInfoSource::createDefaultSource(NULL);
ret->satellites = QGeoSatelliteInfoSource::createDefaultSource(NULL);
if (ret->source == NULL) {
- dbg(lvl_error, "Got NO QGeoPositionInfoSource\n");
+ dbg(lvl_error, "Got NO QGeoPositionInfoSource");
} else {
- dbg(lvl_debug, "Using %s\n", ret->source->sourceName().toLatin1().data());
+ dbg(lvl_debug, "Using %s", ret->source->sourceName().toLatin1().data());
ret->receiver = new QNavitGeoReceiver(NULL, ret);
ret->satellites->setUpdateInterval(1000);
ret->satellites->startUpdates();
ret->source->setUpdateInterval(500);
ret->source->startUpdates();
}
- dbg(lvl_debug, "return\n");
+ dbg(lvl_debug, "return");
return ret;
}
@@ -299,6 +299,6 @@ vehicle_qt5_new_qt5(struct vehicle_methods* meth,
*/
void plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("qt5", vehicle_qt5_new_qt5);
}
diff --git a/navit/vehicle/webos/bluetooth.c b/navit/vehicle/webos/bluetooth.c
index 343d2ec5c..906a42b07 100644
--- a/navit/vehicle/webos/bluetooth.c
+++ b/navit/vehicle/webos/bluetooth.c
@@ -25,10 +25,10 @@ static void
mlPDL_ServiceCall_callback(struct callback_list *cbl, char *service, char *parameters/*, struct callback *fail_cb*/)
{
PDL_Err err;
- dbg(lvl_debug,"PDL_ServiceCall(%s) parameters(%s)\n",service,parameters);
+ dbg(lvl_debug,"PDL_ServiceCall(%s) parameters(%s)",service,parameters);
err = PDL_ServiceCall(service, parameters);
if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_ServiceCall to (%s) with (%s) failed with (%d): (%s)\n", service, parameters, err, PDL_GetError());
+ dbg(lvl_error,"PDL_ServiceCall to (%s) with (%s) failed with (%d): (%s)", service, parameters, err, PDL_GetError());
}
callback_list_destroy(cbl);
@@ -50,7 +50,7 @@ mlPDL_ServiceCall(const char *service, const char *parameters/*, struct callback
callback_list_add(cbl, cb);
-dbg(lvl_debug,"event_call_callback(%p)\n",cbl);
+dbg(lvl_debug,"event_call_callback(%p)",cbl);
event_call_callback(cbl);
}
@@ -65,10 +65,10 @@ mlPDL_ServiceCallWithCallback_callback(struct callback_list *cbl,
PDL_bool removeAfterResponse)
{
PDL_Err err;
- dbg(lvl_debug,"PDL_ServiceCallWithCallback(%s) parameters(%s)\n",service,parameters);
+ dbg(lvl_debug,"PDL_ServiceCallWithCallback(%s) parameters(%s)",service,parameters);
err = PDL_ServiceCallWithCallback(service, parameters, callback, user, removeAfterResponse);
if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_ServiceCallWithCallback to (%s) with (%s) failed with (%d): (%s)\n", service, parameters, err, PDL_GetError());
+ dbg(lvl_error,"PDL_ServiceCallWithCallback to (%s) with (%s) failed with (%d): (%s)", service, parameters, err, PDL_GetError());
}
callback_list_destroy(cbl);
@@ -94,7 +94,7 @@ mlPDL_ServiceCallWithCallback(const char *service,
callback_list_add(cbl, cb);
- dbg(lvl_debug,"event_call_callback(%p)\n",cbl);
+ dbg(lvl_debug,"event_call_callback(%p)",cbl);
event_call_callback(cbl);
}
@@ -107,11 +107,11 @@ vehicle_webos_init_pdl_locationtracking_callback(struct vehicle_priv *priv, stru
priv->gps_type = param ? GPS_TYPE_INT: GPS_TYPE_NONE;
- dbg(lvl_debug,"Calling PDL_EnableLocationTracking(%i)\n",param);
+ dbg(lvl_debug,"Calling PDL_EnableLocationTracking(%i)",param);
err = PDL_EnableLocationTracking(param);
if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_EnableLocationTracking failed with (%d): (%s)\n", err, PDL_GetError());
+ dbg(lvl_error,"PDL_EnableLocationTracking failed with (%d): (%s)", err, PDL_GetError());
// vehicle_webos_close(priv);
// return 0;
}
@@ -146,10 +146,10 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer)
int valid=0;
int ret = 0;
- dbg(lvl_info, "enter: buffer='%s'\n", buffer);
+ dbg(lvl_info, "enter: buffer='%s'", buffer);
for (;;) {
if (len < 4) {
- dbg(lvl_error, "'%s' too short\n", buffer);
+ dbg(lvl_error, "'%s' too short", buffer);
return ret;
}
if (buffer[len - 1] == '\r' || buffer[len - 1] == '\n') {
@@ -160,22 +160,22 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer)
break;
}
if (buffer[0] != '$') {
- dbg(lvl_error, "no leading $ in '%s'\n", buffer);
+ dbg(lvl_error, "no leading $ in '%s'", buffer);
return ret;
}
if (buffer[len - 3] != '*') {
- dbg(lvl_error, "no *XX in '%s'\n", buffer);
+ dbg(lvl_error, "no *XX in '%s'", buffer);
return ret;
}
for (i = 1; i < len - 3; i++) {
csum ^= (unsigned char) (buffer[i]);
}
if (!sscanf(buffer + len - 2, "%x", &bcsum) /*&& priv->checksum_ignore != 2*/) {
- dbg(lvl_error, "no checksum in '%s'\n", buffer);
+ dbg(lvl_error, "no checksum in '%s'", buffer);
return ret;
}
if (bcsum != csum /*&& priv->checksum_ignore == 0*/) {
- dbg(lvl_error, "wrong checksum in '%s was %x should be %x'\n", buffer,bcsum,csum);
+ dbg(lvl_error, "wrong checksum in '%s was %x should be %x'", buffer,bcsum,csum);
return ret;
}
@@ -184,7 +184,7 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer)
g_free(priv->nmea_data_buf);
priv->nmea_data_buf=nmea_data_buf;
} else {
- dbg(lvl_error, "nmea buffer overflow, discarding '%s'\n", buffer);
+ dbg(lvl_error, "nmea buffer overflow, discarding '%s'", buffer);
}
i = 0;
p = buffer;
@@ -203,7 +203,7 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer)
priv->delta = 0; // (unsigned int)difftime(tv.tv_sec, priv->fix_time);
// priv->fix_time = tv.tv_sec;
-// dbg(lvl_info,"delta(%i)\n",priv->delta);
+// dbg(lvl_info,"delta(%i)",priv->delta);
// }
if (!strncmp(&buffer[3], "GGA", 3)) {
@@ -230,7 +230,7 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer)
if (!g_strcasecmp(item[5],"W"))
priv->geo.lng=-priv->geo.lng;
priv->valid=attr_position_valid_valid;
- dbg(lvl_info, "latitude '%2.4f' longitude %2.4f\n", priv->geo.lat, priv->geo.lng);
+ dbg(lvl_info, "latitude '%2.4f' longitude %2.4f", priv->geo.lat, priv->geo.lng);
} else
priv->valid=attr_position_valid_invalid;
@@ -252,14 +252,6 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer)
g_free(priv->nmea_data);
priv->nmea_data=priv->nmea_data_buf;
priv->nmea_data_buf=NULL;
-#if 0
- if (priv->file_type == file_type_file) {
- if (priv->watch) {
- vehicle_file_disable_watch(priv);
- event_add_timeout(priv->time, 0, priv->cbt);
- }
- }
-#endif
ret = 1;
}
if (!strncmp(&buffer[3], "VTG", 3)) {
@@ -275,7 +267,7 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer)
if (valid) {
priv->track = g_ascii_strtod( item[1], NULL );
priv->speed = g_ascii_strtod( item[7], NULL );
- dbg(lvl_info,"direction %lf, speed %2.1lf\n", priv->track, priv->speed);
+ dbg(lvl_info,"direction %lf, speed %2.1lf", priv->track, priv->speed);
}
}
if (!strncmp(&buffer[3], "RMC", 3)) {
@@ -302,13 +294,6 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer)
strptime(time,"%H%M%S%d%m%y",&tm);
priv->fix_time = mktime(&tm);
-#if 0
- sscanf(item[9], "%02d%02d%02d",
- &priv->fixday,
- &priv->fixmonth,
- &priv->fixyear);
- priv->fixyear += 2000;
-#endif
}
ret = 1;
}
@@ -329,46 +314,7 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer)
if (item[3]) {
sscanf(item[3], "%d", &priv->sats_visible);
}
-#if 0
- j=4;
- while (j+4 <= i && priv->current_count < 24) {
- struct gps_sat *sat=&priv->next[priv->next_count++];
- sat->prn=atoi(item[j]);
- sat->elevation=atoi(item[j+1]);
- sat->azimuth=atoi(item[j+2]);
- sat->snr=atoi(item[j+3]);
- j+=4;
- }
- if (!strcmp(item[1], item[2])) {
- priv->sats_signal=0;
- for (i = 0 ; i < priv->next_count ; i++) {
- priv->current[i]=priv->next[i];
- if (priv->current[i].snr)
- priv->sats_signal++;
- }
- priv->current_count=priv->next_count;
- priv->next_count=0;
- }
-#endif
- }
-#if 0
- if (!strncmp(&buffer[3], "ZDA", 3)) {
- /*
- 0 1 2 3 4 5 6
- $GPZDA,hhmmss.ss,dd,mm,yyyy,xx,yy*CC
- hhmmss HrMinSec(UTC)
- dd,mm,yyy Day,Month,Year
- xx local zone hours -13..13
- yy local zone minutes 0..59
- */
- if (item[1] && item[2] && item[3] && item[4]) {
- strncpy(priv->fixtime, item[1], strlen(priv->fixtime));
- priv->fixday = atoi(item[2]);
- priv->fixmonth = atoi(item[3]);
- priv->fixyear = atoi(item[4]);
- }
}
-#endif
if (!strncmp(buffer, "$IISMD", 6)) {
/*
0 1 2 3 4
@@ -380,7 +326,7 @@ vehicle_webos_parse_nmea(struct vehicle_priv *priv, char *buffer)
*/
if (item[1]) {
priv->magnetic_direction = g_ascii_strtod( item[1], NULL );
- dbg(lvl_debug,"magnetic %d\n", priv->magnetic_direction);
+ dbg(lvl_debug,"magnetic %d", priv->magnetic_direction);
}
}
return ret;
@@ -396,14 +342,14 @@ vehicle_webos_spp_handle_read(PDL_ServiceParameters *params, void *user)
//PDL_Err err;
size = PDL_GetParamInt(params, "dataLength");
if (size > buffer_size) {
- dbg(lvl_error, "read returned too much data\n");
+ dbg(lvl_error, "read returned too much data");
return;
}
char buffer[buffer_size];
PDL_GetParamString(params,"data",buffer,buffer_size);
- dbg(lvl_debug,"data(%s) dataLength(%i)\n",buffer,size);
+ dbg(lvl_debug,"data(%s) dataLength(%i)",buffer,size);
memmove(priv->buffer + priv->buffer_pos, buffer, size);
@@ -411,12 +357,12 @@ vehicle_webos_spp_handle_read(PDL_ServiceParameters *params, void *user)
priv->buffer_pos += size;
priv->buffer[priv->buffer_pos] = '\0';
- dbg(lvl_debug, "size=%d pos=%d buffer='%s'\n", size,
+ dbg(lvl_debug, "size=%d pos=%d buffer='%s'", size,
priv->buffer_pos, priv->buffer);
str = priv->buffer;
while ((tok = strchr(str, '\n'))) {
*tok++ = '\0';
- dbg(lvl_debug, "line='%s'\n", str);
+ dbg(lvl_debug, "line='%s'", str);
rc += vehicle_webos_parse_nmea(priv, str);
str = tok;
// if (priv->file_type == file_type_file && rc)
@@ -427,10 +373,10 @@ vehicle_webos_spp_handle_read(PDL_ServiceParameters *params, void *user)
size = priv->buffer + priv->buffer_pos - str;
memmove(priv->buffer, str, size + 1);
priv->buffer_pos = size;
- dbg(lvl_debug,"now pos=%d buffer='%s'\n",
+ dbg(lvl_debug,"now pos=%d buffer='%s'",
priv->buffer_pos, priv->buffer);
} else if (priv->buffer_pos == buffer_size - 1) {
- dbg(lvl_error,"Overflow. Most likely wrong baud rate or no nmea protocol\n");
+ dbg(lvl_error,"Overflow. Most likely wrong baud rate or no nmea protocol");
priv->buffer_pos = 0;
}
if (rc) {
@@ -464,13 +410,6 @@ vehicle_webos_spp_init_read(struct vehicle_priv *priv, unsigned int length)
priv,
PDL_FALSE
);
-#if 0
- if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_ServiceCall failed with (%d): (%s)\n", err, PDL_GetError());
- vehicle_webos_close(priv);
- return;
- }
-#endif
}
static void
@@ -481,7 +420,7 @@ vehicle_webos_spp_handle_open(PDL_ServiceParameters *params, void *user)
if (!priv->buffer)
priv->buffer = g_malloc(buffer_size);
- dbg(lvl_debug,"instanceId(%i)\n",priv->spp_instance_id);
+ dbg(lvl_debug,"instanceId(%i)",priv->spp_instance_id);
priv->gps_type = GPS_TYPE_BT;
@@ -497,27 +436,27 @@ vehicle_webos_spp_notify(PDL_ServiceParameters *params, void *user)
char parameters[128];
const char *params_json = PDL_GetParamJson(params);
- dbg(lvl_info,"params_json(%s)\n", params_json);
+ dbg(lvl_info,"params_json(%s)", params_json);
if (PDL_ParamExists(params, "errorText")) {
PDL_GetParamString(params, "errorText", notification, sizeof(notification));
- dbg(lvl_error,"errorText(%s)\n",notification);
+ dbg(lvl_error,"errorText(%s)",notification);
return;
}
PDL_GetParamString(params, "notification", notification, sizeof(notification));
notification[sizeof(notification)-1] = '\0';
- dbg(lvl_warning,"notification(%s) %i\n",notification,PDL_ParamExists(params, "notification"));
+ dbg(lvl_warning,"notification(%s) %i",notification,PDL_ParamExists(params, "notification"));
if(strcmp(notification,"notifnservicenames") == 0) {
int instance_id = PDL_GetParamInt(params, "instanceId");
- dbg(lvl_debug,"instanceId(%i)\n", instance_id);
+ dbg(lvl_debug,"instanceId(%i)", instance_id);
cJSON *root = cJSON_Parse(params_json);
if (!root) {
- dbg(lvl_error,"parsing json failed\n");
+ dbg(lvl_error,"parsing json failed");
return;
}
@@ -544,7 +483,7 @@ vehicle_webos_spp_notify(PDL_ServiceParameters *params, void *user)
PDL_TRUE);
}
else {
- dbg(lvl_error,"notifnconnected error(%i)\n",PDL_GetParamInt(params,"error"));
+ dbg(lvl_error,"notifnconnected error(%i)",PDL_GetParamInt(params,"error"));
}
}
else if(strcmp(notification,"notifndisconnected") == 0) {
@@ -563,29 +502,15 @@ vehicle_webos_init_bt_gps(struct vehicle_priv *priv, char *addr)
{
char parameters[128];
- dbg(lvl_debug,"subscribeNotifications\n");
+ dbg(lvl_debug,"subscribeNotifications");
mlPDL_ServiceCallWithCallback("palm://com.palm.bluetooth/spp/subscribenotifications",
"{\"subscribe\":true}",
(PDL_ServiceCallbackFunc)vehicle_webos_spp_notify,
priv,
PDL_FALSE);
-#if 0
- if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_ServiceCallWithCallback failed with (%d): (%s)\n", err, PDL_GetError());
- vehicle_webos_close(priv);
- return;
- }
-#endif
snprintf(parameters, sizeof(parameters), "{\"address\":\"%s\"}", addr);
mlPDL_ServiceCall("palm://com.palm.bluetooth/spp/connect", parameters);
-#if 0
- if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_ServiceCall failed with (%d): (%s)\n", err, PDL_GetError());
- vehicle_webos_close(priv);
- return;
- }
-#endif
priv->spp_address = addr;
}
@@ -598,38 +523,38 @@ vehicle_webos_bt_gap_callback(PDL_ServiceParameters *params, void *param)
char *device_addr = NULL;
cJSON *root;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
PDL_Err err;
err = PDL_GetParamInt(params, "errorCode");
if (err != PDL_NOERROR) {
- dbg(lvl_error,"BT GAP Callback errorCode %d\n", err);
+ dbg(lvl_error,"BT GAP Callback errorCode %d", err);
return /*PDL_EOTHER*/;
}
params_json = PDL_GetParamJson(params);
- dbg(lvl_info,"params_json(%s)\n",params_json);
+ dbg(lvl_info,"params_json(%s)",params_json);
root = cJSON_Parse(params_json);
if (!root) {
- dbg(lvl_error,"parsing json failed\n");
+ dbg(lvl_error,"parsing json failed");
return;
}
cJSON *trusted_devices = cJSON_GetObjectItem(root, "trusteddevices");
unsigned int i,c = cJSON_GetArraySize(trusted_devices);
- dbg(lvl_debug, "trusted_devices(%i)\n",c);
+ dbg(lvl_debug, "trusted_devices(%i)",c);
for(i=0; i < c && !device_addr; i++) {
cJSON *device = cJSON_GetArrayItem(trusted_devices,i);
char *name = cJSON_GetObjectItem(device, "name")->valuestring;
char *address = cJSON_GetObjectItem(device, "address")->valuestring;
char *status = cJSON_GetObjectItem(device, "status")->valuestring;
- dbg(lvl_debug,"i(%i) name(%s) address(%s) status(%s)\n",i,name,address,status);
+ dbg(lvl_debug,"i(%i) name(%s) address(%s) status(%s)",i,name,address,status);
if (/*strncmp(status, "connected",9) == 0 && */strstr(name, "GPS") != NULL) {
- dbg(lvl_debug,"choose name(%s) address(%s)\n",name,address);
+ dbg(lvl_debug,"choose name(%s) address(%s)",name,address);
device_addr = g_strdup(address);
break;
}
@@ -649,7 +574,7 @@ vehicle_webos_bt_open(struct vehicle_priv *priv)
{
// Try to connect to BT GPS, or use PDL method
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
PDL_Err err;
err = PDL_ServiceCallWithCallback("palm://com.palm.bluetooth/gap/gettrusteddevices",
@@ -658,7 +583,7 @@ vehicle_webos_bt_open(struct vehicle_priv *priv)
priv,
PDL_TRUE);
if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_ServiceCallWithCallback failed with (%d): (%s)\n", err, PDL_GetError());
+ dbg(lvl_error,"PDL_ServiceCallWithCallback failed with (%d): (%s)", err, PDL_GetError());
vehicle_webos_close(priv);
return 0;
}
@@ -668,7 +593,7 @@ vehicle_webos_bt_open(struct vehicle_priv *priv)
void
vehicle_webos_bt_close(struct vehicle_priv *priv)
{
- dbg(lvl_debug,"XXX\n");
+ dbg(lvl_debug,"XXX");
char parameters[128];
if (priv->spp_instance_id) {
snprintf(parameters, sizeof(parameters), "{\"instanceId\":%i}", priv->spp_instance_id);
diff --git a/navit/vehicle/webos/vehicle_webos.c b/navit/vehicle/webos/vehicle_webos.c
index c4bdcbaf2..8ba477305 100644
--- a/navit/vehicle/webos/vehicle_webos.c
+++ b/navit/vehicle/webos/vehicle_webos.c
@@ -59,7 +59,7 @@ vehicle_webos_callback(PDL_ServiceParameters *params, void *priv)
err = PDL_GetParamInt(params, "errorCode");
if (err != 0) {
- dbg(lvl_error,"Location Callback errorCode %d\n", err);
+ dbg(lvl_error,"Location Callback errorCode %d", err);
return /*PDL_EOTHER*/;
}
@@ -93,14 +93,14 @@ vehicle_webos_gps_update(struct vehicle_priv *priv, PDL_Location *location)
gettimeofday(&tv,NULL);
priv->delta = (int)difftime(tv.tv_sec, priv->fix_time);
- dbg(lvl_info,"delta(%i)\n",priv->delta);
+ dbg(lvl_info,"delta(%i)",priv->delta);
priv->fix_time = tv.tv_sec;
priv->geo.lat = location->latitude;
/* workaround for webOS GPS bug following */
priv->geo.lng = (priv->pdk_version >= 200 && location->longitude >= -1 && location->longitude <= 1) ?
-location->longitude : location->longitude;
- dbg(lvl_info,"Location: %f %f %f %.12g %.12g +-%fm\n",
+ dbg(lvl_info,"Location: %f %f %f %.12g %.12g +-%fm",
location->altitude,
location->velocity,
location->heading,
@@ -134,7 +134,7 @@ vehicle_webos_timeout_callback(struct vehicle_priv *priv)
int delta = (int)difftime(tv.tv_sec, priv->fix_time);
if (delta >= priv->delta*2) {
- dbg(lvl_warning, "GPS timeout triggered cb(%p) delta(%d)\n", priv->timeout_cb, delta);
+ dbg(lvl_warning, "GPS timeout triggered cb(%p) delta(%d)", priv->timeout_cb, delta);
priv->delta = -1;
@@ -165,7 +165,7 @@ vehicle_webos_open(struct vehicle_priv *priv)
PDL_Err err;
priv->pdk_version = PDL_GetPDKVersion();
- dbg(lvl_debug,"pdk_version(%d)\n", priv->pdk_version);
+ dbg(lvl_debug,"pdk_version(%d)", priv->pdk_version);
if (priv->pdk_version <= 100) {
// Use Location Service via callback interface
@@ -175,7 +175,7 @@ vehicle_webos_open(struct vehicle_priv *priv)
priv,
PDL_FALSE);
if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_ServiceCallWithCallback failed with (%d): (%s)\n", err, PDL_GetError());
+ dbg(lvl_error,"PDL_ServiceCallWithCallback failed with (%d): (%s)", err, PDL_GetError());
vehicle_webos_close(priv);
return 0;
}
@@ -184,7 +184,7 @@ vehicle_webos_open(struct vehicle_priv *priv)
PDL_Err err;
err = PDL_EnableLocationTracking(PDL_TRUE);
if (err != PDL_NOERROR) {
- dbg(lvl_error,"PDL_EnableLocationTracking failed with (%d): (%s)\n", err, PDL_GetError());
+ dbg(lvl_error,"PDL_EnableLocationTracking failed with (%d): (%s)", err, PDL_GetError());
// vehicle_webos_close(priv);
// return 0;
}
@@ -214,15 +214,15 @@ vehicle_webos_position_attr_get(struct vehicle_priv *priv,
{
switch (type) {
case attr_position_height:
- dbg(lvl_info,"Altitude: %f\n", priv->altitude);
+ dbg(lvl_info,"Altitude: %f", priv->altitude);
attr->u.numd = &priv->altitude;
break;
case attr_position_speed:
- dbg(lvl_info,"Speed: %f\n", priv->speed);
+ dbg(lvl_info,"Speed: %f", priv->speed);
attr->u.numd = &priv->speed;
break;
case attr_position_direction:
- dbg(lvl_info,"Direction: %f\n", priv->track);
+ dbg(lvl_info,"Direction: %f", priv->track);
attr->u.numd = &priv->track;
break;
case attr_position_magnetic_direction:
@@ -246,11 +246,11 @@ vehicle_webos_position_attr_get(struct vehicle_priv *priv,
}
break;
case attr_position_coord_geo:
- dbg(lvl_info,"Coord: %.12g %.12g\n", priv->geo.lat, priv->geo.lng);
+ dbg(lvl_info,"Coord: %.12g %.12g", priv->geo.lat, priv->geo.lng);
attr->u.coord_geo = &priv->geo;
break;
case attr_position_radius:
- dbg(lvl_info,"Radius: %f\n", priv->radius);
+ dbg(lvl_info,"Radius: %f", priv->radius);
attr->u.numd = &priv->radius;
break;
case attr_position_time_iso8601:
@@ -265,10 +265,10 @@ vehicle_webos_position_attr_get(struct vehicle_priv *priv,
priv->fix_time = 0;
return 0;
}
- dbg(lvl_info,"Fix Time: %d %s\n", priv->fix_time, priv->fixiso8601);
+ dbg(lvl_info,"Fix Time: %d %s", priv->fix_time, priv->fixiso8601);
}
else {
- dbg(lvl_info,"Fix Time: %d\n", priv->fix_time);
+ dbg(lvl_info,"Fix Time: %d", priv->fix_time);
return 0;
}
@@ -326,7 +326,7 @@ vehicle_webos_set_attr_do(struct vehicle_priv *priv, struct attr *attr, int init
switch (attr->type) {
case attr_source:
if (strncmp(vehicle_webos_prefix,attr->u.str,strlen(vehicle_webos_prefix))) {
- dbg(lvl_warning,"source must start with '%s'\n", vehicle_webos_prefix);
+ dbg(lvl_warning,"source must start with '%s'", vehicle_webos_prefix);
return 0;
}
g_free(priv->source);
@@ -388,7 +388,7 @@ vehicle_webos_new(struct vehicle_methods
void
plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("webos", vehicle_webos_new);
}
diff --git a/navit/vehicle/wince/vehicle_wince.c b/navit/vehicle/wince/vehicle_wince.c
index 49f90b1f5..8ab59fdce 100644
--- a/navit/vehicle/wince/vehicle_wince.c
+++ b/navit/vehicle/wince/vehicle_wince.c
@@ -156,7 +156,7 @@ static void initBth(struct vehicle_priv *priv)
priv->BthSetMode = (PFN_BthSetMode)GetProcAddress(priv->hBthDll, TEXT("BthSetMode") );
if( priv->BthSetMode && priv->BthSetMode(1) == ERROR_SUCCESS )
{
- dbg(lvl_debug, "bluetooth activated\n");
+ dbg(lvl_debug, "bluetooth activated");
succeeded = TRUE;
}
}
@@ -164,13 +164,13 @@ static void initBth(struct vehicle_priv *priv)
}
else
{
- dbg(lvl_error, "Bluetooth library notfound\n");
+ dbg(lvl_error, "Bluetooth library notfound");
}
if ( !succeeded )
{
- dbg(lvl_warning, "Bluetooth already enabled or failed to enable it.\n");
+ dbg(lvl_warning, "Bluetooth already enabled or failed to enable it.");
priv->BthSetMode = NULL;
if ( priv->hBthDll )
{
@@ -188,7 +188,7 @@ static int initDevice(struct vehicle_priv *priv)
if ( priv->file_type == file_type_device )
{
- dbg(lvl_debug, "Init Device\n");
+ dbg(lvl_debug, "Init Device");
/* GPD0 is the control port for the GPS driver */
hGPS = CreateFile(L"GPD0:", GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (hGPS != INVALID_HANDLE_VALUE) {
@@ -209,7 +209,7 @@ static int initDevice(struct vehicle_priv *priv)
NULL, OPEN_EXISTING, 0, 0)) == INVALID_HANDLE_VALUE)
{
Sleep(1000);
- dbg(lvl_debug, "Waiting to connect to %s\n", priv->source);
+ dbg(lvl_debug, "Waiting to connect to %s", priv->source);
}
GetCommTimeouts (priv->m_hGPSDevice, &commTiming);
commTiming.ReadIntervalTimeout = 20;
@@ -240,11 +240,11 @@ static int initDevice(struct vehicle_priv *priv)
}
else
{
- dbg(lvl_debug, "Open File\n");
+ dbg(lvl_debug, "Open File");
priv->m_hGPSDevice = CreateFileW( A2W(priv->source),
GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, 0);
if ( priv->m_hGPSDevice == INVALID_HANDLE_VALUE) {
- dbg(lvl_error, "Could not open %s\n", priv->source);
+ dbg(lvl_error, "Could not open %s", priv->source);
return 0;
}
}
@@ -274,7 +274,7 @@ static DWORD WINAPI wince_reader_thread (LPVOID lParam)
DWORD bytes_read;
int waitcounter;
- dbg(lvl_debug, "GPS Port:[%s]\n", priv->source);
+ dbg(lvl_debug, "GPS Port:[%s]", priv->source);
priv->thread_up = 1;
if ( !initDevice(priv) ) {
@@ -282,7 +282,7 @@ static DWORD WINAPI wince_reader_thread (LPVOID lParam)
}
while (priv->is_running)
{
- dbg(lvl_debug,"readfile\n");
+ dbg(lvl_debug,"readfile");
waitcounter = 0;
status = ReadFile(priv->m_hGPSDevice,
chunk_buffer, sizeof(chunk_buffer),
@@ -290,7 +290,7 @@ static DWORD WINAPI wince_reader_thread (LPVOID lParam)
if ( !status )
{
- dbg(lvl_error,"Error reading file/device. Try again.\n");
+ dbg(lvl_error,"Error reading file/device. Try again.");
initDevice(priv);
continue;
}
@@ -300,24 +300,24 @@ static DWORD WINAPI wince_reader_thread (LPVOID lParam)
/* TODO (rikky#1#): should use blocking */
if ( priv->file_type != file_type_file )
{
- dbg(lvl_debug, "GPS data comes too fast. Have to wait here\n");
+ dbg(lvl_debug, "GPS data comes too fast. Have to wait here");
}
Sleep(50);
waitcounter++;
if ( waitcounter % 8 == 0 )
{
- dbg(lvl_debug, "Remind them of the data\n");
+ dbg(lvl_debug, "Remind them of the data");
event_call_callback(priv->priv_cbl);
}
if(waitcounter % 200 == 0) {
- dbg(lvl_error,"Will main thread ever be ready for the GPS data? Already %d intervals gone.\n",waitcounter);
+ dbg(lvl_error,"Will main thread ever be ready for the GPS data? Already %d intervals gone.",waitcounter);
}
}
if(waitcounter>2)
- dbg(lvl_debug,"Sent GPS data to the main thread after %d intervals delay.\n",waitcounter);
+ dbg(lvl_debug,"Sent GPS data to the main thread after %d intervals delay.",waitcounter);
g_mutex_lock(&priv->lock);
memcpy(priv->read_buffer + priv->read_buffer_pos , chunk_buffer, bytes_read );
@@ -358,11 +358,11 @@ vehicle_wince_available_ports(void)
regdevtype_length = sizeof(devicetype);
if ( RegQueryValueEx( hkSubResult, L"Key", NULL, NULL, (LPBYTE)devicetype, &regdevtype_length) == ERROR_SUCCESS )
{
- dbg(lvl_debug, "Found device '%s' (%s)\n", W2A(devicename), W2A(devicetype));
+ dbg(lvl_debug, "Found device '%s' (%s)", W2A(devicename), W2A(devicetype));
}
else
{
- dbg(lvl_debug, "Found device '%s'\n", W2A(devicename));
+ dbg(lvl_debug, "Found device '%s'", W2A(devicename));
}
}
RegCloseKey(hkSubResult);
@@ -412,7 +412,7 @@ vehicle_wince_open(struct vehicle_priv *priv)
char* strport;
char* strsettings;
- dbg(lvl_debug, "enter vehicle_wince_open, priv->source='%s'\n", priv->source);
+ dbg(lvl_debug, "enter vehicle_wince_open, priv->source='%s'", priv->source);
if (priv->source ) {
@@ -431,7 +431,7 @@ vehicle_wince_open(struct vehicle_priv *priv)
*strsettings = '\0';
strsettings++;
- dbg(lvl_debug, "serial('%s', '%s')\n", strport, strsettings );
+ dbg(lvl_debug, "serial('%s', '%s')", strport, strsettings );
}
if (raw_setting_str)
g_free( raw_setting_str );
@@ -456,10 +456,10 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer)
int valid=0;
int ret = 0;
- dbg(lvl_info, "enter: buffer='%s'\n", buffer);
+ dbg(lvl_info, "enter: buffer='%s'", buffer);
for (;;) {
if (len < 4) {
- dbg(lvl_error, "'%s' too short\n", buffer);
+ dbg(lvl_error, "'%s' too short", buffer);
return ret;
}
if (buffer[len - 1] == '\r' || buffer[len - 1] == '\n') {
@@ -470,22 +470,22 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer)
break;
}
if (buffer[0] != '$') {
- dbg(lvl_error, "no leading $ in '%s'\n", buffer);
+ dbg(lvl_error, "no leading $ in '%s'", buffer);
return ret;
}
if (buffer[len - 3] != '*') {
- dbg(lvl_error, "no *XX in '%s'\n", buffer);
+ dbg(lvl_error, "no *XX in '%s'", buffer);
return ret;
}
for (i = 1; i < len - 3; i++) {
csum ^= (unsigned char) (buffer[i]);
}
if (!sscanf(buffer + len - 2, "%x", &bcsum) && priv->checksum_ignore != 2) {
- dbg(lvl_error, "no checksum in '%s'\n", buffer);
+ dbg(lvl_error, "no checksum in '%s'", buffer);
return ret;
}
if (bcsum != csum && priv->checksum_ignore == 0) {
- dbg(lvl_error, "wrong checksum in '%s'\n", buffer);
+ dbg(lvl_error, "wrong checksum in '%s'", buffer);
return ret;
}
@@ -494,7 +494,7 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer)
g_free(priv->nmea_data_buf);
priv->nmea_data_buf=nmea_data_buf;
} else {
- dbg(lvl_error, "nmea buffer overflow, discarding '%s'\n", buffer);
+ dbg(lvl_error, "nmea buffer overflow, discarding '%s'", buffer);
}
i = 0;
p = buffer;
@@ -541,7 +541,7 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer)
strncpy(priv->fixtime, item[1], sizeof(priv->fixtime));
}
- dbg(lvl_info, "latitude '%2.4f' longitude %2.4f\n", priv->geo.lat, priv->geo.lng);
+ dbg(lvl_info, "latitude '%2.4f' longitude %2.4f", priv->geo.lat, priv->geo.lng);
} else {
if (priv->valid == attr_position_valid_valid)
@@ -575,7 +575,7 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer)
if (valid) {
priv->direction = g_ascii_strtod( item[1], NULL );
priv->speed = g_ascii_strtod( item[7], NULL );
- dbg(lvl_info,"direction %lf, speed %2.1lf\n", priv->direction, priv->speed);
+ dbg(lvl_info,"direction %lf, speed %2.1lf", priv->direction, priv->speed);
}
}
if (!strncmp(&buffer[3], "RMC", 3)) {
@@ -625,7 +625,7 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer)
strncpy(priv->fixtime, item[1], sizeof(priv->fixtime));
}
- dbg(lvl_info, "latitude '%2.4f' longitude %2.4f\n", priv->geo.lat, priv->geo.lng);
+ dbg(lvl_info, "latitude '%2.4f' longitude %2.4f", priv->geo.lat, priv->geo.lng);
} else {
if (priv->valid == attr_position_valid_valid)
@@ -697,7 +697,7 @@ vehicle_wince_parse(struct vehicle_priv *priv, char *buffer)
*/
if (item[1]) {
priv->magnetic_direction = g_ascii_strtod( item[1], NULL );
- dbg(lvl_debug,"magnetic %d\n", priv->magnetic_direction);
+ dbg(lvl_debug,"magnetic %d", priv->magnetic_direction);
}
}
return ret;
@@ -709,7 +709,7 @@ vehicle_wince_io(struct vehicle_priv *priv)
int size, rc = 0;
char *str, *tok;
- dbg(lvl_debug, "vehicle_file_io : enter\n");
+ dbg(lvl_debug, "vehicle_file_io : enter");
size = read_win32(priv, priv->buffer + priv->buffer_pos, buffer_size - priv->buffer_pos - 1);
@@ -730,12 +730,12 @@ vehicle_wince_io(struct vehicle_priv *priv)
}
priv->buffer_pos += size;
priv->buffer[priv->buffer_pos] = '\0';
- dbg(lvl_debug, "size=%d pos=%d buffer='%s'\n", size,
+ dbg(lvl_debug, "size=%d pos=%d buffer='%s'", size,
priv->buffer_pos, priv->buffer);
str = priv->buffer;
while ((tok = strchr(str, '\n'))) {
*tok++ = '\0';
- dbg(lvl_debug, "line='%s'\n", str);
+ dbg(lvl_debug, "line='%s'", str);
rc +=vehicle_wince_parse(priv, str);
str = tok;
if (priv->file_type == file_type_file && rc)
@@ -746,7 +746,7 @@ vehicle_wince_io(struct vehicle_priv *priv)
size = priv->buffer + priv->buffer_pos - str;
memmove(priv->buffer, str, size + 1);
priv->buffer_pos = size;
- dbg(lvl_info, "now pos=%d buffer='%s'\n",
+ dbg(lvl_info, "now pos=%d buffer='%s'",
priv->buffer_pos, priv->buffer);
} else if (priv->buffer_pos == buffer_size - 1) {
dbg(lvl_error,
@@ -876,7 +876,7 @@ vehicle_wince_position_attr_get(struct vehicle_priv *priv,
attr->u.str=priv->fixiso8601;
break;
case attr_position_sat_item:
- dbg(lvl_debug,"at here\n");
+ dbg(lvl_debug,"at here");
priv->sat_item.id_lo++;
if (priv->sat_item.id_lo > priv->current_count) {
priv->sat_item.id_lo=0;
@@ -967,7 +967,7 @@ vehicle_wince_new(struct vehicle_methods
struct attr *handle_bluetooth;
char *cp;
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
source = attr_search(attrs, NULL, attr_source);
ret = g_new0(struct vehicle_priv, 1);
ret->fd = -1;
@@ -1006,7 +1006,7 @@ vehicle_wince_new(struct vehicle_methods
ret->on_eof=1;
if (on_eof && !g_strcasecmp(on_eof->u.str, "exit"))
ret->on_eof=2;
- dbg(lvl_debug,"on_eof=%d\n", ret->on_eof);
+ dbg(lvl_debug,"on_eof=%d", ret->on_eof);
*meth = vehicle_wince_methods;
ret->priv_cbl = callback_list_new();
callback_list_add(ret->priv_cbl, callback_new_1(callback_cast(vehicle_wince_io), ret));
@@ -1026,7 +1026,7 @@ vehicle_wince_new(struct vehicle_methods
vehicle_wince_enable_watch(ret);
return ret;
}
- dbg(lvl_error, "Failed to open '%s'\n", ret->source);
+ dbg(lvl_error, "Failed to open '%s'", ret->source);
vehicle_wince_destroy(ret);
return NULL;
}
@@ -1037,7 +1037,7 @@ vehicle_wince_new(struct vehicle_methods
void
plugin_init(void)
{
- dbg(lvl_debug, "enter\n");
+ dbg(lvl_debug, "enter");
plugin_register_category_vehicle("wince", vehicle_wince_new);
plugin_register_category_vehicle("file", vehicle_wince_new);
}
diff --git a/navit/vehicleprofile.c b/navit/vehicleprofile.c
index 9da721d26..32723bacc 100644
--- a/navit/vehicleprofile.c
+++ b/navit/vehicleprofile.c
@@ -30,7 +30,7 @@
static void
vehicleprofile_set_attr_do(struct vehicleprofile *this_, struct attr *attr)
{
- dbg(lvl_debug,"%s:%ld\n", attr_to_name(attr->type), attr->u.num);
+ dbg(lvl_debug,"%s:%ld", attr_to_name(attr->type), attr->u.num);
switch (attr->type) {
case attr_flags:
this_->flags=attr->u.num;
@@ -154,7 +154,7 @@ vehicleprofile_apply_roadprofile(struct vehicleprofile *this_, struct navit_obje
struct navit_object *newrp;
struct attr_iter *iter=rp->func->iter_new(NULL);
struct attr attr;
- dbg(lvl_debug,"patching roadprofile\n");
+ dbg(lvl_debug,"patching roadprofile");
newrp=oldrp->func->dup(oldrp);
while (rp->func->get_attr(rp, attr_any, &attr, iter))
newrp->func->set_attr(newrp, &attr);
@@ -177,7 +177,7 @@ vehicleprofile_apply_attrs(struct vehicleprofile *this_, struct navit_object *ob
struct attr attr;
struct attr_iter *iter=obj->func->iter_new(NULL);
while (obj->func->get_attr(obj, attr_any, &attr, iter)) {
- dbg(lvl_debug,"%s\n",attr_to_name(attr.type));
+ dbg(lvl_debug,"%s",attr_to_name(attr.type));
if (attr.type == attr_roadprofile)
vehicleprofile_apply_roadprofile(this_, attr.u.navit_object, is_option);
else if (attr.type != attr_profile_option)
@@ -190,7 +190,7 @@ static void
vehicleprofile_debug_roadprofile(gpointer key, gpointer value, gpointer user_data)
{
struct roadprofile *rp=value;
- dbg(lvl_debug,"type %s avg %d weight %d max %d\n",item_to_name((int)(long)key),rp->speed,rp->route_weight,rp->maxspeed);
+ dbg(lvl_debug,"type %s avg %d weight %d max %d",item_to_name((int)(long)key),rp->speed,rp->route_weight,rp->maxspeed);
}
static void
@@ -198,7 +198,7 @@ vehicleprofile_update(struct vehicleprofile *this_)
{
struct attr_iter *iter=vehicleprofile_attr_iter_new();
struct attr profile_option;
- dbg(lvl_debug,"enter\n");
+ dbg(lvl_debug,"enter");
vehicleprofile_clear(this_);
vehicleprofile_apply_attrs(this_, (struct navit_object *)this_, 0);
while (vehicleprofile_get_attr(this_, attr_profile_option, &profile_option, iter)) {
@@ -206,13 +206,13 @@ vehicleprofile_update(struct vehicleprofile *this_)
if (!profile_option.u.navit_object->func->get_attr(profile_option.u.navit_object, attr_active, &active, NULL))
active.u.num=0;
if (profile_option.u.navit_object->func->get_attr(profile_option.u.navit_object, attr_name, &name, NULL))
- dbg(lvl_debug,"%p %s %ld\n",profile_option.u.navit_object,name.u.str,active.u.num);
+ dbg(lvl_debug,"%p %s %ld",profile_option.u.navit_object,name.u.str,active.u.num);
if (active.u.num)
vehicleprofile_apply_attrs(this_, profile_option.u.navit_object, 1);
}
vehicleprofile_attr_iter_destroy(iter);
- dbg(lvl_debug,"result l %d w %d h %d wg %d awg %d pen %d\n",this_->length,this_->width,this_->height,this_->weight,this_->axle_weight,this_->through_traffic_penalty);
- dbg(lvl_debug,"m %d fwd 0x%x rev 0x%x flags 0x%x max %d stsp %d stdst %d dg %d\n",this_->mode,this_->flags_forward_mask,this_->flags_reverse_mask, this_->flags, this_->maxspeed_handling, this_->static_speed, this_->static_distance, this_->dangerous_goods);
+ dbg(lvl_debug,"result l %d w %d h %d wg %d awg %d pen %d",this_->length,this_->width,this_->height,this_->weight,this_->axle_weight,this_->through_traffic_penalty);
+ dbg(lvl_debug,"m %d fwd 0x%x rev 0x%x flags 0x%x max %d stsp %d stdst %d dg %d",this_->mode,this_->flags_forward_mask,this_->flags_reverse_mask, this_->flags, this_->maxspeed_handling, this_->static_speed, this_->static_distance, this_->dangerous_goods);
g_hash_table_foreach(this_->roadprofile_hash, vehicleprofile_debug_roadprofile, NULL);
}
diff --git a/navit/xmlconfig.c b/navit/xmlconfig.c
index 36f7965cc..56df4c7fa 100644
--- a/navit/xmlconfig.c
+++ b/navit/xmlconfig.c
@@ -118,7 +118,7 @@ static struct attr ** convert_to_attrs(struct xmlstate *state, struct attr_fixme
if (! strcmp(name, attr_fixme[0])) {
name=attr_fixme[1];
if (fixme_count++ < 10)
- dbg(lvl_error,"Please change attribute '%s' to '%s' in <%s />\n", attr_fixme[0], attr_fixme[1], fixme->element);
+ dbg(lvl_error,"Please change attribute '%s' to '%s' in <%s />", attr_fixme[0], attr_fixme[1], fixme->element);
break;
}
attr_fixme+=2;
@@ -128,12 +128,12 @@ static struct attr ** convert_to_attrs(struct xmlstate *state, struct attr_fixme
if (ret[count])
count++;
else if (strcmp(*attribute_name,"enabled") && strcmp(*attribute_name,"xmlns:xi"))
- dbg(lvl_error,"failed to create attribute '%s' with value '%s'\n", *attribute_name,*attribute_value);
+ dbg(lvl_error,"failed to create attribute '%s' with value '%s'", *attribute_name,*attribute_value);
attribute_name++;
attribute_value++;
}
ret[count]=NULL;
- dbg(lvl_debug,"ret=%p\n", ret);
+ dbg(lvl_debug,"ret=%p", ret);
return ret;
}
@@ -209,7 +209,7 @@ xmlconfig_announce(struct xmlstate *state)
if (itype!=type_none) {
navigation_set_announce(state->parent->element_attr.u.data, itype, level);
} else {
- dbg(lvl_error, "Invalid type for announcement: %s\n",tok);
+ dbg(lvl_error, "Invalid type for announcement: %s",tok);
}
str=NULL;
}
@@ -586,7 +586,7 @@ start_element(xml_context *context,
const char *parent_name=NULL;
char *s,*sep="",*possible_parents;
struct attr *parent_attr;
- dbg(lvl_info,"name='%s' parent='%s'\n", element_name, *parent ? (*parent)->element:NULL);
+ dbg(lvl_info,"name='%s' parent='%s'", element_name, *parent ? (*parent)->element:NULL);
if (!strcmp(element_name,"xml"))
return;
@@ -604,7 +604,7 @@ start_element(xml_context *context,
if (!strcmp(element_name,element_fixme[0])) {
element_name=element_fixme[1];
if (fixme_count++ < 10)
- dbg(lvl_error,"Please change <%s /> to <%s /> in config file\n", element_fixme[0], element_fixme[1]);
+ dbg(lvl_error,"Please change <%s /> to <%s /> in config file", element_fixme[0], element_fixme[1]);
}
element_fixme+=2;
}
@@ -676,7 +676,7 @@ start_element(xml_context *context,
return;
new->element_attr.type=attr_from_name(element_name);
if (new->element_attr.type == attr_none)
- dbg(lvl_error,"failed to create object of type '%s'\n", element_name);
+ dbg(lvl_error,"failed to create object of type '%s'", element_name);
if (new->element_attr.type == attr_tracking)
new->element_attr.type=attr_trackingo;
if (new->parent && new->parent->object_func && new->parent->object_func->add_attr)
@@ -697,7 +697,7 @@ end_element (xml_context *context,
if (!strcmp(element_name,"xml"))
return;
- dbg(lvl_info,"name='%s'\n", element_name);
+ dbg(lvl_info,"name='%s'", element_name);
curr=*state;
if (curr->object_func && curr->object_func->init)
curr->object_func->init(curr->element_attr.u.data);
@@ -752,27 +752,27 @@ xinclude(xml_context *context, const gchar **attribute_names, const gchar **attr
doc_new.level=doc_old->level+1;
doc_new.user_data=doc_old->user_data;
if (! href) {
- dbg(lvl_debug,"no href, using '%s'\n", doc_old->href);
+ dbg(lvl_debug,"no href, using '%s'", doc_old->href);
doc_new.href=doc_old->href;
if (file_exists(doc_new.href)) {
parse_file(&doc_new, error);
} else {
- dbg(lvl_error,"Unable to include %s\n",doc_new.href);
+ dbg(lvl_error,"Unable to include %s",doc_new.href);
}
} else {
- dbg(lvl_debug,"expanding '%s'\n", href);
+ dbg(lvl_debug,"expanding '%s'", href);
we=file_wordexp_new(href);
we_files=file_wordexp_get_array(we);
count=file_wordexp_get_count(we);
- dbg(lvl_debug,"%d results\n", count);
+ dbg(lvl_debug,"%d results", count);
if (file_exists(we_files[0])) {
for (i = 0 ; i < count ; i++) {
- dbg(lvl_debug,"result[%d]='%s'\n", i, we_files[i]);
+ dbg(lvl_debug,"result[%d]='%s'", i, we_files[i]);
doc_new.href=we_files[i];
parse_file(&doc_new, error);
}
} else {
- dbg(lvl_error,"Unable to include %s\n",we_files[0]);
+ dbg(lvl_error,"Unable to include %s",we_files[0]);
}
file_wordexp_destroy(we);
@@ -783,13 +783,6 @@ static int
strncmp_len(const char *s1, int s1len, const char *s2)
{
int ret;
-#if 0
- char c[s1len+1];
- strncpy(c, s1, s1len);
- c[s1len]='\0';
- dbg(lvl_debug,"'%s' vs '%s'\n", c, s2);
-#endif
-
ret=strncmp(s1, s2, s1len);
if (ret)
return ret;
@@ -827,13 +820,6 @@ xpointer_test(const char *test, int len, struct xistate *elem)
int eq,i,count,vlen,cond_req=1,cond=0;
char c;
const char *tmp[16];
-#if 0
- char test2[len+1];
-
- strncpy(test2, test, len);
- test2[len]='\0';
- dbg(lvl_debug,"%s\n", test2);
-#endif
if (!len)
return 0;
c=test[len-1];
@@ -886,7 +872,7 @@ xpointer_xpointer_match(const char *xpointer, int len, struct xistate *first)
{
const char *c;
int s;
- dbg(lvl_info,"%s\n", xpointer);
+ dbg(lvl_info,"%s", xpointer);
if (xpointer[0] != '/')
return 0;
c=xpointer+1;
@@ -1019,16 +1005,14 @@ xi_text (xml_context *context,
struct xmldocument *doc=user_data;
struct xmlstate *curr, **state = doc->user_data;
struct attr attr;
- char *text_dup = malloc(text_len+1);
curr=*state;
- strncpy(text_dup, text, text_len);
- text_dup[text_len]='\0';
+ char *text_dup = g_strndup(text, text_len);
attr.type=attr_xml_text;
attr.u.str=text_dup;
if (curr->object_func && curr->object_func->add_attr && curr->element_attr.u.data)
curr->object_func->add_attr(curr->element_attr.u.data, &attr);
- free(text_dup);
+ g_free(text_dup);
return;
}
}
@@ -1067,12 +1051,12 @@ xml_parse_text(const char *document, void *data,
context = g_markup_parse_context_new (&parser, 0, data, NULL);
if (!document){
- dbg(lvl_error, "FATAL: No XML data supplied (looks like incorrect configuration for internal GUI).\n");
+ dbg(lvl_error, "FATAL: No XML data supplied (looks like incorrect configuration for internal GUI).");
exit(1);
}
result = g_markup_parse_context_parse (context, document, strlen(document), NULL);
if (!result){
- dbg(lvl_error, "FATAL: Cannot parse data as XML: '%s'\n", document);
+ dbg(lvl_error, "FATAL: Cannot parse data as XML: '%s'", document);
exit(1);
}
g_markup_parse_context_free (context);
@@ -1115,7 +1099,7 @@ parse_file(struct xmldocument *document, xmlerror **error)
gboolean result;
char *xmldir,*newxmldir,*xmlfile,*newxmlfile,*sep;
- dbg(lvl_debug,"enter filename='%s'\n", document->href);
+ dbg(lvl_debug,"enter filename='%s'", document->href);
#if GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 12
#define G_MARKUP_TREAT_CDATA_AS_TEXT 0
#endif
@@ -1159,7 +1143,7 @@ parse_file(struct xmldocument *document, xmlerror **error)
unsetenv("XMLFILE");
g_free(newxmldir);
g_free(newxmlfile);
- dbg(lvl_debug,"return %d\n", result);
+ dbg(lvl_debug,"return %d", result);
return result;
}
@@ -1219,7 +1203,7 @@ gboolean config_load(const char *filename, xmlerror **error)
item_create_hash();
initStatic();
- dbg(lvl_debug,"enter filename='%s'\n", filename);
+ dbg(lvl_debug,"enter filename='%s'", filename);
memset(&document, 0, sizeof(document));
document.href=filename;
document.user_data=&curr;
@@ -1230,7 +1214,7 @@ gboolean config_load(const char *filename, xmlerror **error)
}
attr_destroy_hash();
item_destroy_hash();
- dbg(lvl_debug,"return %d\n", result);
+ dbg(lvl_debug,"return %d", result);
return result;
}
@@ -1264,7 +1248,7 @@ struct navit_object *
navit_object_ref(struct navit_object *obj)
{
obj->refcount++;
- dbg(lvl_debug,"refcount %s %p %d\n",attr_to_name(obj->func->type),obj,obj->refcount);
+ dbg(lvl_debug,"refcount %s %p %d",attr_to_name(obj->func->type),obj,obj->refcount);
return obj;
}
@@ -1273,7 +1257,7 @@ navit_object_unref(struct navit_object *obj)
{
if (obj) {
obj->refcount--;
- dbg(lvl_debug,"refcount %s %p %d\n",attr_to_name(obj->func->type),obj,obj->refcount);
+ dbg(lvl_debug,"refcount %s %p %d",attr_to_name(obj->func->type),obj,obj->refcount);
if (obj->refcount <= 0 && obj->func && obj->func->destroy)
obj->func->destroy(obj);
}
@@ -1336,7 +1320,7 @@ navit_object_callbacks(struct navit_object *obj, struct attr *attr)
int
navit_object_set_attr(struct navit_object *obj, struct attr *attr)
{
- dbg(lvl_debug, "enter, obj=%p, attr=%p (%s)\n", obj, attr, attr_to_name(attr->type));
+ dbg(lvl_debug, "enter, obj=%p, attr=%p (%s)", obj, attr, attr_to_name(attr->type));
obj->attrs=attr_generic_set_attr(obj->attrs, attr);
navit_object_callbacks(obj, attr);
return 1;
@@ -1345,7 +1329,7 @@ navit_object_set_attr(struct navit_object *obj, struct attr *attr)
int
navit_object_add_attr(struct navit_object *obj, struct attr *attr)
{
- dbg(lvl_debug, "enter, obj=%p, attr=%p (%s)\n", obj, attr, attr_to_name(attr->type));
+ dbg(lvl_debug, "enter, obj=%p, attr=%p (%s)", obj, attr, attr_to_name(attr->type));
if (attr->type == attr_callback) {
struct callback_list *cbl;
if (obj->attrs && obj->attrs[0] && obj->attrs[0]->type == attr_callback_list)
diff --git a/po/af.po.in b/po/af.po.in
index 04af45fca..9e8ed0ff7 100644
--- a/po/af.po.in
+++ b/po/af.po.in
@@ -1670,7 +1670,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/ar.po.in b/po/ar.po.in
index b1f8011b4..8768d21f6 100644
--- a/po/ar.po.in
+++ b/po/ar.po.in
@@ -1695,7 +1695,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/ast.po.in b/po/ast.po.in
index 02fe9cb07..1a8c7d738 100644
--- a/po/ast.po.in
+++ b/po/ast.po.in
@@ -1664,7 +1664,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/be.po.in b/po/be.po.in
index 561f630f7..71326297c 100644
--- a/po/be.po.in
+++ b/po/be.po.in
@@ -1667,7 +1667,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/bg.po.in b/po/bg.po.in
index 9da4a8820..c744854d0 100644
--- a/po/bg.po.in
+++ b/po/bg.po.in
@@ -1668,7 +1668,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/bs.po.in b/po/bs.po.in
index c6c8e8506..5ee1a68f7 100644
--- a/po/bs.po.in
+++ b/po/bs.po.in
@@ -1668,7 +1668,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/ca.po.in b/po/ca.po.in
index 4c41bcd79..0bbb0c966 100644
--- a/po/ca.po.in
+++ b/po/ca.po.in
@@ -1675,7 +1675,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/ckb.po.in b/po/ckb.po.in
index ab8a5a1eb..258d101cc 100644
--- a/po/ckb.po.in
+++ b/po/ckb.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/cs.po.in b/po/cs.po.in
index 28a3ec959..ad79fcf33 100644
--- a/po/cs.po.in
+++ b/po/cs.po.in
@@ -1685,8 +1685,8 @@ msgstr "Taxi"
msgid "Shopping"
msgstr "Nakupování"
-msgid "Distance from screen center (km)"
-msgstr "Vzdálenost od středu mapy (km)"
+msgid "Select a search radius from screen center"
+msgstr "Vzdálenost od středu mapy"
#, c-format
msgid "POI %s. %s"
diff --git a/po/cy.po.in b/po/cy.po.in
index 9171574a7..92251c27c 100644
--- a/po/cy.po.in
+++ b/po/cy.po.in
@@ -1668,7 +1668,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/da.po.in b/po/da.po.in
index 2bd2cee87..570b72a9c 100644
--- a/po/da.po.in
+++ b/po/da.po.in
@@ -1674,7 +1674,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/de.po.in b/po/de.po.in
index 7ff0ba0e6..a01949d76 100644
--- a/po/de.po.in
+++ b/po/de.po.in
@@ -1,18 +1,15 @@
# German translations for navit
-# Copyright (C) 2006-2017 The Navit Team
+# Copyright (C) 2006-2018 The Navit Team
# This file is distributed under the same license as the navit package.
# Many thanks to the contributors of this translation:
# Achim Behrens https://launchpad.net/~k1l
# Artem Anufrij https://launchpad.net/~artem-anufrij
# Bernhard Reiter https://launchpad.net/~ockham-razor
# Christian Moll https://launchpad.net/~christian-chrmoll
-# Clemens Kiener https://launchpad.net/~clemens-kiener
# Dennis Gohert https://launchpad.net/~info-degoist
-# Ettore Atalan https://launchpad.net/~atalanttore
# Fred https://launchpad.net/~jelk
# Fume https://launchpad.net/~fume
# KaZeR https://launchpad.net/~kazer
-# Kamikaaze https://launchpad.net/~kamikaazewiesel
# Keruskerfuerst https://launchpad.net/~arminmohring
# Konsti K. https://launchpad.net/~konstantin-koehring
# Lars Hennig https://launchpad.net/~elhennig
@@ -35,13 +32,13 @@
# metehyi https://launchpad.net/~metehyi
# singesang https://launchpad.net/~singesang
# spaetz https://launchpad.net/~spaetz
-# vsandre https://launchpad.net/~riedel-andre
+# vsandre https://launchpad.net/~vsandre
msgid ""
msgstr ""
-"Project-Id-Version: navit 0.5.0\n"
+"Project-Id-Version: navit 0.5.1\n"
"Report-Msgid-Bugs-To: \n"
-"PO-Revision-Date: 2017-01-12 18:37+0000\n"
+"PO-Revision-Date: 2018-05-01 17:39+0000\n"
"Last-Translator: Steffen <zintor@lycos.com>\n"
"Language-Team: Martin Schaller <martin-s@sourceforge.net>\n"
"MIME-Version: 1.0\n"
@@ -414,9 +411,15 @@ msgstr "Anweisung"
msgid "Length"
msgstr "Länge"
+msgid "mi"
+msgstr ""
+
msgid "km"
msgstr "km"
+msgid "feet"
+msgstr "Fuß"
+
msgid "m"
msgstr "m"
@@ -1484,26 +1487,24 @@ msgstr ""
"\t-v: zeige die Version und beende.\n"
#. We have not found an existing config file from all possibilities
-msgid "No config file navit.xml, navit.xml.local found\n"
-msgstr "Keine Konfigurations-Datei navit.xml oder navit.xml.local gefunden\n"
+msgid "No config file navit.xml, navit.xml.local found"
+msgstr ""
#, c-format
-msgid "Error parsing config file '%s': %s\n"
-msgstr "Fehler beim Parsen der Konfigurations-Datei '%s': %s\n"
+msgid "Error parsing config file '%s': %s"
+msgstr ""
#, c-format
-msgid "Using config file '%s'\n"
-msgstr "Benutze Konfigurations-Datei '%s'\n"
+msgid "Using config file '%s'"
+msgstr ""
#, c-format
-msgid "Error: No configuration found in config file '%s'\n"
-msgstr "Fehler: Keine Konfiguration in der Datei '%s' gefunden\n"
+msgid "Error: No configuration found in config file '%s'"
+msgstr ""
msgid ""
-"Internal initialization failed, exiting. Check previous error messages.\n"
+"Internal initialization failed, exiting. Check previous error messages."
msgstr ""
-"Interne Initialisierung fehlgeschlagen, Programm wird beendet. Frühere "
-"Fehler beachten.\n"
msgid "unknown street"
msgstr "unbekannte Straße"
@@ -1644,6 +1645,9 @@ msgstr "Positions_marke zeigen"
msgid "_Lock on Road"
msgstr "Auf Straße _zeigen"
+msgid "_Follow Vehicle"
+msgstr "_Folge Fahrzeug"
+
msgid "_Keep orientation to the North"
msgstr "_Nordorientierung"
@@ -1714,24 +1718,24 @@ msgstr "Taxi"
msgid "Shopping"
msgstr "Einkaufen"
-msgid "Distance from screen center (km)"
-msgstr "Entfernung vom Bildschirmmittelpunkt (km)"
+msgid "Select a search radius from screen center"
+msgstr "Entfernung vom Bildschirmmittelpunkt"
#, c-format
msgid "POI %s. %s"
msgstr "POI %s. %s"
#, c-format
-msgid "Set destination to %ld, %ld \n"
-msgstr "Setze Ziel auf %ld, %ld \n"
+msgid "Set destination to %ld, %ld "
+msgstr ""
#, c-format
-msgid "Set map to %ld, %ld \n"
-msgstr "Setze Karte auf %ld, %ld \n"
+msgid "Set map to %ld, %ld "
+msgstr ""
#, c-format
-msgid "Set next visit to %ld, %ld \n"
-msgstr "Setze nächsten Besuch auf %ld, %ld \n"
+msgid "Set next visit to %ld, %ld "
+msgstr ""
msgid "POI search"
msgstr "POI Suche"
@@ -1801,8 +1805,8 @@ msgid "OT"
msgstr "OT"
#, c-format
-msgid "Route %4.0fkm %02d:%02d ETA"
-msgstr "Route %4.0fkm %02d:%02d ETA"
+msgid "Route %4.1f%s %02d:%02d ETA"
+msgstr ""
msgid "Route 0000km 0+00:00 ETA"
msgstr "Route 0000km 0+00:00 ETA"
@@ -2025,6 +2029,9 @@ msgstr "Wegbeschreibung"
msgid "Show Locale"
msgstr "Lokalisierung anzeigen"
+msgid "Network info"
+msgstr "Netzwerkinfo"
+
msgid "Former Destinations"
msgstr "Vorherige Ziele"
@@ -2063,451 +2070,9 @@ msgstr "Achtung Blitzer!"
msgid "Please decrease your speed"
msgstr "Bitte Geschwindigkeit verringern"
-msgid "partial match"
-msgstr "ungefähr"
-
-#. Android resource: @strings/address_search_button
-msgid "Search"
-msgstr "Suche"
-
-#. Android resource: @strings/address_search_towns
-msgid "Towns"
-msgstr "Städte"
-
-msgid "Map data (c) OpenStreetMap contributors, ODBL"
-msgstr "Kartendaten (c) von OpenStreetMap unter ODbL"
-
-msgid ""
-"Current map location %s is not available\n"
-"Please restart Navit after you attach an SD card or select a different map "
-"location."
-msgstr ""
-"Der Speicherpfad für die Karte ist nicht verfügbar.\n"
-"Setzen Sie eine SD Karte ein und starten Sie Navit erneut\n"
-"oder wählen Sie einen anderen Pfad aus."
-
-msgid "Downloaded maps"
-msgstr "Heruntergeladene Karten"
-
-msgid ""
-"Sorry, we currently do not support maps above 3.8G on Android, please select "
-"a smaller one."
-msgstr ""
-"Entschuldigung. Derzeit untestützen wir auf Android keine Karten die größer "
-"als 3,8Gigabyte sind. Bitte wählen Sie eine kleinere Karte aus."
-
-#. Android resource: @strings/position_popup_drive_here
-msgid "Route to here"
-msgstr "Ziel setzen"
-
-msgid "Cancel"
-msgstr "Abbrechen"
-
msgid "filenamePath"
msgstr "Dateipfad"
-msgid ""
-"New location set to %s\n"
-"Restart Navit to apply the changes."
-msgstr ""
-"Karten-Speicherort ist %s\n"
-"Starten Sie Navit erneut."
-
-msgid "Whole Planet"
-msgstr "Ganze Welt"
-
-msgid "Africa"
-msgstr "Afrika"
-
-msgid "Canary Islands"
-msgstr "Kanarische Inseln"
-
-msgid "Asia"
-msgstr "Asien"
-
-msgid "Korea"
-msgstr "Korea"
-
-msgid "Taiwan"
-msgstr "Taiwan"
-
-msgid "UAE+Other"
-msgstr "Vereinigte Arabische Emirate+weitere"
-
-msgid "Oceania"
-msgstr "Ozeanien"
-
-msgid "Tasmania"
-msgstr "Tasmanien"
-
-msgid "Victoria"
-msgstr "Victoria"
-
-msgid "New South Wales"
-msgstr "New South Wales"
-
-msgid "Europe"
-msgstr "Europa"
-
-msgid "Western Europe"
-msgstr "West-Europa"
-
-msgid "Azores"
-msgstr "Azoren"
-
-msgid "BeNeLux"
-msgstr "Beneluxländer"
-
-msgid "Alsace"
-msgstr "Elsass"
-
-msgid "Aquitaine"
-msgstr "Aquitanien"
-
-msgid "Auvergne"
-msgstr "Auvergne"
-
-msgid "Basse-Normandie"
-msgstr "Basse-Normandie"
-
-msgid "Bourgogne"
-msgstr "Burgund"
-
-msgid "Bretagne"
-msgstr "Bretagne"
-
-msgid "Centre"
-msgstr "Centre"
-
-msgid "Champagne-Ardenne"
-msgstr "Champagne-Ardenne"
-
-msgid "Corse"
-msgstr "Korsika"
-
-msgid "Franche-Comte"
-msgstr "Freie Grafschaft"
-
-msgid "Haute-Normandie"
-msgstr "Haute Normandie"
-
-msgid "Ile-de-France"
-msgstr "Ile-de-France"
-
-msgid "Languedoc-Roussillon"
-msgstr "Languedoc-Roussillon"
-
-msgid "Limousin"
-msgstr "Limousin"
-
-msgid "Lorraine"
-msgstr "Lothringen"
-
-msgid "Midi-Pyrenees"
-msgstr "Midi-Pyrenäen"
-
-msgid "Nord-pas-de-Calais"
-msgstr "Nord-pas-de-Calais"
-
-msgid "Pays-de-la-Loire"
-msgstr "Pays-de-la-Loire"
-
-msgid "Picardie"
-msgstr "Picardie"
-
-msgid "Poitou-Charentes"
-msgstr "Poitou-Charentes"
-
-msgid "Provence-Alpes-Cote-d-Azur"
-msgstr "Provence-Alpes-Cote-d-Azur"
-
-msgid "Rhone-Alpes"
-msgstr "Rhone-Alpen"
-
-msgid "Baden-Wuerttemberg"
-msgstr "Baden-Württemberg"
-
-msgid "Bayern"
-msgstr "Bayern"
-
-msgid "Mittelfranken"
-msgstr "Mittelfranken"
-
-msgid "Niederbayern"
-msgstr "Niederbayern"
-
-msgid "Oberbayern"
-msgstr "Oberbayern"
-
-msgid "Oberfranken"
-msgstr "Oberfranken"
-
-msgid "Oberpfalz"
-msgstr "Oberpfalz"
-
-msgid "Schwaben"
-msgstr "Schwaben"
-
-msgid "Unterfranken"
-msgstr "Unterfranken"
-
-msgid "Berlin"
-msgstr "Berlin"
-
-msgid "Brandenburg"
-msgstr "Brandenburg"
-
-msgid "Bremen"
-msgstr "Bremen"
-
-msgid "Hamburg"
-msgstr "Hamburg"
-
-msgid "Hessen"
-msgstr "Hessen"
-
-msgid "Mecklenburg-Vorpommern"
-msgstr "Mecklenburg-Vorpommern"
-
-msgid "Niedersachsen"
-msgstr "Niedersachsen"
-
-msgid "Nordrhein-westfalen"
-msgstr "Nordrhein-Westfalen"
-
-msgid "Rheinland-Pfalz"
-msgstr "Rheinland-Pfalz"
-
-msgid "Saarland"
-msgstr "Saarland"
-
-msgid "Sachsen-Anhalt"
-msgstr "Sachsen-Anhalt"
-
-msgid "Sachsen"
-msgstr "Sachsen"
-
-msgid "Schleswig-Holstein"
-msgstr "Schleswig-Holstein"
-
-msgid "Thueringen"
-msgstr "Thüringen"
-
-msgid "Mallorca"
-msgstr "Mallorca"
-
-msgid "Galicia"
-msgstr "Galicien"
-
-msgid "Scandinavia"
-msgstr "Skandinavien"
-
-msgid "England"
-msgstr "England"
-
-msgid "Buckinghamshire"
-msgstr "Buckinghamshire"
-
-msgid "Cambridgeshire"
-msgstr "Cambridgeshire"
-
-msgid "Cumbria"
-msgstr "Cumbria"
-
-msgid "East yorkshire with hull"
-msgstr "East Yorkshire und Hull"
-
-msgid "Essex"
-msgstr "Essex"
-
-msgid "Herefordshire"
-msgstr "Herefordshire"
-
-msgid "Kent"
-msgstr "Kent"
-
-msgid "Lancashire"
-msgstr "Lancashire"
-
-msgid "Leicestershire"
-msgstr "Leicestershire"
-
-msgid "Norfolk"
-msgstr "Norfolk"
-
-msgid "Nottinghamshire"
-msgstr "Nottinghamshire"
-
-msgid "Oxfordshire"
-msgstr "Oxfordshire"
-
-msgid "Shropshire"
-msgstr "Shropshire"
-
-msgid "Somerset"
-msgstr "Somerset"
-
-msgid "South yorkshire"
-msgstr "South yorkshire"
-
-msgid "Suffolk"
-msgstr "Suffolk"
-
-msgid "Surrey"
-msgstr "Surrey"
-
-msgid "Wiltshire"
-msgstr "Wiltshire"
-
-msgid "Scotland"
-msgstr "Schottland"
-
-msgid "Wales"
-msgstr "Wales"
-
-msgid "Crete"
-msgstr "Kreta"
-
-msgid "North America"
-msgstr "Nordamerika"
-
-msgid "Alaska"
-msgstr "Alaska"
-
-msgid "Hawaii"
-msgstr "Hawaii"
-
-msgid "USA"
-msgstr "USA"
-
-msgid " (except Alaska and Hawaii)"
-msgstr " (außer Alaska und Hawaii)"
-
-msgid "Midwest"
-msgstr "Mittlerer Westen"
-
-msgid "Michigan"
-msgstr "Michigan"
-
-msgid "Ohio"
-msgstr "Ohio"
-
-msgid "Northeast"
-msgstr "Nordosten"
-
-msgid "Massachusetts"
-msgstr "Massachusetts"
-
-msgid "Vermont"
-msgstr "Vermont"
-
-msgid "Pacific"
-msgstr "Pazifik"
-
-msgid "South"
-msgstr "Süd"
-
-msgid "Arkansas"
-msgstr "Arkansas"
-
-msgid "District of Columbia"
-msgstr "District of Columbia"
-
-msgid "Florida"
-msgstr "Florida"
-
-msgid "Louisiana"
-msgstr "Louisiana"
-
-msgid "Maryland"
-msgstr "Maryland"
-
-msgid "Mississippi"
-msgstr "Mississippi"
-
-msgid "Oklahoma"
-msgstr "Oklahoma"
-
-msgid "Texas"
-msgstr "Texas"
-
-msgid "Virginia"
-msgstr "Virginia"
-
-msgid "West Virginia"
-msgstr "West Virginia"
-
-msgid "West"
-msgstr "West"
-
-msgid "Arizona"
-msgstr "Arizona"
-
-msgid "California"
-msgstr "Kalifornien"
-
-msgid "Colorado"
-msgstr "Colorado"
-
-msgid "Idaho"
-msgstr "Idaho"
-
-msgid "Montana"
-msgstr "Montana"
-
-msgid "New Mexico"
-msgstr "New Mexico"
-
-msgid "Nevada"
-msgstr "Nevada"
-
-msgid "Oregon"
-msgstr "Oregon"
-
-msgid "Utah"
-msgstr "Utah"
-
-msgid "Washington State"
-msgstr "Washington State"
-
-msgid "South+Middle America"
-msgstr "Süd+Mittel-Amerika"
-
-msgid "Guyane Francaise"
-msgstr "Französisch-Guayana"
-
-msgid "downloading"
-msgstr "wird heruntergeladen"
-
-#. Android resource: @strings/map_download_ready
-msgid "ready"
-msgstr "Fertig in"
-
-msgid "Media selected for map storage is not available"
-msgstr ""
-"Der eingestellte Speicherort für das Kartenmaterial ist nicht verfügbar."
-
-#. Android resource: @strings/map_download_not_enough_free_space
-msgid "Not enough free space"
-msgstr "Nicht genug freier Speicher"
-
-msgid "Error downloading map!"
-msgstr "Fehler beim Kartendownload"
-
-msgid "Error writing map!"
-msgstr "Fehler beim speichern der Karte!"
-
-msgid "Map download aborted!"
-msgstr "Kartendownload abgebrochen!"
-
-#. Android resource: @strings/map_download_eta
-msgid "ETA"
-msgstr "Fertig in"
-
-#. Android resource: @strings/map_download_title
-msgid "Map download"
-msgstr "Kartendownload"
-
msgid "Vehicle Position"
msgstr "Fahrzeugposition"
@@ -2565,9 +2130,18 @@ msgstr "Vollbildmodus"
msgid "Window Mode"
msgstr "Fenstermodus"
+msgid "Auto zoom"
+msgstr "Automatischer Zoom"
+
+msgid "Manual zoom"
+msgstr "Manuelle Vergrößerung"
+
msgid "Layers"
msgstr "Ebenen"
+msgid "Zoom to route"
+msgstr ""
+
msgid "Description"
msgstr "Beschreibung"
@@ -2680,14 +2254,30 @@ msgstr "Sichern / Wiederherstellen"
msgid "Set map location"
msgstr "Kartenort festlegen"
+#. Android resource: @strings/position_popup_drive_here
+msgid "Route to here"
+msgstr "Ziel setzen"
+
#. Android resource: @strings/map_delete
msgid "Delete this map?"
msgstr "Diese Karte löschen?"
+#. Android resource: @strings/map_download_title
+msgid "Map download"
+msgstr "Kartendownload"
+
#. Android resource: @strings/map_download_downloading
msgid "Downloading:"
msgstr "Laden:"
+#. Android resource: @strings/map_download_eta
+msgid "ETA"
+msgstr "Fertig in"
+
+#. Android resource: @strings/map_download_ready
+msgid "ready"
+msgstr "Fertig in"
+
#. Android resource: @strings/map_download_download_error
msgid "Error downloading map."
msgstr "Fehler beim Kartendownload"
@@ -2696,6 +2286,10 @@ msgstr "Fehler beim Kartendownload"
msgid "Map download aborted"
msgstr "Download der Karte abgebrochen"
+#. Android resource: @strings/map_download_not_enough_free_space
+msgid "Not enough free space"
+msgstr "Nicht genug freier Speicher"
+
#. Android resource: @strings/map_no_fix
msgid "No location. Reopen after location fix."
msgstr "Position noch nicht bekannt."
@@ -2716,6 +2310,10 @@ msgstr "Ziel eingeben"
msgid "Match partial address"
msgstr "Ungefähr"
+#. Android resource: @strings/address_search_button
+msgid "Search"
+msgstr "Suche"
+
#. Android resource: @strings/address_search_searching
msgid "Searching..."
msgstr "Suche läuft..."
@@ -2744,6 +2342,10 @@ msgstr "Keine Eingabe"
msgid "Setting destination to:"
msgstr "Neues Fahrziel:"
+#. Android resource: @strings/address_search_towns
+msgid "Towns"
+msgstr "Städte"
+
#. Android resource: @strings/choose_an_action
msgid "Choose an action"
msgstr "Bitte auswählen"
@@ -2827,15 +2429,468 @@ msgid ""
"Navit needs permission to access GPS and read the map.\n"
"If you change your mind please restart Navit and grant the permissions"
msgstr ""
+"Navit benötigt die Berechtigung, um GPS zu nutzen und die Karte zu zeigen.\n"
+"Wenn Du dies erlauben möchtest, starte Navit bitte neu und erlaube die "
+"Berechtigung"
#. Android resource: @strings/permissions_info_box_title
msgid "One or more ungranted permissions"
-msgstr ""
+msgstr "Eine oder mehrere nicht gewährte Berechtigungen"
+
+#, c-format
+#~ msgid "Route %4.0fkm %02d:%02d ETA"
+#~ msgstr "Route %4.0fkm %02d:%02d ETA"
+
+#~ msgid "No config file navit.xml, navit.xml.local found\n"
+#~ msgstr "Keine Konfigurations-Datei navit.xml oder navit.xml.local gefunden\n"
+
+#, c-format
+#~ msgid "Error parsing config file '%s': %s\n"
+#~ msgstr "Fehler beim Parsen der Konfigurations-Datei '%s': %s\n"
+
+#, c-format
+#~ msgid "Using config file '%s'\n"
+#~ msgstr "Benutze Konfigurations-Datei '%s'\n"
+
+#~ msgid ""
+#~ "Internal initialization failed, exiting. Check previous error messages.\n"
+#~ msgstr ""
+#~ "Interne Initialisierung fehlgeschlagen, Programm wird beendet. Frühere "
+#~ "Fehler beachten.\n"
+
+#~ msgid "partial match"
+#~ msgstr "ungefähr"
+
+#~ msgid "Downloaded maps"
+#~ msgstr "Heruntergeladene Karten"
+
+#~ msgid "Error downloading map!"
+#~ msgstr "Fehler beim Kartendownload"
+
+#~ msgid "Taiwan"
+#~ msgstr "Taiwan"
+
+#~ msgid "Asia"
+#~ msgstr "Asien"
+
+#~ msgid "Canary Islands"
+#~ msgstr "Kanarische Inseln"
+
+#~ msgid "Whole Planet"
+#~ msgstr "Ganze Welt"
+
+#~ msgid "Map data (c) OpenStreetMap contributors, ODBL"
+#~ msgstr "Kartendaten (c) von OpenStreetMap unter ODbL"
+
+#~ msgid "Korea"
+#~ msgstr "Korea"
+
+#~ msgid "Tasmania"
+#~ msgstr "Tasmanien"
+
+#~ msgid "Oceania"
+#~ msgstr "Ozeanien"
+
+#~ msgid "Alsace"
+#~ msgstr "Elsass"
+
+#~ msgid "BeNeLux"
+#~ msgstr "Beneluxländer"
+
+#~ msgid "Victoria"
+#~ msgstr "Victoria"
+
+#~ msgid "Western Europe"
+#~ msgstr "West-Europa"
+
+#~ msgid "New South Wales"
+#~ msgstr "New South Wales"
+
+#~ msgid "Europe"
+#~ msgstr "Europa"
+
+#~ msgid "Aquitaine"
+#~ msgstr "Aquitanien"
+
+#~ msgid "Auvergne"
+#~ msgstr "Auvergne"
+
+#~ msgid "Basse-Normandie"
+#~ msgstr "Basse-Normandie"
+
+#~ msgid "Languedoc-Roussillon"
+#~ msgstr "Languedoc-Roussillon"
+
+#~ msgid "Limousin"
+#~ msgstr "Limousin"
+
+#~ msgid "Haute-Normandie"
+#~ msgstr "Haute Normandie"
+
+#~ msgid "Bretagne"
+#~ msgstr "Bretagne"
+
+#~ msgid "Corse"
+#~ msgstr "Korsika"
+
+#~ msgid "Champagne-Ardenne"
+#~ msgstr "Champagne-Ardenne"
+
+#~ msgid "Baden-Wuerttemberg"
+#~ msgstr "Baden-Württemberg"
+
+#~ msgid "Bayern"
+#~ msgstr "Bayern"
+
+#~ msgid "Lorraine"
+#~ msgstr "Lothringen"
+
+#~ msgid "Poitou-Charentes"
+#~ msgstr "Poitou-Charentes"
+
+#~ msgid "Picardie"
+#~ msgstr "Picardie"
+
+#~ msgid "Mittelfranken"
+#~ msgstr "Mittelfranken"
+
+#~ msgid "Oberpfalz"
+#~ msgstr "Oberpfalz"
+
+#~ msgid "Oberfranken"
+#~ msgstr "Oberfranken"
+
+#~ msgid "Oberbayern"
+#~ msgstr "Oberbayern"
+
+#~ msgid "Unterfranken"
+#~ msgstr "Unterfranken"
+
+#~ msgid "Schwaben"
+#~ msgstr "Schwaben"
+
+#~ msgid "Niederbayern"
+#~ msgstr "Niederbayern"
+
+#~ msgid "Bremen"
+#~ msgstr "Bremen"
+
+#~ msgid "Berlin"
+#~ msgstr "Berlin"
+
+#~ msgid "Brandenburg"
+#~ msgstr "Brandenburg"
+
+#~ msgid "Rheinland-Pfalz"
+#~ msgstr "Rheinland-Pfalz"
+
+#~ msgid "Saarland"
+#~ msgstr "Saarland"
+
+#~ msgid "Niedersachsen"
+#~ msgstr "Niedersachsen"
+
+#~ msgid "Hessen"
+#~ msgstr "Hessen"
+
+#~ msgid "Mecklenburg-Vorpommern"
+#~ msgstr "Mecklenburg-Vorpommern"
+
+#~ msgid "Hamburg"
+#~ msgstr "Hamburg"
+
+#~ msgid "Sachsen"
+#~ msgstr "Sachsen"
+
+#~ msgid "Sachsen-Anhalt"
+#~ msgstr "Sachsen-Anhalt"
+
+#~ msgid "Schleswig-Holstein"
+#~ msgstr "Schleswig-Holstein"
+
+#~ msgid "Galicia"
+#~ msgstr "Galicien"
+
+#~ msgid "Essex"
+#~ msgstr "Essex"
+
+#~ msgid "Cumbria"
+#~ msgstr "Cumbria"
+
+#~ msgid "Thueringen"
+#~ msgstr "Thüringen"
+
+#~ msgid "Mallorca"
+#~ msgstr "Mallorca"
+
+#~ msgid "England"
+#~ msgstr "England"
+
+#~ msgid "Scandinavia"
+#~ msgstr "Skandinavien"
+
+#~ msgid "Cambridgeshire"
+#~ msgstr "Cambridgeshire"
+
+#~ msgid "Buckinghamshire"
+#~ msgstr "Buckinghamshire"
+
+#~ msgid "Oxfordshire"
+#~ msgstr "Oxfordshire"
+
+#~ msgid "Nottinghamshire"
+#~ msgstr "Nottinghamshire"
+
+#~ msgid "Lancashire"
+#~ msgstr "Lancashire"
+
+#~ msgid "Kent"
+#~ msgstr "Kent"
+
+#~ msgid "Norfolk"
+#~ msgstr "Norfolk"
+
+#~ msgid "Leicestershire"
+#~ msgstr "Leicestershire"
+
+#~ msgid "Herefordshire"
+#~ msgstr "Herefordshire"
+
+#~ msgid "South yorkshire"
+#~ msgstr "South yorkshire"
+
+#~ msgid "Shropshire"
+#~ msgstr "Shropshire"
+
+#~ msgid "Somerset"
+#~ msgstr "Somerset"
+
+#~ msgid "Alaska"
+#~ msgstr "Alaska"
+
+#~ msgid "North America"
+#~ msgstr "Nordamerika"
+
+#~ msgid "USA"
+#~ msgstr "USA"
+
+#~ msgid "Hawaii"
+#~ msgstr "Hawaii"
+
+#~ msgid "Crete"
+#~ msgstr "Kreta"
+
+#~ msgid "Suffolk"
+#~ msgstr "Suffolk"
+
+#~ msgid "Scotland"
+#~ msgstr "Schottland"
+
+#~ msgid "Wales"
+#~ msgstr "Wales"
+
+#~ msgid "Surrey"
+#~ msgstr "Surrey"
+
+#~ msgid "Wiltshire"
+#~ msgstr "Wiltshire"
+
+#~ msgid "Pacific"
+#~ msgstr "Pazifik"
+
+#~ msgid "South"
+#~ msgstr "Süd"
+
+#~ msgid "Arkansas"
+#~ msgstr "Arkansas"
+
+#~ msgid " (except Alaska and Hawaii)"
+#~ msgstr " (außer Alaska und Hawaii)"
+
+#~ msgid "Northeast"
+#~ msgstr "Nordosten"
+
+#~ msgid "Ohio"
+#~ msgstr "Ohio"
+
+#~ msgid "Michigan"
+#~ msgstr "Michigan"
+
+#~ msgid "Midwest"
+#~ msgstr "Mittlerer Westen"
+
+#~ msgid "Vermont"
+#~ msgstr "Vermont"
+
+#~ msgid "Massachusetts"
+#~ msgstr "Massachusetts"
+
+#~ msgid "District of Columbia"
+#~ msgstr "District of Columbia"
+
+#~ msgid "Florida"
+#~ msgstr "Florida"
+
+#~ msgid "Louisiana"
+#~ msgstr "Louisiana"
+
+#~ msgid "Maryland"
+#~ msgstr "Maryland"
+
+#~ msgid "Oklahoma"
+#~ msgstr "Oklahoma"
+
+#~ msgid "Texas"
+#~ msgstr "Texas"
+
+#~ msgid "Mississippi"
+#~ msgstr "Mississippi"
+
+#~ msgid "West Virginia"
+#~ msgstr "West Virginia"
+
+#~ msgid "Virginia"
+#~ msgstr "Virginia"
+
+#~ msgid "West"
+#~ msgstr "West"
+
+#~ msgid "Washington State"
+#~ msgstr "Washington State"
+
+#~ msgid "Oregon"
+#~ msgstr "Oregon"
+
+#~ msgid "New Mexico"
+#~ msgstr "New Mexico"
+
+#~ msgid "Nevada"
+#~ msgstr "Nevada"
+
+#~ msgid "Arizona"
+#~ msgstr "Arizona"
+
+#~ msgid "Colorado"
+#~ msgstr "Colorado"
+
+#~ msgid "California"
+#~ msgstr "Kalifornien"
+
+#~ msgid "Montana"
+#~ msgstr "Montana"
+
+#~ msgid "Idaho"
+#~ msgstr "Idaho"
+
+#~ msgid "Utah"
+#~ msgstr "Utah"
+
+#~ msgid "Africa"
+#~ msgstr "Afrika"
+
+#~ msgid "UAE+Other"
+#~ msgstr "Vereinigte Arabische Emirate+weitere"
+
+#~ msgid "Azores"
+#~ msgstr "Azoren"
+
+#~ msgid "Bourgogne"
+#~ msgstr "Burgund"
+
+#~ msgid "South+Middle America"
+#~ msgstr "Süd+Mittel-Amerika"
+
+#~ msgid "Error writing map!"
+#~ msgstr "Fehler beim speichern der Karte!"
+
+#~ msgid "downloading"
+#~ msgstr "wird heruntergeladen"
+
+#~ msgid "Nordrhein-westfalen"
+#~ msgstr "Nordrhein-Westfalen"
+
+#~ msgid "Map download aborted!"
+#~ msgstr "Kartendownload abgebrochen!"
+
+#~ msgid "Centre"
+#~ msgstr "Centre"
+
+#~ msgid "Ile-de-France"
+#~ msgstr "Ile-de-France"
+
+#~ msgid "Nord-pas-de-Calais"
+#~ msgstr "Nord-pas-de-Calais"
+
+#~ msgid "Pays-de-la-Loire"
+#~ msgstr "Pays-de-la-Loire"
+
+#~ msgid "Midi-Pyrenees"
+#~ msgstr "Midi-Pyrenäen"
+
+#~ msgid "Guyane Francaise"
+#~ msgstr "Französisch-Guayana"
+
+#~ msgid "Franche-Comte"
+#~ msgstr "Freie Grafschaft"
+
+#~ msgid "Cancel"
+#~ msgstr "Abbrechen"
+
+#~ msgid "Rhone-Alpes"
+#~ msgstr "Rhone-Alpen"
+
+#, c-format
+#~ msgid "Error: No configuration found in config file '%s'\n"
+#~ msgstr "Fehler: Keine Konfiguration in der Datei '%s' gefunden\n"
+
+#~ msgid "Provence-Alpes-Cote-d-Azur"
+#~ msgstr "Provence-Alpes-Cote-d-Azur"
+
+#~ msgid "Media selected for map storage is not available"
+#~ msgstr ""
+#~ "Der eingestellte Speicherort für das Kartenmaterial ist nicht verfügbar."
+
+#~ msgid ""
+#~ "Sorry, we currently do not support maps above 3.8G on Android, please select "
+#~ "a smaller one."
+#~ msgstr ""
+#~ "Entschuldigung. Derzeit untestützen wir auf Android keine Karten die größer "
+#~ "als 3,8Gigabyte sind. Bitte wählen Sie eine kleinere Karte aus."
+
+#, c-format
+#~ msgid "Set destination to %ld, %ld \n"
+#~ msgstr "Setze Ziel auf %ld, %ld \n"
+
+#~ msgid "Distance from screen center (km)"
+#~ msgstr "Entfernung vom Bildschirmmittelpunkt (km)"
+
+#, c-format
+#~ msgid "Set map to %ld, %ld \n"
+#~ msgstr "Setze Karte auf %ld, %ld \n"
+
+#~ msgid ""
+#~ "New location set to %s\n"
+#~ "Restart Navit to apply the changes."
+#~ msgstr ""
+#~ "Karten-Speicherort ist %s\n"
+#~ "Starten Sie Navit erneut."
+
+#~ msgid ""
+#~ "Current map location %s is not available\n"
+#~ "Please restart Navit after you attach an SD card or select a different map "
+#~ "location."
+#~ msgstr ""
+#~ "Der Speicherpfad für die Karte ist nicht verfügbar.\n"
+#~ "Setzen Sie eine SD Karte ein und starten Sie Navit erneut\n"
+#~ "oder wählen Sie einen anderen Pfad aus."
#, c-format
#~ msgid "then leave the roundabout at the %1$s %2$s"
#~ msgstr "anschließend verlassen Sie den Kreisverkehr an der %1$s %2$s"
+#~ msgid "East yorkshire with hull"
+#~ msgstr "East Yorkshire und Hull"
+
#, c-format
#~ msgid "in %d m"
#~ msgstr "in %d m"
@@ -2843,3 +2898,7 @@ msgstr ""
#, c-format
#~ msgid "%d m"
#~ msgstr "%d m"
+
+#, c-format
+#~ msgid "Set next visit to %ld, %ld \n"
+#~ msgstr "Setze nächsten Besuch auf %ld, %ld \n"
diff --git a/po/de_CH.po.in b/po/de_CH.po.in
index d30c18584..309047f4d 100644
--- a/po/de_CH.po.in
+++ b/po/de_CH.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/el.po.in b/po/el.po.in
index 9da1b8087..a1c63d17a 100644
--- a/po/el.po.in
+++ b/po/el.po.in
@@ -1670,7 +1670,7 @@ msgstr "Ταξί"
msgid "Shopping"
msgstr "Αγορές"
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/en.po.in b/po/en.po.in
index ca337896c..a3937cb80 100644
--- a/po/en.po.in
+++ b/po/en.po.in
@@ -1669,7 +1669,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
@@ -1695,7 +1695,7 @@ msgid "Select a category"
msgstr ""
msgid "Select a distance to look for (km)"
-msgstr ""
+msgstr "Select a search radius from screen center"
msgid "Select a POI"
msgstr ""
@@ -1709,8 +1709,9 @@ msgstr ""
msgid "Direction"
msgstr ""
+# TRANSLATORS: This is the distance to a Point of Interest (POI) in the POI window. It will be feet (imperial) or, meters (metric), depending on the user's preference.
msgid "Distance(m)"
-msgstr ""
+msgstr "Distance"
msgid "Name"
msgstr ""
diff --git a/po/en_AU.po.in b/po/en_AU.po.in
index 50842f620..bf7d7a65d 100644
--- a/po/en_AU.po.in
+++ b/po/en_AU.po.in
@@ -1666,7 +1666,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
@@ -1692,7 +1692,7 @@ msgid "Select a category"
msgstr ""
msgid "Select a distance to look for (km)"
-msgstr ""
+msgstr "Select a search radius from screen center"
msgid "Select a POI"
msgstr ""
@@ -1706,8 +1706,9 @@ msgstr ""
msgid "Direction"
msgstr ""
+# TRANSLATORS: This is the distance to a Point of Interest (POI) in the POI window. It will be feet (imperial) or, meters (metric), depending on the user's preference.
msgid "Distance(m)"
-msgstr ""
+msgstr "Distance"
msgid "Name"
msgstr ""
diff --git a/po/en_CA.po.in b/po/en_CA.po.in
index fa624bc71..b0ee764cd 100644
--- a/po/en_CA.po.in
+++ b/po/en_CA.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
@@ -1689,7 +1689,7 @@ msgid "Select a category"
msgstr ""
msgid "Select a distance to look for (km)"
-msgstr ""
+msgstr "Select a search radius from screen center"
msgid "Select a POI"
msgstr ""
@@ -1703,8 +1703,9 @@ msgstr ""
msgid "Direction"
msgstr ""
+# TRANSLATORS: This is the distance to a Point of Interest (POI) in the POI window. It will be feet (imperial) or, meters (metric), depending on the user's preference.
msgid "Distance(m)"
-msgstr ""
+msgstr "Distance"
msgid "Name"
msgstr ""
diff --git a/po/en_GB.po.in b/po/en_GB.po.in
index fec19d509..81ca21295 100644
--- a/po/en_GB.po.in
+++ b/po/en_GB.po.in
@@ -1682,8 +1682,8 @@ msgstr "Taxi"
msgid "Shopping"
msgstr "Shopping"
-msgid "Distance from screen center (km)"
-msgstr "Distance from screen centre (km)"
+msgid "Select a search radius from screen center"
+msgstr ""
#, c-format
msgid "POI %s. %s"
@@ -1708,7 +1708,7 @@ msgid "Select a category"
msgstr "Select a category"
msgid "Select a distance to look for (km)"
-msgstr "Select a distance to look for (km)"
+msgstr "Select a search radius from screen center"
msgid "Select a POI"
msgstr "Select a POI"
@@ -1722,8 +1722,9 @@ msgstr "Category"
msgid "Direction"
msgstr "Direction"
+# TRANSLATORS: This is the distance to a Point of Interest (POI) in the POI window. It will be feet (imperial) or, meters (metric), depending on the user's preference.
msgid "Distance(m)"
-msgstr "Distance(m)"
+msgstr "Distance"
msgid "Name"
msgstr "Name"
diff --git a/po/eo.po.in b/po/eo.po.in
index 62a0a7128..8ac6d2526 100644
--- a/po/eo.po.in
+++ b/po/eo.po.in
@@ -1668,7 +1668,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/es.po.in b/po/es.po.in
index bbd11a961..fc43a6a87 100644
--- a/po/es.po.in
+++ b/po/es.po.in
@@ -1,5 +1,5 @@
# Spanish translations for navit
-# Copyright (C) 2006-2017 The Navit Team
+# Copyright (C) 2006-2018 The Navit Team
# This file is distributed under the same license as the navit package.
# Many thanks to the contributors of this translation:
# Benjamín Valero Espinosa https://launchpad.net/~benjavalero
@@ -25,10 +25,10 @@
msgid ""
msgstr ""
-"Project-Id-Version: navit 0.5.0\n"
+"Project-Id-Version: navit 0.5.1\n"
"Report-Msgid-Bugs-To: \n"
-"PO-Revision-Date: 2017-09-26 07:01+0000\n"
-"Last-Translator: Iñigo Huguet <inigohuguet@hotmail.com>\n"
+"PO-Revision-Date: 2018-05-01 17:39+0000\n"
+"Last-Translator: iceman75 <Unknown>\n"
"Language-Team: Chris Eubank <cteubank@gmail.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -398,9 +398,15 @@ msgstr "Orden"
msgid "Length"
msgstr "Longitud"
+msgid "mi"
+msgstr "mi"
+
msgid "km"
msgstr "km"
+msgid "feet"
+msgstr "pies"
+
msgid "m"
msgstr "m"
@@ -1466,28 +1472,24 @@ msgstr ""
"\t-v: muestra la versión y termina.\n"
#. We have not found an existing config file from all possibilities
-msgid "No config file navit.xml, navit.xml.local found\n"
+msgid "No config file navit.xml, navit.xml.local found"
msgstr ""
-"No hay fichero de configuración navit.xml, encontrado navit.xml.local\n"
#, c-format
-msgid "Error parsing config file '%s': %s\n"
-msgstr "Error cargando el fichero de configuración '%s': %s\n"
+msgid "Error parsing config file '%s': %s"
+msgstr ""
#, c-format
-msgid "Using config file '%s'\n"
-msgstr "Usando el fichero de configuración '%s'\n"
+msgid "Using config file '%s'"
+msgstr ""
#, c-format
-msgid "Error: No configuration found in config file '%s'\n"
+msgid "Error: No configuration found in config file '%s'"
msgstr ""
-"Error: No se encontró la configuración en el archivo de configuración '%s'\n"
msgid ""
-"Internal initialization failed, exiting. Check previous error messages.\n"
+"Internal initialization failed, exiting. Check previous error messages."
msgstr ""
-"Inicialización interna fallida, saliendo. Compruebe mensajes previos de "
-"error\n"
msgid "unknown street"
msgstr "calle desconocida"
@@ -1627,6 +1629,9 @@ msgstr "_Mostrar posición del cursor"
msgid "_Lock on Road"
msgstr "_Bloqueo en la ruta"
+msgid "_Follow Vehicle"
+msgstr ""
+
msgid "_Keep orientation to the North"
msgstr "Mantener _orientación al Norte"
@@ -1696,24 +1701,24 @@ msgstr "Taxi"
msgid "Shopping"
msgstr "Shopping"
-msgid "Distance from screen center (km)"
-msgstr "Distancia del centro de la pantalla (km)"
+msgid "Select a search radius from screen center"
+msgstr "Distancia del centro de la pantalla"
#, c-format
msgid "POI %s. %s"
msgstr "POI %s. %s"
#, c-format
-msgid "Set destination to %ld, %ld \n"
-msgstr "Cambiar destino a %ld, %ld \n"
+msgid "Set destination to %ld, %ld "
+msgstr ""
#, c-format
-msgid "Set map to %ld, %ld \n"
-msgstr "Cambiar mapa a % ld, %ld \n"
+msgid "Set map to %ld, %ld "
+msgstr ""
#, c-format
-msgid "Set next visit to %ld, %ld \n"
-msgstr "Conjunto siguiente visita a %ld, %ld \n"
+msgid "Set next visit to %ld, %ld "
+msgstr ""
msgid "POI search"
msgstr "Búsqueda de puntos de interés"
@@ -1783,8 +1788,8 @@ msgid "OT"
msgstr "OT"
#, c-format
-msgid "Route %4.0fkm %02d:%02d ETA"
-msgstr "Ruta %4.0fkm %02d:%02d TEL"
+msgid "Route %4.1f%s %02d:%02d ETA"
+msgstr ""
msgid "Route 0000km 0+00:00 ETA"
msgstr "Ruta 0000km 0+00:00 TEL"
@@ -2049,452 +2054,9 @@ msgstr "¡Atención! Radar"
msgid "Please decrease your speed"
msgstr "Por favor, disminuya su velocidad"
-msgid "partial match"
-msgstr "Coincidencia parcial"
-
-#. Android resource: @strings/address_search_button
-msgid "Search"
-msgstr "Búsqueda"
-
-#. Android resource: @strings/address_search_towns
-msgid "Towns"
-msgstr "Ciudades"
-
-msgid "Map data (c) OpenStreetMap contributors, ODBL"
-msgstr "Datos de Mapa (c) contribuyentes de OpenStreetMap, ODBL"
-
-msgid ""
-"Current map location %s is not available\n"
-"Please restart Navit after you attach an SD card or select a different map "
-"location."
-msgstr ""
-"Ubicación actual del mapa %s no se encuentra disponible\n"
-"Por favor reiniciar Navit después de conectar una tarjeta SD o seleccione "
-"una ubicación del mapa diferente."
-
-msgid "Downloaded maps"
-msgstr "Mapas descargados"
-
-msgid ""
-"Sorry, we currently do not support maps above 3.8G on Android, please select "
-"a smaller one."
-msgstr ""
-"Lo sentimos, actualmente no permitimos mapas por encima de 3,8 G en Android, "
-"por favor, seleccione una versión más pequeña."
-
-#. Android resource: @strings/position_popup_drive_here
-msgid "Route to here"
-msgstr "Ruta hasta aquí"
-
-msgid "Cancel"
-msgstr "Cancelar"
-
msgid "filenamePath"
msgstr ""
-msgid ""
-"New location set to %s\n"
-"Restart Navit to apply the changes."
-msgstr ""
-"Nueva ubicación cambiada a %s\n"
-"Reinicie Navit para aplicar los cambios."
-
-msgid "Whole Planet"
-msgstr "Todo el Planeta"
-
-msgid "Africa"
-msgstr "África"
-
-msgid "Canary Islands"
-msgstr "Islas Canarias"
-
-msgid "Asia"
-msgstr "Asia"
-
-msgid "Korea"
-msgstr "Corea"
-
-msgid "Taiwan"
-msgstr "Taiwán"
-
-msgid "UAE+Other"
-msgstr "Emiratos Árabes Unidos + Otros"
-
-msgid "Oceania"
-msgstr "Oceanía"
-
-msgid "Tasmania"
-msgstr "Tasmania"
-
-msgid "Victoria"
-msgstr "Victoria"
-
-msgid "New South Wales"
-msgstr "Nueva Gales del Sur"
-
-msgid "Europe"
-msgstr "Europa"
-
-msgid "Western Europe"
-msgstr "Europa Occidental"
-
-msgid "Azores"
-msgstr "Azores"
-
-msgid "BeNeLux"
-msgstr "Benelux"
-
-msgid "Alsace"
-msgstr "Alsacia"
-
-msgid "Aquitaine"
-msgstr "Aquitania"
-
-msgid "Auvergne"
-msgstr "Auvernia"
-
-msgid "Basse-Normandie"
-msgstr "Baja Normandía"
-
-msgid "Bourgogne"
-msgstr "Borgoña"
-
-msgid "Bretagne"
-msgstr "Bretaña"
-
-msgid "Centre"
-msgstr "Centro"
-
-msgid "Champagne-Ardenne"
-msgstr "Champaña - Ardenas"
-
-msgid "Corse"
-msgstr "Córcega"
-
-msgid "Franche-Comte"
-msgstr "Franco Condado"
-
-msgid "Haute-Normandie"
-msgstr "Alta Normandía"
-
-msgid "Ile-de-France"
-msgstr "Isla de Francia"
-
-msgid "Languedoc-Roussillon"
-msgstr "Languedoc - Rosellón"
-
-msgid "Limousin"
-msgstr "Limusina"
-
-msgid "Lorraine"
-msgstr "Lorena"
-
-msgid "Midi-Pyrenees"
-msgstr "Midi - Pirineos"
-
-msgid "Nord-pas-de-Calais"
-msgstr "Paso Norte de Calais"
-
-msgid "Pays-de-la-Loire"
-msgstr "Países del Loira"
-
-msgid "Picardie"
-msgstr "Paradía"
-
-msgid "Poitou-Charentes"
-msgstr "Poitou-Charentes"
-
-msgid "Provence-Alpes-Cote-d-Azur"
-msgstr "Alpes - Costa Azul"
-
-msgid "Rhone-Alpes"
-msgstr "Rhone - Alpes"
-
-msgid "Baden-Wuerttemberg"
-msgstr "Baden-Wuerttemberg"
-
-msgid "Bayern"
-msgstr "Baviera"
-
-msgid "Mittelfranken"
-msgstr "Franconia Media"
-
-msgid "Niederbayern"
-msgstr "Baja Baviera"
-
-msgid "Oberbayern"
-msgstr "Alta Baviera"
-
-msgid "Oberfranken"
-msgstr "Alta Franconia"
-
-msgid "Oberpfalz"
-msgstr "Alto Palatinado"
-
-msgid "Schwaben"
-msgstr "Schawben"
-
-msgid "Unterfranken"
-msgstr "Baja Franconia"
-
-msgid "Berlin"
-msgstr "Berlín"
-
-msgid "Brandenburg"
-msgstr "Brandenburgo"
-
-msgid "Bremen"
-msgstr "Bremen"
-
-msgid "Hamburg"
-msgstr "Hamburgo"
-
-msgid "Hessen"
-msgstr "Hessen"
-
-msgid "Mecklenburg-Vorpommern"
-msgstr "Mecklemburgo-Pomerania"
-
-msgid "Niedersachsen"
-msgstr "Niedersachsen"
-
-msgid "Nordrhein-westfalen"
-msgstr "Renania del Norte-Westfalia"
-
-msgid "Rheinland-Pfalz"
-msgstr "Renania del Norte-Westfalia"
-
-msgid "Saarland"
-msgstr "Sarre"
-
-msgid "Sachsen-Anhalt"
-msgstr "Sajonia-Anhalt"
-
-msgid "Sachsen"
-msgstr "Sachsen"
-
-msgid "Schleswig-Holstein"
-msgstr "Schleswig-Holstein"
-
-msgid "Thueringen"
-msgstr "Turingia"
-
-msgid "Mallorca"
-msgstr "Mallorca"
-
-msgid "Galicia"
-msgstr "Galicia"
-
-msgid "Scandinavia"
-msgstr "Escandinavia"
-
-msgid "England"
-msgstr "Inglaterra"
-
-msgid "Buckinghamshire"
-msgstr "Buckinghamshire"
-
-msgid "Cambridgeshire"
-msgstr "Cambridgeshire"
-
-msgid "Cumbria"
-msgstr "Cumbria"
-
-msgid "East yorkshire with hull"
-msgstr "Yorkshire Este con Hull"
-
-msgid "Essex"
-msgstr "Essex"
-
-msgid "Herefordshire"
-msgstr "Herefordshire"
-
-msgid "Kent"
-msgstr "Kent"
-
-msgid "Lancashire"
-msgstr "Lancashire"
-
-msgid "Leicestershire"
-msgstr "Leicestershire"
-
-msgid "Norfolk"
-msgstr "Norfolk"
-
-msgid "Nottinghamshire"
-msgstr "Nottinghamshire"
-
-msgid "Oxfordshire"
-msgstr "Oxfordshire"
-
-msgid "Shropshire"
-msgstr "Shropshire"
-
-msgid "Somerset"
-msgstr "Somerset"
-
-msgid "South yorkshire"
-msgstr "Yorkshire Sur"
-
-msgid "Suffolk"
-msgstr "Suffolk"
-
-msgid "Surrey"
-msgstr "Surrey"
-
-msgid "Wiltshire"
-msgstr "Wiltshire"
-
-msgid "Scotland"
-msgstr "Escocia"
-
-msgid "Wales"
-msgstr "Gales"
-
-msgid "Crete"
-msgstr "Creta"
-
-msgid "North America"
-msgstr "Norteamérica"
-
-msgid "Alaska"
-msgstr "Alaska"
-
-msgid "Hawaii"
-msgstr "Hawái"
-
-msgid "USA"
-msgstr "Estados Unidos de Norteamérica"
-
-msgid " (except Alaska and Hawaii)"
-msgstr " (excepto Alaska y Hawái)"
-
-msgid "Midwest"
-msgstr "Medio-Oeste"
-
-msgid "Michigan"
-msgstr "Michigan"
-
-msgid "Ohio"
-msgstr "Ohio"
-
-msgid "Northeast"
-msgstr "Noreste"
-
-msgid "Massachusetts"
-msgstr "Massachusetts"
-
-msgid "Vermont"
-msgstr "Vermont"
-
-msgid "Pacific"
-msgstr "Pacífico"
-
-msgid "South"
-msgstr "Sur"
-
-msgid "Arkansas"
-msgstr "Arkansas"
-
-msgid "District of Columbia"
-msgstr "Distrito de Columbia"
-
-msgid "Florida"
-msgstr "Florida"
-
-msgid "Louisiana"
-msgstr "Luisiana"
-
-msgid "Maryland"
-msgstr "Maryland"
-
-msgid "Mississippi"
-msgstr "Mississippi"
-
-msgid "Oklahoma"
-msgstr "Oklahoma"
-
-msgid "Texas"
-msgstr "Tejas"
-
-msgid "Virginia"
-msgstr "Virginia"
-
-msgid "West Virginia"
-msgstr "Virginia Occidental"
-
-msgid "West"
-msgstr "Oeste"
-
-msgid "Arizona"
-msgstr "Arizona"
-
-msgid "California"
-msgstr "California"
-
-msgid "Colorado"
-msgstr "Colorado"
-
-msgid "Idaho"
-msgstr "Idaho"
-
-msgid "Montana"
-msgstr "Montana"
-
-msgid "New Mexico"
-msgstr "Nuevo Méjico"
-
-msgid "Nevada"
-msgstr "Nevada"
-
-msgid "Oregon"
-msgstr "Oregón"
-
-msgid "Utah"
-msgstr "Utah"
-
-msgid "Washington State"
-msgstr "Estado de Washington"
-
-msgid "South+Middle America"
-msgstr "Suramérica + Centroamérica"
-
-msgid "Guyane Francaise"
-msgstr "Guayana Francesa"
-
-msgid "downloading"
-msgstr "descargando"
-
-#. Android resource: @strings/map_download_ready
-msgid "ready"
-msgstr "listo"
-
-msgid "Media selected for map storage is not available"
-msgstr ""
-"Los medios de comunicación seleccionados para el almacenamiento del mapa no "
-"está disponible"
-
-#. Android resource: @strings/map_download_not_enough_free_space
-msgid "Not enough free space"
-msgstr "No hay suficiente espacio libre"
-
-msgid "Error downloading map!"
-msgstr "Error al descargar el mapa"
-
-msgid "Error writing map!"
-msgstr "Error al guardar el mapa"
-
-msgid "Map download aborted!"
-msgstr "Descarga del mapa interrumpida"
-
-#. Android resource: @strings/map_download_eta
-msgid "ETA"
-msgstr "Tiempo estimado"
-
-#. Android resource: @strings/map_download_title
-msgid "Map download"
-msgstr "Mapa descargado"
-
msgid "Vehicle Position"
msgstr "Posición del vehículo"
@@ -2559,7 +2121,7 @@ msgid "Manual zoom"
msgstr "Zoom manual"
msgid "Layers"
-msgstr ""
+msgstr "Capas"
msgid "Zoom to route"
msgstr "Zoom a ruta"
@@ -2676,14 +2238,30 @@ msgstr "Respaldar / Restaurar"
msgid "Set map location"
msgstr "Establecer ubicación en mapa"
+#. Android resource: @strings/position_popup_drive_here
+msgid "Route to here"
+msgstr "Ruta hasta aquí"
+
#. Android resource: @strings/map_delete
msgid "Delete this map?"
msgstr "¿Borrar este mapa?"
+#. Android resource: @strings/map_download_title
+msgid "Map download"
+msgstr "Mapa descargado"
+
#. Android resource: @strings/map_download_downloading
msgid "Downloading:"
msgstr "Descargando:"
+#. Android resource: @strings/map_download_eta
+msgid "ETA"
+msgstr "Tiempo estimado"
+
+#. Android resource: @strings/map_download_ready
+msgid "ready"
+msgstr "listo"
+
#. Android resource: @strings/map_download_download_error
msgid "Error downloading map."
msgstr "Error descargando mapa"
@@ -2692,6 +2270,10 @@ msgstr "Error descargando mapa"
msgid "Map download aborted"
msgstr "Descarga de mapa interrumpida"
+#. Android resource: @strings/map_download_not_enough_free_space
+msgid "Not enough free space"
+msgstr "No hay suficiente espacio libre"
+
#. Android resource: @strings/map_no_fix
msgid "No location. Reopen after location fix."
msgstr "Sin localización. Reabra tras fijar localización."
@@ -2712,6 +2294,10 @@ msgstr "Introduzca destino"
msgid "Match partial address"
msgstr "Coincidencia parcial en la dirección"
+#. Android resource: @strings/address_search_button
+msgid "Search"
+msgstr "Búsqueda"
+
#. Android resource: @strings/address_search_searching
msgid "Searching..."
msgstr "Buscando…"
@@ -2740,6 +2326,10 @@ msgstr "No se introdujo texto"
msgid "Setting destination to:"
msgstr "Configurando destino a:"
+#. Android resource: @strings/address_search_towns
+msgid "Towns"
+msgstr "Ciudades"
+
#. Android resource: @strings/choose_an_action
msgid "Choose an action"
msgstr "Elija una acción"
@@ -2806,7 +2396,7 @@ msgstr "Restaurar"
#. Android resource: @strings/TTS_title_data_missing
msgid "System text to speech engine data is missing"
-msgstr ""
+msgstr "No hay datos de síntesis de voz del sistema"
#. Android resource: @strings/TTS_qery_install_data
msgid ""
@@ -2814,6 +2404,9 @@ msgid ""
"currently selected engine reports it is unable to speak in your language. "
"Should we ask the system to show voice download dialog?"
msgstr ""
+"Navit puede usar cualquier sintetizador de voz instalado en el dispositivo. "
+"El sintetizador seleccionado actualmente informa de que no puede hablar en "
+"su idioma. ¿Desea ver el diálogo de descarga de voces del sistema?"
#. Android resource: @strings/permissions_not_granted
msgid ""
@@ -2828,5 +2421,462 @@ msgid "One or more ungranted permissions"
msgstr "Uno o más permisos rechazados"
#, c-format
+#~ msgid "Route %4.0fkm %02d:%02d ETA"
+#~ msgstr "Ruta %4.0fkm %02d:%02d TEL"
+
+#~ msgid "No config file navit.xml, navit.xml.local found\n"
+#~ msgstr ""
+#~ "No hay fichero de configuración navit.xml, encontrado navit.xml.local\n"
+
+#, c-format
+#~ msgid "Error parsing config file '%s': %s\n"
+#~ msgstr "Error cargando el fichero de configuración '%s': %s\n"
+
+#, c-format
+#~ msgid "Using config file '%s'\n"
+#~ msgstr "Usando el fichero de configuración '%s'\n"
+
+#~ msgid ""
+#~ "Internal initialization failed, exiting. Check previous error messages.\n"
+#~ msgstr ""
+#~ "Inicialización interna fallida, saliendo. Compruebe mensajes previos de "
+#~ "error\n"
+
+#~ msgid "Cancel"
+#~ msgstr "Cancelar"
+
+#~ msgid "Downloaded maps"
+#~ msgstr "Mapas descargados"
+
+#~ msgid "partial match"
+#~ msgstr "Coincidencia parcial"
+
+#~ msgid "Taiwan"
+#~ msgstr "Taiwán"
+
+#~ msgid "Asia"
+#~ msgstr "Asia"
+
+#~ msgid "Canary Islands"
+#~ msgstr "Islas Canarias"
+
+#~ msgid "Whole Planet"
+#~ msgstr "Todo el Planeta"
+
+#~ msgid "Korea"
+#~ msgstr "Corea"
+
+#~ msgid "Tasmania"
+#~ msgstr "Tasmania"
+
+#~ msgid "Victoria"
+#~ msgstr "Victoria"
+
+#~ msgid "Oceania"
+#~ msgstr "Oceanía"
+
+#~ msgid "UAE+Other"
+#~ msgstr "Emiratos Árabes Unidos + Otros"
+
+#~ msgid "BeNeLux"
+#~ msgstr "Benelux"
+
+#~ msgid "Alsace"
+#~ msgstr "Alsacia"
+
+#~ msgid "Western Europe"
+#~ msgstr "Europa Occidental"
+
+#~ msgid "Azores"
+#~ msgstr "Azores"
+
+#~ msgid "New South Wales"
+#~ msgstr "Nueva Gales del Sur"
+
+#~ msgid "Europe"
+#~ msgstr "Europa"
+
+#~ msgid "Bourgogne"
+#~ msgstr "Borgoña"
+
+#~ msgid "Auvergne"
+#~ msgstr "Auvernia"
+
+#~ msgid "Aquitaine"
+#~ msgstr "Aquitania"
+
+#~ msgid "Basse-Normandie"
+#~ msgstr "Baja Normandía"
+
+#~ msgid "Lorraine"
+#~ msgstr "Lorena"
+
+#~ msgid "Languedoc-Roussillon"
+#~ msgstr "Languedoc - Rosellón"
+
+#~ msgid "Bretagne"
+#~ msgstr "Bretaña"
+
+#~ msgid "Haute-Normandie"
+#~ msgstr "Alta Normandía"
+
+#~ msgid "Centre"
+#~ msgstr "Centro"
+
+#~ msgid "Corse"
+#~ msgstr "Córcega"
+
+#~ msgid "Champagne-Ardenne"
+#~ msgstr "Champaña - Ardenas"
+
+#~ msgid "Baden-Wuerttemberg"
+#~ msgstr "Baden-Wuerttemberg"
+
+#~ msgid "Rhone-Alpes"
+#~ msgstr "Rhone - Alpes"
+
+#~ msgid "Provence-Alpes-Cote-d-Azur"
+#~ msgstr "Alpes - Costa Azul"
+
+#~ msgid "Midi-Pyrenees"
+#~ msgstr "Midi - Pirineos"
+
+#~ msgid "Nord-pas-de-Calais"
+#~ msgstr "Paso Norte de Calais"
+
+#~ msgid "Picardie"
+#~ msgstr "Paradía"
+
+#~ msgid "Schwaben"
+#~ msgstr "Schawben"
+
+#~ msgid "Hamburg"
+#~ msgstr "Hamburgo"
+
+#~ msgid "Bremen"
+#~ msgstr "Bremen"
+
+#~ msgid "Berlin"
+#~ msgstr "Berlín"
+
+#~ msgid "Brandenburg"
+#~ msgstr "Brandenburgo"
+
+#~ msgid "Saarland"
+#~ msgstr "Sarre"
+
+#~ msgid "Niedersachsen"
+#~ msgstr "Niedersachsen"
+
+#~ msgid "Hessen"
+#~ msgstr "Hessen"
+
+#~ msgid "Sachsen"
+#~ msgstr "Sachsen"
+
+#~ msgid "Thueringen"
+#~ msgstr "Turingia"
+
+#~ msgid "Schleswig-Holstein"
+#~ msgstr "Schleswig-Holstein"
+
+#~ msgid "Cumbria"
+#~ msgstr "Cumbria"
+
+#~ msgid "Herefordshire"
+#~ msgstr "Herefordshire"
+
+#~ msgid "Essex"
+#~ msgstr "Essex"
+
+#~ msgid "Buckinghamshire"
+#~ msgstr "Buckinghamshire"
+
+#~ msgid "Galicia"
+#~ msgstr "Galicia"
+
+#~ msgid "Mallorca"
+#~ msgstr "Mallorca"
+
+#~ msgid "England"
+#~ msgstr "Inglaterra"
+
+#~ msgid "Scandinavia"
+#~ msgstr "Escandinavia"
+
+#~ msgid "Cambridgeshire"
+#~ msgstr "Cambridgeshire"
+
+#~ msgid "Oxfordshire"
+#~ msgstr "Oxfordshire"
+
+#~ msgid "Nottinghamshire"
+#~ msgstr "Nottinghamshire"
+
+#~ msgid "Lancashire"
+#~ msgstr "Lancashire"
+
+#~ msgid "Kent"
+#~ msgstr "Kent"
+
+#~ msgid "Norfolk"
+#~ msgstr "Norfolk"
+
+#~ msgid "Leicestershire"
+#~ msgstr "Leicestershire"
+
+#~ msgid "Suffolk"
+#~ msgstr "Suffolk"
+
+#~ msgid "Somerset"
+#~ msgstr "Somerset"
+
+#~ msgid " (except Alaska and Hawaii)"
+#~ msgstr " (excepto Alaska y Hawái)"
+
+#~ msgid "USA"
+#~ msgstr "Estados Unidos de Norteamérica"
+
+#~ msgid "Hawaii"
+#~ msgstr "Hawái"
+
+#~ msgid "Alaska"
+#~ msgstr "Alaska"
+
+#~ msgid "Crete"
+#~ msgstr "Creta"
+
+#~ msgid "North America"
+#~ msgstr "Norteamérica"
+
+#~ msgid "Scotland"
+#~ msgstr "Escocia"
+
+#~ msgid "Wales"
+#~ msgstr "Gales"
+
+#~ msgid "Surrey"
+#~ msgstr "Surrey"
+
+#~ msgid "Wiltshire"
+#~ msgstr "Wiltshire"
+
+#~ msgid "Pacific"
+#~ msgstr "Pacífico"
+
+#~ msgid "South"
+#~ msgstr "Sur"
+
+#~ msgid "Arkansas"
+#~ msgstr "Arkansas"
+
+#~ msgid "District of Columbia"
+#~ msgstr "Distrito de Columbia"
+
+#~ msgid "Ohio"
+#~ msgstr "Ohio"
+
+#~ msgid "Michigan"
+#~ msgstr "Michigan"
+
+#~ msgid "Vermont"
+#~ msgstr "Vermont"
+
+#~ msgid "Massachusetts"
+#~ msgstr "Massachusetts"
+
+#~ msgid "Florida"
+#~ msgstr "Florida"
+
+#~ msgid "Louisiana"
+#~ msgstr "Luisiana"
+
+#~ msgid "Maryland"
+#~ msgstr "Maryland"
+
+#~ msgid "Oklahoma"
+#~ msgstr "Oklahoma"
+
+#~ msgid "Mississippi"
+#~ msgstr "Mississippi"
+
+#~ msgid "Texas"
+#~ msgstr "Tejas"
+
+#~ msgid "West Virginia"
+#~ msgstr "Virginia Occidental"
+
+#~ msgid "Virginia"
+#~ msgstr "Virginia"
+
+#~ msgid "Arizona"
+#~ msgstr "Arizona"
+
+#~ msgid "West"
+#~ msgstr "Oeste"
+
+#~ msgid "Washington State"
+#~ msgstr "Estado de Washington"
+
+#~ msgid "South+Middle America"
+#~ msgstr "Suramérica + Centroamérica"
+
+#~ msgid "Oregon"
+#~ msgstr "Oregón"
+
+#~ msgid "Utah"
+#~ msgstr "Utah"
+
+#~ msgid "Nevada"
+#~ msgstr "Nevada"
+
+#~ msgid "New Mexico"
+#~ msgstr "Nuevo Méjico"
+
+#~ msgid "Colorado"
+#~ msgstr "Colorado"
+
+#~ msgid "California"
+#~ msgstr "California"
+
+#~ msgid "Montana"
+#~ msgstr "Montana"
+
+#~ msgid "Idaho"
+#~ msgstr "Idaho"
+
+#~ msgid "Error downloading map!"
+#~ msgstr "Error al descargar el mapa"
+
+#~ msgid "Guyane Francaise"
+#~ msgstr "Guayana Francesa"
+
+#~ msgid "downloading"
+#~ msgstr "descargando"
+
+#~ msgid "Map download aborted!"
+#~ msgstr "Descarga del mapa interrumpida"
+
+#~ msgid "Error writing map!"
+#~ msgstr "Error al guardar el mapa"
+
+#~ msgid "Mittelfranken"
+#~ msgstr "Franconia Media"
+
+#~ msgid "Africa"
+#~ msgstr "África"
+
+#~ msgid "Map data (c) OpenStreetMap contributors, ODBL"
+#~ msgstr "Datos de Mapa (c) contribuyentes de OpenStreetMap, ODBL"
+
+#~ msgid "Ile-de-France"
+#~ msgstr "Isla de Francia"
+
+#~ msgid "Limousin"
+#~ msgstr "Limusina"
+
+#~ msgid "Pays-de-la-Loire"
+#~ msgstr "Países del Loira"
+
+#~ msgid "Poitou-Charentes"
+#~ msgstr "Poitou-Charentes"
+
+#~ msgid "Franche-Comte"
+#~ msgstr "Franco Condado"
+
+#~ msgid "Northeast"
+#~ msgstr "Noreste"
+
+#~ msgid "Midwest"
+#~ msgstr "Medio-Oeste"
+
+#~ msgid "Oberpfalz"
+#~ msgstr "Alto Palatinado"
+
+#~ msgid "Oberfranken"
+#~ msgstr "Alta Franconia"
+
+#~ msgid "Unterfranken"
+#~ msgstr "Baja Franconia"
+
+#~ msgid "Rheinland-Pfalz"
+#~ msgstr "Renania del Norte-Westfalia"
+
+#~ msgid "Mecklenburg-Vorpommern"
+#~ msgstr "Mecklemburgo-Pomerania"
+
+#~ msgid "Sachsen-Anhalt"
+#~ msgstr "Sajonia-Anhalt"
+
+#~ msgid "Nordrhein-westfalen"
+#~ msgstr "Renania del Norte-Westfalia"
+
+#~ msgid "South yorkshire"
+#~ msgstr "Yorkshire Sur"
+
+#~ msgid "Shropshire"
+#~ msgstr "Shropshire"
+
+#~ msgid "East yorkshire with hull"
+#~ msgstr "Yorkshire Este con Hull"
+
+#, c-format
#~ msgid "then leave the roundabout at the %1$s %2$s"
#~ msgstr "después salga de la rotonda por la %1$s %2$s"
+
+#~ msgid "Bayern"
+#~ msgstr "Baviera"
+
+#~ msgid "Niederbayern"
+#~ msgstr "Baja Baviera"
+
+#~ msgid "Oberbayern"
+#~ msgstr "Alta Baviera"
+
+#~ msgid "Distance from screen center (km)"
+#~ msgstr "Distancia del centro de la pantalla (km)"
+
+#, c-format
+#~ msgid "Set destination to %ld, %ld \n"
+#~ msgstr "Cambiar destino a %ld, %ld \n"
+
+#, c-format
+#~ msgid "Set map to %ld, %ld \n"
+#~ msgstr "Cambiar mapa a % ld, %ld \n"
+
+#, c-format
+#~ msgid "Set next visit to %ld, %ld \n"
+#~ msgstr "Conjunto siguiente visita a %ld, %ld \n"
+
+#~ msgid ""
+#~ "Current map location %s is not available\n"
+#~ "Please restart Navit after you attach an SD card or select a different map "
+#~ "location."
+#~ msgstr ""
+#~ "Ubicación actual del mapa %s no se encuentra disponible\n"
+#~ "Por favor reiniciar Navit después de conectar una tarjeta SD o seleccione "
+#~ "una ubicación del mapa diferente."
+
+#~ msgid ""
+#~ "Sorry, we currently do not support maps above 3.8G on Android, please select "
+#~ "a smaller one."
+#~ msgstr ""
+#~ "Lo sentimos, actualmente no permitimos mapas por encima de 3,8 G en Android, "
+#~ "por favor, seleccione una versión más pequeña."
+
+#~ msgid ""
+#~ "New location set to %s\n"
+#~ "Restart Navit to apply the changes."
+#~ msgstr ""
+#~ "Nueva ubicación cambiada a %s\n"
+#~ "Reinicie Navit para aplicar los cambios."
+
+#~ msgid "Media selected for map storage is not available"
+#~ msgstr ""
+#~ "Los medios de comunicación seleccionados para el almacenamiento del mapa no "
+#~ "está disponible"
+
+#, c-format
+#~ msgid "Error: No configuration found in config file '%s'\n"
+#~ msgstr ""
+#~ "Error: No se encontró la configuración en el archivo de configuración '%s'\n"
diff --git a/po/et.po.in b/po/et.po.in
index 23781e008..52fa1f929 100644
--- a/po/et.po.in
+++ b/po/et.po.in
@@ -1670,7 +1670,7 @@ msgstr "Takso"
msgid "Shopping"
msgstr "kauplus"
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/eu.po.in b/po/eu.po.in
index d0de74d5d..71158c04b 100644
--- a/po/eu.po.in
+++ b/po/eu.po.in
@@ -1665,7 +1665,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/fa.po.in b/po/fa.po.in
index 96767686f..0492353c8 100644
--- a/po/fa.po.in
+++ b/po/fa.po.in
@@ -1665,7 +1665,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/fi.po.in b/po/fi.po.in
index 5662696a4..d318c22ee 100644
--- a/po/fi.po.in
+++ b/po/fi.po.in
@@ -1675,7 +1675,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/fil.po.in b/po/fil.po.in
index a882e9f6d..ccf4cb877 100644
--- a/po/fil.po.in
+++ b/po/fil.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/fo.po.in b/po/fo.po.in
index f713a82aa..8c71ca69b 100644
--- a/po/fo.po.in
+++ b/po/fo.po.in
@@ -1665,7 +1665,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/fr.po.in b/po/fr.po.in
index 7ef62db68..0a561a1fe 100644
--- a/po/fr.po.in
+++ b/po/fr.po.in
@@ -1712,8 +1712,8 @@ msgstr "Taxi"
msgid "Shopping"
msgstr "Achats"
-msgid "Distance from screen center (km)"
-msgstr "Distance du centre de l'écran (km)"
+msgid "Select a search radius from screen center"
+msgstr "Distance du centre de l'écran"
#, c-format
msgid "POI %s. %s"
diff --git a/po/fr_CH.po.in b/po/fr_CH.po.in
index 68d798ee5..a32aa6ed6 100644
--- a/po/fr_CH.po.in
+++ b/po/fr_CH.po.in
@@ -1668,7 +1668,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/fy.po.in b/po/fy.po.in
index 5b3e798cb..9f13fe11a 100644
--- a/po/fy.po.in
+++ b/po/fy.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/gl.po.in b/po/gl.po.in
index e4cb41cd6..75a724aa7 100644
--- a/po/gl.po.in
+++ b/po/gl.po.in
@@ -1667,7 +1667,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/he.po.in b/po/he.po.in
index 2fb3df1eb..199ae7044 100644
--- a/po/he.po.in
+++ b/po/he.po.in
@@ -1668,7 +1668,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/hi.po.in b/po/hi.po.in
index ba0d20e10..2e5fa87f3 100644
--- a/po/hi.po.in
+++ b/po/hi.po.in
@@ -1665,7 +1665,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/hr.po.in b/po/hr.po.in
index c39cad97e..3f4a63f55 100644
--- a/po/hr.po.in
+++ b/po/hr.po.in
@@ -1670,7 +1670,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/hu.po.in b/po/hu.po.in
index c4ec926a7..6aa19c503 100644
--- a/po/hu.po.in
+++ b/po/hu.po.in
@@ -1682,7 +1682,7 @@ msgstr "Taxi"
msgid "Shopping"
msgstr "Bevásárlás"
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/id.po.in b/po/id.po.in
index 302b11212..45c74dc0d 100644
--- a/po/id.po.in
+++ b/po/id.po.in
@@ -1667,7 +1667,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/it.po.in b/po/it.po.in
index c2c557d7e..b3073d7b1 100644
--- a/po/it.po.in
+++ b/po/it.po.in
@@ -1684,8 +1684,8 @@ msgstr "Taxi"
msgid "Shopping"
msgstr "Negozi"
-msgid "Distance from screen center (km)"
-msgstr "Distanza dal centro dello schermo (km)"
+msgid "Select a search radius from screen center"
+msgstr "Distanza dal centro dello schermo"
#, c-format
msgid "POI %s. %s"
diff --git a/po/ja.po.in b/po/ja.po.in
index 66ce52328..5761862d0 100644
--- a/po/ja.po.in
+++ b/po/ja.po.in
@@ -1665,7 +1665,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/jv.po.in b/po/jv.po.in
index 500c5c750..56ae5c2a2 100644
--- a/po/jv.po.in
+++ b/po/jv.po.in
@@ -1665,7 +1665,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/kk.po.in b/po/kk.po.in
index 7f48773a4..65f250701 100644
--- a/po/kk.po.in
+++ b/po/kk.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/kn.po.in b/po/kn.po.in
index 7a1b13a20..6a2adc742 100644
--- a/po/kn.po.in
+++ b/po/kn.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/ko.po.in b/po/ko.po.in
index 4c908aa68..f65870083 100644
--- a/po/ko.po.in
+++ b/po/ko.po.in
@@ -1660,7 +1660,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/ku.po.in b/po/ku.po.in
index 22f79bbea..8073de5d7 100644
--- a/po/ku.po.in
+++ b/po/ku.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/lb.po.in b/po/lb.po.in
index a8e5450db..143cc2543 100644
--- a/po/lb.po.in
+++ b/po/lb.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/lt.po.in b/po/lt.po.in
index b1c4a4e68..626cb5bd4 100644
--- a/po/lt.po.in
+++ b/po/lt.po.in
@@ -1676,8 +1676,8 @@ msgstr "Taksi"
msgid "Shopping"
msgstr "Parduotuvė"
-msgid "Distance from screen center (km)"
-msgstr "Atstumas nuo ekrano vidaus (km)"
+msgid "Select a search radius from screen center"
+msgstr "Atstumas nuo ekrano vidaus"
#, c-format
msgid "POI %s. %s"
diff --git a/po/lv.po.in b/po/lv.po.in
index 8f729a8ca..d947bf182 100644
--- a/po/lv.po.in
+++ b/po/lv.po.in
@@ -1674,8 +1674,8 @@ msgstr "Taksometrs"
msgid "Shopping"
msgstr "Iepirkšanās"
-msgid "Distance from screen center (km)"
-msgstr "Attālums no ekrāna centra (km)"
+msgid "Select a search radius from screen center"
+msgstr "Attālums no ekrāna centra"
#, c-format
msgid "POI %s. %s"
diff --git a/po/mk.po.in b/po/mk.po.in
index d51a99fb3..4e5f164f1 100644
--- a/po/mk.po.in
+++ b/po/mk.po.in
@@ -1671,7 +1671,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/ml.po.in b/po/ml.po.in
index 3658437a3..27320e951 100644
--- a/po/ml.po.in
+++ b/po/ml.po.in
@@ -1666,7 +1666,7 @@ msgstr "ടാക്സി സ്റ്റാന്റ്"
msgid "Shopping"
msgstr "കച്ചവടസ്ഥാപനം"
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr "സ്ക്രീനിന്റെ നടുവില്‍ നിന്നുള്ള ദൂരം (കി. മി. )"
#, c-format
diff --git a/po/mn.po.in b/po/mn.po.in
index d9c7c7fff..8fa8def8e 100644
--- a/po/mn.po.in
+++ b/po/mn.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/mr.po.in b/po/mr.po.in
index 69acbd449..9fca9a747 100644
--- a/po/mr.po.in
+++ b/po/mr.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/nb.po.in b/po/nb.po.in
index 04b4436e0..7537c06b0 100644
--- a/po/nb.po.in
+++ b/po/nb.po.in
@@ -1672,7 +1672,7 @@ msgstr "Drosje"
msgid "Shopping"
msgstr "Handleområde"
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/nds.po.in b/po/nds.po.in
index 76b176302..4d6ea6993 100644
--- a/po/nds.po.in
+++ b/po/nds.po.in
@@ -1672,7 +1672,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/nl.po.in b/po/nl.po.in
index 92f587b6d..5e796b6b5 100644
--- a/po/nl.po.in
+++ b/po/nl.po.in
@@ -1686,8 +1686,8 @@ msgstr "Taxi"
msgid "Shopping"
msgstr "Winkelen"
-msgid "Distance from screen center (km)"
-msgstr "Afstand vanaf schem midden (km)"
+msgid "Select a search radius from screen center"
+msgstr "Afstand vanaf schem midden"
#, c-format
msgid "POI %s. %s"
diff --git a/po/nn.po.in b/po/nn.po.in
index b4d4c66e5..8c0a2514d 100644
--- a/po/nn.po.in
+++ b/po/nn.po.in
@@ -1666,7 +1666,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/pl.po.in b/po/pl.po.in
index cd4bf9dd5..e6d950141 100644
--- a/po/pl.po.in
+++ b/po/pl.po.in
@@ -1684,7 +1684,7 @@ msgstr "Postój taksówek"
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/pms.po.in b/po/pms.po.in
index e52ac59fb..971d5381b 100644
--- a/po/pms.po.in
+++ b/po/pms.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/pt.po.in b/po/pt.po.in
index 418c05136..58f2a7302 100644
--- a/po/pt.po.in
+++ b/po/pt.po.in
@@ -1689,8 +1689,8 @@ msgstr "Táxi"
msgid "Shopping"
msgstr "Compras"
-msgid "Distance from screen center (km)"
-msgstr "Distância ao centro do ecrã (km)"
+msgid "Select a search radius from screen center"
+msgstr "Distância ao centro do ecrã"
#, c-format
msgid "POI %s. %s"
diff --git a/po/pt_BR.po.in b/po/pt_BR.po.in
index 3c4d5c6d7..7248d436d 100644
--- a/po/pt_BR.po.in
+++ b/po/pt_BR.po.in
@@ -1693,8 +1693,8 @@ msgstr "Táxi"
msgid "Shopping"
msgstr "Comprando"
-msgid "Distance from screen center (km)"
-msgstr "Distância do centro da tela (km)"
+msgid "Select a search radius from screen center"
+msgstr "Distância do centro da tela"
#, c-format
msgid "POI %s. %s"
diff --git a/po/ro.po.in b/po/ro.po.in
index 28ac5f311..af94e5c83 100644
--- a/po/ro.po.in
+++ b/po/ro.po.in
@@ -1676,7 +1676,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/ru.po.in b/po/ru.po.in
index 0f1944e1d..2e140b8f2 100644
--- a/po/ru.po.in
+++ b/po/ru.po.in
@@ -1692,7 +1692,7 @@ msgstr "Такси"
msgid "Shopping"
msgstr "Магазин"
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr "Расстояние от центра экрана (км)"
#, c-format
diff --git a/po/sc.po.in b/po/sc.po.in
index 4c3fffbe6..12a7f7477 100644
--- a/po/sc.po.in
+++ b/po/sc.po.in
@@ -1664,7 +1664,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/si.po.in b/po/si.po.in
index 890eb0644..32a6d1db1 100644
--- a/po/si.po.in
+++ b/po/si.po.in
@@ -1663,7 +1663,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/sk.po.in b/po/sk.po.in
index b11a80e2e..e8a6be27d 100644
--- a/po/sk.po.in
+++ b/po/sk.po.in
@@ -1678,7 +1678,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/sl.po.in b/po/sl.po.in
index 703178d83..803222366 100644
--- a/po/sl.po.in
+++ b/po/sl.po.in
@@ -1672,7 +1672,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/sq.po.in b/po/sq.po.in
index 58850e77b..1cb93ac25 100644
--- a/po/sq.po.in
+++ b/po/sq.po.in
@@ -1662,7 +1662,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/sr.po.in b/po/sr.po.in
index 00ec61b1d..9bc8414fa 100644
--- a/po/sr.po.in
+++ b/po/sr.po.in
@@ -1678,8 +1678,8 @@ msgstr "Такси"
msgid "Shopping"
msgstr "Куповина"
-msgid "Distance from screen center (km)"
-msgstr "Растојање од средишта екрана (km)"
+msgid "Select a search radius from screen center"
+msgstr "Растојање од средишта екрана"
#, c-format
msgid "POI %s. %s"
diff --git a/po/sv.po.in b/po/sv.po.in
index 8a4a292c4..752757fc6 100644
--- a/po/sv.po.in
+++ b/po/sv.po.in
@@ -1671,7 +1671,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/sw.po.in b/po/sw.po.in
index d1fe07e31..207f2a08f 100644
--- a/po/sw.po.in
+++ b/po/sw.po.in
@@ -1665,7 +1665,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/ta.po.in b/po/ta.po.in
index 74ba7a104..ff176435f 100644
--- a/po/ta.po.in
+++ b/po/ta.po.in
@@ -1665,7 +1665,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/te.po.in b/po/te.po.in
index eb412a536..240168138 100644
--- a/po/te.po.in
+++ b/po/te.po.in
@@ -1665,7 +1665,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/th.po.in b/po/th.po.in
index 58ac0335d..daf3a8093 100644
--- a/po/th.po.in
+++ b/po/th.po.in
@@ -1662,7 +1662,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/tr.po.in b/po/tr.po.in
index 1802c15a9..19ad72810 100644
--- a/po/tr.po.in
+++ b/po/tr.po.in
@@ -1685,7 +1685,7 @@ msgstr "Taksi"
msgid "Shopping"
msgstr "Alışveriş"
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/uk.po.in b/po/uk.po.in
index 787e71327..10422f902 100644
--- a/po/uk.po.in
+++ b/po/uk.po.in
@@ -1672,7 +1672,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/ur.po.in b/po/ur.po.in
index e1ffb4b51..cd9a0e884 100644
--- a/po/ur.po.in
+++ b/po/ur.po.in
@@ -1677,7 +1677,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/vi.po.in b/po/vi.po.in
index 54ec62618..91f5dbcf0 100644
--- a/po/vi.po.in
+++ b/po/vi.po.in
@@ -1664,7 +1664,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/zh_CN.po.in b/po/zh_CN.po.in
index 44f5e1cc3..27186f960 100644
--- a/po/zh_CN.po.in
+++ b/po/zh_CN.po.in
@@ -1668,7 +1668,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/zh_HK.po.in b/po/zh_HK.po.in
index 49fb73c01..9fe382c65 100644
--- a/po/zh_HK.po.in
+++ b/po/zh_HK.po.in
@@ -1666,7 +1666,7 @@ msgstr ""
msgid "Shopping"
msgstr ""
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr ""
#, c-format
diff --git a/po/zh_TW.po.in b/po/zh_TW.po.in
index bd136f1e8..6511c9154 100644
--- a/po/zh_TW.po.in
+++ b/po/zh_TW.po.in
@@ -1665,7 +1665,7 @@ msgstr "計程車"
msgid "Shopping"
msgstr "購物處"
-msgid "Distance from screen center (km)"
+msgid "Select a search radius from screen center"
msgstr "距螢幕中心的距離 (公里)"
#, c-format