[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout.spec
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -3,7 +3,7 @@
<service name="tar_git">
<param name="url">https://github.com/Karry/osmscout-sailfish.git</param>
<param name="branch">master</param>
- <param name="revision">v2.31</param>
+ <param name="revision">v2.32</param>
<param name="debian">N</param>
<param name="dumb">N</param>
</service>
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.31.tar.bz2/dependencies/libosmscout/.github/workflows/build_on_ubuntu_18_04_qt_android.yml
^
|
@@ -1,74 +0,0 @@
-name: Ubuntu 22.04 for Qt on Android
-
-# See https://doc.qt.io/qt-5/android-getting-started.html
-# See https://github.com/jurplel/install-qt-action
-# See https://github.com/miurahr/aqtinstall/
-
-on:
- pull_request:
- branches:
- - master
- push:
- branches:
- - master
- paths-ignore:
- - '.github/workflows/**'
-
-jobs:
- build:
- name: Ubuntu+android - Build
- runs-on: ubuntu-22.04
- steps:
- - name: Checkout
- uses: actions/checkout@v3
- - name: set up JDK 11
- uses: actions/setup-java@v3
- with:
- distribution: zulu
- java-version: 11
- - name: Setup Android SDK
- uses: android-actions/setup-android@v2
- - name: Run sdkmanager update
- run: ${ANDROID_HOME}/tools/bin/sdkmanager --update
- - name: Install android platform, platform-tools, build-tools and ndk
- run: ${ANDROID_HOME}/tools/bin/sdkmanager --install "platform-tools" "platforms;android-29" "build-tools;29.0.2" "ndk;23.1.7779620"
- - name: Cache Qt
- id: cache-qt
- uses: actions/cache@v1
- with:
- path: ../Qt
- key: ${{ runner.os }}-QtCache
- - name: Install Qt
- uses: jurplel/install-qt-action@v2
- with:
- version: '5.12.9'
- host: 'linux'
- target: 'android'
- arch: 'android_arm64_v8a'
- modules: android
- install-deps: 'true'
- cached: ${{ steps.cache-qt.outputs.cache-hit }}
- - name: Dump Qt installation data
- run: echo ${Qt5_DIR}
- - name: List Qt installation
- run: ls -l ../Qt/5.12.9/android_arm64_v8a/
- - name: Configure build project
- run: "cmake -B build
- -DCMAKE_TOOLCHAIN_FILE=${ANDROID_HOME}/ndk/23.1.7779620/build/cmake/android.toolchain.cmake
- -DANDROID_NDK=${ANDROID_HOME}/ndk/23.1.7779620/
- -DANDROID_ABI=arm64-v8a
- -DANDROID_PLATFORM=android-29
- -DANDROID_STL=c++_shared
- -DANDROID_LD=lld
- -DOSMSCOUT_BUILD_IMPORT=OFF
- -DOSMSCOUT_BUILD_GPX=ON
- -DOSMSCOUT_BUILD_DEMOS=OFF
- -DOSMSCOUT_BUILD_TOOL_DUMPDATA=OFF
- -DOSMSCOUT_BUILD_DOC_API=OFF
- -DOSMSCOUT_BUILD_WEBPAGE=OFF
- -DOSMSCOUT_BUILD_TESTS=OFF
- -DQt5_DIR=${Qt5_DIR}/lib/cmake/Qt5
- -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON
- -Wno-dev"
- - name: Build project
- run: cmake --build build
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.31.tar.bz2/dependencies/libosmscout/cmake/FindAgg.cmake
^
|
@@ -1,54 +0,0 @@
-# - Try to find libagg
-# Once done, this will define
-#
-# LIBAGG_FOUND - system has libagg
-# LIBAGG_INCLUDE_DIRS - the libagg include directories
-# LIBAGG_LIBRARIES - link these to use libagg
-# LIBAGGFT2_LIBRARIES - link these to connect agg and freetype
-#
-FIND_PACKAGE(PkgConfig)
-PKG_CHECK_MODULES(PC_LIBAGG QUIET LIBAGG)
-
-FIND_PATH(LIBAGG_INCLUDE_DIRS
- NAMES agg2/agg_basics.h
- HINTS ${PC_LIBAGG_INCLUDEDIR}
- ${PC_LIBAGG_INCLUDE_DIRS}
- $ENV{LIBAGG_HOME}/include
- $ENV{LIBAGG_ROOT}/include
- /usr/local/include
- /usr/include
- /libagg/include
- PATH_SUFFIXES agg agg2
-)
-
-FIND_LIBRARY(LIBAGG_LIBRARIES
- NAMES agg_pic libagg agg libagg-2.5 agg-2.5
- HINTS ${PC_LIBAGG_LIBDIR}
- ${PC_LIBAGG_LIBRARY_DIRS}
- $ENV{LIBAGG_HOME}/lib
- $ENV{LIBAGG_ROOT}/lib
- /usr/local/lib
- /usr/lib
- /lib
- /libagg/lib
- PATH_SUFFIXES agg agg2
-)
-
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBAGG DEFAULT_MSG LIBAGG_INCLUDE_DIRS LIBAGG_LIBRARIES)
-
-IF(LIBAGG_FOUND)
- PKG_CHECK_MODULES(PC_LIBAGGFT2 QUIET LIBAGGFT2)
- FIND_LIBRARY(LIBAGGFT2_LIBRARIES
- NAMES aggfontfreetype_pic aggfontfreetype libaggfontfreetype
- HINTS ${PC_LIBAGG_LIBDIR}
- ${PC_LIBAGG_LIBRARY_DIRS}
- $ENV{LIBAGG_HOME}/lib
- $ENV{LIBAGG_ROOT}/lib
- /usr/local/lib
- /usr/lib
- /lib
- /libagg/lib
- PATH_SUFFIXES agg agg2
- )
-ENDIF()
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.31.tar.bz2/dependencies/libosmscout/cmake/FindFontconfig.cmake
^
|
@@ -1,58 +0,0 @@
-# - try to find FONTCONFIG
-#
-# FONTCONFIG_FOUND - system has Cairo
-# FONTCONFIG_CFLAGS - the Cairo CFlags
-# FONTCONFIG_INCLUDE_DIRS - the Cairo include directories
-# FONTCONFIG_LIBRARIES - Link these to use Cairo
-#
-# Copyright (C) 2017 Tim Teulings
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-
-if(FONTCONFIG_INCLUDE_DIRS AND FONTCONFIG_LIBRARIES)
-
- # in cache already
- set(FONTCONFIG_FOUND TRUE)
-
-else(FONTCONFIG_INCLUDE_DIRS AND FONTCONFIG_LIBRARIES)
-
-if(NOT WIN32)
- # use pkg-config to get the directories and then use these values
- # in the FIND_PATH() and FIND_LIBRARY() calls
- find_package(PkgConfig REQUIRED)
- pkg_check_modules(_pc_fontconfig fontconfig)
- if(_pc_fontconfig_FOUND)
- set(FONTCONFIG_FOUND TRUE)
- endif(_pc_fontconfig_FOUND)
-else(NOT WIN32)
- # assume so, for now
- set(FONTCONFIG_FOUND TRUE)
-endif(NOT WIN32)
-
-if(FONTCONFIG_FOUND)
- # set it back as false
- set(FONTCONFIG_FOUND FALSE)
-
- find_library(FONTCONFIG_LIBRARY fontconfig
- HINTS ${_pc_fontconfig_LIBRARY_DIRS}
- )
- set(FONTCONFIG_LIBRARIES "${FONTCONFIG_LIBRARY}")
-
- find_path(FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h
- HINTS ${_pc_fontconfig_INCLUDE_DIRS}
- PATH_SUFFIXES fontconfig
- )
- set(FONTCONFIG_INCLUDE_DIRS "${FONTCONFIG_INCLUDE_DIR}")
-
- include(FindPackageHandleStandardArgs)
- find_package_handle_standard_args(Fontconfig DEFAULT_MSG FONTCONFIG_LIBRARIES FONTCONFIG_INCLUDE_DIRS)
-endif(FONTCONFIG_FOUND)
-
-endif(FONTCONFIG_INCLUDE_DIRS AND FONTCONFIG_LIBRARIES)
-
-mark_as_advanced(
- FONTCONFIG_CFLAGS
- FONTCONFIG_INCLUDE_DIRS
- FONTCONFIG_LIBRARIES
-)
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.31.tar.bz2/dependencies/libosmscout/cmake/FindGLFW.cmake
^
|
@@ -1,277 +0,0 @@
-#
-# Copyright 2013 Pixar
-#
-# Licensed under the Apache License, Version 2.0 (the "Apache License")
-# with the following modification; you may not use this file except in
-# compliance with the Apache License and the following modification to it:
-# Section 6. Trademarks. is deleted and replaced with:
-#
-# 6. Trademarks. This License does not grant permission to use the trade
-# names, trademarks, service marks, or product names of the Licensor
-# and its affiliates, except as required to comply with Section 4(c) of
-# the License and to reproduce the content of the NOTICE file.
-#
-# You may obtain a copy of the Apache License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the Apache License with the above modification is
-# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the Apache License for the specific
-# language governing permissions and limitations under the Apache License.
-#
-
-# Try to find GLFW library and include path.
-# Once done this will define
-#
-# GLFW_FOUND
-# GLFW_INCLUDE_DIR
-# GLFW_LIBRARIES
-#
-
-find_path( GLFW_INCLUDE_DIR
- NAMES
- GLFW/glfw3.h
- HINTS
- "${GLFW_LOCATION}/include"
- "$ENV{GLFW_LOCATION}/include"
- PATHS
- "$ENV{PROGRAMFILES}/GLFW/include"
- "${OPENGL_INCLUDE_DIR}"
- /usr/openwin/share/include
- /usr/openwin/include
- /usr/X11R6/include
- /usr/include/X11
- /opt/graphics/OpenGL/include
- /opt/graphics/OpenGL/contrib/libglfw
- /usr/local/include
- /usr/include/GL
- /usr/include
- DOC
- "The directory where GLFW/glfw3.h resides"
-)
-
-#
-# XXX: Do we still need to search for GL/glfw.h?
-#
-find_path( GLFW_INCLUDE_DIR
- NAMES
- GL/glfw.h
- HINTS
- "${GLFW_LOCATION}/include"
- "$ENV{GLFW_LOCATION}/include"
- PATHS
- "$ENV{PROGRAMFILES}/GLFW/include"
- "${OPENGL_INCLUDE_DIR}"
- /usr/openwin/share/include
- /usr/openwin/include
- /usr/X11R6/include
- /usr/include/X11
- /opt/graphics/OpenGL/include
- /opt/graphics/OpenGL/contrib/libglfw
- /usr/local/include
- /usr/include/GL
- /usr/include
- DOC
- "The directory where GL/glfw.h resides"
-)
-
-set (GLFW_DEPENDENCIES_FOUND "true")
-
-if (WIN32)
- if(CYGWIN)
- find_library( GLFW_glfw_LIBRARY
- NAMES
- glfw32
- HINTS
- "${GLFW_LOCATION}/lib"
- "${GLFW_LOCATION}/lib/x64"
- "$ENV{GLFW_LOCATION}/lib"
- PATHS
- "${OPENGL_LIBRARY_DIR}"
- /usr/lib
- /usr/lib/w32api
- /usr/local/lib
- /usr/X11R6/lib
- DOC
- "The GLFW library"
- )
- else()
- find_library( GLFW_glfw_LIBRARY
- NAMES
- glfw32
- glfw32s
- glfw
- glfw3
- HINTS
- "${GLFW_LOCATION}/lib"
- "${GLFW_LOCATION}/lib/x64"
- "${GLFW_LOCATION}/lib-msvc110"
- "${GLFW_LOCATION}/lib-vc2012"
- "$ENV{GLFW_LOCATION}/lib"
- "$ENV{GLFW_LOCATION}/lib/x64"
- "$ENV{GLFW_LOCATION}/lib-msvc110"
- "$ENV{GLFW_LOCATION}/lib-vc2012"
- PATHS
- "$ENV{PROGRAMFILES}/GLFW/lib"
- "${OPENGL_LIBRARY_DIR}"
- DOC
- "The GLFW library"
- )
- endif()
-else ()
- if (APPLE)
- find_library( GLFW_glfw_LIBRARY glfw
- NAMES
- glfw
- glfw3
- HINTS
- "${GLFW_LOCATION}/lib"
- "${GLFW_LOCATION}/lib/cocoa"
- "$ENV{GLFW_LOCATION}/lib"
- "$ENV{GLFW_LOCATION}/lib/cocoa"
- PATHS
- /usr/local/lib
- )
- set(GLFW_cocoa_LIBRARY "-framework Cocoa" CACHE STRING "Cocoa framework for OSX")
- set(GLFW_corevideo_LIBRARY "-framework CoreVideo" CACHE STRING "CoreVideo framework for OSX")
- set(GLFW_iokit_LIBRARY "-framework IOKit" CACHE STRING "IOKit framework for OSX")
- else ()
- # (*)NIX
-
- find_package(Threads QUIET)
-
- find_package(X11 QUIET)
-
- if(NOT Threads_FOUND)
- message(STATUS "Threads not found - required for GLFW")
- set (GLFW_DEPENDENCIES_FOUND false)
- endif()
-
- if(NOT X11_FOUND)
- message(STATUS "X11 library not found - required for GLFW")
- set (GLFW_DEPENDENCIES_FOUND false)
- endif()
-
- if(NOT X11_Xrandr_FOUND)
- message(STATUS "Xrandr library not found - required for GLFW")
- set (GLFW_DEPENDENCIES_FOUND false)
- endif()
-
- if(NOT X11_xf86vmode_FOUND)
- message(STATUS "xf86vmode library not found - required for GLFW")
- set (GLFW_DEPENDENCIES_FOUND false)
- endif()
-
- if(NOT X11_Xcursor_FOUND)
- message(STATUS "Xcursor library not found - required for GLFW")
- set (GLFW_DEPENDENCIES_FOUND false)
- endif()
-
- if(NOT X11_Xinerama_FOUND)
- message(STATUS "Xinerama library not found - required for GLFW")
- set (GLFW_DEPENDENCIES_FOUND false)
- endif()
-
- if(NOT X11_Xi_FOUND)
- message(STATUS "Xi library not found - required for GLFW")
- set (GLFW_DEPENDENCIES_FOUND false)
- endif()
-
- list(APPEND GLFW_x11_LIBRARY "${X11_Xrandr_LIB}" "${X11_Xxf86vm_LIB}" "${X11_Xcursor_LIB}" "${X11_Xinerama_LIB}" "${X11_Xi_LIB}" "${X11_LIBRARIES}" "${CMAKE_THREAD_LIBS_INIT}" -lrt -ldl)
-
- find_library( GLFW_glfw_LIBRARY
- NAMES
- glfw
- glfw3
- HINTS
- "${GLFW_LOCATION}/lib"
- "$ENV{GLFW_LOCATION}/lib"
- "${GLFW_LOCATION}/lib/x11"
- "$ENV{GLFW_LOCATION}/lib/x11"
- PATHS
- /usr/lib64
- /usr/lib
- /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
- /usr/local/lib64
- /usr/local/lib
- /usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.31.tar.bz2/dependencies/libosmscout/cmake/FindGLM.cmake
^
|
@@ -1,63 +0,0 @@
-# FindGLM - attempts to locate the glm matrix/vector library.
-#
-# This module defines the following variables (on success):
-# GLM_INCLUDE_DIRS - where to find glm/glm.hpp
-# GLM_FOUND - if the library was successfully located
-#
-# It is trying a few standard installation locations, but can be customized
-# with the following variables:
-# GLM_ROOT_DIR - root directory of a glm installation
-# Headers are expected to be found in either:
-# <GLM_ROOT_DIR>/glm/glm.hpp OR
-# <GLM_ROOT_DIR>/include/glm/glm.hpp
-# This variable can either be a cmake or environment
-# variable. Note however that changing the value
-# of the environment varible will NOT result in
-# re-running the header search and therefore NOT
-# adjust the variables set by this module.
-
-#=============================================================================
-# Copyright 2012 Carsten Neumann
-#
-# Distributed under the OSI-approved BSD License (the "License");
-# see accompanying file Copyright.txt for details.
-#
-# This software is distributed WITHOUT ANY WARRANTY; without even the
-# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-# See the License for more information.
-#=============================================================================
-# (To distribute this file outside of CMake, substitute the full
-# License text for the above reference.)
-
-# default search dirs
-SET(_glm_HEADER_SEARCH_DIRS
- "/usr/include"
- "/usr/local/include")
-
-# check environment variable
-SET(_glm_ENV_ROOT_DIR "$ENV{GLM_ROOT_DIR}")
-
-IF(NOT GLM_ROOT_DIR AND _glm_ENV_ROOT_DIR)
- SET(GLM_ROOT_DIR "${_glm_ENV_ROOT_DIR}")
-ENDIF(NOT GLM_ROOT_DIR AND _glm_ENV_ROOT_DIR)
-
-# put user specified location at beginning of search
-IF(GLM_ROOT_DIR)
- SET(_glm_HEADER_SEARCH_DIRS "${GLM_ROOT_DIR}"
- "${GLM_ROOT_DIR}/include"
- ${_glm_HEADER_SEARCH_DIRS})
-ENDIF(GLM_ROOT_DIR)
-
-# locate header
-FIND_PATH(GLM_INCLUDE_DIR "glm/glm.hpp"
- PATHS ${_glm_HEADER_SEARCH_DIRS})
-
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLM DEFAULT_MSG
- GLM_INCLUDE_DIR)
-
-IF(GLM_FOUND)
- SET(GLM_INCLUDE_DIRS "${GLM_INCLUDE_DIR}")
-
- MESSAGE(STATUS "GLM_INCLUDE_DIR = ${GLM_INCLUDE_DIR}")
-ENDIF(GLM_FOUND)
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.31.tar.bz2/dependencies/libosmscout/cmake/FindHarfBuzz.cmake
^
|
@@ -1,36 +0,0 @@
-# - Try to find HarfBuzz
-# Once done, this will define
-#
-# HARFBUZZ_FOUND - system has HARFBUZZ
-# HARFBUZZ_INCLUDE_DIRS - the HARFBUZZ include directories
-# HARFBUZZ_LIBRARIES - link these to use HARFBUZZ
-#
-FIND_PACKAGE(PkgConfig)
-PKG_CHECK_MODULES(PC_HARFBUZZ QUIET HARFBUZZ)
-
-FIND_PATH(HARFBUZZ_INCLUDE_DIRS
- NAMES hb.h
- HINTS ${PC_HARFBUZZ_INCLUDEDIR}
- ${PC_HARFBUZZ_INCLUDE_DIRS}
- $ENV{HARFBUZZ_HOME}/include
- $ENV{HARFBUZZ_ROOT}/include
- /usr/local/include
- /usr/include
- /harfbuzz/include
- PATH_SUFFIXES harfbuzz
- )
-
-FIND_LIBRARY(HARFBUZZ_LIBRARIES
- NAMES harfbuzz libmarisa
- HINTS ${PC_HARFBUZZ_LIBDIR}
- ${PC_HARFBUZZ_LIBRARY_DIRS}
- $ENV{HARFBUZZ_HOME}/lib
- $ENV{HARFBUZZ_ROOT}/lib
- /usr/local/lib
- /usr/lib
- /lib
- /harfbuzz/lib
- )
-
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(HARFBUZZ DEFAULT_MSG HARFBUZZ_INCLUDE_DIRS HARFBUZZ_LIBRARIES)
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.31.tar.bz2/dependencies/libosmscout/cmake/FindLibLZMA.cmake
^
|
@@ -1,22 +0,0 @@
-# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
-# file Copyright.txt or https://cmake.org/licensing for details.
-
-#.rst:
-# FindLibLZMA
-# -----------
-#
-# Find LibLZMA
-#
-# Find LibLZMA headers and library
-#
-# ::
-#
-# LIBLZMA_FOUND - True if liblzma is found.
-# LIBLZMA_INCLUDE_DIRS - Directory where liblzma headers are located.
-# LIBLZMA_LIBRARIES - Lzma libraries to link against.
-
-find_path(LIBLZMA_INCLUDE_DIRS lzma.h )
-find_library(LIBLZMA_LIBRARIES lzma)
-
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBLZMA DEFAULT_MSG LIBLZMA_INCLUDE_DIRS LIBLZMA_LIBRARIES)
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.31.tar.bz2/dependencies/libosmscout/cmake/Findiconv.cmake
^
|
@@ -1,71 +0,0 @@
-# - Try to find Iconv
-# Once done this will define
-#
-# ICONV_FOUND - system has Iconv
-# ICONV_INCLUDE_DIR - the Iconv include directory
-# ICONV_LIBRARIES - Link these to use Iconv
-# ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const
-#
-include(CheckCCompilerFlag)
-include(CheckCSourceCompiles)
-include(CheckCSourceRuns)
-include(CMakePushCheckState)
-
-#if (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
- # Already in cache, be silent
-# set(ICONV_FIND_QUIETLY TRUE)
-#endif ()
-
-if(APPLE)
- find_path(ICONV_INCLUDE_DIR iconv.h
- PATHS
- /opt/local/include/
- NO_CMAKE_SYSTEM_PATH
- )
-
- find_library(ICONV_LIBRARIES NAMES iconv libiconv c
- PATHS
- /opt/local/lib/
- NO_CMAKE_SYSTEM_PATH
- )
-endif()
-
-find_path(ICONV_INCLUDE_DIR iconv.h PATHS /opt/local/include /sw/include /usr/include /usr/local/include)
-
-string(REGEX REPLACE "(.*)/include/?" "\\1" ICONV_INCLUDE_BASE_DIR "${ICONV_INCLUDE_DIR}")
-
-find_library(ICONV_LIBRARIES NAMES libiconv iconv libiconv.lib libiconv.dylib)
-
-if(NOT ICONV_LIBRARIES AND UNIX)
- find_library(ICONV_LIBRARIES NAMES c libc)
-endif()
-
-if(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
- cmake_push_check_state(RESET)
- set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
- set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
- if(MSVC)
- set(CMAKE_REQUIRED_FLAGS /we4028 /fp:fast /wd4251 /Oi)
- endif()
- check_prototype_definition("iconv"
- "size_t iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)"
- "-1"
- "iconv.h"
- ICONV_SECOND_ARGUMENT_IS_CONST)
- cmake_pop_check_state()
-endif()
-
-include(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(ICONV DEFAULT_MSG ICONV_INCLUDE_DIR ICONV_LIBRARIES)
-
-# Copy the results to the output variables.
-if(ICONV_FOUND)
- set(ICONV_LIBRARY ${ICONV_LIBRARIES})
- set(ICONV_INCLUDE_DIRS ${ICONV_INCLUDE_DIR})
-endif()
-
-mark_as_advanced(
- ICONV_INCLUDE_DIR
- ICONV_LIBRARIES
- ICONV_SECOND_ARGUMENT_IS_CONST
-)
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.31.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/DBInstance.h
^
|
@@ -1,223 +0,0 @@
- #ifndef OSMSCOUT_CLIENT_QT_DBINSTANCE_H
-#define OSMSCOUT_CLIENT_QT_DBINSTANCE_H
-
-/*
- OSMScout - a Qt backend for libosmscout and libosmscout-map
- Copyright (C) 2017 Lukáš Karas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <osmscout/location/LocationService.h>
-#include <osmscout/location/LocationDescriptionService.h>
-
-#include <osmscout/db/Database.h>
-
-#include <osmscoutmap/MapService.h>
-#include <osmscoutmapqt/MapPainterQt.h>
-
-#include <osmscout/async/Breaker.h>
-
-#include <osmscoutclientqt/ClientQtImportExport.h>
-
-#include <QObject>
-#include <QMutex>
-#include <QDebug>
-#include <QMap>
-#include <QThread>
-#include <QElapsedTimer>
-#include <QMutexLocker>
-
-namespace osmscout {
-
-/**
- * \ingroup QtAPI
- */
-class OSMSCOUT_CLIENT_QT_API QBreaker : public osmscout::Breaker
-{
-private:
- mutable QMutex mutex;
- bool aborted;
-
-public:
- QBreaker();
-
- void Break() override;
- bool IsAborted() const override;
- void Reset() override;
-};
-
-/**
- * \ingroup QtAPI
- */
-class OSMSCOUT_CLIENT_QT_API StyleError
-{
- enum StyleErrorType {
- Symbol, Error, Warning, Exception
- };
-
-public:
- StyleError(StyleErrorType type, int line, int column, const QString &text) :
- type(type), line(line), column(column), text(text){}
- explicit StyleError(QString msg);
-
- StyleErrorType GetType() const { return type; }
- QString GetTypeName() const;
- int GetLine() const{ return line; }
- int GetColumn() const{ return column; }
- const QString &GetText() const { return text; }
- QString GetDescription() const {return GetTypeName()+": "+GetText();}
-
-private:
- StyleErrorType type;
- int line;
- int column;
- QString text;
-};
-
-
-/**
- * \ingroup QtAPI
- *
- * Instance of one osmscout db and db specific objects.
- *
- * It is thread safe
- */
-class OSMSCOUT_CLIENT_QT_API DBInstance : public QObject
-{
- Q_OBJECT
-
-public:
- const QString path;
-
-private:
- mutable QMutex mutex;
- QMap<QThread*,osmscout::MapPainterQt*> painterHolder; ///< thread-local cache of map painters, guarded by mutex
- QElapsedTimer lastUsage; ///< last time when db was used, guarded by mutex
-
- osmscout::GeoBox dbBox; ///< cached db GeoBox, may be accessed without lock and lastUsage update
- osmscout::DatabaseRef database;
-
- osmscout::LocationServiceRef locationService;
- osmscout::LocationDescriptionServiceRef locationDescriptionService;
- osmscout::MapServiceRef mapService;
-
- osmscout::StyleConfigRef styleConfig;
-
-public slots:
- void onThreadFinished();
-
-public:
- DBInstance(const QString &path,
- const osmscout::DatabaseRef& database,
- const osmscout::LocationServiceRef& locationService,
- const osmscout::LocationDescriptionServiceRef& locationDescriptionService,
- const osmscout::MapServiceRef& mapService,
- const osmscout::StyleConfigRef& styleConfig):
- path(path),
- database(database),
- locationService(locationService),
- locationDescriptionService(locationDescriptionService),
- mapService(mapService),
- styleConfig(styleConfig)
- {
- if (!database->GetBoundingBox(dbBox)){
- osmscout::log.Error() << "Failed to get db GeoBox: " << path.toStdString();
- }
- lastUsage.start();
- };
-
- ~DBInstance() override
- {
- close();
- };
-
- osmscout::GeoBox GetDBGeoBox() const
- {
- return dbBox;
- }
-
- /**
- * return true if db is open
- * lastUsage is not udpated
- */
- bool IsOpen() const
- {
- return database->IsOpen();
- }
-
- osmscout::DatabaseRef GetDatabase()
- {
- QMutexLocker locker(&mutex);
- lastUsage.restart();
- return database;
- }
-
- osmscout::MapServiceRef GetMapService()
- {
- QMutexLocker locker(&mutex);
- lastUsage.restart();
- return mapService;
- }
-
- osmscout::LocationDescriptionServiceRef GetLocationDescriptionService()
- {
- QMutexLocker locker(&mutex);
- lastUsage.restart();
- return locationDescriptionService;
- }
-
- osmscout::LocationServiceRef GetLocationService()
- {
- QMutexLocker locker(&mutex);
- lastUsage.restart();
- return locationService;
- }
-
- osmscout::StyleConfigRef GetStyleConfig() const
- {
- return styleConfig;
- }
-
- /**
- * Returns the number of milliseconds since last db usage
- */
- qint64 LastUsageMs() const
- {
- QMutexLocker locker(&mutex);
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.31.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/MapProvider.h
^
|
@@ -1,97 +0,0 @@
-#ifndef OSMSCOUT_CLIENT_QT_MAPPROVIDER_H
-#define OSMSCOUT_CLIENT_QT_MAPPROVIDER_H
-
-/*
- OSMScout - a Qt backend for libosmscout and libosmscout-map
- Copyright (C) 2016 Lukas Karas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <QObject>
-#include <QString>
-#include <QUrl>
-
-#include <QJsonDocument>
-#include <QJsonArray>
-#include <QJsonObject>
-
-#include <osmscoutclientqt/ClientQtImportExport.h>
-
-namespace osmscout {
-
-/**
- * \ingroup QtAPI
- */
-class OSMSCOUT_CLIENT_QT_API MapProvider: public QObject
-{
- Q_OBJECT
-
-private:
- bool valid=false;
- QString uri;
- QString listUri;
- QString name;
-
-public:
- MapProvider() = default;
-
- MapProvider(const MapProvider &o):
- QObject(o.parent()),
- valid(o.valid), uri(o.uri), listUri(o.listUri), name(o.name){};
-
- MapProvider(QString name, QString uri, QString listUri):
- valid(true), uri(uri), listUri(listUri), name(name) {}
-
- ~MapProvider() override = default;
-
- MapProvider& operator=(const MapProvider &o)
- {
- valid = o.valid;
- uri = o.uri;
- listUri = o.listUri;
- name = o.name;
-
- return *this;
- }
-
- QString getName() const
- {
- return name;
- }
-
- QString getUri() const
- {
- return uri;
- }
-
- QUrl getListUri(int fromVersion, int toVersion, QString locale="en") const
- {
- return listUri.arg(fromVersion).arg(toVersion).arg(locale);
- }
-
- bool isValid() const
- {
- return valid;
- }
-
- static MapProvider fromJson(QJsonValue obj);
-};
-
-}
-
-Q_DECLARE_METATYPE(osmscout::MapProvider)
-
-#endif // OSMSCOUT_CLIENT_QT_MAPPROVIDER_H
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.31.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/OnlineTileProvider.h
^
|
@@ -1,108 +0,0 @@
-#ifndef OSMSCOUT_CLIENT_QT_ONLINETILEPROVIDER_H
-#define OSMSCOUT_CLIENT_QT_ONLINETILEPROVIDER_H
-
-/*
- OSMScout - a Qt backend for libosmscout and libosmscout-map
- Copyright (C) 2016 Lukas Karas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <QObject>
-#include <QDebug>
-
-#include <QJsonDocument>
-#include <QJsonArray>
-#include <QJsonObject>
-
-#include <osmscoutclientqt/ClientQtImportExport.h>
-
-namespace osmscout {
-
-/**
- * \ingroup QtAPI
- *
- * Online tile provider object. See OnlineTileProviderModel and Settings.
- */
-class OSMSCOUT_CLIENT_QT_API OnlineTileProvider: public QObject
-{
- Q_OBJECT
-
-public:
- OnlineTileProvider() = default;
-
- OnlineTileProvider(const OnlineTileProvider &o):
- QObject(o.parent()),
- valid(o.valid), id(o.id), name(o.name), servers(o.servers),
- maximumZoomLevel(o.maximumZoomLevel), copyright(o.copyright){};
-
- OnlineTileProvider(const QString &id, const QString &name, const QStringList &servers, int maximumZoomLevel,
- QString copyright):
- valid(true), id(id), name(name), servers(servers), maximumZoomLevel(maximumZoomLevel),
- copyright(copyright){};
-
- ~OnlineTileProvider() override = default;
-
- OnlineTileProvider& operator=(const OnlineTileProvider &o)
- {
- valid = o.valid;
- id = o.id;
- name = o.name;
- servers = o.servers;
- maximumZoomLevel = o.maximumZoomLevel;
- copyright = o.copyright;
-
- return *this;
- }
-
- QString getId() const {
- return id;
- }
-
- int getMaximumZoomLevel() const {
- return maximumZoomLevel;
- }
-
- QString getName() const {
- return name;
- }
-
- QStringList getServers() const {
- return servers;
- }
-
- bool isValid() const {
- return valid;
- }
-
- QString getCopyright() const
- {
- return copyright;
- }
-
- static OnlineTileProvider fromJson(QJsonValue obj);
-
-private:
- bool valid{false};
- QString id;
- QString name;
- QStringList servers;
- int maximumZoomLevel{-1};
- QString copyright;
-};
-
-}
-
-#endif /* OSMSCOUT_CLIENT_QT_ONLINETILEPROVIDER_H */
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.31.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/Settings.h
^
|
@@ -1,265 +0,0 @@
-#ifndef OSMSCOUT_CLIENT_QT_SETTINGS_H
-#define OSMSCOUT_CLIENT_QT_SETTINGS_H
-
-/*
- OSMScout - a Qt backend for libosmscout and libosmscout-map
- Copyright (C) 2013 Tim Teulings
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <memory>
-
-#include <QSettings>
-#include <QStringList>
-
-#include <osmscout/routing/RoutingProfile.h>
-#include <osmscoutclientqt/InputHandler.h>
-#include <osmscoutclientqt/OnlineTileProvider.h>
-#include <osmscoutclientqt/MapProvider.h>
-#include <osmscoutclientqt/VoiceProvider.h>
-
-#include <osmscoutclientqt/ClientQtImportExport.h>
-
-// this variable should be defined by build system
-#ifndef LIBOSMSCOUT_VERSION_STRING
-#define LIBOSMSCOUT_VERSION_STRING "v?"
-#endif
-
-namespace osmscout {
-
-/**
- * \ingroup QtAPI
- *
- * Settings provides central point mutable configuration of OSMScout library.
- * It uses Qt's QSettings for persistency. It may be accessed from DBThread instance.
- *
- * List of online tile providers should be initialized at applicaiton start.
- * ```
- * Settings::GetInstance()->loadOnlineTileProviders(
- * ":/resources/online-tile-providers.json");
- * ```
- *
- * Before program exit, resources should be released by calling Settings::FreeInstance.
- */
-class OSMSCOUT_CLIENT_QT_API Settings: public QObject
-{
- Q_OBJECT
- Q_PROPERTY(double mapDPI READ GetMapDPI WRITE SetMapDPI NOTIFY MapDPIChange)
- Q_PROPERTY(bool onlineTiles READ GetOnlineTilesEnabled WRITE SetOnlineTilesEnabled NOTIFY OnlineTilesEnabledChanged)
- Q_PROPERTY(QString onlineTileProviderId READ GetOnlineTileProviderId WRITE SetOnlineTileProviderId NOTIFY OnlineTileProviderIdChanged)
- Q_PROPERTY(bool offlineMap READ GetOfflineMap WRITE SetOfflineMap NOTIFY OfflineMapChanged)
- Q_PROPERTY(bool renderSea READ GetRenderSea WRITE SetRenderSea NOTIFY RenderSeaChanged)
- Q_PROPERTY(QString styleSheetDirectory READ GetStyleSheetDirectory WRITE SetStyleSheetDirectory NOTIFY StyleSheetDirectoryChanged)
- Q_PROPERTY(QString styleSheetFile READ GetStyleSheetFile WRITE SetStyleSheetFile NOTIFY StyleSheetFileChanged)
- Q_PROPERTY(QString fontName READ GetFontName WRITE SetFontName NOTIFY FontNameChanged)
- Q_PROPERTY(double fontSize READ GetFontSize WRITE SetFontSize NOTIFY FontSizeChanged)
- Q_PROPERTY(bool showAltLanguage READ GetShowAltLanguage WRITE SetShowAltLanguage NOTIFY ShowAltLanguageChanged)
- /// metrics or imperial
- Q_PROPERTY(QString units READ GetUnits WRITE SetUnits NOTIFY UnitsChanged)
- Q_PROPERTY(QString voiceLookupDirectory READ GetVoiceLookupDirectory WRITE SetVoiceLookupDirectory NOTIFY VoiceLookupDirectoryChanged)
- Q_PROPERTY(QString voiceDir READ GetVoiceDir WRITE SetVoiceDir NOTIFY VoiceDirChanged)
-
-signals:
- void MapDPIChange(double dpi);
- void OnlineTilesEnabledChanged(bool);
- void OnlineTileProviderIdChanged(const QString id);
- void OnlineTileProviderChanged(const OnlineTileProvider &provider);
- void OfflineMapChanged(bool);
- void RenderSeaChanged(bool);
- void StyleSheetDirectoryChanged(const QString dir);
- void StyleSheetFileChanged(const QString file);
- void VoiceLookupDirectoryChanged(const QString dir);
- void VoiceDirChanged(const QString voice);
- void FontNameChanged(const QString fontName);
- void FontSizeChanged(double fontSize);
- void ShowAltLanguageChanged(bool showAltLanguage);
- void UnitsChanged(const QString units);
-
-private:
- QSettings *storage;
- double physicalDpi;
- QMap<QString, OnlineTileProvider> onlineProviderMap;
- QList<OnlineTileProvider> onlineProviders;
- QList<MapProvider> mapProviders;
- QList<VoiceProvider> voiceProviders;
-
-public:
- explicit Settings(QSettings *providedStorage=nullptr);
- ~Settings() override = default;
-
- double GetPhysicalDPI() const;
-
- void SetMapDPI(double dpi);
- double GetMapDPI() const;
-
- osmscout::Vehicle GetRoutingVehicle() const;
- void SetRoutingVehicle(const osmscout::Vehicle& vehicle);
-
- bool GetOnlineTilesEnabled() const;
- void SetOnlineTilesEnabled(bool b);
-
- const QList<OnlineTileProvider> GetOnlineProviders() const;
- const OnlineTileProvider GetOnlineTileProvider() const;
-
- const QList<MapProvider> GetMapProviders() const;
- const QList<VoiceProvider> GetVoiceProviders() const;
-
- const QString GetOnlineTileProviderId() const;
- void SetOnlineTileProviderId(QString id);
-
- bool loadOnlineTileProviders(const QStringList &paths);
- bool loadMapProviders(const QStringList &paths);
- bool loadVoiceProviders(const QStringList &paths);
-
- bool GetOfflineMap() const;
- void SetOfflineMap(bool);
-
- bool GetRenderSea() const;
- void SetRenderSea(bool);
-
- const QString GetStyleSheetDirectory() const;
- void SetStyleSheetDirectory(const QString dir);
-
- const QString GetVoiceLookupDirectory() const;
- void SetVoiceLookupDirectory(const QString &voiceLookupDirectory);
-
- const QString GetVoiceDir() const;
- void SetVoiceDir(const QString &voice);
-
- const QString GetStyleSheetFile() const;
- const QString GetStyleSheetAbsoluteFile() const;
- void SetStyleSheetFile(const QString file);
-
- const std::unordered_map<std::string,bool> GetStyleSheetFlags(const QString styleSheetFile);
- const std::unordered_map<std::string,bool> GetStyleSheetFlags();
- void SetStyleSheetFlags(const QString styleSheetFile, std::unordered_map<std::string,bool> flags);
- void SetStyleSheetFlags(std::unordered_map<std::string,bool> flags);
-
- QString GetFontName() const;
- void SetFontName(const QString fontName);
-
- double GetFontSize() const;
- void SetFontSize(double fontSize);
-
- bool GetShowAltLanguage() const;
- void SetShowAltLanguage(bool showAltLanguage);
-
- const QString GetHttpCacheDir() const;
-
- const QByteArray GetCookieData() const;
- void SetCookieData(QByteArray data);
-
- QString GetUnits() const;
- void SetUnits(const QString units);
-};
-
-/**
- * \ingroup QtAPI
- */
-using SettingsRef = std::shared_ptr<Settings>;
-
-/**
- * \ingroup QtAPI
- *
- * Provides interface to Settings object from QML. It should be registered
- * by qmlRegisterType before first use.
- *
- * ```
- * qmlRegisterType<QmlSettings>("net.sf.libosmscout.map", 1, 0, "Settings");
- * ```
- *
- * It may be imported and used in QML then:
- * ```
- * import net.sf.libosmscout.map 1.0
- *
- * Settings {
- * id: settings
- * }
- * ```
- */
-class OSMSCOUT_CLIENT_QT_API QmlSettings: public QObject{
- Q_OBJECT
- Q_PROPERTY(double physicalDPI READ GetPhysicalDPI CONSTANT)
- Q_PROPERTY(double mapDPI READ GetMapDPI WRITE SetMapDPI NOTIFY MapDPIChange)
- Q_PROPERTY(bool onlineTiles READ GetOnlineTilesEnabled WRITE SetOnlineTilesEnabled NOTIFY OnlineTilesEnabledChanged)
- Q_PROPERTY(QString onlineTileProviderId READ GetOnlineTileProviderId WRITE SetOnlineTileProviderId NOTIFY OnlineTileProviderIdChanged)
- Q_PROPERTY(bool offlineMap READ GetOfflineMap WRITE SetOfflineMap NOTIFY OfflineMapChanged)
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.31.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/VoiceProvider.h
^
|
@@ -1,97 +0,0 @@
-#ifndef OSMSCOUT_CLIENT_QT_VOICEPROVIDER_H
-#define OSMSCOUT_CLIENT_QT_VOICEPROVIDER_H
-
-/*
- OSMScout - a Qt backend for libosmscout and libosmscout-map
- Copyright (C) 2020 Lukas Karas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <QObject>
-#include <QString>
-#include <QUrl>
-
-#include <QJsonDocument>
-#include <QJsonArray>
-#include <QJsonObject>
-
-#include <osmscoutclientqt/ClientQtImportExport.h>
-
-namespace osmscout {
-
-/**
- * \ingroup QtAPI
- */
-class OSMSCOUT_CLIENT_QT_API VoiceProvider: public QObject
-{
- Q_OBJECT
-
-private:
- bool valid=false;
- QString uri;
- QString listUri;
- QString name;
-
-public:
- VoiceProvider() = default;
-
- VoiceProvider(const VoiceProvider &o):
- QObject(o.parent()),
- valid(o.valid), uri(o.uri), listUri(o.listUri), name(o.name){};
-
- VoiceProvider(const QString &name, const QString &uri, const QString &listUri):
- valid(true), uri(uri), listUri(listUri), name(name) {}
-
- ~VoiceProvider() override = default;
-
- VoiceProvider& operator=(const VoiceProvider &o)
- {
- valid = o.valid;
- uri = o.uri;
- listUri = o.listUri;
- name = o.name;
-
- return *this;
- }
-
- QString getName() const
- {
- return name;
- }
-
- QString getUri() const
- {
- return uri;
- }
-
- QUrl getListUri(QString locale="en") const
- {
- return listUri.arg(locale);
- }
-
- bool isValid() const
- {
- return valid;
- }
-
- static VoiceProvider fromJson(QJsonValue obj);
-};
-
-}
-
-Q_DECLARE_METATYPE(osmscout::VoiceProvider)
-
-#endif // OSMSCOUT_CLIENT_QT_VOICEPROVIDER_H
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.31.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/DBInstance.cpp
^
|
@@ -1,193 +0,0 @@
-/*
- OSMScout - a Qt backend for libosmscout and libosmscout-map
- Copyright (C) 2017 Lukáš Karas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include <osmscoutclientqt/DBInstance.h>
-
-#include <osmscout/log/Logger.h>
-
-#include <QRegExp>
-
-namespace osmscout {
-
-QBreaker::QBreaker()
- : osmscout::Breaker(),
- aborted(false)
-{
-}
-
-void QBreaker::Break()
-{
- QMutexLocker locker(&mutex);
-
- aborted=true;
-}
-
-bool QBreaker::IsAborted() const
-{
- QMutexLocker locker(&mutex);
-
- return aborted;
-}
-
-void QBreaker::Reset()
-{
- QMutexLocker locker(&mutex);
-
- aborted=false;
-}
-
-StyleError::StyleError(QString msg){
- QRegExp rx("(\\d+),(\\d+) (Symbol|Error|Warning|Exception):(.*)");
- if(rx.exactMatch(msg)){
- line = rx.cap(1).toInt();
- column = rx.cap(2).toInt();
- if(rx.cap(3) == "Symbol"){
- type = Symbol;
- } else if(rx.cap(3) == "Error"){
- type = Error;
- } else if(rx.cap(3) == "Warning"){
- type = Warning;
- } else {
- type = Exception;
- }
- text = rx.cap(4);
- }
-}
-
-QString StyleError::GetTypeName() const
-{
- switch(type){
- case Symbol:
- return QString("symbol");
- break;
- case Error:
- return QString("error");
- break;
- case Warning:
- return QString("warning");
- break;
- case Exception:
- return QString("exception");
- break;
- default:
- return QString("???");
- }
-}
-
-bool DBInstance::LoadStyle(QString stylesheetFilename,
- std::unordered_map<std::string,bool> stylesheetFlags,
- QList<StyleError> &errors)
-{
- QMutexLocker locker(&mutex);
-
- if (!database->IsOpen()) {
- return false;
- }
-
- osmscout::TypeConfigRef typeConfig=database->GetTypeConfig();
-
- if (!typeConfig) {
- return false;
- }
-
- // new map style may require more data types. when tile is marked as "completed"
- // such data types are never loaded into these tiles
- // so we mark them as "incomplete" to make sure that all types for new stylesheet are loaded
- mapService->InvalidateTileCache();
- osmscout::StyleConfigRef newStyleConfig=std::make_shared<osmscout::StyleConfig>(typeConfig);
-
- for (const auto& flag : stylesheetFlags) {
- newStyleConfig->AddFlag(flag.first,flag.second);
- }
-
- if (newStyleConfig->Load(stylesheetFilename.toLocal8Bit().data(),nullptr, false)) {
- // Tear down
- qDeleteAll(painterHolder);
- painterHolder.clear();
-
- // Recreate
- styleConfig=newStyleConfig;
-
- osmscout::log.Info()<< "Created new style with " << stylesheetFilename.toStdString();
- }
- else {
- std::list<std::string> errorsStrings=newStyleConfig->GetErrors();
-
- for(const auto& errorString : errorsStrings) {
- StyleError err(QString::fromStdString(errorString));
- qWarning() << "Style error:" << err.GetDescription();
- errors.append(err);
- }
-
- styleConfig=nullptr;
-
- return false;
- }
-
- return true;
-}
-
-osmscout::MapPainterQt* DBInstance::GetPainter()
-{
- QMutexLocker locker(&mutex);
- if (!styleConfig)
- return nullptr;
-
- if (!painterHolder.contains(QThread::currentThread())){
- painterHolder[QThread::currentThread()]=new osmscout::MapPainterQt(styleConfig);
- connect(QThread::currentThread(), &QThread::finished,
- this, &DBInstance::onThreadFinished);
- }
- return painterHolder[QThread::currentThread()];
-}
-
-void DBInstance::onThreadFinished()
-{
- QMutexLocker locker(&mutex);
- if (painterHolder.contains(QThread::currentThread())){
- delete painterHolder[QThread::currentThread()];
- painterHolder.remove(QThread::currentThread());
- }
-}
-
-void DBInstance::close()
-{
- QMutexLocker locker(&mutex);
-
- qDeleteAll(painterHolder);
- painterHolder.clear();
-
- // release map service, its threads may still use db
- // threads are stopped and joined in MapService destructor
- if (mapService && mapService.use_count() > 1){
- // if DBInstance is not exclusive owner, threads may hit closed data file and trigger assert!
- log.Warn() << "Map service for " << path.toStdString() << " is used on multiple places";
- }
- mapService.reset();
-
- locationService.reset();
- locationDescriptionService.reset();
- styleConfig.reset();
-
- if (database && database->IsOpen()) {
- database->Close();
- }
- database.reset();
-}
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.31.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/MapProvider.cpp
^
|
@@ -1,39 +0,0 @@
-/*
- This source is part of the libosmscout-map library
- Copyright (C) 2016 Lukáš Karas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <osmscoutclientqt/MapProvider.h>
-
-namespace osmscout {
-
-MapProvider MapProvider::fromJson(QJsonValue val)
-{
- if (!val.isObject())
- return MapProvider();
-
- QJsonObject obj = val.toObject();
- auto name = obj["name"];
- auto uri = obj["uri"];
- auto listUri = obj["listUri"];
-
- if (!(name.isString() && uri.isString() && listUri.isString())){
- return MapProvider();
- }
- return MapProvider(name.toString(), uri.toString(), listUri.toString());
-}
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.31.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/OnlineTileProvider.cpp
^
|
@@ -1,54 +0,0 @@
-/*
- This source is part of the libosmscout-map library
- Copyright (C) 2016 Lukáš Karas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <osmscoutclientqt/OnlineTileProvider.h>
-
-namespace osmscout {
-
-OnlineTileProvider OnlineTileProvider::fromJson(QJsonValue val)
-{
- if (!val.isObject())
- return OnlineTileProvider();
-
- QJsonObject obj = val.toObject();
- auto id = obj["id"];
- auto name = obj["name"];
- auto servers = obj["servers"];
- auto maximumZoomLevel = obj["maximumZoomLevel"];
- auto copyright = obj["copyright"];
-
- if (!(id.isString() && name.isString() && servers.isArray() &&
- maximumZoomLevel.isDouble() && copyright.isString())){
- return OnlineTileProvider();
- }
-
- QStringList serverList;
- for (auto serverVal: servers.toArray()){
- if (serverVal.isString()){
- serverList.append(serverVal.toString());
- }
- }
- if (serverList.empty()){
- return OnlineTileProvider();
- }
-
- return OnlineTileProvider(id.toString(), name.toString(), serverList,
- maximumZoomLevel.toDouble(), copyright.toString());
-}
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.31.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/Settings.cpp
^
|
@@ -1,522 +0,0 @@
-/*
- OSMScout - a Qt backend for libosmscout and libosmscout-map
- Copyright (C) 2013 Tim Teulings
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <osmscoutclientqt/Settings.h>
-#include <osmscoutclientqt/OSMScoutQt.h>
-
-#include <QScreen>
-#include <QGuiApplication>
-#include <QStandardPaths>
-#include <QDir>
-#include <QObject>
-#include <QDebug>
-#include <QFileInfo>
-#include <QJsonDocument>
-#include <QLocale>
-
-namespace osmscout {
-
-Settings::Settings(QSettings *providedStorage):
- storage(providedStorage)
-{
- if (storage==nullptr){
- storage=new QSettings(this);
- }
- /* Warning: Sailfish OS before version 2.0.1 reports incorrect DPI (100)
- *
- * Some DPI values:
- *
- * ~ 330 - Jolla tablet native
- * 242.236 - Jolla phone native
- * 130 - PC (24" FullHD)
- * 100 - Qt default (reported by SailfishOS < 2.0.1)
- */
- QScreen *srn=QGuiApplication::screens().at(0);
- physicalDpi = (double)srn->physicalDotsPerInch();
-}
-
-double Settings::GetPhysicalDPI() const
-{
- return physicalDpi;
-}
-
-void Settings::SetMapDPI(double dpi)
-{
- storage->setValue("OSMScoutLib/Rendering/DPI", (unsigned int)dpi);
- emit MapDPIChange(dpi);
-}
-
-double Settings::GetMapDPI() const
-{
- return (size_t)storage->value("OSMScoutLib/Rendering/DPI",physicalDpi).toDouble();
-}
-
-osmscout::Vehicle Settings::GetRoutingVehicle() const
-{
- return (osmscout::Vehicle)storage->value("OSMScoutLib/Routing/Vehicle",osmscout::vehicleCar).toUInt();
-}
-
-void Settings::SetRoutingVehicle(const osmscout::Vehicle& vehicle)
-{
- storage->setValue("OSMScoutLib/Routing/Vehicle", (unsigned int)vehicle);
-}
-
-bool Settings::GetOnlineTilesEnabled() const
-{
- return storage->value("OSMScoutLib/Rendering/OnlineTiles", true).toBool();
-}
-
-void Settings::SetOnlineTilesEnabled(bool b)
-{
- if (GetOnlineTilesEnabled() != b){
- storage->setValue("OSMScoutLib/Rendering/OnlineTiles", b);
- emit OnlineTilesEnabledChanged(b);
- }
-}
-
-const QList<OnlineTileProvider> Settings::GetOnlineProviders() const
-{
- return onlineProviders;
-}
-
-const QList<MapProvider> Settings::GetMapProviders() const
-{
- return mapProviders;
-}
-
-const QList<VoiceProvider> Settings::GetVoiceProviders() const
-{
- return voiceProviders;
-}
-
-const OnlineTileProvider Settings::GetOnlineTileProvider() const
-{
- if (onlineProviderMap.contains(GetOnlineTileProviderId())){
- return onlineProviderMap[GetOnlineTileProviderId()];
- }
- return OnlineTileProvider();
-}
-
-const QString Settings::GetOnlineTileProviderId() const
-{
- QString def = "?";
- if (!onlineProviders.isEmpty()){
- def = onlineProviders.begin()->getId();
- }
- return storage->value("OSMScoutLib/Rendering/OnlineTileProvider", def).toString();
-}
-
-void Settings::SetOnlineTileProviderId(QString id){
- if (GetOnlineTileProviderId() != id){
- storage->setValue("OSMScoutLib/Rendering/OnlineTileProvider", id);
- emit OnlineTileProviderIdChanged(id);
- emit OnlineTileProviderChanged(GetOnlineTileProvider());
- }
-}
-
-bool Settings::loadOnlineTileProviders(const QStringList &paths)
-{
- // load online tile providers
- bool result = true;
- for (const auto &path : paths) {
- QFile loadFile(path);
- if (!loadFile.open(QIODevice::ReadOnly)) {
- qWarning() << "Couldn't open" << loadFile.fileName() << "file.";
- result = false;
- continue;
- }
- qDebug() << "Loading online tile providers from " << loadFile.fileName();
-
- QJsonDocument doc = QJsonDocument::fromJson(loadFile.readAll());
- for (auto obj: doc.array()) {
- OnlineTileProvider provider = OnlineTileProvider::fromJson(obj);
- if (!provider.isValid()) {
- qWarning() << "Can't parse online provider from json value" << obj;
- } else {
- if (!onlineProviderMap.contains(provider.getId())) {
- onlineProviderMap[provider.getId()] = provider;
- onlineProviders << provider;
- }
- }
- }
- }
-
- // check if current provider is valid...
- if (!onlineProviderMap.contains(GetOnlineTileProviderId())){
- // ...if not, setup first
- if (!onlineProviders.isEmpty()){
- SetOnlineTileProviderId(onlineProviders.begin()->getId());
- }
- }
-
- emit OnlineTileProviderIdChanged(GetOnlineTileProviderId());
- return result && !onlineProviders.empty();
-}
-
-namespace { // anonymous namespace
-
-template <typename Provider>
-bool loadResourceProviders(const QString &path, QList<Provider> &providers)
-{
- QFile loadFile(path);
- if (!loadFile.open(QIODevice::ReadOnly)) {
- qWarning() << "Couldn't open" << loadFile.fileName() << "file.";
- return false;
- }
- qDebug() << "Loading providers from " << loadFile.fileName();
-
- QJsonDocument doc = QJsonDocument::fromJson(loadFile.readAll());
- for (auto obj: doc.array()){
- Provider provider = Provider::fromJson(obj);
- if (!provider.isValid()){
- qWarning() << "Can't parse online provider from json value" << obj;
- }else{
- providers.append(provider);
- }
- }
- return true;
-}
-}
-
-bool Settings::loadMapProviders(const QStringList &paths)
-{
- bool result = true;
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.31.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/VoiceProvider.cpp
^
|
@@ -1,39 +0,0 @@
-/*
- This source is part of the libosmscout-map library
- Copyright (C) 2020 Lukáš Karas
-
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-*/
-
-#include <osmscoutclientqt/VoiceProvider.h>
-
-namespace osmscout {
-
-VoiceProvider VoiceProvider::fromJson(QJsonValue val)
-{
- if (!val.isObject())
- return VoiceProvider();
-
- QJsonObject obj = val.toObject();
- auto name = obj["name"];
- auto uri = obj["uri"];
- auto listUri = obj["listUri"];
-
- if (!(name.isString() && uri.isString() && listUri.isString())){
- return VoiceProvider();
- }
- return VoiceProvider(name.toString(), uri.toString(), listUri.toString());
-}
-}
|
[-]
[+]
|
Deleted |
_service:tar_git:harbour-osmscout-2.31.tar.bz2/dependencies/libosmscout/libosmscout-client/src/osmscoutclient/Empty.cpp
^
|
@@ -1,3 +0,0 @@
-//
-// Created by tim on 08.06.23.
-//
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/CMakeLists.txt
^
|
@@ -6,7 +6,7 @@
# Redistribution and use is allowed according to the terms of the BSD license.
cmake_policy(SET CMP0048 NEW)
-project(osmscout-sailfish VERSION 2.31.0 LANGUAGES C CXX)
+project(osmscout-sailfish VERSION 2.32.0 LANGUAGES C CXX)
# ==================================================================================================
# Information to update before to release this package.
@@ -397,6 +397,7 @@
qml/pages/TrackEdit.qml
qml/pages/TrackFilter.qml
qml/pages/VoiceSelector.qml
+ qml/pages/WaypointSelector.qml
qml/main.qml
qml/l10n.qml
qml/desktop.qml)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/.github/workflows/build_and test_on_ios.yml
^
|
@@ -20,8 +20,44 @@
- name: Install build tool
run: brew install cmake ninja
- name: Install dependencies
- run: brew install openjdk protobuf protobuf-c qt5 cairo libxml2 gettext pango glfw3 glew glm pkgconfig
+ run: brew install openjdk
+ - name: Activate XCode
+ uses: maxim-lobanov/setup-xcode@v1
+ with:
+ xcode-version: latest-stable
+ - name: Install Qt
+ uses: jurplel/install-qt-action@v3
+ with:
+ version: '5.15.2'
+ host: 'mac'
+ target: 'ios'
+ arch: 'ios'
+ install-deps: 'true'
+ cache: true
+ cache-key-prefix: ${{ runner.os }}
+ setup-python: false
+ - name: Dump Qt installation data
+ run: echo ${Qt5_DIR}
+ - name: List Qt installation
+ run: ls -l ../Qt/5.15.2/ios/
+ - name: List Qt installation
+ run: ls -l ../Qt/5.15.2/ios/lib/cmake/Qt5
- name: Configure build project
- run: cmake -B build -DCMAKE_TOOLCHAIN_FILE=../cmake/iOS.cmake -DPKG_CONFIG_EXECUTABLE=/usr/local/bin/pkg-config -DCMAKE_UNITY_BUILD=ON -Wno-dev
+ run: "cmake -B build
+ -DCMAKE_SYSTEM_NAME=iOS
+ -DCMAKE_OSX_ARCHITECTURES=arm64
+ -DCMAKE_OSX_DEPLOYMENT_TARGET=13
+ -DOSMSCOUT_BUILD_IMPORT=OFF
+ -DOSMSCOUT_BUILD_GPX=ON
+ -DOSMSCOUT_BUILD_DEMOS=OFF
+ -DOSMSCOUT_BUILD_TOOL_DUMPDATA=OFF
+ -DOSMSCOUT_BUILD_DOC_API=OFF
+ -DOSMSCOUT_BUILD_WEBPAGE=OFF
+ -DOSMSCOUT_BUILD_TESTS=OFF
+ -DQt5_DIR=${Qt5_DIR}/lib/cmake/Qt5
+ -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON
+ -DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ON
+ -DCMAKE_UNITY_BUILD=ON
+ -Wno-dev"
- name: Build project
run: cmake --build build
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/.github/workflows/build_and test_on_msys.yml
^
|
@@ -20,6 +20,7 @@
steps:
- name: Checkout
uses: actions/checkout@v3
+ # mingw-w64-x86_64-cairo mingw-w64-x86_64-pango
- name: Setup MSYS/MINGW64
uses: msys2/setup-msys2@v2
with:
@@ -28,9 +29,9 @@
mingw-w64-x86_64-cmake mingw-w64-x86_64-extra-cmake-modules mingw-w64-x86_64-ninja
mingw-w64-x86_64-protobuf
mingw-w64-x86_64-libxml2
- mingw-w64-x86_64-cairo mingw-w64-x86_64-pango
mingw-w64-x86_64-qt5
- mingw-w64-x86_64-glew mingw-w64-x86_64-glfw mingw-w64-x86_64-glm"
+ mingw-w64-x86_64-glew mingw-w64-x86_64-glfw mingw-w64-x86_64-glm
+ mingw-w64-x86_64-directx-headers"
- name: Configure build project
run: DXSDK_DIR=${MINGW_PREFIX}/${MINGW_CHOST} cmake -B build -DCMAKE_UNITY_BUILD=ON -Wno-dev -G "Ninja"
- name: Build project
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/.github/workflows/build_and test_on_osx.yml
^
|
@@ -24,7 +24,7 @@
- name: Configure build project
run: meson setup --buildtype debugoptimized --unity on debug -Dopenmp=false
env:
- PKG_CONFIG_PATH: "/usr/local/opt/qt/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig"
+ PKG_CONFIG_PATH: "/usr/local/opt/qt@5/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig"
- name: Build project
run: meson compile -C debug
- name: Execute tests
@@ -41,7 +41,9 @@
- name: Install dependencies
run: brew install openjdk protobuf protobuf-c qt5 cairo libxml2 gettext pango glfw3 glew glm pkgconfig
- name: Configure build project
- run: cmake -B build -DCMAKE_PREFIX_PATH=/usr/local/opt/qt -DCMAKE_UNITY_BUILD=ON -Wno-dev -G "Ninja"
+ run: cmake -B build -DQt5_DIR=$(brew --prefix qt5)/lib/cmake/Qt5 -DCMAKE_UNITY_BUILD=ON -Wno-dev -G "Ninja"
+ env:
+ PKG_CONFIG_PATH: "/usr/local/opt/qt@5/lib/pkgconfig:/usr/local/opt/libxml2/lib/pkgconfig"
- name: Build project
run: cmake --build build
- name: Run tests
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/.github/workflows/build_and test_on_ubuntu_22_04.yml
^
|
@@ -130,7 +130,7 @@
libfreetype6-dev libcairo2-dev libpangocairo-1.0-0 libpango1.0-dev
qmake6 libqt6svg6-dev libqt6core5compat6-dev qt6-declarative-dev qt6-positioning-dev qt6-tools-dev-tools
qt6-l10n-tools qt6-tools-dev qt6-multimedia-dev
- libgl-dev"
+ libglm-dev libgl-dev"
- name: Configure build project
run: PATH=/usr/lib/qt6/bin:/usr/lib/qt6/libexec:$PATH meson setup --buildtype debugoptimized --unity on --wrap-mode=nofallback -D qtVersion=6 debug
env:
@@ -140,3 +140,33 @@
run: ninja -C debug
- name: Run tests
run: meson test -C debug --print-errorlogs
+
+ build_gcc_cmake_qt6:
+ name: gcc and cmake with Qt6
+ runs-on: ubuntu-22.04
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ - name: Install software-properties-common
+ run: sudo apt-get install software-properties-common
+ - name: Install gcc compiler, cmake and ninja
+ run: sudo apt-get -y install gcc-12 g++-12 libtbb-dev ccache libtool pkg-config cmake ninja-build
+ - name: Install libosmscout dependencies
+ run: "sudo apt-get update && sudo apt-get install -y
+ libprotobuf-dev protobuf-compiler
+ qmake6 libqt6svg6-dev libqt6core5compat6-dev qt6-declarative-dev qt6-positioning-dev qt6-tools-dev-tools
+ qt6-l10n-tools qt6-tools-dev qt6-multimedia-dev"
+ - name: Configure build project
+ run: cmake -B build -DCMAKE_UNITY_BUILD=ON -Wno-dev -G "Ninja"
+ env:
+ CXX: g++-12
+ CC: gcc-12
+ - name: Build project
+ run: cmake --build build
+ - name: Install project
+ run: sudo cmake --install build
+ - name: Run tests
+ run: xvfb-run ctest -j 2 --output-on-failure
+ env:
+ QT_QPA_PLATFORM: offscreen
+ working-directory: build
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/.github/workflows/build_on_ubuntu_22_04_qt_android.yml
^
|
@@ -0,0 +1,69 @@
+name: Ubuntu 22.04 for Qt on Android
+
+# See https://doc.qt.io/qt-5/android-getting-started.html
+# See https://github.com/jurplel/install-qt-action
+# See https://github.com/miurahr/aqtinstall/
+
+on:
+ pull_request:
+ branches:
+ - master
+ push:
+ branches:
+ - master
+ paths-ignore:
+ - '.github/workflows/**'
+
+jobs:
+ build:
+ name: Ubuntu+android - Build
+ runs-on: ubuntu-22.04
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ - name: set up JDK 11
+ uses: actions/setup-java@v3
+ with:
+ distribution: zulu
+ java-version: 11
+ - name: Setup Android SDK
+ uses: android-actions/setup-android@v2
+ - name: Run sdkmanager update
+ run: ${ANDROID_HOME}/tools/bin/sdkmanager --update
+ - name: Install android platform, platform-tools, build-tools and ndk
+ run: ${ANDROID_HOME}/tools/bin/sdkmanager --install "platform-tools" "platforms;android-29" "build-tools;29.0.2" "ndk;23.1.7779620"
+ - name: Install Qt
+ uses: jurplel/install-qt-action@v3
+ with:
+ version: '5.15.2'
+ host: 'linux'
+ target: 'android'
+ arch: 'android'
+ install-deps: 'true'
+ cache: true
+ cache-key-prefix: ${{ runner.os }}
+ setup-python: false
+ - name: Dump Qt installation data
+ run: echo ${Qt5_DIR}
+ - name: List Qt installation
+ run: ls -l ../Qt/5.15.2/android/
+ - name: Configure build project
+ run: "cmake -B build
+ -DCMAKE_TOOLCHAIN_FILE=${ANDROID_HOME}/ndk/23.1.7779620/build/cmake/android.toolchain.cmake
+ -DANDROID_NDK=${ANDROID_HOME}/ndk/23.1.7779620/
+ -DANDROID_ABI=arm64-v8a
+ -DANDROID_PLATFORM=android-29
+ -DANDROID_STL=c++_shared
+ -DANDROID_LD=lld
+ -DOSMSCOUT_BUILD_IMPORT=OFF
+ -DOSMSCOUT_BUILD_GPX=ON
+ -DOSMSCOUT_BUILD_DEMOS=OFF
+ -DOSMSCOUT_BUILD_TOOL_DUMPDATA=OFF
+ -DOSMSCOUT_BUILD_DOC_API=OFF
+ -DOSMSCOUT_BUILD_WEBPAGE=OFF
+ -DOSMSCOUT_BUILD_TESTS=OFF
+ -DQt5_DIR=${Qt5_DIR}/lib/cmake/Qt5
+ -DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON
+ -Wno-dev"
+ - name: Build project
+ run: cmake --build build
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/.github/workflows/sonar.yml
^
|
@@ -42,9 +42,9 @@
libmarisa-dev"
- name: Prepare Sonar scanner
run: |
- wget -nv https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.8.0.2856-linux.zip
- unzip -q sonar-scanner-cli-4.8.0.2856-linux.zip
- echo "${PWD}/sonar-scanner-4.8.0.2856-linux/bin/" >> $GITHUB_PATH
+ wget -nv https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-5.0.1.3006-linux.zip
+ unzip -q sonar-scanner-cli-5.0.1.3006-linux.zip
+ echo "${PWD}/sonar-scanner-5.0.1.3006-linux/bin/" >> $GITHUB_PATH
wget -nv https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
unzip -q build-wrapper-linux-x86.zip
echo "${PWD}/build-wrapper-linux-x86" >> $GITHUB_PATH
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/BasemapImport/CMakeLists.txt
^
|
@@ -23,5 +23,6 @@
install(TARGETS BasemapImport
RUNTIME DESTINATION bin
+ BUNDLE DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/CMakeLists.txt
^
|
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.10)
+cmake_minimum_required(VERSION 3.20)
project(libosmscout VERSION 1.1.1 LANGUAGES C CXX)
set(OSMSCOUT_LIBRARY_VERSION 1.1.1)
@@ -24,10 +24,33 @@
set(CMAKE_DEBUG_POSTFIX d)
endif()
endif()
+
set(OSMSCOUT_BASE_DIR_SOURCE ${CMAKE_CURRENT_SOURCE_DIR})
set(OSMSCOUT_BASE_DIR_BUILD ${CMAKE_CURRENT_BINARY_DIR})
-include_directories(${OSMSCOUT_BASE_DIR_BUILD}/include)
+
+#include_directories(${OSMSCOUT_BASE_DIR_BUILD}/include)
+
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
+
+## Pre-feature options
+option(QT_VERSION_PREFERRED "preferred Qt version, if multiple version are available. Value can be 5 or 6")
+
+option(OSMSCOUT_BUILD_IMPORT_TOOL_FOR_DISTRIBUTION "Import tool for distribution" OFF)
+if(APPLE)
+ option(OSMSCOUT_BUILD_FRAMEWORKS "Enable build of libraries as frameworks" ON)
+endif()
+
+# options for extra debugging of map renderer
+option(OSMSCOUT_DEBUG_LABEL_LAYOUTER "Print extra debug messages during label layouting" OFF)
+option(OSMSCOUT_DEBUG_GROUNDTILES "Print extra debug messages while rendering ground tiles" OFF)
+
+# options for extra debugging of import
+option(OSMSCOUT_DEBUG_COASTLINE "Print extra debug messages while importing coastline" OFF)
+option(OSMSCOUT_DEBUG_TILING "Print extra debug messages related with map tiles" OFF)
+
+# options for extra debugging of routing
+option(OSMSCOUT_DEBUG_ROUTING "Print extra debug messages while routing" OFF)
+
if(IOS)
set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "" FORCE)
else()
@@ -50,7 +73,7 @@
# feature detection (libraries, header, etc.)
include(features)
-# options
+# post-feature options
option(OSMSCOUT_BUILD_WITH_OPENMP "Enable OpenMP support" ${OPENMP_FOUND})
if(OSMSCOUT_BUILD_WITH_OPENMP)
if(OPENMP_FOUND)
@@ -61,36 +84,25 @@
endif()
endif()
-option(OSMSCOUT_BUILD_IMPORT_TOOL_FOR_DISTRIBUTION "Import tool for distribution" OFF)
-if(APPLE)
- option(OSMSCOUT_BUILD_FRAMEWORKS "Enable build of libraries as frameworks" ON)
-endif()
-
-# options for extra debugging of map renderer
-option(OSMSCOUT_DEBUG_LABEL_LAYOUTER "Print extra debug messages during label layouting" OFF)
-option(OSMSCOUT_DEBUG_GROUNDTILES "Print extra debug messages while rendering ground tiles" OFF)
-
-# options for extra debugging of import
-option(OSMSCOUT_DEBUG_COASTLINE "Print extra debug messages while importing coastline" OFF)
-option(OSMSCOUT_DEBUG_TILING "Print extra debug messages related with map tiles" OFF)
-
-# options for extra debugging of routing
-option(OSMSCOUT_DEBUG_ROUTING "Print extra debug messages while routing" OFF)
-
# compiler settings
include(CheckCXXCompilerFlag)
+
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX OR CMAKE_COMPILER_IS_GNUCC)
- set(OSMSCOUT_WARNING_FLAGS "-Wall -Winit-self -Wno-overloaded-virtual -Wcast-qual -Wwrite-strings -Wextra -Wno-long-long")
+ add_compile_options(-Wall -pedantic -Winit-self -Wno-overloaded-virtual -Wcast-qual -Wwrite-strings -Wextra -Wno-long-long)
if(EMSCRIPTEN)
- set(OSMSCOUT_WARNING_FLAGS "${OSMSCOUT_WARNING_FLAGS} -Wno-warn-absolute-paths")
+ add_compile_options(-Wno-warn-absolute-paths)
elseif(NOT APPLE)
- set(OSMSCOUT_WARNING_FLAGS "${OSMSCOUT_WARNING_FLAGS} -Wno-unused-but-set-parameter")
+ add_compile_options(-Wno-unused-but-set-parameter)
endif()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OSMSCOUT_WARNING_FLAGS}")
if(UNIX)
- add_definitions(-ldl -lm -lpthread)
+ add_compile_options(-ldl -lm -lpthread)
+ endif()
+
+ if(NOT MINGW AND NOT APPLE)
+ add_compile_options(-fPIC)
endif()
endif()
+
if(MSVC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /we4028")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:fast /wd4251 /MP")
@@ -100,6 +112,7 @@
endif()
add_definitions(-D_WIN32_WINNT=0x0A00 -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
endif()
+
if(MINGW OR MSYS)
add_definitions(-D_WIN32_WINNT=0x0600)
if(NOT OSMSCOUT_PLATFORM_X64)
@@ -110,8 +123,8 @@
endif ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -fno-tree-slp-vectorize -Wno-error=cast-qual -Wno-unused-local-typedefs")
endif()
+
if((CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX OR CMAKE_COMPILER_IS_GNUCC) AND NOT MINGW)
- add_definitions( -Wall -pedantic )
check_cxx_compiler_flag(-fvisibility=hidden OSMSCOUT_GCC_VISIBILITY)
if(OSMSCOUT_GCC_VISIBILITY)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE OSMSCOUT_GCC_VERSION)
@@ -133,23 +146,23 @@
endif()
endif()
endif()
- if(NOT APPLE)
- add_definitions(-fPIC)
- endif()
endif()
+
if(APPLE)
if(IOS)
set(CMAKE_SIZEOF_VOID_P 4)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fobjc-arc -fembed-bitcode")
+ add_compile_options(-fobjc-arc -fembed-bitcode)
else()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fobjc-arc")
+ add_compile_options(-fobjc-arc)
endif()
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++17")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
endif()
+
if(NOT BUILD_SHARED_LIBS)
add_definitions(-DOSMSCOUT_STATIC)
endif()
+
include(ProjectConfig)
add_definitions(-D_USE_MATH_DEFINES)
@@ -158,18 +171,18 @@
OPJ_TEST_LARGE_FILES(OPJ_HAVE_LARGEFILES)
# Qt DLLs
-if(WIN32 AND TARGET Qt5::qmake AND NOT TARGET Qt5::windeployqt)
- get_target_property(_qt5_qmake_location Qt5::qmake IMPORTED_LOCATION)
+if(WIN32 AND TARGET Qt::qmake AND NOT TARGET Qt::windeployqt)
+ get_target_property(_qt_qmake_location Qt::qmake IMPORTED_LOCATION)
execute_process(
- COMMAND "${_qt5_qmake_location}" -query QT_INSTALL_PREFIX
+ COMMAND "${_qt_qmake_location}" -query QT_INSTALL_PREFIX
RESULT_VARIABLE return_code
- OUTPUT_VARIABLE qt5_install_prefix
+ OUTPUT_VARIABLE qt_install_prefix
OUTPUT_STRIP_TRAILING_WHITESPACE
)
- set(imported_location "${qt5_install_prefix}/bin/windeployqt.exe")
+ set(imported_location "${qt_install_prefix}/bin/windeployqt.exe")
if(EXISTS ${imported_location})
- add_executable(Qt5::windeployqt IMPORTED libosmscout-client/src/osmscoutclient/Empty.cpp)
- set_target_properties(Qt5::windeployqt PROPERTIES IMPORTED_LOCATION ${imported_location})
+ add_executable(Qt::windeployqt IMPORTED libosmscout-client/src/osmscoutclient/Empty.cpp)
+ set_target_properties(Qt::windeployqt PROPERTIES IMPORTED_LOCATION ${imported_location})
endif()
option(OSMSCOUT_INSTALL_QT_DLL "Copies the DLLs from Qt to the installation directory" OFF)
mark_as_advanced(OSMSCOUT_INSTALL_QT_DLL)
@@ -294,7 +307,7 @@
set(OSMSCOUT_BUILD_MAP_IOSX OFF CACHE INTERNAL "" FORCE)
endif()
-if(OPENGL_FOUND AND GLEW_FOUND AND GLM_FOUND AND PNG_FOUND AND OSMSCOUT_BUILD_MAP)
+if(OPENGL_FOUND AND GLEW_FOUND AND TARGET glm AND PNG_FOUND AND OSMSCOUT_BUILD_MAP)
set(OSMSCOUT_BUILD_MAP_OPENGL_CACHE ON)
else()
set(OSMSCOUT_BUILD_MAP_OPENGL_CACHE OFF)
@@ -317,7 +330,7 @@
message(SEND_ERROR "GLEW is required for OpenGL map drawing backend")
set(OSMSCOUT_BUILD_MAP_OPENGL OFF)
endif()
- if(NOT GLM_FOUND)
+ if(NOT TARGET glm)
message(SEND_ERROR "GLM is required for OpenGL map drawing backend")
set(OSMSCOUT_BUILD_MAP_OPENGL OFF)
endif()
@@ -326,21 +339,13 @@
endif()
endif()
-if(Qt5Gui_FOUND AND Qt5Svg_FOUND AND OSMSCOUT_BUILD_MAP)
+if(QT_MAP_DEPENDENCIES_FOUND AND OSMSCOUT_BUILD_MAP)
set(OSMSCOUT_BUILD_MAP_QT_CACHE ON)
else()
set(OSMSCOUT_BUILD_MAP_QT_CACHE OFF)
endif()
option(OSMSCOUT_BUILD_MAP_QT "Enable build of Qt map drawing backend" ${OSMSCOUT_BUILD_MAP_QT_CACHE})
if(OSMSCOUT_BUILD_MAP_QT)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/Demos/CMakeLists.txt
^
|
@@ -45,15 +45,15 @@
#---- RoutingAnimation
if(${OSMSCOUT_BUILD_MAP_QT})
- osmscout_demo_project(NAME RoutingAnimation SOURCES src/RoutingAnimation.cpp TARGET OSMScout::OSMScout OSMScout::Map OSMScout::MapQt Qt5::Widgets)
+ osmscout_demo_project(NAME RoutingAnimation SOURCES src/RoutingAnimation.cpp TARGET OSMScout::OSMScout OSMScout::Map OSMScout::MapQt Qt::Widgets)
if(MSVC)
visual_studio_qt_helper("RoutingAnimation")
endif()
- if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt5::windeployqt)
+ if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt::windeployqt)
add_custom_command(TARGET RoutingAnimation
POST_BUILD
- COMMAND set PATH=%PATH%$<SEMICOLON>${qt5_install_prefix}/bin
- COMMAND Qt5::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:RoutingAnimation>/$<TARGET_FILE_NAME:RoutingAnimation>"
+ COMMAND set PATH=%PATH%$<SEMICOLON>${qt_install_prefix}/bin
+ COMMAND Qt::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:RoutingAnimation>/$<TARGET_FILE_NAME:RoutingAnimation>"
)
endif()
endif()
@@ -85,30 +85,30 @@
#---- DrawMapQt & ResourceConsumptionQt
if(${OSMSCOUT_BUILD_MAP_QT})
#---- DrawMapQt
- osmscout_demo_project(NAME DrawMapQt SOURCES src/DrawMapQt.cpp TARGET OSMScout::OSMScout OSMScout::Map OSMScout::MapQt Qt5::Widgets)
- target_compile_definitions(DrawMapQt PRIVATE ${Qt5Widgets_DEFINITIONS})
+ osmscout_demo_project(NAME DrawMapQt SOURCES src/DrawMapQt.cpp TARGET OSMScout::OSMScout OSMScout::Map OSMScout::MapQt Qt::Widgets)
+ target_compile_definitions(DrawMapQt PRIVATE ${QtWidgets_DEFINITIONS})
if(MSVC)
visual_studio_qt_helper("DrawMapQt")
endif()
- if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt5::windeployqt)
+ if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt::windeployqt)
add_custom_command(TARGET DrawMapQt
POST_BUILD
- COMMAND set PATH=%PATH%$<SEMICOLON>${qt5_install_prefix}/bin
- COMMAND Qt5::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:DrawMapQt>/$<TARGET_FILE_NAME:DrawMapQt>"
+ COMMAND set PATH=%PATH%$<SEMICOLON>${qt_install_prefix}/bin
+ COMMAND Qt::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:DrawMapQt>/$<TARGET_FILE_NAME:DrawMapQt>"
)
endif()
#---- ResourceConsumptionQt
- osmscout_demo_project(NAME ResourceConsumptionQt SOURCES src/ResourceConsumptionQt.cpp TARGET OSMScout::OSMScout OSMScout::Map OSMScout::MapQt Qt5::Widgets)
- target_compile_definitions(ResourceConsumptionQt PRIVATE ${Qt5Widgets_DEFINITIONS})
+ osmscout_demo_project(NAME ResourceConsumptionQt SOURCES src/ResourceConsumptionQt.cpp TARGET OSMScout::OSMScout OSMScout::Map OSMScout::MapQt Qt::Widgets)
+ target_compile_definitions(ResourceConsumptionQt PRIVATE ${QtWidgets_DEFINITIONS})
if(MSVC)
visual_studio_qt_helper("ResourceConsumptionQt")
endif()
- if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt5::windeployqt)
+ if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt::windeployqt)
add_custom_command(TARGET ResourceConsumptionQt
POST_BUILD
- COMMAND set PATH=%PATH%$<SEMICOLON>${qt5_install_prefix}/bin
- COMMAND Qt5::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:ResourceConsumptionQt>/$<TARGET_FILE_NAME:ResourceConsumptionQt>"
+ COMMAND set PATH=%PATH%$<SEMICOLON>${qt_install_prefix}/bin
+ COMMAND Qt::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:ResourceConsumptionQt>/$<TARGET_FILE_NAME:ResourceConsumptionQt>"
)
endif()
else()
@@ -120,7 +120,7 @@
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
- qt5_add_resources(RESOURCE_FILES ../OSMScout2/res.qrc demo.qrc)
+ qt_add_resources(RESOURCE_FILES ../OSMScout2/res.qrc demo.qrc)
set_property(SOURCE qrc_res.cpp PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE qrc_demo.cpp PROPERTY SKIP_AUTOMOC ON)
@@ -135,18 +135,18 @@
# qml files in CMake sources make it visible in QtCreator
qml/ElevationProfileChart.qml
- TARGET OSMScout::OSMScout OSMScout::Map OSMScout::MapQt OSMScout::ClientQt Qt5::Widgets)
- target_compile_definitions(ElevationProfileChart PRIVATE ${Qt5Widgets_DEFINITIONS})
+ TARGET OSMScout::OSMScout OSMScout::Map OSMScout::MapQt OSMScout::ClientQt Qt::Widgets)
+ target_compile_definitions(ElevationProfileChart PRIVATE ${QtWidgets_DEFINITIONS})
set_target_properties(ElevationProfileChart PROPERTIES
UNITY_BUILD OFF) # generated code for qt resources use static variables with the same name
if(MSVC)
visual_studio_qt_helper("ElevationProfileChart")
endif()
- if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt5::windeployqt)
+ if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt::windeployqt)
add_custom_command(TARGET ElevationProfileChart
POST_BUILD
- COMMAND set PATH=%PATH%$<SEMICOLON>${qt5_install_prefix}/bin
- COMMAND Qt5::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:ElevationProfileChart>/$<TARGET_FILE_NAME:ElevationProfileChart>"
+ COMMAND set PATH=%PATH%$<SEMICOLON>${qt_install_prefix}/bin
+ COMMAND Qt::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:ElevationProfileChart>/$<TARGET_FILE_NAME:ElevationProfileChart>"
)
endif()
@@ -165,18 +165,18 @@
qml/NavigationSimulation.qml
INCLUDES ../OSMScout2/src/
- TARGET OSMScout::OSMScout OSMScout::Map OSMScout::MapQt OSMScout::ClientQt OSMScout::GPX Qt5::Widgets)
- target_compile_definitions(NavigationSimulation PRIVATE ${Qt5Widgets_DEFINITIONS})
+ TARGET OSMScout::OSMScout OSMScout::Map OSMScout::MapQt OSMScout::ClientQt OSMScout::GPX Qt::Widgets)
+ target_compile_definitions(NavigationSimulation PRIVATE ${QtWidgets_DEFINITIONS})
set_target_properties(NavigationSimulation PROPERTIES
UNITY_BUILD OFF) # generated code for qt resources use static variables with the same name
if(MSVC)
visual_studio_qt_helper("NavigationSimulation")
endif()
- if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt5::windeployqt)
+ if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt::windeployqt)
add_custom_command(TARGET NavigationSimulation
POST_BUILD
- COMMAND set PATH=%PATH%$<SEMICOLON>${qt5_install_prefix}/bin
- COMMAND Qt5::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:NavigationSimulation>/$<TARGET_FILE_NAME:NavigationSimulation>"
+ COMMAND set PATH=%PATH%$<SEMICOLON>${qt_install_prefix}/bin
+ COMMAND Qt::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:NavigationSimulation>/$<TARGET_FILE_NAME:NavigationSimulation>"
)
endif()
else()
@@ -196,22 +196,25 @@
qml/PlaceInput.qml
INCLUDES ../OSMScout2/src/
- TARGET OSMScout::OSMScout OSMScout::Map OSMScout::MapQt OSMScout::ClientQt Qt5::Widgets)
- target_compile_definitions(RoutingParameters PRIVATE ${Qt5Widgets_DEFINITIONS})
+ TARGET OSMScout::OSMScout OSMScout::Map OSMScout::MapQt OSMScout::ClientQt Qt::Widgets)
+ target_compile_definitions(RoutingParameters PRIVATE ${QtWidgets_DEFINITIONS})
set_target_properties(RoutingParameters PROPERTIES
UNITY_BUILD OFF) # generated code for qt resources use static variables with the same name
if(MSVC)
visual_studio_qt_helper("RoutingParameters")
endif()
- if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt5::windeployqt)
+ if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt::windeployqt)
add_custom_command(TARGET RoutingParameters
POST_BUILD
- COMMAND set PATH=%PATH%$<SEMICOLON>${qt5_install_prefix}/bin
- COMMAND Qt5::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:RoutingParameters>/$<TARGET_FILE_NAME:RoutingParameters>"
+ COMMAND set PATH=%PATH%$<SEMICOLON>${qt_install_prefix}/bin
+ COMMAND Qt::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:RoutingParameters>/$<TARGET_FILE_NAME:RoutingParameters>"
)
endif()
+
+ #---- QtWidgetsDemoApp
+ osmscout_demo_project(NAME QtWidgetsDemoApp SOURCES src/QtWidgetsDemoApp.cpp TARGET Qt::Widgets OSMScout::ClientQt)
else()
- message("Skip ElevationProfileChart, NavigationSimulation and RoutingParameters demo, libosmscout-client-qt is missing.")
+ message("Skip ElevationProfileChart, NavigationSimulation and RoutingParameters QtWidgetsDemoApp demo, libosmscout-client-qt is missing.")
endif()
#---- DrawMapSVG
@@ -232,16 +235,15 @@
endif()
#---- DrawMapOpenGL
-if(${OSMSCOUT_BUILD_MAP_OPENGL} AND ${GLFW_FOUND})
- osmscout_demo_project(NAME DrawMapOpenGL SOURCES src/DrawMapOpenGL.cpp TARGET OSMScout::OSMScout OSMScout::Map OSMScout::MapOpenGL ${GLFW_LIBRARIES})
- target_include_directories(DrawMapOpenGL PRIVATE ${GLFW_INCLUDE_DIR})
+if(${OSMSCOUT_BUILD_MAP_OPENGL} AND TARGET glfw)
+ osmscout_demo_project(NAME DrawMapOpenGL SOURCES src/DrawMapOpenGL.cpp TARGET OSMScout::OSMScout OSMScout::Map OSMScout::MapOpenGL glfw)
else()
message("Skip DrawMapOpenGL demo, libosmscout-map-opengl or glfw is missing.")
endif()
#---- DrawMapOSX
-if(APPLE)
- if(${OSMSCOUT_BUILD_MAP_IOSX} AND NOT DEFINED IOS_PLATFORM)
+if(APPLE AND NOT IOS)
+ if(${OSMSCOUT_BUILD_MAP_IOSX})
osmscout_demo_project(NAME DrawMapOSX SOURCES src/DrawMapOSX.mm TARGET OSMScout::OSMScout OSMScout::Map OSMScoutMapIOSX INCLUDES ${CMAKE_SOURCE_DIR}/libosmscout-map-iOSX/include ${CMAKE_BINARY_DIR}/libosmscout-map-iOSX/include)
set_target_properties(DrawMapOSX PROPERTIES
UNITY_BUILD OFF)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/Demos/meson.build
^
|
@@ -125,7 +125,7 @@
'src/QtDemoApp.cpp'],
demoMocs,
cpp_args: ['-fPIC'],
- include_directories: [osmscoutIncDir, osmscoutmapIncDir, osmscoutmapqtIncDir, osmscoutclientqtIncDir, demoIncDir],
+ include_directories: [osmscoutIncDir, osmscoutmapIncDir, osmscoutmapqtIncDir, osmscoutclientIncDir, osmscoutclientqtIncDir, demoIncDir],
dependencies: [mathDep, openmpDep, qtClientDep],
link_with: [osmscout, osmscoutmap, osmscoutmapqt, osmscoutclientqt],
override_options : ['unity=off'], # generated code for qt resources use static variables with the same name
@@ -145,7 +145,7 @@
'../OSMScout2/src/Theme.cpp'],
[demoMocs, navDemoMocs],
cpp_args: ['-fPIC'],
- include_directories: [osmscoutIncDir, osmscoutmapIncDir, osmscoutmapqtIncDir, osmscoutclientqtIncDir, osmscoutgpxIncDir, demoIncDir, include_directories('../OSMScout2/src')],
+ include_directories: [osmscoutIncDir, osmscoutmapIncDir, osmscoutmapqtIncDir, osmscoutclientIncDir, osmscoutclientqtIncDir, osmscoutgpxIncDir, demoIncDir, include_directories('../OSMScout2/src')],
dependencies: [mathDep, openmpDep, qtClientDep],
link_with: [osmscout, osmscoutmap, osmscoutmapqt, osmscoutclientqt, osmscoutgpx],
override_options : ['unity=off'], # generated code for qt resources use static variables with the same name
@@ -164,12 +164,21 @@
'../OSMScout2/src/Theme.cpp'],
[demoMocs, routingParamsDemoMocs],
cpp_args: ['-fPIC'],
- include_directories: [osmscoutIncDir, osmscoutmapIncDir, osmscoutmapqtIncDir, osmscoutclientqtIncDir, demoIncDir, include_directories('../OSMScout2/src')],
+ include_directories: [osmscoutIncDir, osmscoutmapIncDir, osmscoutmapqtIncDir, osmscoutclientIncDir, osmscoutclientqtIncDir, demoIncDir, include_directories('../OSMScout2/src')],
dependencies: [mathDep, openmpDep, qtClientDep],
link_with: [osmscout, osmscoutmap, osmscoutmapqt, osmscoutclientqt],
override_options : ['unity=off'], # generated code for qt resources use static variables with the same name
install: true,
install_dir: demoInstallDir)
+
+ QtWidgetsDemoApp = executable('QtWidgetsDemoApp',
+ ['src/QtWidgetsDemoApp.cpp'],
+ cpp_args: ['-fPIC'],
+ include_directories: [osmscoutIncDir, osmscoutmapIncDir, osmscoutmapqtIncDir, osmscoutclientIncDir, osmscoutclientqtIncDir],
+ dependencies: [qtClientDep],
+ link_with: [osmscout, osmscoutmap, osmscoutmapqt, osmscoutclientqt],
+ install: true,
+ install_dir: demoInstallDir)
endif
Routing = executable('Routing',
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/Demos/src/LocationLookup.cpp
^
|
@@ -499,6 +499,9 @@
std::cout << "Database: " << args.databaseDirectory << std::endl;
std::cout << "Search pattern: " << searchParameter.GetSearchString() << std::endl;
+ if (args.transliterate) {
+ std::cout << "Transliterated pattern: " << osmscout::UTF8Transliterate(osmscout::UTF8StringToUpper(searchParameter.GetSearchString())) << std::endl;
+ }
std::cout << "Search for location: " << (searchParameter.GetSearchForLocation() ? "true" : "false") << std::endl;
std::cout << "Search for POI: " << (searchParameter.GetSearchForPOI() ? "true" : "false") << std::endl;
std::cout << "Admin region only match: " << (searchParameter.GetAdminRegionOnlyMatch() ? "true" : "false") << std::endl;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/Demos/src/NavigationSimulator.cpp
^
|
@@ -162,7 +162,6 @@
double maxSpeed)
{
size_t tickCount=0;
- double totalTime=0.0;
double restTime=0.0;
auto currentNode=description.Nodes().begin();
auto nextNode=currentNode;
@@ -204,7 +203,6 @@
auto timeInHours=distanceInKilometer/maxSpeed;
auto timeInSeconds=timeInHours*60*60;
- totalTime+=timeInHours;
// Make sure we do not skip edges in the street
lastPosition=currentNode->GetLocation();
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/Demos/src/QtWidgetsDemoApp.cpp
^
|
@@ -0,0 +1,127 @@
+#include <QApplication>
+#include <QWidget>
+#include <QMouseEvent>
+
+#include <osmscoutclientqt/OSMScoutQt.h>
+
+const auto MAX_ZOOM = 20;
+const auto MIN_ZOOM = 0;
+const auto MAP_DPI = 96;
+
+namespace {
+// used with QWheelEvent
+template <typename EventType>
+auto pos(EventType* event)
+{
+#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+ return event->pos();
+#else
+ return event->position().toPoint();
+#endif
+}
+
+// used with QMouseEvent
+template <typename EventType>
+auto pos2(EventType* event)
+{
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+ return event->pos();
+#else
+ return event->position().toPoint();
+#endif
+}
+}
+
+class MapFrame : public QWidget {
+public:
+ explicit MapFrame(const QString& maps_dir, const QString& stylesheet_file)
+ {
+ m_currentProjection.Set({0, 0}, 0.0, osmscout::Magnification{osmscout::Magnification::magWorld}, MAP_DPI, width(), height());
+
+ QFileInfo stylesheetFile(stylesheet_file);
+ if (!osmscout::OSMScoutQt::NewInstance()
+ .WithMapLookupDirectories({maps_dir})
+ .WithStyleSheetDirectory(stylesheetFile.dir().path())
+ .WithStyleSheetFile(stylesheetFile.fileName())
+ .Init()) {
+ throw std::runtime_error{"failed to init OSMScoutQt"};
+ }
+
+ m_renderer = osmscout::OSMScoutQt::GetInstance().MakeMapRenderer(osmscout::RenderingType::TiledRendering);
+ connect(m_renderer, &osmscout::MapRenderer::Redraw, this, [this] {update();});
+ }
+
+protected:
+ void paintEvent(QPaintEvent*) override
+ {
+ auto painter = QPainter(this);
+ painter.setRenderHint(QPainter::Antialiasing, true);
+ painter.setRenderHint(QPainter::TextAntialiasing, true);
+ painter.setRenderHint(QPainter::SmoothPixmapTransform, true);
+
+ m_renderer->RenderMap(painter, osmscout::MapViewStruct{
+ m_currentProjection.GetCenter(),
+ osmscout::Bearing{},
+ m_currentProjection.GetMagnification(),
+ static_cast<size_t>(width()),
+ static_cast<size_t>(height()),
+ MAP_DPI,
+ });
+ }
+
+ void mousePressEvent(QMouseEvent* ev) override
+ {
+ m_lastMousePos = ::pos2(ev);
+ }
+
+ void mouseMoveEvent(QMouseEvent* ev) override
+ {
+ auto x_delta = ::pos2(ev).x() - m_lastMousePos.x();
+ auto y_delta = ::pos2(ev).y() - m_lastMousePos.y();
+ m_currentProjection.Move(-x_delta, y_delta);
+ m_lastMousePos = ::pos2(ev);
+ update();
+ }
+
+ void wheelEvent(QWheelEvent* ev) override
+ {
+ auto magnification = m_currentProjection.GetMagnification().GetLevel();
+ if (ev->angleDelta().y() > 0) {
+ if (magnification >= MAX_ZOOM) {
+ return;
+ }
+ magnification++;
+ auto x_delta = (width() / 2. - ::pos(ev).x()) * 0.75;
+ auto y_delta = (height() / 2. - ::pos(ev).y()) * 0.75;
+ m_currentProjection.Move(-x_delta, y_delta);
+ } else {
+ if (magnification <= MIN_ZOOM) {
+ return;
+ }
+ magnification--;
+ auto x_delta = (width() / 2. - ::pos(ev).x()) * 0.75;
+ auto y_delta = (height() / 2. - ::pos(ev).y()) * 0.75;
+ m_currentProjection.Move(x_delta, -y_delta);
+ }
+ m_currentProjection.Set(m_currentProjection.GetCenter(), osmscout::Magnification{osmscout::MagnificationLevel{magnification}}, width(), height());
+ update();
+ }
+
+private:
+ osmscout::MapRenderer* m_renderer;
+ osmscout::MercatorProjection m_currentProjection;
+ QPoint m_lastMousePos;
+};
+
+int main(int argc, char *argv[])
+{
+ if (argc != 3) {
+ std::cerr << "Usage: " << argv[0] << ": <map_database_directory> <stylesheet_file>\n";
+ return 1;
+ }
+ osmscout::OSMScoutQt::RegisterQmlTypes();
+ QApplication app(argc, argv);
+ MapFrame map(argv[1], argv[2]);
+ map.show();
+ return QApplication::exec();
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/Demos/src/Routing.cpp
^
|
@@ -61,21 +61,22 @@
struct Arguments
{
- bool help=false;
- std::string router=osmscout::RoutingService::DEFAULT_FILENAME_BASE;
- osmscout::Vehicle vehicle=osmscout::Vehicle::vehicleCar;
- std::string gpx;
- std::string databaseDirectory;
- osmscout::GeoCoord start;
- osmscout::GeoCoord target;
- bool debug=false;
- bool dataDebug=false;
- bool routeDebug=false;
- std::string routeJson;
-
- osmscout::Distance penaltySameType=osmscout::Meters(40);
- osmscout::Distance penaltyDifferentType=osmscout::Meters(250);
- osmscout::HourDuration maxPenalty=std::chrono::seconds(10);
+ bool help=false;
+ std::string router=osmscout::RoutingService::DEFAULT_FILENAME_BASE;
+ osmscout::Vehicle vehicle=osmscout::Vehicle::vehicleCar;
+ std::string gpx;
+ std::string databaseDirectory;
+ osmscout::GeoCoord start;
+ std::vector<osmscout::GeoCoord> via;
+ osmscout::GeoCoord target;
+ bool debug=false;
+ bool dataDebug=false;
+ bool routeDebug=false;
+ std::string routeJson;
+
+ osmscout::Distance penaltySameType=osmscout::Meters(40);
+ osmscout::Distance penaltyDifferentType=osmscout::Meters(250);
+ osmscout::HourDuration maxPenalty=std::chrono::seconds(10);
};
class ConsoleRoutingProgress : public osmscout::RoutingProgress
@@ -606,6 +607,15 @@
std::cout << "Pass: " << poiAtRouteDescription->GetName()->GetDescription() << std::endl;
}
+ void OnViaAtRoute(const osmscout::RouteDescription::ViaDescriptionRef& viaDescription) override
+ {
+ size_t sectionNumber = viaDescription->GetSectionNumber();
+ if (sectionNumber > 1) {
+ NextLine(lineCount);
+ std::cout << "Etap: " << sectionNumber - 1 << std::endl;
+ }
+ }
+
void BeforeNode(const osmscout::RouteDescription::Node& node) override
{
lineCount=0;
@@ -741,6 +751,13 @@
"penalty-max",
"Maximum junction penalty, time [s]. Default "s + std::to_string(duration_cast<seconds>(args.maxPenalty).count()));
+
+ argParser.AddOption(osmscout::CmdLineGeoCoordOption([&args](const osmscout::GeoCoord& value) {
+ args.via.push_back(value);
+ }),
+ "via",
+ "add a via location coordinate");
+
argParser.AddPositional(osmscout::CmdLineStringOption([&args](const std::string& value) {
args.databaseDirectory=value;
}),
@@ -855,11 +872,25 @@
if (target.GetObjectFileRef().GetType()==osmscout::refNode) {
std::cerr << "Cannot find start node for target location!" << std::endl;
}
-
- osmscout::RoutingResult result=router->CalculateRoute(*routingProfile,
- start,
- target,
- parameter);
+
+ osmscout::RoutingResult result;
+
+ if (args.via.size() > 0) {
+ std::cout << "Using 'CalculateRouteViaCoords' method" << std::endl;
+ args.via.insert(args.via.begin(), args.start);
+ args.via.push_back(args.target);
+ result=router->CalculateRouteViaCoords(*routingProfile,
+ args.via,
+ osmscout::Kilometers(1),
+ parameter);
+
+ } else {
+ std::cout << "Using 'CalculateRoute' method" << std::endl;
+ result=router->CalculateRoute(*routingProfile,
+ start,
+ target,
+ parameter);
+ }
if (!result.Success()) {
std::cerr << "There was an error while calculating the route!" << std::endl;
@@ -963,6 +994,10 @@
std::vector<osmscout::RoutingProfileRef> profiles{routingProfile};
std::vector<osmscout::DatabaseRef> databases{database};
+ // SectionsPostprocessor needs the section lenghts computed in the routing when there are some via points
+ // between start and end
+ postprocessors.push_back(std::make_shared<osmscout::RoutePostprocessor::SectionsPostprocessor>(result.GetSectionLenghts()));
+
if (!postprocessor.PostprocessRouteDescription(*routeDescriptionResult.GetDescription(),
profiles,
databases,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/DumpData/CMakeLists.txt
^
|
@@ -14,5 +14,6 @@
install(TARGETS DumpData
RUNTIME DESTINATION bin
+ BUNDLE DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/Import/CMakeLists.txt
^
|
@@ -23,5 +23,6 @@
install(TARGETS Import
RUNTIME DESTINATION bin
+ BUNDLE DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/Import/src/Import.cpp
^
|
@@ -125,6 +125,9 @@
std::cout << " --wayDataMemoryMaped true|false memory maped way data file access (default: " << osmscout::BoolToString(parameter.GetWayDataMemoryMaped()) << ")" << std::endl;
std::cout << " --wayDataCacheSize <number> way data cache size (default: " << parameter.GetWayDataCacheSize() << ")" << std::endl;
+ std::cout << " --areaWayIndexMinMag <number> minimum index level for area way index analysis (default: " << parameter.GetAreaWayIndexMinMag() << ")" << std::endl;
+ std::cout << " --areaWayIndexMaxMag <number> maximum index level for area way index analysis (default: " << parameter.GetAreaWayIndexMaxMag() << ")" << std::endl;
+
std::cout << " --routeNodeBlockSize <number> number of route nodes resolved in block (default: " << parameter.GetRouteNodeBlockSize() << ")" << std::endl;
std::cout << std::endl;
std::cout << " --langOrder <#|lang1[,#|lang2]..> language order when parsing lang[:language] and place_name[:language] tags" << std::endl
@@ -349,6 +352,10 @@
(parameter.GetAreaDataMemoryMaped() ? "true" : "false"));
progress.Info(std::string("AreaDataCacheSize: ")+
std::to_string(parameter.GetAreaDataCacheSize()));
+ progress.Info(std::string("AreaWayIndexMinMag: ")+
+ std::to_string(parameter.GetAreaWayIndexMinMag().Get()));
+ progress.Info(std::string("AreaWayIndexMaxMag: ")+
+ std::to_string(parameter.GetAreaWayIndexMaxMag().Get()));
progress.Info(std::string("WayDataMemoryMaped: ")+
(parameter.GetWayDataMemoryMaped() ? "true" : "false"));
@@ -808,6 +815,32 @@
}
else {
parameterError=true;
+ }
+ }
+ else if (strcmp(argv[i],"--areaWayIndexMinMag")==0) {
+ size_t areaWayIndexMinMag;
+
+ if (osmscout::ParseSizeTArgument(argc,
+ argv,
+ i,
+ areaWayIndexMinMag)) {
+ parameter.SetAreaWayIndexMinMag(osmscout::MagnificationLevel(areaWayIndexMinMag));
+ }
+ else {
+ parameterError=true;
+ }
+ }
+ else if (strcmp(argv[i],"--areaWayIndexMaxMag")==0) {
+ size_t areaWayIndexMaxMag;
+
+ if (osmscout::ParseSizeTArgument(argc,
+ argv,
+ i,
+ areaWayIndexMaxMag)) {
+ parameter.SetAreaWayIndexMaxMag(osmscout::MagnificationLevel(areaWayIndexMaxMag));
+ }
+ else {
+ parameterError=true;
}
}
else if (strcmp(argv[i],"--wayDataMemoryMaped")==0) {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/OSMScout2/CMakeLists.txt
^
|
@@ -59,11 +59,11 @@
#
# - create binary translation files (*.qm) from translated phrases available
# in *.ts files with lrelease tool
-qt5_create_translation(TRANSLATION_QM_FILES
+qt_create_translation(TRANSLATION_QM_FILES
${TRANSLATION_SOURCE_FILES}
${TRANSLATION_TS_FILES})
-qt5_add_resources(RESOURCE_FILES res.qrc)
+qt_add_resources(RESOURCE_FILES res.qrc)
set_property(SOURCE qrc_res.cpp PROPERTY SKIP_AUTOMOC ON)
@@ -78,19 +78,19 @@
OSMScout::Map
OSMScout::MapQt
OSMScout::ClientQt
- Qt5::Core
- Qt5::Gui
- Qt5::Widgets
- Qt5::Qml
- Qt5::Quick
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+ Qt::Qml
+ Qt::Quick
)
-if (Qt5Svg_FOUND)
- target_link_libraries(OSMScout2 Qt5::Svg)
+if (QtSvg_FOUND)
+ target_link_libraries(OSMScout2 Qt::Svg)
endif()
-if (Qt5Positioning_FOUND)
- target_link_libraries(OSMScout2 Qt5::Positioning)
+if (QtPositioning_FOUND)
+ target_link_libraries(OSMScout2 Qt::Positioning)
endif()
if(MARISA_FOUND)
@@ -114,16 +114,17 @@
if(MSVC)
visual_studio_qt_helper("OSMScout2")
endif()
-if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt5::windeployqt)
+if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt::windeployqt)
add_custom_command(TARGET OSMScout2
POST_BUILD
- COMMAND set PATH=%PATH%$<SEMICOLON>${qt5_install_prefix}/bin
- COMMAND Qt5::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:OSMScout2>/$<TARGET_FILE_NAME:OSMScout2>"
+ COMMAND set PATH=%PATH%$<SEMICOLON>${qt_install_prefix}/bin
+ COMMAND Qt::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:OSMScout2>/$<TARGET_FILE_NAME:OSMScout2>"
)
endif()
install(TARGETS OSMScout2
RUNTIME DESTINATION bin
+ BUNDLE DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/OSMScout2/meson.build
^
|
@@ -19,8 +19,8 @@
osmscout2Src,
osmscout2Mocs,
cpp_args: ['-fPIC'],
- include_directories: [osmscout2IncDir, osmscoutgpxIncDir, osmscoutclientqtIncDir, osmscoutmapqtIncDir, osmscoutmapIncDir, osmscoutIncDir],
+ include_directories: [osmscout2IncDir, osmscoutgpxIncDir, osmscoutclientqtIncDir, osmscoutclientIncDir, osmscoutmapqtIncDir, osmscoutmapIncDir, osmscoutIncDir],
dependencies: [mathDep, openmpDep, qtClientDep],
- link_with: [osmscoutgpx, osmscoutclientqt, osmscoutmapqt, osmscoutmap, osmscout],
+ link_with: [osmscoutgpx, osmscoutclientqt, osmscoutclient, osmscoutmapqt, osmscoutmap, osmscout],
install: true)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/OSMScout2/resources/voice-providers.json
^
|
@@ -1,7 +1,7 @@
[
{
"uri": "https://osmscout.karry.cz/voices",
- "listUri": "https://osmscout.karry.cz/voices/list.json?locale=%3",
+ "listUri": "https://osmscout.karry.cz/voices/list.json?locale=%1",
"name": "karry.cz"
}
]
\ No newline at end of file
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/OSMScoutOpenGL/CMakeLists.txt
^
|
@@ -7,19 +7,15 @@
set_target_properties(OSMScoutOpenGL PROPERTIES VERSION ${OSMSCOUT_LIBRARY_VERSION} SOVERSION ${OSMSCOUT_LIBRARY_VERSION} FOLDER "Tools")
target_include_directories(OSMScoutOpenGL PRIVATE
- ${OPENGL_INCLUDE_DIR}
- ${GLEW_INCLUDE_DIRS}
- ${GLFW_INCLUDE_DIR}
- ${FREETYPE_INCLUDE_DIRS}
+ Freetype::Freetype
)
target_link_libraries(OSMScoutOpenGL
OSMScout::OSMScout
OSMScout::Map
OSMScout::MapOpenGL
- ${OPENGL_LIBRARIES}
- ${GLFW_LIBRARIES}
- ${FREETYPE_LIBRARIES}
+ OpenGL::GL
+ glfw
)
install(TARGETS OSMScoutOpenGL
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/PublicTransportMap/CMakeLists.txt
^
|
@@ -14,5 +14,6 @@
install(TARGETS PublicTransportMap
RUNTIME DESTINATION bin
+ BUNDLE DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/StyleEditor/CMakeLists.txt
^
|
@@ -46,15 +46,15 @@
OSMScout::Map
OSMScout::MapQt
OSMScout::ClientQt
- Qt5::Core
- Qt5::Gui
- Qt5::Widgets
- Qt5::Qml
- Qt5::Quick
+ Qt::Core
+ Qt::Gui
+ Qt::Widgets
+ Qt::Qml
+ Qt::Quick
)
-if (Qt5Svg_FOUND)
- target_link_libraries(StyleEditor Qt5::Svg)
+if (QtSvg_FOUND)
+ target_link_libraries(StyleEditor Qt::Svg)
endif()
if(MARISA_FOUND)
@@ -78,15 +78,16 @@
if(MSVC)
visual_studio_qt_helper("StyleEditor")
endif()
-if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt5::windeployqt)
+if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt::windeployqt)
add_custom_command(TARGET StyleEditor
POST_BUILD
- COMMAND set PATH=%PATH%$<SEMICOLON>${qt5_install_prefix}/bin
- COMMAND Qt5::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:OSMScout2>/$<TARGET_FILE_NAME:OSMScout2>"
+ COMMAND set PATH=%PATH%$<SEMICOLON>${qt_install_prefix}/bin
+ COMMAND Qt::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:OSMScout2>/$<TARGET_FILE_NAME:OSMScout2>"
)
endif()
install(TARGETS StyleEditor
RUNTIME DESTINATION bin
+ BUNDLE DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/StyleEditor/meson.build
^
|
@@ -23,7 +23,7 @@
styleeditorSrc,
styleeditorMocs,
cpp_args: ['-fPIC'],
- include_directories: [styleeditorIncDir, osmscoutclientqtIncDir, osmscoutmapqtIncDir, osmscoutmapIncDir, osmscoutIncDir],
+ include_directories: [styleeditorIncDir, osmscoutclientqtIncDir, osmscoutclientIncDir, osmscoutmapqtIncDir, osmscoutmapIncDir, osmscoutIncDir],
dependencies: [mathDep, openmpDep, qtClientDep],
- link_with: [osmscoutclientqt, osmscoutmapqt, osmscoutmap, osmscout],
+ link_with: [osmscoutclientqt, osmscoutclient, osmscoutmapqt, osmscoutmap, osmscout],
install: true)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/StyleEditor/src/MainWindow.h
^
|
@@ -22,7 +22,8 @@
#include <QQmlApplicationEngine>
-#include <osmscoutclientqt/Settings.h>
+#include <osmscoutclient/Settings.h>
+
#include <osmscoutclientqt/MapWidget.h>
class MainWindow : public QQmlApplicationEngine
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/StyleEditor/src/SettingsDialog.h
^
|
@@ -28,7 +28,7 @@
#include <QStandardItemModel>
#include <QTableView>*/
-#include <osmscoutclientqt/Settings.h>
+#include <osmscoutclient/Settings.h>
class SettingsDialog : public QQuickView
{
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/StyleEditor/src/StyleAnalyser.cpp
^
|
@@ -85,16 +85,11 @@
QSet<int> errorLines;
QSet<int> warningLines;
- int line;
for (const auto &w: styleConfig->GetWarnings()) {
- // TODO: expose warning as some structure with line number
- osmscout::StringToNumberSigned(w, line);
- warningLines << line;
+ warningLines << w.GetLine();
}
for (const auto &w: styleConfig->GetErrors()) {
- // TODO: expose warning as some structure with line number
- osmscout::StringToNumberSigned(w, line);
- errorLines << line;
+ errorLines << w.GetLine();
}
emit problematicLines(errorLines, warningLines);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/StyleEditor/src/StyleEditor.cpp
^
|
@@ -25,7 +25,7 @@
#include <QApplication>
// OSMScout library
-#include <osmscoutclientqt/Settings.h>
+#include <osmscoutclient/Settings.h>
#include <osmscoutclientqt/OSMScoutQt.h>
// Main Window
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/Tests/CMakeLists.txt
^
|
@@ -87,11 +87,14 @@
message("Skip TextLookupTest test, Marisa library is missing.")
endif()
+#---- Thread
+osmscout_test_project(NAME Thread SOURCES src/Thread.cpp)
+
#---- DrawTextQt
if(${OSMSCOUT_BUILD_MAP_QT} AND TARGET OSMScout::MapQt)
set(src_files src/DrawTextQt.cpp include/DrawWindow.h)
- qt5_wrap_cpp(src_files include/DrawWindow.h)
- osmscout_test_project(NAME DrawTextQt SOURCES ${src_files} TARGET OSMScout::Map OSMScout::MapQt Qt5::Widgets SKIPTEST)
+ qt_wrap_cpp(src_files include/DrawWindow.h)
+ osmscout_test_project(NAME DrawTextQt SOURCES ${src_files} TARGET OSMScout::Map OSMScout::MapQt Qt::Widgets SKIPTEST)
else()
message("Skip DrawTextQt test, libosmscout-map-qt is missing.")
endif()
@@ -149,6 +152,9 @@
#---- StdByteTest
osmscout_test_project(NAME StdByteTest SOURCES src/StdByteTest.cpp)
+#---- Signal
+osmscout_test_project(NAME Signal SOURCES src/Signal.cpp)
+
#---- TilingTest
osmscout_test_project(NAME TilingTest SOURCES src/TilingTest.cpp)
@@ -201,16 +207,16 @@
set(PERFORMANCE_TEST_DRIVERS ${PERFORMANCE_TEST_DRIVERS} cairo)
endif()
if(${OSMSCOUT_BUILD_MAP_QT})
- target_link_libraries(PerformanceTest OSMScout::MapQt Qt5::Widgets)
+ target_link_libraries(PerformanceTest OSMScout::MapQt Qt::Widgets)
set(HAVE_LIB_OSMSCOUTMAPQT 1)
if(MSVC)
visual_studio_qt_helper("PerformanceTest")
endif()
- if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt5::windeployqt)
+ if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt::windeployqt)
add_custom_command(TARGET PerformanceTest
POST_BUILD
- COMMAND set PATH=%PATH%$<SEMICOLON>${qt5_install_prefix}/bin
- COMMAND Qt5::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:PerformanceTest>/$<TARGET_FILE_NAME:PerformanceTest>"
+ COMMAND set PATH=%PATH%$<SEMICOLON>${qt_install_prefix}/bin
+ COMMAND Qt::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:PerformanceTest>/$<TARGET_FILE_NAME:PerformanceTest>"
)
endif()
set(PERFORMANCE_TEST_DRIVERS ${PERFORMANCE_TEST_DRIVERS} Qt)
@@ -220,9 +226,8 @@
set(HAVE_LIB_OSMSCOUTMAPAGG 1)
set(PERFORMANCE_TEST_DRIVERS ${PERFORMANCE_TEST_DRIVERS} agg)
endif()
- if(${OSMSCOUT_BUILD_MAP_OPENGL} AND ${GLFW_FOUND})
- target_include_directories(PerformanceTest PRIVATE ${GLFW_INCLUDE_DIR})
- target_link_libraries(PerformanceTest OSMScout::MapOpenGL ${GLFW_LIBRARIES})
+ if(${OSMSCOUT_BUILD_MAP_OPENGL} AND TARGET glfw)
+ target_link_libraries(PerformanceTest OSMScout::MapOpenGL glfw)
set(HAVE_LIB_OSMSCOUTMAPOPENGL 1)
set(PERFORMANCE_TEST_DRIVERS ${PERFORMANCE_TEST_DRIVERS} opengl)
endif()
@@ -282,8 +287,8 @@
#---- ClientQtThreading
if(${OSMSCOUT_BUILD_CLIENT_QT} AND TARGET OSMScout::MapQt AND TARGET OSMScout::ClientQt)
set(src_files src/ClientQtThreading.cpp)
- qt5_wrap_cpp(src_files include/ClientQtThreading.h)
- osmscout_test_project(NAME ClientQtThreading SOURCES ${src_files} TARGET OSMScout::Map OSMScout::MapQt OSMScout::ClientQt Qt5::Widgets SKIPTEST)
+ qt_wrap_cpp(src_files include/ClientQtThreading.h)
+ osmscout_test_project(NAME ClientQtThreading SOURCES ${src_files} TARGET OSMScout::Map OSMScout::MapQt OSMScout::ClientQt Qt::Widgets SKIPTEST)
else()
message("Skip ClientQtThreading test, libosmscout-client-qt is missing.")
endif()
@@ -291,8 +296,8 @@
#---- QtFileDownloader
if(${OSMSCOUT_BUILD_CLIENT_QT} AND TARGET OSMScout::MapQt AND TARGET OSMScout::ClientQt)
set(src_files src/QtFileDownloader.cpp)
- qt5_wrap_cpp(src_files include/DownloaderTest.h)
- osmscout_test_project(NAME QtFileDownloader SOURCES ${src_files} TARGET OSMScout::Map OSMScout::MapQt OSMScout::ClientQt Qt5::Widgets SKIPTEST)
+ qt_wrap_cpp(src_files include/DownloaderTest.h)
+ osmscout_test_project(NAME QtFileDownloader SOURCES ${src_files} TARGET OSMScout::Map OSMScout::MapQt OSMScout::ClientQt Qt::Widgets SKIPTEST)
else()
message("Skip QtFileDownloader test, libosmscout-client-qt is missing.")
endif()
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/Tests/meson.build
^
|
@@ -401,6 +401,15 @@
install: true,
install_dir: testInstallDir)
+Signal = executable('Signal',
+ 'src/Signal.cpp',
+ include_directories: [testIncDir, osmscoutIncDir],
+ link_with: [osmscout],
+ install: true,
+ install_dir: testInstallDir)
+
+test('Check signal', Signal)
+
StringUtils = executable('StringUtils',
'src/StringUtils.cpp',
include_directories: [testIncDir, osmscoutIncDir],
@@ -550,6 +559,16 @@
'bosyne'])
endif
+Thread = executable('Thread',
+ 'src/Thread.cpp',
+ include_directories: [testIncDir, osmscoutIncDir],
+ dependencies: [mathDep, threadDep, openmpDep],
+ link_with: [osmscout],
+ install: true,
+ install_dir: testInstallDir)
+
+test('Check Thread utilities', Thread)
+
if buildImport
ostandossEnv = environment()
ostandossEnv.set('TESTS_TOP_DIR', meson.current_source_dir())
@@ -580,7 +599,7 @@
ClientQtThreading = executable('ClientQtThreading',
'src/ClientQtThreading.cpp',
threadingMocs,
- include_directories: [testIncDir, osmscoutmapqtIncDir, osmscoutmapIncDir, osmscoutIncDir, osmscoutclientqtIncDir],
+ include_directories: [testIncDir, osmscoutmapqtIncDir, osmscoutclientIncDir, osmscoutmapIncDir, osmscoutIncDir, osmscoutclientqtIncDir],
dependencies: [mathDep, threadDep, openmpDep, qtClientDep],
link_with: [osmscoutmapqt, osmscoutmap, osmscout, osmscoutclientqt],
install: true,
@@ -593,7 +612,7 @@
QtFileDownloader = executable('QtFileDownloader',
'src/QtFileDownloader.cpp',
testMocs,
- include_directories: [testIncDir, osmscoutmapqtIncDir, osmscoutmapIncDir, osmscoutIncDir, osmscoutclientqtIncDir],
+ include_directories: [testIncDir, osmscoutmapqtIncDir, osmscoutmapIncDir, osmscoutIncDir, osmscoutclientIncDir, osmscoutclientqtIncDir],
dependencies: [mathDep, threadDep, openmpDep, qtClientDep],
link_with: [osmscoutmapqt, osmscoutmap, osmscout, osmscoutclientqt],
install: true,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/Tests/src/DrawTextQt.cpp
^
|
@@ -100,7 +100,7 @@
painter->drawText(point.GetX(), point.GetY(), QString(string[i]));
-#if QT_VERSION < 0x051100
+#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
offset+=metrics.width(string[i]);
#else
offset+=metrics.horizontalAdvance(string[i]);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/Tests/src/PerformanceTest.cpp
^
|
@@ -857,8 +857,6 @@
args.TileWidth(),
args.TileHeight());
- osmscout::GeoBox boundingBox(projection.GetDimensions());
-
projection.SetLinearInterpolationUsage(level.Get() >= 10);
for (size_t i=0; i<args.loadRepeat; i++) {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/Tests/src/ScreenBox.cpp
^
|
@@ -77,3 +77,39 @@
REQUIRE(expectedResizedBox==resizedBox);
}
+
+TEST_CASE("Resize ==0")
+{
+ osmscout::ScreenBox box(osmscout::Vertex2D(-1, -1),
+ osmscout::Vertex2D(1, 1));
+ osmscout::ScreenBox resizedBox=box.Resize(0);
+
+ osmscout::ScreenBox expectedResizedBox(osmscout::Vertex2D(-1, -1),
+ osmscout::Vertex2D(1, 1));
+
+ REQUIRE(expectedResizedBox==resizedBox);
+}
+
+TEST_CASE("Resize empty rectangle by zero")
+{
+ osmscout::ScreenBox box(osmscout::Vertex2D(-1, -1),
+ osmscout::Vertex2D(-1, 1));
+ osmscout::ScreenBox resizedBox=box.Resize(0);
+
+ osmscout::ScreenBox expectedResizedBox(osmscout::Vertex2D(-1, -1),
+ osmscout::Vertex2D(1, 1));
+
+ REQUIRE(expectedResizedBox==resizedBox);
+}
+
+TEST_CASE("Resize square to zero")
+{
+ osmscout::ScreenBox box(osmscout::Vertex2D(-1, -1),
+ osmscout::Vertex2D(1, 1));
+ osmscout::ScreenBox resizedBox=box.Resize(-1);
+
+ osmscout::ScreenBox expectedResizedBox(osmscout::Vertex2D(0, 0),
+ osmscout::Vertex2D(0, 0));
+
+ REQUIRE(expectedResizedBox==resizedBox);
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/Tests/src/Signal.cpp
^
|
@@ -0,0 +1,95 @@
+#include <osmscout/async/Signal.h>
+
+#include <TestMain.h>
+
+#include <string>
+
+TEST_CASE("basic signal <-> slot connection") {
+ osmscout::Signal<std::string, double> source;
+
+ std::map<std::string, double> map;
+ osmscout::Slot<std::string, double> target([&map](const std::string& str, const double &d) mutable {
+ map[str]=d;
+ });
+
+ source.Connect(target);
+
+ source.Emit("Pi", 3.1415);
+ source.Emit("the meaning of life", 42);
+
+ REQUIRE(map.size()==2);
+ REQUIRE(map["Pi"]==3.1415);
+ REQUIRE(map["the meaning of life"]==42);
+}
+
+TEST_CASE("multiple signal <-> slot connections") {
+ osmscout::Signal<std::string, double> source1;
+ osmscout::Signal<std::string, double> source2;
+
+ std::map<std::string, double> map1;
+ osmscout::Slot<std::string, double> target1([&map1](const std::string& str, const double &d) mutable {
+ map1[str]=d;
+ });
+
+ std::map<std::string, double> map2;
+ osmscout::Slot<std::string, double> target2([&map2](const std::string& str, const double &d) mutable {
+ map2[str]=d;
+ });
+
+ source1.Connect(target1);
+ source2.Connect(target1);
+
+ source1.Emit("A", 1);
+
+ source2.Connect(target2);
+ source2.Emit("B", 1);
+
+ REQUIRE(map1.size() == 2);
+ REQUIRE(map1["A"] == 1);
+ REQUIRE(map1["B"] == 1);
+
+ REQUIRE(map2.size() == 1);
+ REQUIRE(map2["B"] == 1);
+}
+
+TEST_CASE("slot disconnection on destructor") {
+ osmscout::Signal<std::string, double> source;
+
+ std::map<std::string, double> map;
+ {
+ osmscout::Slot<std::string, double> target([&map](const std::string &str, const double &d) mutable {
+ map[str] = d;
+ });
+
+ source.Connect(target);
+
+ source.Emit("A", 1);
+ }
+ source.Emit("B", 2);
+
+ REQUIRE(map.size()==1);
+ REQUIRE(map["A"]==1);
+}
+
+TEST_CASE("shorter signal live cycle") {
+ std::map<std::string, double> map;
+ osmscout::Slot<std::string, double> target([&map](const std::string &str, const double &d) mutable {
+ map[str] = d;
+ });
+
+ {
+ osmscout::Signal<std::string, double> source;
+ source.Connect(target);
+ source.Emit("A", 1);
+ }
+
+ {
+ osmscout::Signal<std::string, double> source;
+ source.Connect(target);
+ source.Emit("B", 2);
+ }
+
+ REQUIRE(map.size()==2);
+ REQUIRE(map["A"]==1);
+ REQUIRE(map["B"]==2);
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/Tests/src/StringUtils.cpp
^
|
@@ -319,3 +319,12 @@
REQUIRE(osmscout::Trim(" abc ")=="abc");
REQUIRE(osmscout::Trim("-- abc --", '-')==" abc ");
}
+
+TEST_CASE("String replace")
+{
+ REQUIRE(osmscout::ReplaceString("", "a", "b").empty());
+ REQUIRE(osmscout::ReplaceString("abc", "", "b")=="abc");
+ REQUIRE(osmscout::ReplaceString("abcabc", "a", "A")=="AbcAbc");
+ REQUIRE(osmscout::ReplaceString("abcdef", "ef", "X")=="abcdX");
+ REQUIRE(osmscout::ReplaceString("abcdef", "ab", "X")=="Xcdef");
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/Tests/src/Thread.cpp
^
|
@@ -0,0 +1,27 @@
+#include <osmscout/async/Signal.h>
+#include <osmscout/async/Thread.h>
+
+#include <TestMain.h>
+
+#include <atomic>
+
+TEST_CASE("Thread exit signal") {
+
+ auto cnt=std::atomic_int(0);
+
+ osmscout::Slot<std::thread::id> threadEndSlot([&cnt](const std::thread::id &id){
+ std::cout << "Thread " << id << " ended" << std::endl;
+ cnt.fetch_add(1);
+ });
+
+ REQUIRE(cnt==0);
+
+ std::thread t1([&threadEndSlot](){
+ std::cout << "ThreadFn " << std::this_thread::get_id() << std::endl;
+ osmscout::ThreadExitSignal().Connect(threadEndSlot);
+ });
+
+ t1.join();
+
+ REQUIRE(cnt==1);
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/ci/docker/debian_buster_gcc_meson/Dockerfile
^
|
@@ -28,7 +28,8 @@
python3-pip \
&& rm -rf /var/lib/apt/lists/*
-RUN pip3 install meson ninja
+# meson fails to detect ninja 1.11
+RUN pip3 install meson ninja==1.10.2
RUN mkdir /work
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/cmake/FindGperftools.cmake
^
|
@@ -31,4 +31,4 @@
)
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(GPERFTOOLS DEFAULT_MSG GPERFTOOLS_INCLUDE_DIRS GPERFTOOLS_LIBRARIES)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gperftools DEFAULT_MSG GPERFTOOLS_INCLUDE_DIRS GPERFTOOLS_LIBRARIES)
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/cmake/FindLibAgg.cmake
^
|
@@ -0,0 +1,54 @@
+# - Try to find libagg
+# Once done, this will define
+#
+# LIBAGG_FOUND - system has libagg
+# LIBAGG_INCLUDE_DIRS - the libagg include directories
+# LIBAGG_LIBRARIES - link these to use libagg
+# LIBAGGFT2_LIBRARIES - link these to connect agg and freetype
+#
+FIND_PACKAGE(PkgConfig)
+PKG_CHECK_MODULES(PC_LIBAGG QUIET LIBAGG)
+
+FIND_PATH(LIBAGG_INCLUDE_DIRS
+ NAMES agg2/agg_basics.h
+ HINTS ${PC_LIBAGG_INCLUDEDIR}
+ ${PC_LIBAGG_INCLUDE_DIRS}
+ $ENV{LIBAGG_HOME}/include
+ $ENV{LIBAGG_ROOT}/include
+ /usr/local/include
+ /usr/include
+ /libagg/include
+ PATH_SUFFIXES agg agg2
+)
+
+FIND_LIBRARY(LIBAGG_LIBRARIES
+ NAMES agg_pic libagg agg libagg-2.5 agg-2.5
+ HINTS ${PC_LIBAGG_LIBDIR}
+ ${PC_LIBAGG_LIBRARY_DIRS}
+ $ENV{LIBAGG_HOME}/lib
+ $ENV{LIBAGG_ROOT}/lib
+ /usr/local/lib
+ /usr/lib
+ /lib
+ /libagg/lib
+ PATH_SUFFIXES agg agg2
+)
+
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibAgg DEFAULT_MSG LIBAGG_INCLUDE_DIRS LIBAGG_LIBRARIES)
+
+IF(LIBAGG_FOUND)
+ PKG_CHECK_MODULES(PC_LIBAGGFT2 QUIET LIBAGGFT2)
+ FIND_LIBRARY(LIBAGGFT2_LIBRARIES
+ NAMES aggfontfreetype_pic aggfontfreetype libaggfontfreetype
+ HINTS ${PC_LIBAGG_LIBDIR}
+ ${PC_LIBAGG_LIBRARY_DIRS}
+ $ENV{LIBAGG_HOME}/lib
+ $ENV{LIBAGG_ROOT}/lib
+ /usr/local/lib
+ /usr/lib
+ /lib
+ /libagg/lib
+ PATH_SUFFIXES agg agg2
+ )
+ENDIF()
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/cmake/FindMarisa.cmake
^
|
@@ -37,4 +37,4 @@
)
INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(MARISA DEFAULT_MSG MARISA_INCLUDE_DIRS MARISA_LIBRARIES)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Marisa DEFAULT_MSG MARISA_INCLUDE_DIRS MARISA_LIBRARIES)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/cmake/FindPango.cmake
^
|
(renamed from dependencies/libosmscout/cmake/FindPANGO.cmake)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/cmake/ProjectConfig.cmake
^
|
@@ -17,7 +17,7 @@
set(_targets)
set(_includes
include
- ${CMAKE_SOURCE_DIR}/include
+ ${PROJECT_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}/privateinclude
${CMAKE_CURRENT_SOURCE_DIR}/include
@@ -109,6 +109,7 @@
endif()
install(TARGETS ${_name}
RUNTIME DESTINATION bin
+ BUNDLE DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
FRAMEWORK DESTINATION lib)
@@ -123,13 +124,13 @@
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/${_includedir} DESTINATION include FILES_MATCHING PATTERN "*.h" ${_exclude_cmd})
endif()
endif()
- if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt5::windeployqt AND BUILD_SHARED_LIBS)
+ if(OSMSCOUT_INSTALL_QT_DLL AND TARGET Qt::windeployqt AND BUILD_SHARED_LIBS)
foreach(T ${_targets})
- if("${T}" STREQUAL "Qt5::Core" OR "${T}" STREQUAL "Qt5::Gui" OR "${T}" STREQUAL "Qt5::Widgets" OR "${T}" STREQUAL "Qt5::Svg")
+ if("${T}" STREQUAL "Qt::Core" OR "${T}" STREQUAL "Qt::Gui" OR "${T}" STREQUAL "Qt::Widgets" OR "${T}" STREQUAL "Qt::Svg")
add_custom_command(TARGET ${_name}
POST_BUILD
- COMMAND set PATH=%PATH%$<SEMICOLON>${qt5_install_prefix}/bin
- COMMAND Qt5::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:${_name}>/$<TARGET_FILE_NAME:${_name}>"
+ COMMAND set PATH=%PATH%$<SEMICOLON>${qt_install_prefix}/bin
+ COMMAND Qt::windeployqt --dir "${CMAKE_BINARY_DIR}/windeployqt" "$<TARGET_FILE_DIR:${_name}>/$<TARGET_FILE_NAME:${_name}>"
)
break()
endif()
@@ -140,6 +141,8 @@
install(FILES $<TARGET_PDB_FILE:${_name}> DESTINATION ${CMAKE_INSTALL_PREFIX}/bin CONFIGURATIONS Debug)
endif()
endif()
+ configure_file("${PROJECT_SOURCE_DIR}/pkgconfig-template.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/${_output}.pc" @ONLY)
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${_output}.pc" DESTINATION lib/pkgconfig)
endmacro(osmscout_library_project)
macro(osmscout_demo_project)
@@ -148,7 +151,7 @@
set(_targets)
set(_includes
include
- ${CMAKE_SOURCE_DIR}/include
+ ${PROJECT_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}/privateinclude
${CMAKE_CURRENT_SOURCE_DIR}/include
@@ -174,7 +177,7 @@
add_executable(${_name} ${_sources})
set_target_properties(${_name} PROPERTIES VERSION ${OSMSCOUT_LIBRARY_VERSION} SOVERSION ${OSMSCOUT_LIBRARY_VERSION} FOLDER "Demos")
target_link_libraries(${_name} ${_targets})
- install(TARGETS ${_name} RUNTIME DESTINATION share/osmscout/demos LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
+ install(TARGETS ${_name} RUNTIME DESTINATION share/osmscout/demos BUNDLE DESTINATION share/osmscout/demos LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
target_include_directories(${_name} PRIVATE ${_includes})
if(WIN32 AND HAVE_WINRES_H)
create_win32_demo_resource(${_name})
@@ -187,7 +190,7 @@
set(_targets OSMScout::OSMScout)
set(_includes
include
- ${CMAKE_SOURCE_DIR}/include
+ ${PROJECT_SOURCE_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}/include
${CMAKE_CURRENT_BINARY_DIR}/privateinclude
${CMAKE_CURRENT_SOURCE_DIR}
@@ -224,7 +227,7 @@
add_executable(${_name} ${_sources})
set_target_properties(${_name} PROPERTIES VERSION ${OSMSCOUT_LIBRARY_VERSION} SOVERSION ${OSMSCOUT_LIBRARY_VERSION} FOLDER "Tests")
target_link_libraries(${_name} ${_targets})
- install(TARGETS ${_name} RUNTIME DESTINATION share/osmscout/tests LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
+ install(TARGETS ${_name} RUNTIME DESTINATION share/osmscout/tests BUNDLE DESTINATION share/osmscout/tests LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
target_include_directories(${_name} PRIVATE ${_includes})
if(WIN32)
create_win32_test_resource(${_name})
@@ -233,11 +236,11 @@
add_test(NAME ${_name} COMMAND ${_name} ${_command} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
if(MSVC)
set(qt5_bin "")
- if(Qt5_FOUND AND MSVC AND TARGET Qt5::qmake)
- get_target_property(_qt5_qmake_location Qt5::qmake IMPORTED_LOCATION)
- execute_process(COMMAND "${_qt5_qmake_location}" -query QT_INSTALL_PREFIX RESULT_VARIABLE return_code OUTPUT_VARIABLE qt5_install_prefix OUTPUT_STRIP_TRAILING_WHITESPACE)
- file(TO_NATIVE_PATH "${qt5_install_prefix}" qt5_install_prefix)
- set(qt5_bin ";${qt5_install_prefix}\\bin")
+ if(QT_FOUND AND MSVC AND TARGET Qt::qmake)
+ get_target_property(_qt_qmake_location Qt::qmake IMPORTED_LOCATION)
+ execute_process(COMMAND "${_qt_qmake_location}" -query QT_INSTALL_PREFIX RESULT_VARIABLE return_code OUTPUT_VARIABLE qt5_install_prefix OUTPUT_STRIP_TRAILING_WHITESPACE)
+ file(TO_NATIVE_PATH "${qt_install_prefix}" qt5_install_prefix)
+ set(qt5_bin ";${qt_install_prefix}\\bin")
endif()
set(envpath "PATH=$<TARGET_FILE_DIR:OSMScout>${qt5_bin}")
get_target_property(envpath_user OSMScout BINARY_DIR)
@@ -253,7 +256,7 @@
endif()
endforeach()
set_tests_properties(${_name} PROPERTIES ENVIRONMENT "${envpath};$ENV{PATH}")
- file(TO_NATIVE_PATH "${CMAKE_SOURCE_DIR}" working_directory)
+ file(TO_NATIVE_PATH "${PROJECT_SOURCE_DIR}" working_directory)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${_name}.vcxproj.user "<?xml version=\"1.0\" encoding=\"utf-8\"?>
<Project ToolsVersion=\"15.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">
<PropertyGroup>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/cmake/features.cmake
^
|
@@ -80,6 +80,7 @@
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:SSE2")
endif()
endif()
+
if(CMAKE_COMPILER_IS_GNUCXX)
check_cxx_compiler_flag(-fvisibility=hidden HAVE_VISIBILITY)
if(HAVE_VISIBILITY)
@@ -104,7 +105,7 @@
check_include_file(sys/types.h HAVE_SYS_TYPES_H)
check_include_file(unistd.h HAVE_UNISTD_H)
check_include_file_cxx(codecvt HAVE_CODECVT)
-if(${HAVE_STDINT_H} AND ${HAVE_STDLIB_H} AND ${HAVE_INTTYPES_H} AND ${HAVE_STRING_H} AND ${HAVE_MEMORY_H})
+if(HAVE_STDINT_H AND HAVE_STDLIB_H AND HAVE_INTTYPES_H AND HAVE_STRING_H AND HAVE_MEMORY_H)
set(STDC_HEADERS ON)
else()
set(STDC_HEADERS OFF)
@@ -133,17 +134,21 @@
check_function_exists(posix_madvise HAVE_POSIX_MADVISE)
check_function_exists(mallinfo HAVE_MALLINFO)
-# prefer static libraries if shared are disabled
-if(NOT BUILD_SHARED_LIBS AND (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX OR CMAKE_COMPILER_IS_GNUCC))
- set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
+# prefer static libraries if shared are disabled
+if(NOT BUILD_SHARED_LIBS AND (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX OR CMAKE_COMPILER_IS_GNUCC))
+ set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif()
# check libraries and tools
if(NOT IOS)
find_package(Marisa)
endif()
-find_package(LibXml2)
-if (LIBXML2_FOUND AND NOT BUILD_SHARED_LIBS)
+set(HAVE_LIB_MARISA ${MARISA_FOUND})
+set(OSMSCOUT_HAVE_LIB_MARISA ${HAVE_LIB_MARISA})
+set(OSMSCOUT_IMPORT_HAVE_LIB_MARISA ${MARISA_FOUND})
+
+find_package(LibXml2 QUIET)
+if (TARGET LibXml2::LibXml2 AND NOT BUILD_SHARED_LIBS)
# seems that FindLibXml2.cmake don't handle static libraries properly
# as a workaround we append PC_LIBXML_STATIC_LIBRARIES to LIBXML2_LIBRARIES
set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${PC_LIBXML_STATIC_LIBRARIES})
@@ -155,15 +160,47 @@
list(APPEND LIBXML2_LIBRARIES "dl")
endif()
endif()
-find_package(Protobuf)
-if (${PROTOBUF_FOUND} AND NOT EXISTS ${PROTOBUF_PROTOC_EXECUTABLE})
+set(HAVE_LIB_XML $<TARGET_EXISTS:LibXml2>)
+set(OSMSCOUT_GPX_HAVE_LIB_XML $<TARGET_EXISTS:LibXml2>)
+
+find_package(Protobuf QUIET)
+if (TARGET protobuf::libprotobuf AND NOT EXISTS ${PROTOBUF_PROTOC_EXECUTABLE})
message(STATUS "Protobuf library found, but protoc compiler is missing")
- set(PROTOBUF_FOUND FALSE)
endif()
-find_package(ZLIB)
-find_package(iconv)
-find_package(LibLZMA)
+set(HAVE_LIB_PROTOBUF $<TARGET_EXISTS:protobuf::libprotobuf>)
+
+find_package(ZLIB QUIET)
+set(HAVE_LIB_ZLIB $<TARGET_EXISTS:ZLIB::ZLIB>)
+
+find_package(Iconv QUIET)
+if(TARGET Iconv::Iconv)
+ set(HAVE_ICONV TRUE)
+
+ cmake_push_check_state(RESET)
+ set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
+ set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
+ if(MSVC)
+ set(CMAKE_REQUIRED_FLAGS /we4028 /fp:fast /wd4251 /Oi)
+ endif()
+ check_prototype_definition("iconv"
+ "size_t iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)"
+ "-1"
+ "iconv.h"
+ ICONV_SECOND_ARGUMENT_IS_CONST)
+ cmake_pop_check_state()
+
+ if(${ICONV_SECOND_ARGUMENT_IS_CONST})
+ set(ICONV_CONST "const")
+ endif()
+else()
+ message(WARNING "No iconv support")
+endif()
+
+find_package(LibLZMA QUIET)
+
find_package(PNG QUIET)
+set(HAVE_LIB_PNG ${PNG_FOUND})
+
find_package(Cairo QUIET)
if(CAIRO_FOUND)
option(CAIRO_STATIC "Switch on if the found cairo library is static" OFF)
@@ -172,15 +209,31 @@
endif()
mark_as_advanced(CAIRO_STATIC)
endif()
-find_package(Agg QUIET)
+set(HAVE_LIB_CAIRO ${CAIRO_FOUND})
+
+find_package(LibAgg QUIET)
+set(HAVE_LIB_AGG ${LIBAGG_FOUND})
+
find_package(Freetype QUIET)
-find_package(PANGO QUIET)
-find_package(HarfBuzz QUIET)
+set(HAVE_LIB_FREETYPE ${FREETYPE_FOUND})
+
+find_package(Pango QUIET)
+set(HAVE_LIB_PANGO ${PANGO_FOUND})
+set(OSMSCOUT_MAP_CAIRO_HAVE_LIB_PANGO ${PANGOCAIRO_FOUND})
+set(OSMSCOUT_MAP_SVG_HAVE_LIB_PANGO ${PANGOFT2_FOUND})
+
+find_package(harfbuzz QUIET)
+set(HAVE_LIB_HARFBUZZ $<TARGET_EXISTS:harfbuzz::harfbuzz>)
+
set(OpenGL_GL_PREFERENCE "GLVND") # Prever non-legacy OpenGL libraries
find_package(OpenGL QUIET)
+set(HAVE_LIB_OPENGL ${OPENGL_FOUND})
+
find_package(GLEW QUIET)
-find_package(GLM QUIET)
-if(NOT GLM_FOUND)
+
+find_package(glm QUIET)
+if(NOT TARGET glm)
+ message(STATUS "glm NOT found")
find_package(Git QUIET)
if(Git_FOUND)
option(OSMSCOUT_DOWNLOAD_GLM_IF_NOT_FOUND "Load GLM via Git automatically if the library was not found offline" OFF)
@@ -196,13 +249,108 @@
mark_as_advanced(OSMSCOUT_DOWNLOAD_GLM_IF_NOT_FOUND)
endif()
endif()
-find_package(GLFW QUIET)
-find_package(Qt5 5.6 COMPONENTS Core Gui Widgets Qml Quick Svg Positioning Multimedia LinguistTools QUIET)
-if(Qt5_FOUND)
+
+find_package(glfw3 QUIET)
+
+if (QT_VERSION_PREFERRED AND QT_VERSION_PREFERRED EQUAL 5)
+ message(STATUS "Try loading Qt5 (explicitly preferred)...")
+ set(QT5_TRIED 1)
+ set(QT_DEFAULT_MAJOR_VERSION 5)
+ find_package(Qt5 5.15 COMPONENTS Core Gui Widgets Qml Quick Svg Location Positioning Multimedia LinguistTools QUIET)
+ if(Qt5_FOUND)
+ message(STATUS "Choosing Qt5, since explicitly preferred")
+ set(QT_FOUND 1)
+ set(QT_VERSION_MAJOR 5)
+ else ()
+ message(STATUS "Qt5 NOT found")
+ endif()
+endif ()
+
+if (QT_VERSION_PREFERRED AND QT_VERSION_PREFERRED EQUAL 6)
+ message(STATUS "Try loading preferred Qt6 (explicitly preferred)...")
+ set(QT6_TRIED 1)
+ set(QT_DEFAULT_MAJOR_VERSION 6)
+ find_package(Qt6 COMPONENTS Core Core5Compat Gui Widgets Qml Quick Svg Positioning Multimedia LinguistTools QUIET)
+ if(Qt6_FOUND)
+ message(STATUS "Choosing Qt6, since explicitly preferred")
+ set(QT_FOUND 1)
+ set(QT_VERSION_MAJOR 6)
+ else ()
+ message(STATUS "Qt6 NOT found")
+ endif()
+endif()
+
+if (NOT QT_FOUND AND NOT QT5_TRIED)
+ message(STATUS "Try loading Qt5 (implicitly preferred version)...")
+ set(QT_DEFAULT_MAJOR_VERSION 5)
+ find_package(Qt5 5.15 COMPONENTS Core Gui Widgets Qml Quick Svg Location Positioning Multimedia LinguistTools QUIET)
+endif ()
+
+if(NOT QT_FOUND)
+ if (Qt5_FOUND)
+ message(STATUS "Choosing Qt5, since implicitly preferred")
+ set(QT_FOUND 1)
+ set(QT_VERSION_MAJOR 5)
+ else ()
+ message(STATUS "Qt5 NOT found")
+ endif ()
+endif ()
+
+if (NOT QT_FOUND AND NOT QT6_TRIED)
+ message(STATUS "Try loading Qt6 (implicitly preferred version)...")
+ set(QT_DEFAULT_MAJOR_VERSION 6)
+ find_package(Qt6 COMPONENTS Core Core5Compat Gui Widgets Qml Quick Svg Positioning Multimedia LinguistTools QUIET)
+endif()
+
+if (NOT QT_FOUND)
+ if (Qt6_FOUND)
+ message(STATUS "Choosing Qt6, since implicitly preferred")
+ set(QT_FOUND 1)
+ set(QT_VERSION_MAJOR 6)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/cmake/libosmscoutConfig.cmake.in
^
|
@@ -44,7 +44,7 @@
add_library(OSMScout::${COMPONENT} SHARED IMPORTED)
foreach(CFG DEBUG RELEASE)
set_property(TARGET OSMScout::${COMPONENT} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${CFG})
- find_library(LIBOSMSCOUT_OSMScout${COMPONENT}_LIB_${CFG} NAME ${OUTPUT}${LIBOSMSCOUT_${CFG}_POSTFIX} HINTS ${LIBOSMSCOUT_LIBRARY_DIRS})
+ find_library(LIBOSMSCOUT_OSMScout${COMPONENT}_LIB_${CFG} NAME ${OUTPUT}${LIBOSMSCOUT_${CFG}_POSTFIX} ${OUTPUT}${LIBOSMSCOUT_DEBUG_POSTFIX} ${OUTPUT}${LIBOSMSCOUT_RELEASE_POSTFIX} HINTS ${LIBOSMSCOUT_LIBRARY_DIRS})
set_target_properties(OSMScout::${COMPONENT} PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${LIBOSMSCOUT_INCLUDE_DIRS}
IMPORTED_IMPLIB_${CFG} ${LIBOSMSCOUT_OSMScout${COMPONENT}_LIB_${CFG}}
@@ -60,14 +60,14 @@
set(LIBOSMSCOUT_FOUND TRUE)
add_library(OSMScout::OSMScout SHARED IMPORTED)
set_property(TARGET OSMScout::OSMScout APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
-find_library(LIBOSMSCOUT_OSMScout_LIB_DEBUG NAME osmscout${LIBOSMSCOUT_DEBUG_POSTFIX} HINTS ${LIBOSMSCOUT_LIBRARY_DIRS})
+find_library(LIBOSMSCOUT_OSMScout_LIB_DEBUG NAMES osmscout${LIBOSMSCOUT_DEBUG_POSTFIX} osmscout${LIBOSMSCOUT_RELEASE_POSTFIX} HINTS ${LIBOSMSCOUT_LIBRARY_DIRS})
set_target_properties(OSMScout::OSMScout PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${LIBOSMSCOUT_INCLUDE_DIRS}
IMPORTED_IMPLIB_DEBUG ${LIBOSMSCOUT_OSMScout_LIB_DEBUG}
IMPORTED_LOCATION_DEBUG ${LIBOSMSCOUT_OSMScout_LIB_DEBUG}
)
set_property(TARGET OSMScout::OSMScout APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
-find_library(LIBOSMSCOUT_OSMScout_LIB_RELEASE NAME osmscout${LIBOSMSCOUT_RELEASE_POSTFIX} HINTS ${LIBOSMSCOUT_LIBRARY_DIRS})
+find_library(LIBOSMSCOUT_OSMScout_LIB_RELEASE NAMES osmscout${LIBOSMSCOUT_RELEASE_POSTFIX} osmscout${LIBOSMSCOUT_DEBUG_POSTFIX} HINTS ${LIBOSMSCOUT_LIBRARY_DIRS})
set_target_properties(OSMScout::OSMScout PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${LIBOSMSCOUT_INCLUDE_DIRS}
IMPORTED_IMPLIB_RELEASE ${LIBOSMSCOUT_OSMScout_LIB_RELEASE}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/CMakeLists.txt
^
|
@@ -5,7 +5,6 @@
include/osmscoutclientqt/AdminRegionInfo.h
include/osmscoutclientqt/ClientQtImportExport.h
include/osmscoutclientqt/DBThread.h
- include/osmscoutclientqt/DBInstance.h
include/osmscoutclientqt/ElevationChartWidget.h
include/osmscoutclientqt/ElevationModule.h
include/osmscoutclientqt/FileDownloader.h
@@ -15,7 +14,6 @@
include/osmscoutclientqt/LocationEntry.h
include/osmscoutclientqt/LocationInfoModel.h
include/osmscoutclientqt/MapWidget.h
- include/osmscoutclientqt/OnlineTileProvider.h
include/osmscoutclientqt/OnlineTileProviderModel.h
include/osmscoutclientqt/OpeningHoursModel.h
include/osmscoutclientqt/OsmTileDownloader.h
@@ -23,9 +21,7 @@
include/osmscoutclientqt/RoutingModel.h
include/osmscoutclientqt/Router.h
include/osmscoutclientqt/SearchLocationModel.h
- include/osmscoutclientqt/Settings.h
include/osmscoutclientqt/TileCache.h
- include/osmscoutclientqt/MapProvider.h
include/osmscoutclientqt/AvailableMapsModel.h
include/osmscoutclientqt/PersistentCookieJar.h
include/osmscoutclientqt/MapManager.h
@@ -51,7 +47,9 @@
include/osmscoutclientqt/NavigationModel.h
include/osmscoutclientqt/VehiclePosition.h
include/osmscoutclientqt/QmlRoutingProfile.h
+ include/osmscoutclientqt/QmlSettings.h
include/osmscoutclientqt/QtRouteData.h
+ include/osmscoutclientqt/QtSettingsStorage.h
include/osmscoutclientqt/RouteStep.h
include/osmscoutclientqt/NearPOIModel.h
include/osmscoutclientqt/POILookupModule.h
@@ -59,13 +57,11 @@
include/osmscoutclientqt/Voice.h
include/osmscoutclientqt/VoiceManager.h
include/osmscoutclientqt/AvailableVoicesModel.h
- include/osmscoutclientqt/VoiceProvider.h
include/osmscoutclientqt/InstalledVoicesModel.h
)
set(SOURCE_FILES
src/osmscoutclientqt/DBThread.cpp
- src/osmscoutclientqt/DBInstance.cpp
src/osmscoutclientqt/ElevationChartWidget.cpp
src/osmscoutclientqt/ElevationModule.cpp
src/osmscoutclientqt/FileDownloader.cpp
@@ -75,7 +71,6 @@
src/osmscoutclientqt/LocationEntry.cpp
src/osmscoutclientqt/LocationInfoModel.cpp
src/osmscoutclientqt/MapWidget.cpp
- src/osmscoutclientqt/OnlineTileProvider.cpp
src/osmscoutclientqt/OnlineTileProviderModel.cpp
src/osmscoutclientqt/OpeningHoursModel.cpp
src/osmscoutclientqt/OSMTile.cpp
@@ -83,9 +78,7 @@
src/osmscoutclientqt/RoutingModel.cpp
src/osmscoutclientqt/Router.cpp
src/osmscoutclientqt/SearchLocationModel.cpp
- src/osmscoutclientqt/Settings.cpp
src/osmscoutclientqt/TileCache.cpp
- src/osmscoutclientqt/MapProvider.cpp
src/osmscoutclientqt/AvailableMapsModel.cpp
src/osmscoutclientqt/MapManager.cpp
src/osmscoutclientqt/MapDownloadsModel.cpp
@@ -111,27 +104,41 @@
src/osmscoutclientqt/VehiclePosition.cpp
src/osmscoutclientqt/RouteStep.cpp
src/osmscoutclientqt/QmlRoutingProfile.cpp
+ src/osmscoutclientqt/QmlSettings.cpp
src/osmscoutclientqt/QtRouteData.cpp
+ src/osmscoutclientqt/QtSettingsStorage.cpp
src/osmscoutclientqt/NearPOIModel.cpp
src/osmscoutclientqt/POILookupModule.cpp
src/osmscoutclientqt/InstalledMapsModel.cpp
src/osmscoutclientqt/Voice.cpp
src/osmscoutclientqt/VoiceManager.cpp
src/osmscoutclientqt/AvailableVoicesModel.cpp
- src/osmscoutclientqt/VoiceProvider.cpp
src/osmscoutclientqt/InstalledVoicesModel.cpp
)
-osmscout_library_project(
- NAME OSMScoutClientQt
- ALIAS ClientQt
- OUTPUT_NAME "osmscout_client_qt"
- SOURCE ${SOURCE_FILES}
- HEADER ${HEADER_FILES}
- INCLUDEDIR osmscoutclientqt
- TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/include/osmscoutclientqt/ClientQtFeatures.h.cmake
- TARGET OSMScout::OSMScout OSMScout::Map OSMScout::MapQt Qt5::Core Qt5::Gui Qt5::Quick Qt5::Multimedia OSMScout::Client
-)
+if (QT_VERSION_MAJOR EQUAL 6)
+ osmscout_library_project(
+ NAME OSMScoutClientQt
+ ALIAS ClientQt
+ OUTPUT_NAME "osmscout_client_qt"
+ SOURCE ${SOURCE_FILES}
+ HEADER ${HEADER_FILES}
+ INCLUDEDIR osmscoutclientqt
+ TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/include/osmscoutclientqt/ClientQtFeatures.h.cmake
+ TARGET OSMScout::OSMScout OSMScout::Map OSMScout::MapQt Qt5::Core Qt6::Core5Compat Qt5::Gui Qt5::Quick Qt5::Multimedia OSMScout::Client
+ )
+else ()
+ osmscout_library_project(
+ NAME OSMScoutClientQt
+ ALIAS ClientQt
+ OUTPUT_NAME "osmscout_client_qt"
+ SOURCE ${SOURCE_FILES}
+ HEADER ${HEADER_FILES}
+ INCLUDEDIR osmscoutclientqt
+ TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/include/osmscoutclientqt/ClientQtFeatures.h.cmake
+ TARGET OSMScout::OSMScout OSMScout::Map OSMScout::MapQt Qt5::Core Qt5::Gui Qt5::Quick Qt5::Multimedia OSMScout::Client
+ )
+endif ()
if(MARISA_FOUND)
target_include_directories(OSMScoutClientQt PUBLIC ${MARISA_INCLUDE_DIRS})
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/meson.build
^
|
@@ -4,7 +4,6 @@
'osmscoutclientqt/AdminRegionInfo.h',
'osmscoutclientqt/ClientQtImportExport.h',
'osmscoutclientqt/DBThread.h',
- 'osmscoutclientqt/DBInstance.h',
'osmscoutclientqt/ElevationChartWidget.h',
'osmscoutclientqt/ElevationModule.h',
'osmscoutclientqt/RoutingModel.h',
@@ -12,23 +11,22 @@
'osmscoutclientqt/RouteDescriptionBuilder.h',
'osmscoutclientqt/RouteStep.h',
'osmscoutclientqt/QmlRoutingProfile.h',
+ 'osmscoutclientqt/QmlSettings.h',
'osmscoutclientqt/QtRouteData.h',
+ 'osmscoutclientqt/QtSettingsStorage.h',
'osmscoutclientqt/NavigationModule.h',
'osmscoutclientqt/NavigationModel.h',
'osmscoutclientqt/VehiclePosition.h',
'osmscoutclientqt/InputHandler.h',
- 'osmscoutclientqt/OnlineTileProvider.h',
'osmscoutclientqt/OnlineTileProviderModel.h',
'osmscoutclientqt/OpeningHoursModel.h',
'osmscoutclientqt/SearchLocationModel.h',
- 'osmscoutclientqt/Settings.h',
'osmscoutclientqt/MapWidget.h',
'osmscoutclientqt/LocationEntry.h',
'osmscoutclientqt/LocationInfoModel.h',
'osmscoutclientqt/OsmTileDownloader.h',
'osmscoutclientqt/OSMTile.h',
'osmscoutclientqt/TileCache.h',
- 'osmscoutclientqt/MapProvider.h',
'osmscoutclientqt/AvailableMapsModel.h',
'osmscoutclientqt/FileDownloader.h',
'osmscoutclientqt/IconAnimation.h',
@@ -57,7 +55,6 @@
'osmscoutclientqt/Voice.h',
'osmscoutclientqt/VoiceManager.h',
'osmscoutclientqt/AvailableVoicesModel.h',
- 'osmscoutclientqt/VoiceProvider.h',
'osmscoutclientqt/InstalledVoicesModel.h',
]
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/AvailableMapsModel.h
^
|
@@ -25,8 +25,10 @@
#include <QNetworkDiskCache>
#include <QNetworkReply>
-#include <osmscoutclientqt/MapProvider.h>
-#include <osmscoutclientqt/Settings.h>
+#include <osmscoutclient/MapProvider.h>
+#include <osmscoutclient/Settings.h>
+
+#include <osmscoutclientqt/ClientQtImportExport.h>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/AvailableVoicesModel.h
^
|
@@ -20,12 +20,13 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <osmscoutclientqt/VoiceProvider.h>
+#include <osmscoutclientqt/ClientQtImportExport.h>
+
+#include <osmscoutclient/VoiceProvider.h>
+
#include <osmscoutclientqt/VoiceManager.h>
#include <osmscoutclientqt/Voice.h>
-#include <osmscoutclientqt/ClientQtImportExport.h>
-
#include <QAbstractListModel>
#include <QNetworkDiskCache>
#include <QNetworkAccessManager>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/DBJob.h
^
|
@@ -25,6 +25,7 @@
#include <QList>
#include <QThread>
#include <QReadWriteLock>
+#include <QMap>
#include <osmscout/projection/MercatorProjection.h>
@@ -32,7 +33,8 @@
#include <osmscoutmap/DataTileCache.h>
-#include <osmscoutclientqt/DBInstance.h>
+#include <osmscoutclient/DBInstance.h>
+
#include <osmscoutclientqt/ClientQtImportExport.h>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/DBThread.h
^
|
@@ -22,11 +22,9 @@
*/
#include <QThread>
-#include <QMetaType>
-#include <QMutex>
-#include <QTime>
-#include <QTimer>
+#include <QObject>
#include <QReadWriteLock>
+#include <QDir>
#include <osmscout/db/BasemapDatabase.h>
#include <osmscout/db/Database.h>
@@ -34,14 +32,12 @@
#include <osmscout/location/LocationService.h>
#include <osmscoutmap/MapService.h>
-#include <osmscoutmapqt/MapPainterQt.h>
-#include <osmscoutclientqt/Settings.h>
-#include <osmscoutclientqt/TileCache.h>
-#include <osmscoutclientqt/OsmTileDownloader.h>
-#include <osmscoutclientqt/MapManager.h>
-#include <osmscoutclientqt/DBInstance.h>
+#include <osmscoutclient/DBInstance.h>
+#include <osmscoutclient/Settings.h>
+
#include <osmscoutclientqt/DBJob.h>
+#include <osmscoutclientqt/MapManager.h>
namespace osmscout {
@@ -116,6 +112,8 @@
void databaseLoadFinished(osmscout::GeoBox boundingBox);
void styleErrorsChanged();
+ void mapDpiSignal(double);
+
public slots:
void ToggleDaylight();
void onMapDPIChange(double dpi);
@@ -139,7 +137,6 @@
SettingsRef settings;
double mapDpi;
- double physicalDpi;
mutable QReadWriteLock lock;
@@ -158,10 +155,16 @@
bool daylight;
bool renderError;
- QList<StyleError> styleErrors;
+ std::list<StyleError> styleErrors;
std::vector<std::string> customPoiTypes;
+ Slot<double> mapDpiSlot{
+ [this](const double &d) {
+ mapDpiSignal(d);
+ }
+ };
+
protected:
/**
@@ -184,7 +187,7 @@
void registerCustomPoiTypes(TypeConfigRef typeConfig) const;
- StyleConfigRef makeStyleConfig(TypeConfigRef typeConfig) const;
+ StyleConfigRef makeStyleConfig(TypeConfigRef typeConfig, bool suppressWarnings=false) const;
public:
DBThread(QThread *backgroundThread,
@@ -220,7 +223,7 @@
return stylesheetFilename;
}
- const QList<StyleError> &GetStyleErrors() const
+ const std::list<StyleError> &GetStyleErrors() const
{
return styleErrors;
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/IconAnimation.h
^
|
@@ -29,6 +29,7 @@
#include <QObject>
#include <QTimer>
#include <QPainter>
+#include <QElapsedTimer>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/IconLookup.h
^
|
@@ -30,6 +30,9 @@
#include <QObject>
#include <QSettings>
#include <QMutex>
+#include <QPoint>
+#include <QRectF>
+#include <QImage>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/InstalledVoicesModel.h
^
|
@@ -19,15 +19,17 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+
+#include <osmscoutclient/Settings.h>
+
#include <osmscoutclientqt/VoiceManager.h>
#include <osmscoutclientqt/Voice.h>
-#include <osmscoutclientqt/Settings.h>
#include <osmscoutclientqt/ClientQtImportExport.h>
#include <QAbstractListModel>
#include <QList>
#include <QMediaPlayer>
-#if QT_VERSION < 0x060000
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QMediaPlaylist>
#endif
@@ -44,6 +46,11 @@
class OSMSCOUT_CLIENT_QT_API InstalledVoicesModel : public QAbstractListModel {
Q_OBJECT
+private:
+ Slot<std::string> voiceDirSlot{
+ [this](const std::string &dir){ onVoiceChanged(QString::fromStdString(dir)); }
+ };
+
signals:
void voiceChanged(const QString);
@@ -82,7 +89,7 @@
SettingsRef settings;
// we setup QObject parents, objects are cleaned after Module destruction
-#if QT_VERSION < 0x060000
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QMediaPlaylist *currentPlaylist{nullptr};
#endif
QMediaPlayer *mediaPlayer{nullptr};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/LookupModule.h
^
|
@@ -24,6 +24,8 @@
#include <QObject>
#include <QThread>
+#include <QRectF>
+#include <QMutex>
#include <osmscout/location/LocationDescriptionService.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/MapDownloadsModel.h
^
|
@@ -20,18 +20,17 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <osmscoutclientqt/ClientQtImportExport.h>
+
+#include <osmscoutclientqt/MapManager.h>
+#include <osmscoutclientqt/DBThread.h>
+
#include <QObject>
#include <QStringList>
#include <QList>
#include <QDir>
#include <QTimer>
-#include <osmscoutclientqt/ClientQtImportExport.h>
-
-#include <osmscoutclientqt/MapProvider.h>
-#include <osmscoutclientqt/MapManager.h>
-#include <osmscoutclientqt/DBThread.h>
-
namespace osmscout {
/**
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/MapManager.h
^
|
@@ -20,19 +20,19 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <QObject>
-#include <QStringList>
-#include <QList>
-#include <QDir>
-#include <QTimer>
-
#include <osmscoutclientqt/ClientQtImportExport.h>
-#include <osmscoutclientqt/MapProvider.h>
-#include <osmscoutclientqt/Settings.h>
+#include <osmscoutclient/MapProvider.h>
+#include <osmscoutclient/Settings.h>
+
#include <osmscoutclientqt/AvailableMapsModel.h>
#include <osmscoutclientqt/FileDownloader.h>
+#include <QObject>
+#include <QStringList>
+#include <QList>
+#include <QDir>
+#include <QTimer>
#include <QtGlobal>
#include <QStorageInfo>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/MapRenderer.h
^
|
@@ -31,6 +31,7 @@
#include <QObject>
#include <QSettings>
#include <QMutex>
+#include <QPainter>
namespace osmscout {
@@ -110,6 +111,51 @@
void Redraw();
void TriggerDrawMap();
+ void mapDpiChangeSignal(double);
+ void renderSeaSignal(bool);
+ void fontNameSignal(QString);
+ void fontSizeSignal(double);
+ void showAltLanguageSignal(bool);
+ void unitsSignal(QString);
+
+private:
+ // slots
+ Slot<double> mapDpiChangeSlot{
+ [this](const double &d){
+ mapDpiChangeSignal(d);
+ }
+ };
+
+ Slot<bool> renderSeaSlot{
+ [this](const bool &b){
+ renderSeaSignal(b);
+ }
+ };
+
+ Slot<std::string> fontNameSlot{
+ [this](const std::string &str){
+ fontNameSignal(QString::fromStdString(str));
+ }
+ };
+
+ Slot<double> fontSizeSlot{
+ [this](const double &d){
+ fontSizeSignal(d);
+ }
+ };
+
+ Slot<bool> showAltLanguageSlot{
+ [this](const bool &b){
+ showAltLanguageSignal(b);
+ }
+ };
+
+ Slot<std::string> unitsSlot{
+ [this](const std::string &str){
+ unitsSignal(QString::fromStdString(str));
+ }
+ };
+
public slots:
virtual void Initialize() = 0;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/MapWidget.h
^
|
@@ -275,6 +275,13 @@
void onIconFound(QPoint lookupCoord, MapIcon icon);
+private:
+ Slot<double> mapDpiSlot{
+ [this](const double &d) {
+ this->onMapDPIChange(d);
+ }
+ };
+
private slots:
virtual void onTap(const QPoint p);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/NavigationModel.h
^
|
@@ -22,6 +22,7 @@
#include <osmscoutclientqt/NavigationModule.h>
#include <osmscoutclientqt/OverlayObject.h>
+#include <osmscoutclientqt/VehiclePosition.h>
#include <osmscoutclientqt/ClientQtImportExport.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/NavigationModule.h
^
|
@@ -20,8 +20,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <osmscoutclient/Settings.h>
+
#include <osmscoutclientqt/DBThread.h>
-#include <osmscoutclientqt/Settings.h>
#include <osmscoutclientqt/Router.h>
#include <osmscout/navigation/Navigation.h>
@@ -44,7 +45,7 @@
#include <QTimer>
#include <QMediaPlayer>
-#if QT_VERSION < 0x060000
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QMediaPlaylist>
#endif
@@ -52,7 +53,7 @@
namespace osmscout {
-#if QT_VERSION < 0x060000
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
using QtMediaPlayerState = QMediaPlayer::State;
#else
using QtMediaPlayerState = QMediaPlayer::PlaybackState;
@@ -65,6 +66,11 @@
class OSMSCOUT_CLIENT_QT_API NavigationModule: public QObject {
Q_OBJECT
+private:
+ Slot<std::string> voiceDirSlot{
+ [this](const std::string &str) { onVoiceChanged(QString::fromStdString(str)); }
+ };
+
signals:
void update(std::list<RouteStep> instructions);
@@ -136,7 +142,7 @@
QString voiceDir;
// player and playlist should be created in module thread, not in UI thread (constructor)
// we setup QObject parents, objects are cleaned after Module destruction
-#if QT_VERSION < 0x060000
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QMediaPlaylist *currentPlaylist{nullptr};
#endif
QMediaPlayer *mediaPlayer{nullptr};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/OSMScoutQt.h
^
|
@@ -78,6 +78,10 @@
virtual ~OSMScoutQtBuilder();
+ /** Set custom settings storage. OSMScout library takes ownership.
+ * @param providedStorage
+ * @return
+ */
inline OSMScoutQtBuilder& WithSettingsStorage(QSettings *providedStorage)
{
this->settingsStorage=providedStorage;
@@ -325,7 +329,4 @@
}
-Q_DECLARE_METATYPE(osmscout::TileRef)
-Q_DECLARE_METATYPE(osmscout::BreakerRef)
-
#endif /* OSMSCOUT_CLIENT_QT_OSMSCOUTQT_H */
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/OnlineTileProviderModel.h
^
|
@@ -22,7 +22,8 @@
#include <QAbstractListModel>
-#include <osmscoutclientqt/OnlineTileProvider.h>
+#include <osmscoutclient/OnlineTileProvider.h>
+
#include <osmscoutclientqt/DBThread.h>
#include <osmscoutclientqt/OSMScoutQt.h>
@@ -85,7 +86,10 @@
inline OnlineTileProviderModel()
{
auto settings=OSMScoutQt::GetInstance().GetSettings();
- onlineProviders=settings->GetOnlineProviders();
+ auto providers=settings->GetOnlineProviders();
+ for (const auto &provider: providers) {
+ onlineProviders << provider;
+ }
};
virtual inline ~OnlineTileProviderModel(){};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/OsmTileDownloader.h
^
|
@@ -28,9 +28,10 @@
#include <QImage>
#include <QNetworkDiskCache>
+#include <osmscoutclient/OnlineTileProvider.h>
+#include <osmscoutclient/Settings.h>
+
#include <osmscoutclientqt/TileCache.h>
-#include <osmscoutclientqt/OnlineTileProvider.h>
-#include <osmscoutclientqt/Settings.h>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/PersistentCookieJar.h
^
|
@@ -87,14 +87,14 @@
}
}
- settings->SetCookieData(data);
+ settings->SetCookieData(std::vector<char>(data.data(), data.data() + data.size()));
}
void load()
{
QMutexLocker lock(&mutex);
- const QByteArray data = settings->GetCookieData();
- setAllCookies(QNetworkCookie::parseCookies(data));
+ const auto data = settings->GetCookieData();
+ setAllCookies(QNetworkCookie::parseCookies(QByteArray(data.data(), data.size())));
}
mutable QMutex mutex;
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/QmlSettings.h
^
|
@@ -0,0 +1,163 @@
+#ifndef OSMSCOUT_CLIENT_QT_QMLSETTINGS_H
+#define OSMSCOUT_CLIENT_QT_QMLSETTINGS_H
+
+/*
+ OSMScout - a Qt backend for libosmscout and libosmscout-map
+ Copyright (C) 2023 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscoutclientqt/ClientQtImportExport.h>
+
+#include <osmscoutclient/Settings.h>
+
+#include <QObject>
+
+namespace osmscout {
+
+/**
+ * \ingroup QtAPI
+ *
+ * Provides interface to Settings object from QML. It should be registered
+ * by qmlRegisterType before first use.
+ *
+ * ```
+ * qmlRegisterType<QmlSettings>("net.sf.libosmscout.map", 1, 0, "Settings");
+ * ```
+ *
+ * It may be imported and used in QML then:
+ * ```
+ * import net.sf.libosmscout.map 1.0
+ *
+ * Settings {
+ * id: settings
+ * }
+ * ```
+ */
+class OSMSCOUT_CLIENT_QT_API QmlSettings: public QObject{
+Q_OBJECT
+ Q_PROPERTY(double physicalDPI READ GetPhysicalDPI CONSTANT)
+ Q_PROPERTY(double mapDPI READ GetMapDPI WRITE SetMapDPI NOTIFY MapDPIChange)
+ Q_PROPERTY(bool onlineTiles READ GetOnlineTilesEnabled WRITE SetOnlineTilesEnabled NOTIFY OnlineTilesEnabledChanged)
+ Q_PROPERTY(QString onlineTileProviderId READ GetOnlineTileProviderId WRITE SetOnlineTileProviderId NOTIFY OnlineTileProviderIdChanged)
+ Q_PROPERTY(bool offlineMap READ GetOfflineMap WRITE SetOfflineMap NOTIFY OfflineMapChanged)
+ Q_PROPERTY(QString styleSheetFile READ GetStyleSheetFile WRITE SetStyleSheetFile NOTIFY StyleSheetFileChanged)
+ Q_PROPERTY(bool renderSea READ GetRenderSea WRITE SetRenderSea NOTIFY RenderSeaChanged)
+ Q_PROPERTY(QString fontName READ GetFontName WRITE SetFontName NOTIFY FontNameChanged)
+ Q_PROPERTY(double fontSize READ GetFontSize WRITE SetFontSize NOTIFY FontSizeChanged)
+ Q_PROPERTY(bool showAltLanguage READ GetShowAltLanguage WRITE SetShowAltLanguage NOTIFY ShowAltLanguageChanged)
+ /// metrics or imperial
+ Q_PROPERTY(QString units READ GetUnits WRITE SetUnits NOTIFY UnitsChanged)
+
+private:
+ SettingsRef settings;
+
+ // slots
+ Slot<double> mapDPISlot{
+ [this](const double &d){ this->MapDPIChange(d); }
+ };
+
+ Slot<bool> onlineTilesEnabledSlot{
+ [this](const bool &b){this->OnlineTilesEnabledChanged(b);}
+ };
+
+ Slot<std::string> onlineTileProviderIdSlot{
+ [this](const std::string &str){ this->OnlineTileProviderIdChanged(QString::fromStdString(str));}
+ };
+
+ Slot<bool> offlineMapSlot{
+ [this](const bool &b){ this->OfflineMapChanged(b);}
+ };
+
+ Slot<std::string> styleSheetFileSlot{
+ [this](const std::string &str){ this->StyleSheetFileChanged(QString::fromStdString(str));}
+ };
+
+ Slot<bool> renderSeaSlot{
+ [this](const bool &b){ this->RenderSeaChanged(b);}
+ };
+
+ Slot<std::string> fontNameSlot{
+ [this](const std::string &str){ this->FontNameChanged(QString::fromStdString(str));}
+ };
+
+ Slot<double> fontSizeSlot{
+ [this](const double &d){ this->FontSizeChanged(d);}
+ };
+
+ Slot<bool> showAltLanguageSlot{
+ [this](const bool &b){ this->ShowAltLanguageChanged(b);}
+ };
+
+ Slot<std::string> unitsSlot{
+ [this](const std::string &str){ this->UnitsChanged(QString::fromStdString(str));}
+ };
+
+signals:
+ void MapDPIChange(double dpi);
+ void OnlineTilesEnabledChanged(bool enabled);
+ void OnlineTileProviderIdChanged(const QString id);
+ void OfflineMapChanged(bool);
+ void StyleSheetFileChanged(const QString file);
+ void RenderSeaChanged(bool);
+ void FontNameChanged(const QString fontName);
+ void FontSizeChanged(double fontSize);
+ void ShowAltLanguageChanged(bool showAltLanguage);
+ void UnitsChanged(const QString units);
+
+public:
+ QmlSettings();
+
+ ~QmlSettings() override = default;
+
+ double GetPhysicalDPI() const;
+
+ void SetMapDPI(double dpi);
+ double GetMapDPI() const;
+
+ bool GetOnlineTilesEnabled() const;
+ void SetOnlineTilesEnabled(bool b);
+
+ const QString GetOnlineTileProviderId() const;
+ void SetOnlineTileProviderId(QString id);
+
+ Q_INVOKABLE QString onlineProviderCopyright();
+
+ bool GetOfflineMap() const;
+ void SetOfflineMap(bool);
+
+ QString GetStyleSheetFile() const;
+ void SetStyleSheetFile(const QString file);
+
+ bool GetRenderSea() const;
+ void SetRenderSea(bool);
+
+ QString GetFontName() const;
+ void SetFontName(const QString fontName);
+
+ double GetFontSize() const;
+ void SetFontSize(double fontSize);
+
+ bool GetShowAltLanguage() const;
+ void SetShowAltLanguage(bool showAltLanguage);
+
+ QString GetUnits() const;
+ void SetUnits(const QString units);
+};
+
+}
+
+#endif //OSMSCOUT_CLIENT_QT_QMLSETTINGS_H
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/QtSettingsStorage.h
^
|
@@ -0,0 +1,60 @@
+#ifndef OSMSCOUT_CLIENT_QT_QTSETTINGSSTORAGE_H
+#define OSMSCOUT_CLIENT_QT_QTSETTINGSSTORAGE_H
+
+/*
+ OSMScout - a Qt backend for libosmscout and libosmscout-map
+ Copyright (C) 2023 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscoutclientqt/ClientQtImportExport.h>
+
+#include <osmscoutclient/Settings.h>
+
+#include <QObject>
+#include <QSettings>
+
+
+namespace osmscout {
+
+ class OSMSCOUT_CLIENT_QT_API QtSettingsStorage: public QObject, public SettingsStorage
+ {
+ private:
+ QSettings *storage;
+ public:
+ /**
+ * @param providedStorage custom provider when not null. Storage takes ownership.
+ * When it is null, default Qt settings is used.
+ */
+ explicit QtSettingsStorage(QSettings *providedStorage=nullptr);
+ virtual ~QtSettingsStorage() = default;
+
+ void SetValue(const std::string &key, double d) override;
+ void SetValue(const std::string &key, uint32_t i) override;
+ void SetValue(const std::string &key, const std::string &str) override;
+ void SetValue(const std::string &key, bool b) override;
+ void SetValue(const std::string &key, std::vector<char> bytes) override;
+ double GetDouble(const std::string &key, double defaultValue = 0) override;
+ uint32_t GetUInt(const std::string &key, uint32_t defaultValue = 0) override;
+ std::string GetString(const std::string &key, const std::string &defaultValue = "") override;
+ bool GetBool(const std::string &key, bool defaultValue = 0) override;
+ std::vector<char> GetBytes(const std::string &key) override;
+
+ std::vector<std::string> Keys(const std::string &prefix) override;
+ };
+
+}
+#endif //OSMSCOUT_CLIENT_QT_QTSETTINGSSTORAGE_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/Router.h
^
|
@@ -30,8 +30,9 @@
#include <osmscoutmap/DataTileCache.h>
+#include <osmscoutclient/Settings.h>
+
#include <osmscoutclientqt/DBThread.h>
-#include <osmscoutclientqt/Settings.h>
#include <osmscoutclientqt/RouteDescriptionBuilder.h>
#include <osmscoutclientqt/QmlRoutingProfile.h>
#include <osmscoutclientqt/LocationEntry.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/SearchModule.h
^
|
@@ -32,6 +32,7 @@
#include <QObject>
#include <QThread>
#include <QRunnable>
+#include <QElapsedTimer>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/StyleModule.h
^
|
@@ -22,6 +22,8 @@
#include <QObject>
#include <QThread>
+#include <QMutex>
+
#include <osmscoutclientqt/DBThread.h>
#include <osmscoutclientqt/ClientQtImportExport.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/TiledMapOverlay.h
^
|
@@ -26,6 +26,7 @@
#include <osmscoutclientqt/ClientQtImportExport.h>
#include <QImage>
+#include <QJsonObject>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/TiledMapRenderer.h
^
|
@@ -25,8 +25,11 @@
#include <QSettings>
#include <osmscoutmap/DataTileCache.h>
+
#include <osmscoutclientqt/DBThread.h>
#include <osmscoutclientqt/MapRenderer.h>
+#include <osmscoutclientqt/TileCache.h>
+#include <osmscoutclientqt/OsmTileDownloader.h>
#include <osmscoutclientqt/ClientQtImportExport.h>
@@ -75,6 +78,23 @@
QColor unknownColor;
+ Slot<OnlineTileProvider> onlineTileProviderSlot{
+ [this](const OnlineTileProvider &provider) { onlineTileProviderSignal(provider); }
+ };
+
+ Slot<bool> onlineTileEnabledSlot{
+ [this](const bool &b) { onlineTilesEnabledSignal(b); }
+ };
+
+ Slot<bool> offlineMapChangedSlot{
+ [this](const bool &b) { offlineMapChangedSignal(b); }
+ };
+
+signals:
+ void onlineTileProviderSignal(OnlineTileProvider provider);
+ void onlineTilesEnabledSignal(bool);
+ void offlineMapChangedSignal(bool);
+
public slots:
virtual void Initialize();
virtual void InvalidateVisualCache();
@@ -87,7 +107,7 @@
void onDatabaseLoaded(osmscout::GeoBox boundingBox);
void onLoadJobFinished(QMap<QString,QMap<osmscout::TileKey,osmscout::TileRef>>);
- void onlineTileProviderChanged();
+ void onlineTileProviderChanged(const OnlineTileProvider &);
void onlineTilesEnabledChanged(bool);
void onOfflineMapChanged(bool);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/Voice.h
^
|
@@ -20,7 +20,8 @@
*/
#include <osmscoutclientqt/ClientQtImportExport.h>
-#include <osmscoutclientqt/VoiceProvider.h>
+
+#include <osmscoutclient/VoiceProvider.h>
#include <QObject>
#include <QDir>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/include/osmscoutclientqt/meson.build
^
|
@@ -1,5 +1,6 @@
clientqtFeaturesCfg = configuration_data()
configure_file(output: 'ClientQtFeatures.h',
+ install_dir: 'include/osmscoutclientqt',
configuration: clientqtFeaturesCfg)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/meson.build
^
|
@@ -26,11 +26,12 @@
osmscoutclientqt = library('osmscout_client_qt',
mocFiles,
osmscoutclientqtSrc,
- include_directories: [osmscoutclientqtIncDir, osmscoutmapqtIncDir, osmscoutmapIncDir, osmscoutIncDir],
+ include_directories: [osmscoutclientqtIncDir, osmscoutclientIncDir, osmscoutmapqtIncDir, osmscoutmapIncDir, osmscoutIncDir],
cpp_args: cppArgs,
dependencies: [mathDep, threadDep, qtClientDep],
link_with: [osmscout, osmscoutmap, osmscoutmapqt, osmscoutclient],
version: libraryVersion,
install: true)
-# TODO: Generate PKG_CONFIG file
+pkg = import('pkgconfig')
+pkg.generate(osmscoutclientqt)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/meson.build
^
|
@@ -1,6 +1,5 @@
osmscoutclientqtSrc = [
'src/osmscoutclientqt/DBThread.cpp',
- 'src/osmscoutclientqt/DBInstance.cpp',
'src/osmscoutclientqt/ElevationChartWidget.cpp',
'src/osmscoutclientqt/ElevationModule.cpp',
'src/osmscoutclientqt/RoutingModel.cpp',
@@ -8,23 +7,22 @@
'src/osmscoutclientqt/RouteDescriptionBuilder.cpp',
'src/osmscoutclientqt/RouteStep.cpp',
'src/osmscoutclientqt/QmlRoutingProfile.cpp',
+ 'src/osmscoutclientqt/QmlSettings.cpp',
'src/osmscoutclientqt/QtRouteData.cpp',
+ 'src/osmscoutclientqt/QtSettingsStorage.cpp',
'src/osmscoutclientqt/NavigationModule.cpp',
'src/osmscoutclientqt/NavigationModel.cpp',
'src/osmscoutclientqt/VehiclePosition.cpp',
'src/osmscoutclientqt/InputHandler.cpp',
- 'src/osmscoutclientqt/OnlineTileProvider.cpp',
'src/osmscoutclientqt/OnlineTileProviderModel.cpp',
'src/osmscoutclientqt/OpeningHoursModel.cpp',
'src/osmscoutclientqt/SearchLocationModel.cpp',
- 'src/osmscoutclientqt/Settings.cpp',
'src/osmscoutclientqt/MapWidget.cpp',
'src/osmscoutclientqt/LocationEntry.cpp',
'src/osmscoutclientqt/LocationInfoModel.cpp',
'src/osmscoutclientqt/OsmTileDownloader.cpp',
'src/osmscoutclientqt/OSMTile.cpp',
'src/osmscoutclientqt/TileCache.cpp',
- 'src/osmscoutclientqt/MapProvider.cpp',
'src/osmscoutclientqt/AvailableMapsModel.cpp',
'src/osmscoutclientqt/FileDownloader.cpp',
'src/osmscoutclientqt/IconAnimation.cpp',
@@ -53,7 +51,6 @@
'src/osmscoutclientqt/Voice.cpp',
'src/osmscoutclientqt/VoiceManager.cpp',
'src/osmscoutclientqt/AvailableVoicesModel.cpp',
- 'src/osmscoutclientqt/VoiceProvider.cpp',
'src/osmscoutclientqt/InstalledVoicesModel.cpp',
]
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/AvailableMapsModel.cpp
^
|
@@ -18,6 +18,7 @@
*/
#include <osmscout/util/String.h>
+
#include <osmscoutclientqt/AvailableMapsModel.h>
#include <osmscoutclientqt/PersistentCookieJar.h>
#include <osmscoutclientqt/DBThread.h>
@@ -25,6 +26,10 @@
#include <QString>
#include <QtAlgorithms>
+#include <QJsonDocument>
+#include <QJsonArray>
+#include <QJsonObject>
+#include <QStandardPaths>
#include <algorithm>
@@ -63,9 +68,12 @@
AvailableMapsModel::AvailableMapsModel()
{
SettingsRef settings = OSMScoutQt::GetInstance().GetSettings();
- mapProviders = settings->GetMapProviders();
+ auto providers = settings->GetMapProviders();
+ for (const auto &provider: providers) {
+ mapProviders << provider;
+ }
- diskCache.setCacheDirectory(settings->GetHttpCacheDir());
+ diskCache.setCacheDirectory(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QDir::separator() + "OSMScoutHttpCache");
webCtrl.setCache(&diskCache);
webCtrl.setCookieJar(new PersistentCookieJar(settings));
@@ -78,13 +86,14 @@
QLocale locale;
for (const auto &provider: mapProviders){
- QUrl url = provider.getListUri(21 ,
- /* 21: routes was added in that version
- * 22: alternative language was added location.idx
- */
- osmscout::TypeConfig::MAX_FORMAT_VERSION,
- locale.name());
- QNetworkRequest request(url);
+ std::string url = provider.getListUri(21 ,
+ /* 21: routes was added in that version
+ * 22: alternative language was added location.idx
+ */
+ osmscout::TypeConfig::MAX_FORMAT_VERSION,
+ locale.name().toStdString());
+
+ QNetworkRequest request(QUrl(QString::fromStdString(url)));
request.setHeader(QNetworkRequest::UserAgentHeader, OSMScoutQt::GetInstance().GetUserAgent());
@@ -310,7 +319,7 @@
case SizeRole:
return map==nullptr ? "": QVariant(map->getSizeHuman());
case ProviderUriRole:
- return map==nullptr ? QVariant(): map->getProvider().getName();
+ return map==nullptr ? QVariant(): QString::fromStdString(map->getProvider().getName());
case DescriptionRole:
return item->getDescription();
case MapRole:
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/AvailableVoicesModel.cpp
^
|
@@ -21,6 +21,11 @@
#include <osmscoutclientqt/PersistentCookieJar.h>
#include <osmscoutclientqt/OSMScoutQt.h>
+#include <QJsonDocument>
+#include <QJsonArray>
+#include <QJsonObject>
+#include <QStandardPaths>
+
#include <algorithm>
namespace osmscout {
@@ -29,9 +34,12 @@
{
SettingsRef settings = OSMScoutQt::GetInstance().GetSettings();
assert(settings);
- voiceProviders = settings->GetVoiceProviders();
+ auto providers = settings->GetVoiceProviders();
+ for (const auto &provider: providers) {
+ voiceProviders << provider;
+ }
- diskCache.setCacheDirectory(settings->GetHttpCacheDir());
+ diskCache.setCacheDirectory(QStandardPaths::writableLocation(QStandardPaths::CacheLocation) + QDir::separator() + "OSMScoutHttpCache");
webCtrl.setCache(&diskCache);
webCtrl.setCookieJar(new PersistentCookieJar(settings));
@@ -69,7 +77,7 @@
QLocale locale;
for (auto &provider: voiceProviders){
- QUrl url = provider.getListUri(locale.name());
+ QUrl url = QUrl(QString::fromStdString(provider.getListUri(locale.name().toStdString())));
QNetworkRequest request(url);
request.setHeader(QNetworkRequest::UserAgentHeader, OSMScoutQt::GetInstance().GetUserAgent());
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/DBJob.cpp
^
|
@@ -68,7 +68,7 @@
bool closeOnFinish):
DBJob(),
closeOnFinish(closeOnFinish),
- breaker(std::make_shared<QBreaker>()),
+ breaker(std::make_shared<ThreadedBreaker>()),
lookupProjection(lookupProjection)
{
//qDebug() << "create: " << this << " in " << QThread::currentThread();
@@ -101,12 +101,12 @@
std::list<DBInstanceRef> relevantDatabases;
for (const auto &db:databases){
if (!db->IsOpen() || (!db->GetStyleConfig())) {
- qDebug() << "Database is not ready" << db->path;
+ log.Warn() << "Database is not ready" << db->path;
continue;
}
osmscout::GeoBox dbBox=db->GetDBGeoBox();
if (!dbBox.Intersects(lookupBox)){
- qDebug() << "Skip db" << db->path;
+ log.Debug() << "Skip db" << db->path;
continue;
}
relevantDatabases.push_back(db);
@@ -117,7 +117,7 @@
std::list<osmscout::TileRef> tiles;
db->GetMapService()->LookupTiles(lookupProjection,tiles);
- QString path=db->path;
+ QString path=QString::fromStdString(db->path);
osmscout::MapService::TileStateCallback callback=[this,path](const osmscout::TileRef& tile) {
//std::cout << "callback called for job: " << this << std::endl;
emit tileStateChanged(path,tile);
@@ -125,14 +125,14 @@
osmscout::MapService::CallbackId callbackId=db->GetMapService()->RegisterTileStateCallback(callback);
//std::cout << "callback registered for job: " << this << " " << db->path.toStdString() << ": " << callbackId << std::endl ;
- callbacks[db->path]=callbackId;
- loadedTiles[db->path]=QMap<osmscout::TileKey,osmscout::TileRef>();
+ callbacks[path]=callbackId;
+ loadedTiles[path]=QMap<osmscout::TileKey,osmscout::TileRef>();
QMap<osmscout::TileKey,osmscout::TileRef> tileMap;
for (const auto &tile:tiles){
tileMap[tile->GetKey()]=tile;
}
- allTiles[db->path]=tileMap;
- loadingTiles[db->path]=tileMap;
+ allTiles[path]=tileMap;
+ loadingTiles[path]=tileMap;
// load tiles asynchronous
db->GetMapService()->LoadMissingTileDataAsync(searchParameter,
@@ -200,10 +200,11 @@
// deregister callbacks
for (auto &db:databases){
- if (callbacks.contains(db->path)){
+ QString path=QString::fromStdString(db->path);
+ if (callbacks.contains(path)){
//qDebug() << "Remove callback for job:" << this << ":" << callbacks[db->path] << "in" << QThread::currentThread();
- db->GetMapService()->DeregisterTileStateCallback(callbacks[db->path]);
- callbacks.remove(db->path);
+ db->GetMapService()->DeregisterTileStateCallback(callbacks[path]);
+ callbacks.remove(path);
}
}
@@ -225,7 +226,7 @@
osmscout::MapData &data)
{
for (auto &db:databases){
- if (db->path==dbPath){
+ if (db->path==dbPath.toStdString()){
std::list<osmscout::TileRef> tileList;
for (const auto &tile:tiles){
tileList.push_back(tile);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/DBThread.cpp
^
|
@@ -30,9 +30,6 @@
#include <osmscout/log/Logger.h>
-#include <QGuiApplication>
-#include <QScreen>
-
namespace osmscout {
DBThread::DBThread(QThread *backgroundThread,
@@ -46,28 +43,26 @@
basemapLookupDirectory(basemapLookupDirectory),
settings(settings),
mapDpi(-1),
- physicalDpi(-1),
lock(QReadWriteLock::Recursive),
iconDirectory(iconDirectory),
daylight(true),
customPoiTypes(customPoiTypes)
{
- QScreen *srn=QGuiApplication::screens().at(0);
-
- physicalDpi = (double)srn->physicalDotsPerInch();
+ double physicalDpi = settings->GetPhysicalDPI();
osmscout::log.Debug() << "Reported screen DPI: " << physicalDpi;
mapDpi = settings->GetMapDPI();
osmscout::log.Debug() << "Map DPI override: " << mapDpi;
- stylesheetFilename=settings->GetStyleSheetAbsoluteFile();
+ stylesheetFilename=QString::fromStdString(settings->GetStyleSheetAbsoluteFile());
stylesheetFlags=settings->GetStyleSheetFlags();
osmscout::log.Debug() << "Using stylesheet: " << stylesheetFilename.toStdString();
emptyTypeConfig=std::make_shared<TypeConfig>();
registerCustomPoiTypes(emptyTypeConfig);
- emptyStyleConfig=makeStyleConfig(emptyTypeConfig);
+ emptyStyleConfig=makeStyleConfig(emptyTypeConfig, true);
- connect(settings.get(), &Settings::MapDPIChange,
+ settings->mapDPIChange.Connect(mapDpiSlot);
+ connect(this, &DBThread::mapDpiSignal,
this, &DBThread::onMapDPIChange,
Qt::QueuedConnection);
@@ -81,13 +76,15 @@
QWriteLocker locker(&lock);
osmscout::log.Debug() << "DBThread::~DBThread()";
+ mapDpiSlot.Disconnect();
+
if (basemapDatabase) {
basemapDatabase->Close();
basemapDatabase=nullptr;
}
for (auto& db:databases){
- db->close();
+ db->Close();
}
databases.clear();
backgroundThread->quit(); // deleteLater() is invoked when thread is finished
@@ -112,7 +109,7 @@
double DBThread::GetPhysicalDpi() const
{
- return physicalDpi;
+ return settings->GetPhysicalDPI();
}
const DatabaseLoadedResponse DBThread::loadedResponse() const {
@@ -190,7 +187,7 @@
}
for (const auto& db:databases){
- db->close();
+ db->Close();
}
databases.clear();
osmscout::GeoBox boundingBox;
@@ -307,7 +304,7 @@
continue;
}
- databases.push_back(std::make_shared<DBInstance>(databaseDirectory.absolutePath(),
+ databases.push_back(std::make_shared<DBInstance>(databaseDirectory.absolutePath().toStdString(),
database,
std::make_shared<osmscout::LocationService>(database),
std::make_shared<osmscout::LocationDescriptionService>(database),
@@ -342,7 +339,7 @@
}
}
-StyleConfigRef DBThread::makeStyleConfig(TypeConfigRef typeConfig) const
+StyleConfigRef DBThread::makeStyleConfig(TypeConfigRef typeConfig, bool suppressWarnings) const
{
osmscout::StyleConfigRef styleConfig=std::make_shared<osmscout::StyleConfig>(typeConfig);
@@ -351,7 +348,12 @@
styleConfig->AddFlag(flag.first,flag.second);
}
- if (!styleConfig->Load(stylesheetFilename.toLocal8Bit().data())) {
+ Log log=osmscout::log;
+ if (suppressWarnings) {
+ log.Warn(false);
+ }
+
+ if (!styleConfig->Load(stylesheetFilename.toLocal8Bit().data(), nullptr, false, log)) {
qWarning() << "Cannot load style sheet '" << stylesheetFilename << "'!";
styleConfig=nullptr;
}
@@ -418,17 +420,18 @@
this->stylesheetFilename = stylesheetFilename;
this->stylesheetFlags = stylesheetFlags;
- emptyStyleConfig=makeStyleConfig(emptyTypeConfig);
+ emptyStyleConfig=makeStyleConfig(emptyTypeConfig, true);
- bool prevErrs = !styleErrors.isEmpty();
+ bool prevErrs = !styleErrors.empty();
styleErrors.clear();
+ std::string file = (stylesheetFilename+suffix).toStdString();
for (const auto& db: databases){
- qDebug() << "Loading style " << stylesheetFilename << suffix << "...";
- db->LoadStyle(stylesheetFilename+suffix, stylesheetFlags, styleErrors);
- qDebug() << "Loading style done";
+ log.Debug() << "Loading style " << file << "...";
+ db->LoadStyle(file, stylesheetFlags, styleErrors);
+ log.Debug() << "Loading style done";
}
- if (prevErrs || (!styleErrors.isEmpty())){
- qWarning()<<"Failed to load stylesheet"<<(stylesheetFilename+suffix);
+ if (prevErrs || (!styleErrors.empty())){
+ log.Warn() << "Failed to load stylesheet" << file;
emit styleErrorsChanged();
}
emit stylesheetFilenameChanged();
@@ -464,7 +467,7 @@
{
RunSynchronousJob([idleMs](const std::list<DBInstanceRef> &dbs){
for (const auto &db:dbs){
- if (db->LastUsageMs() > idleMs){
+ if (db->LastUsageMs().count() > idleMs){
auto database=db->GetDatabase();
osmscout::log.Debug() << "Flushing caches for " << database->GetPath();
database->DumpStatistics();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/FileDownloader.cpp
^
|
@@ -17,8 +17,9 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <osmscoutclient/Settings.h>
+
#include <osmscoutclientqt/FileDownloader.h>
-#include <osmscoutclientqt/Settings.h>
#include <osmscoutclientqt/OSMScoutQt.h>
#include <QUrl>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/IconLookup.cpp
^
|
@@ -205,10 +205,10 @@
loadJob->AddTileDataToMapData(dbPath,tiles,data);
dbThread->RunSynchronousJob([&](const std::list<DBInstanceRef> &databases){
for (auto &db: databases) {
- if (db->path==dbPath){
+ if (db->path==dbPath.toStdString()){
TypeConfigRef typeConfig=db->GetDatabase()->GetTypeConfig();
StyleConfigRef styleConfig=db->GetStyleConfig();
- this->lookupIcons(db->path, data, typeConfig, styleConfig);
+ this->lookupIcons(QString::fromStdString(db->path), data, typeConfig, styleConfig);
}
}
});
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/InstalledVoicesModel.cpp
^
|
@@ -31,14 +31,12 @@
assert(voiceManager);
assert(settings);
+ settings->voiceDirChanged.Connect(voiceDirSlot);
+
connect(voiceManager.get(), &VoiceManager::reloaded,
this, &InstalledVoicesModel::update);
- connect(settings.get(), &Settings::VoiceDirChanged,
- this, &InstalledVoicesModel::onVoiceChanged);
- connect(settings.get(), &Settings::VoiceDirChanged,
- this, &InstalledVoicesModel::voiceChanged);
- voiceDir = settings->GetVoiceDir();
+ voiceDir = QString::fromStdString(settings->GetVoiceDir());
update();
}
@@ -124,7 +122,7 @@
// when voice is invalid, directory may be still valid (default-constructed QDir pointing to $PWD)
settings->SetVoiceDir("");
} else {
- settings->SetVoiceDir(voice.getDir().absolutePath());
+ settings->SetVoiceDir(voice.getDir().absolutePath().toStdString());
}
}
@@ -138,7 +136,7 @@
return;
}
-#if QT_VERSION < 0x060000
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
if (mediaPlayer==nullptr){
assert(currentPlaylist==nullptr);
mediaPlayer = new QMediaPlayer(this);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/LookupModule.cpp
^
|
@@ -149,7 +149,7 @@
dbThread->RunSynchronousJob(
[&](const std::list<DBInstanceRef> &databases){
for (const auto &db:databases) {
- if (db->path==entry.getDatabase()){
+ if (QString::fromStdString(db->path)==entry.getDatabase()){
std::set<osmscout::FileOffset> areaOffsets;
std::set<osmscout::FileOffset> wayOffsets;
@@ -309,7 +309,7 @@
count++;
auto place = description.GetAtAddressDescription()->GetPlace();
- emit locationDescription(location, db->path, description,
+ emit locationDescription(location, QString::fromStdString(db->path), description,
BuildAdminRegionList(db, place.GetAdminRegion(), regionMap));
}
@@ -322,7 +322,7 @@
count++;
auto place = description.GetAtPOIDescription()->GetPlace();
- emit locationDescription(location, db->path, description,
+ emit locationDescription(location, QString::fromStdString(db->path), description,
BuildAdminRegionList(db, place.GetAdminRegion(), regionMap));
}
}
@@ -343,7 +343,7 @@
return info;
}
- info->database=db->path;
+ info->database=QString::fromStdString(db->path);
// read admin region features
auto database=db->GetDatabase();
@@ -403,7 +403,7 @@
std::list<osmscout::LocationDescriptionService::ReverseLookupResult> result;
if (db->GetLocationDescriptionService()->ReverseLookupRegion(location,result)){
- std::map<osmscout::FileOffset,AdminRegionInfoRef> adminRegionMap=adminRegionCache[db->path];
+ std::map<osmscout::FileOffset,AdminRegionInfoRef> adminRegionMap=adminRegionCache[QString::fromStdString(db->path)];
AdminRegionInfoRef bottomAdminRegion; // admin region with highest admin level
for (const auto &entry:result) {
@@ -437,7 +437,7 @@
emit locationAdminRegions(location,
adminRegionList);
}
- adminRegionCache[db->path]=adminRegionMap;
+ adminRegionCache[QString::fromStdString(db->path)]=adminRegionMap;
}
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/MapManager.cpp
^
|
@@ -19,14 +19,15 @@
#include <QDirIterator>
#include <QDebug>
+#include <QJsonDocument>
+#include <QJsonArray>
+#include <QJsonObject>
#include <osmscoutclientqt/MapManager.h>
-#include <osmscout/TypeConfig.h>
#include <osmscoutclientqt/PersistentCookieJar.h>
+#include <osmscout/TypeConfig.h>
#include <osmscout/log/Logger.h>
-#include <osmscout/system/Compiler.h>
-#include <osmscoutclientqt/DBThread.h>
namespace osmscout {
@@ -106,7 +107,7 @@
QStringList fileNames = MapDirectory::optionalFiles() + MapDirectory::mandatoryFiles();
- DownloadJob::start(map.getProvider().getUri()+"/"+map.getServerDirectory(), fileNames);
+ DownloadJob::start(QString::fromStdString(map.getProvider().getUri())+"/"+map.getServerDirectory(), fileNames);
}
MapDirectory::MapDirectory(QDir dir):
@@ -239,7 +240,7 @@
MapManager::MapManager(QStringList databaseLookupDirs, SettingsRef settings):
databaseLookupDirs(databaseLookupDirs)
{
- qDebug() << "MapManager ctor";
+ osmscout::log.Debug() << "MapManager ctor";
webCtrl.setCookieJar(new PersistentCookieJar(settings));
// we don't use disk cache here
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/MapObjectInfoModel.cpp
^
|
@@ -22,6 +22,8 @@
#include <osmscoutclientqt/MapObjectInfoModel.h>
#include <osmscoutclientqt/OSMScoutQt.h>
+#include <osmscoutclientqt/InputHandler.h>
+
#include <iostream>
namespace osmscout {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/MapRenderer.cpp
^
|
@@ -20,6 +20,8 @@
#include <osmscoutclientqt/MapRenderer.h>
+#include <osmscoutmapqt/MapPainterQt.h>
+
namespace osmscout {
MapRenderer::MapRenderer(QThread *thread,
@@ -35,29 +37,37 @@
osmscout::log.Debug() << "Map DPI override: " << mapDpi;
renderSea=settings->GetRenderSea();
- fontName=settings->GetFontName();
+ fontName=QString::fromStdString(settings->GetFontName());
fontSize=settings->GetFontSize();
showAltLanguage=settings->GetShowAltLanguage();
- units=settings->GetUnits();
+ units=QString::fromStdString(settings->GetUnits());
+
+ settings->mapDPIChange.Connect(mapDpiChangeSlot);
+ settings->renderSeaChanged.Connect(renderSeaSlot);
+ settings->fontNameChanged.Connect(fontNameSlot);
+ settings->fontSizeChanged.Connect(fontSizeSlot);
+ settings->showAltLanguageChanged.Connect(showAltLanguageSlot);
+ settings->unitsChanged.Connect(unitsSlot);
- connect(settings.get(), &Settings::MapDPIChange,
+ connect(this, &MapRenderer::mapDpiChangeSignal,
this, &MapRenderer::onMapDPIChange,
Qt::QueuedConnection);
- connect(settings.get(), &Settings::RenderSeaChanged,
+ connect(this, &MapRenderer::renderSeaSignal,
this, &MapRenderer::onRenderSeaChanged,
Qt::QueuedConnection);
- connect(settings.get(), &Settings::FontNameChanged,
+ connect(this, &MapRenderer::fontNameSignal,
this, &MapRenderer::onFontNameChanged,
Qt::QueuedConnection);
- connect(settings.get(), &Settings::FontSizeChanged,
+ connect(this, &MapRenderer::fontSizeSignal,
this, &MapRenderer::onFontSizeChanged,
Qt::QueuedConnection);
- connect(settings.get(), &Settings::ShowAltLanguageChanged,
+ connect(this, &MapRenderer::showAltLanguageSignal,
this, &MapRenderer::onShowAltLanguageChanged,
Qt::QueuedConnection);
- connect(settings.get(), &Settings::UnitsChanged,
+ connect(this, &MapRenderer::unitsSignal,
this, &MapRenderer::onUnitsChanged,
Qt::QueuedConnection);
+
connect(thread, &QThread::started,
this, &MapRenderer::Initialize);
connect(dbThread.get(), &DBThread::stylesheetFilenameChanged,
@@ -295,8 +305,8 @@
++i;
std::list<osmscout::TileRef> tileList;
- if (tiles.contains(db->path)) {
- auto list = tiles[db->path].values();
+ if (tiles.contains(QString::fromStdString(db->path))) {
+ auto list = tiles[QString::fromStdString(db->path)].values();
tileList = std::list<osmscout::TileRef>(list.begin(), list.end());
skip = false;
}
@@ -317,7 +327,7 @@
}
if (skip) {
- osmscout::log.Debug() << "Skip db " << db->path.toStdString();
+ osmscout::log.Debug() << "Skip db " << db->path;
continue;
}
@@ -326,11 +336,12 @@
data->groundTiles);
}
- auto *painter = db->GetPainter();
- if (painter != nullptr) {
- batch.AddData(data, painter);
+ std::shared_ptr<MapPainterQt> painter = db->GetPainter<MapPainterQt>();
+ if (painter) {
+ MapPainterQt *p = painter.get();
+ batch.AddData(data, p);
} else {
- osmscout::log.Warn() << "Painter is not available for db: " << db->path.toStdString();
+ osmscout::log.Warn() << "Painter is not available for db: " << db->path;
success = false;
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/MapStyleModel.cpp
^
|
@@ -41,7 +41,7 @@
SettingsRef settings=OSMScoutQt::GetInstance().GetSettings();
- QDirIterator dirIt(settings->GetStyleSheetDirectory(), QDir::Files, QDirIterator::FollowSymlinks);
+ QDirIterator dirIt(QString::fromStdString(settings->GetStyleSheetDirectory()), QDir::Files, QDirIterator::FollowSymlinks);
while (dirIt.hasNext()) {
dirIt.next();
QFileInfo fInfo(dirIt.filePath());
@@ -69,9 +69,9 @@
{
SettingsRef settings=OSMScoutQt::GetInstance().GetSettings();
- settings->SetStyleSheetFile(styleFile);
+ settings->SetStyleSheetFile(styleFile.toStdString());
- emit loadStyleRequested(settings->GetStyleSheetAbsoluteFile(),
+ emit loadStyleRequested(QString::fromStdString(settings->GetStyleSheetAbsoluteFile()),
settings->GetStyleSheetFlags());
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/MapWidget.cpp
^
|
@@ -47,8 +47,7 @@
DBThreadRef dbThread = OSMScoutQt::GetInstance().GetDBThread();
- connect(settings.get(), &Settings::MapDPIChange,
- this, &MapWidget::onMapDPIChange);
+ settings->mapDPIChange.Connect(mapDpiSlot);
tapRecognizer.setPhysicalDpi(dbThread->GetPhysicalDpi());
@@ -944,31 +943,34 @@
bool MapWidget::stylesheetHasErrors() const
{
DBThreadRef dbThread=OSMScoutQt::GetInstance().GetDBThread();
- return !dbThread->GetStyleErrors().isEmpty();
+ return !dbThread->GetStyleErrors().empty();
}
int MapWidget::firstStylesheetErrorLine() const
{
DBThreadRef dbThread=OSMScoutQt::GetInstance().GetDBThread();
- QList<StyleError> errors=dbThread->GetStyleErrors();
- if (errors.isEmpty())
+ std::list<StyleError> errors=dbThread->GetStyleErrors();
+ if (errors.empty()) {
return -1;
- return errors.first().GetLine();
+ }
+ return errors.front().GetLine();
}
int MapWidget::firstStylesheetErrorColumn() const
{
DBThreadRef dbThread=OSMScoutQt::GetInstance().GetDBThread();
- QList<StyleError> errors=dbThread->GetStyleErrors();
- if (errors.isEmpty())
+ std::list<StyleError> errors=dbThread->GetStyleErrors();
+ if (errors.empty()) {
return -1;
- return errors.first().GetColumn();
+ }
+ return errors.front().GetColumn();
}
QString MapWidget::firstStylesheetErrorDescription() const
{
DBThreadRef dbThread=OSMScoutQt::GetInstance().GetDBThread();
- QList<StyleError> errors=dbThread->GetStyleErrors();
- if (errors.isEmpty())
+ std::list<StyleError> errors=dbThread->GetStyleErrors();
+ if (errors.empty()) {
return "";
- return errors.first().GetDescription();
+ }
+ return QString::fromStdString(errors.front().GetDescription());
}
bool MapWidget::toggleDebug()
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/NavigationModule.cpp
^
|
@@ -34,9 +34,8 @@
timer.moveToThread(thread); // constructor is called from different thread!
connect(&timer, &QTimer::timeout, this, &NavigationModule::onTimeout);
- connect(settings.get(), &Settings::VoiceLookupDirectoryChanged, this, &NavigationModule::onVoiceChanged);
- connect(settings.get(), &Settings::VoiceDirChanged, this, &NavigationModule::onVoiceChanged);
- onVoiceChanged(settings->GetVoiceDir());
+ settings->voiceDirChanged.Connect(voiceDirSlot);
+ onVoiceChanged(QString::fromStdString(settings->GetVoiceDir()));
}
NavigationModule::~NavigationModule()
@@ -57,19 +56,19 @@
}
if (mediaPlayer==nullptr){
-#if QT_VERSION < 0x060000
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
assert(currentPlaylist==nullptr);
#endif
mediaPlayer = new QMediaPlayer(this);
-#if QT_VERSION < 0x060000
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
currentPlaylist = new QMediaPlaylist(mediaPlayer);
#endif
-#if QT_VERSION < 0x060000
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
connect(mediaPlayer, &QMediaPlayer::stateChanged, this, &NavigationModule::playerStateChanged);
#else
connect(mediaPlayer, &QMediaPlayer::playbackStateChanged, this, &NavigationModule::playerStateChanged);
#endif
-#if QT_VERSION < 0x060000
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
mediaPlayer->setPlaylist(currentPlaylist);
#endif
}
@@ -139,7 +138,7 @@
nextMessage = voiceInstructionMessage->message;
InitPlayer();
assert(mediaPlayer);
-#if QT_VERSION < 0x060000
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
playerStateChanged(mediaPlayer->state());
#else
playerStateChanged(mediaPlayer->playbackState());
@@ -330,7 +329,7 @@
}
}
-#if QT_VERSION < 0x060000
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
void NavigationModule::playerStateChanged(QMediaPlayer::State state)
#else
void NavigationModule::playerStateChanged(QMediaPlayer::PlaybackState state)
@@ -340,26 +339,26 @@
qWarning() << "Player state changed from incorrect thread;" << thread << "!=" << QThread::currentThread();
}
-#if QT_VERSION < 0x060000
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
qDebug() << "Voice player state:" << mediaPlayer->state() << "(" << currentPlaylist->currentIndex() << "/" << currentPlaylist->mediaCount() << ")";
#endif
if (!voiceDir.isEmpty() &&
!nextMessage.empty() &&
state == QMediaPlayer::StoppedState) {
-#if QT_VERSION < 0x060000
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
currentPlaylist->clear();
#endif
for (const auto& sample : nextMessage){
auto sampleUrl = QUrl::fromLocalFile(voiceDir + QDir::separator() + sampleFile(sample));
-#if QT_VERSION < 0x060000
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
qDebug() << "Adding to playlist:" << sampleUrl;
currentPlaylist->addMedia(sampleUrl);
#endif
}
nextMessage.clear();
-#if QT_VERSION < 0x060000
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
currentPlaylist->setCurrentIndex(0);
#endif
mediaPlayer->play();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/OSMScoutQt.cpp
^
|
@@ -21,8 +21,11 @@
#include <osmscoutmap/DataTileCache.h>
+#include <osmscoutclient/Settings.h>
+
#include <osmscoutclientqt/OSMScoutQt.h>
-#include <osmscoutclientqt/Settings.h>
+#include <osmscoutclientqt/QtSettingsStorage.h>
+#include <osmscoutclientqt/QmlSettings.h>
#include <osmscoutclientqt/DBThread.h>
#include <osmscoutclientqt/MapWidget.h>
#include <osmscoutclientqt/ElevationChartWidget.h>
@@ -54,6 +57,9 @@
#include <QMetaType>
#include <QQmlEngine>
#include <QStandardPaths>
+#include <QGuiApplication>
+#include <QScreen>
+#include <QTemporaryFile>
#include <optional>
@@ -82,29 +88,75 @@
return false;
}
- SettingsRef settings=std::make_shared<Settings>(settingsStorage);
+ /* Warning: Sailfish OS before version 2.0.1 reports incorrect DPI (100)
+ *
+ * Some DPI values:
+ *
+ * ~ 330 - Jolla tablet native
+ * 242.236 - Jolla phone native
+ * 130 - PC (24" FullHD)
+ * 100 - Qt default (reported by SailfishOS < 2.0.1)
+ */
+ QScreen *srn=QGuiApplication::screens().at(0);
+ double physicalDpi = (double)srn->physicalDotsPerInch();
+
+ QLocale locale;
+ QString defaultUnits;
+ switch (locale.measurementSystem()){
+ case QLocale::ImperialUSSystem:
+ case QLocale::ImperialUKSystem:
+ defaultUnits="imperial";
+ break;
+ case QLocale::MetricSystem:
+ default:
+ defaultUnits="metrics";
+ }
+
+ SettingsRef settings=std::make_shared<Settings>(std::make_shared<QtSettingsStorage>(settingsStorage), physicalDpi, defaultUnits.toStdString());
+ settingsStorage = nullptr;
+
+ // Provider files may be distributed as Qt resources. But Setting cannot read Qt resources,
+ // so we make temporary copy of resource on standard filesystem (native file).
+ std::vector<std::unique_ptr<QTemporaryFile>> resourceCopies;
+
+ auto ProviderFiles = [&resourceCopies](const QStringList &list) -> std::vector<std::string> {
+ std::vector<std::string> result;
+ for (const auto &fileName: list) {
+ QFile file(fileName);
+ if (auto tmp=QTemporaryFile::createNativeFile(file); tmp!=nullptr) {
+ resourceCopies.emplace_back(std::unique_ptr<QTemporaryFile>(tmp));
+ result.push_back(tmp->fileName().toStdString());
+ } else {
+ result.push_back(fileName.toStdString());
+ }
+ }
+ return result;
+ };
// load online tile providers
if (!onlineTileProviders.isEmpty()){
- settings->loadOnlineTileProviders(onlineTileProviders);
+ settings->loadOnlineTileProviders(ProviderFiles(onlineTileProviders));
}
if (!mapProviders.isEmpty()){
- settings->loadMapProviders(mapProviders);
+ settings->loadMapProviders(ProviderFiles(mapProviders));
}
if (!voiceProviders.isEmpty()){
- settings->loadVoiceProviders(voiceProviders);
+ settings->loadVoiceProviders(ProviderFiles(voiceProviders));
}
+ // delete temporary files
+ resourceCopies.clear();
+
// setup style sheet
if (styleSheetFileConfigured){
- settings->SetStyleSheetFile(styleSheetFile);
+ settings->SetStyleSheetFile(styleSheetFile.toStdString());
}
if (styleSheetDirectoryConfigured){
- settings->SetStyleSheetDirectory(styleSheetDirectory);
+ settings->SetStyleSheetDirectory(styleSheetDirectory.toStdString());
}
// setup voice
- settings->SetVoiceLookupDirectory(voiceLookupDirectory);
+ settings->SetVoiceLookupDirectory(voiceLookupDirectory.toStdString());
MapManagerRef mapManager=std::make_shared<MapManager>(mapLookupDirectories, settings);
@@ -172,6 +224,9 @@
qRegisterMetaType<ElevationModule::ElevationPoints>("ElevationModule::ElevationPoints");
qRegisterMetaType<std::map<int,OverlayObjectRef>>("std::map<int,OverlayObjectRef>");
qRegisterMetaType<MapIcon>("MapIcon");
+ qRegisterMetaType<VoiceProvider>("VoiceProvider");
+ qRegisterMetaType<MapProvider>("MapProvider");
+ qRegisterMetaType<QmlRoutingProfileRef>("QmlRoutingProfileRef");
// register osmscout types for usage in QML
qmlRegisterType<AvailableMapsModel>(uri, versionMajor, versionMinor, "AvailableMapsModel");
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/OnlineTileProviderModel.cpp
^
|
@@ -27,9 +27,9 @@
switch (role) {
case Qt::DisplayRole:
case NameRole:
- return provider.getName();
+ return QString::fromStdString(provider.getName());
case IdRole:
- return provider.getId();
+ return QString::fromStdString(provider.getId());
default:
break;
}
@@ -62,12 +62,12 @@
QString OnlineTileProviderModel::getId(int row) const
{
- return onlineProviders.at(row).getId();
+ return QString::fromStdString(onlineProviders.at(row).getId());
}
QString OnlineTileProviderModel::getName(int row) const
{
- return onlineProviders.at(row).getName();
+ return QString::fromStdString(onlineProviders.at(row).getName());
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/OsmTileDownloader.cpp
^
|
@@ -23,9 +23,9 @@
#include <QRandomGenerator>
#endif
+#include <osmscoutclient/OnlineTileProvider.h>
+
#include <osmscoutclientqt/OsmTileDownloader.h>
-#include <osmscoutclientqt/OnlineTileProvider.h>
-#include <osmscoutclientqt/DBThread.h>
#include <osmscoutclientqt/OSMScoutQt.h>
namespace osmscout {
@@ -72,12 +72,12 @@
return;
}
- QStringList servers = tileProvider.getServers();
+ auto servers = tileProvider.getServers();
if (servers.empty()){
emit failed(zoomLevel, x, y, false);
return;
}
- QString server = servers.at(serverNumber % servers.size());
+ QString server = QString::fromStdString(servers[serverNumber % servers.size()]);
QUrl tileUrl(server.arg(zoomLevel).arg(x).arg(y));
qDebug() << "Download tile" << tileUrl << "(current thread:" << QThread::currentThread() << ")";
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/POILookupModule.cpp
^
|
@@ -139,14 +139,14 @@
osmscout::GeoBox bbox=area->GetBoundingBox();
osmscout::GeoCoord coordinates=bbox.GetCenter();
- result << buildLocationEntry(area, db->path, coordinates, bbox);
+ result << buildLocationEntry(area, QString::fromStdString(db->path), coordinates, bbox);
}
for (osmscout::WayRef &way:ways) {
osmscout::GeoBox bbox=way->GetBoundingBox();
osmscout::GeoCoord coordinates=bbox.GetCenter();
- result << buildLocationEntry(way, db->path, coordinates, bbox);
+ result << buildLocationEntry(way, QString::fromStdString(db->path), coordinates, bbox);
}
for (osmscout::NodeRef &node:nodes) {
@@ -154,7 +154,7 @@
osmscout::GeoBox bbox;
bbox.Include(osmscout::GeoBox::BoxByCenterAndRadius(node->GetCoords(), Distance::Of<Meter>(2.0)));
- result << buildLocationEntry(node, db->path, coordinates, bbox);
+ result << buildLocationEntry(node, QString::fromStdString(db->path), coordinates, bbox);
}
return result;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/PlaneMapRenderer.cpp
^
|
@@ -332,8 +332,8 @@
drawParameter.SetPatternMode(osmscout::MapParameter::PatternMode::Scalable);
drawParameter.SetIconPaths(paths);
drawParameter.SetPatternPaths(paths);
- drawParameter.SetDebugData(false);
- drawParameter.SetDebugPerformance(true);
+ drawParameter.SetDebugData(osmscout::log.IsDebug());
+ drawParameter.SetDebugPerformance(osmscout::log.IsWarn());
// We want to get notified, if we have more than 1000 objects from a certain type (=> move type rendering to a higher zoom level?)
drawParameter.SetWarningObjectCountLimit(1000);
// We want to get notified, if we have more than 20000 coords from a certain type (=> move type rendering to a higher zoom level?)
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/QmlSettings.cpp
^
|
@@ -0,0 +1,144 @@
+/*
+ OSMScout - a Qt backend for libosmscout and libosmscout-map
+ Copyright (C) 2023 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscoutclientqt/QmlSettings.h>
+#include <osmscoutclientqt/OSMScoutQt.h>
+
+namespace osmscout {
+
+QmlSettings::QmlSettings()
+{
+ settings=OSMScoutQt::GetInstance().GetSettings();
+
+ settings->mapDPIChange.Connect(mapDPISlot);
+ settings->onlineTilesEnabledChanged.Connect(onlineTilesEnabledSlot);
+ settings->onlineTileProviderIdChanged.Connect(onlineTileProviderIdSlot);
+ settings->offlineMapChanged.Connect(offlineMapSlot);
+ settings->styleSheetFileChanged.Connect(styleSheetFileSlot);
+ settings->renderSeaChanged.Connect(renderSeaSlot);
+ settings->fontNameChanged.Connect(fontNameSlot);
+ settings->fontSizeChanged.Connect(fontSizeSlot);
+ settings->showAltLanguageChanged.Connect(showAltLanguageSlot);
+ settings->unitsChanged.Connect(unitsSlot);
+}
+
+double QmlSettings::GetPhysicalDPI() const
+{
+ return settings->GetPhysicalDPI();
+}
+
+void QmlSettings::SetMapDPI(double dpi)
+{
+ settings->SetMapDPI(dpi);
+}
+
+double QmlSettings::GetMapDPI() const
+{
+ return settings->GetMapDPI();
+}
+
+bool QmlSettings::GetOnlineTilesEnabled() const
+{
+ return settings->GetOnlineTilesEnabled();
+}
+
+void QmlSettings::SetOnlineTilesEnabled(bool b)
+{
+ settings->SetOnlineTilesEnabled(b);
+}
+
+const QString QmlSettings::GetOnlineTileProviderId() const
+{
+ return QString::fromStdString(settings->GetOnlineTileProviderId());
+}
+
+void QmlSettings::SetOnlineTileProviderId(QString id)
+{
+ settings->SetOnlineTileProviderId(id.toStdString());
+}
+
+QString QmlSettings::onlineProviderCopyright()
+{
+ OnlineTileProvider provider = settings->GetOnlineTileProvider();
+ if (provider.isValid()){
+ return QString::fromStdString(provider.getCopyright());
+ }
+ return "";
+}
+
+bool QmlSettings::GetOfflineMap() const
+{
+ return settings->GetOfflineMap();
+}
+void QmlSettings::SetOfflineMap(bool b)
+{
+ settings->SetOfflineMap(b);
+}
+
+QString QmlSettings::GetStyleSheetFile() const
+{
+ return QString::fromStdString(settings->GetStyleSheetFile());
+}
+void QmlSettings::SetStyleSheetFile(const QString file)
+{
+ settings->SetStyleSheetFile(file.toStdString());
+}
+
+bool QmlSettings::GetRenderSea() const
+{
+ return settings->GetRenderSea();
+}
+void QmlSettings::SetRenderSea(bool b)
+{
+ settings->SetRenderSea(b);
+}
+QString QmlSettings::GetFontName() const
+{
+ return QString::fromStdString(settings->GetFontName());
+}
+void QmlSettings::SetFontName(const QString fontName)
+{
+ settings->SetFontName(fontName.toStdString());
+}
+double QmlSettings::GetFontSize() const
+{
+ return settings->GetFontSize();
+}
+void QmlSettings::SetFontSize(double fontSize)
+{
+ settings->SetFontSize(fontSize);
+}
+bool QmlSettings::GetShowAltLanguage() const
+{
+ return settings->GetShowAltLanguage();
+}
+void QmlSettings::SetShowAltLanguage(bool showAltLanguage)
+{
+ settings->SetShowAltLanguage(showAltLanguage);
+}
+QString QmlSettings::GetUnits() const
+{
+ return QString::fromStdString(settings->GetUnits());
+}
+void QmlSettings::SetUnits(const QString units)
+{
+ settings->SetUnits(units.toStdString());
+}
+
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/QtSettingsStorage.cpp
^
|
@@ -0,0 +1,107 @@
+/*
+ OSMScout - a Qt backend for libosmscout and libosmscout-map
+ Copyright (C) 2023 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscoutclientqt/QtSettingsStorage.h>
+
+namespace osmscout {
+
+
+QtSettingsStorage::QtSettingsStorage(QSettings *providedStorage):
+ storage(providedStorage)
+{
+ if (storage==nullptr){
+ storage=new QSettings(this);
+ } else {
+ providedStorage->setParent(this);
+ }
+}
+
+void QtSettingsStorage::SetValue(const std::string &key, double d)
+{
+ storage->setValue(QString::fromStdString(key), d);
+}
+
+void QtSettingsStorage::SetValue(const std::string &key, uint32_t i)
+{
+ storage->setValue(QString::fromStdString(key), i);
+}
+
+void QtSettingsStorage::SetValue(const std::string &key, const std::string &str)
+{
+ storage->setValue(QString::fromStdString(key), QString::fromStdString(str));
+}
+
+void QtSettingsStorage::SetValue(const std::string &key, bool b)
+{
+ storage->setValue(QString::fromStdString(key), b);
+}
+
+void QtSettingsStorage::SetValue(const std::string &key, std::vector<char> bytes)
+{
+ storage->setValue(QString::fromStdString(key), QByteArray(bytes.data(), bytes.size()));
+}
+
+double QtSettingsStorage::GetDouble(const std::string &key, double defaultValue)
+{
+ bool ok;
+ double d = storage->value(QString::fromStdString(key), defaultValue).toDouble(&ok);
+ if (!ok) {
+ return defaultValue;
+ }
+ return d;
+}
+
+uint32_t QtSettingsStorage::GetUInt(const std::string &key, uint32_t defaultValue)
+{
+ bool ok;
+ uint32_t i = storage->value(QString::fromStdString(key), defaultValue).toUInt(&ok);
+ if (!ok) {
+ return defaultValue;
+ }
+ return i;
+}
+
+std::string QtSettingsStorage::GetString(const std::string &key, const std::string &defaultValue)
+{
+ return storage->value(QString::fromStdString(key), QString::fromStdString(defaultValue)).toString().toStdString();
+}
+
+bool QtSettingsStorage::GetBool(const std::string &key, bool defaultValue)
+{
+ return storage->value(QString::fromStdString(key), defaultValue).toBool();
+}
+
+std::vector<char> QtSettingsStorage::GetBytes(const std::string &key)
+{
+ QByteArray arr = storage->value(QString::fromStdString(key)).toByteArray();
+ return std::vector<char>(arr.data(), arr.data() + arr.size());
+}
+
+std::vector<std::string> QtSettingsStorage::Keys(const std::string &prefix)
+{
+ std::vector<std::string> result;
+ storage->beginGroup(QString::fromStdString(prefix));
+ for (const QString& key:storage->allKeys()){
+ result.push_back(prefix + key.toStdString());
+ }
+ storage->endGroup();
+ return result;
+}
+
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/SearchModule.cpp
^
|
@@ -68,7 +68,7 @@
}
osmscout::AdminRegionRef defaultRegion;
- if (defaultRegionInfo && defaultRegionInfo->database==db->path){
+ if (defaultRegionInfo && defaultRegionInfo->database==QString::fromStdString(db->path)){
defaultRegion=defaultRegionInfo->adminRegion;
}
@@ -165,8 +165,8 @@
QList<LocationEntry> locations;
QList<osmscout::ObjectFileRef> objectSet;
osmscout::TextSearchIndex textSearch;
- if(!textSearch.Load(db->path.toStdString())){
- osmscout::log.Warn() << "Failed to load text index files, search only for locations with db " << db->path.toStdString();
+ if(!textSearch.Load(db->path)){
+ osmscout::log.Warn() << "Failed to load text index files, search only for locations with db " << db->path;
return true; // silently continue, text indexes are optional in db
}
osmscout::TextSearchIndex::ResultsMap resultsTxt;
@@ -318,7 +318,7 @@
*/
LocationEntry location(LocationEntry::typeObject, name, altName, objectType, adminRegionList,
- db->path, coordinates, bbox);
+ QString::fromStdString(db->path), coordinates, bbox);
location.addReference(object);
locations.append(location);
@@ -355,7 +355,7 @@
osmscout::log.Debug() << "address: " << label.toStdString();
LocationEntry location(LocationEntry::typeObject, label, altName, objectType, adminRegionList,
- db->path, coordinates, bbox);
+ QString::fromStdString(db->path), coordinates, bbox);
location.addReference(entry.address->object);
locations.append(location);
}
@@ -370,7 +370,7 @@
osmscout::log.Debug() << "loc: " << loc.toStdString();
LocationEntry location(LocationEntry::typeObject, loc, altName, objectType, adminRegionList,
- db->path, coordinates, bbox);
+ QString::fromStdString(db->path), coordinates, bbox);
for (auto object : entry.location->objects) {
location.addReference(object);
@@ -387,7 +387,7 @@
osmscout::log.Debug() << "poi: " << poi.toStdString();
LocationEntry location(LocationEntry::typeObject, poi, altName, objectType, adminRegionList,
- db->path, coordinates, bbox);
+ QString::fromStdString(db->path), coordinates, bbox);
location.addReference(entry.poi->object);
locations.append(location);
}
@@ -399,7 +399,7 @@
//=QString::fromUtf8(entry.adminRegion->name.c_str());
LocationEntry location(LocationEntry::typeObject, regionName, altName, objectType, adminRegionList,
- db->path, coordinates, bbox);
+ QString::fromStdString(db->path), coordinates, bbox);
osmscout::log.Debug() << "region: " << regionName.toStdString();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/TiledMapOverlay.cpp
^
|
@@ -22,6 +22,10 @@
#include <osmscoutclientqt/OSMScoutQt.h>
#include <osmscoutclientqt/TiledRenderingHelper.h>
+#include <osmscoutclient/json/json.hpp>
+
+#include <QJsonDocument>
+
namespace osmscout {
TileLoaderThread::TileLoaderThread(QThread *thread):
@@ -198,7 +202,19 @@
void TiledMapOverlay::setProvider(QJsonValue jv)
{
- OnlineTileProvider provider=OnlineTileProvider::fromJson(jv);
+ if (!jv.isObject()) {
+ qWarning() << "Failed to parse providers json:" << jv;
+ return;
+ }
+
+ OnlineTileProvider provider;
+ try{
+ auto jsonStr = QJsonDocument(jv.toObject()).toJson().toStdString();
+ provider = OnlineTileProvider::fromJson(nlohmann::json::parse(jsonStr));
+ } catch (const nlohmann::json::exception &e) {
+ qWarning() << "Failed to parse providers json:" << e.what();
+ return;
+ }
if (!provider.isValid()){
qWarning() << "Invalid provider:" << jv;
return;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/TiledMapRenderer.cpp
^
|
@@ -53,13 +53,17 @@
onlineTilesEnabled = settings->GetOnlineTilesEnabled();
offlineTilesEnabled = settings->GetOfflineMap();
- connect(settings.get(), &Settings::OnlineTileProviderIdChanged,
+ settings->onlineTileProviderChanged.Connect(onlineTileProviderSlot);
+ settings->onlineTilesEnabledChanged.Connect(onlineTileEnabledSlot);
+ settings->offlineMapChanged.Connect(offlineMapChangedSlot);
+
+ connect(this, &TiledMapRenderer::onlineTileProviderSignal,
this, &TiledMapRenderer::onlineTileProviderChanged,
Qt::QueuedConnection);
- connect(settings.get(), &Settings::OnlineTilesEnabledChanged,
+ connect(this, &TiledMapRenderer::onlineTilesEnabledSignal,
this, &TiledMapRenderer::onlineTilesEnabledChanged,
Qt::QueuedConnection);
- connect(settings.get(), &Settings::OfflineMapChanged,
+ connect(this, &TiledMapRenderer::offlineMapChangedSignal,
this, &TiledMapRenderer::onOfflineMapChanged,
Qt::QueuedConnection);
@@ -91,12 +95,12 @@
{
{
QMutexLocker locker(&lock);
- qDebug() << "Initialize";
+ osmscout::log.Debug() << "Initialize";
// create tile downloader in correct thread
tileDownloader = new OsmTileDownloader(tileCacheDirectory,settings->GetOnlineTileProvider());
- connect(settings.get(), &Settings::OnlineTileProviderChanged,
+ connect(this, &TiledMapRenderer::onlineTileProviderSignal,
tileDownloader, &OsmTileDownloader::onlineTileProviderChanged,
Qt::QueuedConnection);
@@ -357,7 +361,7 @@
}
}
-void TiledMapRenderer::onlineTileProviderChanged()
+void TiledMapRenderer::onlineTileProviderChanged(const OnlineTileProvider&)
{
{
QMutexLocker locker(&tileCacheMutex);
@@ -432,8 +436,8 @@
drawParameter.SetPatternMode(osmscout::MapParameter::PatternMode::Scalable);
drawParameter.SetIconPaths(paths);
drawParameter.SetPatternPaths(paths);
- drawParameter.SetDebugData(false);
- drawParameter.SetDebugPerformance(true);
+ drawParameter.SetDebugData(osmscout::log.IsDebug());
+ drawParameter.SetDebugPerformance(osmscout::log.IsWarn());
// optimize process can reduce number of nodes before rendering
// it helps for slow renderer backend, but it cost some cpu
@@ -501,7 +505,7 @@
QMutexLocker tileCacheLocker(&tileCacheMutex);
if (loadEpoch != offlineTileCache.getEpoch()){
- qWarning() << "Rendered from outdated data" << loadEpoch << "!=" << offlineTileCache.getEpoch();
+ osmscout::log.Warn() << "Rendered from outdated data" << loadEpoch << "!=" << offlineTileCache.getEpoch();
}
if (width == 1 && height == 1){
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/Voice.cpp
^
|
@@ -21,6 +21,10 @@
#include <osmscoutclientqt/PersistentCookieJar.h>
#include <osmscoutclientqt/OSMScoutQt.h>
+#include <QJsonDocument>
+#include <QJsonArray>
+#include <QJsonObject>
+
namespace osmscout {
AvailableVoice::AvailableVoice(const VoiceProvider &provider,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client-qt/src/osmscoutclientqt/VoiceManager.cpp
^
|
@@ -18,12 +18,16 @@
*/
#include <osmscoutclientqt/VoiceManager.h>
-#include <osmscoutclientqt/Settings.h>
+
+#include <osmscoutclient/Settings.h>
+
#include <osmscoutclientqt/OSMScoutQt.h>
#include <osmscoutclientqt/PersistentCookieJar.h>
-#include <osmscoutclientqt/AvailableVoicesModel.h>
#include <QDirIterator>
+#include <QJsonDocument>
+#include <QJsonArray>
+#include <QJsonObject>
namespace osmscout {
@@ -78,7 +82,8 @@
return;
}
- DownloadJob::start(voice.getProvider().getUri()+"/"+voice.getDirectory(), Voice::files());
+ DownloadJob::start(QString::fromStdString(voice.getProvider().getUri()) + "/" + voice.getDirectory(),
+ Voice::files());
}
VoiceManager::VoiceManager()
@@ -94,7 +99,7 @@
void VoiceManager::reload()
{
SettingsRef settings = OSMScoutQt::GetInstance().GetSettings();
- lookupDir = settings->GetVoiceLookupDirectory();
+ lookupDir = QString::fromStdString(settings->GetVoiceLookupDirectory());
osmscout::log.Info() << "Lookup voices at " << lookupDir.toStdString();
installedVoices.clear();
QSet<QString> uniqPaths;
@@ -117,7 +122,7 @@
emit reloaded();
// check if configured voice still exists
- QString voiceDir = settings->GetVoiceDir();
+ QString voiceDir = QString::fromStdString(settings->GetVoiceDir());
if (!voiceDir.isEmpty()){
bool found=false;
for (const auto &v:installedVoices){
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client/CMakeLists.txt
^
|
@@ -1,9 +1,20 @@
set(HEADER_FILES
+ include/osmscoutclient/json/json.hpp
+ include/osmscoutclient/json/json_fwd.hpp
+ include/osmscoutclient/DBInstance.h
+ include/osmscoutclient/MapProvider.h
include/osmscoutclient/ClientImportExport.h
+ include/osmscoutclient/OnlineTileProvider.h
+ include/osmscoutclient/Settings.h
+ include/osmscoutclient/VoiceProvider.h
)
set(SOURCE_FILES
- src/osmscoutclient/Empty.cpp
+ src/osmscoutclient/DBInstance.cpp
+ src/osmscoutclient/MapProvider.cpp
+ src/osmscoutclient/OnlineTileProvider.cpp
+ src/osmscoutclient/Settings.cpp
+ src/osmscoutclient/VoiceProvider.cpp
)
set(EXCLUDE_HEADER)
@@ -17,7 +28,7 @@
INCLUDEDIR "osmscoutclient"
TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/include/osmscoutclient/ClientFeatures.h.cmake
FEATURE ${CMAKE_CURRENT_BINARY_DIR}/include/osmscoutclient/ClientFeatures.h
- TARGET OSMScout::OSMScout
+ TARGET OSMScout::OSMScout OSMScout::Map
SKIP_HEADER
)
@@ -45,12 +56,12 @@
endif()
if(NOT EXCLUDE_HEADER)
- install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/osmscoutclient DESTINATION include FILES_MATCHING PATTERN "*.h" PATTERN "private" EXCLUDE)
+ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/osmscoutclient DESTINATION include FILES_MATCHING REGEX "/.*\\.h|.*\\.hpp$" PATTERN "private" EXCLUDE)
else()
set(_exclude PATTERN "private" EXCLUDE)
foreach(ef ${EXCLUDE_HEADER})
set(_exclude ${_exclude} PATTERN ${ef} EXCLUDE)
endforeach()
- install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/osmscoutclient DESTINATION include FILES_MATCHING PATTERN "*.h" ${_exclude})
+ install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/osmscoutclient DESTINATION include FILES_MATCHING REGEX "/.*\\.h|.*\\.hpp$" ${_exclude})
endif()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/osmscoutclient/ClientFeatures.h DESTINATION include/osmscout)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client/include/meson.build
^
|
@@ -1,7 +1,14 @@
osmscoutclientIncDir = include_directories('.')
osmscoutclientHeader = [
- 'osmscoutclient/ClientImportExport.h'
+ 'osmscoutclient/json/json.hpp',
+ 'osmscoutclient/json/json_fwd.hpp',
+ 'osmscoutclient/ClientImportExport.h',
+ 'osmscoutclient/DBInstance.h',
+ 'osmscoutclient/MapProvider.h',
+ 'osmscoutclient/OnlineTileProvider.h',
+ 'osmscoutclient/Settings.h',
+ 'osmscoutclient/VoiceProvider.h'
]
if meson.version().version_compare('>=0.63.0')
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client/include/osmscoutclient/DBInstance.h
^
|
@@ -0,0 +1,207 @@
+#ifndef OSMSCOUT_CLIENT_DBINSTANCE_H
+#define OSMSCOUT_CLIENT_DBINSTANCE_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2017 Lukáš Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <osmscout/location/LocationService.h>
+#include <osmscout/location/LocationDescriptionService.h>
+
+#include <osmscout/db/Database.h>
+#include <osmscout/async/Thread.h>
+#include <osmscout/async/Signal.h>
+#include <osmscout/async/Breaker.h>
+
+#include <osmscoutmap/MapService.h>
+#include <osmscoutmap/MapPainter.h>
+
+#include <osmscoutclient/ClientImportExport.h>
+
+#include <chrono>
+#include <thread>
+
+namespace osmscout {
+
+/**
+ * \ingroup QtAPI
+ *
+ * Instance of one osmscout db and db specific objects.
+ *
+ * It is thread safe
+ */
+class OSMSCOUT_CLIENT_API DBInstance
+{
+public:
+ const std::string path;
+
+ using MapPainterRef=std::shared_ptr<MapPainter>;
+
+private:
+ mutable std::mutex mutex;
+ std::map<std::thread::id,MapPainterRef> painterHolder; ///< thread-local cache of map painters, guarded by mutex
+ std::chrono::steady_clock::time_point lastUsage; ///< last time when db was used, guarded by mutex
+
+ osmscout::GeoBox dbBox; ///< cached db GeoBox, may be accessed without lock and lastUsage update
+ osmscout::DatabaseRef database;
+
+ osmscout::LocationServiceRef locationService;
+ osmscout::LocationDescriptionServiceRef locationDescriptionService;
+ osmscout::MapServiceRef mapService;
+
+ osmscout::StyleConfigRef styleConfig;
+
+ Slot<std::thread::id> threadFinishSlot;
+
+public:
+ DBInstance(const std::string &path,
+ const osmscout::DatabaseRef& database,
+ const osmscout::LocationServiceRef& locationService,
+ const osmscout::LocationDescriptionServiceRef& locationDescriptionService,
+ const osmscout::MapServiceRef& mapService,
+ const osmscout::StyleConfigRef& styleConfig):
+ path(path),
+ database(database),
+ locationService(locationService),
+ locationDescriptionService(locationDescriptionService),
+ mapService(mapService),
+ styleConfig(styleConfig),
+ threadFinishSlot(std::bind(&DBInstance::OnThreadFinished, this, std::placeholders::_1))
+ {
+ if (!database->GetBoundingBox(dbBox)){
+ osmscout::log.Error() << "Failed to get db GeoBox: " << path;
+ }
+ lastUsage=std::chrono::steady_clock::now();
+ };
+
+ DBInstance(const DBInstance&) = delete;
+ DBInstance(DBInstance&&) = delete;
+
+ DBInstance& operator=(const DBInstance&) = delete;
+ DBInstance& operator=(DBInstance&&) = delete;
+
+ virtual ~DBInstance()
+ {
+ Close();
+ };
+
+ osmscout::GeoBox GetDBGeoBox() const
+ {
+ return dbBox;
+ }
+
+ /**
+ * return true if db is open
+ * lastUsage is not updated
+ */
+ bool IsOpen() const
+ {
+ return database->IsOpen();
+ }
+
+ osmscout::DatabaseRef GetDatabase()
+ {
+ std::scoped_lock lock(mutex);
+ lastUsage=std::chrono::steady_clock::now();
+ return database;
+ }
+
+ osmscout::MapServiceRef GetMapService()
+ {
+ std::scoped_lock lock(mutex);
+ lastUsage=std::chrono::steady_clock::now();
+ return mapService;
+ }
+
+ osmscout::LocationDescriptionServiceRef GetLocationDescriptionService()
+ {
+ std::scoped_lock lock(mutex);
+ lastUsage=std::chrono::steady_clock::now();
+ return locationDescriptionService;
+ }
+
+ osmscout::LocationServiceRef GetLocationService()
+ {
+ std::scoped_lock lock(mutex);
+ lastUsage=std::chrono::steady_clock::now();
+ return locationService;
+ }
+
+ osmscout::StyleConfigRef GetStyleConfig() const
+ {
+ return styleConfig;
+ }
+
+ /**
+ * Returns the number of milliseconds since last db usage
+ */
+ std::chrono::milliseconds LastUsageMs() const
+ {
+ std::scoped_lock lock(mutex);
+ return std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::steady_clock::now()-lastUsage);
+ }
+
+ bool LoadStyle(const std::string &stylesheetFilename,
+ std::unordered_map<std::string,bool> stylesheetFlags,
+ std::list<StyleError> &errors);
+
+ /**
+ * Get or create thread local MapPainter instance for this map
+ * \note To make sure that painter will not be destroyed during usage,
+ * read-lock for databases should be held.
+ * \warning It may be null when styleConfig is not loaded!
+ * @return pointer to thread-local painter
+ */
+ template<typename PainterType,
+ typename Requires = std::enable_if_t<std::is_base_of_v<MapPainter, PainterType>>>
+ std::shared_ptr<PainterType> GetPainter()
+ {
+ std::scoped_lock lock(mutex);
+ if (!styleConfig) {
+ return nullptr;
+ }
+
+ if (auto it=painterHolder.find(std::this_thread::get_id());
+ it!=painterHolder.end()){
+ if (std::shared_ptr<PainterType> res=std::dynamic_pointer_cast<PainterType>(it->second);
+ res!=nullptr) {
+ return res;
+ } else {
+ log.Warn() << "Thread changed painter type";
+ }
+ }
+
+ std::shared_ptr<PainterType> res=std::make_shared<PainterType>(styleConfig);
+ painterHolder[std::this_thread::get_id()]=res;
+
+ ThreadExitSignal().Connect(threadFinishSlot);
+
+ return res;
+ }
+
+ void Close();
+
+private:
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client/include/osmscoutclient/MapProvider.h
^
|
@@ -0,0 +1,86 @@
+#ifndef OSMSCOUT_CLIENT_MAPPROVIDER_H
+#define OSMSCOUT_CLIENT_MAPPROVIDER_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2016 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+
+#include <osmscoutclient/ClientImportExport.h>
+
+#include <osmscoutclient/json/json_fwd.hpp>
+
+#include <osmscout/util/String.h>
+
+namespace osmscout {
+
+/**
+ * \ingroup ClientAPI
+ */
+struct OSMSCOUT_CLIENT_API MapProvider
+{
+
+private:
+ bool valid=false;
+ std::string uri;
+ std::string listUri;
+ std::string name;
+
+public:
+ MapProvider() = default;
+ MapProvider(const MapProvider &) = default;
+ MapProvider(MapProvider &&) = default;
+
+ MapProvider(const std::string &name, const std::string &uri, const std::string &listUri):
+ valid(true), uri(uri), listUri(listUri), name(name) {}
+
+ virtual ~MapProvider() = default;
+
+ MapProvider& operator=(const MapProvider &) = default;
+ MapProvider& operator=(MapProvider &&) = default;
+
+ std::string getName() const
+ {
+ return name;
+ }
+
+ std::string getUri() const
+ {
+ return uri;
+ }
+
+ std::string getListUri(int fromVersion, int toVersion, std::string locale="en") const
+ {
+ std::string res = listUri;
+ res=ReplaceString(res, "%1", std::to_string(fromVersion));
+ res=ReplaceString(res, "%2", std::to_string(toVersion));
+ res=ReplaceString(res, "%3", locale);
+ return res;
+ }
+
+ bool isValid() const
+ {
+ return valid;
+ }
+
+ static MapProvider fromJson(const nlohmann::json &obj);
+};
+
+}
+
+#endif // OSMSCOUT_CLIENT_MAPPROVIDER_H
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client/include/osmscoutclient/OnlineTileProvider.h
^
|
@@ -0,0 +1,96 @@
+#ifndef OSMSCOUT_CLIENT_QT_ONLINETILEPROVIDER_H
+#define OSMSCOUT_CLIENT_QT_ONLINETILEPROVIDER_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2016 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscoutclient/ClientImportExport.h>
+
+#include <osmscoutclient/json/json_fwd.hpp>
+
+#include <string>
+#include <vector>
+
+namespace osmscout {
+
+/**
+ * \ingroup ClientAPI
+ *
+ * Online tile provider object. See OnlineTileProviderModel and Settings.
+ */
+struct OSMSCOUT_CLIENT_API OnlineTileProvider
+{
+public:
+ OnlineTileProvider() = default;
+
+ OnlineTileProvider(const OnlineTileProvider &) = default;
+ OnlineTileProvider(OnlineTileProvider &&) = default;
+
+ OnlineTileProvider(const std::string &id,
+ const std::string &name,
+ const std::vector<std::string> &servers,
+ int maximumZoomLevel,
+ const std::string ©right):
+ valid(true), id(id), name(name), servers(servers), maximumZoomLevel(maximumZoomLevel),
+ copyright(copyright){};
+
+ virtual ~OnlineTileProvider() = default;
+
+ OnlineTileProvider& operator=(const OnlineTileProvider &) = default;
+ OnlineTileProvider& operator=(OnlineTileProvider &&) = default;
+
+ std::string getId() const {
+ return id;
+ }
+
+ int getMaximumZoomLevel() const {
+ return maximumZoomLevel;
+ }
+
+ std::string getName() const {
+ return name;
+ }
+
+ std::vector<std::string> getServers() const {
+ return servers;
+ }
+
+ bool isValid() const {
+ return valid;
+ }
+
+ std::string getCopyright() const
+ {
+ return copyright;
+ }
+
+ static OnlineTileProvider fromJson(const nlohmann::json &obj);
+
+private:
+ bool valid{false};
+ std::string id;
+ std::string name;
+ std::vector<std::string> servers;
+ int maximumZoomLevel{-1};
+ std::string copyright;
+};
+
+}
+
+#endif /* OSMSCOUT_CLIENT_QT_ONLINETILEPROVIDER_H */
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client/include/osmscoutclient/Settings.h
^
|
@@ -0,0 +1,191 @@
+#ifndef OSMSCOUT_CLIENT_SETTINGS_H
+#define OSMSCOUT_CLIENT_SETTINGS_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2013 Tim Teulings
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscout/async/Signal.h>
+#include <osmscout/routing/RoutingProfile.h>
+
+#include <osmscoutclient/ClientImportExport.h>
+#include <osmscoutclient/MapProvider.h>
+#include <osmscoutclient/OnlineTileProvider.h>
+#include <osmscoutclient/VoiceProvider.h>
+
+#include <memory>
+#include <map>
+
+// this variable should be defined by build system
+#ifndef LIBOSMSCOUT_VERSION_STRING
+#define LIBOSMSCOUT_VERSION_STRING "v?"
+#endif
+
+namespace osmscout {
+
+/**
+ * \ingroup ClientAPI
+ *
+ * Abstract settings storage.
+ */
+struct OSMSCOUT_CLIENT_API SettingsStorage
+{
+public:
+ virtual void SetValue(const std::string &key, double d) = 0;
+ virtual void SetValue(const std::string &key, uint32_t i) = 0;
+ virtual void SetValue(const std::string &key, const std::string &str) = 0;
+ virtual void SetValue(const std::string &key, bool b) = 0;
+ virtual void SetValue(const std::string &key, std::vector<char> bytes) = 0;
+ virtual double GetDouble(const std::string &key, double defaultValue = 0) = 0;
+ virtual uint32_t GetUInt(const std::string &key, uint32_t defaultValue = 0) = 0;
+ virtual std::string GetString(const std::string &key, const std::string &defaultValue = "") = 0;
+ virtual bool GetBool(const std::string &key, bool defaultValue = 0) = 0;
+ virtual std::vector<char> GetBytes(const std::string &key) = 0;
+
+ /** Get all configuration keys with given prefix.
+ * @param prefix
+ * @return keys (containing prefix)
+ */
+ virtual std::vector<std::string> Keys(const std::string &prefix) = 0;
+};
+
+using SettingsStoragePtr = std::shared_ptr<SettingsStorage>;
+
+/**
+ * \ingroup ClientAPI
+ *
+ * Settings provides central point mutable configuration of OSMScout library.
+ * It uses Qt's QSettings for persistency. It may be accessed from DBThread instance.
+ *
+ * List of online tile providers should be initialized at application start.
+ * ```
+ * OSMScoutQt::GetInstance().GetSettings()->loadOnlineTileProviders(
+ * ":/resources/online-tile-providers.json");
+ * ```
+ *
+ * Before program exit, resources should be released by calling Settings::FreeInstance.
+ */
+class OSMSCOUT_CLIENT_API Settings
+{
+private:
+ SettingsStoragePtr storage;
+ double physicalDpi;
+ std::string defaultUnits;
+ std::map<std::string, OnlineTileProvider> onlineProviderMap;
+ std::vector<OnlineTileProvider> onlineProviders;
+ std::vector<MapProvider> mapProviders;
+ std::vector<VoiceProvider> voiceProviders;
+
+public:
+ Signal<double> mapDPIChange;
+ Signal<bool> onlineTilesEnabledChanged;
+ Signal<std::string> onlineTileProviderIdChanged;
+ Signal<OnlineTileProvider> onlineTileProviderChanged;
+ Signal<bool> offlineMapChanged;
+ Signal<bool> renderSeaChanged;
+ Signal<std::string> styleSheetDirectoryChanged;
+ Signal<std::string> styleSheetFileChanged;
+ Signal<std::string> voiceLookupDirectoryChanged;
+ Signal<std::string> voiceDirChanged;
+ Signal<std::string> fontNameChanged;
+ Signal<double> fontSizeChanged;
+ Signal<bool> showAltLanguageChanged;
+ Signal<std::string> unitsChanged;
+
+public:
+ /**
+ *
+ * @param storage
+ * @param physicalDpi
+ * @param defaultUnits - metrics or imperial
+ */
+ Settings(SettingsStoragePtr storage, double physicalDpi, const std::string &defaultUnits);
+ virtual ~Settings() = default;
+
+ double GetPhysicalDPI() const;
+
+ void SetMapDPI(double dpi);
+ double GetMapDPI() const;
+
+ osmscout::Vehicle GetRoutingVehicle() const;
+ void SetRoutingVehicle(const osmscout::Vehicle& vehicle);
+
+ bool GetOnlineTilesEnabled() const;
+ void SetOnlineTilesEnabled(bool b);
+
+ const std::vector<OnlineTileProvider> GetOnlineProviders() const;
+ const OnlineTileProvider GetOnlineTileProvider() const;
+
+ const std::vector<MapProvider> GetMapProviders() const;
+ const std::vector<VoiceProvider> GetVoiceProviders() const;
+
+ const std::string GetOnlineTileProviderId() const;
+ void SetOnlineTileProviderId(const std::string &id);
+
+ bool loadOnlineTileProviders(const std::vector<std::string> &paths);
+ bool loadMapProviders(const std::vector<std::string> &paths);
+ bool loadVoiceProviders(const std::vector<std::string> &paths);
+
+ bool GetOfflineMap() const;
+ void SetOfflineMap(bool);
+
+ bool GetRenderSea() const;
+ void SetRenderSea(bool);
+
+ const std::string GetStyleSheetDirectory() const;
+ void SetStyleSheetDirectory(const std::string &dir);
+
+ const std::string GetVoiceLookupDirectory() const;
+ void SetVoiceLookupDirectory(const std::string &voiceLookupDirectory);
+
+ const std::string GetVoiceDir() const;
+ void SetVoiceDir(const std::string &voice);
+
+ const std::string GetStyleSheetFile() const;
+ const std::string GetStyleSheetAbsoluteFile() const;
+ void SetStyleSheetFile(const std::string &file);
+
+ const std::unordered_map<std::string,bool> GetStyleSheetFlags(const std::string &styleSheetFile);
+ const std::unordered_map<std::string,bool> GetStyleSheetFlags();
+ void SetStyleSheetFlags(const std::string &styleSheetFile, std::unordered_map<std::string,bool> flags);
+ void SetStyleSheetFlags(std::unordered_map<std::string,bool> flags);
+
+ std::string GetFontName() const;
+ void SetFontName(const std::string &fontName);
+
+ double GetFontSize() const;
+ void SetFontSize(double fontSize);
+
+ bool GetShowAltLanguage() const;
+ void SetShowAltLanguage(bool showAltLanguage);
+
+ const std::vector<char> GetCookieData() const;
+ void SetCookieData(const std::vector<char> &data);
+
+ std::string GetUnits() const;
+ void SetUnits(const std::string &units);
+};
+
+/**
+ * \ingroup QtAPI
+ */
+using SettingsRef = std::shared_ptr<Settings>;
+
+}
+
+#endif
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client/include/osmscoutclient/VoiceProvider.h
^
|
@@ -0,0 +1,82 @@
+#ifndef OSMSCOUT_CLIENT_VOICEPROVIDER_H
+#define OSMSCOUT_CLIENT_VOICEPROVIDER_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2020 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <string>
+
+#include <osmscoutclient/ClientImportExport.h>
+
+#include <osmscoutclient/json/json_fwd.hpp>
+
+#include <osmscout/util/String.h>
+
+namespace osmscout {
+
+/**
+ * \ingroup ClientAPI
+ */
+struct OSMSCOUT_CLIENT_API VoiceProvider
+{
+private:
+ bool valid=false;
+ std::string uri;
+ std::string listUri;
+ std::string name;
+
+public:
+ VoiceProvider() = default;
+ VoiceProvider(const VoiceProvider &) = default;
+ VoiceProvider(VoiceProvider &&) = default;
+
+ VoiceProvider(const std::string &name, const std::string &uri, const std::string &listUri):
+ valid(true), uri(uri), listUri(listUri), name(name) {}
+
+ virtual ~VoiceProvider() = default;
+
+ VoiceProvider& operator=(const VoiceProvider&) = default;
+ VoiceProvider& operator=(VoiceProvider&&) = default;
+
+ std::string getName() const
+ {
+ return name;
+ }
+
+ std::string getUri() const
+ {
+ return uri;
+ }
+
+ std::string getListUri(const std::string &locale="en") const
+ {
+ return ReplaceString(listUri, "%1", locale);
+ }
+
+ bool isValid() const
+ {
+ return valid;
+ }
+
+ static VoiceProvider fromJson(const nlohmann::json &obj);
+};
+
+}
+
+#endif // OSMSCOUT_CLIENT_VOICEPROVIDER_H
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client/include/osmscoutclient/json/json.hpp
^
|
@@ -0,0 +1,24596 @@
+// __ _____ _____ _____
+// __| | __| | | | JSON for Modern C++
+// | | |__ | | | | | | version 3.11.2
+// |_____|_____|_____|_|___| https://github.com/nlohmann/json
+//
+// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
+// SPDX-License-Identifier: MIT
+
+/****************************************************************************\
+ * Note on documentation: The source files contain links to the online *
+ * documentation of the public API at https://json.nlohmann.me. This URL *
+ * contains the most recent documentation and should also be applicable to *
+ * previous versions; documentation for deprecated functions is not *
+ * removed, but marked deprecated. See "Generate documentation" section in *
+ * file docs/README.md. *
+\****************************************************************************/
+
+#ifndef INCLUDE_NLOHMANN_JSON_HPP_
+#define INCLUDE_NLOHMANN_JSON_HPP_
+
+#include <algorithm> // all_of, find, for_each
+#include <cstddef> // nullptr_t, ptrdiff_t, size_t
+#include <functional> // hash, less
+#include <initializer_list> // initializer_list
+#ifndef JSON_NO_IO
+ #include <iosfwd> // istream, ostream
+#endif // JSON_NO_IO
+#include <iterator> // random_access_iterator_tag
+#include <memory> // unique_ptr
+#include <numeric> // accumulate
+#include <string> // string, stoi, to_string
+#include <utility> // declval, forward, move, pair, swap
+#include <vector> // vector
+
+// #include <nlohmann/adl_serializer.hpp>
+// __ _____ _____ _____
+// __| | __| | | | JSON for Modern C++
+// | | |__ | | | | | | version 3.11.2
+// |_____|_____|_____|_|___| https://github.com/nlohmann/json
+//
+// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
+// SPDX-License-Identifier: MIT
+
+
+
+#include <utility>
+
+// #include <nlohmann/detail/abi_macros.hpp>
+// __ _____ _____ _____
+// __| | __| | | | JSON for Modern C++
+// | | |__ | | | | | | version 3.11.2
+// |_____|_____|_____|_|___| https://github.com/nlohmann/json
+//
+// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
+// SPDX-License-Identifier: MIT
+
+
+
+// This file contains all macro definitions affecting or depending on the ABI
+
+#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
+ #if defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR) && defined(NLOHMANN_JSON_VERSION_PATCH)
+ #if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 11 || NLOHMANN_JSON_VERSION_PATCH != 2
+ #warning "Already included a different version of the library!"
+ #endif
+ #endif
+#endif
+
+#define NLOHMANN_JSON_VERSION_MAJOR 3 // NOLINT(modernize-macro-to-enum)
+#define NLOHMANN_JSON_VERSION_MINOR 11 // NOLINT(modernize-macro-to-enum)
+#define NLOHMANN_JSON_VERSION_PATCH 2 // NOLINT(modernize-macro-to-enum)
+
+#ifndef JSON_DIAGNOSTICS
+ #define JSON_DIAGNOSTICS 0
+#endif
+
+#ifndef JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON
+ #define JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 0
+#endif
+
+#if JSON_DIAGNOSTICS
+ #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS _diag
+#else
+ #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS
+#endif
+
+#if JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON
+ #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON _ldvcmp
+#else
+ #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON
+#endif
+
+#ifndef NLOHMANN_JSON_NAMESPACE_NO_VERSION
+ #define NLOHMANN_JSON_NAMESPACE_NO_VERSION 0
+#endif
+
+// Construct the namespace ABI tags component
+#define NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b) json_abi ## a ## b
+#define NLOHMANN_JSON_ABI_TAGS_CONCAT(a, b) \
+ NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b)
+
+#define NLOHMANN_JSON_ABI_TAGS \
+ NLOHMANN_JSON_ABI_TAGS_CONCAT( \
+ NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \
+ NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON)
+
+// Construct the namespace version component
+#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) \
+ _v ## major ## _ ## minor ## _ ## patch
+#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(major, minor, patch) \
+ NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch)
+
+#if NLOHMANN_JSON_NAMESPACE_NO_VERSION
+#define NLOHMANN_JSON_NAMESPACE_VERSION
+#else
+#define NLOHMANN_JSON_NAMESPACE_VERSION \
+ NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(NLOHMANN_JSON_VERSION_MAJOR, \
+ NLOHMANN_JSON_VERSION_MINOR, \
+ NLOHMANN_JSON_VERSION_PATCH)
+#endif
+
+// Combine namespace components
+#define NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) a ## b
+#define NLOHMANN_JSON_NAMESPACE_CONCAT(a, b) \
+ NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b)
+
+#ifndef NLOHMANN_JSON_NAMESPACE
+#define NLOHMANN_JSON_NAMESPACE \
+ nlohmann::NLOHMANN_JSON_NAMESPACE_CONCAT( \
+ NLOHMANN_JSON_ABI_TAGS, \
+ NLOHMANN_JSON_NAMESPACE_VERSION)
+#endif
+
+#ifndef NLOHMANN_JSON_NAMESPACE_BEGIN
+#define NLOHMANN_JSON_NAMESPACE_BEGIN \
+ namespace nlohmann \
+ { \
+ inline namespace NLOHMANN_JSON_NAMESPACE_CONCAT( \
+ NLOHMANN_JSON_ABI_TAGS, \
+ NLOHMANN_JSON_NAMESPACE_VERSION) \
+ {
+#endif
+
+#ifndef NLOHMANN_JSON_NAMESPACE_END
+#define NLOHMANN_JSON_NAMESPACE_END \
+ } /* namespace (inline namespace) NOLINT(readability/namespace) */ \
+ } // namespace nlohmann
+#endif
+
+// #include <nlohmann/detail/conversions/from_json.hpp>
+// __ _____ _____ _____
+// __| | __| | | | JSON for Modern C++
+// | | |__ | | | | | | version 3.11.2
+// |_____|_____|_____|_|___| https://github.com/nlohmann/json
+//
+// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
+// SPDX-License-Identifier: MIT
+
+
+
+#include <algorithm> // transform
+#include <array> // array
+#include <forward_list> // forward_list
+#include <iterator> // inserter, front_inserter, end
+#include <map> // map
+#include <string> // string
+#include <tuple> // tuple, make_tuple
+#include <type_traits> // is_arithmetic, is_same, is_enum, underlying_type, is_convertible
+#include <unordered_map> // unordered_map
+#include <utility> // pair, declval
+#include <valarray> // valarray
+
+// #include <nlohmann/detail/exceptions.hpp>
+// __ _____ _____ _____
+// __| | __| | | | JSON for Modern C++
+// | | |__ | | | | | | version 3.11.2
+// |_____|_____|_____|_|___| https://github.com/nlohmann/json
+//
+// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
+// SPDX-License-Identifier: MIT
+
+
+
+#include <cstddef> // nullptr_t
+#include <exception> // exception
+#include <stdexcept> // runtime_error
+#include <string> // to_string
+#include <vector> // vector
+
+// #include <nlohmann/detail/value_t.hpp>
+// __ _____ _____ _____
+// __| | __| | | | JSON for Modern C++
+// | | |__ | | | | | | version 3.11.2
+// |_____|_____|_____|_|___| https://github.com/nlohmann/json
+//
+// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
+// SPDX-License-Identifier: MIT
+
+
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client/include/osmscoutclient/json/json_fwd.hpp
^
|
@@ -0,0 +1,175 @@
+// __ _____ _____ _____
+// __| | __| | | | JSON for Modern C++
+// | | |__ | | | | | | version 3.11.2
+// |_____|_____|_____|_|___| https://github.com/nlohmann/json
+//
+// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
+// SPDX-License-Identifier: MIT
+
+#ifndef INCLUDE_NLOHMANN_JSON_FWD_HPP_
+#define INCLUDE_NLOHMANN_JSON_FWD_HPP_
+
+#include <cstdint> // int64_t, uint64_t
+#include <map> // map
+#include <memory> // allocator
+#include <string> // string
+#include <vector> // vector
+
+// #include <nlohmann/detail/abi_macros.hpp>
+// __ _____ _____ _____
+// __| | __| | | | JSON for Modern C++
+// | | |__ | | | | | | version 3.11.2
+// |_____|_____|_____|_|___| https://github.com/nlohmann/json
+//
+// SPDX-FileCopyrightText: 2013-2022 Niels Lohmann <https://nlohmann.me>
+// SPDX-License-Identifier: MIT
+
+
+
+// This file contains all macro definitions affecting or depending on the ABI
+
+#ifndef JSON_SKIP_LIBRARY_VERSION_CHECK
+ #if defined(NLOHMANN_JSON_VERSION_MAJOR) && defined(NLOHMANN_JSON_VERSION_MINOR) && defined(NLOHMANN_JSON_VERSION_PATCH)
+ #if NLOHMANN_JSON_VERSION_MAJOR != 3 || NLOHMANN_JSON_VERSION_MINOR != 11 || NLOHMANN_JSON_VERSION_PATCH != 2
+ #warning "Already included a different version of the library!"
+ #endif
+ #endif
+#endif
+
+#define NLOHMANN_JSON_VERSION_MAJOR 3 // NOLINT(modernize-macro-to-enum)
+#define NLOHMANN_JSON_VERSION_MINOR 11 // NOLINT(modernize-macro-to-enum)
+#define NLOHMANN_JSON_VERSION_PATCH 2 // NOLINT(modernize-macro-to-enum)
+
+#ifndef JSON_DIAGNOSTICS
+ #define JSON_DIAGNOSTICS 0
+#endif
+
+#ifndef JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON
+ #define JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON 0
+#endif
+
+#if JSON_DIAGNOSTICS
+ #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS _diag
+#else
+ #define NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS
+#endif
+
+#if JSON_USE_LEGACY_DISCARDED_VALUE_COMPARISON
+ #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON _ldvcmp
+#else
+ #define NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON
+#endif
+
+#ifndef NLOHMANN_JSON_NAMESPACE_NO_VERSION
+ #define NLOHMANN_JSON_NAMESPACE_NO_VERSION 0
+#endif
+
+// Construct the namespace ABI tags component
+#define NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b) json_abi ## a ## b
+#define NLOHMANN_JSON_ABI_TAGS_CONCAT(a, b) \
+ NLOHMANN_JSON_ABI_TAGS_CONCAT_EX(a, b)
+
+#define NLOHMANN_JSON_ABI_TAGS \
+ NLOHMANN_JSON_ABI_TAGS_CONCAT( \
+ NLOHMANN_JSON_ABI_TAG_DIAGNOSTICS, \
+ NLOHMANN_JSON_ABI_TAG_LEGACY_DISCARDED_VALUE_COMPARISON)
+
+// Construct the namespace version component
+#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch) \
+ _v ## major ## _ ## minor ## _ ## patch
+#define NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(major, minor, patch) \
+ NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT_EX(major, minor, patch)
+
+#if NLOHMANN_JSON_NAMESPACE_NO_VERSION
+#define NLOHMANN_JSON_NAMESPACE_VERSION
+#else
+#define NLOHMANN_JSON_NAMESPACE_VERSION \
+ NLOHMANN_JSON_NAMESPACE_VERSION_CONCAT(NLOHMANN_JSON_VERSION_MAJOR, \
+ NLOHMANN_JSON_VERSION_MINOR, \
+ NLOHMANN_JSON_VERSION_PATCH)
+#endif
+
+// Combine namespace components
+#define NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b) a ## b
+#define NLOHMANN_JSON_NAMESPACE_CONCAT(a, b) \
+ NLOHMANN_JSON_NAMESPACE_CONCAT_EX(a, b)
+
+#ifndef NLOHMANN_JSON_NAMESPACE
+#define NLOHMANN_JSON_NAMESPACE \
+ nlohmann::NLOHMANN_JSON_NAMESPACE_CONCAT( \
+ NLOHMANN_JSON_ABI_TAGS, \
+ NLOHMANN_JSON_NAMESPACE_VERSION)
+#endif
+
+#ifndef NLOHMANN_JSON_NAMESPACE_BEGIN
+#define NLOHMANN_JSON_NAMESPACE_BEGIN \
+ namespace nlohmann \
+ { \
+ inline namespace NLOHMANN_JSON_NAMESPACE_CONCAT( \
+ NLOHMANN_JSON_ABI_TAGS, \
+ NLOHMANN_JSON_NAMESPACE_VERSION) \
+ {
+#endif
+
+#ifndef NLOHMANN_JSON_NAMESPACE_END
+#define NLOHMANN_JSON_NAMESPACE_END \
+ } /* namespace (inline namespace) NOLINT(readability/namespace) */ \
+ } // namespace nlohmann
+#endif
+
+
+/*!
+@brief namespace for Niels Lohmann
+@see https://github.com/nlohmann
+@since version 1.0.0
+*/
+NLOHMANN_JSON_NAMESPACE_BEGIN
+
+/*!
+@brief default JSONSerializer template argument
+
+This serializer ignores the template arguments and uses ADL
+([argument-dependent lookup](https://en.cppreference.com/w/cpp/language/adl))
+for serialization.
+*/
+template<typename T = void, typename SFINAE = void>
+struct adl_serializer;
+
+/// a class to store JSON values
+/// @sa https://json.nlohmann.me/api/basic_json/
+template<template<typename U, typename V, typename... Args> class ObjectType =
+ std::map,
+ template<typename U, typename... Args> class ArrayType = std::vector,
+ class StringType = std::string, class BooleanType = bool,
+ class NumberIntegerType = std::int64_t,
+ class NumberUnsignedType = std::uint64_t,
+ class NumberFloatType = double,
+ template<typename U> class AllocatorType = std::allocator,
+ template<typename T, typename SFINAE = void> class JSONSerializer =
+ adl_serializer,
+ class BinaryType = std::vector<std::uint8_t>>
+class basic_json;
+
+/// @brief JSON Pointer defines a string syntax for identifying a specific value within a JSON document
+/// @sa https://json.nlohmann.me/api/json_pointer/
+template<typename RefStringType>
+class json_pointer;
+
+/*!
+@brief default specialization
+@sa https://json.nlohmann.me/api/json/
+*/
+using json = basic_json<>;
+
+/// @brief a minimal map-like container that preserves insertion order
+/// @sa https://json.nlohmann.me/api/ordered_map/
+template<class Key, class T, class IgnoredLess, class Allocator>
+struct ordered_map;
+
+/// @brief specialization that maintains the insertion order of object keys
+/// @sa https://json.nlohmann.me/api/ordered_json/
+using ordered_json = basic_json<nlohmann::ordered_map>;
+
+NLOHMANN_JSON_NAMESPACE_END
+
+#endif // INCLUDE_NLOHMANN_JSON_FWD_HPP_
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client/include/osmscoutclient/meson.build
^
|
@@ -2,5 +2,5 @@
clientFeaturesCfg.set('OSMSCOUT_CLIENT_MESON_BUILD',true, description: 'we are building using meson')
configure_file(output: 'ClientFeatures.h',
+ install_dir: 'include/osmscoutclient',
configuration: clientFeaturesCfg)
-
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client/meson.build
^
|
@@ -25,12 +25,13 @@
osmscoutclient = library('osmscout_client',
osmscoutclientSrc,
- include_directories: osmscoutclientIncDir,
+ include_directories: [osmscoutclientIncDir, osmscoutIncDir, osmscoutmapIncDir],
cpp_args: cppArgs,
dependencies: [mathDep, threadDep],
link_args: link_args,
- link_with: [osmscout],
+ link_with: [osmscout, osmscoutmap],
version: libraryVersion,
install: true)
-# TODO: Generate PKG_CONFIG file
+pkg = import('pkgconfig')
+pkg.generate(osmscoutclient)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client/src/meson.build
^
|
@@ -1,3 +1,7 @@
osmscoutclientSrc = [
- 'src/osmscoutclient/Empty.cpp'
+ 'src/osmscoutclient/DBInstance.cpp',
+ 'src/osmscoutclient/MapProvider.cpp',
+ 'src/osmscoutclient/OnlineTileProvider.cpp',
+ 'src/osmscoutclient/Settings.cpp',
+ 'src/osmscoutclient/VoiceProvider.cpp'
]
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client/src/osmscoutclient/DBInstance.cpp
^
|
@@ -0,0 +1,110 @@
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2017 Lukáš Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <osmscoutclient/DBInstance.h>
+
+#include <osmscoutmap/StyleError.h>
+
+#include <osmscout/log/Logger.h>
+
+namespace osmscout {
+
+bool DBInstance::LoadStyle(const std::string &stylesheetFilename,
+ std::unordered_map<std::string,bool> stylesheetFlags,
+ std::list<StyleError> &errors)
+{
+ std::scoped_lock lock(mutex);
+
+ if (!database->IsOpen()) {
+ return false;
+ }
+
+ osmscout::TypeConfigRef typeConfig=database->GetTypeConfig();
+
+ if (!typeConfig) {
+ return false;
+ }
+
+ // new map style may require more data types. when tile is marked as "completed"
+ // such data types are never loaded into these tiles
+ // so we mark them as "incomplete" to make sure that all types for new stylesheet are loaded
+ mapService->InvalidateTileCache();
+ osmscout::StyleConfigRef newStyleConfig=std::make_shared<osmscout::StyleConfig>(typeConfig);
+
+ for (const auto& flag : stylesheetFlags) {
+ newStyleConfig->AddFlag(flag.first,flag.second);
+ }
+
+ if (newStyleConfig->Load(stylesheetFilename, nullptr, false)) {
+ // Tear down
+ painterHolder.clear();
+
+ // Recreate
+ styleConfig=newStyleConfig;
+
+ log.Info()<< "Created new style with " << stylesheetFilename;
+ }
+ else {
+ errors=newStyleConfig->GetErrors();
+
+ for(const auto& err : errors) {
+ log.Warn() << "Style error:" << err.GetDescription();
+ }
+
+ styleConfig=nullptr;
+
+ return false;
+ }
+
+ return true;
+}
+
+void DBInstance::OnThreadFinished(const std::thread::id &id)
+{
+ std::scoped_lock lock(mutex);
+ if (auto it=painterHolder.find(id);
+ it!=painterHolder.end()){
+ painterHolder.erase(it);
+ }
+}
+
+void DBInstance::Close()
+{
+ std::scoped_lock lock(mutex);
+
+ painterHolder.clear();
+
+ // release map service, its threads may still use db
+ // threads are stopped and joined in MapService destructor
+ if (mapService && mapService.use_count() > 1){
+ // if DBInstance is not exclusive owner, threads may hit closed data file and trigger assert!
+ log.Warn() << "Map service for " << path << " is used on multiple places";
+ }
+ mapService.reset();
+
+ locationService.reset();
+ locationDescriptionService.reset();
+ styleConfig.reset();
+
+ if (database && database->IsOpen()) {
+ database->Close();
+ }
+ database.reset();
+}
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client/src/osmscoutclient/MapProvider.cpp
^
|
@@ -0,0 +1,43 @@
+/*
+ This source is part of the libosmscout-map library
+ Copyright (C) 2016 Lukáš Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscoutclient/MapProvider.h>
+
+#include <osmscoutclient/json/json.hpp>
+
+namespace osmscout {
+
+MapProvider MapProvider::fromJson(const nlohmann::json &obj)
+{
+ if (!obj.is_object()) {
+ return MapProvider();
+ }
+
+ auto name = obj["name"];
+ auto uri = obj["uri"];
+ auto listUri = obj["listUri"];
+
+ if (!(name.is_string() && uri.is_string() && listUri.is_string())){
+ return MapProvider();
+ }
+ return MapProvider(name.get<std::string>(),
+ uri.get<std::string>(),
+ listUri.get<std::string>());
+}
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client/src/osmscoutclient/OnlineTileProvider.cpp
^
|
@@ -0,0 +1,59 @@
+/*
+ This source is part of the libosmscout-map library
+ Copyright (C) 2016 Lukáš Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscoutclient/OnlineTileProvider.h>
+
+#include <osmscoutclient/json/json.hpp>
+
+namespace osmscout {
+
+OnlineTileProvider OnlineTileProvider::fromJson(const nlohmann::json &val)
+{
+ if (!val.is_object()) {
+ return OnlineTileProvider();
+ }
+
+ auto id = val["id"];
+ auto name = val["name"];
+ auto servers = val["servers"];
+ auto maximumZoomLevel = val["maximumZoomLevel"];
+ auto copyright = val["copyright"];
+
+ if (!(id.is_string() && name.is_string() && servers.is_array() &&
+ maximumZoomLevel.is_number() && copyright.is_string())){
+ return OnlineTileProvider();
+ }
+
+ std::vector<std::string> serverList;
+ for (auto serverVal: servers){
+ if (serverVal.is_string()){
+ serverList.push_back(serverVal.get<std::string>());
+ }
+ }
+ if (serverList.empty()){
+ return OnlineTileProvider();
+ }
+
+ return OnlineTileProvider(id.get<std::string>(),
+ name.get<std::string>(),
+ serverList,
+ maximumZoomLevel.get<int>(),
+ copyright.get<std::string>());
+}
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client/src/osmscoutclient/Settings.cpp
^
|
@@ -0,0 +1,377 @@
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2013 Tim Teulings
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscoutclient/Settings.h>
+
+#include <osmscout/io/File.h>
+#include <osmscoutclient/json/json.hpp>
+
+namespace osmscout {
+
+Settings::Settings(SettingsStoragePtr storage, double physicalDpi, const std::string &defaultUnits):
+ storage(storage), physicalDpi(physicalDpi), defaultUnits(defaultUnits)
+{
+ // no code
+}
+
+double Settings::GetPhysicalDPI() const
+{
+ return physicalDpi;
+}
+
+void Settings::SetMapDPI(double dpi)
+{
+ storage->SetValue("OSMScoutLib/Rendering/DPI", dpi);
+ mapDPIChange.Emit(dpi);
+}
+
+double Settings::GetMapDPI() const
+{
+ return storage->GetDouble("OSMScoutLib/Rendering/DPI",physicalDpi);
+}
+
+osmscout::Vehicle Settings::GetRoutingVehicle() const
+{
+ return osmscout::Vehicle(storage->GetUInt("OSMScoutLib/Routing/Vehicle",osmscout::vehicleCar));
+}
+
+void Settings::SetRoutingVehicle(const osmscout::Vehicle& vehicle)
+{
+ storage->SetValue("OSMScoutLib/Routing/Vehicle", (uint32_t)vehicle);
+}
+
+bool Settings::GetOnlineTilesEnabled() const
+{
+ return storage->GetBool("OSMScoutLib/Rendering/OnlineTiles", true);
+}
+
+void Settings::SetOnlineTilesEnabled(bool b)
+{
+ if (GetOnlineTilesEnabled() != b){
+ storage->SetValue("OSMScoutLib/Rendering/OnlineTiles", b);
+ onlineTilesEnabledChanged.Emit(b);
+ }
+}
+
+const std::vector<OnlineTileProvider> Settings::GetOnlineProviders() const
+{
+ return onlineProviders;
+}
+
+const std::vector<MapProvider> Settings::GetMapProviders() const
+{
+ return mapProviders;
+}
+
+const std::vector<VoiceProvider> Settings::GetVoiceProviders() const
+{
+ return voiceProviders;
+}
+
+const OnlineTileProvider Settings::GetOnlineTileProvider() const
+{
+ if (auto it=onlineProviderMap.find(GetOnlineTileProviderId());
+ it!=onlineProviderMap.end()){
+ return it->second;
+ }
+ return OnlineTileProvider();
+}
+
+const std::string Settings::GetOnlineTileProviderId() const
+{
+ std::string def = "?";
+ if (!onlineProviders.empty()){
+ def = onlineProviders.begin()->getId();
+ }
+ return storage->GetString("OSMScoutLib/Rendering/OnlineTileProvider", def);
+}
+
+void Settings::SetOnlineTileProviderId(const std::string &id){
+ if (GetOnlineTileProviderId() != id){
+ storage->SetValue("OSMScoutLib/Rendering/OnlineTileProvider", id);
+ onlineTileProviderIdChanged.Emit(id);
+ onlineTileProviderChanged.Emit(GetOnlineTileProvider());
+ }
+}
+
+bool Settings::loadOnlineTileProviders(const std::vector<std::string> &paths)
+{
+ // load online tile providers
+ bool result = true;
+ for (const auto &path : paths) {
+ std::vector<char> content;
+ if (!ReadFile(path, content)) {
+ log.Warn() << "Couldn't open" << path << "file.";
+ result = false;
+ continue;
+ }
+ log.Debug() << "Loading online tile providers from " << path;
+
+ using json = nlohmann::json;
+ try {
+ auto doc = json::parse(content);
+ if (!doc.is_array()) {
+ log.Warn() << "Json is not array " << doc.dump();
+ result = false;
+ continue;
+ }
+ for (auto obj: doc) {
+ OnlineTileProvider provider = OnlineTileProvider::fromJson(obj);
+ if (!provider.isValid()) {
+ log.Warn() << "Can't parse online provider from json value" << obj.dump();
+ result = false;
+ } else {
+ if (onlineProviderMap.find(provider.getId())==onlineProviderMap.end()) {
+ onlineProviderMap[provider.getId()] = provider;
+ onlineProviders.push_back(provider);
+ }
+ }
+ }
+ } catch (const json::exception &e) {
+ log.Warn() << "Failed to parse json from" << path << ":" << e.what();
+ result = false;
+ }
+ }
+
+ // check if current provider is valid...
+ if (onlineProviderMap.find(GetOnlineTileProviderId())==onlineProviderMap.end()){
+ // ...if not, setup first
+ if (!onlineProviders.empty()){
+ SetOnlineTileProviderId(onlineProviders.begin()->getId());
+ }
+ }
+
+ onlineTileProviderIdChanged.Emit(GetOnlineTileProviderId());
+ return result && !onlineProviders.empty();
+}
+
+namespace { // anonymous namespace
+
+template <typename Provider>
+bool loadResourceProviders(const std::string &path, std::vector<Provider> &providers)
+{
+ std::vector<char> content;
+ if (!ReadFile(path, content)) {
+ log.Warn() << "Couldn't open " << path << " file.";
+ return false;
+ }
+ log.Debug() << "Loading providers from " << path;
+
+ using json = nlohmann::json;
+ try {
+ auto doc = json::parse(content);
+ if (!doc.is_array()) {
+ log.Warn() << "Json is not array " << doc.dump();
+ } else {
+ for (auto obj: doc) {
+ Provider provider = Provider::fromJson(obj);
+ if (!provider.isValid()) {
+ log.Warn() << "Can't parse online provider from json value " << obj.dump();
+ } else {
+ providers.push_back(provider);
+ }
+ }
+ }
+ } catch (const json::exception &e) {
+ log.Warn() << "Failed to parse json from " << path << ": " << e.what();
+ return false;
+ }
+ return true;
+}
+}
+
+bool Settings::loadMapProviders(const std::vector<std::string> &paths)
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-client/src/osmscoutclient/VoiceProvider.cpp
^
|
@@ -0,0 +1,42 @@
+/*
+ This source is part of the libosmscout-map library
+ Copyright (C) 2020 Lukáš Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscoutclient/VoiceProvider.h>
+#include <osmscoutclient/json/json.hpp>
+
+namespace osmscout {
+
+VoiceProvider VoiceProvider::fromJson(const nlohmann::json &obj)
+{
+ if (!obj.is_object()) {
+ return VoiceProvider();
+ }
+
+ auto name = obj["name"];
+ auto uri = obj["uri"];
+ auto listUri = obj["listUri"];
+
+ if (!(name.is_string() && uri.is_string() && listUri.is_string())){
+ return VoiceProvider();
+ }
+ return VoiceProvider(name.get<std::string>(),
+ uri.get<std::string>(),
+ listUri.get<std::string>());
+}
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-gpx/CMakeLists.txt
^
|
@@ -19,7 +19,7 @@
src/osmscoutgpx/Extensions.cpp
)
-if(LIBXML2_FOUND)
+if(TARGET LibXml2::LibXml2)
list(APPEND HEADER_FILES
include/osmscoutgpx/Import.h
include/osmscoutgpx/Export.h
@@ -42,20 +42,16 @@
TARGET OSMScout::OSMScout
)
-if(LIBXML2_FOUND)
- target_include_directories(OSMScoutGPX PRIVATE ${LIBXML2_INCLUDE_DIR})
- target_link_libraries(OSMScoutGPX ${LIBXML2_LIBRARIES})
- target_include_directories(OSMScoutGPX INTERFACE ${LIBXML2_INCLUDE_DIR})
+if(TARGET LibXml2::LibXml2)
+ target_link_libraries(OSMScoutGPX LibXml2::LibXml2)
endif()
-if (ICONV_FOUND)
- target_include_directories(OSMScoutGPX PRIVATE ${ICONV_INCLUDE_DIRS})
- target_link_libraries(OSMScoutGPX ${ICONV_LIBRARIES})
+if (TARGET Iconv::Iconv)
+ target_link_libraries(OSMScoutGPX Iconv::Iconv)
endif()
-if (ZLIB_FOUND)
- target_include_directories(OSMScoutGPX PRIVATE ${ZLIB_INCLUDE_DIRS})
- target_link_libraries(OSMScoutGPX ${ZLIB_LIBRARIES})
+if (TARGET ZLIB::ZLIB)
+ target_link_libraries(OSMScoutGPX ZLIB::ZLIB)
endif()
if(APPLE AND OSMSCOUT_BUILD_FRAMEWORKS)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-gpx/include/osmscoutgpx/meson.build
^
|
@@ -3,5 +3,6 @@
gpxFeaturesCfg.set('OSMSCOUT_GPX_MESON_BUILD',true, description: 'we are building using meson')
configure_file(output: 'GPXFeatures.h',
+ install_dir: 'include/osmscoutgpx',
configuration: gpxFeaturesCfg)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-gpx/meson.build
^
|
@@ -22,4 +22,5 @@
version: libraryVersion,
install: true)
-# TODO: Generate PKG_CONFIG file
+pkg = import('pkgconfig')
+pkg.generate(osmscoutgpx)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-import/CMakeLists.txt
^
|
@@ -108,15 +108,15 @@
list(APPEND EXCLUDE_HEADER GenTextIndex.h)
endif()
-if(LIBXML2_FOUND)
+if(TARGET LibXml2::LibXml2)
list(APPEND HEADER_FILES include/osmscoutimport/PreprocessOSM.h)
list(APPEND SOURCE_FILES src/osmscoutimport/PreprocessOSM.cpp)
else()
list(APPEND EXCLUDE_HEADER PreprocessOSM.h)
endif()
-if (PROTOBUF_FOUND)
- protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS
+if (TARGET protobuf::libprotobuf AND EXISTS ${PROTOBUF_PROTOC_EXECUTABLE})
+ protobuf_generate_cpp(PROTO_SRCS PROTO_HDRS
${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/fileformat.proto
${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/osmformat.proto)
list(APPEND HEADER_FILES include/osmscoutimport/PreprocessPBF.h)
@@ -140,33 +140,29 @@
SKIP_HEADER
)
-if(LIBXML2_FOUND)
- target_include_directories(OSMScoutImport PRIVATE ${LIBXML2_INCLUDE_DIR})
- target_link_libraries(OSMScoutImport ${LIBXML2_LIBRARIES})
+if(TARGET LibXml2::LibXml2)
+ target_link_libraries(OSMScoutImport LibXml2::LibXml2)
endif()
-if (PROTOBUF_FOUND)
- target_include_directories(OSMScoutImport PRIVATE ${Protobuf_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR})
- target_link_libraries(OSMScoutImport ${Protobuf_LIBRARIES})
+if (TARGET protobuf::libprotobuf AND EXISTS ${PROTOBUF_PROTOC_EXECUTABLE})
+ target_include_directories(OSMScoutImport PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+ target_link_libraries(OSMScoutImport protobuf::libprotobuf)
if(WIN32)
target_compile_definitions(OSMScoutImport PRIVATE -DPROTOBUF_USE_DLLS)
endif()
target_compile_definitions(OSMScoutImport PRIVATE -DOSMSCOUT_IMPORT_CMAKE_BUILD)
endif()
-if (ICONV_FOUND)
- target_include_directories(OSMScoutImport PRIVATE ${ICONV_INCLUDE_DIRS})
- target_link_libraries(OSMScoutImport ${ICONV_LIBRARIES})
+if (TARGET Iconv::Iconv)
+ target_link_libraries(OSMScoutImport Iconv::Iconv)
endif()
-if (LIBLZMA_FOUND)
- target_include_directories(OSMScoutImport PRIVATE ${LIBLZMA_INCLUDE_DIRS})
- target_link_libraries(OSMScoutImport ${LIBLZMA_LIBRARIES})
+if (TARGET LibLZMA::LibLZMA)
+ target_link_libraries(OSMScoutImport LibLZMA::LibLZMA)
endif()
-if (ZLIB_FOUND)
- target_include_directories(OSMScoutImport PRIVATE ${ZLIB_INCLUDE_DIRS})
- target_link_libraries(OSMScoutImport ${ZLIB_LIBRARIES})
+if (TARGET ZLIB::ZLIB)
+ target_link_libraries(OSMScoutImport ZLIB::ZLIB)
endif()
if(MARISA_FOUND)
@@ -178,7 +174,7 @@
target_link_libraries(OSMScoutImport TBB::tbb)
endif()
-if(OpenMP_CXX_FOUND)
+if(TARGET OpenMP::OpenMP_CXX)
target_link_libraries(OSMScoutImport OpenMP::OpenMP_CXX)
endif()
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-import/include/osmscoutimport/AreaIndexGenerator.h
^
|
@@ -24,6 +24,7 @@
#include <list>
#include <map>
+#include <utility>
#include <osmscout/Pixel.h>
@@ -66,16 +67,17 @@
}
};
+ private:
std::string typeName;
std::string typeNamePlural;
std::string dataFile;
std::string indexFile;
protected:
- AreaIndexGenerator(const std::string &typeName,
- const std::string &typeNamePlural,
- const std::string &dataFile,
- const std::string &indexFile):
+ AreaIndexGenerator(const std::string& typeName,
+ const std::string& typeNamePlural,
+ const std::string& dataFile,
+ const std::string& indexFile):
typeName(typeName),
typeNamePlural(typeNamePlural),
dataFile(dataFile),
@@ -118,9 +120,8 @@
* @param typeInfo
* @param typeData
* @param typeCellOffsets
- * @return
*/
- bool WriteBitmap(Progress& progress,
+ void WriteBitmap(Progress& progress,
FileWriter& writer,
const TypeInfo& typeInfo,
const TypeData& typeData,
@@ -135,18 +136,17 @@
Progress& progress,
const std::vector<TypeInfoRef> &types,
const MagnificationLevel &areaIndexMinMag,
- const MagnificationLevel &areaIndexMaxLevel,
+ const MagnificationLevel &areaIndexMaxMag,
bool useMmap);
};
template <typename Object>
- bool AreaIndexGenerator<Object>::WriteBitmap(Progress& progress,
+ void AreaIndexGenerator<Object>::WriteBitmap(Progress& progress,
FileWriter& writer,
const TypeInfo& typeInfo,
const TypeData& typeData,
const CoordOffsetsMap& typeCellOffsets)
{
- size_t indexEntries=0;
size_t dataSize=0;
std::array<char,10> buffer;
@@ -156,8 +156,6 @@
// that much bytes we need to address the last data entry.
for (const auto& cell : typeCellOffsets) {
- indexEntries+=cell.second.size();
-
dataSize+=EncodeNumber(cell.second.size(),
buffer);
@@ -176,13 +174,18 @@
// "+1" because we add +1 to every offset, to generate offset > 0
uint8_t dataOffsetBytes=BytesNeededToEncodeNumber(dataSize+1);
- progress.Info("Writing map for "+
- typeInfo.GetName()+" , "+
- ByteSizeToString(1.0*dataOffsetBytes*typeData.tileBox.GetCount()+dataSize));
- FileOffset bitmapOffset;
+ GeoBox boundingBox=typeData.tileBox.GetCenter().GetBoundingBox(typeData.indexLevel);
- bitmapOffset=writer.GetPos();
+ progress.Info("Writing map for "+
+ typeInfo.GetName()+
+ " ("+
+ ByteSizeToString(1.0*dataOffsetBytes*typeData.tileBox.GetCount()+dataSize)+", "+
+ GetEllipsoidalDistance(boundingBox.GetTopLeft(),boundingBox.GetBottomRight()).AsString()+", "+
+ std::to_string(typeData.indexEntries/typeData.indexCells)+"/cell"+
+ ")");
+
+ FileOffset bitmapOffset=writer.GetPos();
assert(typeData.indexOffset!=0);
@@ -201,9 +204,7 @@
dataOffsetBytes);
}
- FileOffset dataStartOffset;
-
- dataStartOffset=writer.GetPos();
+ FileOffset dataStartOffset=writer.GetPos();
// Now write the list of offsets of objects for every cell with content
for (const auto& cell : typeCellOffsets) {
@@ -211,11 +212,10 @@
((cell.first.GetY()-typeData.tileBox.GetMinY())*typeData.tileBox.GetWidth()+
cell.first.GetX()-typeData.tileBox.GetMinX())*(FileOffset)dataOffsetBytes;
FileOffset previousOffset=0;
- FileOffset cellOffset;
assert(bitmapCellOffset>=bitmapOffset);
- cellOffset=writer.GetPos();
+ FileOffset cellOffset=writer.GetPos();
writer.SetPos(bitmapCellOffset);
@@ -238,8 +238,6 @@
previousOffset=offset;
}
}
-
- return true;
}
template <typename Object>
@@ -260,37 +258,59 @@
}
// Average number of entries per tile cell
- double average=overallCount*1.0/cellFillCount.size();
+ double average=double(overallCount)/double(cellFillCount.size());
size_t emptyCount=0;
- size_t toLowCount=0;
- size_t toHighCount=0;
- size_t inCount=0;
+ size_t tooLowCount=0;
+ size_t tooHighCount=0;
+ size_t muchTooHighCount=0;
+ size_t okCount=0;
size_t allCount=0;
+ size_t tooLowValue=4*average/10;
+ size_t tooHighValue=64+32;
+ size_t muchTooHighValue=128+64;
+
for (const auto& cell : cellFillCount) {
+ allCount++;
+
if (cell.second==0) {
emptyCount++;
}
- else if (cell.second<0.4*average) {
- toLowCount++;
+ else if (cell.second<tooLowValue) {
+ tooLowCount++;
+ }
+ else if (cell.second>muchTooHighValue) {
+ muchTooHighCount++;
}
- else if (cell.second>128){
- toHighCount++;
+ else if (cell.second>tooHighValue) {
+ tooHighCount++;
}
else {
- inCount++;
+ okCount++;
}
+ }
- allCount++;
+ progress.Info(typeInfo.GetName()+" "+
+ std::to_string(emptyCount)+" | "+
+ std::to_string(tooLowCount)+" < "+
+ std::to_string(okCount)+" < "+
+ std::to_string(tooHighCount)+" *"+
+ std::to_string(muchTooHighCount)+"* - "+
+ std::to_string(allCount));
+
+ if (double(muchTooHighCount) / double(allCount) >= 0.01) {
+ progress.Warning(typeInfo.GetName() + " has more than 1% cells with much too high entry count, will use smaller tile size");
+ return false;
}
- if (toHighCount*1.0/allCount>=0.05) {
+ if (double(tooHighCount) / double(allCount) >= 0.05) {
+ progress.Warning(typeInfo.GetName() + " has more than 5% cells with too high entry count, will use smaller tile size");
return false;
}
- if (toLowCount*1.0/allCount>=0.2) {
- progress.Warning(typeInfo.GetName()+" has more than 20% cells with <40% of average filling ("+std::to_string(toLowCount)+"/"+std::to_string(allCount)+")");
+ if (double(tooLowCount) / double(allCount) >= 0.2) {
+ progress.Warning(typeInfo.GetName() + " has more than 20% cells with <40% of average filling");
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-import/include/osmscoutimport/GenAreaRouteIndex.h
^
|
@@ -47,7 +47,7 @@
public:
AreaRouteIndexGenerator();
- virtual ~AreaRouteIndexGenerator() = default;
+ ~AreaRouteIndexGenerator() override = default;
void GetDescription(const ImportParameter& parameter,
ImportModuleDescription& description) const override;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-import/include/osmscoutimport/GenAreaWayIndex.h
^
|
@@ -47,7 +47,7 @@
public:
AreaWayIndexGenerator();
- virtual ~AreaWayIndexGenerator() = default;
+ ~AreaWayIndexGenerator() override = default;
void GetDescription(const ImportParameter& parameter,
ImportModuleDescription& description) const override;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-import/include/osmscoutimport/GenRelAreaDat.h
^
|
@@ -157,7 +157,7 @@
}
}
- inline std::string GetRelationRoleStr() const
+ static inline std::string GetRelationRoleStr(RelationRole relationRole)
{
switch (relationRole){
case outer:
@@ -169,6 +169,11 @@
}
}
+ inline std::string GetRelationRoleStr() const
+ {
+ return GetRelationRoleStr(relationRole);
+ }
+
inline void SetId(OSMId id)
{
this->id = id;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-import/include/osmscoutimport/ImportParameter.h
^
|
@@ -93,14 +93,14 @@
using RouterRef = std::shared_ptr<Router>;
- enum class AssumeLandStrategy
+ enum class AssumeLandStrategy : std::uint8_t
{
disable = 0, // disable land detection by db objects
enable = 1, // enable land detection
automatic = 2, // disable land detection when data polygon is known
};
- enum class TextIndexVariant
+ enum class TextIndexVariant : std::uint8_t
{
original = 0, // store original names
transliterate = 1, // store transliterated form of names
@@ -161,11 +161,11 @@
MagnificationLevel areaNodeBitmapMaxMag; //<! Maximum Magnification level for bitmap index
uint16_t areaNodeBitmapLimit; //<! All cells must have less entries for a given zoom level
- MagnificationLevel areaWayMinMag; //<! Minimum magnification of index for individual type
- MagnificationLevel areaWayIndexMaxLevel; //<! Maximum zoom level for area way index bitmap
+ MagnificationLevel areaWayIndexMinMag; //<! Minimum magnification of index for individual type
+ MagnificationLevel areaWayIndexMaxMag; //<! Maximum zoom level for area way index bitmap
- MagnificationLevel areaRouteMinMag; //<! Minimum magnification of index for individual type
- MagnificationLevel areaRouteIndexMaxLevel; //<! Maximum zoom level for area route index bitmap
+ MagnificationLevel areaRouteIndexMinMag; //<! Minimum magnification of index for individual type
+ MagnificationLevel areaRouteIndexMaxMag; //<! Maximum zoom level for area route index bitmap
uint32_t waterIndexMinMag; //<! Minimum level of the generated water index
uint32_t waterIndexMaxMag; //<! Maximum level of the generated water index
@@ -252,11 +252,11 @@
MagnificationLevel GetAreaNodeBitmapMaxMag() const;
uint16_t GetAreaNodeBitmapLimit() const;
- MagnificationLevel GetAreaWayMinMag() const;
- MagnificationLevel GetAreaWayIndexMaxLevel() const;
+ MagnificationLevel GetAreaWayIndexMinMag() const;
+ MagnificationLevel GetAreaWayIndexMaxMag() const;
- MagnificationLevel GetAreaRouteMinMag() const;
- MagnificationLevel GetAreaRouteIndexMaxLevel() const;
+ MagnificationLevel GetAreaRouteIndexMinMag() const;
+ MagnificationLevel GetAreaRouteIndexMaxMag() const;
size_t GetAreaAreaIndexMaxMag() const;
@@ -338,11 +338,11 @@
void SetAreaNodeBitmapMaxMag(const MagnificationLevel& areaNodeBitmapMaxMag);
void SetAreaNodeBitmapLimit(uint16_t areaNodeBitmapLimit);
- void SetAreaWayMinMag(MagnificationLevel areaWayMinMag);
- void SetAreaWayIndexMaxMag(MagnificationLevel areaWayIndexMaxLevel);
+ void SetAreaWayIndexMinMag(MagnificationLevel areaWayIndexMinMag);
+ void SetAreaWayIndexMaxMag(MagnificationLevel areaWayIndexMaxMag);
- void SetAreaRouteMinMag(MagnificationLevel areaRouteMinMag);
- void SetAreaRouteIndexMaxMag(MagnificationLevel areaRouteIndexMaxLevel);
+ void SetAreaRouteIndexMinMag(MagnificationLevel areaRouteIndexMinMag);
+ void SetAreaRouteIndexMaxMag(MagnificationLevel areaRouteIndexMaxMag);
void SetWaterIndexMinMag(uint32_t waterIndexMinMag);
void SetWaterIndexMaxMag(uint32_t waterIndexMaxMag);
@@ -374,8 +374,6 @@
std::unique_ptr<Preprocessor> GetPreprocessor(const std::string& filename,
PreprocessorCallback& callback) const;
- void SetAreaWayIndexMaxLevel(const MagnificationLevel& areaWayIndexMaxLevel);
-
void SetTextIndexVariant(TextIndexVariant textIndexVariant);
TextIndexVariant GetTextIndexVariant() const;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-import/include/osmscoutimport/meson.build
^
|
@@ -7,5 +7,6 @@
importFeaturesCfg.set('OSMSCOUT_DEBUG_TILING',false, description: 'Extra debugging of water index tiling')
configure_file(output: 'ImportFeatures.h',
+ install_dir: 'include/osmscoutimport',
configuration: importFeaturesCfg)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-import/meson.build
^
|
@@ -29,4 +29,5 @@
version: libraryVersion,
install: true)
-# TODO: Generate PKG_CONFIG file
+pkg = import('pkgconfig')
+pkg.generate(osmscoutimport)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/GenAreaRouteIndex.cpp
^
|
@@ -26,7 +26,7 @@
AreaRouteIndexGenerator::AreaRouteIndexGenerator():
AreaIndexGenerator<Route>("route",
- "rotues",
+ "routes",
RouteDataFile::ROUTE_DAT,
AreaRouteIndex::AREA_ROUTE_IDX)
{}
@@ -58,8 +58,8 @@
parameter,
progress,
typeConfig->GetRouteTypes(),
- parameter.GetAreaRouteMinMag(),
- parameter.GetAreaRouteIndexMaxLevel(),
+ parameter.GetAreaRouteIndexMinMag(),
+ parameter.GetAreaRouteIndexMaxMag(),
parameter.GetWayDataMemoryMaped());
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/GenAreaWayIndex.cpp
^
|
@@ -61,8 +61,8 @@
parameter,
progress,
typeConfig->GetWayTypes(),
- parameter.GetAreaWayMinMag(),
- parameter.GetAreaWayIndexMaxLevel(),
+ parameter.GetAreaWayIndexMinMag(),
+ parameter.GetAreaWayIndexMaxMag(),
parameter.GetWayDataMemoryMaped());
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/GenRelAreaDat.cpp
^
|
@@ -142,8 +142,7 @@
if (sub->relationRole!=MultipolygonPart::none){
MultipolygonPart::RelationRole expectedRole = id % 2 == 0 ? MultipolygonPart::inner : MultipolygonPart::outer;
if (sub->relationRole != expectedRole) {
- progress.Error("Ring " + std::to_string(sub->id) + " has invalid role, continue");
- continue;
+ progress.Warning("Ring " + std::to_string(sub->id) + " has invalid role " + sub->GetRelationRoleStr() + ", expecting " + MultipolygonPart::GetRelationRoleStr(expectedRole));
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/Import.cpp
^
|
@@ -128,8 +128,13 @@
bool Importer::ValidateParameter(Progress& progress)
{
- if (parameter.GetAreaWayMinMag()<=parameter.GetOptimizationMaxMag()) {
- progress.Error("Area way index minimum magnification is <= than optimization max magnification");
+ if (parameter.GetAreaWayIndexMinMag() > parameter.GetAreaWayIndexMaxMag()) {
+ progress.Error("Area way index minimum magnification is > than area way index max magnification");
+ return false;
+ }
+
+ if (parameter.GetAreaRouteIndexMinMag() > parameter.GetAreaRouteIndexMaxMag()) {
+ progress.Error("Area route index minimum magnification is > than area route index max magnification");
return false;
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-import/src/osmscoutimport/ImportParameter.cpp
^
|
@@ -85,10 +85,10 @@
areaNodeTileListCoordLimit(1000),
areaNodeBitmapMaxMag(20),
areaNodeBitmapLimit(20),
- areaWayMinMag(11), // Should not be >= than optimizationMaxMag
- areaWayIndexMaxLevel(13),
- areaRouteMinMag(11),
- areaRouteIndexMaxLevel(13),
+ areaWayIndexMinMag(10), // Should not be >= than areaWayIndexMaxMag
+ areaWayIndexMaxMag(15),
+ areaRouteIndexMinMag(10),
+ areaRouteIndexMaxMag(15),
waterIndexMinMag(6),
waterIndexMaxMag(14),
optimizationMaxWayCount(1000000),
@@ -294,24 +294,24 @@
return areaNodeBitmapLimit;
}
-MagnificationLevel ImportParameter::GetAreaWayMinMag() const
+MagnificationLevel ImportParameter::GetAreaWayIndexMinMag() const
{
- return areaWayMinMag;
+ return areaWayIndexMinMag;
}
-MagnificationLevel ImportParameter::GetAreaWayIndexMaxLevel() const
+MagnificationLevel ImportParameter::GetAreaWayIndexMaxMag() const
{
- return areaWayIndexMaxLevel;
+ return areaWayIndexMaxMag;
}
-MagnificationLevel ImportParameter::GetAreaRouteMinMag() const
+MagnificationLevel ImportParameter::GetAreaRouteIndexMinMag() const
{
- return areaRouteMinMag;
+ return areaRouteIndexMinMag;
}
-MagnificationLevel ImportParameter::GetAreaRouteIndexMaxLevel() const
+MagnificationLevel ImportParameter::GetAreaRouteIndexMaxMag() const
{
- return areaRouteIndexMaxLevel;
+ return areaRouteIndexMaxMag;
}
size_t ImportParameter::GetAreaAreaIndexMaxMag() const
@@ -586,11 +586,6 @@
this->areaNodeBitmapLimit=areaNodeBitmapLimit;
}
-void ImportParameter::SetAreaWayIndexMaxLevel(const MagnificationLevel& areaWayIndexMaxLevel)
-{
- this->areaWayIndexMaxLevel=areaWayIndexMaxLevel;
-}
-
void ImportParameter::SetTextIndexVariant(TextIndexVariant textIndexVariant)
{
this->textIndexVariant=textIndexVariant;
@@ -601,24 +596,24 @@
return textIndexVariant;
}
-void ImportParameter::SetAreaWayMinMag(MagnificationLevel areaWayMinMag)
+void ImportParameter::SetAreaWayIndexMinMag(MagnificationLevel areaWayMinMag)
{
- this->areaWayMinMag=areaWayMinMag;
+ this->areaWayIndexMinMag=areaWayMinMag;
}
-void ImportParameter::SetAreaWayIndexMaxMag(MagnificationLevel areaWayIndexMaxLevel)
+void ImportParameter::SetAreaWayIndexMaxMag( MagnificationLevel areaWayIndexMaxMag)
{
- this->areaWayIndexMaxLevel=areaWayIndexMaxLevel;
+ this->areaWayIndexMaxMag=areaWayIndexMaxMag;
}
-void ImportParameter::SetAreaRouteMinMag(MagnificationLevel areaRouteMinMag)
+void ImportParameter::SetAreaRouteIndexMinMag(MagnificationLevel areaRouteIndexMinMag)
{
- this->areaRouteMinMag=areaRouteMinMag;
+ this->areaRouteIndexMinMag=areaRouteIndexMinMag;
}
-void ImportParameter::SetAreaRouteIndexMaxMag(MagnificationLevel areaRouteIndexMaxLevel)
+void ImportParameter::SetAreaRouteIndexMaxMag(MagnificationLevel areaRouteIndexMaxMag)
{
- this->areaRouteIndexMaxLevel=areaRouteIndexMaxLevel;
+ this->areaRouteIndexMaxMag=areaRouteIndexMaxMag;
}
void ImportParameter::SetWaterIndexMinMag(uint32_t waterIndexMinMag)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-agg/CMakeLists.txt
^
|
@@ -15,11 +15,11 @@
SOURCE ${SOURCE_FILES}
HEADER ${HEADER_FILES}
INCLUDEDIR "osmscoutmapagg"
- INCLUDES ${LIBAGG_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIR_freetype2} ${FREETYPE_INCLUDE_DIR_ft2build}
+ INCLUDES ${LIBAGG_INCLUDE_DIRS}
TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/include/osmscoutmapagg/MapAggFeatures.h.cmake
- TARGET OSMScout::OSMScout OSMScout::Map ${LIBAGG_LIBRARIES} ${LIBAGGFT2_LIBRARIES} ${FREETYPE_LIBRARIES}
+ TARGET OSMScout::OSMScout OSMScout::Map ${LIBAGG_LIBRARIES} ${LIBAGGFT2_LIBRARIES} Freetype::Freetype
)
-target_include_directories(OSMScoutMapAGG INTERFACE ${LIBAGG_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIR_freetype2} ${FREETYPE_INCLUDE_DIR_ft2build})
+target_include_directories(OSMScoutMapAGG INTERFACE ${LIBAGG_INCLUDE_DIRS})
if(APPLE AND OSMSCOUT_BUILD_FRAMEWORKS)
set_target_properties(OSMScoutMapAGG PROPERTIES
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-agg/include/osmscoutmapagg/meson.build
^
|
@@ -1,5 +1,6 @@
mapaggFeaturesCfg = configuration_data()
configure_file(output: 'MapAggFeatures.h',
+ install_dir: 'include/osmscoutmapagg',
configuration: mapaggFeaturesCfg)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-agg/meson.build
^
|
@@ -32,4 +32,5 @@
version: libraryVersion,
install: true)
-# TODO: Generate PKG_CONFIG file
+pkg = import('pkgconfig')
+pkg.generate(osmscoutmapagg)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-cairo/CMakeLists.txt
^
|
@@ -18,9 +18,9 @@
SOURCE ${SOURCE_FILES}
HEADER ${HEADER_FILES}
INCLUDEDIR osmscoutmapcairo
- INCLUDES ${CAIRO_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS}
+ INCLUDES ${CAIRO_INCLUDE_DIRS}
TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/include/osmscoutmapcairo/MapCairoFeatures.h.cmake
- TARGET OSMScout::OSMScout OSMScout::Map ${CAIRO_LIBRARIES} ${PNG_LIBRARIES}
+ TARGET OSMScout::OSMScout OSMScout::Map ${CAIRO_LIBRARIES} PNG::PNG
)
target_include_directories(OSMScoutMapCairo INTERFACE ${CAIRO_INCLUDE_DIRS})
@@ -29,10 +29,8 @@
target_link_libraries(OSMScoutMapCairo ${PANGO_LIBRARIES})
target_include_directories(OSMScoutMapCairo INTERFACE ${PANGO_INCLUDE_DIRS})
- if(HARFBUZZ_FOUND)
- target_include_directories(OSMScoutMapCairo PUBLIC ${HARFBUZZ_INCLUDE_DIRS})
- target_link_libraries(OSMScoutMapCairo ${HARFBUZZ_LIBRARIES})
- target_include_directories(OSMScoutMapCairo INTERFACE ${HARFBUZZ_INCLUDE_DIRS})
+ if(TARGET harfbuzz::harfbuzz)
+ target_link_libraries(OSMScoutMapCairo harfbuzz::harfbuzz)
endif()
endif()
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-cairo/include/osmscoutmapcairo/meson.build
^
|
@@ -3,5 +3,6 @@
mapcairoFeaturesCfg.set('OSMSCOUT_MAP_CAIRO_HAVE_LIB_PANGO',pangoDep.found() and pangocairoDep.found(), description: 'text drawing using pango is supported')
configure_file(output: 'MapCairoFeatures.h',
+ install_dir: 'include/osmscoutmapcairo',
configuration: mapcairoFeaturesCfg)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-cairo/meson.build
^
|
@@ -23,4 +23,5 @@
version: libraryVersion,
install: true)
-# TODO: Generate PKG_CONFIG file
+pkg = import('pkgconfig')
+pkg.generate(osmscoutmapcairo)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-directx/include/osmscoutmapdirectx/meson.build
^
|
@@ -1,5 +1,6 @@
mapdirectxFeaturesCfg = configuration_data()
configure_file(output: 'MapDirectXFeatures.h',
+ install_dir: 'include/osmscoutmapdirectx',
configuration: mapdirectxFeaturesCfg)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-directx/meson.build
^
|
@@ -22,4 +22,5 @@
version: libraryVersion,
install: true)
-# TODO: Generate PKG_CONFIG file
+pkg = import('pkgconfig')
+pkg.generate(osmscoutmapdirectx)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-gdi/meson.build
^
|
@@ -22,4 +22,5 @@
version: libraryVersion,
install: true)
-# TODO: Generate PKG_CONFIG file
+pkg = import('pkgconfig')
+pkg.generate(osmscoutmapgdi)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-gdi/src/osmscoutmapgdi/MapPainterGDIWindow.cpp
^
|
@@ -23,8 +23,12 @@
#ifndef UNICODE
#define UNICODE
#endif
+#if !defined(NOMINMAX)
#define NOMINMAX // msvc issue with std::max/min
+#endif
+#if !defined(WIN32_LEAN_AND_MEAN)
#define WIN32_LEAN_AND_MEAN
+#endif
#include <windows.h>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-iosx/meson.build
^
|
@@ -16,4 +16,5 @@
version: libraryVersion,
install: true)
-# TODO: Generate PKG_CONFIG file
+pkg = import('pkgconfig')
+pkg.generate(osmscoutmapiosx)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-iosx/src/osmscout/MapPainterIOS.mm
^
|
@@ -445,7 +445,7 @@
int lineNumber = 0;
for (CTRunRef run : layout.run) {
const CTFontRef font = (CTFontRef)CFDictionaryGetValue(CTRunGetAttributes(run), kCTFontAttributeName);
- CFIndex glyphCount = CTRunGetGlyphCount(run);
+ const CFIndex glyphCount = CTRunGetGlyphCount(run);
CGGlyph glyphs[glyphCount];
CGPoint glyphPositions[glyphCount];
CGSize glyphAdvances[glyphCount];
@@ -627,11 +627,9 @@
const MapParameter& /* parameter */,
const Symbol& symbol,
const ContourSymbolData& data){
- CGContextRef drawCG = cg;
SymbolRendererIOS renderer(cg);
ScreenBox boundingBox=symbol.GetBoundingBox(projection);
double width=boundingBox.GetWidth();
- double height=boundingBox.GetHeight();
bool isClosed = false;
CGAffineTransform transform=CGAffineTransformMake(1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
Vertex2D origin;
@@ -642,7 +640,7 @@
if(!isClosed && !followPath(followPathHnd, data.symbolOffset, origin)){
return;
}
-
+
bool loop = true;
while (loop){
x1 = origin.GetX();
@@ -712,7 +710,7 @@
const Symbol& symbol,
const Vertex2D& screenPos,
double scaleFactor) {
-
+
SymbolRendererIOS renderer(cg);
renderer.Render(projection,
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-opengl/CMakeLists.txt
^
|
@@ -68,11 +68,9 @@
SOURCE ${SOURCE_FILES}
HEADER ${HEADER_FILES}
INCLUDEDIR osmscoutmapopengl
- INCLUDES ${OPENGL_INCLUDE_DIR} ${GLEW_INCLUDE_DIRS} ${GLM_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIRS}
TEMPLATE ${CMAKE_CURRENT_SOURCE_DIR}/include/osmscoutmapopengl/MapOpenGLFeatures.h.cmake
- TARGET OSMScout::OSMScout OSMScout::Map ${OPENGL_LIBRARIES} GLEW::GLEW ${PNG_LIBRARIES} ${FREETYPE_LIBRARIES}
+ TARGET OSMScout::OSMScout OSMScout::Map OpenGL::GL glm GLEW::GLEW PNG::PNG Freetype::Freetype
)
-target_include_directories(OSMScoutMapOpenGL INTERFACE ${OPENGL_INCLUDE_DIR} ${GLEW_INCLUDE_DIRS} ${GLM_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS} ${FREETYPE_INCLUDE_DIRS})
if(APPLE AND OSMSCOUT_BUILD_FRAMEWORKS)
set_target_properties(OSMScoutMapOpenGL PROPERTIES
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-opengl/include/osmscoutmapopengl/meson.build
^
|
@@ -4,5 +4,6 @@
mapopenglFeaturesCfg.set('DEFAULT_FONT_FILE','"LiberationSans-Regular.ttf"', description: 'OpenGL default font path')
configure_file(output: 'MapOpenGLFeatures.h',
+ install_dir: 'include/osmscoutmapopengl',
configuration: mapopenglFeaturesCfg)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-opengl/meson.build
^
|
@@ -22,4 +22,5 @@
version: libraryVersion,
install: true)
-# TODO: Generate PKG_CONFIG file
+pkg = import('pkgconfig')
+pkg.generate(osmscoutmapopengl)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-opengl/src/osmscoutmapopengl/MapPainterOpenGL.cpp
^
|
@@ -415,7 +415,6 @@
double yMin = std::min(minPixel.GetY(), maxPixel.GetY()) - pixelOffset;
double yMax = std::max(minPixel.GetY(), maxPixel.GetY()) + pixelOffset;
- osmscout::GeoBox gb(projection.GetDimensions());
double areaMinDimension = projection.ConvertWidthToPixel(parameter.GetAreaMinDimensionMM());
if (xMax - xMin <= areaMinDimension &&
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-qt/include/osmscoutmapqt/meson.build
^
|
@@ -1,5 +1,6 @@
mapqtFeaturesCfg = configuration_data()
configure_file(output: 'MapQtFeatures.h',
+ install_dir: 'include/osmscoutmapqt',
configuration: mapqtFeaturesCfg)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-qt/meson.build
^
|
@@ -22,4 +22,5 @@
version: libraryVersion,
install: true)
-# TODO: Generate PKG_CONFIG file
+pkg = import('pkgconfig')
+pkg.generate(osmscoutmapqt)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-svg/CMakeLists.txt
^
|
@@ -33,8 +33,7 @@
target_include_directories(OSMScoutMapSVG PUBLIC ${PANGOFT2_INCLUDE_DIRS})
target_link_libraries(OSMScoutMapSVG ${PANGOFT2_LIBRARIES})
- if(HARFBUZZ_FOUND)
- target_include_directories(OSMScoutMapSVG PUBLIC ${HARFBUZZ_INCLUDE_DIRS})
- target_link_libraries(OSMScoutMapSVG ${HARFBUZZ_LIBRARIES})
+ if(TARGET harfbuzz::harfbuzz)
+ target_link_libraries(OSMScoutMapSVG harfbuzz::harfbuzz)
endif()
endif()
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-svg/include/osmscoutmapsvg/meson.build
^
|
@@ -1,5 +1,6 @@
mapsvgFeaturesCfg = configuration_data()
configure_file(output: 'MapSVGFeatures.h',
+ install_dir: 'include/osmscoutmapsvg',
configuration: mapsvgFeaturesCfg)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map-svg/meson.build
^
|
@@ -22,4 +22,5 @@
version: libraryVersion,
install: true)
-# TODO: Generate PKG_CONFIG file
+pkg = import('pkgconfig')
+pkg.generate(osmscoutmapsvg)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map/CMakeLists.txt
^
|
@@ -13,6 +13,7 @@
include/osmscoutmap/LabelProvider.h
include/osmscoutmap/LabelPath.h
include/osmscoutmap/Styles.h
+ include/osmscoutmap/StyleError.h
include/osmscoutmap/StyleDescription.h
include/osmscoutmap/StyleConfig.h
include/osmscoutmap/StyleProcessor.h
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map/include/meson.build
^
|
@@ -11,6 +11,7 @@
'osmscoutmap/MapParameter.h',
'osmscoutmap/LabelProvider.h',
'osmscoutmap/LabelPath.h',
+ 'osmscoutmap/StyleError.h',
'osmscoutmap/Styles.h',
'osmscoutmap/StyleDescription.h',
'osmscoutmap/StyleConfig.h',
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map/include/osmscoutmap/StyleConfig.h
^
|
@@ -47,6 +47,7 @@
#include <osmscoutmap/LabelProvider.h>
#include <osmscoutmap/StyleDescription.h>
#include <osmscoutmap/Styles.h>
+#include <osmscoutmap/StyleError.h>
namespace osmscout {
@@ -634,8 +635,8 @@
private:
std::unordered_map<std::string,bool> flags;
std::unordered_map<std::string,StyleConstantRef> constants;
- std::list<std::string> errors;
- std::list<std::string> warnings;
+ std::list<StyleError> errors;
+ std::list<StyleError> warnings;
private:
void Reset();
@@ -844,12 +845,14 @@
bool LoadContent(const std::string& filename,
const std::string& content,
ColorPostprocessor colorPostprocessor=nullptr,
- bool submodule=false);
+ bool submodule=false,
+ Log &log=osmscout::log);
bool Load(const std::string& styleFile,
ColorPostprocessor colorPostprocessor=nullptr,
- bool submodule=false);
- const std::list<std::string>& GetErrors() const;
- const std::list<std::string>& GetWarnings() const;
+ bool submodule=false,
+ Log &log=osmscout::log);
+ const std::list<StyleError>& GetErrors() const;
+ const std::list<StyleError>& GetWarnings() const;
//@}
};
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map/include/osmscoutmap/StyleError.h
^
|
@@ -0,0 +1,107 @@
+#ifndef OSMSCOUT_STYLEERROR_H
+#define OSMSCOUT_STYLEERROR_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2023 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+*/
+
+#include <osmscoutmap/MapImportExport.h>
+
+#include <string>
+
+namespace osmscout {
+
+ /**
+ * \ingroup Stylesheet
+ */
+ class OSMSCOUT_MAP_API StyleError
+ {
+ public:
+ enum StyleErrorType {
+ Symbol, Error, Warning, Exception
+ };
+
+ public:
+ StyleError(StyleErrorType type, int line, int column, const std::string &text) :
+ type(type), line(line), column(column), text(text){}
+
+ StyleError(const StyleError&) = default;
+ StyleError(StyleError&&) = default;
+
+ StyleError& operator=(const StyleError&) = default;
+ StyleError& operator=(StyleError&&) = default;
+
+ ~StyleError() = default;
+
+ StyleErrorType GetType() const
+ {
+ return type;
+ }
+
+ std::string GetTypeName() const
+ {
+ switch(type){
+ case Symbol:
+ return "Symbol";
+ case Error:
+ return "Error";
+ case Warning:
+ return "Warning";
+ case Exception:
+ return "Exception";
+ default:
+ assert(false);
+ return "???";
+ }
+ }
+
+ int GetLine() const
+ {
+ return line;
+ }
+
+ int GetColumn() const
+ {
+ return column;
+ }
+
+ const std::string &GetText() const
+ {
+ return text;
+ }
+
+ std::string GetShortDescription() const
+ {
+ return GetTypeName() + ": " + GetText();
+ }
+
+ std::string GetDescription() const
+ {
+ return std::to_string(GetLine()) + "," + std::to_string(GetColumn()) + " " + GetShortDescription();
+ }
+
+ private:
+ StyleErrorType type;
+ int line;
+ int column;
+ std::string text;
+ };
+
+}
+
+#endif //OSMSCOUT_STYLEERROR_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map/include/osmscoutmap/meson.build
^
|
@@ -3,5 +3,6 @@
mapFeaturesCfg.set('OSMSCOUT_DEBUG_GROUNDTILES',false, description: 'Extra debugging of ground tiles rendering')
configure_file(output: 'MapFeatures.h',
+ install_dir: 'include/osmscoutmap',
configuration: mapFeaturesCfg)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map/include/osmscoutmap/oss/Parser.h
^
|
@@ -32,7 +32,7 @@
#include <osmscout/io/File.h>
#include <osmscout/util/String.h>
#include <osmscout/util/Transformation.h>
-
+#include <osmscout/log/Logger.h>
#include <osmscoutmap/oss/Scanner.h>
@@ -68,10 +68,11 @@
public:
std::list<Err> errors;
- bool hasErrors;
+ bool hasErrors=false;
+ Log log;
public:
- Errors();
+ explicit Errors(const Log &log);
void SynErr(int line, int col, int n);
void Error(int line, int col, const char *s);
void Warning(int line, int col, const char *s);
@@ -198,7 +199,7 @@
if (!filter.FiltersByType() ||
filter.HasType(type)) {
// Add type only if the filter either has no types or
- // if the the type is already filtered
+ // if the type is already filtered
resultTypes.Set(type);
}
}
@@ -217,7 +218,8 @@
Parser(Scanner *scanner,
const std::string& filename,
StyleConfig& config,
- osmscout::ColorPostprocessor colorPostprocessor=nullptr);
+ osmscout::ColorPostprocessor colorPostprocessor=nullptr,
+ const Log &log=osmscout::log);
~Parser();
void SemErr(const char* msg);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map/meson.build
^
|
@@ -22,4 +22,5 @@
version: libraryVersion,
install: true)
-# TODO: Generate PKG_CONFIG file
+pkg = import('pkgconfig')
+pkg.generate(osmscoutmap)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map/src/osmscoutmap/StyleConfig.cpp
^
|
@@ -1603,14 +1603,16 @@
bool StyleConfig::LoadContent(const std::string& filename,
const std::string& content,
ColorPostprocessor colorPostprocessor,
- bool submodule)
+ bool submodule,
+ Log &log)
{
oss::Scanner *scanner=new oss::Scanner((const unsigned char *)content.c_str(),
content.length());
oss::Parser *parser=new oss::Parser(scanner,
filename,
*this,
- colorPostprocessor);
+ colorPostprocessor,
+ log);
parser->Parse();
bool success=!parser->errors->hasErrors;
@@ -1621,16 +1623,16 @@
for (const auto& err : parser->errors->errors) {
switch(err.type) {
case oss::Errors::Err::Symbol:
- errors.push_back(std::to_string(err.line)+","+std::to_string(err.column)+std::string(" Symbol:")+err.text);
+ errors.push_back(StyleError(StyleError::Symbol, err.line, err.column, err.text));
break;
case oss::Errors::Err::Error:
- errors.push_back(std::to_string(err.line)+","+std::to_string(err.column)+std::string(" Error:")+err.text);
+ errors.push_back(StyleError(StyleError::Error, err.line, err.column, err.text));
break;
case oss::Errors::Err::Warning:
- warnings.push_back(std::to_string(err.line)+","+std::to_string(err.column)+std::string(" Warning:")+err.text);
+ warnings.push_back(StyleError(StyleError::Warning, err.line, err.column, err.text));
break;
case oss::Errors::Err::Exception:
- errors.push_back(std::to_string(err.line)+","+std::to_string(err.column)+std::string(" Exception:")+err.text);
+ errors.push_back(StyleError(StyleError::Exception, err.line, err.column, err.text));
break;
default:
break;
@@ -1659,7 +1661,8 @@
*/
bool StyleConfig::Load(const std::string& styleFile,
ColorPostprocessor colorPostprocessor,
- bool submodule)
+ bool submodule,
+ Log &log)
{
StopClock timer;
bool success=false;
@@ -1698,7 +1701,8 @@
success=LoadContent(styleFile,
std::string((const char *)content,fileSize),
colorPostprocessor,
- submodule);
+ submodule,
+ log);
delete [] content;
@@ -1713,12 +1717,12 @@
return success;
}
- const std::list<std::string>& StyleConfig::GetErrors() const
+ const std::list<StyleError>& StyleConfig::GetErrors() const
{
return errors;
}
- const std::list<std::string>& StyleConfig::GetWarnings() const
+ const std::list<StyleError>& StyleConfig::GetWarnings() const
{
return warnings;
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-map/src/osmscoutmap/oss/Parser.cpp
^
|
@@ -2455,7 +2455,8 @@
Parser::Parser(Scanner *scanner,
const std::string& filename,
StyleConfig& config,
- osmscout::ColorPostprocessor colorPostprocessor)
+ osmscout::ColorPostprocessor colorPostprocessor,
+ const Log &log)
: filename(filename),
config(config)
{
@@ -2466,7 +2467,7 @@
minErrDist = 2;
errDist = minErrDist;
this->scanner = scanner;
- errors = new Errors();
+ errors = new Errors(log);
this->colorPostprocessor=colorPostprocessor;
}
@@ -2505,8 +2506,8 @@
}
}
-Errors::Errors()
- : hasErrors(false)
+Errors::Errors(const Log &log)
+ : log(log)
{
// no code
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-test/include/osmscout-test/meson.build
^
|
@@ -2,5 +2,6 @@
testFeaturesCfg.set('OSMSCOUT_TEST_MESON_BUILD',true, description: 'we are building using meson')
configure_file(output: 'TestFeatures.h',
+ install_dir: 'include/osmscout-test',
configuration: testFeaturesCfg)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout-test/meson.build
^
|
@@ -22,4 +22,5 @@
version: libraryVersion,
install: true)
-# TODO: Generate PKG_CONFIG file
+pkg = import('pkgconfig')
+pkg.generate(osmscouttest)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/CMakeLists.txt
^
|
@@ -13,7 +13,6 @@
include/osmscout/Point.h
include/osmscout/PublicTransport.h
include/osmscout/Route.h
- include/osmscout/elevation/SRTM.h
include/osmscout/Tag.h
include/osmscout/TypeConfig.h
include/osmscout/TypeFeature.h
@@ -38,6 +37,7 @@
include/osmscout/async/Breaker.h
include/osmscout/async/CancelableFuture.h
include/osmscout/async/ProcessingQueue.h
+ include/osmscout/async/Signal.h
include/osmscout/async/Thread.h
include/osmscout/async/Worker.h
include/osmscout/async/WorkQueue.h)
@@ -142,7 +142,7 @@
set(HEADER_FILES_ELEVATION
include/osmscout/elevation/ElevationService.h
- src/osmscout/elevation/SRTM.cpp)
+ include/osmscout/elevation/SRTM.h)
set(HEADER_FILES_ROUTING
include/osmscout/routing/RouteData.h
@@ -339,6 +339,7 @@
src/osmscout/location/LocationService.cpp
src/osmscout/location/LocationDescriptionService.cpp
src/osmscout/poi/POIService.cpp
+ src/osmscout/elevation/SRTM.cpp
src/osmscout/Area.cpp
src/osmscout/GeoCoord.cpp
src/osmscout/GroundTile.cpp
@@ -402,9 +403,8 @@
target_link_libraries(OSMScout ${MARISA_LIBRARIES})
endif()
-if (ICONV_FOUND)
- target_include_directories(OSMScout PRIVATE ${ICONV_INCLUDE_DIRS})
- target_link_libraries(OSMScout ${ICONV_LIBRARIES})
+if (TARGET Iconv::Iconv)
+ target_link_libraries(OSMScout Iconv::Iconv)
endif()
if(CMAKE_THREAD_LIBS_INIT)
@@ -462,3 +462,5 @@
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/osmscout DESTINATION include FILES_MATCHING PATTERN "*.h" PATTERN "private/Config.h" EXCLUDE)
endif()
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/include/osmscout/lib/CoreFeatures.h DESTINATION include/osmscout/lib)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/include/meson.build
^
|
@@ -9,6 +9,7 @@
'osmscout/async/Breaker.h',
'osmscout/async/CancelableFuture.h',
'osmscout/async/ProcessingQueue.h',
+ 'osmscout/async/Signal.h',
'osmscout/async/Thread.h',
'osmscout/async/Worker.h',
'osmscout/async/WorkQueue.h',
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/async/Signal.h
^
|
@@ -0,0 +1,221 @@
+#ifndef LIBOSMSCOUT_SIGNAL_H
+#define LIBOSMSCOUT_SIGNAL_H
+
+/*
+ This source is part of the libosmscout library
+ Copyright (C) 2023 Lukas Karas
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <osmscout/lib/CoreImportExport.h>
+
+#include <functional>
+#include <mutex>
+#include <set>
+#include <memory>
+#include <vector>
+
+namespace osmscout {
+
+ template<typename... Args>
+ class Slot;
+
+ /** Signal and Slot is tool for connecting source of events and its consumers.
+ * It is similar to Qt's signal, but it lacks some advanced functionality,
+ * like asynchronous connection. Slot callback is called in thread context of the signal.
+ * Locking or asynchronicity have to be solved differently.
+ *
+ * Signal and Slot are thread safe. Their live cycle may be independent.
+ *
+ * @tparam Args
+ */
+ template<typename... Args>
+ class Signal
+ {
+ private:
+ struct Connection
+ {
+ // Note: when just signal or slot is locked, always lock connection when accessing it
+ mutable std::mutex mutex;
+ Slot<Args...>* slot = nullptr;
+ Signal<Args...>* signal = nullptr;
+ };
+
+ private:
+ // Note: when signal and slot mutexes are locked at the same time, always lock signal's one first
+ mutable std::mutex mutex;
+ std::vector<std::shared_ptr<Connection>> connections;
+
+ public:
+ friend class Slot<Args...>;
+
+ Signal() = default;
+ Signal(const Signal&) = delete;
+ Signal(Signal&&) = delete;
+
+ Signal& operator=(const Signal&) = delete;
+ Signal& operator=(Signal&&) = delete;
+
+ virtual ~Signal();
+
+ /** Emit signal.
+ * All connected slots are called.
+ * @param args
+ */
+ void Emit(const Args&... args) const;
+
+ /** Connect Signal to given Slot
+ * @param slot
+ */
+ void Connect(Slot<Args...> &slot);
+
+ /** Disconnect from specific slot.
+ * When there is no connection with given slot, Method is no-op.
+ * @param slot
+ */
+ void Disconnect(Slot<Args...> &slot);
+
+ /** Disconnect from all slots
+ */
+ void Disconnect();
+ };
+
+ template<typename... Args>
+ class Slot
+ {
+ private:
+ // Note: when signal and slot mutexes are locked at the same time, always lock signal's one first
+ mutable std::mutex mutex;
+ const std::function<void(const Args&...)> callback;
+ std::vector<std::shared_ptr<typename Signal<Args...>::Connection>> connections;
+
+ public:
+ friend class Signal<Args...>;
+
+ /** Construct slot with callback function.
+ * @param callback
+ */
+ explicit Slot(const std::function<void(const Args&...)> &callback);
+
+ Slot(const Slot&) = delete;
+ Slot(Slot&&) = delete;
+
+ Slot& operator=(const Slot&) = delete;
+ Slot& operator=(Slot&&) = delete;
+
+ virtual ~Slot();
+
+ /** Disconnect from all signals
+ */
+ void Disconnect();
+
+ private:
+ /** Call the callback. Lock of specific connection have to be hold,
+ * to be sure that Slot is not destructed before returning from the call.
+ * @param args
+ */
+ void Call(const Args&... args) const;
+ };
+
+ template<typename... Args>
+ Slot<Args...>::Slot(const std::function<void(const Args&...)> &callback):
+ callback(callback)
+ {}
+
+ template<typename... Args>
+ void Slot<Args...>::Call(const Args&... args) const
+ {
+ callback(args...);
+ }
+
+ template<typename... Args>
+ void Signal<Args...>::Emit(const Args&... args) const
+ {
+ std::unique_lock lock(mutex);
+ for (const auto &con: connections) {
+ std::unique_lock lockCon(con->mutex);
+ if (auto slot = con->slot; slot != nullptr) {
+ slot->Call(args...);
+ }
+ }
+ }
+
+ template<typename... Args>
+ void Signal<Args...>::Connect(Slot<Args...> &slot)
+ {
+ std::unique_lock lock(mutex);
+ std::unique_lock slotLock(slot.mutex);
+
+ auto con=std::make_shared<Connection>();
+ con->slot = &slot;
+ con->signal = this;
+ connections.push_back(con);
+ slot.connections.push_back(con);
+ }
+
+ template<typename... Args>
+ void Signal<Args...>::Disconnect(Slot<Args...> &slot)
+ {
+ std::unique_lock lock(mutex);
+ std::unique_lock slotLock(slot.mutex);
+
+ if (auto it = connections.find([&slot](auto const &con) -> bool { return con && con->slot == &slot; });
+ it != connections.end()) {
+ connections.erase(it);
+ }
+ if (auto it = slot.connections.find([this](auto const &con) -> bool { return con && con->signal == this; });
+ it != slot.connections.end()) {
+ slot.connections.erase(it);
+ }
+ }
+
+ template<typename... Args>
+ void Signal<Args...>::Disconnect()
+ {
+ std::unique_lock lock(mutex);
+ for (auto &con: connections) {
+ std::unique_lock lockCon(con->mutex);
+ con->signal = nullptr;
+ con->slot = nullptr;
+ }
+ connections.clear();
+ }
+
+ template<typename... Args>
+ void Slot<Args...>::Disconnect()
+ {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/async/Thread.h
^
|
@@ -22,6 +22,8 @@
#include <osmscout/lib/CoreImportExport.h>
+#include <osmscout/async/Signal.h>
+
#include <string>
#include <thread>
@@ -41,6 +43,13 @@
* @return true if supported and successful, else otherwise
*/
extern OSMSCOUT_API bool SetThreadName(std::thread &thread, const std::string &name);
+
+ /** Signal that is emitted on thread exit.
+ * It is not guaranteed that signal will be emitted for all threads,
+ * some threads may be still running on program exit. For example detached
+ * thread, global scheduler threads, when std::exit is called...
+ */
+ extern OSMSCOUT_API Signal<std::thread::id>& ThreadExitSignal();
}
#endif //LIBOSMSCOUT_THREAD_H
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/lib/meson.build
^
|
@@ -5,5 +5,6 @@
coreFeaturesCfg.set('OSMSCOUT_DEBUG_ROUTING',false, description: 'Extra debugging of routing')
configure_file(output: 'CoreFeatures.h',
+ install_dir: 'include/osmscout/lib',
configuration: coreFeaturesCfg)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/log/Logger.h
^
|
@@ -351,18 +351,24 @@
class OSMSCOUT_API Log
{
private:
- Logger* logger;
- NoOpLogger noOpLogger;
- bool logDebug=false;
- bool logInfo=true;
- bool logWarn=true;
- bool logError=true;
+ std::shared_ptr<Logger> logger;
+ NoOpLogger noOpLogger;
+ bool logDebug=false;
+ bool logInfo=true;
+ bool logWarn=true;
+ bool logError=true;
public:
Log();
- ~Log();
+ Log(const Log &log) = default;
+ Log(Log &&log) = default;
- void SetLogger(Logger* logger);
+ Log& operator=(const Log &log) = default;
+ Log& operator=(Log &&log) = default;
+
+ ~Log() = default;
+
+ void SetLogger(const std::shared_ptr<Logger> &logger);
Log& Debug(bool state)
{
@@ -420,7 +426,7 @@
/**
* \ingroup Logging
- * The one an donly global instance of the logger that should get used
+ * The one and only global instance of the logger that should get used
* for all logging output.
*/
extern OSMSCOUT_API Log log;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/log/LoggerImpl.h
^
|
@@ -79,7 +79,7 @@
/**
* \ingroup Logging
* The console logger extends the StreamLogger by assigning std::cout for normal
- * loging output and std::cerr for error output.
+ * logging output and std::cerr for error output.
*/
class OSMSCOUT_API ConsoleLogger : public StreamLogger
{
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/routing/AbstractRoutingService.h
^
|
@@ -60,6 +60,7 @@
RouteData route;
Distance currentMaxDistance;
Distance overallDistance;
+ std::vector<int> sectionLengths;
public:
RoutingResult();
@@ -98,6 +99,21 @@
{
return !route.IsEmpty();
}
+
+ const std::vector<int>& GetSectionLenghts() const
+ {
+ return sectionLengths;
+ }
+
+ void AppendSectionLength(int length)
+ {
+ this->sectionLengths.push_back(length);
+ }
+
+ void ClearSectionLengths()
+ {
+ this->sectionLengths.clear();
+ }
};
struct OSMSCOUT_API RoutePoints
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/routing/RouteDescription.h
^
|
@@ -92,7 +92,9 @@
static const char* const LANES_DESC;
/** Constant for a description of suggested route lanes (SuggestedLaneDescription) */
static const char* const SUGGESTED_LANES_DESC;
-
+ /** Constant for a description of the first node of a route section */
+ static const char* const NODE_VIA_DESC;
+
public:
/**
* \ingroup Routing
@@ -659,6 +661,28 @@
/**
* \ingroup Routing
+ * Start of the route
+ */
+ class OSMSCOUT_API ViaDescription : public Description
+ {
+ private:
+ int sectionNumber;
+ int nodeCount;
+
+ public:
+ explicit ViaDescription(int sectionNumber, int nodeCount) : sectionNumber(sectionNumber), nodeCount(nodeCount) {};
+
+ std::string GetDebugString() const override;
+
+ int GetSectionNumber() const { return sectionNumber; };
+
+ int GetNodeCount() const { return nodeCount; };
+ };
+
+ using ViaDescriptionRef = std::shared_ptr<ViaDescription>;
+
+ /**
+ * \ingroup Routing
*/
class OSMSCOUT_API Node
{
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/routing/RouteDescriptionPostprocessor.h
^
|
@@ -167,6 +167,14 @@
* The POI information
*/
virtual void OnPOIAtRoute(const RouteDescription::POIAtRouteDescriptionRef& poiAtRouteDescription);
+
+ /**
+ * Called everytime we have a new section at the route when routing with some via points between start and target
+ *
+ * @param viaDescription
+ * The via information
+ */
+ virtual void OnViaAtRoute(const RouteDescription::ViaDescriptionRef& viaDescription);
/**
* Always called before we analyse a node. It may be that other callback methods are called
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/routing/RoutePostprocessor.h
^
|
@@ -377,6 +377,21 @@
private:
Distance distanceBefore;
};
+
+ /**
+ * \ingroup Routing
+ * Adds section to the route if there is one or more via node
+ */
+ class OSMSCOUT_API SectionsPostprocessor : public Postprocessor
+ {
+ private:
+ std::vector<int> sectionLengths;
+ public:
+ explicit SectionsPostprocessor(const std::vector<int>& sectionLengths) : Postprocessor(), sectionLengths(sectionLengths) {};
+
+ bool Process(const RoutePostprocessor& postprocessor,
+ RouteDescription& description) override;
+ };
using SuggestedLanesPostprocessorRef = std::shared_ptr<SuggestedLanesPostprocessor>;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/util/ScreenBox.h
^
|
@@ -123,7 +123,7 @@
* Resize the rectangle in all dimension using the given amount.
* If pixel is >=0 the resulting area will be bigger, else smaller.
*
- * It is checked that pixel>=width/2 and pixel >=height/2
+ * It is checked that offset>=width/-2 and offset>=height/-2
*
* The size delta will be 2*pixel in width and in height!
*
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/util/String.h
^
|
@@ -327,6 +327,20 @@
int maxSize=-1);
/**
+ * \ingroup Util
+ * Replace all occurrences of search in input string by some other string.
+ * When search is empty, unchanged input string is returned.
+ *
+ * @param in - input string
+ * @param search
+ * @param replacement
+ * @return
+ */
+ extern OSMSCOUT_API std::string ReplaceString(const std::string &in,
+ const std::string &search,
+ const std::string &replacement);
+
+ /**
* Split string by separator to two parts. Unlike SplitString with maxSize=2,
* second element contains the rest of the string after first separator.
* When no separator found, nullopt is returned.
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/include/osmscout/util/TileId.h
^
|
@@ -266,6 +266,13 @@
return maxTile;
}
+
+ TileId GetCenter() const
+ {
+ return {(minTile.GetX()+maxTile.GetX())/2,
+ (minTile.GetY()+maxTile.GetY())/2};
+ }
+
uint32_t GetMinX() const
{
return minTile.GetX();
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/meson.build
^
|
@@ -32,4 +32,5 @@
version: libraryVersion,
install: true)
-# TODO: Generate PKG_CONFIG file
+pkg = import('pkgconfig')
+pkg.generate(osmscout)
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/async/Thread.cpp
^
|
@@ -50,4 +50,30 @@
return false;
}
#endif
+
+namespace {
+ struct ThreadFinalizer
+ {
+ Signal<std::thread::id> threadExit;
+
+ ThreadFinalizer() = default;
+ ThreadFinalizer(const ThreadFinalizer &) = delete;
+ ThreadFinalizer(ThreadFinalizer &&) = delete;
+
+ virtual ~ThreadFinalizer()
+ {
+ threadExit.Emit(std::this_thread::get_id());
+ }
+
+ ThreadFinalizer &operator=(const ThreadFinalizer &) = delete;
+ ThreadFinalizer &operator=(ThreadFinalizer &&) = delete;
+ };
+
+ thread_local struct osmscout::ThreadFinalizer threadFinalizer{};
+}
+
+Signal<std::thread::id>& ThreadExitSignal()
+{
+ return threadFinalizer.threadExit;
+}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/elevation/SRTM.cpp
^
|
@@ -197,7 +197,7 @@
int32_t h1=GetHeight(col,row);
- log.Info() << "Height at " << coord.GetDisplayText() << " " << fracLat << "x" << fracLon << " with tile coords " << col << "," << row << " = " << h1;
+ log.Debug() << "Height at " << coord.GetDisplayText() << " " << fracLat << "x" << fracLon << " with tile coords " << col << "," << row << " = " << h1;
#ifndef SRTM_BILINEAR_INTERPOLATION
return (int32_t) floor(h1);
@@ -210,7 +210,7 @@
// bilinear interpolation
double fLat = fracLat - fracLat*row/SRTM::rows;
double fLon = fracLon - fracLon*pixelSize/SRTM::columns;
- log.Info() << "fLat=" << fLat << " fLon=" << fLon;
+ log.Debug() << "fLat=" << fLat << " fLon=" << fLon;
double h = h1*(1-fLat)*(1-fLon) + h2*fLat*(1-fLon) + h3*(1-fLat)*fLon + h4*fLat*fLon;
return (int32_t)floor(h+0.5);
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/log/Logger.cpp
^
|
@@ -96,27 +96,14 @@
return Log(ERROR);
}
- Log::Log()
- : logger(new ConsoleLogger())
- {
- Debug() << "Initializing Logging";
- }
-
- Log::~Log()
- {
- Debug() << "Deinitializing Logging";
-
- delete logger;
- }
+ Log::Log():
+ logger(std::make_shared<ConsoleLogger>())
+ {}
- void Log::SetLogger(Logger* logger)
+ void Log::SetLogger(const std::shared_ptr<Logger> &logger)
{
assert(logger!=nullptr);
- Logger* oldLogger=this->logger;
-
this->logger=logger;
-
- delete oldLogger;
}
Logger::Line Log::Debug()
@@ -134,7 +121,7 @@
return logger->Info();
}
- return noOpLogger.Debug();
+ return noOpLogger.Info();
}
Logger::Line Log::Warn()
@@ -143,7 +130,7 @@
return logger->Warn();
}
- return noOpLogger.Debug();
+ return noOpLogger.Warn();
}
Logger::Line Log::Error()
@@ -152,7 +139,7 @@
return logger->Error();
}
- return noOpLogger.Debug();
+ return noOpLogger.Error();
}
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/routing/MultiDBRoutingService.cpp
^
|
@@ -467,7 +467,8 @@
parameter);
if (!partialResult.Success()) {
result.GetRoute().Clear();
-
+ result.ClearSectionLengths();
+
return result;
}
@@ -478,6 +479,7 @@
}
result.GetRoute().Append(partialResult.GetRoute());
+ result.AppendSectionLength(partialResult.GetRoute().Entries().size());
}
return result;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/routing/RouteDescription.cpp
^
|
@@ -65,6 +65,8 @@
const char* const RouteDescription::LANES_DESC = "Lanes";
/** Constant for a description of suggested route lanes (SuggestedLaneDescription) */
const char* const RouteDescription::SUGGESTED_LANES_DESC = "SuggestedLanes";
+ /** Constant for a description of a via on the rote (first node of a route section) */
+ const char* const RouteDescription::NODE_VIA_DESC = "NodeVia";
RouteDescription::StartDescription::StartDescription(const std::string& description)
: description(description)
@@ -525,6 +527,11 @@
return ss.str();
}
+ std::string RouteDescription::ViaDescription::GetDebugString() const
+ {
+ return "Section number: "+std::to_string(sectionNumber)+" node count: "+std::to_string(nodeCount);
+ }
+
bool RouteDescription::Node::HasDescription(const char* name) const
{
std::unordered_map<std::string,DescriptionRef>::const_iterator entry;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/routing/RouteDescriptionPostprocessor.cpp
^
|
@@ -104,6 +104,11 @@
// no code
}
+ void RouteDescriptionPostprocessor::Callback::OnViaAtRoute(const RouteDescription::ViaDescriptionRef& /*viaDescription*/)
+ {
+ // no code
+ }
+
void RouteDescriptionPostprocessor::Callback::BeforeNode(const RouteDescription::Node& /*node*/)
{
// no code
@@ -163,6 +168,7 @@
osmscout::RouteDescription::MaxSpeedDescriptionRef maxSpeedDescription;
osmscout::RouteDescription::TypeNameDescriptionRef typeNameDescription;
osmscout::RouteDescription::POIAtRouteDescriptionRef poiAtRouteDescription;
+ osmscout::RouteDescription::ViaDescriptionRef viaDescription;
desc=node->GetDescription(osmscout::RouteDescription::WAY_NAME_DESC);
if (desc) {
@@ -250,6 +256,11 @@
poiAtRouteDescription=std::dynamic_pointer_cast<osmscout::RouteDescription::POIAtRouteDescription>(desc);
}
+ desc=node->GetDescription(osmscout::RouteDescription::NODE_VIA_DESC);
+ if (desc) {
+ viaDescription=std::dynamic_pointer_cast<osmscout::RouteDescription::ViaDescription>(desc);
+ }
+
callback.BeforeNode(*node);
if (startDescription) {
@@ -261,6 +272,10 @@
if (targetDescription) {
callback.OnTargetReached(targetDescription);
}
+
+ if (viaDescription) {
+ callback.OnViaAtRoute(viaDescription);
+ }
if (roundaboutEnterDescription || roundaboutLeaveDescription) {
if (roundaboutEnterDescription) {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/routing/RoutePostprocessor.cpp
^
|
@@ -2447,4 +2447,40 @@
return true;
}
+
+ bool RoutePostprocessor::SectionsPostprocessor::Process([[maybe_unused]] const RoutePostprocessor& postprocessor,
+ RouteDescription& description)
+ {
+ int nbSections = this->sectionLengths.size();
+ if (nbSections < 2) {
+ return true;
+ }
+
+ int sectionCount = 0;
+ int nodeCount = 1;
+ RouteDescription::Node *previousNode = nullptr;
+ for (auto &node : description.Nodes()) {
+ if (--nodeCount == 0) {
+
+ if (previousNode) {
+ RouteDescription::ViaDescriptionRef desc=std::make_shared<RouteDescription::ViaDescription>(sectionCount, sectionLengths[sectionCount - 1]);
+ previousNode->AddDescription(RouteDescription::NODE_VIA_DESC, desc);
+ }
+
+ previousNode = &node;
+ nodeCount = sectionLengths[sectionCount++];
+
+ if (sectionCount >= nbSections) {
+ break;
+ }
+ }
+ }
+
+ if (previousNode) {
+ RouteDescription::ViaDescriptionRef desc=std::make_shared<RouteDescription::ViaDescription>(nbSections, sectionLengths[nbSections - 1]);
+ previousNode->AddDescription(RouteDescription::NODE_VIA_DESC, desc);
+ }
+
+ return true;
+ }
}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/routing/SimpleRoutingService.cpp
^
|
@@ -425,6 +425,7 @@
parameter);
if (!partialResult.Success()) {
result.GetRoute().Clear();
+ result.ClearSectionLengths();
return result;
}
@@ -436,6 +437,7 @@
}
result.GetRoute().Append(partialResult.GetRoute());
+ result.AppendSectionLength(partialResult.GetRoute().Entries().size());
}
return result;
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/util/ScreenBox.cpp
^
|
@@ -65,9 +65,9 @@
ScreenBox ScreenBox::Resize(double offset) const
{
- // If the offset is negative its absolute value must not be > than width or height
- assert(offset>-GetWidth());
- assert(offset>-GetHeight());
+ // If the offset is negative its absolute value must not be >= than width/2 or height/2
+ assert(offset >= GetWidth()/-2);
+ assert(offset >= GetHeight()/-2);
return {Vertex2D(minCoord.GetX()-offset,
minCoord.GetY()-offset),
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/util/String.cpp
^
|
@@ -425,6 +425,32 @@
return result;
}
+ std::string ReplaceString(const std::string &in,
+ const std::string &search,
+ const std::string &replacement)
+ {
+ if (search.empty()) {
+ return in;
+ }
+
+ std::ostringstream result;
+ std::string remaining=in;
+
+ while (!remaining.empty()) {
+ std::string::size_type pos = remaining.find(search);
+ if (pos == std::string::npos) {
+ result << remaining;
+ break;
+ } else {
+ result << remaining.substr(0, pos);
+ result << replacement;
+ remaining.erase(0, pos + search.length());
+ }
+ }
+
+ return result.str();
+ }
+
std::optional<std::pair<std::string,std::string>> SplitStringToPair(const std::string& str,
const std::string& separator)
{
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/libosmscout/src/osmscout/util/SunriseSunset.cpp
^
|
@@ -50,7 +50,6 @@
const int JULIAN_DATE_2000_01_01 = 2451545;
const double CONST_0009 = 0.0009;
const double CONST_360 = 360;
- const long MILLISECONDS_IN_DAY = 60 * 60 * 24 * 1000;
/**
* Intermediate variables used in the sunrise equation
@@ -338,4 +337,4 @@
return GetSunriseSunset(location, day, SUN_ALTITUDE_SUNRISE_SUNSET);
}
-}
\ No newline at end of file
+}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/pkgconfig-template.pc.in
^
|
@@ -0,0 +1,9 @@
+prefix="@CMAKE_INSTALL_PREFIX@"
+libdir="${prefix}/lib"
+includedir="${prefix}/include"
+
+Name: @_output@
+Description: @_output@
+Version: @PROJECT_VERSION@
+Cflags: -I${includedir}
+Libs: -L${libdir} -l@_output@
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/dependencies/libosmscout/stylesheets/motorways.ost
^
|
@@ -119,7 +119,7 @@
TYPE highway_residential
= WAY AREA ("highway"=="residential")
{Name, NameAlt, Ref, Sideway}
- PATH[FOOT BICYCLE CAR] LOCATION LANES[2 1]
+ PATH[FOOT BICYCLE CAR] LOCATION LANES[2 1] PIN_WAY
TYPE highway_living_street
= WAY AREA ("highway"=="living_street")
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/graphics/cover-2.32.svg
^
|
@@ -0,0 +1,289 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ width="845"
+ height="422"
+ id="svg2054"
+ version="1.1"
+ sodipodi:docname="cover-2.17.svg"
+ inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata
+ id="metadata14">
+ <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>
+ <defs
+ id="defs12">
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect68354"
+ is_visible="true"
+ lpeversion="1" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect67275"
+ is_visible="true"
+ lpeversion="1" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect61307"
+ is_visible="true"
+ lpeversion="1" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect60161"
+ is_visible="true"
+ lpeversion="1" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect58467"
+ is_visible="true"
+ lpeversion="1" />
+ <inkscape:path-effect
+ effect="spiro"
+ id="path-effect52944"
+ is_visible="true"
+ lpeversion="1" />
+ <filter
+ inkscape:collect="always"
+ style="color-interpolation-filters:sRGB"
+ id="filter51493"
+ x="-0.2313123"
+ y="-0.37891728"
+ width="1.4626246"
+ height="1.7578346">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="3.0860482"
+ id="feGaussianBlur51495" />
+ </filter>
+ <meshgradient
+ inkscape:collect="always"
+ id="meshgradient21283"
+ gradientUnits="userSpaceOnUse"
+ x="-332.61957"
+ y="814.60327">
+ <meshrow
+ id="meshrow47633">
+ <meshpatch
+ id="meshpatch47635">
+ <stop
+ path="c 5.2076,-5.43232e-05 13.5814,1.93095 18.7891,1.93095"
+ style="stop-color:#ffffff;stop-opacity:1"
+ id="stop47637" />
+ <stop
+ path="c 0.22361,7.77765 -1.84395,8.97825 -1.84406,16.3893"
+ style="stop-color:#a17e34;stop-opacity:1"
+ id="stop47639" />
+ <stop
+ path="c -5.20756,0.000281765 -8.57128,5.84397 -13.779,5.84397"
+ style="stop-color:#a17e34;stop-opacity:1"
+ id="stop47641" />
+ <stop
+ path="c 0,-7.41092 -3.16582,-16.7528 -3.16604,-24.1642"
+ style="stop-color:#a17e34;stop-opacity:1"
+ id="stop47643" />
+ </meshpatch>
+ <meshpatch
+ id="meshpatch47645">
+ <stop
+ path="c 5.2077,0 9.81985,0.929076 15.0274,0.929122"
+ id="stop47647" />
+ <stop
+ path="c 0.000144097,7.41081 0.595604,13.893 0.595604,21.3039"
+ style="stop-color:#5b471d;stop-opacity:1"
+ id="stop47649" />
+ <stop
+ path="c -2.11035,-6.44281 -10.3606,-5.23983 -17.4671,-5.84374"
+ style="stop-color:#a17e34;stop-opacity:1"
+ id="stop47651" />
+ </meshpatch>
+ </meshrow>
+ <meshrow
+ id="meshrow47653">
+ <meshpatch
+ id="meshpatch47655">
+ <stop
+ path="c -1.68717,14.2356 1.43271,21.6624 1.84406,28.0763"
+ id="stop47657" />
+ <stop
+ path="c -5.2077,0 -10.4154,0 -15.6231,1.13687e-13"
+ style="stop-color:#a17e34;stop-opacity:1"
+ id="stop47659" />
+ <stop
+ path="c -5.68434e-14,-7.41092 -5.68434e-14,-14.8218 4e-05,-22.2324"
+ style="stop-color:#cbb55e;stop-opacity:1"
+ id="stop47661" />
+ </meshpatch>
+ <meshpatch
+ id="meshpatch47663">
+ <stop
+ path="c 0,7.41092 -4.3727,6.98682 -4.37276,14.3978"
+ id="stop47665" />
+ <stop
+ path="c -5.20757,-0.000164599 -6.04249,7.83479 -11.2502,7.83478"
+ style="stop-color:#1f180a;stop-opacity:1"
+ id="stop47667" />
+ </meshpatch>
+ </meshrow>
+ </meshgradient>
+ <filter
+ inkscape:collect="always"
+ style="color-interpolation-filters:sRGB"
+ id="filter48085"
+ x="-0.011683676"
+ y="-0.0082102014"
+ width="1.0233674"
+ height="1.0164204">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.1521128"
+ id="feGaussianBlur48087" />
+ </filter>
+ </defs>
+ <sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1920"
+ inkscape:window-height="1136"
+ id="namedview10"
+ showgrid="false"
+ inkscape:zoom="0.87407407"
+ inkscape:cx="353.51695"
+ inkscape:cy="253.98305"
+ inkscape:window-x="1920"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="svg2054"
+ inkscape:pagecheckerboard="0" />
+ <image
+ sodipodi:absref="/home/karry/SailfishOS/projects/osmscout-sailfish/graphics/cover-2.17.jpg"
+ xlink:href="cover-2.17.jpg"
+ y="0"
+ x="0"
+ id="image892"
+ style="image-rendering:optimizeSpeed"
+ preserveAspectRatio="none"
+ height="422"
+ width="845" />
+ <g
+ id="label"
+ transform="matrix(1.4841993,0,0,1.4841993,49.48781,-1166.5396)"
+ style="opacity:1">
+ <text
+ xml:space="preserve"
+ style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:50px;line-height:99%;font-family:Arial;-inkscape-font-specification:Arial;text-align:start;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none"
+ x="263.37292"
+ y="835.81036"
+ id="text4187"><tspan
+ style="fill:#411f11;fill-opacity:0.734982"
|
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/pics/cover.jpg
^
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/pkgconfig-template.pc.in
^
|
@@ -0,0 +1,9 @@
+prefix="@CMAKE_INSTALL_PREFIX@"
+libdir="${prefix}/lib"
+includedir="${prefix}/include"
+
+Name: @_output@
+Description: @_output@
+Version: @PROJECT_VERSION@
+Cflags: -I${includedir}
+Libs: -L${libdir} -l@_output@
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/qml/custom/LocationSelector.qml
^
|
@@ -44,6 +44,7 @@
property string currentLocationStr: qsTr("Current location")
property string searchStr: qsTr("Search")
property string pickStr: qsTr("Pick a place")
+ property string waypointStr: qsTr("Waypoint")
signal selectLocation(LocationEntry loc)
signal pickPlace(double lat, double lon)
@@ -93,6 +94,16 @@
value=selectLocationStr;
useCurrentLocation=false;
}
+ if (activeIndex==3){
+ location=null; // in case of search cancel
+ var wpSelectPage=pageStack.push(Qt.resolvedUrl("../pages/WaypointSelector.qml"),
+ {
+ acceptDestination: pageStack.currentPage,
+ });
+ wpSelectPage.selectWaypoint.connect(selectLocation);
+ value=selectLocationStr;
+ useCurrentLocation=false;
+ }
}
value: selectLocationStr
@@ -100,6 +111,7 @@
MenuItem { text: currentLocationStr }
MenuItem { text: searchStr }
MenuItem { text: pickStr }
+ MenuItem { text: waypointStr }
}
Connections {
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/qml/pages/MapPage.qml
^
|
@@ -1636,6 +1636,7 @@
searchFieldText: "poi:10000:natural_peak",
acceptDestination: mapPage
});
+ searchPage.selectLocation.connect(selectLocation);
}
}
}
|
[-]
[+]
|
Added |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/qml/pages/WaypointSelector.qml
^
|
@@ -0,0 +1,322 @@
+/*
+ OSM Scout for Sailfish OS
+ Copyright (C) 2023 Lukas Karas
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+import QtQuick 2.0
+import Sailfish.Silica 1.0
+import Sailfish.Pickers 1.0
+import QtPositioning 5.2
+import QtQml.Models 2.1
+
+import harbour.osmscout.map 1.0
+
+import "../custom"
+
+Page {
+ id: collectionListPage
+
+ signal selectWaypoint(LocationEntry waypoint)
+ property var acceptDestination;
+
+ RemorsePopup { id: remorse }
+
+ CollectionListModel {
+ id: collectionListModel
+ ordering: AppSettings.collectionsOrdering
+ onLoadingChanged: {
+ console.log("onLoadingChanged: " + loading);
+ }
+ onError: {
+ remorse.execute(message, function() { }, 10 * 1000);
+ }
+ }
+
+ SilicaListView {
+ id: collectionListView
+ anchors.fill: parent
+ spacing: Theme.paddingMedium
+ x: Theme.paddingMedium
+ clip: true
+
+ currentIndex: -1 // otherwise currentItem will steal focus
+
+ model: collectionListModel
+ delegate: ListItem {
+ id: collectionItem2
+
+ ListView.onAdd: AddAnimation {
+ target: collectionItem2
+ }
+ ListView.onRemove: RemoveAnimation {
+ target: collectionItem2
+ }
+
+ Image{
+ id: entryIcon
+
+ source: model.visible ?
+ (model.visibleAll ? "image://theme/icon-m-favorite-selected" : ("image://harbour-osmscout/pics/icon-m-favorite-halfselected.png?" + Theme.primaryColor)) :
+ "image://theme/icon-m-favorite"
+
+ width: Theme.iconSizeMedium
+ fillMode: Image.PreserveAspectFit
+ horizontalAlignment: Image.AlignHCenter
+ verticalAlignment: Image.AlignVCenter
+ height: width
+ x: Theme.paddingMedium
+ }
+ Column{
+ id: entryDescription
+ x: Theme.paddingMedium
+ anchors.left: entryIcon.right
+ anchors.right: parent.right
+ anchors.verticalCenter: entryIcon.verticalCenter
+
+ Label {
+ id: nameLabel
+
+ width: parent.width
+ textFormat: Text.StyledText
+ text: name
+ }
+ Label {
+ id: descriptionLabel
+
+ visible: description != ""
+ text: description.replace(/\n/g, " ")
+ font.pixelSize: Theme.fontSizeExtraSmall
+ color: Theme.secondaryColor
+ width: parent.width
+ truncationMode: TruncationMode.Fade
+ }
+ }
+ onClicked: {
+ console.log("selected collection: " + model.name + " (" + model.id + ")");
+ collectionModel.collectionId = model.id;
+ //waypointSelectorDialog.open();
+ pageStack.push(waypointSelectorDialog)
+ }
+ }
+
+ header: PageHeader {
+ id: header
+ title: qsTr("Collections")
+ }
+
+ VerticalScrollDecorator {}
+
+ BusyIndicator {
+ id: busyIndicator
+ running: collectionListModel.loading
+ size: BusyIndicatorSize.Large
+ anchors.horizontalCenter: parent.horizontalCenter
+ anchors.verticalCenter: parent.verticalCenter
+ }
+ }
+
+ CollectionModel {
+ id: collectionModel
+
+ waypointFirst: true
+ showTracks: false
+ ordering: AppSettings.collectionOrdering
+
+ onLoadingChanged: {
+ console.log("onLoadingChanged: " + loading + ", collection " + collectionModel.name + " (" + collectionModel.collectionId + ")");
+ }
+ onError: {
+ remorse.execute(message, function() { }, 10 * 1000);
+ }
+ }
+
+ Page{
+ id: waypointSelectorDialog
+
+ SilicaListView {
+ id: collectionView
+ anchors.fill: parent
+ spacing: Theme.paddingMedium
+ x: Theme.paddingMedium
+ clip: true
+
+ currentIndex: -1 // otherwise currentItem will steal focus
+
+ TrackTypes {
+ id: trackTypes
+ }
+
+ model: collectionModel
+ delegate: ListItem {
+ id: collectionItem
+
+ ListView.onAdd: AddAnimation {
+ target: collectionItem
+ }
+ ListView.onRemove: RemoveAnimation {
+ target: collectionItem
+ }
+
+ Rectangle {
+ x: Theme.paddingMedium * 0.2
+ y: 0
+ height: entryIcon2.height
+ width: Theme.paddingMedium * 0.6
+ radius: width / 2
+
+ function waypointColor() {
+ if (model.color !== "") {
+ return model.color;
+ }
+ return "#ff0000"; // default symbol is red cyrcle (marker)
+ }
+
+ function routeColor() {
+ if (model.color !== "") {
+ return model.color;
+ }
+ return "#10a000"; // default route color in standard stylesheet
+ }
+
+ color: model.type === "waypoint" ? waypointColor() : routeColor()
+ opacity: 0.6
+ }
+
+
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/resources/online-tile-providers.json
^
|
@@ -7,15 +7,15 @@
],
"maximumZoomLevel": 19,
"copyright": "© OpenStreetMap contributors"
- },
+ },
{
- "id": "hikebikemap",
- "name": "Hike & Bike Map",
+ "id": "tracestrack-topo",
+ "name": "Tracestrack Topo",
"servers": [
- "https://tiles.wmflabs.org/hikebike/%1/%2/%3.png"
+ "https://tile.tracestrack.com/topo__/%1/%2/%3.png?key=ca838ccae75253c5f95dfbdfad7c17b1"
],
"maximumZoomLevel": 19,
- "copyright": "© Leaflet, OSM, NASA"
+ "copyright": "© Tracestrack, OSM, NASA"
},
{
"id": "watercolor",
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/src/CollectionModel.cpp
^
|
@@ -20,6 +20,8 @@
#include "CollectionModel.h"
#include "QVariantConverters.h"
+#include <osmscoutclientqt/LocationEntry.h>
+
#include <QDebug>
#include <QtCore/QStandardPaths>
#include <QStorageInfo>
@@ -237,14 +239,18 @@
this->collection = collection;
std::vector<Item> newItems;
- if (collection.waypoints){
- for (const auto &wpt : *collection.waypoints){
- newItems.push_back(wpt);
+ if (showWaypoints) {
+ if (collection.waypoints) {
+ for (const auto &wpt: *collection.waypoints) {
+ newItems.push_back(wpt);
+ }
}
}
- if (collection.tracks){
- for (const auto &trk : *collection.tracks){
- newItems.push_back(trk);
+ if (showTracks) {
+ if (collection.tracks) {
+ for (const auto &trk: *collection.tracks) {
+ newItems.push_back(trk);
+ }
}
}
@@ -347,6 +353,16 @@
case VisibleRole: return waypoint.visible;
case ColorRole: return waypointColor(waypoint.data.symbol);
case WaypointTypeRole: return waypointType(waypoint.data.symbol);
+ case LocationObjectRole:
+ // QML will take ownership
+ return QVariant::fromValue(new osmscout::LocationEntry(osmscout::LocationEntry::typeObject,
+ QString::fromStdString(waypoint.data.name.value_or(""s)),
+ "",
+ waypointType(waypoint.data.symbol),
+ QList<osmscout::AdminRegionInfoRef>(),
+ "",
+ waypoint.data.coord,
+ osmscout::GeoBox::BoxByCenterAndRadius(waypoint.data.coord, osmscout::Meters(waypoint.data.hdop.value_or(1)))));
default: return QVariant();
}
} else {
@@ -392,6 +408,7 @@
roles[LongitudeRole] = "longitude";
roles[ElevationRole] = "elevation";
roles[WaypointTypeRole] = "waypointType";
+ roles[LocationObjectRole] = "locationObject";
// track
roles[DistanceRole] = "distance";
@@ -687,3 +704,13 @@
emit loadingChanged();
emit trackVisibilityRequest(trackId, visible);
}
+
+void CollectionModel::setShowTracks(bool b)
+{
+ showTracks=b;
+}
+
+void CollectionModel::setShowWaypoints(bool b)
+{
+ showWaypoints=b;
+}
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/src/CollectionModel.h
^
|
@@ -37,6 +37,11 @@
Q_PROPERTY(QString name READ getCollectionName NOTIFY loadingChanged)
Q_PROPERTY(QString filesystemName READ getCollectionFilesystemName NOTIFY loadingChanged)
Q_PROPERTY(QString description READ getCollectionDescription NOTIFY loadingChanged)
+
+ // visibility
+ Q_PROPERTY(bool showTracks READ getShowTracks WRITE setShowTracks)
+ Q_PROPERTY(bool showWaypoints READ getShowWaypoints WRITE setShowWaypoints)
+
// ordering
Q_PROPERTY(bool waypointFirst READ getWaypointFirst WRITE setWaypointFirst NOTIFY orderingChanged)
Q_PROPERTY(Ordering ordering READ getOrdering WRITE setOrdering NOTIFY orderingChanged)
@@ -78,6 +83,8 @@
void moveTrack(QString trackId, QString collectionId);
void setWaypointVisibility(QString id, bool visible);
void setTrackVisibility(QString id, bool visible);
+ void setShowTracks(bool b);
+ void setShowWaypoints(bool b);
public:
CollectionModel();
@@ -109,10 +116,11 @@
LongitudeRole = Qt::UserRole+11,
ElevationRole = Qt::UserRole+12,
WaypointTypeRole = Qt::UserRole+13,
+ LocationObjectRole = Qt::UserRole+14,
// type == track
- DistanceRole = Qt::UserRole+14,
- TrackTypeRole = Qt::UserRole+15,
+ DistanceRole = Qt::UserRole+15,
+ TrackTypeRole = Qt::UserRole+16,
};
Q_ENUM(Roles)
@@ -155,9 +163,19 @@
static QString waypointType(const std::optional<std::string> &symbol, const QString &defaultType = "_waypoint");
static QString waypointColor(const std::optional<std::string> &symbol, const QString &defaultColor = "");
+ bool getShowTracks() const
+ {
+ return showTracks;
+ }
+
+ bool getShowWaypoints() const
+ {
+ return showWaypoints;
+ }
+
private:
/**
- * Updates model entries without reseting whole model.
+ * Updates model entries without resetting whole model.
* Both vectors have to use the same sorting.
*/
void handleChanges(std::vector<Item> ¤t, const std::vector<Item> &newItems);
@@ -171,6 +189,9 @@
bool collectionLoaded{false};
bool collectionExporting{false};
+ bool showTracks{true};
+ bool showWaypoints{true};
+
bool waypointFirst{true};
Ordering ordering{DateAscent};
};
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/src/TrackElevationChartWidget.cpp
^
|
@@ -19,6 +19,8 @@
#include "TrackElevationChartWidget.h"
+#include <QElapsedTimer>
+
TrackElevationChartWidget::TrackElevationChartWidget(QQuickItem* parent)
:osmscout::ElevationChartWidget(parent)
{
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/translations/cs.ts
^
|
@@ -773,6 +773,10 @@
<source>Pick a place</source>
<translation>Vybrat na mapě</translation>
</message>
+ <message>
+ <source>Waypoint</source>
+ <translation>Uložené místo</translation>
+ </message>
</context>
<context>
<name>MapDetail</name>
@@ -1971,6 +1975,17 @@
</message>
</context>
<context>
+ <name>WaypointSelector</name>
+ <message>
+ <source>Collections</source>
+ <translation>Sbírky</translation>
+ </message>
+ <message>
+ <source>Loading collection</source>
+ <translation>Nahrávám sbírku</translation>
+ </message>
+</context>
+<context>
<name>databaseType</name>
<message>
<source>node</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/translations/de.ts
^
|
@@ -773,6 +773,10 @@
<source>Pick a place</source>
<translation>Einen Ort auswählen</translation>
</message>
+ <message>
+ <source>Waypoint</source>
+ <translation>Wegpunkt</translation>
+ </message>
</context>
<context>
<name>MapDetail</name>
@@ -1962,6 +1966,17 @@
</message>
</context>
<context>
+ <name>WaypointSelector</name>
+ <message>
+ <source>Collections</source>
+ <translation>Sammlungen</translation>
+ </message>
+ <message>
+ <source>Loading collection</source>
+ <translation>Lade Sammlung</translation>
+ </message>
+</context>
+<context>
<name>databaseType</name>
<message>
<source>node</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/translations/en.ts
^
|
@@ -773,6 +773,10 @@
<source>Pick a place</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>Waypoint</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>MapDetail</name>
@@ -1961,6 +1965,17 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>WaypointSelector</name>
+ <message>
+ <source>Collections</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Loading collection</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
<context>
<name>databaseType</name>
<message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/translations/es.ts
^
|
@@ -773,6 +773,10 @@
<source>Pick a place</source>
<translation>Marcar</translation>
</message>
+ <message>
+ <source>Waypoint</source>
+ <translation>Punto definido</translation>
+ </message>
</context>
<context>
<name>MapDetail</name>
@@ -1962,6 +1966,17 @@
</message>
</context>
<context>
+ <name>WaypointSelector</name>
+ <message>
+ <source>Collections</source>
+ <translation>Colecciones</translation>
+ </message>
+ <message>
+ <source>Loading collection</source>
+ <translation>Cargando colección</translation>
+ </message>
+</context>
+<context>
<name>databaseType</name>
<message>
<source>node</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/translations/et.ts
^
|
@@ -773,6 +773,10 @@
<source>Pick a place</source>
<translation>Vali asukoht</translation>
</message>
+ <message>
+ <source>Waypoint</source>
+ <translation>Teekonnapunkt</translation>
+ </message>
</context>
<context>
<name>MapDetail</name>
@@ -1962,6 +1966,17 @@
</message>
</context>
<context>
+ <name>WaypointSelector</name>
+ <message>
+ <source>Collections</source>
+ <translation>Kogumikud</translation>
+ </message>
+ <message>
+ <source>Loading collection</source>
+ <translation>Laadin kogumikku</translation>
+ </message>
+</context>
+<context>
<name>databaseType</name>
<message>
<source>node</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/translations/fa.ts
^
|
@@ -773,6 +773,10 @@
<source>Pick a place</source>
<translation>انتخاب محل</translation>
</message>
+ <message>
+ <source>Waypoint</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>MapDetail</name>
@@ -1953,6 +1957,17 @@
</message>
</context>
<context>
+ <name>WaypointSelector</name>
+ <message>
+ <source>Collections</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Loading collection</source>
+ <translation>بارگیری مجموعه</translation>
+ </message>
+</context>
+<context>
<name>databaseType</name>
<message>
<source>node</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/translations/fr.ts
^
|
@@ -773,6 +773,10 @@
<source>Pick a place</source>
<translation>Choisir un emplacement</translation>
</message>
+ <message>
+ <source>Waypoint</source>
+ <translation>Repère</translation>
+ </message>
</context>
<context>
<name>MapDetail</name>
@@ -1962,6 +1966,17 @@
</message>
</context>
<context>
+ <name>WaypointSelector</name>
+ <message>
+ <source>Collections</source>
+ <translation>Collections</translation>
+ </message>
+ <message>
+ <source>Loading collection</source>
+ <translation>Chargement de la collection</translation>
+ </message>
+</context>
+<context>
<name>databaseType</name>
<message>
<source>node</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/translations/hu.ts
^
|
@@ -773,6 +773,10 @@
<source>Pick a place</source>
<translation>Válassz a térképről</translation>
</message>
+ <message>
+ <source>Waypoint</source>
+ <translation>Útpont</translation>
+ </message>
</context>
<context>
<name>MapDetail</name>
@@ -1953,6 +1957,17 @@
</message>
</context>
<context>
+ <name>WaypointSelector</name>
+ <message>
+ <source>Collections</source>
+ <translation>Gyűjtemények</translation>
+ </message>
+ <message>
+ <source>Loading collection</source>
+ <translation>Gyűjtemény betöltése</translation>
+ </message>
+</context>
+<context>
<name>databaseType</name>
<message>
<source>node</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/translations/it.ts
^
|
@@ -773,6 +773,10 @@
<source>Pick a place</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>Waypoint</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>MapDetail</name>
@@ -1961,6 +1965,17 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>WaypointSelector</name>
+ <message>
+ <source>Collections</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Loading collection</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
<context>
<name>databaseType</name>
<message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/translations/nb.ts
^
|
@@ -773,6 +773,10 @@
<source>Pick a place</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>Waypoint</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>MapDetail</name>
@@ -1961,6 +1965,17 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>WaypointSelector</name>
+ <message>
+ <source>Collections</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Loading collection</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
<context>
<name>databaseType</name>
<message>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/translations/nl.ts
^
|
@@ -773,6 +773,10 @@
<source>Pick a place</source>
<translation>Kies een plaats</translation>
</message>
+ <message>
+ <source>Waypoint</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>MapDetail</name>
@@ -1962,6 +1966,17 @@
</message>
</context>
<context>
+ <name>WaypointSelector</name>
+ <message>
+ <source>Collections</source>
+ <translation>Verzamelingen</translation>
+ </message>
+ <message>
+ <source>Loading collection</source>
+ <translation>Verzameling wordt geladen</translation>
+ </message>
+</context>
+<context>
<name>databaseType</name>
<message>
<source>node</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/translations/nl_BE.ts
^
|
@@ -773,6 +773,10 @@
<source>Pick a place</source>
<translation>Kiest een plek</translation>
</message>
+ <message>
+ <source>Waypoint</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>MapDetail</name>
@@ -1962,6 +1966,17 @@
</message>
</context>
<context>
+ <name>WaypointSelector</name>
+ <message>
+ <source>Collections</source>
+ <translation>Verzamelingen</translation>
+ </message>
+ <message>
+ <source>Loading collection</source>
+ <translation>Verzameling wordt geladen</translation>
+ </message>
+</context>
+<context>
<name>databaseType</name>
<message>
<source>node</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/translations/pl.ts
^
|
@@ -773,6 +773,10 @@
<source>Pick a place</source>
<translation>Wybierz miejsce</translation>
</message>
+ <message>
+ <source>Waypoint</source>
+ <translation>Punkt trasy</translation>
+ </message>
</context>
<context>
<name>MapDetail</name>
@@ -1971,6 +1975,17 @@
</message>
</context>
<context>
+ <name>WaypointSelector</name>
+ <message>
+ <source>Collections</source>
+ <translation>Kolekcje</translation>
+ </message>
+ <message>
+ <source>Loading collection</source>
+ <translation>Ładowanie kolekcji</translation>
+ </message>
+</context>
+<context>
<name>databaseType</name>
<message>
<source>node</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/translations/pt_BR.ts
^
|
@@ -773,6 +773,10 @@
<source>Pick a place</source>
<translation type="unfinished"></translation>
</message>
+ <message>
+ <source>Waypoint</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>MapDetail</name>
@@ -1962,6 +1966,17 @@
</message>
</context>
<context>
+ <name>WaypointSelector</name>
+ <message>
+ <source>Collections</source>
+ <translation>Coleções</translation>
+ </message>
+ <message>
+ <source>Loading collection</source>
+ <translation>Carregando coleção</translation>
+ </message>
+</context>
+<context>
<name>databaseType</name>
<message>
<source>node</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/translations/ru.ts
^
|
@@ -773,6 +773,10 @@
<source>Pick a place</source>
<translation>Выберите место</translation>
</message>
+ <message>
+ <source>Waypoint</source>
+ <translation type="unfinished"></translation>
+ </message>
</context>
<context>
<name>MapDetail</name>
@@ -1971,6 +1975,17 @@
</message>
</context>
<context>
+ <name>WaypointSelector</name>
+ <message>
+ <source>Collections</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Loading collection</source>
+ <translation>Загрузка коллекции</translation>
+ </message>
+</context>
+<context>
<name>databaseType</name>
<message>
<source>node</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/translations/sv.ts
^
|
@@ -773,6 +773,10 @@
<source>Pick a place</source>
<translation>Välj en plats</translation>
</message>
+ <message>
+ <source>Waypoint</source>
+ <translation>Vägpunkt</translation>
+ </message>
</context>
<context>
<name>MapDetail</name>
@@ -1962,6 +1966,17 @@
</message>
</context>
<context>
+ <name>WaypointSelector</name>
+ <message>
+ <source>Collections</source>
+ <translation>Samlingar</translation>
+ </message>
+ <message>
+ <source>Loading collection</source>
+ <translation>Läser in samling</translation>
+ </message>
+</context>
+<context>
<name>databaseType</name>
<message>
<source>node</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout-2.32.tar.bz2/translations/zh_CN.ts
^
|
@@ -773,6 +773,10 @@
<source>Pick a place</source>
<translation>选取一个地点</translation>
</message>
+ <message>
+ <source>Waypoint</source>
+ <translation>路标</translation>
+ </message>
</context>
<context>
<name>MapDetail</name>
@@ -1953,6 +1957,17 @@
</message>
</context>
<context>
+ <name>WaypointSelector</name>
+ <message>
+ <source>Collections</source>
+ <translation type="unfinished">收藏</translation>
+ </message>
+ <message>
+ <source>Loading collection</source>
+ <translation type="unfinished">正在搜藏中</translation>
+ </message>
+</context>
+<context>
<name>databaseType</name>
<message>
<source>node</source>
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout.changes.in
^
|
@@ -605,3 +605,8 @@
* 2023-07-18 Lukáš Karas <lukas.karas@centrum.cz> 2.31
- update translations (Estonian, Polish)
- fix nondeterministic elevation feature values
+
+* 2023-10-14 Lukáš Karas <lukas.karas@centrum.cz> 2.32
+- replace online wmflabs "Hike and Bike" map with "Topo" map from Tracestrack
+- fix crash during map rendering of zero-size area (happening with Bern in Switzerland)
+- allow to select stored waypoint as navigation start or destination
|
[-]
[+]
|
Changed |
_service:tar_git:harbour-osmscout.yaml
^
|
@@ -1,6 +1,6 @@
Name: harbour-osmscout
Summary: OSMScout for Sailfish
-Version: 2.31
+Version: 2.32
Release: 1
# The contents of the Group field should be one of the groups listed here:
# http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS
|