summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormvglasow <michael -at- vonglasow.com>2019-07-28 19:14:54 +0200
committermvglasow <michael -at- vonglasow.com>2019-07-28 19:14:54 +0200
commitdcfd347996ef5bd6b7c581266792d24794c3751b (patch)
tree87821ce9ba0a55c110e1da72f5f619dc180dbd3a
parent834f75624e27c32427e7dc9bc4c2bfc605e53478 (diff)
parent6bd2ceb8fd645dc401549979efeb042d1922ff21 (diff)
downloadnavit-dcfd347996ef5bd6b7c581266792d24794c3751b.tar.gz
Merge branch 'master' into traffic
-rw-r--r--.circleci/config.yml44
-rw-r--r--.github/PULL_REQUEST_TEMPLATE.md2
-rwxr-xr-xCMakeLists.txt116
-rw-r--r--CONTRIBUTING.md59
-rw-r--r--COPYING4
-rw-r--r--Toolchain/arm-mingw32ce.cmake8
-rw-r--r--Toolchain/i386-mingw32ce.cmake8
-rw-r--r--Toolchain/mingw.cmake34
-rw-r--r--Toolchain/mingw32.cmake22
-rw-r--r--cmake/FindDBus.cmake26
-rw-r--r--cmake/FindDBusGLib.cmake23
-rw-r--r--cmake/FindGTK2.cmake471
-rw-r--r--cmake/FindGlib.cmake39
-rw-r--r--cmake/FindGmodule.cmake28
-rw-r--r--cmake/Findespeak.cmake29
-rw-r--r--cmake/LibFindMacros.cmake99
-rwxr-xr-xcmake/version.cmake68
-rw-r--r--config.h.in (renamed from config.h.cmake)7
-rw-r--r--docs/basic_configuration.rst66
-rw-r--r--docs/binfile.rst122
-rw-r--r--docs/conf.py11
-rw-r--r--docs/configuration/advanced.rst101
-rw-r--r--docs/configuration/display.rst111
-rw-r--r--docs/configuration/general.rst83
-rw-r--r--docs/configuration/index.rst143
-rw-r--r--docs/configuration/layout.rst71
-rw-r--r--docs/configuration/vehicle.rst117
-rw-r--r--docs/development/programming_guidelines.rst181
-rw-r--r--docs/index.rst48
-rw-r--r--docs/maps.rst20
-rw-r--r--docs/navit.pngbin0 -> 367957 bytes
-rw-r--r--docs/osm.rst117
-rw-r--r--navit/CMakeLists.txt23
-rw-r--r--navit/android.c19
-rw-r--r--navit/android.h1
-rw-r--r--navit/android/CMakeLists.txt1
-rw-r--r--navit/android/res/values/strings.xml1
-rw-r--r--navit/android/src/org/navitproject/navit/Navit.java100
-rw-r--r--navit/android/src/org/navitproject/navit/NavitGraphics.java342
-rw-r--r--navit/android/src/org/navitproject/navit/NavitSpeech2.java4
-rw-r--r--navit/attr.h1
-rw-r--r--navit/attr_def.h6
-rw-r--r--navit/autoload/osso/osso.c4
-rw-r--r--navit/binding/dbus/binding_dbus.c2
-rw-r--r--navit/binding/win32/CMakeLists.txt2
-rw-r--r--navit/bookmarks.c7
-rw-r--r--navit/coord.h12
-rw-r--r--navit/file.c5
-rw-r--r--navit/graphics/android/graphics_android.c59
-rw-r--r--navit/graphics/qt5/QNavitWidget.cpp2
-rw-r--r--navit/graphics/qt5/event_qt5.cpp2
-rw-r--r--navit/graphics/sdl/graphics_sdl.c2
-rw-r--r--navit/gui/gtk/destination.c50
-rw-r--r--navit/gui/gtk/gui_gtk_poi.c71
-rw-r--r--navit/gui/gtk/gui_gtk_window.c1
-rw-r--r--navit/gui/internal/CMakeLists.txt4
-rw-r--r--navit/gui/internal/gui_internal.c200
-rw-r--r--navit/gui/internal/gui_internal_command.c100
-rw-r--r--navit/gui/internal/gui_internal_keyboard.c127
-rw-r--r--navit/gui/internal/gui_internal_keyboard.h2
-rw-r--r--navit/gui/internal/gui_internal_menu.c3
-rw-r--r--navit/gui/internal/gui_internal_widget.c78
-rw-r--r--navit/icons/follow.svg168
-rw-r--r--navit/icons/gui_android_menu.svg174
-rw-r--r--navit/icons/sound_off.svg114
-rw-r--r--navit/icons/sound_on.svg122
-rw-r--r--navit/icons/zoom_auto.svg147
-rw-r--r--navit/icons/zoom_in.svg142
-rw-r--r--navit/icons/zoom_manual.svg147
-rw-r--r--navit/icons/zoom_out.svg144
-rw-r--r--navit/item.c6
-rw-r--r--navit/item_def.h7
-rw-r--r--navit/navit.c132
-rw-r--r--navit/navit.h2
-rw-r--r--navit/osd.c2
-rw-r--r--navit/osd/core/osd_core.c42
-rw-r--r--navit/plugin/pedestrian/pedestrian.c2
-rw-r--r--navit/route.c18
-rw-r--r--navit/route_protected.h1
-rw-r--r--navit/speech/android/speech_android.c9
-rw-r--r--navit/speech/qt5_espeak/Qt5EspeakAudioOut.cpp3
-rw-r--r--navit/start_real.c4
-rw-r--r--navit/traffic.c227
-rw-r--r--navit/traffic.h1
-rw-r--r--navit/traffic/traff_android/traffic_traff_android.c2
-rw-r--r--navit/transform.c22
-rw-r--r--navit/transform.h4
-rw-r--r--navit/util.c64
-rw-r--r--navit/util.h3
-rw-r--r--navit/vehicle/android/vehicle_android.c4
-rw-r--r--navit/vehicle/gpsd/vehicle_gpsd.c4
-rw-r--r--navit/vehicle/qt5/vehicle_qt5.cpp2
-rw-r--r--navit/version.h.in2
-rw-r--r--navit/xslt/openmoko.xslt8
-rw-r--r--navit/xslt/osd_android.xslt2
-rw-r--r--navit/xslt/osd_minimum.xslt30
-rw-r--r--navit/xslt/sailfish_osd.xslt29
-rw-r--r--navit/xslt/tomtom.xslt17
-rw-r--r--navit/xslt/wince.xslt7
-rw-r--r--navit/zipfile.h4
-rwxr-xr-xscripts/build_android.sh2
-rwxr-xr-xscripts/build_android_arm.sh13
-rw-r--r--scripts/build_win32.sh9
-rw-r--r--scripts/build_wince.sh14
104 files changed, 3696 insertions, 1669 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml
index f8172eebd..823ca54d0 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -65,7 +65,7 @@ jobs:
- store_artifacts:
name: Store rpm
path: ../rpmbuild/RPMS/
- build_android_arm:
+ build_android:
working_directory: ~/code
docker:
- image: circleci/android:api-28-ndk
@@ -136,13 +136,16 @@ jobs:
steps:
- checkout
- run:
- name: Build for Windows
+ name: Prepare the Windows build environment
command: |
apt-get update && xargs -a scripts/setup_14.04_requirements.list apt-get install -y
apt-get install -y software-properties-common
add-apt-repository -y ppa:george-edison55/cmake-3.x
apt-get remove -y cmake
- apt-get install -y cmake3
+ apt-get install -y cmake3 mingw-w64 mingw-w64-tools default-jdk nsis libsaxonb-java curl
+ - run:
+ name: Build for Windows
+ command: |
bash scripts/build_win32.sh
- store_artifacts:
path: win32/navit.exe
@@ -220,10 +223,33 @@ jobs:
command: mkdir -p ~/.ssh/ && ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
- add_ssh_keys:
fingerprints:
- - "16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48"
+ - "58:42:73:90:cc:68:f7:34:7e:37:37:fa:b3:26:1f:a5"
- run:
name: Update results to Github
command: export GIT_TERMINAL_PROMPT=0 && git push origin $CIRCLE_SHA1:refs/heads/master
+ check_spelling:
+ <<: *defaults
+ steps:
+ - checkout
+ - run:
+ name: Install curl
+ command: apt-get update && apt-get -y install curl
+ - run:
+ name: Install misspell
+ command: |
+ curl -L -o ./install-misspell.sh https://git.io/misspell
+ sh ./install-misspell.sh -b /usr/local/bin/
+ - run:
+ name: Check docs folder for misspells
+ command: |
+ misspell docs/ > typos.txt
+ if [[ $( wc -l < typos.txt ) -gt 0 ]]; then
+ echo "Typos/mispells found, please fix them";
+ cat typos.txt
+ exit -1
+ fi
+
+
workflows:
version: 2
build_all:
@@ -232,7 +258,7 @@ workflows:
- build_linux:
requires:
- sanity_check
- - build_android_arm:
+ - build_android:
requires:
- sanity_check
- build_sailfish:
@@ -253,7 +279,7 @@ workflows:
- run_doxygen:
requires:
- build_linux
- - build_android_arm
+ - build_android
- build_win32
- build_wince
- build_tomtom_minimal
@@ -264,7 +290,7 @@ workflows:
- merge_trunk_in_master:
requires:
- build_linux
- - build_android_arm
+ - build_android
- build_win32
- build_wince
- build_tomtom_minimal
@@ -272,3 +298,7 @@ workflows:
filters:
branches:
only: /^trunk$/
+ - check_spelling:
+ filters:
+ branches:
+ only: /^readthedocs$/
diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md
index 5623ec64a..bafbcbcb2 100644
--- a/.github/PULL_REQUEST_TEMPLATE.md
+++ b/.github/PULL_REQUEST_TEMPLATE.md
@@ -3,4 +3,4 @@ Before opening a pull request on navit, make sure your commit message follows ou
https://wiki.navit-project.org/index.php/Commit_guidelines
and that your code is compliant with out coding style guidelines:
-https://wiki.navit-project.org/index.php/Programming_guidelines
+https://navit.readthedocs.io/en/trunk/development/programming_guidelines.html
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 93ed3eb76..4890afa04 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,3 +1,5 @@
+cmake_minimum_required(VERSION 3.2)
+
set(MACOSX_BUNDLE_GUI_IDENTIFIER "org.navitproject.navit")
set(MACOSX_BUNDLE_BUNDLE_NAME "Navit")
message(STATUS "Building with CMake V${CMAKE_VERSION}")
@@ -11,7 +13,6 @@ if (NOT DISABLE_CXX)
enable_language(CXX OPTIONAL)
endif(NOT DISABLE_CXX)
-cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
set(NAVIT_VERSION_MAJOR "0")
set(NAVIT_VERSION_MINOR "5")
set(NAVIT_VERSION_PATCH "3")
@@ -146,8 +147,55 @@ INCLUDE (CheckIncludeFiles)
INCLUDE (CheckLibraryExists)
INCLUDE (CheckFunctionExists)
INCLUDE (CheckSymbolExists)
-find_package(Glib)
-find_package(Gmodule)
+
+################################
+# pkg-config based detection #
+################################
+
+find_package(PkgConfig)
+if(PKG_CONFIG_FOUND)
+ pkg_check_modules ( GMODULE gmodule-2.0 )
+ if (GMODULE_FOUND)
+ set(HAVE_GMODULE 1)
+ include_directories(${GMODULE_INCLUDE_DIRS})
+ list(APPEND NAVIT_LIBS ${GMODULE_LIBRARIES})
+ endif(GMODULE_FOUND)
+
+ pkg_check_modules (GLIB2 glib-2.0>=2.10)
+ if (GLIB2_FOUND)
+ set(HAVE_GLIB 1)
+ include_directories(${GLIB2_INCLUDE_DIRS})
+ list(APPEND NAVIT_LIBS ${GLIB2_LIBRARIES})
+ else(GLIB2_FOUND)
+ set_with_reason(support/glib "Glib not found" TRUE ${INTL_LIBS})
+ endif(GLIB2_FOUND)
+
+ pkg_check_modules(FONTCONFIG "fontconfig >= 2.2.0")
+ pkg_check_modules(DBUS "dbus-1 >= 1.4")
+ pkg_check_modules(DBUSGLIB dbus-glib-1)
+ if(DBUSGLIB_FOUND)
+ include_directories(${DBUSGLIB_INCLUDE_DIRS})
+ set_with_reason(binding/dbus "dbus-glib-1 found" TRUE ${DBUSGLIB_LIBRARIES})
+ set_with_reason(speech/dbus "dbus-glib-1 found" TRUE ${DBUSGLIB_LIBRARIES})
+ set_with_reason(vehicle/gpsd_dbus "dbus-glib-1 found" TRUE ${DBUSGLIB_LIBRARIES})
+ endif()
+
+ pkg_check_modules(LIBLOCATION liblocation)
+ pkg_check_modules(LIBOSSO libosso)
+ # Accept even old versions of libgps, because N810 uses an old version (see #1179).
+ pkg_check_modules(LIBGPS libgps)
+ pkg_check_modules(LIBGPS19 libgps>=2.90)
+ # libgpsd<V3.1 is buggy if LC_ALL is set.
+ pkg_check_modules(LIBGPS_NEW libgps>=3.1)
+ pkg_check_modules(LIBGARMIN libgarmin)
+ pkg_check_modules(IMLIB2 imlib2)
+ if(IMLIB2_FOUND)
+ set(HAVE_IMLIB2 1)
+ endif(IMLIB2_FOUND)
+endif(PKG_CONFIG_FOUND)
+
+#find_package(Iconv)
+#find_package(Gmodule)
find_package(ZLIB)
find_package(Freetype)
#find_library(SDL2MAIN SDL2)
@@ -162,10 +210,9 @@ find_package(GLUT)
find_package(GTK2 2.6 COMPONENTS gtk)
find_package(Gettext)
find_package(PNG)
-find_package(DBusGLib)
find_package(PythonLibs)
find_package(Threads)
-libfind_pkg_check_modules(FONTCONFIG fontconfig)
+
#Qt detection
if (NOT DISABLE_QT)
find_package(Qt5Widgets)
@@ -191,22 +238,6 @@ if (NOT DISABLE_QT)
endif (Qt5Widgets_FOUND OR Qt5Quick_FOUND OR Qt5Sensors_FOUND)
endif (NOT DISABLE_QT)
-#pkg-config based detection
-find_package(PkgConfig)
-if(PKG_CONFIG_FOUND)
- pkg_check_modules(LIBLOCATION liblocation)
- pkg_check_modules(LIBOSSO libosso)
- # Accept even old versions of libgps, because N810 uses an old version (see #1179).
- pkg_check_modules(LIBGPS libgps)
- pkg_check_modules(LIBGPS19 libgps>=2.90)
- # libgpsd<V3.1 is buggy if LC_ALL is set.
- pkg_check_modules(LIBGPS_NEW libgps>=3.1)
- pkg_check_modules(LIBGARMIN libgarmin)
- pkg_check_modules(IMLIB2 imlib2)
- if(IMLIB2_FOUND)
- set(HAVE_IMLIB2 1)
- endif(IMLIB2_FOUND)
-endif(PKG_CONFIG_FOUND)
#Simple checks
CHECK_INCLUDE_FILES(wordexp.h HAVE_WORDEXP)
CHECK_INCLUDE_FILES(endian.h HAVE_ENDIAN_H)
@@ -256,18 +287,7 @@ if (CMAKE_USE_PTHREADS_INIT)
list(APPEND NAVIT_LIBS pthread)
endif(NOT ANDROID)
endif(CMAKE_USE_PTHREADS_INIT)
-if (Glib_FOUND)
- set(HAVE_GLIB 1)
- include_directories(${Glib_INCLUDE_DIRS})
- list(APPEND NAVIT_LIBS ${Glib_LIBRARIES})
-else(Glib_FOUND)
- set_with_reason(support/glib "Glib not found" TRUE ${INTL_LIBS})
-endif(Glib_FOUND)
-if (Gmodule_FOUND)
- set(HAVE_GMODULE 1)
- include_directories(${Gmodule_INCLUDE_DIRS})
- list(APPEND NAVIT_LIBS ${Gmodule_LIBRARIES})
-endif(Gmodule_FOUND)
+
if(ZLIB_FOUND)
set(HAVE_ZLIB 1)
include_directories(${ZLIB_INCLUDE_DIRS})
@@ -288,7 +308,7 @@ if (NOT HAVE_WORDEXP)
message(STATUS "wordexp.h not found. use internal wordexp")
set_with_reason(support/wordexp "native wordexp missing" TRUE)
endif()
-if (NOT Glib_FOUND)
+if (NOT GLIB2_FOUND)
set_with_reason(support/ezxml "Glib not found" TRUE)
endif()
@@ -440,13 +460,6 @@ if (LIBGARMIN_FOUND)
set_with_reason(map/garmin "Garmin library found" TRUE ${LIBGARMIN_LDFLAGS})
endif(LIBGARMIN_FOUND)
-if(DBusGLib_FOUND)
- include_directories(${DBusGLib_INCLUDE_DIRS})
- set_with_reason(binding/dbus "dbus-glib-1 found" TRUE ${DBusGLib_LIBRARIES})
- set_with_reason(speech/dbus "dbus-glib-1 found" TRUE ${DBusGLib_LIBRARIES})
- set_with_reason(vehicle/gpsd_dbus "dbus-glib-1 found" TRUE ${DBusGLib_LIBRARIES})
-endif()
-
if(PYTHONLIBS_FOUND)
set_with_reason(binding/python "python libraries [${PYTHONLIBS_VERSION_STRING}] found" TRUE ${PYTHON_LIBRARIES})
endif()
@@ -516,6 +529,14 @@ add_feature(USE_SVG "default" TRUE)
add_feature(SVG2PNG "default" TRUE)
add_feature(SAMPLE_MAP "default" TRUE)
add_feature(NETWORK_INFO "default" FALSE)
+add_feature(GUI_INTERNAL_VISUAL_DBG "default" FALSE)
+
+if (GUI_INTERNAL_VISUAL_DBG)
+ list(FIND ALL_MODULES gui/internal GUI_INTERNAL_ENABLED)
+ if ( ${GUI_INTERNAL_ENABLED} LESS 0 )
+ message(WARNING "GUI_INTERNAL_VISUAL_DBG enabled but gui/internal module is not included in compilation")
+ endif()
+endif(GUI_INTERNAL_VISUAL_DBG)
IF(NOT svg2png_scaling)
IF(NOT ANDROID)
@@ -576,7 +597,7 @@ if(NOT CACHE_SIZE)
endif(NOT CACHE_SIZE)
if(WIN32 OR WINCE)
- SET(CMAKE_EXECUTABLE_SUFFIX ".exe")
+ SET(CMAKE_EXECUTABLE_SUFFIX ".exe") #remove it when wince'll use cmake 3
add_module(graphics/win32 "Windows detected" TRUE)
add_plugin(support/win32 "Windows detected" TRUE)
@@ -637,6 +658,7 @@ if (WIN32 AND NOT WINCE)
set(HAVE_STDINT_H 1)
list(APPEND NAVIT_LIBS winmm)
set_with_reason(speech/cmdline "using native tts system of windows instead of espeak" TRUE)
+ set(HAVE_PRAGMA_PACK 1)
endif()
if(WINCE)
add_plugin(support/libc "wince detected" TRUE)
@@ -666,6 +688,13 @@ if(CMAKE_SIZEOF_VOID_P LESS 8)
set_with_reason(BUILD_MAPTOOL "maptool works only on 64 bit architectures" FALSE)
endif()
+if(BUILD_MAPTOOL)
+ find_package(Protobuf-c REQUIRED)
+ if(NOT PROTOBUF_C_FOUND)
+ set_with_reason(BUILD_MAPTOOL "PROTOBUF-C not found" FALSE)
+ endif()
+endif()
+
set(LOCALEDIR "${LOCALE_DIR}")
find_program(BZCAT NAMES bzcat)
@@ -791,7 +820,8 @@ CHECK_FUNCTION_EXISTS (posix_memalign HAVE_POSIX_MEMALIGN)
CHECK_FUNCTION_EXISTS (popen HAVE_POPEN)
CHECK_FUNCTION_EXISTS (_atoi64 HAVE__ATOI64)
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h)
+CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/config.h" )
# Compile with -Wall -Wextra. We need all the help we can get from the compiler :-).
# Disabled warnings:
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index e116f8ccd..d94366471 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,10 +1,63 @@
# Contributing
-Welcome to Navit! If you are interested in contributing to the [Navit code repo](README.md)
+Welcome to Navit! We welcome contributions!
+
+If you are interested in contributing to the [Navit code repo](README.md)
then checkout the [Wiki](https://wiki.navit-project.org/index.php/Main_Page)
+and our [ReadTheDocs space](https://navit.readthedocs.io)
When pushing a pull request, please make sure you follow our:
-* [programming guidelines](https://wiki.navit-project.org/index.php/Programming_guidelines)
+* [programming guidelines](https://navit.readthedocs.io/en/trunk/development/programming_guidelines.html)
* [commit message guidelines](https://wiki.navit-project.org/index.php/Commit_guidelines)
-For more information on our developement process, see: https://wiki.navit-project.org/index.php/Development
+For more information on our development process, see: https://wiki.navit-project.org/index.php/Development
+
+## Submitting patches
+
+We are very happy that you like to participate and help the [[team]] to improve Navit :) To make this teamwork a pleasure for all, we will try to guide you trough this process:
+
+### Preparation
+
+Make sure you are familar with our (development tips)[https://wiki.navit-project.org/index.php/Development], learned about the codebase and our guidelines.
+If you found a bug, please open a [GitHub issue](https://github.com/navit-gps/navit/issues) and bring up all details so others can check them and help you on isolating the defective code.
+Point out that you like to submit a patch.
+
+### Contibuting via a Pull Request
+
+The easiest way to get started is to fork Navit, work on the feature and submit a pull request.
+
+Prepare your repository:
+ * Fork the [Github repository](https://github.com/navit-gps/navit) and clone it using `git clone` (note that we use the `trunk`
+ branch as our branch of reference for developments)
+ * always use a separate branch for your improvement: ` git checkout -b <name of your branch>`
+
+Enhance Navit:
+ * Find the bug (and please address only one issue per patch!) and try to fix it
+ * always document new functions according to the doxygen standard discussed in the [programming guidelines](https://navit.readthedocs.io/en/trunk/development/programming_guidelines.html)
+ * Test test test if still compiles and the behaviour is as expected
+ * Think about possible side effects (as performance, different settings, ...)
+
+Submit your work:
+ * Get the newest Git Navit version (see [this documentation](https://help.github.com/en/articles/syncing-a-fork) on how to sync your fork) and apply your changes once more
+ * Test if everything still works fine
+ * double check that you are on the correct branch with git status
+ * commit your change using our [commit message guidelines](https://wiki.navit-project.org/index.php/Commit_guidelines)
+ * push your branch (`git push origin <name of your branch>`)
+ * [Create a pull request](https://help.github.com/articles/creating-a-pull-request/) on github
+ * Wait to verify that all the tests in our CI finish successfully
+
+If at some point you want to get write access to our repository, just [contact us](https://wiki.navit-project.org/index.php/Contacts).
+
+### Review
+
+It might take some time until somebody reviews the pull request (maybe try to reach out using one of the various ccontact methods [listed in the wiki](https://wiki.navit-project.org/index.php/Contacts)).
+If your changes are more complex, catch up new ideas, or still have some minor problems, it might be discussed and we might ask you to submit an updated version/adapt your changes.
+
+So that's it, you helped Navit to go one step forward. Thank you very much :)
+
+## See also
+
+ * [programming guidelines](https://navit.readthedocs.io/en/trunk/development/programming_guidelines.html)
+ * [commit message guidelines](https://wiki.navit-project.org/index.php/Commit_guidelines)
+ * [Reporting Bugs](https://wiki.navit-project.org/index.php/Reporting_Bugs)
+ * [Translations](https://wiki.navit-project.org/index.php/Translations)
diff --git a/COPYING b/COPYING
index d53a7767c..e460889b1 100644
--- a/COPYING
+++ b/COPYING
@@ -1,4 +1,4 @@
-The following files are lincensed under the terms of the
+The following files are licensed under the terms of the
GNU General Public License (see GPL-2):
navit/tools/gpx2navit_txt/src/utils.c
@@ -105,7 +105,7 @@ navit/callback.c
contrib/android_build.sh
contrib/sjjb_import.pl
-The following files are lincensed under the terms of the
+The following files are licensed under the terms of the
GNU Library General Public License (see LGPL):
navit/callback.h
diff --git a/Toolchain/arm-mingw32ce.cmake b/Toolchain/arm-mingw32ce.cmake
deleted file mode 100644
index 4ccdd22c4..000000000
--- a/Toolchain/arm-mingw32ce.cmake
+++ /dev/null
@@ -1,8 +0,0 @@
-SET(CMAKE_SYSTEM_NAME WINCE)
-
-# specify the cross compiler
-FIND_PROGRAM(CMAKE_C_COMPILER NAMES arm-mingw32ce-gcc arm-wince-mingw32ce-gcc)
-FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES arm-mingw32ce-g++ arm-wince-mingw32ce-g++)
-FIND_PROGRAM(CMAKE_RC_COMPILER_INIT NAMES arm-mingw32ce-windres arm-wince-mingw32ce-windres)
-SET(PKG_CONFIG_EXECUTABLE "arm-mingw32ce-pkg-config")
-SET(WINCE TRUE)
diff --git a/Toolchain/i386-mingw32ce.cmake b/Toolchain/i386-mingw32ce.cmake
deleted file mode 100644
index a1cc562f6..000000000
--- a/Toolchain/i386-mingw32ce.cmake
+++ /dev/null
@@ -1,8 +0,0 @@
-SET(CMAKE_SYSTEM_NAME WINCE)
-
-# specify the cross compiler
-FIND_PROGRAM(CMAKE_C_COMPILER NAMES i386-mingw32ce-gcc )
-FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES i386-mingw32ce-g++ )
-FIND_PROGRAM(CMAKE_RC_COMPILER_INIT NAMES i386-mingw32ce-windres )
-SET(PKG_CONFIG_EXECUTABLE "i386-mingw32ce-pkg-config")
-SET(WINCE TRUE)
diff --git a/Toolchain/mingw.cmake b/Toolchain/mingw.cmake
new file mode 100644
index 000000000..c50c80f91
--- /dev/null
+++ b/Toolchain/mingw.cmake
@@ -0,0 +1,34 @@
+SET(CMAKE_C_COMPILER ${TARGET_ARCH}-gcc)
+SET(CMAKE_CXX_COMPILER ${TARGET_ARCH}-g++)
+SET(CMAKE_RC_COMPILER_INIT ${TARGET_ARCH}-windres)
+SET(PKG_CONFIG_EXECUTABLE ${TARGET_ARCH}-pkg-config)
+
+# unecessary according to https://cmake.org/cmake/help/v3.4/variable/WINCE.html
+# TODO: plateform wince change too much things for now, fix later.
+# WindowsCETest -> WindowsCE
+if (CMAKE_SYSTEM_NAME STREQUAL "WindowsCETest")
+ SET(CMAKE_EXECUTABLE_SUFFIX ".exe")
+ SET(WINCE TRUE)
+endif()
+
+if(WINCE)
+ # MINGW32CE_PATH is set in dockerfile
+ message(STATUS "Wince toolchain in $ENV{MINGW32CE_PATH}")
+
+ #SET(CMAKE_FIND_ROOT_PATH $ENV{MINGW32CE_PATH})
+ #SET(CMAKE_INSTALL_PREFIX $ENV{MINGW32CE_PATH})
+endif(WINCE)
+
+if(WIN32)
+ message(STATUS "WIN32 case")
+ #SET(CMAKE_FIND_ROOT_PATH ${MINGW_INSTALL_PREFIX})
+ #SET(QT_MOC_EXECUTABLE bin/moc)
+ #SET(QT_RCC_EXECUTABLE ${MINGW_INSTALL_PREFIX}/bin/rcc)
+ #SET(QT_UIC_EXECUTABLE ${MINGW_INSTALL_PREFIX}/bin/uic)
+ SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
+ SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
+ SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
+
+ SET(CMAKE_FIND_ROOT_PATH ${MINGW_INSTALL_PREFIX})
+ SET(CMAKE_INSTALL_PREFIX ${MINGW_INSTALL_PREFIX})
+endif()
diff --git a/Toolchain/mingw32.cmake b/Toolchain/mingw32.cmake
deleted file mode 100644
index f16eb51ad..000000000
--- a/Toolchain/mingw32.cmake
+++ /dev/null
@@ -1,22 +0,0 @@
-SET(CMAKE_SYSTEM_NAME Windows)
-
-FIND_PROGRAM(CMAKE_C_COMPILER NAMES i686-w64-mingw32-gcc i686-mingw32-gcc i586-mingw32-gcc i386-mingw32-gcc i586-mingw32msvc-gcc mingw32-gcc)
-FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES i686-w64-mingw32-g++ i686-mingw32-g++ i586-mingw32-g++ i386-mingw32-g++ i586-mingw32msvc-g++ mingw32-g++)
-
-FIND_PROGRAM(CMAKE_RC_COMPILER_INIT NAMES i686-w64-mingw32-windres i686-mingw32-windres i586-mingw32-windres i386-mingw32-windres mingw32-windres i586-mingw32msvc-windres windres.exe)
-
-FIND_PROGRAM(CMAKE_AR NAMES i686-w64-mingw32-ar i686-mingw32-ar i586-mingw32-ar i386-mingw32-ar i586-mingw32msvc-ar mingw32-ar ar.exe)
-
-FIND_PROGRAM(PKG_CONFIG_EXECUTABLE i686-w64-mingw32-pkg-config mingw32-pkg-config)
-
-IF (NOT CMAKE_FIND_ROOT_PATH)
-EXECUTE_PROCESS(
- COMMAND ${CMAKE_C_COMPILER} -print-sysroot
- OUTPUT_VARIABLE CMAKE_FIND_ROOT_PATH
-)
-ENDIF(NOT CMAKE_FIND_ROOT_PATH)
-
-
-set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
-set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
-set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
diff --git a/cmake/FindDBus.cmake b/cmake/FindDBus.cmake
deleted file mode 100644
index b6bbdb53d..000000000
--- a/cmake/FindDBus.cmake
+++ /dev/null
@@ -1,26 +0,0 @@
-include(LibFindMacros)
-
-libfind_pkg_check_modules(DBUS_PKGCONFIG dbus-1)
-
-FIND_PATH(DBus_INCLUDE_DIR dbus/dbus.h
- PATHS
- ${DBUS_PKGCONFIG_INCLUDE_DIRS}
- /usr/include/dbus-1.0
-# PATH_SUFFIXES dbus
-)
-
-FIND_PATH(DBus_INCLUDE_DIR_ARCH dbus/dbus-arch-deps.h
- PATHS
- ${DBUS_PKGCONFIG_INCLUDE_DIRS}
- /usr/lib/dbus-1.0/include
-# PATH_SUFFIXES dbus
-)
-
-FIND_LIBRARY(DBus_LIBRARY
- NAMES dbus-1
- PATHS ${DBUS_PKGCONFIG_LIBRARY_DIRS}
-)
-
-set(DBus_PROCESS_INCLUDES DBus_INCLUDE_DIR DBus_INCLUDE_DIR_ARCH)
-set(DBus_PROCESS_LIBS DBus_LIBRARY)
-libfind_process(DBus)
diff --git a/cmake/FindDBusGLib.cmake b/cmake/FindDBusGLib.cmake
deleted file mode 100644
index 57bbd022a..000000000
--- a/cmake/FindDBusGLib.cmake
+++ /dev/null
@@ -1,23 +0,0 @@
-FIND_PACKAGE(DBus)
-
-include(LibFindMacros)
-
-libfind_pkg_check_modules(DBUS_GLIB_PKGCONFIG dbus-glib-1)
-
-FIND_PATH(DBusGLib_INCLUDE_DIR dbus/dbus-glib.h
- PATHS
- ${DBUS_GLIB_PKGCONFIG_INCLUDE_DIRS}
- /usr/include/dbus-1.0
-# PATH_SUFFIXES dbus
-)
-
-FIND_LIBRARY(DBusGLib_LIBRARY
- NAMES
- dbus-glib-1
- PATHS
- ${DBUS_GLIB_PKGCONFIG_LIBRARY_DIRS}
-)
-
-set(DBusGLib_PROCESS_INCLUDES DBusGLib_INCLUDE_DIR DBus_INCLUDE_DIRS)
-set(DBusGLib_PROCESS_LIBS DBusGLib_LIBRARY DBus_LIBRARIES)
-libfind_process(DBusGLib)
diff --git a/cmake/FindGTK2.cmake b/cmake/FindGTK2.cmake
deleted file mode 100644
index d538ca3e8..000000000
--- a/cmake/FindGTK2.cmake
+++ /dev/null
@@ -1,471 +0,0 @@
-# - Try to find GTK2
-# Once done this will define
-#
-# GTK2_FOUND - System has Boost
-# GTK2_INCLUDE_DIRS - GTK2 include directory
-# GTK2_LIBRARIES - Link these to use GTK2
-# GTK2_LIBRARY_DIRS - The path to where the GTK2 library files are.
-# GTK2_DEFINITIONS - Compiler switches required for using GTK2
-#
-# Copyright (c) 2007 Andreas Schneider <mail@cynapses.org>
-#
-# Redistribution and use is allowed according to the terms of the New
-# BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-#
-
-# Set GTK2_DEBUG to enable debug output.
-macro(GTK2_DEBUG_MESSAGE _message)
- if (GTK2_DEBUG)
- message(STATUS "(DEBUG) ${_message}")
- endif (GTK2_DEBUG)
-endmacro(GTK2_DEBUG_MESSAGE _message)
-
-if (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS)
- # in cache already
- set(GTK2_FOUND TRUE)
-else (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS)
-
- # use pkg-config to get the directories and then use these values
- # in the FIND_PATH() and FIND_LIBRARY() calls
- include(UsePkgConfig)
-
- pkgconfig(gtk+-2.0 _GTK2IncDir _GTK2LinkDir _GTK2LinkFlags _GTK2Cflags)
-
- find_path(GTK2_GTK_INCLUDE_DIR
- NAMES
- gtk/gtk.h
- PATHS
- $ENV{GTK2_HOME}
- ${_GTK2IncDir}
- ${_GTK2IncDir}/gtk-2.0
- /usr/include/gtk-2.0
- /usr/local/include/gtk-2.0
- /opt/include/gtk-2.0
- /opt/gnome/include/gtk-2.0
- /sw/include/gtk-2.0
- )
- gtk2_debug_message("GTK2_GTK_INCLUDE_DIR is ${GTK2_GTK_INCLUDE_DIR}")
-
- # Some Linux distributions (e.g. Red Hat) have glibconfig.h
- # and glib.h in different directories, so we need to look
- # for both.
- # - Atanas Georgiev <atanas@cs.columbia.edu>
- pkgconfig(glib-2.0 _GLIB2IncDir _GLIB2LinkDir _GLIB2LinkFlags _GLIB2Cflags)
- pkgconfig(gmodule-2.0 _GMODULE2IncDir _GMODULE2LinkDir _GMODULE2LinkFlags _GMODULE2Cflags)
-
- find_path(GTK2_GLIBCONFIG_INCLUDE_DIR
- NAMES
- glibconfig.h
- PATHS
- ${_GLIB2IncDir}
- ${_GMODULE2IncDir}
- ${_GMODULE2IncDir}/glib-2.0
- ${_GLIB2LinkDir}/glib-2.0/include
- /opt/gnome/lib64/glib-2.0/include
- /opt/gnome/lib/glib-2.0/include
- /opt/lib/glib-2.0/include
- /usr/lib64/glib-2.0/include
- /usr/lib/glib-2.0/include
- /sw/lib/glib-2.0/include
- )
- gtk2_debug_message("GTK2_GLIBCONFIG_INCLUDE_DIR is ${GTK2_GLIBCONFIG_INCLUDE_DIR}")
-
- find_path(GTK2_GLIB_INCLUDE_DIR
- NAMES
- glib.h
- PATHS
- ${_GLIB2IncDir}
- ${_GLIB2IncDir}/glib-2.0
- ${_GMODULE2IncDir}
- /opt/include/glib-2.0
- /opt/gnome/include/glib-2.0
- /usr/include/glib-2.0
- /sw/include/glib-2.0
- )
- gtk2_debug_message("GTK2_GLIB_INCLUDE_DIR is ${GTK2_GLIB_INCLUDE_DIR}")
-
- pkgconfig(gdk-2.0 _GDK2IncDir _GDK2LinkDir _GDK2LinkFlags _GDK2Cflags)
-
- find_path(GTK2_GDK_INCLUDE_DIR
- NAMES
- gdkconfig.h
- PATHS
- ${_GDK2IncDir}
- ${_GDK2IncDir}/gtk-2.0
- ${_GDK2LinkDir}/gtk-2.0/include
- /opt/gnome/lib/gtk-2.0/include
- /opt/gnome/lib64/gtk-2.0/include
- /opt/lib/gtk-2.0/include
- /usr/lib/gtk-2.0/include
- /usr/lib64/gtk-2.0/include
- /sw/lib/gtk-2.0/include
- )
- gtk2_debug_message("GTK2_GDK_INCLUDE_DIR is ${GTK2_GDK_INCLUDE_DIR}")
-
- find_path(GTK2_GTKGL_INCLUDE_DIR
- NAMES
- gtkgl/gtkglarea.h
- PATHS
- ${_GLIB2IncDir}
- /usr/include
- /usr/local/include
- /usr/openwin/share/include
- /opt/gnome/include
- /opt/include
- /sw/include
- )
- gtk2_debug_message("GTK2_GTKGL_INCLUDE_DIR is ${GTK2_GTKGL_INCLUDE_DIR}")
-
- pkgconfig(pango _PANGOIncDir _PANGOLinkDir _PANGOLinkFlags _PANGOCflags)
-
- find_path(GTK2_PANGO_INCLUDE_DIR
- NAMES
- pango/pango.h
- PATHS
- ${_PANGOIncDir}
- ${_PANGOIncDir}/pango-1.0/
- /usr/include/pango-1.0
- /opt/gnome/include/pango-1.0
- /opt/include/pango-1.0
- /sw/include/pango-1.0
- )
- gtk2_debug_message("GTK2_PANGO_INCLUDE_DIR is ${GTK2_PANGO_INCLUDE_DIR}")
-
- pkgconfig(cairo _CAIROIncDir _CAIROLinkDir _CAIROLinkFlags _CAIROCflags)
-
- find_path(GTK2_CAIRO_INCLUDE_DIR
- NAMES
- cairo.h
- PATHS
- ${_CAIROIncDir}
- ${_CAIROIncDir}/cairo
- /opt/gnome/include/cairo
- /usr/include
- /usr/include/cairo
- /opt/include
- /opt/include/cairo
- /sw/include
- /sw/include/cairo
- )
- gtk2_debug_message("GTK2_CAIRO_INCLUDE_DIR is ${GTK2_CAIRO_INCLUDE_DIR}")
-
- pkgconfig(gdk-pixbuf-2.0 _GDKPIXBUFIncDir _GDKPIXBUFLinkDir _GDKPIXBUFLinkFlags _GDKPIXBUFCflags)
-
- find_path(GTK2_GDKPIXBUF_INCLUDE_DIR
- NAMES
- gdk-pixbuf/gdk-pixbuf.h
- PATHS
- ${_GDKPIXBUFIncDir}
- ${_GDKPIXBUFIncDir}/gdk-pixbuf-2.0
- /opt/gnome/include/cairo
- /usr/include
- /usr/include/cairo
- /opt/include
- /opt/include/cairo
- /sw/include
- /sw/include/cairo
- /sw/include/gdk-pixbuf-2.0
- )
- gtk2_debug_message("GTK2_CAIRO_INCLUDE_DIR is ${GTK2_CAIRO_INCLUDE_DIR}")
-
- pkgconfig(atk _ATKIncDir _ATKLinkDir _ATKLinkFlags _ATKCflags)
-
- find_path(GTK2_ATK_INCLUDE_DIR
- NAMES
- atk/atk.h
- PATHS
- ${_ATKIncDir}
- ${_ATKIncDir}/atk-1.0
- /opt/gnome/include/atk-1.0
- /usr/include/atk-1.0
- /opt/include/atk-1.0
- /sw/include/atk-1.0
- )
- gtk2_debug_message("GTK2_ATK_INCLUDE_DIR is ${GTK2_ATK_INCLUDE_DIR}")
- if (UNIX)
- find_library(GTK2_GTK_LIBRARY
- NAMES
- gtk-x11-2.0
- PATHS
- ${_GTK2LinkDir}
- /usr/lib
- /usr/local/lib
- /usr/openwin/lib
- /usr/X11R6/lib
- /opt/gnome/lib
- /opt/lib
- /sw/lib
- )
- gtk2_debug_message("GTK2_GTK_LIBRARY is ${GTK2_GTK_LIBRARY}")
-
- find_library(GTK2_GDK_LIBRARY
- NAMES
- gdk-x11-2.0
- PATHS
- ${_GDK2LinkDir}
- /usr/lib
- /usr/local/lib
- /usr/openwin/lib
- /usr/X11R6/lib
- /opt/gnome/lib
- /opt/lib
- /sw/lib
- )
- gtk2_debug_message("GTK2_GDK_LIBRARY is ${GTK2_GDK_LIBRARY}")
- endif(UNIX)
- if (WIN32)
-
- find_library(GTK2_GTK_LIBRARY
- NAMES
- gtk-win32-2.0
- PATHS
- ${_GTK2LinkDir}
- /usr/lib
- /usr/local/lib
- /usr/openwin/lib
- /usr/X11R6/lib
- /opt/gnome/lib
- /opt/lib
- /sw/lib
- )
- gtk2_debug_message("GTK2_GTK_LIBRARY is ${GTK2_GTK_LIBRARY}")
-
- find_library(GTK2_GDK_LIBRARY
- NAMES
- gdk-win32-2.0
- PATHS
- ${_GDK2LinkDir}
- /usr/lib
- /usr/local/lib
- /usr/openwin/lib
- /usr/X11R6/lib
- /opt/gnome/lib
- /opt/lib
- /sw/lib
- )
- endif (WIN32)
- find_library(GTK2_GDK_PIXBUF_LIBRARY
- NAMES
- gdk_pixbuf-2.0
- PATHS
- ${_GDK2LinkDir}
- /usr/lib
- /usr/local/lib
- /usr/openwin/lib
- /usr/X11R6/lib
- /opt/gnome/lib
- /opt/lib
- /sw/lib
- )
- gtk2_debug_message("GTK2_GDK_PIXBUF_LIBRARY is ${GTK2_GDK_PIXBUF_LIBRARY}")
-
- find_library(GTK2_GMODULE_LIBRARY
- NAMES
- gmodule-2.0
- PATHS
- ${_GMODULE2LinkDir}
- /usr/lib
- /usr/local/lib
- /usr/openwin/lib
- /usr/X11R6/lib
- /opt/gnome/lib
- /opt/lib
- /sw/lib
- )
- gtk2_debug_message("GTK2_GMODULE_LIBRARY is ${GTK2_GMODULE_LIBRARY}")
-
- find_library(GTK2_GTHREAD_LIBRARY
- NAMES
- gthread-2.0
- PATHS
- ${_GTK2LinkDir}
- /usr/lib
- /usr/local/lib
- /usr/openwin/lib
- /usr/X11R6/lib
- /opt/gnome/lib
- /opt/lib
- /sw/lib
- )
- gtk2_debug_message("GTK2_GTHREAD_LIBRARY is ${GTK2_GTHREAD_LIBRARY}")
-
- find_library(GTK2_GOBJECT_LIBRARY
- NAMES
- gobject-2.0
- PATHS
- ${_GTK2LinkDir}
- /usr/lib
- /usr/local/lib
- /usr/openwin/lib
- /usr/X11R6/lib
- /opt/gnome/lib
- /opt/lib
- /sw/lib
- )
- gtk2_debug_message("GTK2_GOBJECT_LIBRARY is ${GTK2_GOBJECT_LIBRARY}")
-
- find_library(GTK2_GLIB_LIBRARY
- NAMES
- glib-2.0
- PATHS
- ${_GLIB2LinkDir}
- /usr/lib
- /usr/local/lib
- /usr/openwin/lib
- /usr/X11R6/lib
- /opt/gnome/lib
- /opt/lib
- /sw/lib
- )
- gtk2_debug_message("GTK2_GLIB_LIBRARY is ${GTK2_GLIB_LIBRARY}")
-
- find_library(GTK2_GTKGL_LIBRARY
- NAMES
- gtkgl
- PATHS
- ${_GTK2LinkDir}
- /usr/lib
- /usr/local/lib
- /usr/openwin/lib
- /usr/X11R6/lib
- /opt/gnome/lib
- /opt/lib
- /sw/lib
- )
- gtk2_debug_message("GTK2_GTKGL_LIBRARY is ${GTK2_GTKGL_LIBRARY}")
-
- find_library(GTK2_PANGO_LIBRARY
- NAMES
- pango-1.0
- PATHS
- ${_PANGOLinkDir}
- /usr/lib
- /usr/local/lib
- /usr/openwin/lib
- /usr/X11R6/lib
- /opt/gnome/lib
- /opt/lib
- /sw/lib
- )
- gtk2_debug_message("GTK2_PANGO_LIBRARY is ${GTK2_PANGO_LIBRARY}")
-
- find_library(GTK2_CAIRO_LIBRARY
- NAMES
- pangocairo-1.0
- PATHS
- ${_CAIROLinkDir}
- /usr/lib
- /usr/local/lib
- /usr/openwin/lib
- /usr/X11R6/lib
- /opt/gnome/lib
- /opt/lib
- /sw/lib
- )
- gtk2_debug_message("GTK2_PANGO_LIBRARY is ${GTK2_CAIRO_LIBRARY}")
-
- find_library(GTK2_ATK_LIBRARY
- NAMES
- atk-1.0
- PATHS
- ${_ATKinkDir}
- /usr/lib
- /usr/local/lib
- /usr/openwin/lib
- /usr/X11R6/lib
- /opt/gnome/lib
- /opt/lib
- /sw/lib
- )
- gtk2_debug_message("GTK2_ATK_LIBRARY is ${GTK2_ATK_LIBRARY}")
-
- set(GTK2_INCLUDE_DIRS
- ${GTK2_GTK_INCLUDE_DIR}
- ${GTK2_GLIBCONFIG_INCLUDE_DIR}
- ${GTK2_GLIB_INCLUDE_DIR}
- ${GTK2_GDK_INCLUDE_DIR}
- ${GTK2_PANGO_INCLUDE_DIR}
- ${GTK2_CAIRO_INCLUDE_DIR}
- ${GTK2_ATK_INCLUDE_DIR}
- )
-
- if(GTK2_GDKPIXBUF_INCLUDE_DIR)
- set(GTK2_INCLUDE_DIRS ${GTK2_INCLUDE_DIRS} ${GTK2_GDKPIXBUF_INCLUDE_DIR})
- endif(GTK2_GDKPIXBUF_INCLUDE_DIR)
-
- if (GTK2_GTK_LIBRARY AND GTK2_GTK_INCLUDE_DIR)
- if (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR)
- if (GTK2_GMODULE_LIBRARY)
- if (GTK2_GTHREAD_LIBRARY)
- if (GTK2_GOBJECT_LIBRARY)
- if (GTK2_PANGO_LIBRARY AND GTK2_PANGO_INCLUDE_DIR)
- if (GTK2_CAIRO_LIBRARY AND GTK2_CAIRO_INCLUDE_DIR)
- if (GTK2_ATK_LIBRARY AND GTK2_ATK_INCLUDE_DIR)
-
- # set GTK2 libraries
- set (GTK2_LIBRARIES
- ${GTK2_GTK_LIBRARY}
- ${GTK2_GDK_LIBRARY}
- ${GTK2_GDK_PIXBUF_LIBRARY}
- ${GTK2_GMODULE_LIBRARY}
- ${GTK2_GTHREAD_LIBRARY}
- ${GTK2_GOBJECT_LIBRARY}
- ${GTK2_PANGO_LIBRARY}
- ${GTK2_CAIRO_LIBRARY}
- ${GTK2_ATK_LIBRARY}
- )
-
- # check for gtkgl support
- if (GTK2_GTKGL_LIBRARY AND GTK2_GTKGL_INCLUDE_DIR)
- set(GTK2_GTKGL_FOUND TRUE)
-
-# set(GTK2_INCLUDE_DIRS
-# ${GTK2_INCLUDE_DIRS}
-# ${GTK2_GTKGL_INCLUDE_DIR}
-# )
-
-# set(GTK2_LIBRARIES
-# ${GTK2_LIBRARIES}
-# ${GTK2_GTKGL_LIBRARY}
-# )
- endif (GTK2_GTKGL_LIBRARY AND GTK2_GTKGL_INCLUDE_DIR)
-
- else (GTK2_ATK_LIBRARY AND GTK2_ATK_INCLUDE_DIR)
- endif (GTK2_ATK_LIBRARY AND GTK2_ATK_INCLUDE_DIR)
- else (GTK2_CAIRO_LIBRARY AND GTK2_CAIRO_INCLUDE_DIR)
- endif (GTK2_CAIRO_LIBRARY AND GTK2_CAIRO_INCLUDE_DIR)
- else (GTK2_PANGO_LIBRARY AND GTK2_PANGO_INCLUDE_DIR)
- endif (GTK2_PANGO_LIBRARY AND GTK2_PANGO_INCLUDE_DIR)
- else (GTK2_GOBJECT_LIBRARY)
- endif (GTK2_GOBJECT_LIBRARY)
- else (GTK2_GTHREAD_LIBRARY)
- endif (GTK2_GTHREAD_LIBRARY)
- else (GTK2_GMODULE_LIBRARY)
- endif (GTK2_GMODULE_LIBRARY)
- else (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR)
- endif (GTK2_GDK_LIBRARY AND GTK2_GDK_PIXBUF_LIBRARY AND GTK2_GDK_INCLUDE_DIR)
- else (GTK2_GTK_LIBRARY AND GTK2_GTK_INCLUDE_DIR)
- endif (GTK2_GTK_LIBRARY AND GTK2_GTK_INCLUDE_DIR)
-
-
- if (GTK2_INCLUDE_DIRS AND GTK2_LIBRARIES)
- set(GTK2_FOUND TRUE)
- endif (GTK2_INCLUDE_DIRS AND GTK2_LIBRARIES)
-
- if (GTK2_FOUND)
- if (NOT GTK2_FIND_QUIETLY)
- message(STATUS "Found GTK2: ${GTK2_LIBRARIES}")
- endif (NOT GTK2_FIND_QUIETLY)
- else (GTK2_FOUND)
- if (GTK2_FIND_REQUIRED)
- message(FATAL_ERROR "Could not find GTK2")
- endif (GTK2_FIND_REQUIRED)
- endif (GTK2_FOUND)
-
- # show the GTK2_INCLUDE_DIRS and GTK2_LIBRARIES variables only in the advanced view
- mark_as_advanced(GTK2_INCLUDE_DIRS GTK2_LIBRARIES)
-
-
-endif (GTK2_LIBRARIES AND GTK2_INCLUDE_DIRS)
-
diff --git a/cmake/FindGlib.cmake b/cmake/FindGlib.cmake
deleted file mode 100644
index 43414ff54..000000000
--- a/cmake/FindGlib.cmake
+++ /dev/null
@@ -1,39 +0,0 @@
-# - Try to find Glib-2.0 (with gobject)
-# Once done, this will define
-#
-# Glib_FOUND - system has Glib
-# Glib_INCLUDE_DIRS - the Glib include directories
-# Glib_LIBRARIES - link these to use Glib
-
-include(LibFindMacros)
-
-# Use pkg-config to get hints about paths
-libfind_pkg_check_modules(Glib_PKGCONF glib-2.0)
-
-# Main include dir
-find_path(Glib_INCLUDE_DIR
- NAMES glib.h
- PATHS ${Glib_PKGCONF_INCLUDE_DIRS} /sw/include
- PATH_SUFFIXES glib-2.0
-)
-
-# Glib-related libraries also use a separate config header, which is in lib dir
-find_path(GlibConfig_INCLUDE_DIR
- NAMES glibconfig.h
- PATHS ${Glib_PKGCONF_INCLUDE_DIRS} /usr /sw
- PATH_SUFFIXES lib/glib-2.0/include
-)
-
-# Finally the library itself
-find_library(Glib_LIBRARY
- NAMES glib-2.0
- PATHS ${Glib_PKGCONF_LIBRARY_DIRS} /sw/lib
-)
-
-# Set the include dir variables and the libraries and let libfind_process do the rest.
-# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
-set(Glib_PROCESS_INCLUDES Glib_INCLUDE_DIR GlibConfig_INCLUDE_DIR)
-set(Glib_PROCESS_LIBS Glib_LIBRARY)
-libfind_process(Glib)
-
-
diff --git a/cmake/FindGmodule.cmake b/cmake/FindGmodule.cmake
deleted file mode 100644
index 2d5ddd0bb..000000000
--- a/cmake/FindGmodule.cmake
+++ /dev/null
@@ -1,28 +0,0 @@
-# - Try to find Glib-2.0 (with gobject)
-# Once done, this will define
-#
-# Glib_FOUND - system has Glib
-# Glib_INCLUDE_DIRS - the Glib include directories
-# Glib_LIBRARIES - link these to use Glib
-
-include(LibFindMacros)
-
-libfind_pkg_check_modules(Gmodule_PKGCONF gmodule-2.0)
-# Main include dir
-find_path(Gmodule_INCLUDE_DIR
- NAMES gmodule.h
- PATHS ${Gmodule_PKGCONF_INCLUDE_DIRS}
- PATH_SUFFIXES gmodule-2.0
-)
-
-# Finally the modulerary itself
-find_library(Gmodule_LIBRARY
- NAMES gmodule-2.0
- PATHS ${Gmodule_PKGCONF_LIBRARY_DIRS}
-)
-
-# Set the include dir variables and the libraries and let libfind_process do the rest.
-# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
-set(Gmodule_PROCESS_INCLUDES Gmodule_INCLUDE_DIR)
-set(Gmodule_PROCESS_LIBS Gmodule_LIBRARY)
-libfind_process(Gmodule)
diff --git a/cmake/Findespeak.cmake b/cmake/Findespeak.cmake
deleted file mode 100644
index 6d390a9a8..000000000
--- a/cmake/Findespeak.cmake
+++ /dev/null
@@ -1,29 +0,0 @@
-# - Try to find espeak (with libespeak)
-# Once done, this will define
-#
-# espeak_FOUND - system has Glib
-# espeak_INCLUDE_DIRS - the Glib include directories
-# espeak_LIBRARIES - link these to use Glib
-
-include(LibFindMacros)
-
-# espeak-related libraries
-find_path(espeak_INCLUDE_DIR
- NAMES speak_lib.h
- PATHS /usr /sw/include
- PATH_SUFFIXES espeak
-)
-
-# Finally the library itself
-find_library(espeak_LIBRARY
- NAMES libespeak.so libespeak.a
- PATHS /sw/lib
-)
-
-# Set the include dir variables and the libraries and let libfind_process do the rest.
-# NOTE: Singular variables for this library, plural for libraries this this lib depends on.
-set(espeak_PROCESS_INCLUDES espeak_INCLUDE_DIR)
-set(espeak_PROCESS_LIBS espeak_LIBRARY)
-libfind_process(espeak)
-
-
diff --git a/cmake/LibFindMacros.cmake b/cmake/LibFindMacros.cmake
deleted file mode 100644
index 69975c51b..000000000
--- a/cmake/LibFindMacros.cmake
+++ /dev/null
@@ -1,99 +0,0 @@
-# Works the same as find_package, but forwards the "REQUIRED" and "QUIET" arguments
-# used for the current package. For this to work, the first parameter must be the
-# prefix of the current package, then the prefix of the new package etc, which are
-# passed to find_package.
-macro (libfind_package PREFIX)
- set (LIBFIND_PACKAGE_ARGS ${ARGN})
- if (${PREFIX}_FIND_QUIETLY)
- set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} QUIET)
- endif (${PREFIX}_FIND_QUIETLY)
- if (${PREFIX}_FIND_REQUIRED)
- set (LIBFIND_PACKAGE_ARGS ${LIBFIND_PACKAGE_ARGS} REQUIRED)
- endif (${PREFIX}_FIND_REQUIRED)
- find_package(${LIBFIND_PACKAGE_ARGS})
-endmacro (libfind_package)
-
-# CMake developers made the UsePkgConfig system deprecated in the same release (2.6)
-# where they added pkg_check_modules. Consequently I need to support both in my scripts
-# to avoid those deprecated warnings. Here's a helper that does just that.
-# Works identically to pkg_check_modules, except that no checks are needed prior to use.
-macro (libfind_pkg_check_modules PREFIX PKGNAME)
- if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
- include(UsePkgConfig)
- pkgconfig(${PKGNAME} ${PREFIX}_INCLUDE_DIRS ${PREFIX}_LIBRARY_DIRS ${PREFIX}_LDFLAGS ${PREFIX}_CFLAGS)
- else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
- find_package(PkgConfig)
- if (PKG_CONFIG_FOUND)
- pkg_check_modules(${PREFIX} ${PKGNAME})
- endif (PKG_CONFIG_FOUND)
- endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
-endmacro (libfind_pkg_check_modules)
-
-# Do the final processing once the paths have been detected.
-# If include dirs are needed, ${PREFIX}_PROCESS_INCLUDES should be set to contain
-# all the variables, each of which contain one include directory.
-# Ditto for ${PREFIX}_PROCESS_LIBS and library files.
-# Will set ${PREFIX}_FOUND, ${PREFIX}_INCLUDE_DIRS and ${PREFIX}_LIBRARIES.
-# Also handles errors in case library detection was required, etc.
-macro (libfind_process PREFIX)
- # Skip processing if already processed during this run
- if (NOT ${PREFIX}_FOUND)
- # Start with the assumption that the library was found
- set (${PREFIX}_FOUND TRUE)
-
- # Process all includes and set _FOUND to false if any are missing
- foreach (i ${${PREFIX}_PROCESS_INCLUDES})
- if (${i})
- set (${PREFIX}_INCLUDE_DIRS ${${PREFIX}_INCLUDE_DIRS} ${${i}})
- mark_as_advanced(${i})
- else (${i})
- set (${PREFIX}_FOUND FALSE)
- endif (${i})
- endforeach (i)
-
- # Process all libraries and set _FOUND to false if any are missing
- foreach (i ${${PREFIX}_PROCESS_LIBS})
- if (${i})
- set (${PREFIX}_LIBRARIES ${${PREFIX}_LIBRARIES} ${${i}})
- mark_as_advanced(${i})
- else (${i})
- set (${PREFIX}_FOUND FALSE)
- endif (${i})
- endforeach (i)
-
- # Print message and/or exit on fatal error
- if (${PREFIX}_FOUND)
- if (NOT ${PREFIX}_FIND_QUIETLY)
- message (STATUS "Found ${PREFIX} ${${PREFIX}_VERSION}")
- endif (NOT ${PREFIX}_FIND_QUIETLY)
- else (${PREFIX}_FOUND)
- if (${PREFIX}_FIND_REQUIRED)
- foreach (i ${${PREFIX}_PROCESS_INCLUDES} ${${PREFIX}_PROCESS_LIBS})
- message("${i}=${${i}}")
- endforeach (i)
- message (FATAL_ERROR "Required library ${PREFIX} NOT FOUND.\nInstall the library (dev version) and try again. If the library is already installed, use ccmake to set the missing variables manually.")
- endif (${PREFIX}_FIND_REQUIRED)
- endif (${PREFIX}_FOUND)
- endif (NOT ${PREFIX}_FOUND)
-endmacro (libfind_process)
-
-macro(libfind_library PREFIX basename)
- set(TMP "")
- if(MSVC80)
- set(TMP -vc80)
- endif(MSVC80)
- if(MSVC90)
- set(TMP -vc90)
- endif(MSVC90)
- set(${PREFIX}_LIBNAMES ${basename}${TMP})
- if(${ARGC} GREATER 2)
- set(${PREFIX}_LIBNAMES ${basename}${TMP}-${ARGV2})
- string(REGEX REPLACE "\\." "_" TMP ${${PREFIX}_LIBNAMES})
- set(${PREFIX}_LIBNAMES ${${PREFIX}_LIBNAMES} ${TMP})
- endif(${ARGC} GREATER 2)
- find_library(${PREFIX}_LIBRARY
- NAMES ${${PREFIX}_LIBNAMES}
- PATHS ${${PREFIX}_PKGCONF_LIBRARY_DIRS}
- )
-endmacro(libfind_library)
-
diff --git a/cmake/version.cmake b/cmake/version.cmake
deleted file mode 100755
index 0dd520a45..000000000
--- a/cmake/version.cmake
+++ /dev/null
@@ -1,68 +0,0 @@
-FIND_PROGRAM(GIT_EXECUTABLE NAMES git git.exe DOC "git command line client")
-FIND_PROGRAM(DATE_EXECUTABLE NAMES date DOC "unix date command")
-
-get_filename_component(SOURCE_DIR ${SRC} PATH)
-
-if (GIT_EXECUTABLE)
- EXECUTE_PROCESS(
- COMMAND ${GIT_EXECUTABLE} log "--format=%ct" # output as unix timestamp
- WORKING_DIRECTORY "${SOURCE_DIR}"
- OUTPUT_VARIABLE GIT_OUTPUT_DATE
- ERROR_VARIABLE GIT_ERROR
- OUTPUT_STRIP_TRAILING_WHITESPACE
- ERROR_STRIP_TRAILING_WHITESPACE
- )
- if(GIT_ERROR)
- message(STATUS "Cannot determine current git commit - git error: '${GIT_ERROR}'")
- set(GIT_OUTPUT_DATE "0000000000")
- endif(GIT_ERROR)
- EXECUTE_PROCESS(
- COMMAND ${GIT_EXECUTABLE} log "--format='%h'"
- WORKING_DIRECTORY "${SOURCE_DIR}"
- OUTPUT_VARIABLE GIT_OUTPUT_HASH
- ERROR_VARIABLE GIT_ERROR_HASH
- OUTPUT_STRIP_TRAILING_WHITESPACE
- ERROR_STRIP_TRAILING_WHITESPACE
- )
- if(GIT_ERROR_HASH)
- message(STATUS "Cannot determine current git hash - git error: '${GIT_ERROR}'")
- set(GIT_OUTPUT_HASH "xdevxgitxnotxfound")
- endif(GIT_ERROR_HASH)
-else()
- message(STATUS "git not found, cannot record git commit")
- set(GIT_OUTPUT_DATE "0000000000") # To match length of android versionCode
- set(GIT_OUTPUT_HASH "xdevxgitxnotxfound")
-endif(GIT_EXECUTABLE)
-
-string(REGEX MATCH "^[0-9]+" VERSION_NUM ${GIT_OUTPUT_DATE} )
-
-set(VERSION ${GIT_OUTPUT_HASH})
-
-EXECUTE_PROCESS(
- COMMAND ${DATE_EXECUTABLE} "+%y%m%d%H%M" "-d \@${VERSION_NUM}" # output as unix timestamp
- WORKING_DIRECTORY "${SOURCE_DIR}"
- OUTPUT_VARIABLE DATE_CONVERT_OUTPUT
- ERROR_VARIABLE DATE_CONVERT_ERROR
- OUTPUT_STRIP_TRAILING_WHITESPACE
- ERROR_STRIP_TRAILING_WHITESPACE
-)
-if(NOT DATE_CONVERT_ERROR)
- string(REGEX MATCH "[0-9]+" VERSION_CODE "${DATE_CONVERT_OUTPUT}")
-else(NOT DATE_CONVERT_ERROR)
- message(FATAL_ERROR "Date convert not working\nError message:\n${DATE_CONVERT_ERROR}")
-endif(NOT DATE_CONVERT_ERROR)
-
-string(REGEX MATCH "[a-z0-9]+" VERSION ${GIT_OUTPUT_HASH} )
-
-if (STRIP_M)
- set(VERSION ${VERSION_CODE})
-endif()
-
-set(NAVIT_VARIANT "-")
-set(GIT_VERSION VERSION)
-
-set(${NAME} ${VERSION})
-
-message (STATUS "Git commit: ${VERSION}")
-message (STATUS "Git date: ${VERSION_CODE}")
-CONFIGURE_FILE(${SRC} ${DST} @ONLY)
diff --git a/config.h.cmake b/config.h.in
index c759e69c1..1bbbf782a 100644
--- a/config.h.cmake
+++ b/config.h.in
@@ -16,10 +16,17 @@
#cmakedefine USE_LIBGNUINTL 1
#cmakedefine HAVE_BYTESWAP_H 1
/* Versions */
+#cmakedefine GIT_VERSION "@GIT_VERSION@"
+#ifndef GIT_VERSION
+#define GIT_VERSION "xdevxgitxnotxfound"
+#endif
+
+#define NAVIT_VARIANT "-"
#cmakedefine PACKAGE_VERSION "@PACKAGE_VERSION@"
#cmakedefine PACKAGE_NAME "@PACKAGE_NAME@"
#cmakedefine PACKAGE "@PACKAGE@"
#cmakedefine LOCALEDIR "@LOCALEDIR@"
+#define NAVIT_VERSION PACKAGE_VERSION "+git:" GIT_VERSION NAVIT_VARIANT
#cmakedefine HAVE_ZLIB 1
diff --git a/docs/basic_configuration.rst b/docs/basic_configuration.rst
new file mode 100644
index 000000000..250a6686f
--- /dev/null
+++ b/docs/basic_configuration.rst
@@ -0,0 +1,66 @@
+There are much more options, see [[configuration]].
+
+Preparation
+===========
+Get a supported map package
+---------------------------
+Navit can use different :doc:`maps` formats, including free :ref:`OpenStreetMap` data. In order to use one of these maps, download a map of your desired area and store it into a local folder (such as navit/maps or /usr/share/navit/maps).
+
+Install TTS
+-----------
+To get speech support, you need to install a text-to-speech tool such as **espeak**, **mbrola** or **festival**. These tools can be invoked from the command line. Test your setup by invoking the tools manually e.g.
+
+.. code-block:: bash
+
+ espeak "This is a text!"
+
+On some systems Navit comes with integrated espeak support, so you don't need to download it separately.
+
+Connect GPS
+-----------
+Now connect your GPS. The exact procedure for this varies depending on the type of GPS device you are using and how you connect it to your computer. On Linux / Unix systems, your GPS should typically show up as a character device, i.e., you will find an entry in the /dev folder corresponding to your GPS device. Again, the file name depends on the type and connection method of your GPS receiver. See [[Connecting a GPS receiver]] for details.
+
+Most GPS receiver will output the position in [[NMEA]] format, which can be used directly in Navit or using a GPS daemon program such as **gpsd**. A simple way to test whether your GPS receiver works and outputs NMEA data is to dump its output to a console. For example, if your GPS receiver can be found at **/dev/rfcomm0**, you can dump its output using
+
+.. code-block:: bash
+
+ cat /dev/rfcomm0
+
+The output should give you steady NMEA position updates. You can feed this information into **gpsd** / **xgps** or **QLandkarte** to see a graphical representation of your position and to check whether the output corresponds to your current position.
+
+Configuring
+===========
+
+Currently Navit doesn't provide a graphical tool to change settings, so you have to do the changes manually using a texteditor.
+Please open your current **navit.xml** file and do the following steps:
+
+
+Setup proper startup-position
+-----------------------------
+On Navit's very first startup, it needs a **center** to look at on the map. By default this is set to Munich in Germany (at latitude 48.08 and longitude, which is conveniently covered by the sample map created on installation).
+
+.. code-block:: xml
+
+ <navit center="4808 N 1134 E" />
+
+See furthermore: [[Configuration]]
+
+
+Setup GPS
+---------
+Add the GPS connection
+
+.. code-block:: xml
+
+ <vehicle name="My" enabled="yes" source="file://dev/ttyS0"/ active="1"/>
+
+See furthermore: [[Configuration]]
+
+
+Enable Map
+----------
+Just change the map entry corresponding to your local folders
+
+.. code-block:: xml
+
+ <map type="binfile" enabled="yes" data="/var/navit/maps/uk.bin" />
diff --git a/docs/binfile.rst b/docs/binfile.rst
new file mode 100644
index 000000000..e4489e381
--- /dev/null
+++ b/docs/binfile.rst
@@ -0,0 +1,122 @@
+Binfile
+-------
+
+Navit has its own map format, called **binfile** format. It's a binary format, optimized for use with Navit (rendering, search, routing on embedded devices).
+
+Dividing the world into tiles
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The map coordinates of binfile are in meters, measured from equator and null meridian, with a merkator projection. The limit of this world is about 20000 km in earch direction from this null point. This doesn't cover polar regions, but it's ok for now.
+
+So, the world gives a 40000x40000km rectangle (tile). This rectangle is divided into 4 equally-sized sub-rectangles (tiles) called a,b,c and d counter clockwise ...
+
+* a is top right
+* b top left
+* c bottom right
+* d bottom left
+
+Each of the sub-rectangles (tiles) is then further subdivided, so a rectangle "aa" is top right in "a"
+
+This is continued further up to 14 levels (but the number of levels might be variable). So in the end you get many tiles which are containing objects which are within this tile... And the tiles are also containing references to tiles which are within them.
+
+A Navit binfile is actually a ZIP file; each tile is a member file in a zip file. So to extract an area of this file, you just read the zip file sequentially.
+
+If you extract a small binfile using a zip tool, you will see member files
+adbdbbbbadcacd, adbdbbbbadcacd, ... . Each file contains the data for one tile.
+
+Projection
+~~~~~~~~~~
+
+The coordinates are projected using a modified "Google" (i.e. EPSG900913) projection.
+Navit assumes an earth radius of 6371000m rather than the WGS84 value of 6378137m. Thus, for navit, the circumference of the earth is (2 x 20015087m).
+
+Tile data format
+~~~~~~~~~~~~~~~~
+
+A tile itself is a dynamic data structure.
+
+As declared in `navit/map/binfile/binfile.c`__, a tile is represented in memory by a struct :
+
+.. code-block:: c
+
+ struct tile {
+ int *start; /* Memory address of the whole data structure */
+ int *end; /* Memory address of first memory address not belonging to tile
+ * thus tile->end - tile->start represents the size of the tile
+ * in multiples of 4 Bytes */
+ int *pos; /* current position inside the tile */
+ int *pos_coord_start; /* pointer to the first element inside the tile that is a
+ * coordinate. That is the first position after the header of a
+ * tile. The header holds 3 entries each 32bit wide integers.
+ * header[0] holds the size of the whole data-structure.
+ * header[1] holds the type of the item
+ * header[2] holds the size of the coordinates in the tile */
+ int *pos_coord; /* current position inside the coordinates region within the tile */
+ int *pos_attr_start; /* pointer to the first attr //TODO explain attr format// data
+ * structure inside the tile's memory region */
+ int *pos_attr; /* current position inside the attr region */
+ int *pos_next; /* link to the next tile */
+ int zipfile_num;
+ }
+
+
+Content
+~~~~~~~
+Inside the binfile, each tile file contains a list of items. Each item is stored like this (everything is 4 bytes wide and always aligned):
+
+.. code-block:: c
+
+ {
+ int: Length of the item (not including this length field) in integers
+ int: Type of the item (from item_def.h)
+ int: Length of the coordinate data which follows in integers
+ {
+ int: pairs of coordinates with consisting of 2 integers each
+ } 0..n
+ {
+ int: length of the attribute (not including this length field) in integers
+ int: Type of attribute (from attr_def.h)
+ {
+ int: Attribute data, depending on attribute type
+ } 0..n
+ } 0..n
+ }
+
+Extracting a specific area
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+You can calculate the bounding box of the current tile.
+
+Then there are two possibilities:
+
+* The tile overlaps with the area you are interested in: Then simply copy the whole file data, including its header to the output, and add an entry to the directory which will be written later
+* The tile doesn't overlap: Then don't drop that file, but instead write a file with size 0 and the same name to the output (I will explain later why this is needed), and add an entry to the directory
+
+At some point you will have reached the end of the zip files, then you have to write the zip directory and the "end of directory" marker.
+
+This will be very fast (you don't have to look into the zip files, which would mean decompressing and compressing them again) but has some disadvantages:
+
+* You will have many empty files in it which are not really necessary. This is needed because the reference to sub-tiles are by number, and not by name (would be slow), and so the position of a tile within the zip file is not allowed to change
+* You get some data you didn't want to have: this is because a tile which overlaps with your area of course doesn't contain only data from your wanted area, but from the area where it is located
+
+
+How an object is placed in a tile
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+An object is placed inside of a tile using the following approach
+
+* If the object can fit into one of the 4 top tiles it is placed in that tile
+
+* The 4 sub-tiles are then checked to see if the object will fit inside of any of the four tiles that are contained inside of the sub-tile. If so, it is moved down a tile. This step is repeated until the object spans 2 or more tiles (or the lowest tile level is reached)
+
+* If the object can't fit inside of any of the 4 top sub-tiles it is placed inside of the top-most tile
+
+An object 'fits' inside of a tile if the coordinates of the object (min lat, min lon, max lat, max lon) lie inside of the coordinates of the tile (tile_min_lat, tile_min_lon, tile_max_lat, tile_max_lon)
+
+Any object that cross the equator or the poles is placed in the top-most tile because it can not fit inside of any sub-tile.
+
+Some important objects are placed into upper level tiles despite of their length to be easier reachable for routing or display purposes. This is done by specifying maximum tile name length for them in item_order_by_type() function in `navit/maptool/misc.c`__.
+
+BTW, "order" (zoom level) values used to query map and referred in <itemgra> and route_depth are equal to (tile_name_length-4).
+
+.. __: https://github.com/navit-gps/navit/blob/trunk/navit/map/binfile/binfile.c
+.. __: https://github.com/navit-gps/navit/blob/trunk/navit/maptool/misc.c
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644
index 000000000..a8b73e774
--- /dev/null
+++ b/docs/conf.py
@@ -0,0 +1,11 @@
+# -*- coding: utf-8 -*-
+from datetime import datetime
+
+source_suffix = '.rst'
+
+master_doc = 'index'
+
+# General information about the project.
+project = u'navit'
+year = datetime.now().year
+author = u'The Navit Team'
diff --git a/docs/configuration/advanced.rst b/docs/configuration/advanced.rst
new file mode 100644
index 000000000..68066af03
--- /dev/null
+++ b/docs/configuration/advanced.rst
@@ -0,0 +1,101 @@
+Advanced Options
+================
+The rest of this webpage is meant for advanced/power users who'd like to fiddle a little more under-the-hood. The average user can safely ignore this section!
+
+Speech
+------
+Navit can announce driving directions with voice. Navit can use different mechanisms to play these announcements.
+Note that not all tools are available on all platforms.
+
+Prerecorded samples
+~~~~~~~~~~~~~~~~~~~
+Navit is able to compose phrases if you give it a set of prerecorded **samples**. Configuration example:
+
+.. code-block:: xml
+
+ <speech type="cmdline" data="aplay -q %s"
+ sample_dir="/path/to/sampledir" sample_suffix=".wav" flags="1"
+ vocabulary_name="0" vocabulary_name_systematic="0" vocabulary_distances="0"/>
+
+
+The directory ''sample_dir'' should contain audio files. ''sample_suffix'' is the common file type suffix of those files. The names of the files (without the suffix) must correspond to the text they contain. For each text it wants to speak, Navit will look for one or more sample files with corresponding names (ignoring upper/lower case). So for "turn right in 300 meters" you could use turn.wav, right.wav, in.wav, 300.wav, meters.wav. Navit will prefer files that contain multiple words: If file "turn right.wav" is present, it will be used even if you have turn.wav and right.wav.
+
+Note that Navit internally handles all text in UTF-8 encoding. If you use a file system where file names are not encoded with UTF-8 (such as Windows), Navit will only find files for ASCII text. If you use a language that uses non-ASCII characters, the file name must be the [http://en.wikipedia.org/wiki/Percent-encoding percent encoding] of the UTF-8 representation of the text. For example the filename for "süd" would be "s%c3%bcd.wav" (because "ü" is encoded as C3BC in UTF-8). For this feature to work, you must set ''flags'' to 1.
+
+''data'' is the program that can be used to play the sample files. You should specify the program name along with any necessary parameters. The placeholder "%s" will be replaced with the file(s) to be played. All files required for a text will be passed in one go, so the program will need to support playing multiple files. Note that the %s should ''not'' be quoted; the text is not passed through a shell.
+
+Note that if any file that is needed to compose the complete phrase is missing then Navit will be silent. In that case a warning will be printed. Unfortunately, there is no complete list of the samples required. However, all the navigation text is contained in the translation files (.po files), so you can get a rough list.
+
+By default Navit is trying to announce street names. To disable this feature you can set ''vocabulary_name'' and ''vocabulary_name_systematic'' to 0 in the speech tag which will specify that the speech synthesizer isn't capable of speaking names. Also there is ''vocabulary_distances'' which you can set to 0 so only the minimum set of 1,2,3,4,5,10,25,50,75,100,150,200,250,300,400,500,750 as numbers is used.
+
+espeak
+~~~~~~
+.. code-block:: xml
+
+ <speech type="cmdline" data="espeak -s 150 -v english_rp %s"/>
+
+Will use espeak instead, for those who want Navit to speak to them in English, at 150 words per minute. The ''%s'' is filled in by Navit when sent to the speech synthesis software (with something like "Turn left" or whatever is appropriate at the time). If you need more features, you should use an external wrapper script which can contain anything supported by your shell (see [[Translations]]).
+
+festival
+~~~~~~~~
+
+flite
+~~~~~
+
+Mbrola
+~~~~~~
+
+Android
+~~~~~~~
+
+.. code-block:: xml
+
+ <speech type="android" cps="15"/>
+
+
+Start up in silent mode
+~~~~~~~~~~~~~~~~~~~~~~~
+To have Navit start up in silent mode, insert ``<code>active="0"</code>`` somewhere in your ``<code>speech</code>`` tag. For example on Android:
+
+.. code-block:: xml
+
+ <speech type="android" cps="15" active="0"/>
+
+
+In this case, you should place a <code>toggle_announcer</code> item in your [[OSD]] configuration, or add a menu item so you can enable speech output when you need it.
+
+
+Splitting navit.xml
+-------------------
+Navit has support for a small subset of **XInclude** / **XPath** for including parts of external XML files. Supported is a tag like
+
+.. code-block:: xml
+
+ <xi:include href="some_file" xpointer="xpointer_stuff" />
+
+
+You can leave out either href (xi:include refers to the same file it is in then) or xpointer (xi:include then refers the complete file), but not both. The ''href'' attribute refers to a file relative to the current directory. It is suggested to use the complete path, such as ''/home/root/.navit/navit-vehicles.xml''.
+
+href is expanded with wordexp internally, so you can do stuff like:
+
+.. code-block:: xml
+
+ <xi:include href="$NAVIT_SHAREDIR/maps/*.xml" />
+
+Some examples on the supported syntax:
+.. code-block:: xml
+
+ <xi:include xpointer="xpointer(/config/navit/layout[@name='Car']/layer[@name='points'])" />
+
+references to the XML-Tag "layer" with attribute "name" of value "points" within an XML-Tag "layout" with attribute "name" of value "Car" within an XML-Tag "navit" within an XML-Tag "config".
+
+.. code-block:: xml
+
+ <config xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xi:include href="$NAVIT_SHAREDIR/navit.xml" xpointer="xpointer(/config/*[name(.)!='navit'])"/>
+ <navit center="4808 N 1134 E" zoom="256" tracking="1" cursor="1" orientation="0">
+ <xi:include href="$NAVIT_SHAREDIR/navit.xml" xpointer="xpointer(/config/navit/*[name(.)!='vehicle'])"/>
+ </navit>
+ </config>
+
+Use this as your ``$HOME/.navit/navit.xml`` and you will get everything under ``<config>..</config>`` except ``<navit>..</navit>`` (first ``xi:include``), plus ``<navit>`` as specified plus everything from navit within config, except the vehicle definitions (second ``xi:include``).
diff --git a/docs/configuration/display.rst b/docs/configuration/display.rst
new file mode 100644
index 000000000..f822d053b
--- /dev/null
+++ b/docs/configuration/display.rst
@@ -0,0 +1,111 @@
+Display Options
+---------------
+The Navit display is highly customisable and consists of the following components
+
+* Graphics driver (appropriate engine for your system, to draw everything)
+* GUI (enables user interaction and map display)
+* OSD (shows widgets on map screen)
+
+Graphics Driver
+---------------
+
+Different technologies can be used, to let Navit draw it's visual components. Not all might be available at your specific system
+
+The current list of available graphics drivers:
+
+* **android**, for the Android port
+* **cocoa**, for the iPhone port
+* **gtk_drawing_area**, usually most appropriate on Linux desktop systems
+* **sdl**, render inside an X window, or direct to the Linux framebuffer, with min dependencies on external libraries.
+* **qt5**, render using Qt5 library, either using QWidgets or QML. On top of any Qt5 supported display technology.
+* **win32** - useable with <tt>gtk</tt> or <tt>internal</tt> GUIs for Windows systems only.
+
+Experimental/less maintained drivers:
+
+* **qt_qpainter**, render inside X window or on top of Qt Palmtop Environment.
+* **opengl**, rendering via OpenGL
+* **gtk_gl_ext**, rendering via OpenGL using GTK+ OpenGL extension
+* **gd**, rendering using the GD Graphics Library
+
+They can be activated and configured as following:
+
+.. code-block:: xml
+
+ <graphics type="gtk_drawing_area"/>
+
+As mentioned, it's usually best to leave this as whatever the default is within your :xml:`navit.xml`, and only mess around with it if you know what you are doing, or have been told to by one of the developers.
+
+Graphical User Interface
+------------------------
+You can now choose which type of GUI you would like to use with Navit. Not all GUIs work with all Graphics drivers
+
+
+======== ======= ===== ==== ================ ========== ====== =========== === ===== === =======
+GUI android cocoa gd gtk_drawing_area gtk_gl_ext opengl qt_qpainter sdl win32 qt5 preview
+======== ======= ===== ==== ================ ========== ====== =========== === ===== === =======
+GTK
+Internal Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes
+QML2
+======== ======= ===== ==== ================ ========== ====== =========== === ===== === =======
+
+Generic GUI Options
+~~~~~~~~~~~~~~~~~~~
+There are some options available for the ``gui`` tag which are used by all the GUI types. These include:
+
+* **fullscreen** - Enables Navit to start in fullscreen mode.
+* **pitch** - The pitch value to pitch the map to when selecting 3D mode from the menus.
+* **dimensions** - w="1024" h="600"
+
+The following example uses the :xml:`internal` GUI, and starts Navit up in fullscreen mode, and will pitch the map to 35 degrees when 3D mode is selected from the menu. Note that to start Navit in 3D mode by default, [[#Initial 3D pitch|change the :xml:`pitch` value in the :xml:`navit` tag]]:
+
+.. code-block:: xml
+
+ <gui type="internal" enabled="yes" fullscreen="1" pitch="35">
+
+Internal GUI
+~~~~~~~~~~~~
+The first GUI is embedded in Navit core and is primarily aimed at [[touchscreen]] devices, or those devices with small screens (such as netbooks). However, this GUI also works very well on desktops and laptops.
+
+.. code-block:: xml
+
+ <gui type="internal" enabled="yes">
+
+Options
+^^^^^^^
+A number of options specific to the ``internal`` GUI are available. These include:
+
+* **font_size** - Base text size to use within the ``internal`` menu.
+* **icon_xs** - The size that extra-small style icons should be scaled to (e.g. country flag on town search).
+* **icon_s** - The size that small style icons should be scaled to (e.g. icons of ``internal`` GUI toolbar).
+* **icon_l** - The size that large style icons should be scaled to (e.g. icons of internal GUI menu).
+* **menu_on_map_click** - Toggles the ability to bring up the menu screen when clicking on the map. See the [[Internal_Gui#Menu_Configuration|``internal`` GUI page]] for more information.
+
+An example ``gui`` tag using the previous options is shown below:
+
+.. code-block:: xml
+
+ <gui type="internal" enabled="yes" font_size="250" icon_xs="48" icon_s="48" icon_l="64">
+
+More options are discussed on the [[Internal Gui]] and the [[Configuration/Full_list_of_options|full list of options]].
+
+GTK GUI
+~~~~~~~
+The second GUI is called **gtk**, and is most useful for those users who wish to use a traditional windowed GUI. This is one useful to desktop use.
+
+.. code-block:: xml
+
+ <gui type="gtk" enabled="yes" ... />
+
+
+Options
+^^^^^^^
+A number of options specific to the ``gtk`` GUI are available. These include:
+
+* menubar - enable/disable the menubar
+* toolbar - enable/disable the toolbar
+* statusbar - enable/disable the statusbar
+
+
+.. code-block:: xml
+
+ <gui type="gtk" enabled="yes" menubar="1" toolbar="1" statusbar="1"/>
diff --git a/docs/configuration/general.rst b/docs/configuration/general.rst
new file mode 100644
index 000000000..2ad2874d7
--- /dev/null
+++ b/docs/configuration/general.rst
@@ -0,0 +1,83 @@
+==General Options==
+Settings which affect Navit's general behaviour are located within the ``<navit .. >`` tag. In a default installation, this is found on line 31 of ``navit.xml``. By default, the ``navit`` tag is set as follows:
+
+.. code-block:: xml
+
+<source lang="xml">
+ <navit center="4808 N 1134 E" zoom="256" tracking="1" orientation="-1" recent_dest="10">
+</source>
+
+Some common attributes are discussed below. For more advanced features, see [[Configuration/Full_list_of_options | the full list of options]].
+
+===Initial map position===
+On Navit's very first startup, it needs a **center** to look at on the map. By default this is set to Munich in Germany, which is conveniently covered by the sample map created on installation.
+
+
+.. code-block:: xml
+
+<source lang="xml">
+ center="11.5666 48.1333"
+</source>
+
+Coordinates can be written in different formats; see [[Coordinate_format]] for the full list.
+To determine a specific latitude and longitude for your location you can use http://itouchmap.com/latlong.html.
+Usually, changing the "center" setting is not necessary, since it is only used during the first start.
+On subsequent starts, Navit will remember the last map position (stored in "center.txt") and ignore the "center" setting.
+
+When Navit starts, it will display the map at a pre-defined **zoom**. The default zoom level is 256. The lower the value, the closer you will be zoomed in. <!---what does the zoom number express? How can I estimate it?-->
+
+ zoom="256"
+
+For those using the [[SDL GUI]], a level of 128 is recommended.
+
+ zoom="128"
+
+Note that once Navit has started, the zoom level can be altered using [[OSD]] or menu items.
+
+
+Use the **orientation** attribute to orient the map in either the direction of travel, or oriented North. .To orient the map in the direction of travel:
+
+ orientation="-1"
+
+or to orient North:
+
+ orientation="0"
+
+Orienting the map North whilst in [[3D]] mode will provide visually confusing results, and is not recommended. When in 3D mode, it's best to have the map oriented in the direction of travel.
+
+===Autozoom===
+Navit has the ability to **autozoom** the map in or out dependent upon your speed.
+
+ autozoom_active="1"
+
+To de-activate autozoom:
+
+ autozoom_active="0"
+
+===3D pitch===
+Navit has the capability to display either a 2D map (bird's eye perspective) or a [[3D]] map (some amount of tilt looking to the horizon). Navit's default configuration is to startup in the 2D perspective but it is possible to specify that Navit start with a 3D perspective. The amount of tilt is specified by setting the value of <tt>pitch</tt>.
+
+The **pitch** value defines default camera tilting, with a value from 0 to 359. Note that usable values lie between 0 and 90 where 0 is bird's eye perspective looking down and 90 is human perspective looking forward. Also note that values closer to 90 will slow down map drawing, because the line of sight gets longer and longer and more objects are seen.
+
+For example, the following added to the <tt>navit</tt> tag will force Navit to start with a pitch of 30 degrees:
+
+ pitch="30"
+
+===Imperial units===
+By default, Navit use the metric system of measurements when displaying or announcing distances, speeds etc. However, you can configure Navit to display and announce these values in imperial units. Simply add an <tt>imperial</tt> attribute to the Navit tag, and set its value to 1, as shown below:
+
+ imperial="1"
+
+Speeds should now be displayed in units of miles-per-hour, whilst distances are converted to miles (large distances) and feet (small distances).
+
+===Default layout===
+When no specific layout has been specified by the user, navit uses a default layout to draw maps.
+The <tt>default_layout</tt> attribute of the navit tag allows to specify which layout to use as default;
+
+ default_layout="Car"
+
+This string should match the <tt>name</tt> attribute of the required <tt><layout></tt> tag.
+
+See [[Configuration/Layout_Options| layout options]] for more details.
+[[Category:Customizing]]
+[[Category:Configuration]]
diff --git a/docs/configuration/index.rst b/docs/configuration/index.rst
new file mode 100644
index 000000000..38504d067
--- /dev/null
+++ b/docs/configuration/index.rst
@@ -0,0 +1,143 @@
+Navit is highly modular and customizable. This page aims to point out the most common options which a first-time user may want to change - power users may want to consult [[Configuration/Full_list_of_options | the full list of options]].
+It is also possible to edit the navit.xml file for your Android device under Windows and Linux (Debian/Ubuntu derivates) with a third party application called [[NavitConfigurator]].
+
+Setting up Navit is done by editing a configuration file called "**navit.xml**".
+Editing XML configurations files in a text editor is simple, they are just plain text XML files, that can be edited with any editor. Just remember to ''turn off 'save UTF8 byte mark' in Preferences'' or navit may complain very much on the first byte of the file.<br>
+The XML configuration file is splitted into sections within a hierarchy:
+
+.. code-block:: xml
+
+<source lang="xml">
+<config>
+ <plugins></plugins>
+ <navit>
+ <osd></osd>
+ <vehicle></vehicle>
+ <vehicleprofile></vehicleprofile>
+ <mapset></mapset>
+ <layout></layout>
+ </navit>
+</config>
+</source>
+
+Navit comes **preshipped** with a default ``navit.xml`` together with ``navit_layout_*.xml`` files that are stored at various locations (depending on your system). For Linux-like OSes:
+* in ``~/.navit/``: e.g: ``/home/myusername/.navit/navit.xml`` (This is probably to best place to customize your settings!)
+* in ``/usr/share/navit`` or ``/etc/navit``
+
+Navit will apply settings in the following order:
+* in the current directory (used on Windows)
+* location supplied as first argument on the command line, e.g.: ``navit /home/myusername/navittestconfig.xml`` (Used mainly for development)
+* in the current directory as ``navit.xml.local`` (Used mainly for development)
+
+{{note
+|In any case, you have to **adapt settings** to your system!<br> This includes especially GPS, map provider and vehicle: [[Basic configuration]]
+}}
+
+=Configurable Sections=
+<div style="margin-bottom:8px;">
+{| cellpadding=3 cellspacing=1
+
+<!-- GENERAL -->
+| width="33%" valign="top" style="background:#FFFFFF; border:2px solid #478cff;" |
+{| style="width:100%; vertical-align:top; background:#FFFFFF;"
+! style="padding:2px" | <h2 style="margin:3px; background:#478cff; font-size:120%; font-weight:bold; border:1px solid #478cff; text-align:left; color:#fff; padding:0.2em 0.4em;">General</h2>
+|-
+| style="margin:2px; padding:10px;" |
+
+Common options such as units, position, zoom and map orientation, ... be configured in this section.
+
+[[Configuration/General_Options| General options.]]
+
+|}
+
+| style="border:1px solid transparent;" |
+
+| width="33%" valign="top" style="background:#FFFFFF; border:2px solid #48be1f; margin-top:50px;" |
+<!-- DISPLAY -->
+{| style="width:100%; vertical-align:top; background:#FFFFFF;"
+|-
+! style="padding:2px" | <h2 style="margin:3px; background:#48be1f; font-size:120%; font-weight:bold; border:1px solid #48be1f; text-align:left; color:#fff; padding:0.2em 0.4em;">Display</h2>
+|-
+| style="margin:2px; padding:10px;" |
+
+A large number of display properties can be configured, including desktop or touchscreen-optimised GUIs, on-screen display items and complete control over menu items.
+
+[[Configuration/Display_Options| Display options.]]
+
+|}
+
+| style="border:1px solid transparent;" |
+
+
+<!-- VEHICLE -->
+| width="33%" valign="top" style="background:#FFFFFF; border:2px solid #e79e00;" |
+{| style="width:100%; vertical-align:top; background:#FFFFFF;"
+! style="padding:2px" | <h2 style="margin:3px; background:#e79e00; font-size:120%; font-weight:bold; border:0px solid #e79e00; text-align:left; color:#fff; padding:0.2em 0.4em;">Vehicle</h2>
+|-
+| style="margin:2px; padding:10px;" |
+
+A number of vehicles can be defined within Navit, depending upon the device and/or operating system in use. Vehicle profiles for routing (eg: car, pedestrian, bicycle...) are also completely configurable.
+
+[[Configuration/Vehicle_Options| Vehicle options.]]
+
+|}
+|}
+</div>
+
+<div style="margin-bottom:8px;">
+{| cellpadding=3 cellspacing=1
+
+<!-- MAPS -->
+| width="33%" valign="top" style="background:#FFFFFF; border:2px solid #ec7312;" |
+{| style="width:100%; vertical-align:top; background:#FFFFFF;"
+! style="padding:2px" | <h2 style="margin:3px; background:#ec7312; font-size:120%; font-weight:bold; border:1px solid #ec7312; text-align:left; color:#fff; padding:0.2em 0.4em;">Maps</h2>
+|-
+| style="margin:2px; padding:10px;" |
+
+You can use maps from a variety of sources, any number of maps can be configured and enabled at any one time.
+
+[[Configuration/Maps_Options| Maps options.]]
+
+|}
+
+| style="border:1px solid transparent;" |
+
+<!-- LAYOUT -->
+| width="33%" valign="top" style="background:#FFFFFF; border:2px solid #b30800;" |
+{| style="width:100%; vertical-align:top; background:#FFFFFF;"
+! style="padding:2px" | <h2 style="margin:3px; background:#b30800; font-size:120%; font-weight:bold; border:1px solid #b30800; text-align:left; color:#fff; padding:0.2em 0.4em;">Layout</h2>
+|-
+| style="margin:2px; padding:10px;" |
+
+Maps are displayed according to the rules defined in the layout. All aspects of the layout are configurable, from POI icons to colours for a particular type of highway.
+
+For all versions shipped after nov 2018, layout XML configuration is stored in dedicated XML files called with the prefix **navit_layout_** (one file per layout definition).
+
+[[Configuration/Layout_Options| Layout options.]]
+
+|}
+
+| style="border:1px solid transparent;" |
+
+<!-- ADVANCED -->
+| width="33%" valign="top" style="background:#FFFFFF; border:2px solid #992667;" |
+{| style="width:100%; vertical-align:top; background:#FFFFFF;"
+! style="padding:2px" | <h2 style="margin:3px; background:#992667; font-size:120%; font-weight:bold; border:1px solid #992667; text-align:left; color:#fff; padding:0.2em 0.4em;">Advanced</h2>
+|-
+| style="margin:2px; padding:10px;" |
+
+There are many more options, including debugging, specific plugins, speech announcements, trip logging, ...
+
+[[Configuration/Advanced_Options| Advanced options.]]
+
+|}
+
+
+|}
+</div>
+
+<!-- Following line disables table of contents -->
+__NOTOC__
+
+[[Category:Customizing]]
+[[Category:Configuration]]
diff --git a/docs/configuration/layout.rst b/docs/configuration/layout.rst
new file mode 100644
index 000000000..31a41366d
--- /dev/null
+++ b/docs/configuration/layout.rst
@@ -0,0 +1,71 @@
+==Layout Options==
+===Layouts===
+A layout defines how to **render a map**. Layouts are fully customisable, from the road colours and widths to size and type of icons to display for specific POIs. The layout is also where the **cursor** (i.e. the shape which shows where you are) is defined.<br>
+A number of user-generated layouts and cursor definitions are available at [[Layout]].
+
+===Defining layers===
+A layout consist of one cursor and one or more **layers** which are each a set of rules on how and when to draw certain items. Those rules are called **itemgra**. The layers are rendered one by one in the order they appear in the XML config file, as are the items in each layer. If you can't see an item make sure there is not another one hiding it. If your item is hidden, you can move your item further down in the layout section of the file.
+
+
+.. code-block:: xml
+
+<source lang="xml">
+ <layout name="Demo layout" color="#ffefb7" font="Liberation Sans" active="1">
+ <cursor w="26" h="26">
+ <layer name="layer_1">
+ <itemgra item_types="water_poly" order="0-">
+ <polygon color="#82c8ea" />
+ <polyline color="#5096b8" />
+ </itemgra>
+ </layer>
+ <layout>
+</source>
+
+
+Here the available options:
+* item_types: Comma separated list of items (see navit/item.h for definitions)
+* order: Range for zoom levels.
+* speed_range: Range for vehicle speed, useful for cursors.
+* angle_range: Range for pitch angle.
+* sequence_range: Useful for animated cursors.
+
+For infos about map icons, see [[Icons]]
+
+===Overriding default (shipped) layouts===
+When the XML config file is parsed, layouts are taken in the order they come, and a layout with an already existing name overrides a previous definition.
+The default (shipped) navit.xml includes first system-wide navit_layout_*.xml files then the user-specific navit_layout_*.xml files, so the system-wide navit_layout_*.xml files can be overiden by adding a user-specific navit-layout_*.xml containing the same **name** attribute.
+
+Copying the default **navit.xml** file to the user-specific location will still use the default shipped layout files, but copying one or several layout files as well to the user-specific location (and modifying them) allow to override these specific layouts.
+
+===Note on the default layout used by navit===
+When no layout has been specifically selected by the user (for example at first startup), navit will use the default layout specified (see [[Configuration/General_Options#Default_layout|the related section to know how to configure this]]).
+
+===Using a layer in multiple layouts===
+Sometimes, multiple layouts can use the same layer. For example, a reduced layout for a cleaner map may use the same layers as the regular layout, just not all of them.
+
+To use a layer in multiple layouts, it can be referenced using the **ref** attribute. In place of the regular layer definition, use an empty tag with only the attributes ''name'' and ''ref'':
+
+<source lang="xml">
+<layer name="Found items" order="0-">
+ <itemgra item_types="found_item">
+ <circle color="#008080" radius="24" width="2" text_size="12"/>
+ </itemgra>
+</layer>
+[...]
+<layout name="Demo layout">
+ [...]
+ <layer name="Found items for demo layout" ref="Found items" />
+ [...]
+</layout>
+<layout name="Demo layout reduced">
+ [...]
+ <layer name="Found items" ref="Found items" />
+ [...]
+</layout>
+
+</source>
+
+Note that the layer you want to reuse must be placed ''outside'' the layout. Layers defined inside a layout cannot be reused in this way.
+
+[[Category:Customizing]]
+[[Category:Configuration]]
diff --git a/docs/configuration/vehicle.rst b/docs/configuration/vehicle.rst
new file mode 100644
index 000000000..3d1769b9f
--- /dev/null
+++ b/docs/configuration/vehicle.rst
@@ -0,0 +1,117 @@
+==Vehicle Options==
+It's important to understand the separate but linked Navit concepts of a **vehicle** and [[Vehicleprofile| **vehicleprofile**]] element. A vehicle defines the source of positional data (suchas a USB GPS device), and how to present that data to the user on the map, where the vehicleprofile defines all aspects of routing.
+
+A simple vehicle definition looks like this:
+
+
+.. code-block:: xml
+
+<source lang="xml">
+ <vehicle name="My" enabled="yes" source="file://dev/ttyS0"/ active="1"/>
+</source>
+
+
+Here some of the available options:
+* **active**: If set to 1, makes the vehicle the default active one. Routing, view centering and map redraw would be applied to this one by default.
+* **enabled**: If set to yes, Navit connects to the vehicle data source and shows the vehicle on the map.
+* **follow**: map follows after "n" gps updates (where n=0 means only when the vehicle leaves the map->saving CPU time)
+* **source** : source of GPS (required)
+* **profilename**: link the vehicleprofile for this vehicle.
+
+<!-- do we need to keep this keys or note them elsewhere?
+Obsolete options:
+* **update**: This will force the map to be recentered at your main cursor's position.
+* **color**/**color2**: The color of the cursor is now specified within the cursor tag itself.
+* **animate**: If set to 1, the cursor will be animated as a moving dotted line, to make it easier to see.
+-->
+
+===GPS===
+Most essential detail is the gps source, that need to be adapted to your local setup.
+
+
+**Local:**
+
+Windows:
+* source="serial:COM2 baud=4800 parity=N data=8 stop=1"
+** For Locosys GT31 (or BGT31 plugged by USB), settings are: source="serial:COM3 baud=38400 parity=N data=8 stop=1" where COM3 should be replaced by the correct COM over USB number.
+
+Windows Mobile:
+* source="wince:GPD1:" - using the internal GPS driver, configured from Windows Remote GPS Settings.
+** To use a BT GPS it must be configured as outgoing com port and paired, then selected as hardware port in GPS Settings.
+** To start bluetooth on navit startup add bluetooth="yes". When exiting navit, the previous bluetooth state is recovered.
+* source="wince:COM1:" baudrate="57600"
+
+There is useful [http://w5.nuinternet.com/s660100031/SirfTech.htm. SirfTech utility] that can automatically scan existing serial ports trying different baudrates to detect GPS source.
+
+Linux:
+* source="file:/dev/rfcomm0" - BlueTooth GPS
+* source="file:/dev/ttyS0" - serial GPS connected to the first serial port (you may need to add the correct baudrate eg.: freerunner source="file:/dev/ttySAC1" baudrate="9600")
+* source="gpsd_dbus:" - via dbus, position reported by gpsd
+
+**Network based:**<br>
+If you want to connect multiple tools to your GPS, you need an multiplexer tool, as gpsd or gypsy.
+* source="gpsd://host[:port]" - gpsd://localhost, the default one, will try to connect to gpsd on localhost
+* source="socket:ipaddr:post" - socket connection (expects nmea stream)
+* source="socket:ipaddr:2947:r=1" - connect to gpsd in nmea mode (gpsd versions 2.39 or older)
+* source='socket:ipaddr:2947:?WATCH={"enable":true,"nmea":true};' - connect to gpsd in nmea mode (gpsd versions newer than 2.39)
+* source="gypsy://connectstring" - gypsy
+
+**Tricks:**
+* source="file:/home/myhome/mynmea.log" : here, navit will replay the nmea logfile (under Windows it is currently not possible in Navit)
+* source="pipe:/usr/bin/gpspipe -r" - any executable that produces NMEA output - gpsbabel, gpspipe, ...
+* source="demo://" : to use the demo vehicle. Set your Position and Destination, and vehicle will follow the calculated route. Useful if you have no nmea data source.
+* source="null://" : no GPS at all
+
+===Logging tracks===
+To record your trip , you can add a sub-instance "log" to the vehicle. It is possible to add multiple logs.
+
+
+.. code-block:: xml
+
+<source lang="xml">
+ <log type="gpx" data="track_%Y%m%d%i.gpx" flush_size="1048576" flush_time="900" />
+ <log type="nmea" data="track_%Y%m%d%i.nmea" flush_size="1048576" flush_time="900" />
+</source>
+
+
+This will give a log file named YearMonthDaySequencenumber.gpx/.nmea which will be kept in memory and flushed to disk when it is 1048576 bytes large or the oldest data is older than 900 seconds.
+<!--how to define, where the file get's stored?-->
+
+To display your track for more than one hour, you must use [[binfile]] to create a cache file that get's display <!--do I need to add it as a map source?-->
+
+.. code-block:: xml
+
+<source lang="xml">
+ <log type="binfile" data="track.bin" flush_size="0"/>
+</source>
+
+For customizing what is stored, see [[GPX]]
+
+===Vehicleprofile===
+[[Vehicleprofile | Profiles to add in the navit.xml]]
+<br/>
+<!-- this is tricky, here we need a step by step introduction-->
+Defines the behaviour of the routing and are usually linked to a vehicle section, so switching the "vehicle" (type of mobility) from within Navit, routing also will change its behaviour. This way, it is possible to include steps for pedestrian routing, but to exclude it for bike, horse or car routing. Within the vehicleprofile section, roadprofile sections are used to describe the routing behaviour of different roads. Here's a very basic example:
+
+
+.. code-block:: xml
+
+<source lang="xml">
+<vehicleprofile name="bike" flags="0x40000000" flags_forward_mask="0x40000000" flags_reverse_mask="0x40000000" maxspeed_handling="1" route_mode="0">
+ <roadprofile item_types="path,track_ground" speed="12" route_weight="5">
+ </roadprofile>
+ <roadprofile item_types="track_gravelled,track_paved,cycleway,street_service,street_parking_lane,street_0,street_1_city,living_street,street_2_city,street_1_land,street_2_land,street_3_city" speed="25" route_weight="15">
+ </roadprofile>
+ <roadprofile item_types="roundabout" speed="20" route_weight="10"/>
+ <roadprofile item_types="ferry" speed="40" route_weight="40"/>
+ </vehicleprofile>
+</source>
+
+For details on the flags, see [[Vehicle profile flags]].
+The speeds are in km/h.
+
+Only the vehicle profile names "car", "bike" and "pedestrian" are translated in the GUI.
+
+
+[[Category:Customizing]]
+[[Category:Configuration]]
diff --git a/docs/development/programming_guidelines.rst b/docs/development/programming_guidelines.rst
new file mode 100644
index 000000000..cabfa015a
--- /dev/null
+++ b/docs/development/programming_guidelines.rst
@@ -0,0 +1,181 @@
+======================
+Programming guidelines
+======================
+
+NAVIT is a team-project, thus a lot of coders are working on it's development and code base.
+To get a unified coding style and make it easier for everybody to work with parts, that someone else wrote, we tried to specify the formatting of our source and how we deal with third party modules as following.
+
+Coding Style
+============
+
+We try to follow those simple rules:
+* indentation is done using 4 spaces
+* the return type of a function is specified on the same line as the function name
+* the open brackets should be at the end of the line (on the same line as the function name or the if/for/while statement)
+* out line length is of 120 characters
+
+To help us keeping a coherent indentation, we use astyle on C, C++ and java files. Usage example:
+
+.. code-block:: C
+
+ astyle --indent=spaces=4 --style=attach -n --max-code-length=120 -xf -xh my_file.c
+
+
+.. note::
+
+ Because of the bug: [https://sourceforge.net/p/astyle/bugs/230/](https://sourceforge.net/p/astyle/bugs/230/) on astyle,
+ we cannot rely on astyle to handle properly the line length of 120 characters that we choose.
+ It would be recommended to set that line length in the editor you are using.
+
+Character encoding and line breaks
+----------------------------------
+
+All non-ascii-strings must be utf-8 encoded. Line breaks consist of a linefeed (no carriage return).
+
+C Standard
+----------
+
+C95. That means:
+
+* No inline declarations of variables
+
+Instead of
+
+.. code-block:: C
+
+ {
+ do_something();
+ int a=do_something_else();
+ }
+
+use
+
+.. code-block:: C
+
+ {
+ int a;
+ do_something();
+ a=do_something_else();
+ }
+
+* No dynamic arrays
+
+Instead of
+
+.. code-block:: C
+
+ void myfunc(int count) {
+ struct mystruct x[count]
+ }
+
+use
+
+.. code-block:: C
+
+ void myfunc(int count) {
+ struct mystruct *x=g_alloca(count*sizeof(struct mystruct));
+ }
+
+* No empty initializers
+
+Instead of
+
+.. code-block:: C
+
+ struct mystruct m={};
+
+use
+
+.. code-block:: C
+
+ struct mystruct m={0,};
+
+* Use `/*` and `*/` for comments instead of `//`
+
+.. note::
+
+ The restriction to C95 exists mainly to help the [[WinCE]] port, which uses a compiler without full support for C99. Once all platforms supported by Navit use a compiler capable of C99, this decision may be reconsidered.
+
+
+Use of libraries
+----------------
+
+* Navit uses [GLIB](http://developer.gnome.org/glib/) extensively. In general, code should use GLib's functions in preference to functions from libc.
+ For example, use `g_new()` / `g_free()` / `g_realloc()`, rather than `malloc()` / `free()` / `realloc()`, `g_strdup()` rather than `strdup()`, `g_strcmp0()` rather than `strcmp()` etc.
+* Unfortunately, not all platforms that Navit runs on have a native GLib version.
+ For these platforms, there is code replacing these libraries under `navit/support/`.
+ Take care to only use functions from GLib (or other libraries), that is also present under `navit/support/`.
+ If you need something that is not present there, please discuss it on IRC - it may be possible to add it to the support code.
+
+Comments
+--------
+
+General guidelines
+``````````````````
+
+* Comments for the entire `file` and `classes/structs/methods/functions` is the `'minimum requirement`'. Examples see below.
+* Please comment your code in a significant and reasonable way.
+* A quick description of (complicated) algorithms makes it easier for other developers and helps them to save a lot of time.
+* Please add a doxygen description for all function you should add. You are we1come to add it too to older functions. Doxygen result can be found [there](http://doxygen.navit-project.org)
+
+Example :
+
+.. code-block:: C
+
+ /**
+ * @brief Change the current zoom level, zooming closer to the ground.
+ *
+ * This sentence starts the "detailed" description (because this is a new
+ * paragraph).
+ *
+ * @param navit The navit instance
+ * @param factor The zoom factor, usually 2
+ * @param p The invariant point (if set to NULL, default to center)
+ * @returns nothing
+ */
+ void navit_zoom_in(struct navit *this_, int factor, struct point *p)
+
+Templates
+`````````
+
+This is an example how you could (should) comment your files and functions. If you have any suggestions for improvement, please feel free to [[Talk:Programming_guidelines|discuss]] them with us. These templates should be doxygen-conform - if not, please correct them. A more comprehensive overview of possible documentation can be found [http://www.stack.nl/~dimitri/doxygen/manual.html here].
+
+Files
+'''''
+
+.. code-block:: C
+
+ /** @file can.cpp
+ * @brief CAN-Camera Framework :: CAN container class and high level functions
+ *
+ * Some documentation regarding this file.
+ *
+ * @Author Stefan Klumpp <sk@....>
+ * @date 2008
+ */
+ <include "can.h">
+ .
+ .
+ .
+
+Classes/Structs/Functions/Methods
+'''''''''''''''''''''''''''''''''
+
+
+.. code-block:: C
+
+ /**
+ * @brief A short description of this function
+ *
+ * A lot more of documentation regarding this function.
+ * @param raw_data Some string to pass to the function
+ * @return Nothing
+ */
+
+ void CanData::processData(string &raw_data) {
+ .
+ .
+ .
+ }
+
+Please add yourself to the list of authors, if you make a significant change.
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644
index 000000000..ac1a5ab66
--- /dev/null
+++ b/docs/index.rst
@@ -0,0 +1,48 @@
+Navit's User Manual
+===================
+
+This document is the official User Manual for `Navit`__,
+the OpenSource vector based navigation software.
+
+Navit is a open source (GPL) car navigation system with routing engine.
+
+It's modular design is capable of using vector maps of various formats for routing and rendering of the displayed map. It's even possible to use multiple maps at a time.
+
+The user interfaces are designed to work well with touch screen displays. Points of Interest of various formats are displayed on the map.
+
+The current vehicle position is either read from gpsd or directly from NMEA GPS sensors.
+
+The routing engine not only calculates an optimal route to your destination, but also generates directions and even speaks to you.
+
+Navit currently speaks over 70 languages!
+
+Navit is highly customizable, from map layouts and on-screen display to the details of the routing engine.
+
+.. image:: navit.png
+
+.. toctree::
+ :hidden:
+ :glob:
+ :numbered:
+ :maxdepth: 2
+ :caption: Navit's user manual
+
+ basic_configuration
+ maps
+
+
+.. Indices and tables
+.. ------------------
+
+.. * :ref:`genindex`
+.. * :ref:`modindex`
+.. * :ref:`search`
+
+.. __: https://github.com/navit-gps/navit/
+
+.. toctree::
+ :maxdepth: 2
+ :glob:
+ :caption: Navit's developer documentation
+
+ development/programming_guidelines
diff --git a/docs/maps.rst b/docs/maps.rst
new file mode 100644
index 000000000..ff5b18c2f
--- /dev/null
+++ b/docs/maps.rst
@@ -0,0 +1,20 @@
+.. _maps:
+Maps
+====
+
+Navit can use a variety of maps from a number of sources. This includes free and commercial material, that can be read using different map drivers which allow different sets of functionality. The visual design of maps can be adjusted with a layout.
+
+The following matrix shows at-a-glance the features that each supported map type has.
+
+============================== ======== ===== ======= ====== == =============== ========
+Provider Coverage Age Binfile Garmin mg poi_geodownload textfile
+============================== ======== ===== ======= ====== == =============== ========
+OpenStreetMap global daily Yes Yes
+Garmin maps global Yes Yes
+Marco Polo Grosser Reiseplaner EU > 4y
+Routeplaner Europa 2007 EU > 4y
+Map + Route EU > 4y
+============================== ======== ===== ======= ====== == =============== ========
+
+.. include:: osm.rst
+.. include:: binfile.rst
diff --git a/docs/navit.png b/docs/navit.png
new file mode 100644
index 000000000..81f3239d6
--- /dev/null
+++ b/docs/navit.png
Binary files differ
diff --git a/docs/osm.rst b/docs/osm.rst
new file mode 100644
index 000000000..12766d0d2
--- /dev/null
+++ b/docs/osm.rst
@@ -0,0 +1,117 @@
+.. _OpenStreetMap:
+OpenStreetMap
+-------------
+
+`OpenStreetMap <http://www.openstreetmap.org/>`_ is a free editable map of the whole world. It is made by people like you. OpenStreetMap allows you to view, edit and use geographical data in a collaborative way from anywhere on Earth. Maps from OpenStreetMap can be used in Navit.
+
+Quick Start
+~~~~~~~~~~~
+
+* Go to `Navit Planet Extractor <http://maps.navit-project.org/>`_
+* Zoom in and select the area that you are interested in. Use the 'Map Controls' on the right to switch between 'Navigation' and 'Select' modes. or use preselected areas:
+ * `Germany <http://maps.navit-project.org/api/map/?bbox=5.185546875,46.845703125,15.46875,55.634765625>`_
+ * `France <http://maps.navit-project.org/api/map/?bbox=-5.44921875,42.01171875,8.437500000000002,51.6796875>`_
+ * `BeNeLux <http://maps.navit-project.org/api/map/?bbox=2.08740234375,48.8671875,7.778320312500001,54.51416015625>`_
+ * `Spain/Portugal <http://maps.navit-project.org/api/map/?bbox=-11.0302734375,34.87060546875,4.614257812500003,44.40673828125>`_
+ * `Italy <http://maps.navit-project.org/api/map/?bbox=6.52587890625,36.38671875,18.96240234375,47.197265625>`_
+ * `Entire planet <http://maps.navit-project.org/planet.bin>`_
+* Hit '''Get Map!'''
+* Move the downloaded map to the directory of your choice, and add it to the active the mapset (see [[Configuration]]) in navit.xml with a line similar to the following:
+
+.. code-block:: xml
+
+ <mapset>
+ <map type="binfile" enabled="yes" data="/path/to/your/map/osm_bbox.bin" />
+ </mapset>
+
+Add OSM map to your mapset
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+Move the downloaded map to the directory of your choice, and add it to the active mapset (see [[Configuration]]) in navit.xml with a line similar to the following:
+
+.. code-block:: xml
+
+ <mapset>
+ <map type="binfile" enabled="yes" data="/path/to/your/map/my_downloaded_map.bin" />
+ </mapset>
+
+Topographic Maps
+~~~~~~~~~~~~~~~~
+Navit will display elevation/height lines but the required data is not included in most OSM derived maps.
+
+Navit compatible maps with height lines can be created by feeding the output of `Phyghtmap <http://wiki.openstreetmap.org/wiki/Phyghtmap>`_ to Navit's maptool. Alternatively the SRTM data can be downloaded in osm.xml format http://geoweb.hft-stuttgart.de/SRTM/srtm_as_osm/, avoiding the Phygtmap step. The information can be either merged with OSM derived maps or used in a separate layer.
+
+Many Garmin type maps such as http://www.wanderreitkarte.de/garmin_de.php also have the height lines information but routing will not work with them.
+
+Processing OSM Maps yourself
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+You can create your own Navit binfiles from OSM data very easily using [[maptool]], the conversion program which installs alongside Navit. ''maptool'' can process both OpenStreetMap XML Data files (*.osm files) and OpenStreetMap Protobuf Data files (*.pbf files) Follow these steps to process your own maps.
+
+Download your own OSM data
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+OSM data can be downloaded from a variety of sources. OpenStreetMap XML Data files are regular textfiles, easily editable in any text editor. OpenStreetMap Protobuf Data files are binary files, which take up less space (so are quicker to download and process) but are not editable.
+
+* '''OpenStreetMap XML Data'''
+ * `Geofabrik <http://download.geofabrik.de/osm/>`_ provides pre-processed OpenStreetMap XML Data files of almost all countries, and all continents. This method is probably the easiest way of downloading OpenStreetMap XML Data for an entire country or continent. Note that the OSM files are bzipped
+ * `planet.openstreetmap.org <http://planet.openstreetmap.org>`_ hosts the complete data set (the whole world). You can use `Osmosis <http://wiki.openstreetmap.org/index.php/Osmosis>`_ to cut it into smaller chunks.
+ * `OpenStreetMap ReadOnly (XAPI) <http://wiki.openstreetmap.org/wiki/Xapi>`_ The API allows to get the data of a specific bounding box, so that download managers can be used. For example:
+ wget -O map.osm "http://xapi.openstreetmap.org/api/0.6/map?bbox=11.4,48.7,11.6,48.9"
+ * [http://www.openstreetmap.org/export OpenStreetMap (visual)] allows you to select a small rectangular area and download the selection as OpenStreetMap XML Data.
+* '''OpenStreetMap Protobuf Data'''
+ * [http://download.geofabrik.de/osm/ Geofabrik] provides pre-processed OpenStreetMap Protobuf Data files of almost all countries, and all continents.
+
+Convert OSM data to Navit binfile
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+The following examples assume that you have installed Navit system-wide. If this is not the case, you will need to provide an absolute path to the ''maptool'' executable, which is in the navit/maptool folder.
+
+Please also note, that maptool uses country multipolygon relations. So it's a good idea to include the whole country boundary to your dataset. You can use the josm editor to download the country boundary relation and save it as osm file. Then this file can be concatenated with your sub-country level excerpt.
+
+From .osm
+"""""""""
+.. code-block:: bash
+
+ cat my_OSM_map.osm | maptool my_Navit_map.bin
+
+Or
+
+.. code-block:: bash
+
+ maptool -i my_OSM_map.osm my_Navit_map.bin
+
+Or for multiple OSM data files use the <tt>--dedupe-ways</tt> option to avoid duplication of way data if a way occurs multiple times in the OSM maps.
+
+.. code-block:: bash
+
+ cat my_OSM_map1.osm my_OSM_map2.osm my_OSM_map3.osm | maptool --dedupe-ways my_Navit_map.bin
+
+From .bz2
+"""""""""
+.. code-block:: bash
+
+ bzcat my_OSM_map.osm.bz2 | maptool my_Navit_map.bin
+
+From .pbf
+"""""""""
+.. code-block:: bash
+
+ maptool --protobuf -i my_OSM_map.osm.pbf my_Navit_map.bin
+
+Processing the whole Planet
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The OpenStreetMap wiki [http://wiki.openstreetmap.org/index.php/Planet.osm Planet.osm] page lists mirrors where Planet.osm can be downloaded. There are also downloads of smaller areas such as the UK and parts of Europe. These smaller excerpts are a lot quicker to download and process.
+
+In case you want the whole planet.osm (24GB in December 2012), it is even possible to process planet.osm. It will take about 7 hours , requires > 1GB of main memory and about 30 GB disk space for result and temp files - planet.bin is currently (as of December 2012) 9.6GB:
+
+.. code-block:: bash
+
+ bzcat planet.osm.bz2 | maptool -6 my_Navit_map.bin
+
+Please note -6 option (long name --64bit) used above. It should be used always if output bin file grows above 4GB, or generated file will not work at all. Using that option on smaller files slightly increases their size and makes them unreadable by some unzip versions.
+
+Tips
+~~~~
+* To enable a map you have downloaded refer [[OpenStreetMap#Adding_an_OSM_map_to_your_mapset| adding OSM map to navit.xml]]
+* If you don't see any map data in Navit (assuming your map is properly specified in navit.xml) using the Internal GUI click anywhere on the screen to bring up the menu. Click on "Actions" and then "Town". Type in the name of a town that should be within your map data. Select your town from the list that appears. This will bring up a sub-menu where you can click "View On Map". Note that if you have a GPS receiver you can also just wait till you get a satellite lock.
+* To avoid changing navit.xml if you update your maps and the maps have different file names use the wildcard (\*.bin) in your navit.xml file. For example:
+.. code-block:: xml
+
+ <map type="binfile" enabled="yes" data="/media/mmc2/maps/*.bin"/>
diff --git a/navit/CMakeLists.txt b/navit/CMakeLists.txt
index ca19ce41d..0c4d4243d 100644
--- a/navit/CMakeLists.txt
+++ b/navit/CMakeLists.txt
@@ -95,28 +95,22 @@ if(NOT ANDROID)
endif()
endif()
-if (SHARED_LIBNAVIT)
- add_library (${NAVIT_LIBNAME} SHARED ${NAVIT_SRC} )
-else(SHARED_LIBNAVIT)
- add_library (${NAVIT_LIBNAME} STATIC ${NAVIT_SRC} )
-endif(SHARED_LIBNAVIT)
+#if (SHARED_LIBNAVIT)
+# add_library (${NAVIT_LIBNAME} SHARED ${NAVIT_SRC} )
+#else(SHARED_LIBNAVIT)
+# add_library (${NAVIT_LIBNAME} STATIC ${NAVIT_SRC} )
+#endif(SHARED_LIBNAVIT)
+
+add_library (${NAVIT_LIBNAME} ${NAVIT_SRC} )
if(NOT MSVC)
SET(NAVIT_LIBS ${NAVIT_LIBS} m)
endif(NOT MSVC)
-target_link_libraries(${NAVIT_LIBNAME} ${MODULES_NAME} ${NAVIT_SUPPORT_LIBS} fib ${NAVIT_LIBS} )
+target_link_libraries(${NAVIT_LIBNAME} ${MODULES_NAME} ${NAVIT_SUPPORT_LIBS} fib ${NAVIT_LIBS} )
set_target_properties(${NAVIT_LIBNAME} PROPERTIES COMPILE_DEFINITIONS "MODULE=navit;LIBDIR=\"${CMAKE_INSTALL_PREFIX}/${LIB_DIR}\";PREFIX=\"${CMAKE_INSTALL_PREFIX}\"")
if (DEFINED NAVIT_COMPILE_FLAGS)
set_target_properties(${NAVIT_LIBNAME} PROPERTIES COMPILE_FLAGS "${NAVIT_COMPILE_FLAGS}")
endif()
-ADD_CUSTOM_TARGET(
- git_version
- ${CMAKE_COMMAND} -D SRC=${CMAKE_CURRENT_SOURCE_DIR}/version.h.in
- -D DST=${CMAKE_CURRENT_BINARY_DIR}/version.h
- -D NAME="GIT_VERSION"
- -P ${PROJECT_SOURCE_DIR}/cmake/version.cmake
- )
-
add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/navit.dtd"
COMMENT "Copy navit.dtd to ${CMAKE_CURRENT_BINARY_DIR}/navit.dtd"
@@ -216,7 +210,6 @@ else()
add_custom_target( navit_config_xml ALL DEPENDS ${XMLCFG_OUTPUT_LIST})
endif()
-ADD_DEPENDENCIES(${NAVIT_LIBNAME} git_version)
if (USE_LIBGNUINTL AND NOT HAVE_GLIB)
ADD_DEPENDENCIES(support_glib support_gettext_intl)
endif()
diff --git a/navit/android.c b/navit/android.c
index 9b06ebb44..dc506ffb0 100644
--- a/navit/android.c
+++ b/navit/android.c
@@ -22,7 +22,8 @@
#include "track.h"
JNIEnv *jnienv;
-jobject *android_activity;
+jobject *android_activity = NULL;
+jobject *android_application = NULL;
int android_version;
struct android_search_priv {
@@ -67,14 +68,20 @@ int android_find_static_method(jclass class, char *name, char *args, jmethodID *
}
JNIEXPORT void JNICALL Java_org_navitproject_navit_Navit_NavitMain( JNIEnv* env, jobject thiz, jobject activity,
- jobject lang, int version, jobject display_density_string, jobject path, jobject map_path) {
+ jobject application, jobject lang, int version, jobject display_density_string, jobject path, jobject map_path,
+ jboolean isLaunch) {
const char *langstr;
const char *displaydensitystr;
const char *map_file_path;
android_version=version;
__android_log_print(ANDROID_LOG_ERROR,"test","called");
jnienv=env;
+ if (android_activity)
+ (*jnienv)->DeleteGlobalRef(jnienv, android_activity);
android_activity = (*jnienv)->NewGlobalRef(jnienv, activity);
+ if (android_application)
+ (*jnienv)->DeleteGlobalRef(jnienv, android_application);
+ android_application = (*jnienv)->NewGlobalRef(jnienv, application);
langstr=(*env)->GetStringUTFChars(env, lang, NULL);
dbg(lvl_debug,"enter env=%p thiz=%p activity=%p lang=%s version=%d",env,thiz,android_activity,langstr,version);
setenv("LANG",langstr,1);
@@ -89,9 +96,11 @@ JNIEXPORT void JNICALL Java_org_navitproject_navit_Navit_NavitMain( JNIEnv* env,
setenv("NAVIT_USER_DATADIR",map_file_path,1);
(*env)->ReleaseStringUTFChars(env, display_density_string, map_file_path);
- const char *strings=(*env)->GetStringUTFChars(env, path, NULL);
- main_real(1, &strings);
- (*env)->ReleaseStringUTFChars(env, path, strings);
+ if (isLaunch) {
+ const char *strings=(*env)->GetStringUTFChars(env, path, NULL);
+ main_real(1, &strings);
+ (*env)->ReleaseStringUTFChars(env, path, strings);
+ }
}
JNIEXPORT void JNICALL Java_org_navitproject_navit_Navit_NavitDestroy( JNIEnv* env) {
diff --git a/navit/android.h b/navit/android.h
index 24774d0e5..ee8b1b4b5 100644
--- a/navit/android.h
+++ b/navit/android.h
@@ -1,6 +1,7 @@
#include <jni.h>
extern JNIEnv *jnienv;
extern jobject *android_activity;
+extern jobject *android_application;
extern int android_version;
int android_find_class_global(char *name, jclass *ret);
int android_find_method(jclass class, char *name, char *args, jmethodID *ret);
diff --git a/navit/android/CMakeLists.txt b/navit/android/CMakeLists.txt
index 91a4b29e7..64bd47f8e 100644
--- a/navit/android/CMakeLists.txt
+++ b/navit/android/CMakeLists.txt
@@ -35,7 +35,6 @@ if (ANDROID AND NOT ${CMAKE_GENERATOR} STREQUAL Ninja)
-D ANDROID_API_VERSION=${ANDROID_API_VERSION}
-D ANDROID_PERMISSIONS:string="${ANDROID_PERMISSIONS_EXPANDED}"
-D STRIP_M="1"
- -P ${PROJECT_SOURCE_DIR}/cmake/version.cmake
)
add_custom_command (
diff --git a/navit/android/res/values/strings.xml b/navit/android/res/values/strings.xml
index ae80265e3..f321991e7 100644
--- a/navit/android/res/values/strings.xml
+++ b/navit/android/res/values/strings.xml
@@ -7,6 +7,7 @@
<string name="cancel">Cancel</string>
<!-- NOTIFICATION -->
+ <string name="channel_name">Navit</string>
<string name="notification_ticker">Navit started</string>
<string name="notification_event_default">Navit running</string>
diff --git a/navit/android/src/org/navitproject/navit/Navit.java b/navit/android/src/org/navitproject/navit/Navit.java
index e6a477a37..bc2af1632 100644
--- a/navit/android/src/org/navitproject/navit/Navit.java
+++ b/navit/android/src/org/navitproject/navit/Navit.java
@@ -20,10 +20,13 @@
package org.navitproject.navit;
import android.Manifest;
+import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlertDialog;
+import android.app.Application;
import android.app.Dialog;
import android.app.Notification;
+import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
@@ -70,16 +73,12 @@ import java.util.regex.Pattern;
public class Navit extends Activity {
+ protected static NavitGraphics graphics = null;
private 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;
- private 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;
@@ -92,6 +91,7 @@ public class Navit extends Activity {
private static final int NavitSelectStorage_id = 43;
private static String NavitLanguage;
private static Resources NavitResources = null;
+ private static final String CHANNEL_ID = "org.navitproject.navit";
private static final String NAVIT_PACKAGE_NAME = "org.navitproject.navit";
private static final String TAG = "Navit";
static String map_filename_path = null;
@@ -101,7 +101,7 @@ public class Navit extends Activity {
Boolean isFullscreen = false;
private static final int MY_PERMISSIONS_REQUEST_ALL = 101;
private static NotificationManager nm;
- private static Navit navit;
+ private static Navit navit = null;
public static Navit getInstance() {
return navit;
@@ -120,6 +120,25 @@ public class Navit extends Activity {
}
}
+ private void createNotificationChannel() {
+ /*
+ * Create the NotificationChannel, but only on API 26+ because
+ * the NotificationChannel class is new and not in the support library
+ */
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ CharSequence name = getString(R.string.channel_name);
+ //String description = getString(R.string.channel_description);
+ int importance = NotificationManager.IMPORTANCE_LOW;
+ NotificationChannel channel = new NotificationChannel(CHANNEL_ID, name, importance);
+ //channel.setDescription(description);
+ /*
+ * Register the channel with the system; you can't change the importance
+ * or other notification behaviors after this
+ */
+ NotificationManager notificationManager = getSystemService(NotificationManager.class);
+ notificationManager.createNotificationChannel(channel);
+ }
+ }
public void removeFileIfExists(String source) {
File file = new File(source);
@@ -320,6 +339,9 @@ public class Navit extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
+ /* Whether this is the first launch of Navit (as opposed to the activity being recreated) */
+ boolean isLaunch = (navit == null);
+
super.onCreate(savedInstanceState);
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.HONEYCOMB) {
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
@@ -342,37 +364,33 @@ public class Navit extends Activity {
// NOTIFICATION
// Setup the status bar notification
// This notification is removed in the exit() function
+ if (isLaunch)
+ createNotificationChannel();
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(getTstring(R.string.app_name));
- builder.setContentText(getTstring(R.string.notification_event_default));
- builder.setSmallIcon(R.drawable.ic_notify);
- Notification NavitNotification = builder.build();
+ Notification NavitNotification;
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+ Notification.Builder builder;
+ builder = new Notification.Builder(getApplicationContext(), CHANNEL_ID);
+ builder.setContentIntent(appIntent);
+ builder.setAutoCancel(false).setOngoing(true);
+ builder.setContentTitle(getTstring(R.string.app_name));
+ builder.setContentText(getTstring(R.string.notification_event_default));
+ builder.setSmallIcon(R.drawable.ic_notify);
+ NavitNotification = builder.build();
+ } else {
+ NotificationCompat.Builder builder;
+ builder = new NotificationCompat.Builder(getApplicationContext());
+ builder.setContentIntent(appIntent);
+ builder.setAutoCancel(false).setOngoing(true);
+ builder.setContentTitle(getTstring(R.string.app_name));
+ builder.setContentText(getTstring(R.string.notification_event_default));
+ builder.setSmallIcon(R.drawable.ic_notify);
+ 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,
@@ -465,8 +483,10 @@ public class Navit extends Activity {
}
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);
+ NavitMain(this, getApplication(), NavitLanguage, Integer.valueOf(android.os.Build.VERSION.SDK), my_display_density,
+ NAVIT_DATA_DIR + "/bin/navit", map_filename_path, isLaunch);
+ if (graphics != null)
+ graphics.setActivity(this);
showInfos();
@@ -502,6 +522,7 @@ public class Navit extends Activity {
}
}
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();
@@ -855,7 +876,8 @@ public class Navit extends Activity {
}
break;
default :
- ActivityResults[requestCode].onActivityResult(requestCode, resultCode, data);
+ if (ActivityResults[requestCode] != null)
+ ActivityResults[requestCode].onActivityResult(requestCode, resultCode, data);
break;
}
}
@@ -891,10 +913,6 @@ public class Navit extends Activity {
public void onDestroy() {
super.onDestroy();
Log.d(TAG, "OnDestroy");
- // 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) {
@@ -934,8 +952,8 @@ public class Navit extends Activity {
NavitDestroy();
}
- public native void NavitMain(Navit x, String lang, int version, String display_density_string, String path,
- String path2);
+ public native void NavitMain(Navit x, Application application, String lang, int version,
+ String display_density_string, String path, String path2, boolean isLaunch);
public native void NavitDestroy();
diff --git a/navit/android/src/org/navitproject/navit/NavitGraphics.java b/navit/android/src/org/navitproject/navit/NavitGraphics.java
index ba6b87bde..4e7929f88 100644
--- a/navit/android/src/org/navitproject/navit/NavitGraphics.java
+++ b/navit/android/src/org/navitproject/navit/NavitGraphics.java
@@ -20,9 +20,11 @@
package org.navitproject.navit;
import android.annotation.SuppressLint;
+import android.annotation.TargetApi;
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.Matrix;
@@ -43,6 +45,7 @@ import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup.LayoutParams;
+import android.view.WindowInsets;
import android.view.inputmethod.InputMethodManager;
import android.widget.FrameLayout;
import android.widget.RelativeLayout;
@@ -64,12 +67,18 @@ public class NavitGraphics {
private int bgcolor;
private float trackball_x;
private float trackball_y;
+ private int padding_left = 0;
+ private int padding_right = 0;
+ private int padding_top = 0;
+ private int padding_bottom = 0;
private View view;
- private SystemBarTintView navigationTintView;
- private SystemBarTintView statusTintView;
+ private SystemBarTintView leftTintView;
+ private SystemBarTintView rightTintView;
+ private SystemBarTintView topTintView;
+ private SystemBarTintView bottomTintView;
private FrameLayout frameLayout;
private RelativeLayout relativelayout;
- private NavitCamera camera;
+ private NavitCamera camera = null;
private Navit activity;
private static Boolean in_map = false;
// for menu key
@@ -80,18 +89,45 @@ public class NavitGraphics {
public void setBackgroundColor(int bgcolor) {
this.bgcolor = bgcolor;
- if (navigationTintView != null) {
- navigationTintView.setBackgroundColor(bgcolor);
+ if (leftTintView != null) {
+ leftTintView.setBackgroundColor(bgcolor);
}
- if (statusTintView != null) {
- statusTintView.setBackgroundColor(bgcolor);
+ if (rightTintView != null) {
+ rightTintView.setBackgroundColor(bgcolor);
+ }
+ if (topTintView != null) {
+ topTintView.setBackgroundColor(bgcolor);
+ }
+ if (bottomTintView != null) {
+ bottomTintView.setBackgroundColor(bgcolor);
}
}
private void SetCamera(int use_camera) {
if (use_camera != 0 && camera == null) {
// activity.requestWindowFeature(Window.FEATURE_NO_TITLE);
- camera = new NavitCamera(activity);
+ addCamera();
+ addCameraView();
+ }
+ }
+
+ /**
+ * @brief Adds a camera.
+ *
+ * This method does not create the view for the camera. This must be done separately by calling
+ * {@link #addCameraView()}.
+ */
+ private void addCamera() {
+ camera = new NavitCamera(activity);
+ }
+
+ /**
+ * @brief Adds a view for the camera.
+ *
+ * If {@link #camera} is null, this method is a no-op.
+ */
+ private void addCameraView() {
+ if (camera != null) {
relativelayout.addView(camera);
relativelayout.bringChildToFront(view);
}
@@ -146,6 +182,22 @@ public class NavitGraphics {
}
@Override
+ @TargetApi(20)
+ public WindowInsets onApplyWindowInsets (WindowInsets insets) {
+ /*
+ * We're skipping the top inset here because it appears to have a bug on most Android versions tested,
+ * causing it to report between 24 and 64 dip more than what is actually occupied by the system UI.
+ * The top inset is retrieved in handleResize(), with logic depending on the platform version.
+ */
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT_WATCH) {
+ padding_left = insets.getSystemWindowInsetLeft();
+ padding_right = insets.getSystemWindowInsetRight();
+ padding_bottom = insets.getSystemWindowInsetBottom();
+ }
+ return super.onApplyWindowInsets(insets);
+ }
+
+ @Override
protected void onCreateContextMenu(ContextMenu menu) {
super.onCreateContextMenu(menu);
@@ -557,33 +609,10 @@ public class NavitGraphics {
public NavitGraphics(final Activity activity, NavitGraphics parent, int x, int y, int w, int h,
int wraparound, int use_camera) {
if (parent == null) {
- this.activity = (Navit) activity;
- view = new NavitView(activity);
- //activity.registerForContextMenu(view);
- view.setClickable(false);
- view.setFocusable(true);
- view.setFocusableInTouchMode(true);
- view.setKeepScreenOn(true);
- relativelayout = new RelativeLayout(activity);
if (use_camera != 0) {
- SetCamera(use_camera);
- }
- relativelayout.addView(view);
-
- /* The navigational and status bar tinting code is meaningful only on API19+ */
- if (Build.VERSION.SDK_INT >= 19) {
- frameLayout = new FrameLayout(activity);
- frameLayout.addView(relativelayout);
- navigationTintView = new SystemBarTintView(activity);
- statusTintView = new SystemBarTintView(activity);
- frameLayout.addView(navigationTintView);
- frameLayout.addView(statusTintView);
- activity.setContentView(frameLayout);
- } else {
- activity.setContentView(relativelayout);
+ addCamera();
}
-
- view.requestFocus();
+ setActivity(activity);
} else {
draw_bitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
bitmap_w = w;
@@ -597,6 +626,44 @@ public class NavitGraphics {
parent_graphics = parent;
}
+ /**
+ * @brief Sets up the main activity.
+ *
+ * @param activity The main activity.
+ */
+ protected void setActivity(final Activity activity) {
+ if (Navit.graphics == null)
+ Navit.graphics = this;
+ this.activity = (Navit) activity;
+ view = new NavitView(activity);
+ view.setClickable(false);
+ view.setFocusable(true);
+ view.setFocusableInTouchMode(true);
+ view.setKeepScreenOn(true);
+ relativelayout = new RelativeLayout(activity);
+ addCameraView();
+ relativelayout.addView(view);
+
+ /* The navigational and status bar tinting code is meaningful only on API19+ */
+ if (Build.VERSION.SDK_INT >= 19) {
+ frameLayout = new FrameLayout(activity);
+ frameLayout.addView(relativelayout);
+ leftTintView = new SystemBarTintView(activity);
+ rightTintView = new SystemBarTintView(activity);
+ topTintView = new SystemBarTintView(activity);
+ bottomTintView = new SystemBarTintView(activity);
+ frameLayout.addView(leftTintView);
+ frameLayout.addView(rightTintView);
+ frameLayout.addView(topTintView);
+ frameLayout.addView(bottomTintView);
+ activity.setContentView(frameLayout);
+ } else {
+ activity.setContentView(relativelayout);
+ }
+
+ view.requestFocus();
+ }
+
public enum msg_type {
CLB_ZOOM_IN, CLB_ZOOM_OUT, CLB_REDRAW, CLB_MOVE, CLB_BUTTON_UP, CLB_BUTTON_DOWN, CLB_SET_DESTINATION,
CLB_SET_DISPLAY_DESTINATION, CLB_CALL_CMD, CLB_COUNTRY_CHOOSER, CLB_LOAD_MAP, CLB_UNLOAD_MAP, CLB_DELETE_MAP
@@ -688,82 +755,44 @@ public class NavitGraphics {
*
*/
private void adjustSystemBarsTintingViews() {
-
- /* frameLayout is only created on platforms supporting navigation and status bar tinting */
- if (frameLayout == null) {
- return;
- }
- if (activity == null) {
- Log.w(TAG, "Main Activity is not a Navit instance, cannot update padding");
- return;
- }
-
- Navit navit = activity;
-
- /*
- * Determine visibility of status bar.
- * The status bar is always visible unless we are in fullscreen mode.
- */
- final Boolean isStatusShowing = !navit.isFullscreen;
-
- /*
- * Determine visibility of navigation bar.
- * This logic is based on the presence of a hardware menu button and is known to work on
- * devices which allow switching between hw and sw buttons (OnePlus One running CyanogenMod).
- */
- final Boolean isNavShowing = !ViewConfigurationCompat.hasPermanentMenuKey(ViewConfiguration.get(navit));
- Log.d(TAG, String.format("isStatusShowing=%b isNavShowing=%b", isStatusShowing, isNavShowing));
-
- /*
- * Determine where the navigation bar would be displayed.
- * Logic is taken from AOSP RenderSessionImpl.findNavigationBar()
- * platform/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
- */
- final Boolean isLandscape = (navit.getResources().getConfiguration().orientation
- == Configuration.ORIENTATION_LANDSCAPE);
- final Boolean isNavAtBottom = (!isLandscape)
- || (navit.getResources().getConfiguration().smallestScreenWidthDp >= 600);
- Log.d(TAG, String.format("isNavAtBottom=%b (Configuration.smallestScreenWidthDp=%d, isLandscape=%b)",
- isNavAtBottom, navit.getResources().getConfiguration().smallestScreenWidthDp, isLandscape));
-
- int left = 0;
- int top = isStatusShowing ? Navit.status_bar_height : 0;
- int right = (isNavShowing && !isNavAtBottom) ? Navit.navigation_bar_width : 0;
- final int bottom = (!(isNavShowing
- && isNavAtBottom)) ? 0 : (
- isLandscape ? Navit.navigation_bar_height_landscape : Navit.navigation_bar_height);
-
/* hide tint bars during update to prevent ugly effects */
- statusTintView.setVisibility(View.GONE);
- navigationTintView.setVisibility(View.GONE);
+ leftTintView.setVisibility(View.GONE);
+ rightTintView.setVisibility(View.GONE);
+ topTintView.setVisibility(View.GONE);
+ bottomTintView.setVisibility(View.GONE);
frameLayout.post(new Runnable() {
@Override
public void run() {
- statusTintView.setVisibility(isStatusShowing ? View.VISIBLE : View.GONE);
- FrameLayout.LayoutParams statusLayoutParams = new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT,
- Navit.status_bar_height, Gravity.TOP);
-
- /* Prevent tint views from overlapping when navigation is on the right */
- statusLayoutParams.setMargins(0, 0,
- (isNavShowing && !isNavAtBottom) ? Navit.navigation_bar_width : 0, 0);
- statusTintView.setLayoutParams(statusLayoutParams);
- Log.d(TAG, String.format("statusTintView: width=%d height=%d",
- statusTintView.getWidth(), statusTintView.getHeight()));
- navigationTintView.setVisibility(isNavShowing ? View.VISIBLE : View.GONE);
- LayoutParams navigationLayoutParams = new FrameLayout.LayoutParams(
- isNavAtBottom ? LayoutParams.MATCH_PARENT : Navit.navigation_bar_width, // X
- isNavAtBottom ? bottom : LayoutParams.MATCH_PARENT, // Y
- Gravity.BOTTOM | Gravity.RIGHT);
- navigationTintView.setLayoutParams(navigationLayoutParams);
- Log.d(TAG, String.format("navigationTintView: width=%d height=%d",
- navigationTintView.getWidth(), navigationTintView.getHeight()));
+ FrameLayout.LayoutParams leftLayoutParams = new FrameLayout.LayoutParams(padding_left,
+ LayoutParams.MATCH_PARENT, Gravity.BOTTOM | Gravity.LEFT);
+ leftTintView.setLayoutParams(leftLayoutParams);
+
+ FrameLayout.LayoutParams rightLayoutParams = new FrameLayout.LayoutParams(padding_right,
+ LayoutParams.MATCH_PARENT, Gravity.BOTTOM | Gravity.RIGHT);
+ rightTintView.setLayoutParams(rightLayoutParams);
+
+ FrameLayout.LayoutParams topLayoutParams = new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT,
+ padding_top, Gravity.TOP);
+ /* Prevent horizontal and vertical tint views from overlapping */
+ topLayoutParams.setMargins(padding_left, 0, padding_right, 0);
+ topTintView.setLayoutParams(topLayoutParams);
+
+ FrameLayout.LayoutParams bottomLayoutParams = new FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT,
+ padding_bottom, Gravity.BOTTOM);
+ /* Prevent horizontal and vertical tint views from overlapping */
+ bottomLayoutParams.setMargins(padding_left, 0, padding_right, 0);
+ bottomTintView.setLayoutParams(bottomLayoutParams);
+
+ /* show tint bars again */
+ leftTintView.setVisibility(View.VISIBLE);
+ rightTintView.setVisibility(View.VISIBLE);
+ topTintView.setVisibility(View.VISIBLE);
+ bottomTintView.setVisibility(View.VISIBLE);
}
});
- Log.d(TAG, String.format("Padding left=%d top=%d right=%d bottom=%d", left, top, right, bottom));
-
- PaddingChangedCallback(PaddingChangedCallbackID, left, top, right, bottom);
+ PaddingChangedCallback(PaddingChangedCallbackID, padding_left, padding_top, padding_right, padding_bottom);
}
/**
@@ -773,12 +802,123 @@ public class NavitGraphics {
* {@code onSizeChanged()} event handler fires or when toggling Fullscreen mode.
*
*/
+ @TargetApi(23)
public void handleResize(int w, int h) {
if (this.parent_graphics != null) {
this.parent_graphics.handleResize(w, h);
} else {
Log.d(TAG, String.format("handleResize w=%d h=%d", w, h));
+ if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.M) {
+ /*
+ * On API 23+ we can query window insets to determine the area which is obscured by the system bars.
+ * This appears to have a bug, though, causing an inset to be reported for the navigation bar even
+ * when it is not obstructing the window. Therefore, we are relying on the values previously obtained
+ * by NavitView#onApplyWindowInsets(), though this is affected by a different bug. Luckily, the two
+ * bugs appear to be complementary, allowing us to mix and match results.
+ */
+ if (view == null) {
+ Log.w(TAG, "view is null, cannot update padding");
+ } else {
+ Log.d(TAG, String.format("view w=%d h=%d x=%.0f y=%.0f",
+ view.getWidth(), view.getHeight(), view.getX(), view.getY()));
+ if (view.getRootWindowInsets() == null)
+ Log.w(TAG, "No root window insets, cannot update padding");
+ else {
+ Log.d(TAG, String.format("RootWindowInsets left=%d right=%d top=%d bottom=%d",
+ view.getRootWindowInsets().getSystemWindowInsetLeft(),
+ view.getRootWindowInsets().getSystemWindowInsetRight(),
+ view.getRootWindowInsets().getSystemWindowInsetTop(),
+ view.getRootWindowInsets().getSystemWindowInsetBottom()));
+ padding_top = view.getRootWindowInsets().getSystemWindowInsetTop();
+ }
+ }
+ } else if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT_WATCH) {
+ /*
+ * API 20-22 do not support root window insets, forcing us to make an educated guess about the
+ * navigation bar height:
+ *
+ * The size is a platform default and does not change with rotation, but we have to figure out if it
+ * applies, i.e. if the status bar is visible.
+ *
+ * The status bar is always visible unless we are in fullscreen mode. (Fortunately, none of the
+ * versions affected by this support split screen mode, which would have further complicated things.)
+ */
+ if (activity.isFullscreen)
+ padding_top = 0;
+ else {
+ Resources resources = view.getResources();
+ int shid = resources.getIdentifier("status_bar_height", "dimen", "android");
+ padding_top = (shid > 0) ? resources.getDimensionPixelSize(shid) : 0;
+ }
+ } else if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) {
+ /*
+ * API 19 does not support window insets at all, forcing us to do even more guessing than on API 20-22:
+ *
+ * All system bar sizes are platform defaults and do not change with rotation, but we have
+ * to figure out which ones apply.
+ *
+ * Status bar visibility is as on API 20-22.
+ *
+ * The navigation bar is shown on devices that report they have no physical menu button. This seems to
+ * work even on devices that allow disabling the physical buttons (and use the navigation bar, in which
+ * case they report no physical menu button is available; tested with a OnePlus One running CyanogenMod).
+ *
+ * If shown, the navigation bar may appear on the side or at the bottom. The logic to determine this is
+ * taken from AOSP RenderSessionImpl.findNavigationBar()
+ * platform/frameworks/base/tools/layoutlib/bridge/src/com/android/layoutlib/bridge/impl/RenderSessionImpl.java
+ */
+ Resources resources = view.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");
+ int status_bar_height = (shid > 0) ? resources.getDimensionPixelSize(shid) : 0;
+ int action_bar_default_height = (adhid > 0) ? resources.getDimensionPixelSize(adhid) : 0;
+ int navigation_bar_height = (nhid > 0) ? resources.getDimensionPixelSize(nhid) : 0;
+ int navigation_bar_height_landscape = (nhlid > 0) ? resources.getDimensionPixelSize(nhlid) : 0;
+ int 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 (activity == null) {
+ Log.w(TAG, "Main Activity is not a Navit instance, cannot update padding");
+ } else if (frameLayout != null) {
+ /* frameLayout is only created on platforms supporting navigation and status bar tinting */
+
+ Navit navit = activity;
+ boolean isStatusShowing = !navit.isFullscreen;
+ boolean isNavShowing = !ViewConfigurationCompat.hasPermanentMenuKey(ViewConfiguration.get(navit));
+ Log.d(TAG, String.format("isStatusShowing=%b isNavShowing=%b", isStatusShowing, isNavShowing));
+
+ boolean isLandscape = (navit.getResources().getConfiguration().orientation
+ == Configuration.ORIENTATION_LANDSCAPE);
+ boolean isNavAtBottom = (!isLandscape)
+ || (navit.getResources().getConfiguration().smallestScreenWidthDp >= 600);
+ Log.d(TAG, String.format("isNavAtBottom=%b (Configuration.smallestScreenWidthDp=%d, isLandscape=%b)",
+ isNavAtBottom, navit.getResources().getConfiguration().smallestScreenWidthDp, isLandscape));
+
+ padding_left = 0;
+ padding_top = isStatusShowing ? status_bar_height : 0;
+ padding_right = (isNavShowing && !isNavAtBottom) ? navigation_bar_width : 0;
+ padding_bottom = (!(isNavShowing && isNavAtBottom)) ? 0 : (
+ isLandscape ? navigation_bar_height_landscape : navigation_bar_height);
+ }
+ } else {
+ /* API 18 and below does not support drawing under the system bars, padding is 0 all around */
+ padding_left = 0;
+ padding_right = 0;
+ padding_top = 0;
+ padding_bottom = 0;
+ }
+
+ Log.d(TAG, String.format("Padding left=%d top=%d right=%d bottom=%d",
+ padding_left, padding_top, padding_right, padding_bottom));
+
adjustSystemBarsTintingViews();
draw_bitmap = Bitmap.createBitmap(w, h, Bitmap.Config.ARGB_8888);
diff --git a/navit/android/src/org/navitproject/navit/NavitSpeech2.java b/navit/android/src/org/navitproject/navit/NavitSpeech2.java
index 1bf996dc5..c86fdd1c8 100644
--- a/navit/android/src/org/navitproject/navit/NavitSpeech2.java
+++ b/navit/android/src/org/navitproject/navit/NavitSpeech2.java
@@ -44,7 +44,7 @@ public class NavitSpeech2 implements TextToSpeech.OnInitListener, NavitActivityR
navit.startActivityForResult(checkIntent, MY_DATA_CHECK_CODE);
} else {
Log.e(TAG, "ACTION_CHECK_TTS_DATA not available, assume tts is working");
- mTts = new TextToSpeech(navit, this);
+ mTts = new TextToSpeech(navit.getApplication(), this);
}
}
@@ -57,7 +57,7 @@ public class NavitSpeech2 implements TextToSpeech.OnInitListener, NavitActivityR
if (requestCode == MY_DATA_CHECK_CODE) {
if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
// success, create the TTS instance
- mTts = new TextToSpeech(navit, this);
+ mTts = new TextToSpeech(navit.getApplication(), this);
} else {
// missing data, ask to install it
AlertDialog.Builder builder = new AlertDialog.Builder(navit);
diff --git a/navit/attr.h b/navit/attr.h
index dca3a6107..f8aa8dd4a 100644
--- a/navit/attr.h
+++ b/navit/attr.h
@@ -204,6 +204,7 @@ struct attr {
struct osd *osd;
struct range range;
struct navit_object *navit_object;
+ struct traffic *traffic;
int *dash;
enum item_type *item_types;
enum attr_type *attr_types;
diff --git a/navit/attr_def.h b/navit/attr_def.h
index 2b51f11eb..4d859d1fa 100644
--- a/navit/attr_def.h
+++ b/navit/attr_def.h
@@ -29,6 +29,12 @@
/* prototypes */
/* common */
+#ifndef ATTR
+#define ATTR(x) extern ##x;
+#endif
+#ifndef ATTR2
+#define ATTR2(x,y) extern ##y;
+#endif
ATTR2(0x00000000,none)
ATTR(any)
ATTR(any_xml)
diff --git a/navit/autoload/osso/osso.c b/navit/autoload/osso/osso.c
index 033c76a7a..b94657569 100644
--- a/navit/autoload/osso/osso.c
+++ b/navit/autoload/osso/osso.c
@@ -12,8 +12,6 @@
static osso_context_t *osso_context;
static struct attr callback = { attr_callback };
-extern char *version;
-
struct cb_hw_state_trail {
struct navit* nav;
osso_hw_state_t *state;
@@ -62,7 +60,7 @@ static void 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");
- osso_context = osso_initialize("org.navit_project.navit", version, TRUE, NULL);
+ osso_context = osso_initialize("org.navit_project.navit", NAVIT_VERSION, TRUE, NULL);
if (osso_context == NULL) {
dbg(lvl_error, "error initiating osso context");
}
diff --git a/navit/binding/dbus/binding_dbus.c b/navit/binding/dbus/binding_dbus.c
index aa776db10..5eddc50f7 100644
--- a/navit/binding/dbus/binding_dbus.c
+++ b/navit/binding/dbus/binding_dbus.c
@@ -45,9 +45,7 @@
#include "osd.h"
#include "route.h"
#include "search.h"
-#include "callback.h"
#include "gui.h"
-#include "layout.h"
#include "roadprofile.h"
#include "util.h"
#include "transform.h"
diff --git a/navit/binding/win32/CMakeLists.txt b/navit/binding/win32/CMakeLists.txt
index 37b675873..37f81aec7 100644
--- a/navit/binding/win32/CMakeLists.txt
+++ b/navit/binding/win32/CMakeLists.txt
@@ -1,5 +1,5 @@
if (USE_LIBGNUINTL AND NOT HAVE_GLIB)
- ADD_DEPENDENCIES(support_glib intl_cmake)
+ ADD_DEPENDENCIES(support_glib support_gettext_intl)
endif()
module_add_library(binding_win32 binding_win32.c)
diff --git a/navit/bookmarks.c b/navit/bookmarks.c
index a3e5c482d..5df36b7a3 100644
--- a/navit/bookmarks.c
+++ b/navit/bookmarks.c
@@ -362,6 +362,10 @@ static int bookmarks_store_bookmarks_to_file(struct bookmarks *this_, int limit
this_->bookmarks_list=g_list_next(this_->bookmarks_list);
}
+#ifdef FlushFileBuffers
+ FlushFileBuffers(f)
+#endif FlushFileBuffers
+
fclose(f);
g_hash_table_destroy(dedup);
@@ -372,6 +376,9 @@ static int bookmarks_store_bookmarks_to_file(struct bookmarks *this_, int limit
}
unlink(this_->bookmark_file);
+#ifdef _POSIX
+ sync();
+#endif _POSIX
result=(rename(this_->working_file,this_->bookmark_file)==0);
if (!result) {
navit_add_message(this_->parent->u.navit,_("Failed to write bookmarks file"));
diff --git a/navit/coord.h b/navit/coord.h
index cff549e95..8387462a2 100644
--- a/navit/coord.h
+++ b/navit/coord.h
@@ -36,6 +36,18 @@ struct coord {
int y; /*!< Y-Value */
};
+/**
+ * @brief An integer mercator coordinate packed with a text label
+ *
+ * This structure holds information about an item (coordinates & label) on a map. This can be
+ * used in a list as group of points to display as search results on a map.
+ * It is used to structure input data for function navit_populate_search_results_map()
+ */
+struct lcoord {
+ struct coord c; /*!< The coordinates for this item */
+ char *label; /*!< A label to associate to this item */
+};
+
/*! A integer mercator coordinate carrying its projection */
struct pcoord {
enum projection pro;
diff --git a/navit/file.c b/navit/file.c
index 4d7f226f8..8d0365499 100644
--- a/navit/file.c
+++ b/navit/file.c
@@ -44,8 +44,6 @@
#include <netdb.h>
#endif
-extern char *version;
-
#ifdef CACHE_SIZE
static GHashTable *file_name_hash;
#endif
@@ -98,7 +96,8 @@ static int file_socket_connect(char *host, char *service) {
}
static void file_http_request(struct file *file, char *method, char *host, char *path, char *header, int persistent) {
- 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,
+ 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,
+ NAVIT_VERSION,
host,persistent?"Connection: Keep-Alive\r\n":"",header?header:"",header?"\r\n":"");
write(file->fd, request, strlen(request));
dbg(lvl_debug,"%s",request);
diff --git a/navit/graphics/android/graphics_android.c b/navit/graphics/android/graphics_android.c
index 6b6d5c22d..68cf1874d 100644
--- a/navit/graphics/android/graphics_android.c
+++ b/navit/graphics/android/graphics_android.c
@@ -130,7 +130,8 @@ static struct graphics_font_methods font_methods = {
font_destroy
};
-static struct graphics_font_priv *font_new(struct graphics_priv *gr, struct graphics_font_methods *meth, char *font, int size, int flags) {
+static struct graphics_font_priv *font_new(struct graphics_priv *gr, struct graphics_font_methods *meth, char *font,
+ int size, int flags) {
struct graphics_font_priv *ret=g_new0(struct graphics_font_priv, 1);
*meth=font_methods;
@@ -195,7 +196,8 @@ static struct graphics_image_methods image_methods = {
};
-static struct graphics_image_priv *image_new(struct graphics_priv *gra, struct graphics_image_methods *meth, char *path, int *w, int *h, struct point *hot, int rotation) {
+static struct graphics_image_priv *image_new(struct graphics_priv *gra, struct graphics_image_methods *meth, char *path,
+ int *w, int *h, struct point *hot, int rotation) {
struct graphics_image_priv* ret = NULL;
ret=g_new0(struct graphics_image_priv, 1);
@@ -216,7 +218,8 @@ static struct graphics_image_priv *image_new(struct graphics_priv *gra, struct g
id=(*jnienv)->CallIntMethod(jnienv, gra->Resources, gra->Resources_getIdentifier, string, a, gra->packageName);
dbg(lvl_debug,"id=%d",id);
if (id)
- localBitmap=(*jnienv)->CallStaticObjectMethod(jnienv, gra->BitmapFactoryClass, gra->BitmapFactory_decodeResource, gra->Resources, id);
+ localBitmap=(*jnienv)->CallStaticObjectMethod(jnienv, gra->BitmapFactoryClass, gra->BitmapFactory_decodeResource,
+ gra->Resources, id);
(*jnienv)->DeleteLocalRef(jnienv, a);
} else {
string = (*jnienv)->NewStringUTF(jnienv, path);
@@ -316,7 +319,8 @@ static void draw_polygon(struct graphics_priv *gra, struct graphics_gc_priv *gc,
static void draw_rectangle(struct graphics_priv *gra, struct graphics_gc_priv *gc, struct point *p, int w, int h) {
initPaint(gra, gc);
- (*jnienv)->CallVoidMethod(jnienv, gra->NavitGraphics, gra->NavitGraphics_draw_rectangle, gc->gra->Paint, p->x, p->y, w, h);
+ (*jnienv)->CallVoidMethod(jnienv, gra->NavitGraphics, gra->NavitGraphics_draw_rectangle, gc->gra->Paint, p->x, p->y, w,
+ h);
}
static void draw_circle(struct graphics_priv *gra, struct graphics_gc_priv *gc, struct point *p, int r) {
@@ -325,25 +329,30 @@ static void draw_circle(struct graphics_priv *gra, struct graphics_gc_priv *gc,
}
-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) {
+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", text);
initPaint(gra, fg);
if(bg)
bgcolor=(bg->a<<24)| (bg->r<<16) | (bg->g<<8) | bg->b;
jstring string = (*jnienv)->NewStringUTF(jnienv, text);
- (*jnienv)->CallVoidMethod(jnienv, gra->NavitGraphics, gra->NavitGraphics_draw_text, fg->gra->Paint, p->x, p->y, string, font->size, dx, dy, bgcolor);
+ (*jnienv)->CallVoidMethod(jnienv, gra->NavitGraphics, gra->NavitGraphics_draw_text, fg->gra->Paint, p->x, p->y, string,
+ font->size, dx, dy, bgcolor);
(*jnienv)->DeleteLocalRef(jnienv, string);
}
-static void draw_image(struct graphics_priv *gra, struct graphics_gc_priv *fg, struct point *p, struct graphics_image_priv *img) {
+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",img);
initPaint(gra, fg);
- (*jnienv)->CallVoidMethod(jnienv, gra->NavitGraphics, gra->NavitGraphics_draw_image, fg->gra->Paint, p->x, p->y, img->Bitmap);
+ (*jnienv)->CallVoidMethod(jnienv, gra->NavitGraphics, gra->NavitGraphics_draw_image, fg->gra->Paint, p->x, p->y,
+ img->Bitmap);
}
-static void draw_image_warp (struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, int count, struct graphics_image_priv *img) {
+static void draw_image_warp (struct graphics_priv *gr, struct graphics_gc_priv *fg, struct point *p, int count,
+ struct graphics_image_priv *img) {
/*
*
@@ -354,7 +363,8 @@ static void draw_image_warp (struct graphics_priv *gr, struct graphics_gc_priv *
if (count==3) {
initPaint(gr, fg);
- (*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);
+ (*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", count);
}
@@ -372,7 +382,8 @@ static void draw_mode(struct graphics_priv *gra, enum draw_mode_num mode) {
(*jnienv)->CallVoidMethod(jnienv, gra->NavitGraphics, gra->NavitGraphics_draw_mode, (int)mode);
}
-static struct graphics_priv * overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h, int wraparound);
+static struct graphics_priv * overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p,
+ int w, int h, int wraparound);
static void *get_data(struct graphics_priv *this, const char *type) {
if (!strcmp(type,"padding"))
@@ -385,7 +396,8 @@ static void *get_data(struct graphics_priv *this, const char *type) {
static void image_free(struct graphics_priv *gr, struct graphics_image_priv *priv) {
}
-static void get_text_bbox(struct graphics_priv *gr, struct graphics_font_priv *font, char *text, int dx, int dy, struct point *ret, int estimate) {
+static void get_text_bbox(struct graphics_priv *gr, struct graphics_font_priv *font, char *text, int dx, int dy,
+ struct point *ret, int estimate) {
int len = g_utf8_strlen(text, -1);
int xMin = 0;
int yMin = 0;
@@ -407,7 +419,8 @@ static void overlay_disable(struct graphics_priv *gra, int disable) {
}
static void overlay_resize(struct graphics_priv *gra, struct point *pnt, int w, int h, int wraparound) {
- (*jnienv)->CallVoidMethod(jnienv, gra->NavitGraphics, gra->NavitGraphics_overlay_resize, pnt ? pnt->x:0, pnt ? pnt->y:0, w, h, wraparound);
+ (*jnienv)->CallVoidMethod(jnienv, gra->NavitGraphics, gra->NavitGraphics_overlay_resize, pnt ? pnt->x:0, pnt ? pnt->y:0,
+ w, h, wraparound);
}
static int set_attr(struct graphics_priv *gra, struct attr *attr) {
@@ -533,7 +546,8 @@ static int set_activity(jobject graphics) {
* @param wraparound (0 for the main view)
* @param use_camera Whether to use the camera (0 for overlays)
*/
-static int graphics_android_init(struct graphics_priv *ret, struct graphics_priv *parent, struct point *pnt, int w, int h, int wraparound, int use_camera) {
+static int graphics_android_init(struct graphics_priv *ret, struct graphics_priv *parent, struct point *pnt, int w,
+ int h, int wraparound, int use_camera) {
struct callback *cb;
jmethodID cid, Context_getPackageName;
@@ -691,7 +705,8 @@ static int graphics_android_init(struct graphics_priv *ret, struct graphics_priv
}
static jclass NavitClass;
-static jmethodID Navit_disableSuspend, Navit_exit, Navit_fullscreen, Navit_runOptionsItem, Navit_showMenu, Navit_showNativeKeyboard, Navit_hideNativeKeyboard;
+static jmethodID Navit_disableSuspend, Navit_exit, Navit_fullscreen, Navit_runOptionsItem, Navit_showMenu,
+ Navit_showNativeKeyboard, Navit_hideNativeKeyboard;
static int graphics_android_fullscreen(struct window *win, int on) {
(*jnienv)->CallVoidMethod(jnienv, android_activity, Navit_fullscreen, on);
@@ -714,7 +729,8 @@ static void graphics_android_disable_suspend(struct window *win) {
* @param out Points to a buffer which will receive a pointer to the output of the command
* @param valid
*/
-static void graphics_android_cmd_runMenuItem(struct graphics_priv *this, char *function, struct attr **in, struct attr ***out, int *valid) {
+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",function);
if(!strcmp(function,"map_download_dialog")) {
@@ -738,7 +754,8 @@ static void graphics_android_cmd_runMenuItem(struct graphics_priv *this, char *f
* @param out Points to a buffer which will receive a pointer to the output of the command
* @param valid
*/
-static void graphics_android_cmd_menu(struct graphics_priv *this, char *function, struct attr **in, struct attr ***out, int *valid) {
+static void graphics_android_cmd_menu(struct graphics_priv *this, char *function, struct attr **in, struct attr ***out,
+ int *valid) {
dbg(lvl_debug, "enter");
(*jnienv)->CallVoidMethod(jnienv, android_activity, Navit_showMenu);
}
@@ -767,7 +784,8 @@ static struct command_table commands[] = {
*
* @return The new graphics instance
*/
-static struct graphics_priv *graphics_android_new(struct navit *nav, struct graphics_methods *meth, struct attr **attrs, struct callback_list *cbl) {
+static struct graphics_priv *graphics_android_new(struct navit *nav, struct graphics_methods *meth, struct attr **attrs,
+ struct callback_list *cbl) {
struct graphics_priv *ret;
struct attr *attr;
int use_camera=0;
@@ -799,7 +817,7 @@ static struct graphics_priv *graphics_android_new(struct navit *nav, struct grap
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 */
- ret->bgcolor = 0x60000000;
+ ret->bgcolor = 0xa0000000;
}
if ((attr=attr_search(attrs, NULL, attr_use_camera))) {
use_camera=attr->u.num;
@@ -853,7 +871,8 @@ static struct graphics_priv *graphics_android_new(struct navit *nav, struct grap
*
* @return The graphics instance for the new overlay
*/
-static struct graphics_priv *overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h, int wraparound) {
+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 *ret=g_new0(struct graphics_priv, 1);
*meth=graphics_methods;
if (graphics_android_init(ret, gr, p, w, h, wraparound, 0)) {
diff --git a/navit/graphics/qt5/QNavitWidget.cpp b/navit/graphics/qt5/QNavitWidget.cpp
index 355187b49..869d5f2ec 100644
--- a/navit/graphics/qt5/QNavitWidget.cpp
+++ b/navit/graphics/qt5/QNavitWidget.cpp
@@ -41,7 +41,7 @@ extern "C" {
#include <windows.h>
#endif
#include "QNavitWidget.h"
-#include "QNavitWidget.moc"
+//#include "QNavitWidget.moc"
#include "graphics_qt5.h"
QNavitWidget::QNavitWidget(struct graphics_priv* my_graphics_priv,
diff --git a/navit/graphics/qt5/event_qt5.cpp b/navit/graphics/qt5/event_qt5.cpp
index 7186534fe..99361011c 100644
--- a/navit/graphics/qt5/event_qt5.cpp
+++ b/navit/graphics/qt5/event_qt5.cpp
@@ -44,7 +44,7 @@ extern "C" {
#endif
#include "event_qt5.h"
-#include "event_qt5.moc"
+//#include "event_qt5.moc"
#include "graphics_qt5.h"
#include <QSocketNotifier>
diff --git a/navit/graphics/sdl/graphics_sdl.c b/navit/graphics/sdl/graphics_sdl.c
index efd0faad5..4187d4ed6 100644
--- a/navit/graphics/sdl/graphics_sdl.c
+++ b/navit/graphics/sdl/graphics_sdl.c
@@ -1183,6 +1183,8 @@ static gboolean graphics_sdl_idle(void *data) {
#ifdef USE_WEBOS
quit_event_loop = 1;
navit_destroy(gr->nav);
+#else
+ callback_list_call_attr_0(gr->cbl, attr_window_closed);
#endif
break;
}
diff --git a/navit/gui/gtk/destination.c b/navit/gui/gtk/destination.c
index 5f52e042b..6a0fbb5b7 100644
--- a/navit/gui/gtk/destination.c
+++ b/navit/gui/gtk/destination.c
@@ -50,22 +50,6 @@ static struct search_param {
GtkTreeModel *liststore2;
} search_param;
-static void button_map(GtkWidget *widget, struct search_param *search) {
- GtkTreePath *path;
- GtkTreeViewColumn *focus_column;
- struct pcoord *c=NULL;
- GtkTreeIter iter;
-
- gtk_tree_view_get_cursor(GTK_TREE_VIEW(search->treeview), &path, &focus_column);
- if(!path)
- return;
- if(!gtk_tree_model_get_iter(search->liststore2, &iter, path))
- return;
- gtk_tree_model_get (GTK_TREE_MODEL (search->liststore2), &iter, COL_COUNT, &c, -1);
- if (c) {
- navit_set_center(search->nav, c, 1);
- }
-}
static char *description(struct search_param *search, GtkTreeIter *iter) {
char *desc,*car,*postal,*town,*street;
@@ -89,6 +73,39 @@ static char *description(struct search_param *search, GtkTreeIter *iter) {
return desc;
}
+static void button_map(GtkWidget *widget, struct search_param *search) {
+ GtkTreePath *path;
+ GtkTreeViewColumn *focus_column;
+ struct pcoord *point=NULL; /* A pointer on the geographical position of the selected map point */
+ GtkTreeIter iter;
+ char *label;
+ GList* p;
+
+ gtk_tree_view_get_cursor(GTK_TREE_VIEW(search->treeview), &path, &focus_column);
+ if(!path)
+ return;
+ if(!gtk_tree_model_get_iter(search->liststore2, &iter, path))
+ return;
+ gtk_tree_model_get (GTK_TREE_MODEL (search->liststore2), &iter, COL_COUNT, &point, -1);
+ if (point) {
+ GList* list = NULL;
+ struct lcoord *result = g_new0(struct lcoord, 1);
+ result->c.x=point->x;
+ result->c.y=point->y;
+ result->label=description(search, &iter); /* Allocated here, freed by invoking g_free() below when parsing the GList */
+ list = g_list_prepend(list, result);
+ navit_populate_search_results_map(search->nav, list, NULL);
+ /* Parse the GList starting at list and free all payloads before freeing the list itself */
+ for(p=list; p; p=g_list_next(p)) {
+ if (((struct lcoord *)(p->data))->label)
+ g_free(((struct lcoord *)(p->data))->label);
+ }
+ g_list_free(list);
+
+ navit_set_center(search->nav, point, 1);
+ }
+}
+
static void button_destination(GtkWidget *widget, struct search_param *search) {
struct pcoord *c=NULL;
GtkTreeIter iter;
@@ -99,6 +116,7 @@ static void button_destination(GtkWidget *widget, struct search_param *search) {
gtk_tree_model_get (GTK_TREE_MODEL (search->liststore2), &iter, COL_COUNT, &c, -1);
if (c) {
desc=description(search, &iter);
+ navit_populate_search_results_map(search->nav, NULL, NULL); /* Remove any highlighted point on the map */
navit_set_destination(search->nav, c, desc, 1);
g_free(desc);
}
diff --git a/navit/gui/gtk/gui_gtk_poi.c b/navit/gui/gtk/gui_gtk_poi.c
index 503bc321f..265f1f28e 100644
--- a/navit/gui/gtk/gui_gtk_poi.c
+++ b/navit/gui/gtk/gui_gtk_poi.c
@@ -37,6 +37,9 @@
#include "navigation.h" /* for FEET_PER_METER and other conversion factors. */
+/**
+ * @brief Context passed around POI search function
+ */
static struct gtk_poi_search {
GtkWidget *entry_distance;
GtkWidget *label_distance;
@@ -51,6 +54,12 @@ static struct gtk_poi_search {
struct navit *nav;
} gtk_poi_search;
+/**
+ * @brief Get a pixbuf representing an icon for the catalog
+ *
+ * @param name The name of the icon to use (eg: "pharmacy.png"
+ * @return A pixbuf containing this icon of NULL if the icon could not be loaded
+ */
static GdkPixbuf *geticon(const char *name) {
GdkPixbuf *icon=NULL;
GError *error=NULL;
@@ -217,7 +226,14 @@ static void treeview_poi_reload(GtkWidget *widget, struct gtk_poi_search *search
gtk_tree_view_set_model(GTK_TREE_VIEW (search->treeview_poi), model_poi(search));
}
-/** Set the selected POI as destination. */
+/**
+ * @brief Callback invoked when 'Destination' is clicked in a POI contextual window
+ *
+ * Set the selected POI as destination
+ *
+ * @param widget The widget that has been clicked
+ * @param search A pointer to private data containing the POI search context
+ */
static void button_destination_clicked(GtkWidget *widget, struct gtk_poi_search *search) {
GtkTreePath *path;
GtkTreeViewColumn *focus_column;
@@ -241,6 +257,7 @@ static void button_destination_clicked(GtkWidget *widget, struct gtk_poi_search
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);
sprintf(buffer, _("POI %s. %s"), category, label);
+ navit_populate_search_results_map(search->nav, NULL, NULL); /* Remove any highlighted point on the map */
struct pcoord dest;
dest.x=lat;
@@ -250,28 +267,58 @@ static void button_destination_clicked(GtkWidget *widget, struct gtk_poi_search
dbg(lvl_debug,_("Set destination to %ld, %ld "),lat,lon);
}
-/* Show the POI's position in the map. */
+/**
+ * @brief Callback invoked when 'Map' is clicked in a POI contextual window
+ *
+ * Show the POI's position in the map
+ *
+ * @param widget The widget that has been clicked
+ * @param search A pointer to private data containing the POI search context
+ */
static void button_map_clicked(GtkWidget *widget, struct gtk_poi_search *search) {
GtkTreePath *path;
GtkTreeViewColumn *focus_column;
GtkTreeIter iter;
long int lat,lon;
+ char *label;
+ GList* p;
gtk_tree_view_get_cursor(GTK_TREE_VIEW(search->treeview_poi), &path, &focus_column);
if(!path) return;
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, 2, &label, -1);
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);
- struct pcoord dest;
- dest.x=lat;
- dest.y=lon;
- dest.pro=1;
- navit_set_center(search->nav, &dest,1);
+ struct pcoord point; /* The geographical position of the selected POI point */
+ point.x=lat;
+ point.y=lon;
+ point.pro=1;
+ GList* list = NULL;
+ struct lcoord *result = g_new0(struct lcoord, 1);
+ result->c.x=lat;
+ result->c.y=lon;
+ result->label=g_strdup(label);
+ list = g_list_prepend(list, result);
+ navit_populate_search_results_map(search->nav, list, NULL);
+ /* Parse the GList starting at list and free all payloads before freeing the list itself */
+ for(p=list; p; p=g_list_next(p)) {
+ if (((struct lcoord *)(p->data))->label)
+ g_free(((struct lcoord *)(p->data))->label);
+ }
+ g_list_free(list);
+ navit_set_center(search->nav, &point,1);
dbg(lvl_debug,_("Set map to %ld, %ld "),lat,lon);
}
-/** Set POI as the first "visit before". */
+/**
+ * @brief Callback invoked when 'Visit before' is clicked in a POI contextual window
+ *
+ * Set POI as a waypoint to visit before an existing destination
+ *
+ * @param widget The widget that has been clicked
+ * @param search A pointer to private data containing the POI search context
+ */
static void button_visit_clicked(GtkWidget *widget, struct gtk_poi_search *search) {
GtkTreePath *path;
GtkTreeViewColumn *focus_column;
@@ -284,6 +331,7 @@ static void button_visit_clicked(GtkWidget *widget, struct gtk_poi_search *searc
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 "),lat,lon);
+ navit_populate_search_results_map(search->nav, NULL, NULL); /* Remove any highlighted point on the map */
struct pcoord dest;
dest.x=lat;
@@ -292,7 +340,11 @@ static void button_visit_clicked(GtkWidget *widget, struct gtk_poi_search *searc
popup_set_visitbefore(search->nav,&dest,0);
}
-/** Create UI and connect objects to functions. */
+/**
+ * @brief Create the POI search UI window and connect objects to functions
+ *
+ * @param nav The navit instance
+ */
void gtk_gui_poi(struct navit *nav) {
GtkWidget *window2,*vbox, *keyboard, *table;
GtkWidget *label_category, *label_poi;
@@ -302,6 +354,7 @@ void gtk_gui_poi(struct navit *nav) {
struct gtk_poi_search *search=&gtk_poi_search;
search->nav=nav;
+ navit_populate_search_results_map(search->nav, NULL, NULL); /* Remove any highlighted point on the map */
window2 = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window2),_("POI search"));
gtk_window_set_wmclass (GTK_WINDOW (window2), "navit", "Navit");
diff --git a/navit/gui/gtk/gui_gtk_window.c b/navit/gui/gtk/gui_gtk_window.c
index 782add46f..1e57004d0 100644
--- a/navit/gui/gtk/gui_gtk_window.c
+++ b/navit/gui/gtk/gui_gtk_window.c
@@ -323,6 +323,7 @@ static void gui_gtk_action_activate(GtkAction *action, struct action_cb_data *da
if(data->attr.type == attr_destination) {
char * label;
g_object_get(G_OBJECT(action), "label", &label,NULL);
+ navit_populate_search_results_map(data->gui->nav, NULL, NULL); /* Remove any highlighted point on the map */
navit_set_destination(data->gui->nav, data->attr.u.pcoord, label, 1);
g_free(label);
}
diff --git a/navit/gui/internal/CMakeLists.txt b/navit/gui/internal/CMakeLists.txt
index b758ba7e6..27011bab3 100644
--- a/navit/gui/internal/CMakeLists.txt
+++ b/navit/gui/internal/CMakeLists.txt
@@ -1,3 +1,7 @@
+if (GUI_INTERNAL_VISUAL_DBG)
+ add_definitions ("-DGUI_INTERNAL_VISUAL_DBG")
+endif(GUI_INTERNAL_VISUAL_DBG)
+
module_add_library(gui_internal gui_internal.c gui_internal_bookmark.c gui_internal_command.c gui_internal_gesture.c
gui_internal_html.c gui_internal_menu.c gui_internal_poi.c gui_internal_search.c gui_internal_widget.c
gui_internal_keyboard.c)
diff --git a/navit/gui/internal/gui_internal.c b/navit/gui/internal/gui_internal.c
index afae9a9f1..726a03d17 100644
--- a/navit/gui/internal/gui_internal.c
+++ b/navit/gui/internal/gui_internal.c
@@ -895,125 +895,6 @@ static void gui_internal_cmd_view_in_browser(struct gui_priv *this, struct widge
}
/**
- * @brief Get the search result map (and create it if it does not exist)
- *
- * @param this The GUI context
- *
- * @return A pointer to the map named "search_results" or NULL if there wasa failure
- */
-static struct map *get_search_results_map(struct gui_priv *this) {
-
- struct mapset *ms;
- struct map *map;
-
- ms=navit_get_mapset(this->nav);
-
- if(!ms)
- return NULL;
-
- map=mapset_get_map_by_name(ms, "search_results");
- if(!map) {
- struct attr *attrs[10], attrmap;
- enum attr_type types[]= {attr_position_longitude,attr_position_latitude,attr_label,attr_none};
- int i;
-
- attrs[0]=g_new0(struct attr,1);
- attrs[0]->type=attr_type;
- attrs[0]->u.str="csv";
-
- attrs[1]=g_new0(struct attr,1);
- attrs[1]->type=attr_name;
- attrs[1]->u.str="search_results";
-
- attrs[2]=g_new0(struct attr,1);
- attrs[2]->type=attr_charset;
- attrs[2]->u.str="utf-8";
-
- attrs[3]=g_new0(struct attr,1);
- attrs[3]->type=attr_item_type;
- attrs[3]->u.num=type_found_item;
-
- attrs[4]=g_new0(struct attr,1);
- attrs[4]->type=attr_attr_types;
- attrs[4]->u.attr_types=types;
- attrs[5]=NULL;
-
- attrmap.type=attr_map;
- map=attrmap.u.map=map_new(NULL,attrs);
- if(map)
- mapset_add_attr(ms,&attrmap);
-
- for(i=0; attrs[i]; i++)
- g_free(attrs[i]);
- }
- return map;
-}
-
-/**
- * @brief Optimizes the format of a string, adding carriage returns so that when displayed, the result text zone is roughly as wide as high
- *
- * @param[in,out] s The string to proces (will be modified by this function, but length will be unchanged)
- */
-static void square_shape_str(char *s) {
- char *c;
- char *last_break;
- unsigned int max_cols = 0;
- unsigned int cur_cols = 0;
- unsigned int max_rows = 0;
- unsigned int surface;
- unsigned int target_cols;
-
- if (!s)
- return;
- for (c=s; *c!='\0'; c++) {
- if (*c==' ') {
- if (max_cols < cur_cols)
- max_cols = cur_cols;
- cur_cols = 0;
- max_rows++;
- } else
- cur_cols++;
- }
- if (max_cols < cur_cols)
- max_cols = cur_cols;
- if (cur_cols) /* If last line does not end with CR, add it to line numbers anyway */
- max_rows++;
- /* Give twice more room for rows (hence the factor 2 below)
- * This will render as a rectangular shape, taking more horizontal space than vertical */
- surface = max_rows * 2 * max_cols;
- target_cols = uint_sqrt(surface);
-
- if (target_cols < max_cols)
- target_cols = max_cols;
-
- target_cols = target_cols + target_cols/10; /* Allow 10% extra on columns */
- dbg(lvl_debug, "square_shape_str(): analyzing input text=\"%s\". max_rows=%u, max_cols=%u, surface=%u, target_cols=%u",
- s, max_rows, max_cols, max_rows * 2 * max_cols, target_cols);
-
- cur_cols = 0;
- last_break = NULL;
- for (c=s; *c!='\0'; c++) {
- if (*c==' ') {
- if (cur_cols>=target_cols) { /* This line is too long, break at the previous non alnum character */
- if (last_break) {
- *last_break =
- '\n'; /* Replace the previous non alnum character with a line break, this creates a new line and prevents the previous line from being too long */
- cur_cols = c-last_break;
- }
- }
- last_break = c; /* Record this position as a candidate to insert a line break */
- }
- cur_cols++;
- }
- if (cur_cols>=target_cols && last_break) {
- *last_break =
- '\n'; /* Replace the previous non alnum character with a line break, this creates a new line and prevents the previous line from being too long */
- }
-
- dbg(lvl_debug, "square_shape_str(): output text=\"%s\"", s);
-}
-
-/**
* @brief Create a map rect highlighting one of multiple points provided in argument @data and displayed using
* the style type_found_item (name for each point will also be displayed aside)
*
@@ -1024,28 +905,10 @@ static void square_shape_str(char *s) {
*/
static void gui_internal_prepare_search_results_map(struct gui_priv *this, struct widget *table, struct coord_rect *r) {
struct widget *w;
- struct map *map;
- struct map_rect *mr;
- struct item *item;
- GList *l;
+ GList *l; /* Cursor in the list of widgets */
+ GList* list = NULL; /* List we will create to store the points to add to the result map */
struct attr a;
- int count;
- char *name_label;
-
- map = get_search_results_map(this);
- if(!map)
- return;
-
-
- mr = map_rect_new(map, NULL);
-
- if(!mr)
- return;
-
- /* Clean the map */
- while((item = map_rect_get_item(mr))!=NULL) {
- item_type_set(item,type_none);
- }
+ GList* p;
this->results_map_population=0;
@@ -1053,43 +916,33 @@ static void gui_internal_prepare_search_results_map(struct gui_priv *this, struc
for(w=table; w && w->type!=widget_table; w=w->parent);
if(!w) {
- map_rect_destroy(mr);
dbg(lvl_warning,"Can't find the results table - only map clean up is done.");
- return;
- }
-
- /* Populate the map with search results*/
- for(l=w->children, count=0; l; l=g_list_next(l)) {
- struct widget *wr=l->data;
- if(wr->type==widget_table_row) {
- struct widget *wi=wr->children->data;
- struct item* it;
- if(wi->name==NULL)
- continue;
- dbg(lvl_info,"%s",wi->name);
- it=map_rect_create_item(mr,type_found_item);
- if(it) {
- struct coord c;
- struct attr a;
- c.x=wi->c.x;
- c.y=wi->c.y;
- item_coord_set(it, &c, 1, change_mode_modify);
- a.type=attr_label;
- name_label = g_strdup(wi->name);
- square_shape_str(name_label);
- a.u.str=name_label;
- item_attr_set(it, &a, change_mode_modify);
- if (r) {
- if(!count++)
- r->lu=r->rl=c;
- else
- coord_rect_extend(r,&c);
- }
+ } else {
+ /* Create a GList containing all search results */
+ for(l=w->children; l; l=g_list_next(l)) {
+ struct widget *wr=l->data;
+ if(wr->type==widget_table_row) {
+ struct widget *wi=wr->children->data;
+ if(wi->name==NULL)
+ continue;
+ struct lcoord *result = g_new0(struct lcoord, 1);
+ result->c.x=wi->c.x;
+ result->c.y=wi->c.y;
+ result->label=g_strdup(wi->name);
+ list = g_list_prepend(list, result);
}
}
}
- map_rect_destroy(mr);
- if(!count)
+ this->results_map_population=navit_populate_search_results_map(this->nav, list, r);
+ /* Parse the GList starting at list and free all payloads before freeing the list itself */
+ if (list) {
+ for(p=list; p; p=g_list_next(p)) {
+ if (((struct lcoord *)(p->data))->label)
+ g_free(((struct lcoord *)(p->data))->label);
+ }
+ }
+ g_list_free(list);
+ if(!this->results_map_population)
return;
a.type=attr_orientation;
a.u.num=0;
@@ -1098,7 +951,6 @@ static void gui_internal_prepare_search_results_map(struct gui_priv *this, struc
navit_zoom_to_rect(this->nav,r);
gui_internal_prune_menu(this, NULL);
}
- this->results_map_population=count;
}
/**
diff --git a/navit/gui/internal/gui_internal_command.c b/navit/gui/internal/gui_internal_command.c
index acf250408..3148e83e5 100644
--- a/navit/gui/internal/gui_internal_command.c
+++ b/navit/gui/internal/gui_internal_command.c
@@ -41,8 +41,6 @@
#include <arpa/inet.h>
#endif
-extern char *version;
-
/**
* @brief Converts a WGS84 coordinate pair to its string representation.
*
@@ -101,20 +99,38 @@ char *gui_internal_coordinates(struct pcoord *pc, char sep) {
enum escape_mode {
escape_mode_none=0,
- escape_mode_string=1,
- escape_mode_quote=2,
- escape_mode_html=4,
- escape_mode_html_quote=8,
- escape_mode_html_apos=16,
+ escape_mode_string=1, /*!< Surround string by double quotes */
+ escape_mode_quote=2, /*!< Escape double quotes and backslashes */
+ escape_mode_html_amp=4, /*!< Use HTML-style escape sequences for ampersands */
+ escape_mode_html_quote=8, /*!< Use HTML-style escape sequences for double quotes */
+ escape_mode_html_apos=16, /*!< Use HTML-style escape sequences for single quotes (apostrophes) */
+ escape_mode_html_lt=16, /*!< Use HTML-style escape sequences for lower than sign ('<') */
+ escape_mode_html_gt=16, /*!< Use HTML-style escape sequences for greater than sign ('>') */
+ escape_mode_html=escape_mode_html_amp|escape_mode_html_quote|escape_mode_html_apos|escape_mode_html_lt|escape_mode_html_gt, /*!< Use all known HTML-style escape sequences */
};
-/* todo &=&amp;, < = &lt; */
-
-static char *gui_internal_escape(enum escape_mode mode, char *in) {
- int len=mode & escape_mode_string ? 3:1;
- char *dst,*out,*src=in;
- char *quot="&quot;";
- char *apos="&apos;";
+/**
+ * @brief Escape special characters from a string
+ *
+ * @param mode The escape mode that needs to be enabled (see enum escape_mode)
+ * @param in The string to escape
+ *
+ * @return The escaped string
+ *
+ * @note In html escape mode (escape_mode_html), we will only process HTML escape sequence, and string quoting, but we won't escape backslashes or double quotes
+ * @warning The returned string has been allocated and g_free() must thus be called on this string
+ */
+static char *gui_internal_escape(enum escape_mode mode, const char *in) {
+ int len=mode & escape_mode_string ? 2:0; /* Add 2 characters to the length of the buffer if quoting is enabled */
+ char *dst,*out;
+ const char *src=in;
+ static const char *quot="&quot;";
+ static const char *apos="&apos;";
+ static const char *amp="&amp;";
+ static const char *lt="&lt;";
+ static const char *gt="&gt;";
+
+ dbg(lvl_debug, "Entering %s with string=\"%s\", escape mode %d", __func__, in, mode);
while (*src) {
if ((*src == '"' || *src == '\\') && (mode & (escape_mode_string | escape_mode_quote)))
len++;
@@ -122,31 +138,61 @@ static char *gui_internal_escape(enum escape_mode mode, char *in) {
len+=strlen(quot);
else if (*src == '\'' && mode == escape_mode_html_apos)
len+=strlen(apos);
+ else if (*src == '&' && mode == escape_mode_html_amp)
+ len+=strlen(amp);
+ else if (*src == '<' && mode == escape_mode_html_lt)
+ len+=strlen(lt);
+ else if (*src == '>' && mode == escape_mode_html_gt)
+ len+=strlen(gt);
else
len++;
src++;
}
src=in;
- out=dst=g_malloc(len);
+ out=dst=g_malloc(len+1); /* +1 character for NUL termination */
+
+ /* In string quoting mode (escape_mode_string), prepend the whole string with a double quote */
if (mode & escape_mode_string)
*dst++='"';
+
while (*src) {
- if ((*src == '"' || *src == '\\') && (mode & (escape_mode_string | escape_mode_quote)))
- *dst++='\\';
- if (*src == '"' && mode == escape_mode_html_quote) {
- strcpy(dst,quot);
- src++;
- dst+=strlen(quot);
- } else if (*src == '\'' && mode == escape_mode_html_apos) {
- strcpy(dst,apos);
- src++;
- dst+=strlen(apos);
- } else
+ if (mode & escape_mode_html) { /* In html escape mode, only process HTML escape sequence, not backslashes or quotes */
+ if (*src == '"' && (mode & escape_mode_html_quote)) {
+ strcpy(dst,quot);
+ src++;
+ dst+=strlen(quot);
+ } else if (*src == '\'' && (mode & escape_mode_html_apos)) {
+ strcpy(dst,apos);
+ src++;
+ dst+=strlen(apos);
+ } else if (*src == '&' && (mode & escape_mode_html_amp)) {
+ strcpy(dst,amp);
+ src++;
+ dst+=strlen(amp);
+ } else if (*src == '<' && (mode & escape_mode_html_lt)) {
+ strcpy(dst,lt);
+ src++;
+ dst+=strlen(lt);
+ } else if (*src == '>' && (mode & escape_mode_html_gt)) {
+ strcpy(dst,gt);
+ src++;
+ dst+=strlen(gt);
+ } else
+ *dst++=*src++;
+ } else {
+ if ((*src == '"' || *src == '\\') && (mode & (escape_mode_string | escape_mode_quote))) {
+ *dst++='\\';
+ }
*dst++=*src++;
+ }
}
+
+ /* In string quoting mode (escape_mode_string), append a double quote to the whole string */
if (mode & escape_mode_string)
*dst++='"';
+
*dst++='\0';
+ dbg(lvl_debug, "Exitting %s with string=\"%s\"", __func__, out);
return out;
}
@@ -198,7 +244,7 @@ static void gui_internal_cmd2_about(struct gui_priv *this, char *function, struc
g_free(text);
//Version
- text=g_strdup_printf("%s",version);
+ text=g_strdup_printf("%s",NAVIT_VERSION);
gui_internal_widget_append(wb, w=gui_internal_label_new(this, text));
w->flags=gravity_top_center|orientation_horizontal|flags_expand;
g_free(text);
diff --git a/navit/gui/internal/gui_internal_keyboard.c b/navit/gui/internal/gui_internal_keyboard.c
index 8e758de4f..19e48c468 100644
--- a/navit/gui/internal/gui_internal_keyboard.c
+++ b/navit/gui/internal/gui_internal_keyboard.c
@@ -33,6 +33,8 @@ void gui_internal_keyboard_to_upper_case(struct gui_priv *this) {
gui_internal_keyboard_do(this, md->keyboard, VKBD_UMLAUT_UPPER | VKBD_FLAG_2);
if (md->keyboard_mode == (VKBD_CYRILLIC_LOWER | VKBD_FLAG_2))
gui_internal_keyboard_do(this, md->keyboard, VKBD_CYRILLIC_UPPER | VKBD_FLAG_2);
+ if (md->keyboard_mode == (VKBD_GREEK_LOWER | VKBD_FLAG_2))
+ gui_internal_keyboard_do(this, md->keyboard, VKBD_GREEK_UPPER | VKBD_FLAG_2);
}
/**
@@ -56,6 +58,8 @@ void gui_internal_keyboard_to_lower_case(struct gui_priv *this) {
gui_internal_keyboard_do(this, md->keyboard, VKBD_UMLAUT_LOWER | VKBD_FLAG_2);
if (md->keyboard_mode == (VKBD_CYRILLIC_UPPER | VKBD_FLAG_2))
gui_internal_keyboard_do(this, md->keyboard, VKBD_CYRILLIC_LOWER | VKBD_FLAG_2);
+ if (md->keyboard_mode == (VKBD_GREEK_UPPER | VKBD_FLAG_2))
+ gui_internal_keyboard_do(this, md->keyboard, VKBD_GREEK_LOWER | VKBD_FLAG_2);
}
/**
@@ -118,7 +122,9 @@ struct gui_internal_keyb_mode {
/*32: VKBD_UMLAUT_LOWER */ {"äöü", 2, VKBD_UMLAUT_UPPER, VKBD_LATIN_LOWER},
/*40: VKBD_CYRILLIC_UPPER*/ {"АБВ", 2, VKBD_CYRILLIC_LOWER, VKBD_LATIN_UPPER},
/*48: VKBD_CYRILLIC_LOWER*/ {"абв", 2, VKBD_CYRILLIC_UPPER, VKBD_LATIN_LOWER},
- /*56: VKBD_DEGREE */ {"DEG", 2, VKBD_FLAG_2, VKBD_FLAG_2}
+ /*56: VKBD_DEGREE */ {"DEG", 2, VKBD_FLAG_2, VKBD_FLAG_2},
+ /*64: VKBD_GREEK_UPPER */ {"ABΓ", 2, VKBD_GREEK_LOWER, VKBD_LATIN_UPPER},
+ /*72: VKBD_GREEK_LOWER */ {"abγ", 2, VKBD_GREEK_UPPER, VKBD_LATIN_LOWER}
};
@@ -194,7 +200,9 @@ gui_internal_keyboard_do(struct gui_priv *this, struct widget *wkbdb, int mode)
max_h=max_h/8; // Allows 3 results in the list when searching for Towns
wkbd->p.y=max_h*2;
if (((mode & VKBD_LAYOUT_MASK) == VKBD_CYRILLIC_UPPER)
- || ((mode & VKBD_LAYOUT_MASK) == VKBD_CYRILLIC_LOWER)) { // Russian/Ukrainian/Belarussian layout needs more space...
+ || ((mode & VKBD_LAYOUT_MASK) == VKBD_CYRILLIC_LOWER)
+ || ((mode & VKBD_LAYOUT_MASK) == VKBD_GREEK_UPPER)
+ || ((mode & VKBD_LAYOUT_MASK) == VKBD_GREEK_LOWER)) { // Russian/Ukrainian/Belarussian/Greek layout needs more space...
max_h=max_h*4/5;
max_w=max_w*8/9;
wkbd->cols=9;
@@ -265,7 +273,7 @@ gui_internal_keyboard_do(struct gui_priv *this, struct widget *wkbdb, int mode)
if (!(mode & VKBD_MASK_7)) {
- SPACER();
+ MODE(VKBD_GREEK_UPPER);
KEY("-");
KEY("'");
wk=gui_internal_keyboard_key_data(this, wkbd, hide, 0, gui_internal_keyboard_change, wkbdb, NULL,max_w,max_h);
@@ -273,7 +281,10 @@ gui_internal_keyboard_do(struct gui_priv *this, struct widget *wkbdb, int mode)
SPACER();
SPACER();
} else {
- SPACER();
+ if (mode == VKBD_GREEK_UPPER)
+ MODE(VKBD_GREEK_LOWER);
+ else
+ MODE(VKBD_GREEK_UPPER);
MODE(VKBD_CYRILLIC_UPPER);
MODE(VKBD_CYRILLIC_LOWER);
wk=gui_internal_keyboard_key_data(this, wkbd, hide, 0, gui_internal_keyboard_change, wkbdb, NULL,max_w,max_h);
@@ -462,6 +473,112 @@ gui_internal_keyboard_do(struct gui_priv *this, struct widget *wkbdb, int mode)
gui_internal_keyboard_key(this, wkbd, backspace,"\b",max_w,max_h);
}
+ if ((mode & VKBD_LAYOUT_MASK) == VKBD_GREEK_UPPER) {
+ KEY("Α");
+ KEY("Β");
+ KEY("Γ");
+ KEY("Δ");
+ KEY("Ε");
+ KEY("Ζ");
+ KEY("Η");
+ KEY("Θ");
+ KEY("Ι");
+ KEY("Κ");
+ KEY("Λ");
+ KEY("Μ");
+ KEY("Ν");
+ KEY("Ξ");
+ KEY("Ο");
+ KEY("Π");
+ KEY("Ρ");
+ KEY("Σ");
+ KEY("Τ");
+ KEY("Υ");
+ KEY("Φ");
+ KEY("Χ");
+ KEY("Ψ");
+ KEY("Ω");
+ KEY("Ή");
+ KEY("Ά");
+ KEY("Ό");
+ KEY("Ί");
+ KEY("Ώ");
+ KEY("Έ");
+ KEY("Ύ");
+ SPACER();
+ SPACER();
+ SPACER();
+ SPACER();
+ SPACER();
+ SPACER();
+ SPACER();
+ SPACER();
+ gui_internal_keyboard_key(this, wkbd, space," ",max_w,max_h);
+
+ wk=gui_internal_keyboard_key_data(this, wkbd, hide, 0, gui_internal_keyboard_change, wkbdb, NULL,max_w,max_h);
+ wk->datai = mode | VKBD_FLAG_1024;
+
+ SWCASE();
+
+ MODE(VKBD_NUMERIC);
+
+ SPACER();
+
+ gui_internal_keyboard_key(this, wkbd, backspace,"\b",max_w,max_h);
+ }
+ if ((mode & VKBD_LAYOUT_MASK) == VKBD_GREEK_LOWER) {
+ KEY("α");
+ KEY("β");
+ KEY("γ");
+ KEY("δ");
+ KEY("ε");
+ KEY("ζ");
+ KEY("η");
+ KEY("θ");
+ KEY("ι");
+ KEY("κ");
+ KEY("λ");
+ KEY("μ");
+ KEY("ν");
+ KEY("ξ");
+ KEY("ο");
+ KEY("π");
+ KEY("ρ");
+ KEY("σ");
+ KEY("τ");
+ KEY("υ");
+ KEY("φ");
+ KEY("χ");
+ KEY("ψ");
+ KEY("ω");
+ KEY("ή");
+ KEY("ά");
+ KEY("ό");
+ KEY("ί");
+ KEY("ώ");
+ KEY("έ");
+ KEY("ύ");
+ SPACER();
+ SPACER();
+ SPACER();
+ SPACER();
+ SPACER();
+ SPACER();
+ SPACER();
+ SPACER();
+ gui_internal_keyboard_key(this, wkbd, space," ",max_w,max_h);
+
+ wk=gui_internal_keyboard_key_data(this, wkbd, hide, 0, gui_internal_keyboard_change, wkbdb, NULL,max_w,max_h);
+ wk->datai = mode | VKBD_FLAG_1024;
+
+ SWCASE();
+
+ MODE(VKBD_NUMERIC);
+
+ SPACER();
+
+ gui_internal_keyboard_key(this, wkbd, backspace,"\b",max_w,max_h);
+ }
if(md->search_list && md->search_list->type==widget_table) {
@@ -608,6 +725,8 @@ int gui_internal_keyboard_init_mode(char *lang) {
ret = VKBD_CYRILLIC_UPPER;
else if (strstr(lang,"MN"))
ret = VKBD_CYRILLIC_UPPER;
+ else if (strstr(lang,"GR"))
+ ret = VKBD_GREEK_UPPER;
g_free(lang);
return ret;
}
diff --git a/navit/gui/internal/gui_internal_keyboard.h b/navit/gui/internal/gui_internal_keyboard.h
index b9887c915..945d2c5cb 100644
--- a/navit/gui/internal/gui_internal_keyboard.h
+++ b/navit/gui/internal/gui_internal_keyboard.h
@@ -11,6 +11,8 @@ enum vkbd_mode {
VKBD_CYRILLIC_UPPER = 40, /*!< Cyrillic uppercase characters */
VKBD_CYRILLIC_LOWER = 48, /*!< Cyrillic lowercase characters */
VKBD_DEGREE = 56, /*!< Numeric keyboard with extra characters (NESW, degree, minute) for coordinate input */
+ VKBD_GREEK_UPPER = 64, /*!< Greek uppercase letters */
+ VKBD_GREEK_LOWER = 72, /*!< Greek lowercase letters */
/* modifiers and masks */
VKBD_FLAG_2 = 2, /* FIXME seems to show alpha/num switch (VKBD_NUMERIC and VKBD_LATIN_* only) and switches to lowercase after first character */
diff --git a/navit/gui/internal/gui_internal_menu.c b/navit/gui/internal/gui_internal_menu.c
index 6a0d6a52b..3caae2800 100644
--- a/navit/gui/internal/gui_internal_menu.c
+++ b/navit/gui/internal/gui_internal_menu.c
@@ -15,7 +15,6 @@
#include "gui_internal_search.h"
#include "gui_internal_menu.h"
-extern char *version;
/**
* @brief Utility function to check if a menu widget is adapted to the display size or needs resizing (if so, the widget dimensions will be set to match those of the display
@@ -486,7 +485,7 @@ gui_internal_top_bar(struct gui_priv *this) {
l=g_list_next(l);
}
if (this->flags & 32) {
- char *version_text=g_strdup_printf("Navit %s",version);
+ char *version_text=g_strdup_printf("Navit %s",NAVIT_VERSION);
wcn=gui_internal_label_new(this, version_text);
g_free(version_text);
wcn->flags=gravity_right_center|flags_expand;
diff --git a/navit/gui/internal/gui_internal_widget.c b/navit/gui/internal/gui_internal_widget.c
index 0894be5aa..3b979f011 100644
--- a/navit/gui/internal/gui_internal_widget.c
+++ b/navit/gui/internal/gui_internal_widget.c
@@ -358,13 +358,37 @@ gui_internal_box_new(struct gui_priv *this, enum flags flags) {
return gui_internal_box_new_with_label(this, flags, NULL);
}
-
+/**
+ * @brief Renders a box widget, preparing it for drawing on the display
+ *
+ * @param this The internal GUI instance
+ * @param w The box widget to render
+ */
static void gui_internal_box_render(struct gui_priv *this, struct widget *w) {
struct widget *wc;
GList *l;
+ int visual_debug = 0;
+
+#if defined(GUI_INTERNAL_VISUAL_DBG)
+ static struct graphics_gc *debug_gc=NULL;
+ static struct color gui_box_debug_color= {0xffff,0x0400,0x0400,0xffff}; /* Red */
+ visual_debug = (debug_level_get("gui_internal_visual_layout") >= lvl_debug);
+#endif
+
+ if (visual_debug)
+ dbg(lvl_debug, "Internal layout visual debugging is enabled");
+
+#if defined(GUI_INTERNAL_VISUAL_DBG)
+ if (visual_debug && !debug_gc) {
+ debug_gc = graphics_gc_new(this->gra);
+ graphics_gc_set_foreground(debug_gc, &gui_box_debug_color);
+ graphics_gc_set_linewidth(debug_gc, 1);
+ }
+#endif
+
gui_internal_background_render(this, w);
- if (w->foreground && w->border) {
+ if ((w->foreground && w->border) || visual_debug) {
struct point pnt[5];
pnt[0]=w->p;
pnt[1].x=pnt[0].x+w->w;
@@ -374,9 +398,15 @@ static void gui_internal_box_render(struct gui_priv *this, struct widget *w) {
pnt[3].x=pnt[0].x;
pnt[3].y=pnt[0].y+w->h;
pnt[4]=pnt[0];
- graphics_gc_set_linewidth(w->foreground, w->border ? w->border : 1);
- graphics_draw_lines(this->gra, w->foreground, pnt, 5);
- graphics_gc_set_linewidth(w->foreground, 1);
+ if (!visual_debug) {
+ graphics_gc_set_linewidth(w->foreground, w->border ? w->border : 1);
+ graphics_draw_lines(this->gra, w->foreground, pnt, 5);
+ graphics_gc_set_linewidth(w->foreground, 1);
+ }
+#if defined(GUI_INTERNAL_VISUAL_DBG)
+ else
+ graphics_draw_lines(this->gra, debug_gc, pnt, 5); /* Force highlighting box borders in debug more */
+#endif
}
l=w->children;
@@ -1247,10 +1277,10 @@ void gui_internal_table_hide_rows(struct table_data * table_data) {
/**
- * @brief Renders a table widget.
+ * @brief Renders a table widget, preparing it for drawing on the display
*
- * @param this The graphics context
- * @param w The table widget to render.
+ * @param this The internal GUI instance
+ * @param w The widget to render
*/
void gui_internal_table_render(struct gui_priv * this, struct widget * w) {
@@ -1347,9 +1377,41 @@ void gui_internal_table_render(struct gui_priv * this, struct widget * w) {
} else {
cur_widget->state &= ~STATE_OFFSCREEN;
}
+
+#if defined(GUI_INTERNAL_VISUAL_DBG)
+
+ static struct graphics_gc *debug_gc=NULL;
+ static struct color gui_table_debug_color= {0x0000,0xffff,0x0400,0xffff}; /* Green */
+ int visual_debug = (debug_level_get("gui_internal_visual_layout") >= lvl_debug);
+
+ if (visual_debug)
+ dbg(lvl_debug, "Internal layout visual debugging is enabled");
+
+ if (visual_debug && !debug_gc) {
+ debug_gc = graphics_gc_new(this->gra);
+ graphics_gc_set_foreground(debug_gc, &gui_table_debug_color);
+ graphics_gc_set_linewidth(debug_gc, 1);
+ }
+#endif
+
gui_internal_widget_pack(this,cur_widget);
gui_internal_widget_render(this,cur_widget);
+#if defined(GUI_INTERNAL_VISUAL_DBG)
+ if (visual_debug) {
+ struct point pnt[5];
+ pnt[0]=cur_widget->p;
+ pnt[1].x=pnt[0].x+cur_widget->w;
+ pnt[1].y=pnt[0].y;
+ pnt[2].x=pnt[0].x+cur_widget->w;
+ pnt[2].y=pnt[0].y+cur_widget->h;
+ pnt[3].x=pnt[0].x;
+ pnt[3].y=pnt[0].y+cur_widget->h;
+ pnt[4]=pnt[0];
+ graphics_draw_lines(this->gra, debug_gc, pnt, 5); /* Force highlighting table borders in debug more */
+ }
+#endif
+
if(dim->height > max_height) {
max_height = dim->height;
}
diff --git a/navit/icons/follow.svg b/navit/icons/follow.svg
new file mode 100644
index 000000000..a78beb2c8
--- /dev/null
+++ b/navit/icons/follow.svg
@@ -0,0 +1,168 @@
+<?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"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="48"
+ height="48"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"
+ sodipodi:docname="follow.svg"
+ inkscape:export-filename="/home/michael/src/navit-artwork/set_center_cursor.png"
+ inkscape:export-xdpi="134.99994"
+ inkscape:export-ydpi="134.99994">
+ <defs
+ id="defs4">
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath428">
+ <path
+ inkscape:connector-curvature="0"
+ d="M 0,96 96,96 96,0 0,0 0,96 z"
+ id="path430" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath416">
+ <path
+ inkscape:connector-curvature="0"
+ d="M 0,96 96,96 96,0 0,0 0,96 z"
+ id="path418" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath544">
+ <path
+ inkscape:connector-curvature="0"
+ d="M 0,96 96,96 96,0 0,0 0,96 z"
+ id="path546" />
+ </clipPath>
+ <radialGradient
+ r="60"
+ fy="72"
+ fx="72"
+ cy="72"
+ cx="72"
+ gradientUnits="userSpaceOnUse"
+ id="radialGradient3969"
+ xlink:href="#linearGradient3785"
+ inkscape:collect="always" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3785"
+ id="radialGradient3926"
+ gradientUnits="userSpaceOnUse"
+ cx="72"
+ cy="72"
+ fx="72"
+ fy="72"
+ r="60" />
+ <linearGradient
+ id="linearGradient3785">
+ <stop
+ id="stop3787"
+ offset="0"
+ style="stop-color:#3e3e3e;stop-opacity:1;" />
+ <stop
+ id="stop3789"
+ offset="1"
+ style="stop-color:#000000;stop-opacity:1;" />
+ </linearGradient>
+ <radialGradient
+ gradientUnits="userSpaceOnUse"
+ r="60"
+ fy="72"
+ fx="72"
+ cy="72"
+ cx="72"
+ id="radialGradient3791"
+ xlink:href="#linearGradient3785"
+ inkscape:collect="always" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="15.8125"
+ inkscape:cx="15.226152"
+ inkscape:cy="21.470355"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1000"
+ inkscape:window-x="0"
+ inkscape:window-y="24"
+ inkscape:window-maximized="1"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-others="false"
+ inkscape:object-nodes="false">
+ <sodipodi:guide
+ orientation="0,1"
+ position="0,40"
+ id="guide2985"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ orientation="1,0"
+ position="8,0"
+ id="guide2989"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ orientation="1,0"
+ position="40,0"
+ id="guide2991"
+ inkscape:locked="false" />
+ <inkscape:grid
+ type="xygrid"
+ id="grid3763"
+ empspacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <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>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1004.3622)">
+ <rect
+ style="fill:#000000;fill-opacity:0.62745098;stroke:none"
+ id="rect2993"
+ width="48"
+ height="48.000019"
+ x="3.5527137e-15"
+ y="1004.3622"
+ rx="4" />
+ <path
+ inkscape:connector-curvature="0"
+ d="m 24,1022.544 c -3.214546,0 -5.818182,2.6036 -5.818182,5.8182 0,3.2146 2.603636,5.8182 5.818182,5.8182 3.214546,0 5.818182,-2.6036 5.818182,-5.8182 0,-3.2146 -2.603636,-5.8182 -5.818182,-5.8182 z m 13.003637,4.3636 c -0.669091,-6.0654 -5.483637,-10.88 -11.549091,-11.5491 v -2.9963 h -2.909092 v 2.9963 c -6.065454,0.6691 -10.88,5.4837 -11.549091,11.5491 H 8 v 2.9092 h 2.996363 c 0.669091,6.0654 5.483637,10.88 11.549091,11.5491 v 2.9963 h 2.909092 v -2.9963 c 6.065454,-0.6691 10.88,-5.4837 11.549091,-11.5491 H 40 v -2.9092 z M 24,1038.544 c -5.621818,0 -10.181818,-4.56 -10.181818,-10.1818 0,-5.6218 4.56,-10.1818 10.181818,-10.1818 5.621818,0 10.181818,4.56 10.181818,10.1818 0,5.6218 -4.56,10.1818 -10.181818,10.1818 z"
+ id="path2"
+ style="stroke-width:0.72727275;fill:#ffffff" />
+ </g>
+</svg>
diff --git a/navit/icons/gui_android_menu.svg b/navit/icons/gui_android_menu.svg
index b47eae076..d8c25757b 100644
--- a/navit/icons/gui_android_menu.svg
+++ b/navit/icons/gui_android_menu.svg
@@ -1,4 +1,6 @@
<?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#"
@@ -9,112 +11,112 @@
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="48"
height="48"
- viewBox="0 0 48 48"
id="svg2"
version="1.1"
- inkscape:version="0.91 r13725"
- sodipodi:docname="gui_android_menu.svg">
- <metadata
- id="metadata12">
- <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></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"
+ sodipodi:docname="gui_android_menu.svg"
+ inkscape:export-filename="/home/vonglasowm/src/navit-goodies/png/xxhdpi/gui_menu_xxhdpi.png"
+ inkscape:export-xdpi="269.99988"
+ inkscape:export-ydpi="269.99988">
<defs
- id="defs10" />
+ id="defs4">
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath428">
+ <path
+ inkscape:connector-curvature="0"
+ d="M 0,96 96,96 96,0 0,0 0,96 z"
+ id="path430" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath416">
+ <path
+ inkscape:connector-curvature="0"
+ d="M 0,96 96,96 96,0 0,0 0,96 z"
+ id="path418" />
+ </clipPath>
+ </defs>
<sodipodi:namedview
+ id="base"
pagecolor="#ffffff"
bordercolor="#666666"
- borderopacity="1"
- objecttolerance="10"
- gridtolerance="10"
- guidetolerance="10"
- inkscape:pageopacity="0"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:window-width="1280"
- inkscape:window-height="948"
- id="namedview8"
- showgrid="true"
- inkscape:zoom="9.8333333"
- inkscape:cx="24"
+ inkscape:zoom="15.8125"
+ inkscape:cx="10.656127"
inkscape:cy="24"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1000"
inkscape:window-x="0"
inkscape:window-y="24"
inkscape:window-maximized="1"
- inkscape:current-layer="svg2"
- fit-margin-top="16"
- fit-margin-bottom="16"
- fit-margin-left="22"
- fit-margin-right="22"
- showguides="true"
- inkscape:guide-bbox="true">
- <sodipodi:guide
- position="0,12"
- orientation="0,1"
- id="guide4284"
- inkscape:label=""
- inkscape:color="rgb(0,0,255)" />
+ inkscape:object-nodes="false"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-nodes="true">
<sodipodi:guide
- position="0,36"
orientation="0,1"
- id="guide4286"
- inkscape:label=""
- inkscape:color="rgb(0,0,255)" />
+ position="0,40"
+ id="guide2985"
+ inkscape:locked="false" />
<sodipodi:guide
- position="0,16"
orientation="0,1"
- id="guide4288"
- inkscape:label=""
- inkscape:color="rgb(0,0,255)" />
+ position="0,8"
+ id="guide2987"
+ inkscape:locked="false" />
<sodipodi:guide
- position="0,32"
- orientation="0,1"
- id="guide4290"
- inkscape:label=""
- inkscape:color="rgb(0,0,255)" />
- <sodipodi:guide
- position="12,0"
- orientation="1,0"
- id="guide4292"
- inkscape:label=""
- inkscape:color="rgb(0,0,255)" />
- <sodipodi:guide
- position="16,0"
orientation="1,0"
- id="guide4294"
- inkscape:label=""
- inkscape:color="rgb(0,0,255)" />
+ position="8,0"
+ id="guide2989"
+ inkscape:locked="false" />
<sodipodi:guide
- position="32,0"
orientation="1,0"
- id="guide4296"
- inkscape:label=""
- inkscape:color="rgb(0,0,255)" />
- <sodipodi:guide
- position="36,0"
- orientation="1,0"
- id="guide4298"
- inkscape:label=""
- inkscape:color="rgb(0,0,255)" />
+ position="40,0"
+ id="guide2991"
+ inkscape:locked="false" />
<inkscape:grid
type="xygrid"
- id="grid4300" />
+ id="grid3763"
+ empspacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
- <circle
- style="fill:#1a6cb6;stroke:none;stroke-width:0.79100001;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;fill-opacity:1"
- id="path4302"
- cx="24"
- cy="24"
- r="24" />
- <path
- d="m 24,20 c 1.1,0 2,-0.9 2,-2 0,-1.1 -0.9,-2 -2,-2 -1.1,0 -2,0.9 -2,2 0,1.1 0.9,2 2,2 z m 0,2 c -1.1,0 -2,0.9 -2,2 0,1.1 0.9,2 2,2 1.1,0 2,-0.9 2,-2 0,-1.1 -0.9,-2 -2,-2 z m 0,6 c -1.1,0 -2,0.9 -2,2 0,1.1 0.9,2 2,2 1.1,0 2,-0.9 2,-2 0,-1.1 -0.9,-2 -2,-2 z"
- id="path6"
- inkscape:connector-curvature="0"
- style="fill:#ffffff" />
+ <metadata
+ id="metadata7">
+ <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>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1004.3622)">
+ <rect
+ style="fill:#000000;fill-opacity:0.62745098;stroke:none"
+ id="rect2993"
+ width="48"
+ height="48.000019"
+ x="3.5527137e-15"
+ y="1004.3622"
+ rx="4" />
+ <path
+ inkscape:connector-curvature="0"
+ d="m 24,1020.3622 c 2.21,0 4,-1.79 4,-4 0,-2.21 -1.79,-4 -4,-4 -2.21,0 -4,1.79 -4,4 0,2.21 1.79,4 4,4 z m 0,4 c -2.21,0 -4,1.79 -4,4 0,2.21 1.79,4 4,4 2.21,0 4,-1.79 4,-4 0,-2.21 -1.79,-4 -4,-4 z m 0,12 c -2.21,0 -4,1.79 -4,4 0,2.21 1.79,4 4,4 2.21,0 4,-1.79 4,-4 0,-2.21 -1.79,-4 -4,-4 z"
+ id="path2"
+ style="fill:#ffffff" />
+ </g>
</svg>
diff --git a/navit/icons/sound_off.svg b/navit/icons/sound_off.svg
new file mode 100644
index 000000000..b721a7243
--- /dev/null
+++ b/navit/icons/sound_off.svg
@@ -0,0 +1,114 @@
+<?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:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="48"
+ height="48"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"
+ sodipodi:docname="sound_off.svg"
+ inkscape:export-filename="/home/michael/src/navit-artwork/gui_sound_off.png"
+ inkscape:export-xdpi="134.99994"
+ inkscape:export-ydpi="134.99994">
+ <defs
+ id="defs4">
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath428">
+ <path
+ inkscape:connector-curvature="0"
+ d="M 0,96 96,96 96,0 0,0 0,96 z"
+ id="path430" />
+ </clipPath>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="15.8125"
+ inkscape:cx="12.237154"
+ inkscape:cy="24"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1000"
+ inkscape:window-x="0"
+ inkscape:window-y="24"
+ inkscape:window-maximized="1"
+ inkscape:object-nodes="false"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-nodes="true">
+ <sodipodi:guide
+ orientation="0,1"
+ position="0,40"
+ id="guide2985"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ orientation="0,1"
+ position="0,8"
+ id="guide2987"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ orientation="1,0"
+ position="8,0"
+ id="guide2989"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ orientation="1,0"
+ position="40,0"
+ id="guide2991"
+ inkscape:locked="false" />
+ <inkscape:grid
+ type="xygrid"
+ id="grid3763"
+ empspacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <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>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1004.3622)">
+ <rect
+ style="fill:#000000;fill-opacity:0.62745098;stroke:none"
+ id="rect2993"
+ width="48"
+ height="48.000019"
+ x="3.5527137e-15"
+ y="1004.3622"
+ rx="4" />
+ <path
+ inkscape:connector-curvature="0"
+ d="m 32,1028.3622 c 0,-3.1378 -1.813333,-5.8489 -4.444444,-7.1556 v 3.9289 L 31.92,1029.5 c 0.05333,-0.3734 0.08,-0.7556 0.08,-1.1378 z m 4.444444,0 c 0,1.6711 -0.364444,3.2444 -0.96,4.6933 l 2.693334,2.6934 C 39.333333,1033.5355 40,1031.0289 40,1028.3622 c 0,-7.6089 -5.324444,-13.9733 -12.444444,-15.5911 v 3.6711 c 5.137777,1.5289 8.888888,6.2844 8.888888,11.92 z m -26.177777,-16 L 8,1014.6289 l 8.4,8.4 H 8 v 10.6666 h 7.111111 L 24,1042.5844 v -11.9555 l 7.564444,7.5644 c -1.191111,0.9156 -2.533333,1.6533 -4.008888,2.0978 v 3.6711 c 2.444444,-0.56 4.675555,-1.68 6.551111,-3.2178 l 3.626666,3.6178 2.266667,-2.2667 -16,-16 z M 24,1014.14 20.284444,1017.8555 24,1021.5711 Z"
+ id="path2"
+ style="stroke-width:0.8888889;fill:#ffffff" />
+ </g>
+</svg>
diff --git a/navit/icons/sound_on.svg b/navit/icons/sound_on.svg
new file mode 100644
index 000000000..ce405c97f
--- /dev/null
+++ b/navit/icons/sound_on.svg
@@ -0,0 +1,122 @@
+<?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:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="48"
+ height="48"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"
+ sodipodi:docname="sound_on.svg"
+ inkscape:export-filename="/home/michael/src/navit-artwork/gui_sound.png"
+ inkscape:export-xdpi="134.99994"
+ inkscape:export-ydpi="134.99994">
+ <defs
+ id="defs4">
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath428">
+ <path
+ inkscape:connector-curvature="0"
+ d="M 0,96 96,96 96,0 0,0 0,96 z"
+ id="path430" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath416">
+ <path
+ inkscape:connector-curvature="0"
+ d="M 0,96 96,96 96,0 0,0 0,96 z"
+ id="path418" />
+ </clipPath>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="15.8125"
+ inkscape:cx="21.249012"
+ inkscape:cy="24"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1000"
+ inkscape:window-x="0"
+ inkscape:window-y="24"
+ inkscape:window-maximized="1"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-nodes="true"
+ inkscape:object-nodes="false">
+ <sodipodi:guide
+ orientation="0,1"
+ position="0,40"
+ id="guide2985"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ orientation="0,1"
+ position="0,8"
+ id="guide2987"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ orientation="1,0"
+ position="8,0"
+ id="guide2989"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ orientation="1,0"
+ position="40,0"
+ id="guide2991"
+ inkscape:locked="false" />
+ <inkscape:grid
+ type="xygrid"
+ id="grid3763"
+ empspacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <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>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1004.3622)">
+ <rect
+ style="fill:#000000;fill-opacity:0.62745098;stroke:none"
+ id="rect2993"
+ width="48"
+ height="48.000019"
+ x="3.5527137e-15"
+ y="1004.3622"
+ rx="4" />
+ <path
+ inkscape:connector-curvature="0"
+ d="m 8,1023.0288 v 10.6666 h 7.111111 L 24,1042.5843 v -28.4444 l -8.888889,8.8889 z m 24,5.3333 c 0,-3.1378 -1.813333,-5.8489 -4.444444,-7.1555 v 14.32 C 30.186667,1034.211 32,1031.4999 32,1028.3621 Z m -4.444444,-15.5911 v 3.6711 c 5.137777,1.5289 8.888888,6.2845 8.888888,11.92 0,5.6356 -3.751111,10.3911 -8.888888,11.92 v 3.6711 C 34.675556,1042.3354 40,1035.9799 40,1028.3621 c 0,-7.6178 -5.324444,-13.9733 -12.444444,-15.5911 z"
+ id="path2"
+ style="stroke-width:0.8888889;fill:#ffffff" />
+ </g>
+</svg>
diff --git a/navit/icons/zoom_auto.svg b/navit/icons/zoom_auto.svg
new file mode 100644
index 000000000..9136b8dea
--- /dev/null
+++ b/navit/icons/zoom_auto.svg
@@ -0,0 +1,147 @@
+<?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:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="48"
+ height="48"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"
+ sodipodi:docname="zoom_auto.svg"
+ inkscape:export-filename="/home/michael/src/navit-artwork/set_center_cursor.png"
+ inkscape:export-xdpi="134.99994"
+ inkscape:export-ydpi="134.99994">
+ <defs
+ id="defs4">
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath428">
+ <path
+ inkscape:connector-curvature="0"
+ d="M 0,96 96,96 96,0 0,0 0,96 z"
+ id="path430" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath416">
+ <path
+ inkscape:connector-curvature="0"
+ d="M 0,96 96,96 96,0 0,0 0,96 z"
+ id="path418" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath544">
+ <path
+ inkscape:connector-curvature="0"
+ d="M 0,96 96,96 96,0 0,0 0,96 z"
+ id="path546" />
+ </clipPath>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="15.8125"
+ inkscape:cx="15.770278"
+ inkscape:cy="24"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1000"
+ inkscape:window-x="0"
+ inkscape:window-y="24"
+ inkscape:window-maximized="1"
+ inkscape:object-nodes="false"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-nodes="true">
+ <sodipodi:guide
+ orientation="0,1"
+ position="0,40"
+ id="guide2985"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ orientation="0,1"
+ position="0,8"
+ id="guide2987"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ orientation="1,0"
+ position="8,0"
+ id="guide2989"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ orientation="1,0"
+ position="40,0"
+ id="guide2991"
+ inkscape:locked="false" />
+ <inkscape:grid
+ type="xygrid"
+ id="grid3763"
+ empspacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <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>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1004.3622)">
+ <rect
+ style="fill:#000000;fill-opacity:0.62745098;stroke:none"
+ id="rect2993"
+ width="48"
+ height="48.000019"
+ x="3.5527137e-15"
+ y="1004.3622"
+ rx="4" />
+ <g
+ id="g844"
+ transform="matrix(1.8296169,0,0,1.8296169,-19.444254,-858.16898)"
+ style="fill:#ffffff">
+ <path
+ sodipodi:nodetypes="cccssssccccccsssss"
+ inkscape:connector-curvature="0"
+ id="path2"
+ d="m 27.5,1033.3622 h -0.79 l -0.28,-0.27 c 0.98,-1.14 1.57,-2.62 1.57,-4.23 0,-3.59 -2.91,-6.5 -6.5,-6.5 -3.59,0 -6.5,2.91 -6.5,6.5 0,3.59 2.91,6.5 6.5,6.5 1.61,0 3.09,-0.59 4.23,-1.57 l 0.27,0.28 v 0.79 l 5,4.99 1.49,-1.49 z m -6,0 c -2.49,0 -4.5,-2.01 -4.5,-4.5 0,-2.49 2.01,-4.5 4.5,-4.5 2.49,0 4.5,2.01 4.5,4.5 0,2.49 -2.01,4.5 -4.5,4.5 z"
+ style="fill:#ffffff" />
+ <g
+ transform="translate(25.399517,1010.3004)"
+ id="text821-3"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ aria-label="A">
+ <path
+ inkscape:connector-curvature="0"
+ id="path850"
+ style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:6.66666651px;font-family:Roboto;-inkscape-font-specification:'Roboto Bold';fill:#ffffff"
+ d="m -3.0453455,19.955254 h -1.7122396 l -0.3255208,0.976562 h -1.0384114 l 1.7643228,-4.739583 h 0.9049479 l 1.7740885,4.739583 h -1.0384114 z m -1.4485677,-0.791016 h 1.1848958 L -3.9047205,17.39015 Z" />
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/navit/icons/zoom_in.svg b/navit/icons/zoom_in.svg
index 18ff2dac8..cedcc7595 100644
--- a/navit/icons/zoom_in.svg
+++ b/navit/icons/zoom_in.svg
@@ -12,40 +12,90 @@
width="48"
height="48"
id="svg2"
- sodipodi:version="0.32"
- inkscape:version="0.48.0 r9654"
+ version="1.1"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"
sodipodi:docname="zoom_in.svg"
- inkscape:output_extension="org.inkscape.output.svg.inkscape"
- inkscape:export-filename="/home/zeroedout/share/usr/share/navit/xpm/zoom_in.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90"
- version="1.0">
+ inkscape:export-filename="/home/michael/src/navit-artwork/set_center_cursor.png"
+ inkscape:export-xdpi="134.99994"
+ inkscape:export-ydpi="134.99994">
<defs
- id="defs4" />
+ id="defs4">
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath428">
+ <path
+ inkscape:connector-curvature="0"
+ d="M 0,96 96,96 96,0 0,0 0,96 z"
+ id="path430" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath416">
+ <path
+ inkscape:connector-curvature="0"
+ d="M 0,96 96,96 96,0 0,0 0,96 z"
+ id="path418" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath544">
+ <path
+ inkscape:connector-curvature="0"
+ d="M 0,96 96,96 96,0 0,0 0,96 z"
+ id="path546" />
+ </clipPath>
+ </defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
- gridtolerance="10000"
- guidetolerance="10"
- objecttolerance="10"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="7.919596"
- inkscape:cx="13.199956"
- inkscape:cy="14.64192"
+ inkscape:zoom="15.8125"
+ inkscape:cx="9.2964433"
+ inkscape:cy="24"
inkscape:document-units="px"
- inkscape:current-layer="g3036"
+ inkscape:current-layer="layer1"
showgrid="true"
- inkscape:window-width="1394"
- inkscape:window-height="968"
- inkscape:window-x="0"
- inkscape:window-y="20"
- width="48px"
- height="48px"
showguides="true"
- inkscape:window-maximized="0" />
+ inkscape:guide-bbox="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1000"
+ inkscape:window-x="0"
+ inkscape:window-y="24"
+ inkscape:window-maximized="1"
+ inkscape:object-nodes="false"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-nodes="true">
+ <sodipodi:guide
+ orientation="0,1"
+ position="0,40"
+ id="guide2985"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ orientation="0,1"
+ position="0,8"
+ id="guide2987"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ orientation="1,0"
+ position="8,0"
+ id="guide2989"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ orientation="1,0"
+ position="40,0"
+ id="guide2991"
+ inkscape:locked="false" />
+ <inkscape:grid
+ type="xygrid"
+ id="grid3763"
+ empspacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" />
+ </sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
@@ -54,47 +104,27 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
- inkscape:label="lower copy"
- id="g3036"
- inkscape:groupmode="layer"
- style="display:inline"
- sodipodi:insensitive="true">
- <path
- transform="matrix(0.84928644,0,0,0.84928644,3.5710462,3.6632047)"
- d="m 47.603437,23.945744 a 23.549181,23.549181 0 1 1 -47.09836155,0 23.549181,23.549181 0 1 1 47.09836155,0 z"
- sodipodi:ry="23.549181"
- sodipodi:rx="23.549181"
- sodipodi:cy="23.945744"
- sodipodi:cx="24.054256"
- id="path3038"
- style="fill:#999999;fill-opacity:0.38536586;stroke:none;display:inline"
- sodipodi:type="arc" />
- <path
- transform="matrix(0.77851257,0,0,0.77851257,5.273459,5.3579376)"
- d="m 47.603437,23.945744 a 23.549181,23.549181 0 1 1 -47.09836155,0 23.549181,23.549181 0 1 1 47.09836155,0 z"
- sodipodi:ry="23.549181"
- sodipodi:rx="23.549181"
- sodipodi:cy="23.945744"
- sodipodi:cx="24.054256"
- id="path6552"
- style="fill:none;stroke:#999999;stroke-width:4.28166914;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"
- sodipodi:type="arc" />
- </g>
- <g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
- sodipodi:insensitive="true"
- style="display:inline">
+ transform="translate(0,-1004.3622)">
+ <rect
+ style="fill:#000000;fill-opacity:0.62745098;stroke:none"
+ id="rect2993"
+ width="48"
+ height="48.000019"
+ x="3.5527137e-15"
+ y="1004.3622"
+ rx="4" />
<path
- id="path2178"
- style="fill:none;stroke:#999999;stroke-width:4.0538249;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker-start:none"
- d="m 12.508912,24 c 22.982175,0 22.982175,0 22.982175,0 m -11.63349,11.491087 0,-22.982175"
- inkscape:connector-curvature="0" />
+ inkscape:connector-curvature="0"
+ d="m 30.870212,1032.488 h -1.445398 l -0.512293,-0.494 c 1.793025,-2.0858 2.872499,-4.7936 2.872499,-7.7393 0,-6.5683 -5.324185,-11.8925 -11.89251,-11.8925 -6.568325,0 -11.89251,5.3242 -11.89251,11.8925 0,6.5683 5.324185,11.8925 11.89251,11.8925 2.945683,0 5.653516,-1.0795 7.73928,-2.8725 l 0.493996,0.5123 v 1.4454 l 9.148085,9.1298 L 40,1041.6361 Z m -10.977702,0 c -4.555746,0 -8.233276,-3.6775 -8.233276,-8.2333 0,-4.5557 3.67753,-8.2333 8.233276,-8.2333 4.555746,0 8.233276,3.6776 8.233276,8.2333 0,4.5558 -3.67753,8.2333 -8.233276,8.2333 z m 4.574042,-7.3185 h -3.659234 v 3.6593 h -1.829616 v -3.6593 h -3.659234 v -1.8296 h 3.659234 v -3.6592 h 1.829616 v 3.6592 h 3.659234 z"
+ id="path2"
+ style="stroke-width:1.8296169;fill:#ffffff" />
</g>
</svg>
diff --git a/navit/icons/zoom_manual.svg b/navit/icons/zoom_manual.svg
new file mode 100644
index 000000000..bf3f0faed
--- /dev/null
+++ b/navit/icons/zoom_manual.svg
@@ -0,0 +1,147 @@
+<?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:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="48"
+ height="48"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"
+ sodipodi:docname="zoom_manual.svg"
+ inkscape:export-filename="/home/michael/src/navit-artwork/set_center_cursor.png"
+ inkscape:export-xdpi="134.99994"
+ inkscape:export-ydpi="134.99994">
+ <defs
+ id="defs4">
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath428">
+ <path
+ inkscape:connector-curvature="0"
+ d="M 0,96 96,96 96,0 0,0 0,96 z"
+ id="path430" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath416">
+ <path
+ inkscape:connector-curvature="0"
+ d="M 0,96 96,96 96,0 0,0 0,96 z"
+ id="path418" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath544">
+ <path
+ inkscape:connector-curvature="0"
+ d="M 0,96 96,96 96,0 0,0 0,96 z"
+ id="path546" />
+ </clipPath>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="15.8125"
+ inkscape:cx="13.376125"
+ inkscape:cy="24"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ showguides="true"
+ inkscape:guide-bbox="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1000"
+ inkscape:window-x="0"
+ inkscape:window-y="24"
+ inkscape:window-maximized="1"
+ inkscape:object-nodes="false"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-nodes="true">
+ <sodipodi:guide
+ orientation="0,1"
+ position="0,40"
+ id="guide2985"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ orientation="0,1"
+ position="0,8"
+ id="guide2987"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ orientation="1,0"
+ position="8,0"
+ id="guide2989"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ orientation="1,0"
+ position="40,0"
+ id="guide2991"
+ inkscape:locked="false" />
+ <inkscape:grid
+ type="xygrid"
+ id="grid3763"
+ empspacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <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>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1004.3622)">
+ <rect
+ style="fill:#000000;fill-opacity:0.62745098;stroke:none"
+ id="rect2993"
+ width="48"
+ height="48.000019"
+ x="3.5527137e-15"
+ y="1004.3622"
+ rx="4" />
+ <g
+ id="g841"
+ transform="matrix(1.8296169,0,0,1.8296169,-21.273871,-852.68013)"
+ style="fill:#ffffff">
+ <path
+ sodipodi:nodetypes="cccssssccccccsssss"
+ inkscape:connector-curvature="0"
+ id="path2"
+ d="m 28.5,1030.3622 h -0.79 l -0.28,-0.27 c 0.98,-1.14 1.57,-2.62 1.57,-4.23 0,-3.59 -2.91,-6.5 -6.5,-6.5 -3.59,0 -6.5,2.91 -6.5,6.5 0,3.59 2.91,6.5 6.5,6.5 1.61,0 3.09,-0.59 4.23,-1.57 l 0.27,0.28 v 0.79 l 5,4.99 1.49,-1.49 z m -6,0 c -2.49,0 -4.5,-2.01 -4.5,-4.5 0,-2.49 2.01,-4.5 4.5,-4.5 2.49,0 4.5,2.01 4.5,4.5 0,2.49 -2.01,4.5 -4.5,4.5 z"
+ style="fill:#ffffff" />
+ <g
+ transform="translate(13.033456,1016.3816)"
+ id="text821"
+ style="font-style:normal;font-weight:normal;font-size:40px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ aria-label="M">
+ <path
+ inkscape:connector-curvature="0"
+ id="path847"
+ style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:6.66666651px;font-family:Roboto;-inkscape-font-specification:'Roboto Bold';fill:#ffffff"
+ d="M 8.2485857,7.1110504 9.4660335,10.54855 10.676971,7.1110504 h 1.282552 V 11.850634 H 10.979705 V 10.555061 L 11.077362,8.3187327 9.7980648,11.850634 H 9.1274919 L 7.8514503,8.3219879 7.9491065,10.555061 v 1.295573 H 6.972544 V 7.1110504 Z" />
+ </g>
+ </g>
+ </g>
+</svg>
diff --git a/navit/icons/zoom_out.svg b/navit/icons/zoom_out.svg
index 1d794efd2..907a703d3 100644
--- a/navit/icons/zoom_out.svg
+++ b/navit/icons/zoom_out.svg
@@ -12,48 +12,90 @@
width="48"
height="48"
id="svg2"
- sodipodi:version="0.32"
- inkscape:version="0.47 r22583"
- sodipodi:docname="zoom_in.svg"
- inkscape:output_extension="org.inkscape.output.svg.inkscape"
- inkscape:export-filename="/home/zeroedout/share/usr/share/navit/xpm/zoom_in.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90"
- version="1.0">
+ version="1.1"
+ inkscape:version="0.92.3 (2405546, 2018-03-11)"
+ sodipodi:docname="zoom_out.svg"
+ inkscape:export-filename="/home/michael/src/navit-artwork/zoom_in.png"
+ inkscape:export-xdpi="134.99994"
+ inkscape:export-ydpi="134.99994">
<defs
id="defs4">
- <inkscape:perspective
- sodipodi:type="inkscape:persp3d"
- inkscape:vp_x="0 : 24 : 1"
- inkscape:vp_y="0 : 1000 : 0"
- inkscape:vp_z="48 : 24 : 1"
- inkscape:persp3d-origin="24 : 16 : 1"
- id="perspective11" />
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath428">
+ <path
+ inkscape:connector-curvature="0"
+ d="M 0,96 96,96 96,0 0,0 0,96 z"
+ id="path430" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath416">
+ <path
+ inkscape:connector-curvature="0"
+ d="M 0,96 96,96 96,0 0,0 0,96 z"
+ id="path418" />
+ </clipPath>
+ <clipPath
+ clipPathUnits="userSpaceOnUse"
+ id="clipPath544">
+ <path
+ inkscape:connector-curvature="0"
+ d="M 0,96 96,96 96,0 0,0 0,96 z"
+ id="path546" />
+ </clipPath>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
- gridtolerance="10000"
- guidetolerance="10"
- objecttolerance="10"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="7.919596"
- inkscape:cx="13.199956"
- inkscape:cy="14.64192"
+ inkscape:zoom="15.8125"
+ inkscape:cx="9.2964433"
+ inkscape:cy="24"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
- inkscape:window-width="1280"
- inkscape:window-height="973"
- inkscape:window-x="-6"
- inkscape:window-y="0"
- width="48px"
- height="48px"
showguides="true"
- inkscape:window-maximized="1" />
+ inkscape:guide-bbox="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1000"
+ inkscape:window-x="0"
+ inkscape:window-y="24"
+ inkscape:window-maximized="1"
+ inkscape:object-nodes="false"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-nodes="true">
+ <sodipodi:guide
+ orientation="0,1"
+ position="0,40"
+ id="guide2985"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ orientation="0,1"
+ position="0,8"
+ id="guide2987"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ orientation="1,0"
+ position="8,0"
+ id="guide2989"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ orientation="1,0"
+ position="40,0"
+ id="guide2991"
+ inkscape:locked="false" />
+ <inkscape:grid
+ type="xygrid"
+ id="grid3763"
+ empspacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" />
+ </sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
@@ -62,47 +104,27 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
- inkscape:label="lower copy"
- id="g3036"
- inkscape:groupmode="layer"
- style="display:inline"
- sodipodi:insensitive="true">
- <path
- transform="matrix(0.84928644,0,0,0.84928644,3.5710462,3.6632047)"
- d="m 47.603437,23.945744 a 23.549181,23.549181 0 1 1 -47.09836155,0 23.549181,23.549181 0 1 1 47.09836155,0 z"
- sodipodi:ry="23.549181"
- sodipodi:rx="23.549181"
- sodipodi:cy="23.945744"
- sodipodi:cx="24.054256"
- id="path3038"
- style="fill:#999999;fill-opacity:0.38536586;stroke:none;display:inline"
- sodipodi:type="arc" />
- <path
- transform="matrix(0.77851257,0,0,0.77851257,5.273459,5.3579376)"
- d="m 47.603437,23.945744 a 23.549181,23.549181 0 1 1 -47.09836155,0 23.549181,23.549181 0 1 1 47.09836155,0 z"
- sodipodi:ry="23.549181"
- sodipodi:rx="23.549181"
- sodipodi:cy="23.945744"
- sodipodi:cx="24.054256"
- id="path6552"
- style="fill:none;stroke:#999999;stroke-width:4.28166914;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline"
- sodipodi:type="arc" />
- </g>
- <g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
- style="display:inline">
+ transform="translate(0,-1004.3622)">
+ <rect
+ style="fill:#000000;fill-opacity:0.62745098;stroke:none"
+ id="rect2993"
+ width="48"
+ height="48.000019"
+ x="3.5527137e-15"
+ y="1004.3622"
+ rx="4" />
<path
- id="path2178"
- style="fill:none;stroke:#999999;stroke-width:4.0538249;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker-start:none"
- d="m 12.508912,24 c 22.982175,0 22.982175,0 22.982175,0"
inkscape:connector-curvature="0"
- sodipodi:nodetypes="cc" />
+ d="m 30.870212,1032.488 h -1.445398 l -0.512293,-0.494 c 1.793025,-2.0858 2.872499,-4.7936 2.872499,-7.7393 0,-6.5683 -5.324185,-11.8925 -11.89251,-11.8925 -6.568325,0 -11.89251,5.3242 -11.89251,11.8925 0,6.5683 5.324185,11.8925 11.89251,11.8925 2.945683,0 5.653516,-1.0795 7.73928,-2.8725 l 0.493996,0.5123 v 1.4454 l 9.148085,9.1298 L 40,1041.6361 Z m -10.977702,0 c -4.555746,0 -8.233276,-3.6775 -8.233276,-8.2333 0,-4.5557 3.67753,-8.2333 8.233276,-8.2333 4.555746,0 8.233276,3.6776 8.233276,8.2333 0,4.5558 -3.67753,8.2333 -8.233276,8.2333 z m -4.574042,-9.1481 h 9.148084 v 1.8296 h -9.148084 z"
+ id="path2"
+ style="stroke-width:1.8296169;fill:#ffffff" />
</g>
</svg>
diff --git a/navit/item.c b/navit/item.c
index 4f64a1edb..c17f31f8b 100644
--- a/navit/item.c
+++ b/navit/item.c
@@ -345,10 +345,10 @@ void item_attr_rewind(struct item *it) {
* This function is not safe to call after destroying the item's map rect, and doing so may cause errors
* with some map implementations.
*
- * @param it The map item whose attribute to retrieve. This must be the active item, i.e. the last one retrieved from the
+ * @param[in] it The map item whose attribute to retrieve. This must be the active item, i.e. the last one retrieved from the
* {@code map_rect}. There can only be one active item per {@code map_rect}.
- * @param attr_type The attribute type to retrieve, or `attr_any` to retrieve the next attribute
- * @param attr Receives the attribute retrieved
+ * @param[in] attr_type The attribute type to retrieve, or `attr_any` to retrieve the next attribute
+ * @param[out] attr Receives the attribute retrieved
*
* @return True on success, false on failure
*/
diff --git a/navit/item_def.h b/navit/item_def.h
index 231891d12..aedf1b536 100644
--- a/navit/item_def.h
+++ b/navit/item_def.h
@@ -18,6 +18,13 @@
*/
/* This file is generated from http://wiki.navit-project.org/index.php/Item_def.h, do not edit it, edit the wiki page instead */
+#ifndef ITEM
+#define ITEM(x) extern ##x;
+#endif
+#ifndef ITEM2
+#define ITEM2(x,y) extern ##y;
+#endif
+
ITEM2(0x00000000,none)
ITEM2(0x00000001,point_unspecified)
ITEM(town_streets)
diff --git a/navit/navit.c b/navit/navit.c
index 90935786d..1d1b8e664 100644
--- a/navit/navit.c
+++ b/navit/navit.c
@@ -213,6 +213,13 @@ void navit_add_mapset(struct navit *this_, struct mapset *ms) {
this_->mapsets = g_list_append(this_->mapsets, ms);
}
+/**
+ * @brief Get the current mapset
+ *
+ * @param this_ The navit instance
+ *
+ * @return A pointer to the current mapset
+ */
struct mapset *
navit_get_mapset(struct navit *this_) {
if(this_->mapsets) {
@@ -223,6 +230,131 @@ navit_get_mapset(struct navit *this_) {
return NULL;
}
+/**
+ * @brief Get the search result map (and create it if it does not exist)
+ *
+ * @param this_ The navit instance
+ *
+ * @return A pointer to the map named "search_results" or NULL if there wasa failure
+ */
+struct map *navit_get_search_results_map(struct navit *this_) {
+
+ struct mapset *ms;
+ struct map *map;
+
+ ms=navit_get_mapset(this_);
+
+ if(!ms)
+ return NULL;
+
+ map=mapset_get_map_by_name(ms, "search_results");
+ if(!map) {
+ struct attr *attrs[10], attrmap;
+ enum attr_type types[]= {attr_position_longitude,attr_position_latitude,attr_label,attr_none};
+ int i;
+
+ attrs[0]=g_new0(struct attr,1);
+ attrs[0]->type=attr_type;
+ attrs[0]->u.str="csv";
+
+ attrs[1]=g_new0(struct attr,1);
+ attrs[1]->type=attr_name;
+ attrs[1]->u.str="search_results";
+
+ attrs[2]=g_new0(struct attr,1);
+ attrs[2]->type=attr_charset;
+ attrs[2]->u.str="utf-8";
+
+ attrs[3]=g_new0(struct attr,1);
+ attrs[3]->type=attr_item_type;
+ attrs[3]->u.num=type_found_item;
+
+ attrs[4]=g_new0(struct attr,1);
+ attrs[4]->type=attr_attr_types;
+ attrs[4]->u.attr_types=types;
+ attrs[5]=NULL;
+
+ attrmap.type=attr_map;
+ map=attrmap.u.map=map_new(NULL,attrs);
+ if(map)
+ mapset_add_attr(ms,&attrmap);
+
+ for(i=0; attrs[i]; i++)
+ g_free(attrs[i]);
+ }
+ return map;
+}
+
+/**
+ * @brief Populate a map containing one or more search result points
+ *
+ * These search results will be displayed as an overlay on the top of the geographic map.
+ *
+ * @warning Each call to this function will replace currently displayed results, it will not add to them
+ *
+ * @param this_ The navit instance
+ * @param search_results A GList storing {@code struct lcoord} elements to display on the result map
+ * If this argument in NULL, all existing results will be removed from the map
+ * @param[in,out] coord_rect An optional rectangular zone that will be extended to contain all result points
+ * or NULL if no zone needs to be computed
+ * @return The number of results actually added to the map
+ */
+int navit_populate_search_results_map(struct navit *this_, GList *search_results, struct coord_rect *r) {
+ struct map *map;
+ struct map_rect *mr;
+ struct item *item;
+ GList *curr_result = search_results;
+ int count;
+ char *name_label;
+
+ map = navit_get_search_results_map(this_);
+ if(!map)
+ return 0;
+
+ mr = map_rect_new(map, NULL);
+
+ if(!mr)
+ return 0;
+
+ /* Clean the map */
+ while((item = map_rect_get_item(mr))!=NULL) {
+ item_type_set(item,type_none);
+ }
+
+ if(!search_results) {
+ map_rect_destroy(mr);
+ dbg(lvl_warning,"NULL result table - only map clean up is done.");
+ return 0;
+ }
+
+ /* Populate the map with search results*/
+ for(curr_result = search_results, count=0; curr_result; curr_result=g_list_next(curr_result)) {
+ struct lcoord *point = curr_result->data;
+ struct item* it;
+ if(point->label==NULL)
+ continue;
+ dbg(lvl_info,"%s",point->label);
+ it=map_rect_create_item(mr,type_found_item);
+ if(it) {
+ struct attr a;
+ item_coord_set(it, &(point->c), 1, change_mode_modify);
+ a.type=attr_label;
+ name_label = g_strdup(point->label);
+ square_shape_str(name_label);
+ a.u.str=name_label;
+ item_attr_set(it, &a, change_mode_modify);
+ if (r) {
+ if(!count++)
+ r->lu=r->rl=point->c;
+ else
+ coord_rect_extend(r,&(point->c));
+ }
+ }
+ }
+ map_rect_destroy(mr);
+ return count;
+}
+
struct tracking *
navit_get_tracking(struct navit *this_) {
return this_->tracking;
diff --git a/navit/navit.h b/navit/navit.h
index 7125c1878..f543a7baf 100644
--- a/navit/navit.h
+++ b/navit/navit.h
@@ -54,6 +54,8 @@ struct command_table;
struct item;
void navit_add_mapset(struct navit *this_, struct mapset *ms);
struct mapset *navit_get_mapset(struct navit *this_);
+struct map *navit_get_search_results_map(struct navit *this_);
+int navit_populate_search_results_map(struct navit *navit, GList *search_results, struct coord_rect *r);
struct tracking *navit_get_tracking(struct navit *this_);
char *navit_get_user_data_directory(int create);
void navit_draw_async(struct navit *this_, int async);
diff --git a/navit/osd.c b/navit/osd.c
index 086993941..8b548b044 100644
--- a/navit/osd.c
+++ b/navit/osd.c
@@ -298,7 +298,7 @@ void osd_set_std_attr(struct attr **attrs, struct osd_item *item, int flags) {
item->color_bg.r = 0x0;
item->color_bg.g = 0x0;
item->color_bg.b = 0x0;
- item->color_bg.a = 0x5fff;
+ item->color_bg.a = 0x9fff;
}
attr=attr_search(attrs, NULL, attr_osd_configuration);
diff --git a/navit/osd/core/osd_core.c b/navit/osd/core/osd_core.c
index 5450a4203..fbf025cc3 100644
--- a/navit/osd/core/osd_core.c
+++ b/navit/osd/core/osd_core.c
@@ -954,10 +954,11 @@ static void osd_odometer_click(struct osd_priv_common *opc, struct navit *nav, i
return;
if (button != 1)
return;
- if (navit_ignore_button(nav))
- return;
if (!!pressed == !!opc->osd_item.pressed)
return;
+ if (navit_ignore_button(nav))
+ return;
+ opc->osd_item.pressed=pressed;
gettimeofday(&tv,NULL);
curr_time = (double)(tv.tv_usec)/1000000.0+tv.tv_sec;
@@ -1359,10 +1360,11 @@ static void osd_stopwatch_click(struct osd_priv_common *opc, struct navit *nav,
return;
if (button != 1)
return;
- if (navit_ignore_button(nav))
- return;
if (!!pressed == !!opc->osd_item.pressed)
return;
+ if (navit_ignore_button(nav))
+ return;
+ opc->osd_item.pressed=pressed;
if (pressed) { //single click handling
@@ -2195,7 +2197,7 @@ struct nav_toggle_announcer {
/* FIXME this is actually the click callback, which is set once but never read. Do we need this? */
struct callback *navit_init_cb;
char *icon_src;
- int icon_h, icon_w, active, last_state;
+ int active, last_state;
};
static void osd_nav_toggle_announcer_draw(struct osd_priv_common *opc, struct navit *navit, struct vehicle *v) {
@@ -2205,8 +2207,8 @@ static void osd_nav_toggle_announcer_draw(struct osd_priv_common *opc, struct na
int do_draw = opc->osd_item.do_draw;
struct graphics_image *gr_image;
char *path;
- char *gui_sound_off = "gui_sound_off";
- char *gui_sound_on = "gui_sound";
+ char *sound_off = "sound_off";
+ char *sound_on = "sound_on";
struct attr attr, speechattr;
if (!navit_get_attr(navit, attr_speech, &speechattr, NULL)) {
@@ -2229,15 +2231,15 @@ static void osd_nav_toggle_announcer_draw(struct osd_priv_common *opc, struct na
graphics_draw_rectangle(opc->osd_item.gr, opc->osd_item.graphic_bg, &p, opc->osd_item.w, opc->osd_item.h);
if (this->active)
- path = g_strdup_printf(this->icon_src, gui_sound_on);
+ path = g_strdup_printf(this->icon_src, sound_on);
else
- path = g_strdup_printf(this->icon_src, gui_sound_off);
+ path = g_strdup_printf(this->icon_src, sound_off);
- gr_image = graphics_image_new_scaled(opc->osd_item.gr, path, this->icon_w, this->icon_h);
+ gr_image = graphics_image_new_scaled(opc->osd_item.gr, path, opc->osd_item.w, opc->osd_item.h);
if (!gr_image) {
g_free(path);
path = graphics_icon_path("unknown.png");
- gr_image = graphics_image_new_scaled(opc->osd_item.gr, path, this->icon_w, this->icon_h);
+ gr_image = graphics_image_new_scaled(opc->osd_item.gr, path, opc->osd_item.w, opc->osd_item.h);
}
dbg(lvl_debug, "gr_image=%p", gr_image);
@@ -2280,9 +2282,8 @@ static struct osd_priv *osd_nav_toggle_announcer_new(struct navit *nav, struct o
meth->set_attr = set_std_osd_attr;
osd_set_std_attr(attrs, &opc->osd_item, 0);
+ opc->osd_item.color_bg.a = 0x0000;
- this->icon_w = -1;
- this->icon_h = -1;
this->last_state = -1;
attr = attr_search(attrs, NULL, attr_icon_src);
@@ -2291,10 +2292,10 @@ static struct osd_priv *osd_nav_toggle_announcer_new(struct navit *nav, struct o
char **array;
we = file_wordexp_new(attr->u.str);
array = file_wordexp_get_array(we);
- this->icon_src = g_strdup(array[0]);
+ this->icon_src = graphics_icon_path(array[0]);
file_wordexp_destroy(we);
} else
- this->icon_src = graphics_icon_path("%s_32.xpm");
+ this->icon_src = graphics_icon_path("%s");
opc->osd_item.command = g_strdup(command);
@@ -2726,13 +2727,16 @@ static void osd_speed_warner_click(struct osd_priv_common *opc, struct navit *na
return;
if (button != 1)
return;
- if (navit_ignore_button(nav))
- return;
if (!!pressed == !!opc->osd_item.pressed)
return;
- this->active = !this->active;
- osd_speed_warner_draw(opc, nav, NULL);
+ if (navit_ignore_button(nav))
+ return;
+ opc->osd_item.pressed=pressed;
+ if (pressed) {
+ this->active = !this->active;
+ osd_speed_warner_draw(opc, nav, NULL);
+ }
}
diff --git a/navit/plugin/pedestrian/pedestrian.c b/navit/plugin/pedestrian/pedestrian.c
index 1f1d96ac4..a0407c873 100644
--- a/navit/plugin/pedestrian/pedestrian.c
+++ b/navit/plugin/pedestrian/pedestrian.c
@@ -1223,7 +1223,7 @@ static void pedestrian_navit_init(struct navit *nav) {
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);
+ navitsensors=(*jnienv)->NewObject(jnienv, navitsensorsclass, cid, android_application, cb);
dbg(lvl_debug,"object=%p",navitsensors);
if (navitsensors)
navitsensors = (*jnienv)->NewGlobalRef(jnienv, navitsensors);
diff --git a/navit/route.c b/navit/route.c
index 3633abc6a..6ee352c65 100644
--- a/navit/route.c
+++ b/navit/route.c
@@ -1040,6 +1040,24 @@ static struct map_selection *route_calc_selection(struct coord *c, int count, st
}
/**
+ * @brief Retrieves the map selection for the route.
+ */
+struct map_selection * route_get_selection(struct route * this_) {
+ struct coord *c = g_alloca(sizeof(struct coord) * (1 + g_list_length(this_->destinations)));
+ int i = 0;
+ GList *tmp;
+
+ c[i++] = this_->pos->c;
+ tmp = this_->destinations;
+ while (tmp) {
+ struct route_info *dst = tmp->data;
+ c[i++] = dst->c;
+ tmp = g_list_next(tmp);
+ }
+ return route_calc_selection(c, i, this_->vehicleprofile);
+}
+
+/**
* @brief Destroys a list of map selections
*
* @param sel Start of the list to be destroyed
diff --git a/navit/route_protected.h b/navit/route_protected.h
index 9b7bf62f6..586fde91d 100644
--- a/navit/route_protected.h
+++ b/navit/route_protected.h
@@ -159,6 +159,7 @@ struct route_graph {
/* prototypes */
struct route_graph * route_get_graph(struct route *this_);
+struct map_selection * route_get_selection(struct route * this_);
void route_add_traffic_distortion(struct route *this_, struct item *item);
void route_remove_traffic_distortion(struct route *this_, struct item *item);
void route_change_traffic_distortion(struct route *this_, struct item *item);
diff --git a/navit/speech/android/speech_android.c b/navit/speech/android/speech_android.c
index b76c2c3e9..fb0574166 100644
--- a/navit/speech/android/speech_android.c
+++ b/navit/speech/android/speech_android.c
@@ -36,7 +36,14 @@ struct speech_priv {
static int speech_android_say(struct speech_priv *this, const char *text) {
char *str=g_strdup(text);
jstring string;
- int i;
+ char *tok = str;
+
+ /* Replace hyphens with white spaces, or some Android speech SDK will pronounce "hyphen" */
+ while (*tok) {
+ if (*tok=='-')
+ *tok=' ';
+ tok++;
+ }
string = (*jnienv)->NewStringUTF(jnienv, str);
dbg(lvl_debug,"enter %s",str);
diff --git a/navit/speech/qt5_espeak/Qt5EspeakAudioOut.cpp b/navit/speech/qt5_espeak/Qt5EspeakAudioOut.cpp
index a5e488391..f8f8339eb 100644
--- a/navit/speech/qt5_espeak/Qt5EspeakAudioOut.cpp
+++ b/navit/speech/qt5_espeak/Qt5EspeakAudioOut.cpp
@@ -81,6 +81,9 @@ void Qt5EspeakAudioOut::handleStateChanged(QAudio::State newState) {
break;
case QAudio::StoppedState:
break;
+// Sailfish's QT version doesn't have this. Doesn't do anything either.
+// case QAudio::InterruptedState:
+// break;
case QAudio::IdleState:
/*remove all data that was already read*/
data->remove(0, buffer->pos());
diff --git a/navit/start_real.c b/navit/start_real.c
index b7a0db48c..ad990d874 100644
--- a/navit/start_real.c
+++ b/navit/start_real.c
@@ -27,7 +27,6 @@
#include <XGetopt.h>
#endif
#include "config_.h"
-#include "version.h"
#include "item.h"
#include "coord.h"
#include "main.h"
@@ -52,7 +51,6 @@
#include <winbase.h>
#endif
-char *version=PACKAGE_VERSION"+git:"GIT_VERSION""NAVIT_VARIANT;
int main_argc;
char * const* main_argv;
@@ -128,7 +126,7 @@ int main_real(int argc, char * const* argv) {
exit(0);
break;
case 'v':
- printf("%s %s\n", "navit", version);
+ printf("%s %s\n", "navit", NAVIT_VERSION);
exit(0);
break;
case 'c':
diff --git a/navit/traffic.c b/navit/traffic.c
index 7a0b74480..ba0bd3240 100644
--- a/navit/traffic.c
+++ b/navit/traffic.c
@@ -76,14 +76,15 @@
/** Flag to indicate the message store should not be exported */
#define PROCESS_MESSAGES_NO_DUMP_STORE 1 << 1
-/** The lowest order of items to consider */
-#define ROUTE_ORDER 18
+/** The lowest order of items to consider (always the default order for the next-lower road type) */
+#define ROUTE_ORDER(x) (((x == type_highway_land) || (x == type_highway_city) || (x == type_street_n_lanes)) \
+ ? 10 : ((x == type_street_4_land) || (x == type_street_4_city)) ? 12 : 18)
/** The buffer zone around the enclosing rectangle used in route calculations, absolute distance */
-#define ROUTE_RECT_DIST_ABS 1000
+#define ROUTE_RECT_DIST_ABS(x) ((x == location_fuzziness_low_res) ? 1000 : 100)
/** The buffer zone around the enclosing rectangle used in route calculations, relative to rect size */
-#define ROUTE_RECT_DIST_REL 0
+#define ROUTE_RECT_DIST_REL(x) 0
/** Time slice for idle loops, in milliseconds */
#define TIME_SLICE 40
@@ -95,6 +96,9 @@ struct traffic_shared_priv {
GList * messages; /**< Currently active messages */
GList * message_queue; /**< Queued messages, waiting to be processed */
// TODO messages by ID? In a later phase…
+ struct mapset *ms; /**< The mapset used for routing */
+ struct route *rt; /**< The route to notify of traffic changes */
+ struct map *map; /**< The traffic map, in which traffic distortions are stored */
};
/**
@@ -112,9 +116,6 @@ struct traffic {
struct event_timeout * timeout; /**< The timeout event that triggers the loop function */
struct callback *idle_cb; /**< Idle callback to process new messages */
struct event_idle *idle_ev; /**< The pointer to the idle event */
- struct mapset *ms; /**< The mapset used for routing */
- struct route *rt; /**< The route to notify of traffic changes */
- struct map *map; /**< The traffic map, in which traffic distortions are stored */
};
struct traffic_location_priv {
@@ -135,6 +136,7 @@ struct traffic_message_priv {
*/
struct map_priv {
GList * items; /**< The map items */
+ struct traffic_shared_priv *shared; /**< Private data shared between all instances */
// TODO items by start/end coordinates? In a later phase…
};
@@ -249,6 +251,8 @@ struct xml_element {
char * text; /**< Character data (NULL-terminated) */
};
+static struct map_methods traffic_map_meth;
+
static struct seg_data * seg_data_new(void);
static struct item * tm_add_item(struct map *map, enum item_type type, int id_hi, int id_lo,
int flags, struct attr **attrs, struct coord *c, int count, char * id);
@@ -265,6 +269,7 @@ static int tm_coord_get(void *priv_data, struct coord *c, int count);
static void tm_attr_rewind(void *priv_data);
static int tm_attr_get(void *priv_data, enum attr_type attr_type, struct attr *attr);
static int tm_type_set(void *priv_data, enum item_type type);
+static struct map_selection * traffic_location_get_rect(struct traffic_location * this_, enum projection projection);
static struct route_graph * traffic_location_get_route_graph(struct traffic_location * this_,
struct mapset * ms);
static int traffic_location_match_attributes(struct traffic_location * this_, struct item *item);
@@ -272,6 +277,7 @@ static int traffic_message_add_segments(struct traffic_message * this_, struct m
struct map *map, struct route * route);
static void traffic_location_populate_route_graph(struct traffic_location * this_, struct route_graph * rg,
struct mapset * ms);
+static void traffic_location_set_enclosing_rect(struct traffic_location * this_, struct coord_geo ** coords);
static void traffic_dump_messages_to_xml(struct traffic * this_);
static void traffic_loop(struct traffic * this_);
static struct traffic * traffic_new(struct attr *parent, struct attr **attrs);
@@ -867,11 +873,43 @@ static void tm_destroy(struct map_priv *priv) {
*/
static struct map_rect_priv * tm_rect_new(struct map_priv *priv, struct map_selection *sel) {
struct map_rect_priv * mr;
+
+ /* Iterator over active messages */
+ GList * msgiter;
+
+ /* Current message */
+ struct traffic_message * message;
+
+ /* Map selection for current message */
+ struct map_selection * ms;
+
+ /* Attributes for traffic distortions generated from the current traffic message */
+ struct seg_data * data;
+
dbg(lvl_debug,"enter");
mr=g_new0(struct map_rect_priv, 1);
mr->mpriv = priv;
mr->next_item = priv->items;
/* all other pointers are initially NULL */
+
+ /* lazy location matching */
+ if (sel != NULL)
+ /* TODO experimental: if no selection is passed, do not resolve any locations */
+ for (msgiter = priv->shared->messages; msgiter; msgiter = g_list_next(msgiter)) {
+ message = (struct traffic_message *) msgiter->data;
+ if (message->priv->items == NULL) {
+ traffic_location_set_enclosing_rect(message->location, NULL);
+ ms = traffic_location_get_rect(message->location, traffic_map_meth.pro);
+ if ((sel == NULL) || coord_rect_overlap(&(ms->u.c_rect), &(sel->u.c_rect))) {
+ /* TODO the sel criterion is obsolete if we keep the enclosing condition */
+ /* TODO do this in an idle loop, not here */
+ data = traffic_message_parse_events(message);
+ traffic_message_add_segments(message, priv->shared->ms, data, priv->shared->map, priv->shared->rt);
+ g_free(data);
+ }
+ map_selection_destroy(ms);
+ }
+ }
return mr;
}
@@ -953,6 +991,27 @@ static struct item * tm_rect_create_item(struct map_rect_priv *mr, enum item_typ
return ret;
}
+
+/**
+ * @brief Gets an attribute from the traffic map
+ *
+ * This only supports the `attr_traffic` attribute, which is currently only used for the purpose of
+ * identifying the map as a traffic map. Note, however, that for now the attribute will have a null pointer.
+ *
+ * @param map_priv Private data of the traffic map
+ * @param type The type of the attribute to be read
+ * @param attr Pointer to an attrib-structure where the attribute should be written to
+ * @return True if the attribute type was found, false if not
+ */
+static int * tm_get_attr(struct map_priv *priv, enum attr_type type, struct attr *attr) {
+ if (attr_type == attr_traffic) {
+ attr->type = attr_traffic;
+ attr->u.traffic = NULL;
+ return 1;
+ } else
+ return 0;
+}
+
/**
* @brief Rewinds the coordinates of the currently selected item.
*
@@ -1072,7 +1131,7 @@ static struct map_methods traffic_map_meth = {
NULL, /* map_search_destroy: Destroy a map search struct, ignored if `map_search_new` is NULL */
NULL, /* map_search_get_item: Get the next item of a search on the map */
tm_rect_create_item, /* map_rect_create_item: Create a new item in the map */
- NULL, /* map_get_attr */
+ tm_get_attr, /* map_get_attr */
NULL, /* map_set_attr */
};
@@ -1704,6 +1763,27 @@ static void traffic_location_set_enclosing_rect(struct traffic_location * this_,
}
/**
+ * @brief Obtains a map selection for the traffic location.
+ *
+ * The map selection is a rectangle around the points of the traffic location, with some extra padding as
+ * specified in `ROUTE_RECT_DIST_REL` and `ROUTE_RECT_DIST_ABS`, with a map order specified in `ROUTE_ORDER`.
+ *
+ * @param this_ The traffic location
+ * @param projection The projection to be used by coordinates of the selection (should correspond to the
+ * projection of the target map)
+ *
+ * @return A map selection
+ */
+static struct map_selection * traffic_location_get_rect(struct traffic_location * this_, enum projection projection) {
+ /* Corners of the enclosing rectangle, in Mercator coordinates */
+ struct coord c1, c2;
+ transform_from_geo(projection, this_->priv->sw, &c1);
+ transform_from_geo(projection, this_->priv->ne, &c2);
+ return route_rect(ROUTE_ORDER(this_->road_type), &c1, &c2, ROUTE_RECT_DIST_REL(this_->fuzziness),
+ ROUTE_RECT_DIST_ABS(this_->fuzziness));
+}
+
+/**
* @brief Opens a map rectangle around the end points of the traffic location.
*
* Prior to calling this function, the caller must ensure `rg->m` points to the map to be used, and the enclosing
@@ -1716,13 +1796,7 @@ static void traffic_location_set_enclosing_rect(struct traffic_location * this_,
*/
static struct map_rect * traffic_location_open_map_rect(struct traffic_location * this_, struct route_graph * rg) {
/* Corners of the enclosing rectangle, in Mercator coordinates */
- struct coord c1, c2;
-
- transform_from_geo(map_projection(rg->m), this_->priv->sw, &c1);
- transform_from_geo(map_projection(rg->m), this_->priv->ne, &c2);
-
- rg->sel = route_rect(ROUTE_ORDER, &c1, &c2, ROUTE_RECT_DIST_REL, ROUTE_RECT_DIST_ABS);
-
+ rg->sel = traffic_location_get_rect(this_, map_projection(rg->m));
if (!rg->sel)
return NULL;
rg->mr = map_rect_new(rg->m, rg->sel);
@@ -1780,6 +1854,9 @@ static void traffic_location_populate_route_graph(struct traffic_location * this
rg->h = mapset_open(ms);
while ((rg->m = mapset_next(rg->h, 2))) {
+ /* Skip traffic map (identified by the `attr_traffic` attribute) */
+ if (map_get_attr(rg->m, attr_traffic, &attr, NULL))
+ continue;
if (!traffic_location_open_map_rect(this_, rg))
continue;
while ((item = map_rect_get_item(rg->mr))) {
@@ -1787,6 +1864,23 @@ static void traffic_location_populate_route_graph(struct traffic_location * this
route_graph_add_turn_restriction(rg, item);
else if ((item->type < route_item_first) || (item->type > route_item_last))
continue;
+ /* If road class is motorway, trunk or primary, ignore roads more than one level below */
+ if ((this_->road_type == type_highway_land) || (this_->road_type == type_highway_city)) {
+ if ((item->type != type_highway_land) && (item->type != type_highway_city) &&
+ (item->type != type_street_n_lanes) && (item->type != type_ramp))
+ continue;
+ } else if (this_->road_type == type_street_n_lanes) {
+ if ((item->type != type_highway_land) && (item->type != type_highway_city) &&
+ (item->type != type_street_n_lanes) && (item->type != type_ramp) &&
+ (item->type != type_street_4_land) && (item->type != type_street_4_city))
+ continue;
+ } else if ((this_->road_type == type_street_4_land) || (this_->road_type == type_street_4_city)) {
+ if ((item->type != type_highway_land) && (item->type != type_highway_city) &&
+ (item->type != type_street_n_lanes) && (item->type != type_ramp) &&
+ (item->type != type_street_4_land) && (item->type != type_street_4_city) &&
+ (item->type != type_street_3_land) && (item->type != type_street_3_city))
+ continue;
+ }
if (item_get_default_flags(item->type)) {
item_coord_rewind(item);
@@ -2442,6 +2536,9 @@ static GList * traffic_location_get_matching_points(struct traffic_location * th
/* The point from the location to match */
struct traffic_point * trpoint = NULL;
+ /* Map attribute (currently not evaluated) */
+ struct attr attr;
+
/* The item being processed */
struct item *item;
@@ -2467,6 +2564,9 @@ static GList * traffic_location_get_matching_points(struct traffic_location * th
rg->h = mapset_open(ms);
while ((rg->m = mapset_next(rg->h, 2))) {
+ /* Skip traffic map (identified by the `attr_traffic` attribute) */
+ if (map_get_attr(rg->m, attr_traffic, &attr, NULL))
+ continue;
if (!traffic_location_open_map_rect(this_, rg))
continue;
while ((item = map_rect_get_item(rg->mr))) {
@@ -3782,6 +3882,12 @@ static int traffic_process_messages_int(struct traffic * this_, int flags) {
struct traffic_location * swap_location;
struct item ** swap_items;
+ /* Holds queried attributes */
+ struct attr attr;
+
+ /* Map selections for the location and the route, and iterator */
+ struct map_selection * loc_ms, * rt_ms, * ms_iter;
+
/* Time elapsed since start */
double msec = 0;
@@ -3836,8 +3942,26 @@ static int traffic_process_messages_int(struct traffic * this_, int flags) {
swap_candidate->priv->items = swap_items;
} else {
dbg(lvl_debug, "*****checkpoint PROCESS-4, need to find matching segments");
- /* else find matching segments from scratch */
- traffic_message_add_segments(message, this_->ms, data, this_->map, this_->rt);
+ /*
+ * We need to find matching segments from scratch.
+ * This needs to happen immediately if we have a route and the location is within its map
+ * selection, as the message might have an effect on the route. Otherwise this operation
+ * is deferred until a rectangle overlapping with the location is queried.
+ */
+ if (route_get_attr(this_->shared->rt, attr_route_status, &attr, NULL)
+ && (!(attr.u.num & route_status_destination_set))) {
+ traffic_location_set_enclosing_rect(message->location, NULL);
+ loc_ms = traffic_location_get_rect(message->location, traffic_map_meth.pro);
+ rt_ms = route_get_selection(this_->shared->rt);
+ for (ms_iter = rt_ms; ms_iter; ms_iter = ms_iter->next)
+ if (coord_rect_overlap(&(loc_ms->u.c_rect), &(ms_iter->u.c_rect))) {
+ /* TODO do this in an idle loop, not here */
+ traffic_message_add_segments(message, this_->shared->ms, data, this_->shared->map, this_->shared->rt);
+ break;
+ }
+ map_selection_destroy(loc_ms);
+ map_selection_destroy(rt_ms);
+ }
ret |= MESSAGE_UPDATE_SEGMENTS;
}
@@ -3856,7 +3980,7 @@ static int traffic_process_messages_int(struct traffic * this_, int flags) {
if (stored_msg->priv->items)
ret |= MESSAGE_UPDATE_SEGMENTS;
this_->shared->messages = g_list_remove_all(this_->shared->messages, stored_msg);
- traffic_message_remove_item_data(stored_msg, message, this_->rt);
+ traffic_message_remove_item_data(stored_msg, message, this_->shared->rt);
traffic_message_destroy(stored_msg);
}
@@ -3908,7 +4032,7 @@ static int traffic_process_messages_int(struct traffic * this_, int flags) {
if (stored_msg->priv->items)
ret |= MESSAGE_UPDATE_SEGMENTS;
this_->shared->messages = g_list_remove_all(this_->shared->messages, stored_msg);
- traffic_message_remove_item_data(stored_msg, NULL, this_->rt);
+ traffic_message_remove_item_data(stored_msg, NULL, this_->shared->rt);
traffic_message_destroy(stored_msg);
}
@@ -3929,7 +4053,7 @@ static int traffic_process_messages_int(struct traffic * this_, int flags) {
}
/* TODO see comment on route_recalculate_partial about thread-safety */
- route_recalculate_partial(this_->rt);
+ route_recalculate_partial(this_->shared->rt);
/* trigger redraw if segments have changed */
if ((ret & MESSAGE_UPDATE_SEGMENTS) && (navit_get_ready(this_->navit) == 3))
@@ -4018,8 +4142,6 @@ static struct traffic * traffic_new(struct attr *parent, struct attr **attrs) {
this_->callback = callback_new_1(callback_cast(traffic_loop), this_);
this_->timeout = event_add_timeout(1000, 1, this_->callback); // TODO make interval configurable
- this_->map = NULL;
-
if (!this_->shared)
traffic_set_shared(this_);
@@ -5132,9 +5254,17 @@ struct item ** traffic_message_get_items(struct traffic_message * this_) {
*/
static struct map_priv * traffic_map_new(struct map_methods *meth, struct attr **attrs, struct callback_list *cbl) {
struct map_priv *ret;
+ struct attr *traffic_attr;
+
+ traffic_attr = attr_search(attrs, NULL, attr_traffic);
+ if (!traffic_attr) {
+ dbg(lvl_error, "attr_traffic not found!");
+ return NULL;
+ }
ret = g_new0(struct map_priv, 1);
*meth = traffic_map_meth;
+ ret->shared = traffic_attr->u.traffic->shared;
return ret;
}
@@ -5145,44 +5275,31 @@ void traffic_init(void) {
}
struct map * traffic_get_map(struct traffic *this_) {
- struct attr_iter *iter;
- struct attr *attr;
- struct traffic * traffic;
char * filename;
struct traffic_message ** messages;
struct traffic_message ** cur_msg;
- if (!this_->map) {
- /* see if any of the other instances has already created a map */
- attr = g_new0(struct attr, 1);
- iter = navit_attr_iter_new();
- while (navit_get_attr(this_->navit, attr_traffic, attr, iter)) {
- traffic = (struct traffic *) attr->u.navit_object;
- if (traffic->map)
- this_->map = traffic->map;
- }
- navit_attr_iter_destroy(iter);
- g_free(attr);
- }
-
- if (!this_->map) {
+ if (!this_->shared->map) {
/* no map yet, create a new one */
struct attr *attrs[4];
- struct attr a_type,data,a_description;
+ struct attr a_type,data,a_description,a_traffic;
a_type.type = attr_type;
a_type.u.str = "traffic";
data.type = attr_data;
data.u.str = "";
a_description.type = attr_description;
a_description.u.str = "Traffic";
+ a_traffic.type = attr_traffic;
+ a_traffic.u.traffic = this_;
attrs[0] = &a_type;
attrs[1] = &data;
attrs[2] = &a_description;
- attrs[3] = NULL;
+ attrs[3] = &a_traffic;
+ attrs[4] = NULL;
- this_->map = map_new(NULL, attrs);
- navit_object_ref((struct navit_object *) this_->map);
+ this_->shared->map = map_new(NULL, attrs);
+ navit_object_ref((struct navit_object *) this_->shared->map);
/* populate map with previously stored messages */
filename = g_strjoin(NULL, navit_get_user_data_directory(TRUE), "/traffic.xml", NULL);
@@ -5203,7 +5320,7 @@ struct map * traffic_get_map(struct traffic *this_) {
}
}
- return this_->map;
+ return this_->shared->map;
}
/**
@@ -5270,6 +5387,24 @@ struct traffic_message ** traffic_get_stored_messages(struct traffic *this_) {
struct traffic_message ** out = ret;
GList * in = this_->shared->messages;
+ /* Iterator over active messages */
+ GList * msgiter;
+
+ /* Current message */
+ struct traffic_message * message;
+
+ /* Attributes for traffic distortions generated from the current traffic message */
+ struct seg_data * data;
+
+ /* Ensure all locations are fully resolved */
+ for (msgiter = this_->shared->messages; msgiter; msgiter = g_list_next(msgiter)) {
+ message = (struct traffic_message *) msgiter->data;
+ if (message->priv->items == NULL) {
+ data = traffic_message_parse_events(message);
+ traffic_message_add_segments(message, this_->shared->ms, data, this_->shared->map, this_->shared->rt);
+ g_free(data);
+ }
+ }
while (in) {
*out = (struct traffic_message *) in->data;
in = g_list_next(in);
@@ -5295,11 +5430,11 @@ void traffic_process_messages(struct traffic * this_, struct traffic_message **
}
void traffic_set_mapset(struct traffic *this_, struct mapset *ms) {
- this_->ms = ms;
+ this_->shared->ms = ms;
}
void traffic_set_route(struct traffic *this_, struct route *rt) {
- this_->rt = rt;
+ this_->shared->rt = rt;
}
struct object_func traffic_func = {
diff --git a/navit/traffic.h b/navit/traffic.h
index 0dd21c7bc..bf0ca907e 100644
--- a/navit/traffic.h
+++ b/navit/traffic.h
@@ -226,6 +226,7 @@ enum si_type {
si_vehicle_with_trailer, /*!< For vehicles with trailers only (TODO currently not supported) */
};
+struct traffic;
struct traffic_priv;
struct traffic_location_priv;
struct traffic_message_priv;
diff --git a/navit/traffic/traff_android/traffic_traff_android.c b/navit/traffic/traff_android/traffic_traff_android.c
index 0bc07ad7f..91d408777 100644
--- a/navit/traffic/traff_android/traffic_traff_android.c
+++ b/navit/traffic/traff_android/traffic_traff_android.c
@@ -122,7 +122,7 @@ static int traffic_traff_android_init(struct traffic_priv * this_) {
dbg(lvl_error,"no method found");
return 0; /* exception thrown */
}
- this_->NavitTraff=(*jnienv)->NewObject(jnienv, this_->NavitTraffClass, cid, android_activity,
+ this_->NavitTraff=(*jnienv)->NewObject(jnienv, this_->NavitTraffClass, cid, android_application,
(int) this_->cbid);
dbg(lvl_debug,"result=%p", this_->NavitTraff);
if (!this_->NavitTraff)
diff --git a/navit/transform.c b/navit/transform.c
index 4c0cb68b1..771037f8c 100644
--- a/navit/transform.c
+++ b/navit/transform.c
@@ -261,7 +261,16 @@ transform_dup(struct transformation *t) {
static const navit_float gar2geo_units = 360.0/(1<<24);
static const navit_float geo2gar_units = 1/(360.0/(1<<24));
-void transform_to_geo(enum projection pro, struct coord *c, struct coord_geo *g) {
+/**
+ * @brief Transform the coordinates of a geographical point from a coord representation to a geographical (lat, long) representation
+ *
+ * @note This is the reverse of transform_from_geo()
+ *
+ * @param pro The projection to use during the transformation
+ * @param[in] c The coordinates as a struct coord format
+ * @param[out] g The coordinates converted to coord_geo (latitude, longitude)
+ */
+void transform_to_geo(enum projection pro, const struct coord *c, struct coord_geo *g) {
int x,y,northern,zone;
switch (pro) {
case projection_mg:
@@ -288,7 +297,16 @@ void transform_to_geo(enum projection pro, struct coord *c, struct coord_geo *g)
}
}
-void transform_from_geo(enum projection pro, struct coord_geo *g, struct coord *c) {
+/**
+ * @brief Transform the coordinates of a geographical point from a geographical (lat, long) representation to a coord representation
+ *
+ * @note This is the reverse of transform_to_geo()
+ *
+ * @param pro The projection to use during the transformation
+ * @param[in] g The coordinates as coord_geo (latitude, longitude)
+ * @param[out] c The coordinates converted to a struct coord format
+ */
+void transform_from_geo(enum projection pro, const struct coord_geo *g, struct coord *c) {
switch (pro) {
case projection_mg:
c->x=g->lng*6371000.0*M_PI/180;
diff --git a/navit/transform.h b/navit/transform.h
index e58e136d5..dab69fd47 100644
--- a/navit/transform.h
+++ b/navit/transform.h
@@ -47,8 +47,8 @@ int transform_set_attr(struct transformation *this_, struct attr *attr);
int transformation_get_order_base(struct transformation *this_);
void transform_set_order_base(struct transformation *this_, int order_base);
struct transformation *transform_dup(struct transformation *t);
-void transform_to_geo(enum projection pro, struct coord *c, struct coord_geo *g);
-void transform_from_geo(enum projection pro, struct coord_geo *g, struct coord *c);
+void transform_to_geo(enum projection pro, const struct coord *c, struct coord_geo *g);
+void transform_from_geo(enum projection pro, const struct coord_geo *g, struct coord *c);
void transform_from_to_count(struct coord *cfrom, enum projection from, struct coord *cto, enum projection to, int count);
void transform_from_to(struct coord *cfrom, enum projection from, struct coord *cto, enum projection to);
void transform_geo_to_cart(struct coord_geo *geo, navit_float a, navit_float b, struct coord_geo_cart *cart);
diff --git a/navit/util.c b/navit/util.c
index 9398e316c..944dc2a21 100644
--- a/navit/util.c
+++ b/navit/util.c
@@ -529,6 +529,70 @@ char * newSysString(const char *toconvert) {
#endif
#endif
+/**
+ * @brief Optimizes the format of a string, adding carriage returns so that when displayed, the result text zone is roughly as wide as high
+ *
+ * @param[in,out] s The string to proces (will be modified by this function, but length will be unchanged)
+ */
+void square_shape_str(char *s) {
+ char *c;
+ char *last_break;
+ unsigned int max_cols = 0;
+ unsigned int cur_cols = 0;
+ unsigned int max_rows = 0;
+ unsigned int surface;
+ unsigned int target_cols;
+
+ if (!s)
+ return;
+ for (c=s; *c!='\0'; c++) {
+ if (*c==' ') {
+ if (max_cols < cur_cols)
+ max_cols = cur_cols;
+ cur_cols = 0;
+ max_rows++;
+ } else
+ cur_cols++;
+ }
+ if (max_cols < cur_cols)
+ max_cols = cur_cols;
+ if (cur_cols) /* If last line does not end with CR, add it to line numbers anyway */
+ max_rows++;
+ /* Give twice more room for rows (hence the factor 2 below)
+ * This will render as a rectangular shape, taking more horizontal space than vertical */
+ surface = max_rows * 2 * max_cols;
+ target_cols = uint_sqrt(surface);
+
+ if (target_cols < max_cols)
+ target_cols = max_cols;
+
+ target_cols = target_cols + target_cols/10; /* Allow 10% extra on columns */
+ dbg(lvl_debug, "square_shape_str(): analyzing input text=\"%s\". max_rows=%u, max_cols=%u, surface=%u, target_cols=%u",
+ s, max_rows, max_cols, max_rows * 2 * max_cols, target_cols);
+
+ cur_cols = 0;
+ last_break = NULL;
+ for (c=s; *c!='\0'; c++) {
+ if (*c==' ') {
+ if (cur_cols>=target_cols) { /* This line is too long, break at the previous non alnum character */
+ if (last_break) {
+ *last_break =
+ '\n'; /* Replace the previous non alnum character with a line break, this creates a new line and prevents the previous line from being too long */
+ cur_cols = c-last_break;
+ }
+ }
+ last_break = c; /* Record this position as a candidate to insert a line break */
+ }
+ cur_cols++;
+ }
+ if (cur_cols>=target_cols && last_break) {
+ *last_break =
+ '\n'; /* Replace the previous non alnum character with a line break, this creates a new line and prevents the previous line from being too long */
+ }
+
+ dbg(lvl_debug, "square_shape_str(): output text=\"%s\"", s);
+}
+
#if defined(_MSC_VER) || (!defined(HAVE_GETTIMEOFDAY) && defined(HAVE_API_WIN32_BASE))
/**
* Impements a simple incomplete version of gettimeofday. Only usefull for messuring
diff --git a/navit/util.h b/navit/util.h
index 131173ff6..685adc080 100644
--- a/navit/util.h
+++ b/navit/util.h
@@ -41,6 +41,9 @@ wchar_t* newSysString(const char *toconvert);
char * newSysString(const char *toconvert);
#endif
#endif
+
+void square_shape_str(char *s);
+
unsigned int iso8601_to_secs(char *iso8601);
time_t mkgmtime(struct tm * pt);
time_t iso8601_to_time(char * iso8601);
diff --git a/navit/vehicle/android/vehicle_android.c b/navit/vehicle/android/vehicle_android.c
index 4d3137bd8..f6173e1b3 100644
--- a/navit/vehicle/android/vehicle_android.c
+++ b/navit/vehicle/android/vehicle_android.c
@@ -238,8 +238,8 @@ static int vehicle_android_init(struct vehicle_priv *ret) {
dbg(lvl_error,"no method found");
return 0; /* exception thrown */
}
- dbg(lvl_debug, "at 4 android_activity=%p", android_activity);
- ret->NavitVehicle=(*jnienv)->NewObject(jnienv, ret->NavitVehicleClass, cid, android_activity,
+ dbg(lvl_debug, "at 4 android_application=%p", android_application);
+ ret->NavitVehicle=(*jnienv)->NewObject(jnienv, ret->NavitVehicleClass, cid, android_application,
(int) ret->pcb, (int) ret->scb, (int) ret->fcb);
dbg(lvl_debug,"result=%p",ret->NavitVehicle);
if (!ret->NavitVehicle)
diff --git a/navit/vehicle/gpsd/vehicle_gpsd.c b/navit/vehicle/gpsd/vehicle_gpsd.c
index 95324f324..99a4b4ffc 100644
--- a/navit/vehicle/gpsd/vehicle_gpsd.c
+++ b/navit/vehicle/gpsd/vehicle_gpsd.c
@@ -325,7 +325,11 @@ static void vehicle_gpsd_io(struct vehicle_priv *priv) {
int read_result;
/* Read until EOF, in case we are lagging behind.
* No point in processing old GPS reports. */
+#if GPSD_API_MAJOR_VERSION >= 7
+ while((read_result=gps_read(priv->gps, NULL, 0))>0);
+#else
while((read_result=gps_read(priv->gps))>0);
+#endif
if(read_result==-1) {
dbg(lvl_error,"gps_poll failed");
vehicle_gpsd_close(priv);
diff --git a/navit/vehicle/qt5/vehicle_qt5.cpp b/navit/vehicle/qt5/vehicle_qt5.cpp
index b855d12b9..9c613ca54 100644
--- a/navit/vehicle/qt5/vehicle_qt5.cpp
+++ b/navit/vehicle/qt5/vehicle_qt5.cpp
@@ -38,7 +38,7 @@ extern "C" {
#include <time.h>
#include "vehicle_qt5.h"
-#include "vehicle_qt5.moc"
+//#include "vehicle_qt5.moc"
#include <QDateTime>
/**
diff --git a/navit/version.h.in b/navit/version.h.in
deleted file mode 100644
index 3c39d0e1f..000000000
--- a/navit/version.h.in
+++ /dev/null
@@ -1,2 +0,0 @@
-#cmakedefine GIT_VERSION "@GIT_VERSION@"
-#cmakedefine NAVIT_VARIANT "@NAVIT_VARIANT@"
diff --git a/navit/xslt/openmoko.xslt b/navit/xslt/openmoko.xslt
index 2de3c0aab..dae507c90 100644
--- a/navit/xslt/openmoko.xslt
+++ b/navit/xslt/openmoko.xslt
@@ -1,7 +1,13 @@
<?xml version="1.0"?>
<xsl:transform version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xsl:param name="OSD_SIZE" select="2"/>
+ <xsl:param name="ICON_SMALL" select="48"/>
+ <xsl:param name="ICON_MEDIUM" select="48"/>
+ <xsl:param name="ICON_BIG" select="96"/>
+ <xsl:param name="OSD_USE_OVERLAY">yes</xsl:param>
+
<xsl:output method="xml" doctype-system="navit.dtd" cdata-section-elements="gui"/>
<xsl:include href="navit_drag_bitmap.xslt"/>
- <xsl:include href="osd_enable_zoom.xslt"/>
+ <xsl:include href="osd_minimum.xslt"/>
<xsl:template match="@*|node()"><xsl:copy><xsl:apply-templates select="@*|node()"/></xsl:copy></xsl:template>
</xsl:transform>
diff --git a/navit/xslt/osd_android.xslt b/navit/xslt/osd_android.xslt
index a15d4f34d..96dce2449 100644
--- a/navit/xslt/osd_android.xslt
+++ b/navit/xslt/osd_android.xslt
@@ -3,6 +3,6 @@
<xsl:template match="/config/navit/osd[last()]">
<xsl:copy><xsl:copy-of select="@*|node()"/></xsl:copy>
<xsl:text>&#x0A; </xsl:text>
- <osd type="button" src="gui_android_menu_{number($ICON_BIG)}_{number($ICON_BIG)}.png" command="graphics.menu()" x="{round(-60*number($OSD_SIZE))}" y="{round(48*number($OSD_SIZE))}" enable_expression="!has_menu_button" use_overlay="yes"/>
+ <osd type="button" src="gui_android_menu" command="graphics.menu()" x="{round(-(number($ICON_BIG)+8*number($OSD_SIZE)))}" y="{round(62*number($OSD_SIZE))}" w="{round(number($ICON_MEDIUM))}" h="{round(number($ICON_MEDIUM))}" enable_expression="!has_menu_button" use_overlay="yes"/>
</xsl:template>
</xsl:transform>
diff --git a/navit/xslt/osd_minimum.xslt b/navit/xslt/osd_minimum.xslt
index fc4e1f593..b0e310aae 100644
--- a/navit/xslt/osd_minimum.xslt
+++ b/navit/xslt/osd_minimum.xslt
@@ -5,27 +5,35 @@
<xsl:param name="NEXT_TURN_TEXT_HIGHT"><xsl:value-of select="round(20*number($OSD_SIZE))"/></xsl:param>
<xsl:param name="OSD_USE_OVERLAY"><xsl:value-of select="$OSD_USE_OVERLAY='yes' or $OSD_USE_OVERLAY='true' or $OSD_USE_OVERLAY='1'"/></xsl:param>
- <osd type="compass" enabled="yes" x="{round(-60*number($OSD_SIZE))}" y="{round(-80*number($OSD_SIZE))}" w="{round(60*number($OSD_SIZE))}" h="{round(80*number($OSD_SIZE))}" font_size="{round(200*number($OSD_SIZE))}" enable_expression="vehicle.position_valid"/>
+ <osd type="text" label="${{navigation.item[1].name}}" x="0" y="0" w="100%" h="{round(14*number($OSD_SIZE))}" font_size="{round(200*number($OSD_SIZE))}" enable_expression="navigation.nav_status&gt;=3"/>
<xsl:text>&#x0A; </xsl:text>
- <osd type="text" label="${{navigation.item.destination_length[named]}}\n${{navigation.item.destination_time[arrival]}}" x="{round(-60*number($OSD_SIZE))}" y="0" w="{round(60*number($OSD_SIZE))}" h="{round(40*number($OSD_SIZE))}" font_size="{round(200*number($OSD_SIZE))}" enable_expression="navigation.nav_status>=3"/>
+ <osd type="compass" enabled="yes" x="{round(-60*number($OSD_SIZE))}" y="{round(-94*number($OSD_SIZE))}" w="{round(60*number($OSD_SIZE))}" h="{round(80*number($OSD_SIZE))}" font_size="{round(200*number($OSD_SIZE))}" enable_expression="vehicle.position_valid"/>
<xsl:text>&#x0A; </xsl:text>
- <osd type="navigation_status" x="0" y="{-($NEXT_TURN_SIZE+$NEXT_TURN_TEXT_HIGHT)}" w="{$NEXT_TURN_SIZE+$NEXT_TURN_TEXT_HIGHT}" h="{$NEXT_TURN_SIZE+$NEXT_TURN_TEXT_HIGHT}" icon_src="%s_wh_{$ICON_BIG}_{$ICON_BIG}.png" enable_expression="navigation.nav_status==-1 || navigation.nav_status==1 || navigation.nav_status==2"/>
+ <osd type="text" label="${{navigation.item.destination_length[named]}}\n${{navigation.item.destination_time[arrival]}}" x="{round(-60*number($OSD_SIZE))}" y="{round(14*number($OSD_SIZE))}" w="{round(60*number($OSD_SIZE))}" h="{round(40*number($OSD_SIZE))}" font_size="{round(200*number($OSD_SIZE))}" enable_expression="navigation.nav_status>=3"/>
<xsl:text>&#x0A; </xsl:text>
- <osd type="navigation_next_turn" x="0" y="{-($NEXT_TURN_SIZE+$NEXT_TURN_TEXT_HIGHT)}" w="{$NEXT_TURN_SIZE+$NEXT_TURN_TEXT_HIGHT}" h="{$NEXT_TURN_SIZE}" icon_src="%s_wh_{$ICON_BIG}_{$ICON_BIG}.png" enable_expression="navigation.nav_status>=3"/>
+ <osd type="navigation_status" x="0" y="0" w="{$NEXT_TURN_SIZE}" h="{$NEXT_TURN_SIZE}" icon_w="{round(number($ICON_BIG))}" icon_h="{round(number($ICON_BIG))}" icon_src="%s_wh" enable_expression="navigation.nav_status==-1 || navigation.nav_status==1 || navigation.nav_status==2"/>
<xsl:text>&#x0A; </xsl:text>
- <osd type="text" label="${{navigation.item[1].length[named]}}" x="0" y="{-$NEXT_TURN_TEXT_HIGHT}" w="{$NEXT_TURN_SIZE+$NEXT_TURN_TEXT_HIGHT}" h="{$NEXT_TURN_TEXT_HIGHT}" font_size="{round(200*number($OSD_SIZE))}" enable_expression="navigation.nav_status>=3"/>
+ <osd type="navigation_next_turn" x="0" y="{round(14*number($OSD_SIZE))}" w="{$NEXT_TURN_SIZE}" h="{$NEXT_TURN_SIZE}" icon_w="{round(number($ICON_BIG))}" icon_h="{round(number($ICON_BIG))}" icon_src="%s_wh" enable_expression="navigation.nav_status>=3"/>
<xsl:text>&#x0A; </xsl:text>
- <osd type="button" src="gui_zoom_manual_{number($ICON_BIG)}_{number($ICON_BIG)}.png" command="autozoom_active=0" x="0" y="0" osd_configuration="1" use_overlay="{$OSD_USE_OVERLAY}" enable_expression="autozoom_active!=0"/>
+ <osd type="text" label="${{navigation.item[1].length[value]}}" x="0" y="{round(14*number($OSD_SIZE))+$NEXT_TURN_SIZE}" w="{$NEXT_TURN_SIZE}" h="{$NEXT_TURN_TEXT_HIGHT}" font_size="{round(260*number($OSD_SIZE))}" enable_expression="navigation.nav_status>=3"/>
<xsl:text>&#x0A; </xsl:text>
- <osd type="button" src="gui_zoom_auto_{number($ICON_BIG)}_{number($ICON_BIG)}.png" command="autozoom_active=1" x="0" y="0" osd_configuration="1" use_overlay="{$OSD_USE_OVERLAY}" enable_expression="autozoom_active==0"/>
+ <osd type="text" label="${{navigation.item[1].length[unit]}}" x="0" y="{round(14*number($OSD_SIZE))+$NEXT_TURN_SIZE+$NEXT_TURN_TEXT_HIGHT}" w="{$NEXT_TURN_SIZE}" h="{$NEXT_TURN_TEXT_HIGHT}" font_size="{round(200*number($OSD_SIZE))}" enable_expression="navigation.nav_status>=3"/>
<xsl:text>&#x0A; </xsl:text>
- <osd type="button" src="gui_zoom_in_{number($ICON_BIG)}_{number($ICON_BIG)}.png" command="zoom_in()" x="0" y="{round(number($ICON_BIG)+8*number($OSD_SIZE))}" osd_configuration="1" use_overlay="{$OSD_USE_OVERLAY}"/>
+ <osd type="text" label="${{tracking.item.street_name}} ${{tracking.item.street_name_systematic}}" x="0" y="{round(-14*number($OSD_SIZE))}" w="100%" h="{round(14*number($OSD_SIZE))}" font_size="{round(200*number($OSD_SIZE))}" enable_expression="vehicle.position_valid"/>
<xsl:text>&#x0A; </xsl:text>
- <osd type="button" src="gui_zoom_out_{number($ICON_BIG)}_{number($ICON_BIG)}.png" command="zoom_out()" x="0" y="{round(2*(number($ICON_BIG)+8*number($OSD_SIZE)))}" osd_configuration="1" use_overlay="{$OSD_USE_OVERLAY}"/>
+ <osd type="toggle_announcer" icon_src="%s" x="{round(-(number($ICON_MEDIUM)+8*number($OSD_SIZE)))}" y="{round(-(number($ICON_MEDIUM)+8*number($OSD_SIZE))-94*number($OSD_SIZE))}" w="{round(number($ICON_MEDIUM))}" h="{round(number($ICON_MEDIUM))}"/>
<xsl:text>&#x0A; </xsl:text>
- <osd type="cmd_interface" update_period="1" command="pitch=autozoom_active==0?pitch:(follow>1?0:20);orientation=autozoom_active==0?orientation:(follow>1?0:-1)" x="-1" y="-1" w="1" h="1"/>
+ <osd type="button" src="zoom_manual" command="autozoom_active=0" x="{round(8*number($OSD_SIZE))}" y="{-round(number($ICON_MEDIUM)+22*number($OSD_SIZE))}" w="{round(number($ICON_MEDIUM))}" h="{round(number($ICON_MEDIUM))}" osd_configuration="1" use_overlay="{$OSD_USE_OVERLAY}" enable_expression="autozoom_active!=0"/>
+ <xsl:text>&#x0A; </xsl:text>
+ <osd type="button" src="zoom_auto" command="autozoom_active=1" x="{round(8*number($OSD_SIZE))}" y="{-round(number($ICON_MEDIUM)+22*number($OSD_SIZE))}" w="{round(number($ICON_MEDIUM))}" h="{round(number($ICON_MEDIUM))}" osd_configuration="1" use_overlay="{$OSD_USE_OVERLAY}" enable_expression="autozoom_active==0"/>
+ <xsl:text>&#x0A; </xsl:text>
+ <osd type="button" src="zoom_in" command="zoom_in()" x="{round((number($ICON_MEDIUM)+8*number($OSD_SIZE))+8*number($OSD_SIZE))}" y="{-round(number($ICON_MEDIUM)+22*number($OSD_SIZE))}" w="{round(number($ICON_MEDIUM))}" h="{round(number($ICON_MEDIUM))}" osd_configuration="1" use_overlay="{$OSD_USE_OVERLAY}"/>
<xsl:text>&#x0A; </xsl:text>
- <osd type="button" src="cursor_{number($ICON_BIG)}_{number($ICON_BIG)}.png" command="follow=0;set_center_cursor()" x="{round(number($ICON_BIG)+8*number($OSD_SIZE))}" y="0" enable_expression="follow>1" use_overlay="{$OSD_USE_OVERLAY}"/>
+ <osd type="button" src="zoom_out" command="zoom_out()" x="{round(2*(number($ICON_MEDIUM)+8*number($OSD_SIZE))+8*number($OSD_SIZE))}" y="{-round(number($ICON_MEDIUM)+22*number($OSD_SIZE))}" w="{round(number($ICON_MEDIUM))}" h="{round(number($ICON_MEDIUM))}" osd_configuration="1" use_overlay="{$OSD_USE_OVERLAY}"/>
+ <xsl:text>&#x0A; </xsl:text>
+ <osd type="button" src="follow" command="follow=0;set_center_cursor()" x="{round(8*number($OSD_SIZE))}" y="{round(-2*(number($ICON_MEDIUM)+8*number($OSD_SIZE))-14*number($OSD_SIZE))}" w="{round(number($ICON_MEDIUM))}" h="{round(number($ICON_MEDIUM))}" enable_expression="follow>1" use_overlay="{$OSD_USE_OVERLAY}"/>
+ <xsl:text>&#x0A; </xsl:text>
+ <osd type="cmd_interface" update_period="1" command="pitch=autozoom_active==0?pitch:(follow>1?0:20);orientation=autozoom_active==0?orientation:(follow>1?0:-1)" x="-1" y="-1" w="1" h="1"/>
<xsl:text>&#x0A; </xsl:text>
<xsl:copy><xsl:copy-of select="@*|node()"/></xsl:copy>
</xsl:template>
diff --git a/navit/xslt/sailfish_osd.xslt b/navit/xslt/sailfish_osd.xslt
index ca9925a49..fc2244d97 100644
--- a/navit/xslt/sailfish_osd.xslt
+++ b/navit/xslt/sailfish_osd.xslt
@@ -2,8 +2,14 @@
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xsl:param name="OSD_SIZE" select="2"/>
+ <xsl:param name="ICON_SMALL" select="32"/>
+ <xsl:param name="ICON_MEDIUM" select="64"/>
+ <xsl:param name="ICON_BIG" select="96"/>
+ <xsl:param name="OSD_USE_OVERLAY">yes</xsl:param>
<xsl:output method="xml" indent="yes" cdata-section-elements="gui" doctype-system="navit.dtd"/>
+ <xsl:include href="osd_minimum.xslt"/>
<!-- Default rule: copy all -->
<xsl:template match="node()|@*">
@@ -12,27 +18,4 @@
</xsl:copy>
</xsl:template>
- <xsl:template match="/config/navit/osd[1]">
- <osd enabled="yes" type="gps_status" x="0" y="0" w="50" h="50"/>
- <xsl:text>&#x0A; </xsl:text>
- <osd enabled="no" type="text" label="${{vehicle.position_sats_used}}/${{vehicle.position_qual}}" x="0" y="0" w="50" h="50" background_color="#00000058" font_size="400"/>
- <xsl:text>&#x0A; </xsl:text>
- <osd enabled="yes" type="text" label="${{vehicle.position_speed}}" x="50" y="0" w="150" h="50" background_color="#00000058" font_size="400"/>
- <xsl:text>&#x0A; </xsl:text>
- <osd enabled="yes" type="text" label="${{navigation.item.destination_length[named]}}" x="200" y="0" w="240" h="50" background_color="#00000058" font_size="400"/>
- <xsl:text>&#x0A; </xsl:text>
- <osd enabled="yes" type="navigation_next_turn" x="-100" y="0" w="100" h="100" icon_w="90" icon_h="80" background_color="#00000058"/>
- <xsl:text>&#x0A; </xsl:text>
- <osd enabled="yes" type="button" x="-96" y="-96" w="96" h="96" command="zoom_in()" src="zoom_in" use_overlay="true"/>
- <xsl:text>&#x0A; </xsl:text>
- <osd enabled="yes" type="text" label="${{navigation.item[1].length[named]}}" x="-100" y="100" w="100" h="50" background_color="#00000058" font_size="400"/>
- <xsl:text>&#x0A; </xsl:text>
- <osd enabled="yes" type="button" x="0" y="-96" w="96" h="96" command="zoom_out()" src="zoom_out" use_overlay="true"/>
- <xsl:text>&#x0A; </xsl:text>
- <xsl:copy>
- <xsl:apply-templates select="@*"/>
- <xsl:apply-templates select="node()"/>
- </xsl:copy>
- </xsl:template>
-
</xsl:stylesheet>
diff --git a/navit/xslt/tomtom.xslt b/navit/xslt/tomtom.xslt
index fd8031ea2..dac69f3d3 100644
--- a/navit/xslt/tomtom.xslt
+++ b/navit/xslt/tomtom.xslt
@@ -1,7 +1,13 @@
<?xml version="1.0"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xi="http://www.w3.org/2001/XInclude" version="1.0">
+ <xsl:param name="OSD_SIZE" select="1"/>
+ <xsl:param name="ICON_SMALL" select="24"/>
+ <xsl:param name="ICON_MEDIUM" select="24"/>
+ <xsl:param name="ICON_BIG" select="48"/>
+ <xsl:param name="OSD_USE_OVERLAY">yes</xsl:param>
<xsl:output method="xml" indent="yes" cdata-section-elements="gui" doctype-system="navit.dtd"/>
+ <xsl:include href="osd_minimum.xslt"/>
<xsl:template match="/">
<xsl:apply-templates select="config"/>
@@ -22,17 +28,6 @@
<xsl:attribute name="recent_dest">25</xsl:attribute>
<graphics type="sdl" w="480" h="272" bpp="16" frame="0" flags="1"/>
<xsl:copy-of select="gui[@type='internal']"/>
- <osd enabled="yes" type="text" x="80" y="0" w="320" h="40" font_size="360" align="0" label="${{tracking.item.street_name}} ${{tracking.item.street_name_systematic}}" background_color="#00008080"/>
- <osd enabled="yes" type="text" x="80" y="232" w="80" h="40" font_size="360" align="0" label="${{navigation.item[1].length[named]}}" background_color="#00008080"/>
- <osd enabled="yes" type="text" x="160" y="232" w="240" h="40" font_size="360" align="0" label="${{vehicle.position_speed}} / ${{tracking.item.route_speed}}" background_color="#00008080"/>
- <osd enabled="yes" type="text" x="400" y="232" w="80" h="40" font_size="360" align="0" label="${{navigation.item.destination_length[named]}}" background_color="#00008080"/>
- <osd enabled="yes" type="text" x="400" y="192" w="80" h="40" font_size="360" align="0" label="${{navigation.item.destination_time[arrival]}}" background_color="#00008080"/>
- <osd enabled="yes" type="compass" x="400" y="80" w="80" h="112" background_color="#00008080" font_size="300"/>
- <osd enabled="yes" type="gps_status" x="0" y="80" w="80" h="40" background_color="#00008080"/>
- <osd enabled="yes" type="speed_warner" x="0" y="120" w="80" h="72" background_color="#00008080" font_size="300"/>
- <osd enabled="yes" type="navigation_next_turn" x="0" y="192" w="80" h="80" icon_w="48" icon_h="48" icon_src="%s_wh_48_48.png" background_color="#00008080"/>
- <osd enabled="yes" type="button" x="400" y="0" command="zoom_in()" src="tomtom_plus_80_80.png"/>
- <osd enabled="yes" type="button" x="0" y="0" command="zoom_out()" src="tomtom_minus_80_80.png"/>
<vehicle name="Local GPS" profilename="car" enabled="yes" active="yes" follow="1" source="file:/var/run/gpspipe">
<!-- Navit can write a tracklog in several formats (gpx, nmea or textfile): -->
<log enabled="no" type="gpx" attr_types="position_time_iso8601,position_direction,position_speed,position_radius" data="/mnt/sdcard/navit/track_%Y%m%d-%%i.gpx" flush_size="1000" flush_time="30"/>
diff --git a/navit/xslt/wince.xslt b/navit/xslt/wince.xslt
index 1b0c0d230..c5f75bf0d 100644
--- a/navit/xslt/wince.xslt
+++ b/navit/xslt/wince.xslt
@@ -1,6 +1,13 @@
<?xml version="1.0"?>
<xsl:transform version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xi="http://www.w3.org/2001/XInclude">
+ <xsl:param name="OSD_SIZE" select="1"/>
+ <xsl:param name="ICON_SMALL" select="24"/>
+ <xsl:param name="ICON_MEDIUM" select="24"/>
+ <xsl:param name="ICON_BIG" select="48"/>
+ <xsl:param name="OSD_USE_OVERLAY">yes</xsl:param>
+
<xsl:output method="xml" doctype-system="navit.dtd" cdata-section-elements="gui"/>
+ <xsl:include href="osd_minimum.xslt"/>
<xsl:template match="/config/navit/vehicle[@enabled='yes']">
<xsl:copy>
<xsl:copy-of select="@*[name() != 'gpsd_query']"/>
diff --git a/navit/zipfile.h b/navit/zipfile.h
index 9edccf2ef..8002e48d9 100644
--- a/navit/zipfile.h
+++ b/navit/zipfile.h
@@ -167,6 +167,10 @@ struct zip64_eocl {
int zip74lnum;
} ATTRIBUTE_PACKED;
+struct zip_alignment_check {
+ int x[sizeof(struct zip_cd) == 46 ? 1:-1];
+};
+
#ifdef HAVE_PRAGMA_PACK
#pragma pack(pop)
#endif
diff --git a/scripts/build_android.sh b/scripts/build_android.sh
index 8a4ea41a1..4b915f35e 100755
--- a/scripts/build_android.sh
+++ b/scripts/build_android.sh
@@ -18,7 +18,7 @@
echo Set up environment
set - e
-export PATH=$PATH:$ANDROID_HOME/tools
+export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin
export JVM_OPTS="-Xmx3200m"
export GRADLE_OPTS='-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"'
diff --git a/scripts/build_android_arm.sh b/scripts/build_android_arm.sh
deleted file mode 100755
index eaae87729..000000000
--- a/scripts/build_android_arm.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-# Build Navit for Android.
-#
-# This script is to be run from the root of the Navit source tree.
-#
-# It is intended for compatibility and will simply run build_android.sh.
-#
-# When writing or maintaining code, do not call this script but call build_android.sh directly, as this
-# script will eventually be removed.
-
-echo WARNING: This script is deprecated, use build_android.sh instead!
-
-./scripts/build_android.sh
diff --git a/scripts/build_win32.sh b/scripts/build_win32.sh
index 993c0273f..ce0ec0c07 100644
--- a/scripts/build_win32.sh
+++ b/scripts/build_win32.sh
@@ -1,17 +1,18 @@
#!/usr/bin/env bash
set -e
-
apt-get update && apt-get install -y mingw-w64 mingw-w64-tools \
default-jdk nsis libsaxonb-java curl
mkdir win32
pushd win32
-cmake -Dbinding/python:BOOL=FALSE -DSAMPLE_MAP=n -DBUILD_MAPTOOL=n \
- -DXSLTS=windows -DCMAKE_TOOLCHAIN_FILE=../Toolchain/mingw32.cmake ..
+cmake -DTARGET_ARCH=i686-w64-mingw32 -DCMAKE_SYSTEM_NAME=Windows \
+ -Dbinding/python:BOOL=FALSE -DSAMPLE_MAP=n -DBUILD_MAPTOOL=n \
+ -DXSLTS=windows -DCMAKE_TOOLCHAIN_FILE=../Toolchain/mingw.cmake ..
+
make -j $(nproc --all)
make -j $(nproc --all) package
popd
-cp win32/*.exe $CIRCLE_ARTIFACTS/
+cp win32/*.exe $CIRCLE_ARTIFACTS/ \ No newline at end of file
diff --git a/scripts/build_wince.sh b/scripts/build_wince.sh
index 20eb5036e..bd8f6feb1 100644
--- a/scripts/build_wince.sh
+++ b/scripts/build_wince.sh
@@ -1,9 +1,15 @@
-#!/bin/sh
+#!/usr/bin/env bash
set -e
-mkdir -p wince && cd wince
-cmake ../ -DCMAKE_TOOLCHAIN_FILE=Toolchain/arm-mingw32ce.cmake -DXSLTS=windows,wince -DCACHE_SIZE=10485760 -Dsvg2png_scaling:STRING=16,32 -Dsvg2png_scaling_nav:STRING=32 -Dsvg2png_scaling_flag=16 -DSAMPLE_MAP=n
-make
+mkdir -p wince
+pushd wince
+#
+cmake \
+ -DTARGET_ARCH=arm-mingw32ce -DCMAKE_SYSTEM_NAME=WindowsCETest \
+ -DCMAKE_TOOLCHAIN_FILE=../Toolchain/mingw.cmake \
+ -DXSLTS=windows,wince -DCACHE_SIZE=10485760 -Dsvg2png_scaling:STRING=16,32 \
+ -Dsvg2png_scaling_nav:STRING=32 -Dsvg2png_scaling_flag=16 -DSAMPLE_MAP=n ..
+make VERBOSE=1
test -d output && rm -rf output
mkdir output