Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore7
-rw-r--r--CMakeLists.txt39
-rw-r--r--common.pri7
-rw-r--r--drape/drape_tests/testingmain.cpp6
-rw-r--r--drape_frontend/backend_renderer.cpp5
-rw-r--r--generator/generator_tool/generator_tool.pro4
-rw-r--r--indexer/CMakeLists.txt1
-rw-r--r--indexer/map_style_reader.cpp8
-rw-r--r--indexer/scale_index_builder.hpp1
-rw-r--r--iphone/Maps/Classes/CustomViews/MapViewControls/Search/Console/MWMConsole.mm46
-rw-r--r--iphone/Maps/Classes/Widgets/MWMMapWidgets.mm10
-rw-r--r--map/style_tests/classificator_tests.cpp2
-rw-r--r--map/style_tests/style_tests.pro4
-rw-r--r--omim.pro3
-rw-r--r--platform/platform_mac.mm5
-rw-r--r--qt/CMakeLists.txt28
-rw-r--r--qt/about.cpp25
-rw-r--r--qt/about.hpp6
-rw-r--r--qt/build_style/build_common.cpp71
-rw-r--r--qt/build_style/build_common.h16
-rw-r--r--qt/build_style/build_drules.cpp51
-rw-r--r--qt/build_style/build_drules.h2
-rw-r--r--qt/build_style/build_phone_pack.cpp6
-rw-r--r--qt/build_style/build_phone_pack.h2
-rw-r--r--qt/build_style/build_skins.cpp114
-rw-r--r--qt/build_style/build_skins.h2
-rw-r--r--qt/build_style/build_statistics.cpp24
-rw-r--r--qt/build_style/build_statistics.h3
-rw-r--r--qt/build_style/build_style.cpp32
-rw-r--r--qt/build_style/build_style.h3
-rw-r--r--qt/build_style/run_tests.cpp11
-rw-r--r--qt/build_style/run_tests.h8
-rw-r--r--qt/draw_widget.cpp5
-rw-r--r--qt/info_dialog.cpp19
-rw-r--r--qt/info_dialog.hpp6
-rw-r--r--qt/main.cpp22
-rw-r--r--qt/mainwindow.cpp87
-rw-r--r--qt/mainwindow.hpp75
-rw-r--r--qt/preferences_dialog.cpp31
-rw-r--r--qt/preferences_dialog.hpp6
-rw-r--r--qt/qt.pro62
-rw-r--r--qt/search_panel.cpp30
-rw-r--r--qt/search_panel.hpp7
-rw-r--r--qt/update_dialog.cpp5
-rw-r--r--qt/update_dialog.hpp6
-rw-r--r--skin_generator/.qmake.stash42
-rw-r--r--skin_generator/CMakeLists.txt36
-rw-r--r--skin_generator/generator.cpp (renamed from skin_generator/skin_generator.cpp)6
-rw-r--r--skin_generator/generator.hpp (renamed from skin_generator/skin_generator.hpp)4
-rw-r--r--skin_generator/main.cpp15
-rw-r--r--skin_generator/skin_generator.pro12
-rw-r--r--testing/testingmain.cpp6
-rw-r--r--tools/autobuild/build_designer.sh58
-rwxr-xr-xtools/python/generate_styles_override.py4
-rw-r--r--tools/python/stylesheet/drules_info.py4
-rwxr-xr-xtools/unix/build_designer.sh13
-rwxr-xr-xtools/unix/generate_drules.sh3
-rwxr-xr-xtools/unix/generate_symbols.sh7
-rw-r--r--xcode/indexer/indexer.xcodeproj/project.pbxproj4
-rw-r--r--xcode/qtMapsMe/qtMapsMe.xcodeproj/project.pbxproj50
60 files changed, 613 insertions, 564 deletions
diff --git a/.gitignore b/.gitignore
index c0cdc29ed4..7f4a21895d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,6 +19,11 @@ data/[!W]*.mwm
data/local_ads*.dat
data/local_ads_*/*.*
data/shaders_compiler/*
+data/styles/*/*/out/*
+data/resources-*_design/*
+data/drules_proto_design.bin
+data/colors_design.txt
+data/patterns_design.txt
# Compiled Python
*.pyc
@@ -154,3 +159,5 @@ server
*.autosave
cmake-build-*
+
+designer_version.h
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9a3eadd740..f014dee87d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,39 +2,15 @@ cmake_minimum_required(VERSION 3.2)
project(omim C CXX)
-set(CMAKE_POSITION_INDEPENDENT_CODE ON)
-
-# Set environment variables
-
-set(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
-set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
-
-if ($ENV{QT_PATH})
- set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} $ENV{QT_PATH})
+# Options
+option(BUILD_DESIGNER "Build application as design tool" OFF)
+if (BUILD_DESIGNER)
+ message("Designer tool building is enabled")
+ add_definitions(-DBUILD_DESIGNER)
else()
- set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "/usr/local/opt/qt5")
-endif()
-
-if (NOT CMAKE_BUILD_TYPE)
- set(CMAKE_BUILD_TYPE "Release")
+ message("Designer tool building is disabled")
endif()
-if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
- add_definitions(-DDEBUG)
-endif()
-
-if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
- add_definitions(-DRELEASE)
-endif()
-
-if (NOT SKIP_TESTS)
- set(SKIP_TESTS FALSE)
-endif()
-
-add_definitions(-DBUILD_DESIGNER)
-
-# End of setting environment variables
-
# Set target platform:
function(omim_set_platform_var PLATFORM_VAR pattern)
set(${PLATFORM_VAR} FALSE PARENT_SCOPE)
@@ -160,6 +136,8 @@ if (NOT PLATFORM_IPHONE AND NOT PLATFORM_ANDROID)
find_package(Qt5Gui REQUIRED)
find_package(Qt5OpenGL REQUIRED)
find_package(Qt5Widgets REQUIRED)
+ find_package(Qt5Xml REQUIRED)
+ find_package(Qt5Svg REQUIRED)
endif()
if (PLATFORM_LINUX)
@@ -348,6 +326,7 @@ add_subdirectory(local_ads)
if (PLATFORM_DESKTOP)
add_subdirectory(openlr)
add_subdirectory(generator)
+ add_subdirectory(skin_generator)
endif()
omim_add_test_subdirectory(qt_tstfrm)
diff --git a/common.pri b/common.pri
index 953c8dc7da..7784504627 100644
--- a/common.pri
+++ b/common.pri
@@ -6,8 +6,13 @@
# Qt5.6.x sets target OS X version to 10.7 which leads to compile errors.
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.9
-CONFIG(map_designer) {
+CONFIG(map_designer_standalone) {
+ CONFIG += map_designer
+ DEFINES *= USE_DESIGNER_VERSION
DEFINES *= STANDALONE_APP
+}
+
+CONFIG(map_designer) {
DEFINES *= BUILD_DESIGNER
}
diff --git a/drape/drape_tests/testingmain.cpp b/drape/drape_tests/testingmain.cpp
index cfcf9642bd..10849c188f 100644
--- a/drape/drape_tests/testingmain.cpp
+++ b/drape/drape_tests/testingmain.cpp
@@ -17,11 +17,7 @@
#ifdef OMIM_UNIT_TEST_WITH_QT_EVENT_LOOP
#include <Qt>
#ifdef OMIM_OS_MAC // on Mac OS X native run loop works only for QApplication :(
- #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- #include <QtGui/QApplication>
- #else
- #include <QtWidgets/QApplication>
- #endif
+ #include <QtWidgets/QApplication>
#define QAPP QApplication
#else
#include <QtCore/QCoreApplication>
diff --git a/drape_frontend/backend_renderer.cpp b/drape_frontend/backend_renderer.cpp
index 3a4427b3a5..d7a3f0313b 100644
--- a/drape_frontend/backend_renderer.cpp
+++ b/drape_frontend/backend_renderer.cpp
@@ -548,8 +548,13 @@ void BackendRenderer::InitGLDependentResource()
dp::TextureManager::Params params;
params.m_resPostfix = VisualParams::Instance().GetResourcePostfix();
params.m_visualScale = df::VisualParams::Instance().GetVisualScale();
+#ifdef BUILD_DESIGNER
+ params.m_colors = "colors_design.txt";
+ params.m_patterns = "patterns_design.txt";
+#else
params.m_colors = "colors.txt";
params.m_patterns = "patterns.txt";
+#endif // BUILD_DESIGNER
params.m_glyphMngParams.m_uniBlocks = "unicode_blocks.txt";
params.m_glyphMngParams.m_whitelist = "fonts_whitelist.txt";
params.m_glyphMngParams.m_blacklist = "fonts_blacklist.txt";
diff --git a/generator/generator_tool/generator_tool.pro b/generator/generator_tool/generator_tool.pro
index b89f0ecbc8..501f96e369 100644
--- a/generator/generator_tool/generator_tool.pro
+++ b/generator/generator_tool/generator_tool.pro
@@ -10,8 +10,8 @@ include($$ROOT_DIR/common.pri)
INCLUDEPATH *= $$ROOT_DIR/3party/gflags/src
CONFIG += console warn_on
-!map_designer {
- CONFIG -= app_bundle
+!map_designer_standalone {
+ CONFIG -= app_bundle
}
TEMPLATE = app
diff --git a/indexer/CMakeLists.txt b/indexer/CMakeLists.txt
index 8051eada66..39b3a502e9 100644
--- a/indexer/CMakeLists.txt
+++ b/indexer/CMakeLists.txt
@@ -110,6 +110,7 @@ set(
scale_index.hpp
scales.cpp
scales.hpp
+ scales_patch.hpp
search_delimiters.cpp # it's in indexer because of CategoriesHolder dependency.
search_delimiters.hpp # it's in indexer because of CategoriesHolder dependency.
search_string_utils.cpp # it's in indexer because of CategoriesHolder dependency.
diff --git a/indexer/map_style_reader.cpp b/indexer/map_style_reader.cpp
index df9db9fb2a..d9f0889ab5 100644
--- a/indexer/map_style_reader.cpp
+++ b/indexer/map_style_reader.cpp
@@ -15,10 +15,14 @@ std::string const kSuffixVehicleClear = "_vehicle_clear";
std::string const kStylesOverrideDir = "styles";
+#ifdef BUILD_DESIGNER
+std::string const kSuffixDesignTool = "_design";
+#endif // BUILD_DESIGNER
+
std::string GetStyleRulesSuffix(MapStyle mapStyle)
{
#ifdef BUILD_DESIGNER
- return string();
+ return kSuffixDesignTool;
#else
switch (mapStyle)
{
@@ -44,7 +48,7 @@ std::string GetStyleRulesSuffix(MapStyle mapStyle)
std::string GetStyleResourcesSuffix(MapStyle mapStyle)
{
#ifdef BUILD_DESIGNER
- return string();
+ return kSuffixDesignTool;
#else
// We use the same resources for default and vehicle styles
// to avoid textures duplication and package size increasing.
diff --git a/indexer/scale_index_builder.hpp b/indexer/scale_index_builder.hpp
index 3a6bc27417..eb4fedce28 100644
--- a/indexer/scale_index_builder.hpp
+++ b/indexer/scale_index_builder.hpp
@@ -6,7 +6,6 @@
#include "indexer/feature_covering.hpp"
#include "indexer/feature_visibility.hpp"
#include "indexer/interval_index_builder.hpp"
-#include "indexer/scales_patch.hpp"
#include "defines.hpp"
diff --git a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/Console/MWMConsole.mm b/iphone/Maps/Classes/CustomViews/MapViewControls/Search/Console/MWMConsole.mm
deleted file mode 100644
index f076a892d3..0000000000
--- a/iphone/Maps/Classes/CustomViews/MapViewControls/Search/Console/MWMConsole.mm
+++ /dev/null
@@ -1,46 +0,0 @@
-#import "MapsAppDelegate.h"
-#import "MWMConsole.h"
-
-#include "Framework.h"
-
-@implementation MWMConsole
-
-+ (BOOL)performCommand:(NSString *)cmd
-{
- if ([self performMapStyle:cmd])
- return YES;
- if ([self performRenderDebug:cmd])
- return YES;
-
- return NO;
-}
-
-+ (BOOL)performMapStyle:(NSString *)cmd
-{
- // Hook for shell command on change map style
- BOOL const isOld = [cmd isEqualToString:@"?oldstyle"];
-
- if (!isOld)
- return NO;
-
- MapStyle const mapStyle = MapStyleLight;
- [[MapsAppDelegate theApp] setMapStyle:mapStyle];
- return YES;
-}
-
-// <MAPS.ME.Designer>
-// Hook for shell command to turn on/off renderer debug mode
-#import "drape/debug_rect_renderer.hpp"
-+ (BOOL)performRenderDebug:(NSString *)cmd
-{
- BOOL const isDebug = [cmd isEqualToString:@"?debug"];
-
- if (!isDebug)
- return NO;
-
- dp::DebugRectRenderer::Instance().SetEnabled(!dp::DebugRectRenderer::Instance().IsEnabled());
- return YES;
-}
-// </MAPS.ME.Designer>
-
-@end
diff --git a/iphone/Maps/Classes/Widgets/MWMMapWidgets.mm b/iphone/Maps/Classes/Widgets/MWMMapWidgets.mm
index 28a2265332..d5bc1e5399 100644
--- a/iphone/Maps/Classes/Widgets/MWMMapWidgets.mm
+++ b/iphone/Maps/Classes/Widgets/MWMMapWidgets.mm
@@ -28,13 +28,11 @@
self.visualScale = p.m_visualScale;
m_skin.reset(new gui::Skin(gui::ResolveGuiSkinFile("default"), p.m_visualScale));
m_skin->Resize(p.m_surfaceWidth, p.m_surfaceHeight);
- m_skin->ForEach([&p](gui::EWidget widget, gui::Position const & pos)
- {
- p.m_widgetsInitInfo[widget] = pos;
- });
-// #ifdef DEBUG
+ m_skin->ForEach(
+ [&p](gui::EWidget widget, gui::Position const & pos) { p.m_widgetsInitInfo[widget] = pos; });
+#ifdef DEBUG
p.m_widgetsInitInfo[gui::WIDGET_SCALE_LABEL] = gui::Position(dp::LeftBottom);
-// #endif
+#endif
}
- (void)resize:(CGSize)size
diff --git a/map/style_tests/classificator_tests.cpp b/map/style_tests/classificator_tests.cpp
index 2733d6866b..cf8db7f48f 100644
--- a/map/style_tests/classificator_tests.cpp
+++ b/map/style_tests/classificator_tests.cpp
@@ -6,7 +6,7 @@
#include "indexer/feature_visibility.hpp"
#include "indexer/feature_data.hpp"
-#include "Platform/platform.hpp"
+#include "platform/platform.hpp"
#include "base/logging.hpp"
diff --git a/map/style_tests/style_tests.pro b/map/style_tests/style_tests.pro
index 9eb827e26c..b6343496c3 100644
--- a/map/style_tests/style_tests.pro
+++ b/map/style_tests/style_tests.pro
@@ -2,8 +2,8 @@ TARGET = style_tests
TEMPLATE = app
CONFIG += console warn_on
-!map_designer {
- CONFIG -= app_bundle
+!map_designer_standalone {
+ CONFIG -= app_bundle
}
INCLUDEPATH += ../../3party/protobuf/src
diff --git a/omim.pro b/omim.pro
index de62a6d2a5..79e7bc728c 100644
--- a/omim.pro
+++ b/omim.pro
@@ -116,7 +116,8 @@ SUBDIRS = 3party base coding geometry editor indexer routing routing_common sear
CONFIG(map_designer):CONFIG(no-tests) {
# Designer Tool package includes style tests
style_tests.subdir = map/style_tests
- style_tests.depends = map indexer platform geometry coding base
+ style_tests.depends = 3party base coding geometry editor platform storage indexer search map \
+ routing_common drape drape_frontend
SUBDIRS *= style_tests
}
diff --git a/platform/platform_mac.mm b/platform/platform_mac.mm
index 9f447c4b6e..1a0c43b229 100644
--- a/platform/platform_mac.mm
+++ b/platform/platform_mac.mm
@@ -39,7 +39,6 @@ Platform::Platform()
{
#ifdef STANDALONE_APP
m_resourcesDir = resourcesPath + "/";
- m_writableDir = m_resourcesDir;
#else // STANDALONE_APP
// we're the console app, probably unit test, and path is our directory
m_resourcesDir = bundlePath + "/../../data/";
@@ -52,8 +51,8 @@ Platform::Platform()
else
m_resourcesDir = "./data/";
}
- m_writableDir = m_resourcesDir;
#endif // STANDALONE_APP
+ m_writableDir = m_resourcesDir;
}
else
{
@@ -94,6 +93,8 @@ Platform::Platform()
}
}
+ if (m_resourcesDir.empty())
+ m_resourcesDir = ".";
m_resourcesDir = my::AddSlashIfNeeded(m_resourcesDir);
m_writableDir = my::AddSlashIfNeeded(m_writableDir);
diff --git a/qt/CMakeLists.txt b/qt/CMakeLists.txt
index 38528d35b1..da92a04fa9 100644
--- a/qt/CMakeLists.txt
+++ b/qt/CMakeLists.txt
@@ -9,9 +9,22 @@ set(RESOURCES_FOLDER ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.app/Contents/Resources)
set(DATA_DIR ${OMIM_ROOT}/data)
execute_process(
- COMMAND mkdir -p ${RESOURCES_FOLDER}
+ COMMAND mkdir -p ${RESOURCES_FOLDER}
)
+if (BUILD_DESIGNER)
+ execute_process(
+ COMMAND cp -rf ${OMIM_ROOT}/data/resources-mdpi_clear/ ${OMIM_ROOT}/data/resources-mdpi_design/
+ COMMAND cp -rf ${OMIM_ROOT}/data/resources-hdpi_clear/ ${OMIM_ROOT}/data/resources-hdpi_design/
+ COMMAND cp -rf ${OMIM_ROOT}/data/resources-xhdpi_clear/ ${OMIM_ROOT}/data/resources-xhdpi_design/
+ COMMAND cp -rf ${OMIM_ROOT}/data/resources-xxhdpi_clear/ ${OMIM_ROOT}/data/resources-xxhdpi_design/
+ COMMAND cp -rf ${OMIM_ROOT}/data/resources-6plus_clear/ ${OMIM_ROOT}/data/resources-6plus_design/
+ COMMAND cp -f ${OMIM_ROOT}/data/drules_proto_clear.bin ${OMIM_ROOT}/data/drules_proto_design.bin
+ COMMAND cp -f ${OMIM_ROOT}/data/colors.txt ${OMIM_ROOT}/data/colors_design.txt
+ COMMAND cp -f ${OMIM_ROOT}/data/patterns.txt ${OMIM_ROOT}/data/patterns_design.txt
+ )
+endif()
+
include_directories(
${OMIM_ROOT}/3party/glm
${OMIM_ROOT}/3party/gflags/src
@@ -180,4 +193,17 @@ copy_resources(
../tools/shaders_compiler
)
+if (BUILD_DESIGNER)
+ copy_resources(
+ resources-mdpi_design
+ resources-hdpi_design
+ resources-xhdpi_design
+ resources-xxhdpi_design
+ resources-6plus_design
+ colors_design.txt
+ patterns_design.txt
+ drules_proto_design.bin
+ )
+endif()
+
add_subdirectory(qt_common)
diff --git a/qt/about.cpp b/qt/about.cpp
index 37c1920fc2..7a4ca0bd11 100644
--- a/qt/about.cpp
+++ b/qt/about.cpp
@@ -7,23 +7,18 @@
#include <QtCore/QFile>
#include <QtGui/QIcon>
+#include <QtWidgets/QMenuBar>
+#include <QtWidgets/QHBoxLayout>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QLabel>
+#include <QtWidgets/QTextBrowser>
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- #include <QtGui/QMenuBar>
- #include <QtGui/QHBoxLayout>
- #include <QtGui/QVBoxLayout>
- #include <QtGui/QLabel>
- #include <QtGui/QTextBrowser>
-#else
- #include <QtWidgets/QMenuBar>
- #include <QtWidgets/QHBoxLayout>
- #include <QtWidgets/QVBoxLayout>
- #include <QtWidgets/QLabel>
- #include <QtWidgets/QTextBrowser>
-#endif
-
-#ifdef BUILD_DESIGNER
+#ifdef USE_DESIGNER_VERSION
#include "designer_version.h"
+#else
+ #define DESIGNER_APP_VERSION ""
+ #define DESIGNER_CODEBASE_SHA ""
+ #define DESIGNER_DATA_VERSION ""
#endif // BUILD_DESIGNER
AboutDialog::AboutDialog(QWidget * parent)
diff --git a/qt/about.hpp b/qt/about.hpp
index 792521877f..1fdebf710b 100644
--- a/qt/about.hpp
+++ b/qt/about.hpp
@@ -1,11 +1,7 @@
#pragma once
#include <QtWidgets/QApplication>
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- #include <QtGui/QDialog>
-#else
- #include <QtWidgets/QDialog>
-#endif
+#include <QtWidgets/QDialog>
class AboutDialog : public QDialog
{
diff --git a/qt/build_style/build_common.cpp b/qt/build_style/build_common.cpp
index 9c563ca25f..dcf1dbafff 100644
--- a/qt/build_style/build_common.cpp
+++ b/qt/build_style/build_common.cpp
@@ -1,10 +1,16 @@
#include "build_common.h"
+#include "platform/platform.hpp"
+
+#include <QCoreApplication>
#include <QDir>
#include <QFile>
#include <QProcess>
+#include <QRegExp>
+
+#include <exception>
-pair<int, QString> ExecProcess(QString const & cmd, QProcessEnvironment const * env)
+std::pair<int, QString> ExecProcess(QString const & cmd, QProcessEnvironment const * env)
{
QProcess p;
if (nullptr != env)
@@ -23,11 +29,13 @@ pair<int, QString> ExecProcess(QString const & cmd, QProcessEnvironment const *
output += error;
}
- return make_pair(exitCode, output);
+ return std::make_pair(exitCode, output);
}
bool CopyFile(QString const & oldFile, QString const & newFile)
{
+ if (oldFile == newFile)
+ return true;
if (!QFile::exists(oldFile))
return false;
if (QFile::exists(newFile) && !QFile::remove(newFile))
@@ -35,14 +43,71 @@ bool CopyFile(QString const & oldFile, QString const & newFile)
return QFile::copy(oldFile, newFile);
}
+void CopyFromResources(QString const & name, QString const & output)
+{
+ QString const resourceDir = GetPlatform().ResourcesDir().c_str();
+ if (!CopyFile(JoinFoldersToPath({resourceDir, name}),
+ JoinFoldersToPath({output, name})))
+ {
+ throw std::runtime_error(std::string("Cannot copy file ") +
+ name.toStdString() +
+ " to " + output.toStdString());
+ }
+}
+
+void CopyToResources(QString const & name, QString const & input, QString const & newName)
+{
+ QString const resourceDir = GetPlatform().ResourcesDir().c_str();
+ if (!CopyFile(JoinFoldersToPath({input, name}),
+ JoinFoldersToPath({resourceDir, newName.isEmpty() ? name : newName})))
+ {
+ throw std::runtime_error(std::string("Cannot copy file ") +
+ name.toStdString() +
+ " from " + input.toStdString());
+ }
+}
+
QString JoinFoldersToPath(std::initializer_list<QString> const & folders)
{
QString result;
+ bool firstInserted = false;
for (auto it = folders.begin(); it != folders.end(); ++it)
{
- if (it != folders.begin())
+ if (it->isEmpty() || *it == QDir::separator())
+ continue;
+
+ if (firstInserted)
result.append(QDir::separator());
+
result.append(*it);
+ firstInserted = true;
}
return QDir::cleanPath(result);
}
+
+QString GetExternalPath(QString const & name, QString const & primaryPath,
+ QString const & secondaryPath)
+{
+ QString const resourceDir = GetPlatform().ResourcesDir().c_str();
+ QString path = JoinFoldersToPath({resourceDir, primaryPath, name});
+ if (!QFileInfo::exists(path))
+ path = JoinFoldersToPath({resourceDir, secondaryPath, name});
+
+ // Special case for looking for in application folder.
+ if (!QFileInfo::exists(path) && secondaryPath.isEmpty())
+ {
+ QString const appPath = QCoreApplication::applicationDirPath();
+ QRegExp rx("(/[^/]*\\.app)", Qt::CaseInsensitive);
+ int i = rx.indexIn(appPath);
+ if (i >= 0)
+ path = JoinFoldersToPath({appPath.left(i), name});
+ }
+
+ ASSERT(QFileInfo::exists(path), (path.toStdString()));
+ return path;
+}
+
+QString GetProtobufEggPath()
+{
+ return GetExternalPath("protobuf-2.6.1-py2.7.egg", "kothic", "../protobuf");
+}
diff --git a/qt/build_style/build_common.h b/qt/build_style/build_common.h
index 55500c9af1..113a219a57 100644
--- a/qt/build_style/build_common.h
+++ b/qt/build_style/build_common.h
@@ -1,17 +1,23 @@
#pragma once
-#include "std/string.hpp"
-#include "std/utility.hpp"
-
#include <QString>
#include <QProcessEnvironment>
#include <initializer_list>
+#include <string>
+#include <utility>
-inline string to_string(const QString & qs) { return qs.toUtf8().constData(); }
+inline std::string to_string(const QString & qs) { return qs.toUtf8().constData(); }
-pair<int, QString> ExecProcess(QString const & cmd, QProcessEnvironment const * env = nullptr);
+std::pair<int, QString> ExecProcess(QString const & cmd, QProcessEnvironment const * env = nullptr);
bool CopyFile(QString const & oldFile, QString const & newFile);
+void CopyFromResources(QString const & name, QString const & output);
+void CopyToResources(QString const & name, QString const & input, QString const & newName = "");
+
QString JoinFoldersToPath(std::initializer_list<QString> const & folders);
+
+QString GetExternalPath(QString const & name, QString const & primaryPath,
+ QString const & secondaryPath);
+QString GetProtobufEggPath();
diff --git a/qt/build_style/build_drules.cpp b/qt/build_style/build_drules.cpp
index 2e9a108593..7f6ec59258 100644
--- a/qt/build_style/build_drules.cpp
+++ b/qt/build_style/build_drules.cpp
@@ -3,8 +3,7 @@
#include "platform/platform.hpp"
-#include "std/exception.hpp"
-
+#include <exception>
#include <fstream>
#include <streambuf>
@@ -15,32 +14,22 @@
namespace
{
-
QString GetScriptPath()
{
- QString const resourceDir = GetPlatform().ResourcesDir().c_str();
- return resourceDir + "kothic/src/libkomwm.py";
-}
-
-QString GetProtobufEggPath()
-{
- QString const resourceDir = GetPlatform().ResourcesDir().c_str();
- return resourceDir + "kothic/protobuf-2.6.1-py2.7.egg";
+ return GetExternalPath("libkomwm.py", "kothic/src", "../tools/kothic/src");
}
-
} // namespace
namespace build_style
{
-
void BuildDrawingRulesImpl(QString const & mapcssFile, QString const & outputDir)
{
- QString const outputTemplate = outputDir + "drules_proto";
+ QString const outputTemplate = JoinFoldersToPath({outputDir, "drules_proto_design"});
QString const outputFile = outputTemplate + ".bin";
// Caller ensures that output directory is clear
if (QFile(outputFile).exists())
- throw runtime_error("Output directory is not clear");
+ throw std::runtime_error("Output directory is not clear");
// Prepare command line
QStringList params;
@@ -64,41 +53,27 @@ void BuildDrawingRulesImpl(QString const & mapcssFile, QString const & outputDir
QString msg = QString("System error ") + to_string(res.first).c_str();
if (!res.second.isEmpty())
msg = msg + "\n" + res.second;
- throw runtime_error(to_string(msg));
+ throw std::runtime_error(to_string(msg));
}
// Ensure generated files has non-zero size
if (QFile(outputFile).size() == 0)
- throw runtime_error("Drawing rules file has zero size");
+ throw std::runtime_error("Drawing rules file has zero size");
}
void BuildDrawingRules(QString const & mapcssFile, QString const & outputDir)
{
- QString const resourceDir = GetPlatform().ResourcesDir().c_str();
-
- if (!QFile::copy(resourceDir + "mapcss-mapping.csv", outputDir + "mapcss-mapping.csv"))
- throw runtime_error("Unable to copy mapcss-mapping.csv file");
-
- if (!QFile::copy(resourceDir + "mapcss-dynamic.txt", outputDir + "mapcss-dynamic.txt"))
- throw runtime_error("Unable to copy mapcss-dynamic.txt file");
-
+ CopyFromResources("mapcss-mapping.csv", outputDir);
+ CopyFromResources("mapcss-dynamic.txt", outputDir);
BuildDrawingRulesImpl(mapcssFile, outputDir);
}
void ApplyDrawingRules(QString const & outputDir)
{
- QString const resourceDir = GetPlatform().ResourcesDir().c_str();
-
- if (!CopyFile(outputDir + "drules_proto.bin", resourceDir + "drules_proto.bin"))
- throw runtime_error("Cannot copy drawing rules file");
- if (!CopyFile(outputDir + "classificator.txt", resourceDir + "classificator.txt"))
- throw runtime_error("Cannot copy classificator file");
- if (!CopyFile(outputDir + "types.txt", resourceDir + "types.txt"))
- throw runtime_error("Cannot copy types file");
- if (!CopyFile(outputDir + "patterns.txt", resourceDir + "patterns.txt"))
- throw runtime_error("Cannot copy patterns file");
- if (!CopyFile(outputDir + "colors.txt", resourceDir + "colors.txt"))
- throw runtime_error("Cannot copy colors file");
+ CopyToResources("drules_proto_design.bin", outputDir);
+ CopyToResources("classificator.txt", outputDir);
+ CopyToResources("types.txt", outputDir);
+ CopyToResources("patterns.txt", outputDir, "patterns_design.txt");
+ CopyToResources("colors.txt", outputDir, "colors_design.txt");
}
-
} // namespace build_style
diff --git a/qt/build_style/build_drules.h b/qt/build_style/build_drules.h
index f476e4d345..61f718abe8 100644
--- a/qt/build_style/build_drules.h
+++ b/qt/build_style/build_drules.h
@@ -4,8 +4,6 @@
namespace build_style
{
-
void BuildDrawingRules(QString const & mapcssFile, QString const & outputDir);
void ApplyDrawingRules(QString const & outputDir);
-
} // build_style
diff --git a/qt/build_style/build_phone_pack.cpp b/qt/build_style/build_phone_pack.cpp
index 822ea80390..ff91adea94 100644
--- a/qt/build_style/build_phone_pack.cpp
+++ b/qt/build_style/build_phone_pack.cpp
@@ -13,11 +13,7 @@ namespace
{
QString GetScriptPath()
{
- QString const kScriptName = "generate_styles_override.py";
- QString const resourceDir = GetPlatform().ResourcesDir().c_str();
- if (resourceDir.isEmpty())
- return kScriptName;
- return JoinFoldersToPath({resourceDir, kScriptName});
+ return GetExternalPath("generate_styles_override.py", "", "../tools/python");
}
} // namespace
diff --git a/qt/build_style/build_phone_pack.h b/qt/build_style/build_phone_pack.h
index fcc055819f..dae66a0a05 100644
--- a/qt/build_style/build_phone_pack.h
+++ b/qt/build_style/build_phone_pack.h
@@ -4,7 +4,5 @@
namespace build_style
{
-
QString RunBuildingPhonePack(QString const & stylesFolder, QString const & targetFolder);
-
} // namespace build_style
diff --git a/qt/build_style/build_skins.cpp b/qt/build_style/build_skins.cpp
index 7fcb7573ed..8f1fcad0be 100644
--- a/qt/build_style/build_skins.cpp
+++ b/qt/build_style/build_skins.cpp
@@ -3,22 +3,20 @@
#include "platform/platform.hpp"
-#include "std/array.hpp"
-#include "std/algorithm.hpp"
-#include "std/exception.hpp"
-#include "std/tuple.hpp"
-#include "std/unordered_map.hpp"
-#include "std/fstream.hpp"
+#include <array>
+#include <algorithm>
+#include <exception>
+#include <tuple>
+#include <unordered_map>
+#include <utility>
+#include <fstream>
#include <QDir>
namespace
{
-
enum SkinType
{
- SkinYota,
- SkinLDPI,
SkinMDPI,
SkinHDPI,
SkinXHDPI,
@@ -29,22 +27,18 @@ enum SkinType
SkinCount
};
-typedef tuple<const char*, int, bool> SkinInfo;
-const SkinInfo g_skinInfo[SkinCount] =
+using SkinInfo = std::tuple<const char*, int, bool>;
+SkinInfo const g_skinInfo[SkinCount] =
{
- make_tuple("yota", 19, true),
- make_tuple("ldpi", 18, false),
- make_tuple("mdpi", 18, false),
- make_tuple("hdpi", 27, false),
- make_tuple("xhdpi", 36, false),
- make_tuple("xxhdpi", 54, false),
- make_tuple("6plus", 54, false),
+ std::make_tuple("mdpi", 18, false),
+ std::make_tuple("hdpi", 27, false),
+ std::make_tuple("xhdpi", 36, false),
+ std::make_tuple("xxhdpi", 54, false),
+ std::make_tuple("6plus", 54, false),
};
-const array<SkinType, SkinCount> g_skinTypes =
+std::array<SkinType, SkinCount> const g_skinTypes =
{{
- SkinYota,
- SkinLDPI,
SkinMDPI,
SkinHDPI,
SkinXHDPI,
@@ -58,53 +52,50 @@ inline bool SkinCoorrectColor(SkinType s) { return std::get<2>(g_skinInfo[s]); }
QString GetSkinGeneratorPath()
{
- QString const resourceDir = GetPlatform().ResourcesDir().c_str();
- return resourceDir + "skin_generator.app/Contents/MacOS/skin_generator";
+ return GetExternalPath("skin_generator", "skin_generator.app/Contents/MacOS", "");
}
class RAII
{
public:
- RAII(function<void()> && f) : m_f(move(f)) {}
+ RAII(std::function<void()> && f) : m_f(std::move(f)) {}
~RAII() { m_f(); }
private:
function<void()> const m_f;
};
-string trim(string && s)
+std::string trim(std::string && s)
{
- s.erase(remove_if(s.begin(), s.end(), &isspace), s.end());
+ s.erase(std::remove_if(s.begin(), s.end(), &isspace), s.end());
return s;
}
-
} // namespace
namespace build_style
{
-
-unordered_map<string, int> GetSkinSizes(QString const & file)
+std::unordered_map<string, int> GetSkinSizes(QString const & file)
{
- unordered_map<string, int> skinSizes;
+ std::unordered_map<string, int> skinSizes;
for (SkinType s : g_skinTypes)
skinSizes.insert(make_pair(SkinSuffix(s), SkinSize(s)));
try
{
- ifstream ifs(to_string(file));
+ std::ifstream ifs(to_string(file));
- string line;
+ std::string line;
while (std::getline(ifs, line))
{
size_t const pos = line.find('=');
- if (pos == string::npos)
+ if (pos == std::string::npos)
continue;
- string name(line.begin(), line.begin() + pos);
- string valueTxt(line.begin() + pos + 1, line.end());
+ std::string name(line.begin(), line.begin() + pos);
+ std::string valueTxt(line.begin() + pos + 1, line.end());
- name = trim(move(name));
- int value = std::stoi(trim(move(valueTxt)));
+ name = trim(std::move(name));
+ int value = std::stoi(trim(std::move(valueTxt)));
if (value <= 0)
continue;
@@ -122,29 +113,29 @@ unordered_map<string, int> GetSkinSizes(QString const & file)
return skinSizes;
}
-void BuildSkinImpl(QString const & styleDir, QString const & suffix, int size, bool colorCorrection,
- QString const & outputDir)
+void BuildSkinImpl(QString const & styleDir, QString const & suffix,
+ int size, bool colorCorrection, QString const & outputDir)
{
- QString const symbolsDir = styleDir + "symbols/";
+ QString const symbolsDir = JoinFoldersToPath({styleDir, "symbols"});
// Check symbols directory exists
if (!QDir(symbolsDir).exists())
- throw runtime_error("Symbols directory does not exist");
+ throw std::runtime_error("Symbols directory does not exist");
// Caller ensures that output directory is clear
if (QDir(outputDir).exists())
- throw runtime_error("Output directory is not clear");
+ throw std::runtime_error("Output directory is not clear");
// Create output skin directory
if (!QDir().mkdir(outputDir))
- throw runtime_error("Cannot create output skin directory");
+ throw std::runtime_error("Cannot create output skin directory");
// Create symbolic link for symbols/png
QString const pngOriginDir = styleDir + suffix;
- QString const pngDir = styleDir + "symbols/png";
+ QString const pngDir = JoinFoldersToPath({styleDir, "symbols", "png"});
QFile::remove(pngDir);
if (!QFile::link(pngOriginDir, pngDir))
- throw runtime_error("Unable to create symbols/png link");
+ throw std::runtime_error("Unable to create symbols/png link");
RAII const cleaner([=]() { QFile::remove(pngDir); });
// Prepare command line
@@ -153,7 +144,7 @@ void BuildSkinImpl(QString const & styleDir, QString const & suffix, int size, b
"--symbolWidth" << to_string(size).c_str() <<
"--symbolHeight" << to_string(size).c_str() <<
"--symbolsDir" << symbolsDir <<
- "--skinName" << outputDir + "basic" <<
+ "--skinName" << JoinFoldersToPath({outputDir, "basic"}) <<
"--skinSuffix=\"\"";
if (colorCorrection)
params << "--colorCorrection true";
@@ -168,27 +159,27 @@ void BuildSkinImpl(QString const & styleDir, QString const & suffix, int size, b
QString msg = QString("System error ") + to_string(res.first).c_str();
if (!res.second.isEmpty())
msg = msg + "\n" + res.second;
- throw runtime_error(to_string(msg));
+ throw std::runtime_error(to_string(msg));
}
// Check files were created
- if (QFile(outputDir + "symbols.png").size() == 0 ||
- QFile(outputDir + "symbols.sdf").size() == 0)
+ if (QFile(JoinFoldersToPath({outputDir, "symbols.png"})).size() == 0 ||
+ QFile(JoinFoldersToPath({outputDir, "symbols.sdf"})).size() == 0)
{
- throw runtime_error("Skin files have not been created");
+ throw std::runtime_error("Skin files have not been created");
}
}
void BuildSkins(QString const & styleDir, QString const & outputDir)
{
- QString const resolutionFilePath = styleDir + "resolutions.txt";
+ QString const resolutionFilePath = JoinFoldersToPath({styleDir, "resolutions.txt"});
- unordered_map<string, int> const resolution2size = GetSkinSizes(resolutionFilePath);
+ auto const resolution2size = GetSkinSizes(resolutionFilePath);
for (SkinType s : g_skinTypes)
{
QString const suffix = SkinSuffix(s);
- QString const outputSkinDir = outputDir + "resources-" + suffix + "/";
+ QString const outputSkinDir = JoinFoldersToPath({outputDir, "resources-" + suffix + "_design"});
int const size = resolution2size.at(to_string(suffix)); // SkinSize(s);
bool const colorCorrection = SkinCoorrectColor(s);
@@ -203,18 +194,19 @@ void ApplySkins(QString const & outputDir)
for (SkinType s : g_skinTypes)
{
QString const suffix = SkinSuffix(s);
- QString const outputSkinDir = outputDir + "resources-" + suffix + "/";
- QString const resourceSkinDir = resourceDir + "resources-" + suffix + "/";
+ QString const outputSkinDir = JoinFoldersToPath({outputDir, "resources-" + suffix + "_design"});
+ QString const resourceSkinDir = JoinFoldersToPath({resourceDir, "resources-" + suffix + "_design"});
- if (!QDir(resourceSkinDir).exists() && !QDir().mkdir(resourceSkinDir))
- throw runtime_error("Cannot create resource skin directory");
+ if (!QFileInfo::exists(resourceSkinDir) && !QDir().mkdir(resourceSkinDir))
+ throw std::runtime_error("Cannot create resource skin directory: " + resourceSkinDir.toStdString());
- if (!CopyFile(outputSkinDir + "symbols.png", resourceSkinDir + "symbols.png") ||
- !CopyFile(outputSkinDir + "symbols.sdf", resourceSkinDir + "symbols.sdf"))
+ if (!CopyFile(JoinFoldersToPath({outputSkinDir, "symbols.png"}),
+ JoinFoldersToPath({resourceSkinDir, "symbols.png"})) ||
+ !CopyFile(JoinFoldersToPath({outputSkinDir, "symbols.sdf"}),
+ JoinFoldersToPath({resourceSkinDir, "symbols.sdf"})))
{
- throw runtime_error("Cannot copy skins files");
+ throw std::runtime_error("Cannot copy skins files");
}
}
}
-
} // namespace build_style
diff --git a/qt/build_style/build_skins.h b/qt/build_style/build_skins.h
index 77728c2b99..50ca7312af 100644
--- a/qt/build_style/build_skins.h
+++ b/qt/build_style/build_skins.h
@@ -4,8 +4,6 @@
namespace build_style
{
-
void BuildSkins(QString const & styleDir, QString const & outputDir);
void ApplySkins(QString const & outputDir);
-
} // namespace build_style
diff --git a/qt/build_style/build_statistics.cpp b/qt/build_style/build_statistics.cpp
index fbe63f15af..0c6b3577ee 100644
--- a/qt/build_style/build_statistics.cpp
+++ b/qt/build_style/build_statistics.cpp
@@ -2,8 +2,6 @@
#include "build_common.h"
-#include "std/exception.hpp"
-
#include "platform/platform.hpp"
#include <QDir>
@@ -11,21 +9,14 @@
#include <QFileInfo>
#include <QStringList>
+#include <exception>
+
namespace
{
-
QString GetScriptPath()
{
- QString const resourceDir = GetPlatform().ResourcesDir().c_str();
- return resourceDir + "kothic/src/drules_info.py";
-}
-
-QString GetProtobufEggPath()
-{
- QString const resourceDir = GetPlatform().ResourcesDir().c_str();
- return resourceDir + "kothic/protobuf-2.6.1-py2.7.egg";
+ return GetExternalPath("drules_info.py", "kothic/src", "../tools/python/stylesheet");
}
-
} // namespace
namespace build_style
@@ -34,10 +25,10 @@ namespace build_style
QString GetStyleStatistics(QString const & mapcssMappingFile, QString const & drulesFile)
{
if (!QFile(mapcssMappingFile).exists())
- throw runtime_error("mapcss-mapping file does not exist");
+ throw std::runtime_error("mapcss-mapping file does not exist");
if (!QFile(drulesFile).exists())
- throw runtime_error("drawing-rules file does not exist");
+ throw std::runtime_error("drawing-rules file does not exist");
// Prepare command line
QStringList params;
@@ -67,10 +58,9 @@ QString GetStyleStatistics(QString const & mapcssMappingFile, QString const & dr
QString GetCurrentStyleStatistics()
{
QString const resourceDir = GetPlatform().ResourcesDir().c_str();
- QString const mappingPath = resourceDir + "mapcss-mapping.csv";
- QString const drulesPath = resourceDir + "drules_proto.bin";
+ QString const mappingPath = JoinFoldersToPath({resourceDir, "mapcss-mapping.csv"});
+ QString const drulesPath = JoinFoldersToPath({resourceDir, "drules_proto_design.bin"});
return GetStyleStatistics(mappingPath, drulesPath);
}
-
} // namespace build_style
diff --git a/qt/build_style/build_statistics.h b/qt/build_style/build_statistics.h
index 3247bda0cd..9291f5fea7 100644
--- a/qt/build_style/build_statistics.h
+++ b/qt/build_style/build_statistics.h
@@ -4,9 +4,6 @@
namespace build_style
{
-
QString GetStyleStatistics(QString const & mapcssMappingFile, QString const & drulesFile);
-
QString GetCurrentStyleStatistics();
-
} // namespace build_style
diff --git a/qt/build_style/build_style.cpp b/qt/build_style/build_style.cpp
index ddfcfa0ea3..09d393da67 100644
--- a/qt/build_style/build_style.cpp
+++ b/qt/build_style/build_style.cpp
@@ -8,7 +8,7 @@
#include "base/logging.hpp"
-#include "std/exception.hpp"
+#include <exception>
#include <future>
#include <QFile>
@@ -17,35 +17,29 @@
namespace
{
-
QString GetRecalculateGeometryScriptPath()
{
- QString const resourceDir = GetPlatform().ResourcesDir().c_str();
- return resourceDir + "recalculate_geom_index.py";
+ return GetExternalPath("recalculate_geom_index.py", "", "../tools/python");
}
QString GetGeometryToolPath()
{
- QString const resourceDir = GetPlatform().ResourcesDir().c_str();
- return resourceDir + "generator_tool.app/Contents/MacOS/generator_tool";
+ return GetExternalPath("generator_tool", "generator_tool.app/Contents/MacOS", "");
}
QString GetGeometryToolResourceDir()
{
- QString const resourceDir = GetPlatform().ResourcesDir().c_str();
- return resourceDir + "generator_tool.app/Contents/Resources/";
+ return GetExternalPath("", "generator_tool.app/Contents/Resources", "");
}
-
} // namespace
namespace build_style
{
-
void BuildAndApply(QString const & mapcssFile)
{
// Ensure mapcss exists
if (!QFile(mapcssFile).exists())
- throw runtime_error("mapcss files does not exist");
+ throw std::runtime_error("mapcss files does not exist");
QDir const projectDir = QFileInfo(mapcssFile).absoluteDir();
QString const styleDir = projectDir.absolutePath() + QDir::separator();
@@ -53,9 +47,9 @@ void BuildAndApply(QString const & mapcssFile)
// Ensure output directory is clear
if (QDir(outputDir).exists() && !QDir(outputDir).removeRecursively())
- throw runtime_error("Unable to remove the output directory");
+ throw std::runtime_error("Unable to remove the output directory");
if (!QDir().mkdir(outputDir))
- throw runtime_error("Unable to make the output directory");
+ throw std::runtime_error("Unable to make the output directory");
bool const hasSymbols = QDir(styleDir + "symbols/").exists();
if (hasSymbols)
@@ -84,12 +78,9 @@ void RunRecalculationGeometryScript(QString const & mapcssFile)
QString const geometryToolResourceDir = GetGeometryToolResourceDir();
- if (!CopyFile(resourceDir + "drules_proto.bin", geometryToolResourceDir + "drules_proto.bin"))
- throw runtime_error("Cannot copy drawing rules file");
- if (!CopyFile(resourceDir + "classificator.txt", geometryToolResourceDir + "classificator.txt"))
- throw runtime_error("Cannot copy classificator file");
- if (!CopyFile(resourceDir + "types.txt", geometryToolResourceDir + "types.txt"))
- throw runtime_error("Cannot copy types file");
+ CopyFromResources("drules_proto_design.bin", geometryToolResourceDir);
+ CopyFromResources("classificator.txt", geometryToolResourceDir);
+ CopyFromResources("types.txt", geometryToolResourceDir);
QStringList params;
params << "python" <<
@@ -109,10 +100,9 @@ void RunRecalculationGeometryScript(QString const & mapcssFile)
QString msg = QString("System error ") + to_string(res.first).c_str();
if (!res.second.isEmpty())
msg = msg + "\n" + res.second;
- throw runtime_error(to_string(msg));
+ throw std::runtime_error(to_string(msg));
}
}
bool NeedRecalculate = false;
-
} // namespace build_style
diff --git a/qt/build_style/build_style.h b/qt/build_style/build_style.h
index 49c70a6f2d..9b3bf45004 100644
--- a/qt/build_style/build_style.h
+++ b/qt/build_style/build_style.h
@@ -4,11 +4,8 @@
namespace build_style
{
-
void BuildAndApply(QString const & mapcssFile);
-
void RunRecalculationGeometryScript(QString const & mapcssFile);
extern bool NeedRecalculate;
-
} // namespace build_style
diff --git a/qt/build_style/run_tests.cpp b/qt/build_style/run_tests.cpp
index 7edb143d1e..ecc4eac2e2 100644
--- a/qt/build_style/run_tests.cpp
+++ b/qt/build_style/run_tests.cpp
@@ -6,19 +6,15 @@
namespace
{
-
QString GetStyleTestPath()
{
- QString const resourceDir = GetPlatform().ResourcesDir().c_str();
- return resourceDir + "style_tests.app/Contents/MacOS/style_tests";
+ return GetExternalPath("style_tests", "style_tests.app/Contents/MacOS", "");
}
-
} // namespace
namespace build_style
{
-
-pair<bool, QString> RunCurrentStyleTests()
+std::pair<bool, QString> RunCurrentStyleTests()
{
QString const resourceDir = GetPlatform().ResourcesDir().c_str();
@@ -32,7 +28,6 @@ pair<bool, QString> RunCurrentStyleTests()
// Unfortunately test process returns 0 even if some test failed,
// therefore phrase 'All tests passed.' is looked to be sure that everything is OK.
- return make_pair(res.second.contains("All tests passed."), res.second);
+ return std::make_pair(res.second.contains("All tests passed."), res.second);
}
-
} // namespace build_style
diff --git a/qt/build_style/run_tests.h b/qt/build_style/run_tests.h
index bffa11c5b1..c3e721b807 100644
--- a/qt/build_style/run_tests.h
+++ b/qt/build_style/run_tests.h
@@ -1,12 +1,10 @@
#pragma once
-#include "std/utility.hpp"
-
#include <QString>
+#include <utility>
+
namespace build_style
{
-
-pair<bool, QString> RunCurrentStyleTests();
-
+std::pair<bool, QString> RunCurrentStyleTests();
} // namespace build_style
diff --git a/qt/draw_widget.cpp b/qt/draw_widget.cpp
index 69adde3a65..858b17236f 100644
--- a/qt/draw_widget.cpp
+++ b/qt/draw_widget.cpp
@@ -509,11 +509,10 @@ void DrawWidget::SetDefaultSurfaceFormat(bool apiOpenGLES3)
}
//fmt.setOption(QSurfaceFormat::DebugContext);
QSurfaceFormat::setDefaultFormat(fmt);
-
+}
void DrawWidget::RefreshDrawingRules()
{
SetMapStyle(MapStyleClear);
}
-
-}
+} // namespace qt
diff --git a/qt/info_dialog.cpp b/qt/info_dialog.cpp
index 59fa34375a..06583b4758 100644
--- a/qt/info_dialog.cpp
+++ b/qt/info_dialog.cpp
@@ -3,20 +3,11 @@
#include "base/assert.hpp"
#include <QtGui/QIcon>
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- #include <QtGui/QTextBrowser>
- #include <QtGui/QPushButton>
- #include <QtGui/QHBoxLayout>
- #include <QtGui/QVBoxLayout>
- #include <QtGui/QLabel>
-#else
- #include <QtWidgets/QTextBrowser>
- #include <QtWidgets/QPushButton>
- #include <QtWidgets/QHBoxLayout>
- #include <QtWidgets/QVBoxLayout>
- #include <QtWidgets/QLabel>
-#endif
+#include <QtWidgets/QTextBrowser>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QHBoxLayout>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QLabel>
namespace qt
{
diff --git a/qt/info_dialog.hpp b/qt/info_dialog.hpp
index 859f7c6076..fa987ab631 100644
--- a/qt/info_dialog.hpp
+++ b/qt/info_dialog.hpp
@@ -1,11 +1,7 @@
#pragma once
#include <QtWidgets/QApplication>
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- #include <QtGui/QDialog>
-#else
- #include <QtWidgets/QDialog>
-#endif
+#include <QtWidgets/QDialog>
namespace qt
{
diff --git a/qt/main.cpp b/qt/main.cpp
index 46e7294621..e53f4e208c 100644
--- a/qt/main.cpp
+++ b/qt/main.cpp
@@ -21,15 +21,8 @@
#include "3party/gflags/src/gflags/gflags.h"
#include <QMessageBox>
-
#include <QtCore/QDir>
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- #include <QtGui/QApplication>
-#else
- #include <QtWidgets/QApplication>
-#endif
-
+#include <QtWidgets/QApplication>
#include <QFileDialog>
DEFINE_string(log_abort_level, my::ToString(my::GetDefaultLogAbortLevel()),
@@ -152,13 +145,16 @@ int main(int argc, char * argv[])
#endif
qt::MainWindow::SetDefaultSurfaceFormat(apiOpenGLES3);
- QString mapcssFilePath;
#ifdef BUILD_DESIGNER
if (argc >= 2 && GetPlatform().IsFileExistsByFullPath(argv[1]))
mapcssFilePath = argv[1];
if (0 == mapcssFilePath.length())
- mapcssFilePath = QFileDialog::getOpenFileName(nullptr,
- "Open MapCSS file", "~/", "MapCSS Files (*.mapcss)");
+ {
+ mapcssFilePath = QFileDialog::getOpenFileName(nullptr, "Open MapCSS file", "~/",
+ "MapCSS Files (*.mapcss)");
+ }
+ if (mapcssFilePath.isEmpty())
+ return returnCode;
#endif // BUILD_DESIGNER
Framework framework;
@@ -167,7 +163,8 @@ int main(int argc, char * argv[])
returnCode = a.exec();
}
- if (build_style::NeedRecalculate && mapcssFilePath.length() != 0)
+#ifdef BUILD_DESIGNER
+ if (build_style::NeedRecalculate && !mapcssFilePath.isEmpty())
{
try
{
@@ -183,6 +180,7 @@ int main(int argc, char * argv[])
msgBox.exec();
}
}
+#endif // BUILD_DESIGNER
LOG_SHORT(LINFO, ("MapsWithMe finished with code", returnCode));
return returnCode;
diff --git a/qt/mainwindow.cpp b/qt/mainwindow.cpp
index 3a66c20d36..49cdb7c552 100644
--- a/qt/mainwindow.cpp
+++ b/qt/mainwindow.cpp
@@ -10,6 +10,8 @@
#include "qt/traffic_panel.hpp"
#include "qt/trafficmodeinitdlg.h"
+#include "drape/debug_rect_renderer.hpp"
+
#include "openlr/openlr_sample.hpp"
#include "platform/settings.hpp"
@@ -38,6 +40,7 @@
#include <QtWidgets/QLabel>
#include <QtWidgets/QMenu>
#include <QtWidgets/QMenuBar>
+#include <QtWidgets/QMessageBox>
#include <QtWidgets/QPushButton>
#include <QtWidgets/QToolBar>
#include <QtWidgets/QToolButton>
@@ -55,8 +58,6 @@
#endif // NO_DOWNLOADER
-#include "drape/debug_rect_renderer.hpp"
-
namespace
{
// TODO(mgsergio): Consider getting rid of this class: just put everything
@@ -113,7 +114,6 @@ private:
namespace qt
{
-
// Defined in osm_auth_dialog.cpp.
extern char const * kTokenKeySetting;
extern char const * kTokenSecretSetting;
@@ -123,12 +123,6 @@ MainWindow::MainWindow(Framework & framework, bool apiOpenGLES3, QString const &
, m_locationService(CreateDesktopLocationService(*this))
#ifdef BUILD_DESIGNER
, m_mapcssFilePath(mapcssFilePath)
- , m_pBuildStyleAction(nullptr)
- , m_pRecalculateGeomIndex(nullptr)
- , m_pDrawDebugRectAction(nullptr)
- , m_pGetStatisticsAction(nullptr)
- , m_pRunTestsAction(nullptr)
- , m_pBuildPhonePackAction(nullptr)
#endif
{
// Always runs on the first desktop
@@ -145,8 +139,10 @@ MainWindow::MainWindow(Framework & framework, bool apiOpenGLES3, QString const &
CreateSearchBarAndPanel();
QString caption = qAppName();
+#ifdef BUILD_DESIGNER
if (!m_mapcssFilePath.isEmpty())
caption += QString(" - ") + m_mapcssFilePath;
+#endif
setWindowTitle(caption);
setWindowIcon(QIcon(":/ui/logo.png"));
@@ -271,45 +267,45 @@ void MainWindow::LocationStateModeChanged(location::EMyPositionMode mode)
namespace
{
- struct button_t
- {
- QString name;
- char const * icon;
- char const * slot;
- };
+struct button_t
+{
+ QString name;
+ char const * icon;
+ char const * slot;
+};
- void add_buttons(QToolBar * pBar, button_t buttons[], size_t count, QObject * pReceiver)
+void add_buttons(QToolBar * pBar, button_t buttons[], size_t count, QObject * pReceiver)
+{
+ for (size_t i = 0; i < count; ++i)
{
- for (size_t i = 0; i < count; ++i)
- {
- if (buttons[i].icon)
- pBar->addAction(QIcon(buttons[i].icon), buttons[i].name, pReceiver, buttons[i].slot);
- else
- pBar->addSeparator();
- }
+ if (buttons[i].icon)
+ pBar->addAction(QIcon(buttons[i].icon), buttons[i].name, pReceiver, buttons[i].slot);
+ else
+ pBar->addSeparator();
}
+}
- void FormatMapSize(uint64_t sizeInBytes, string & units, size_t & sizeToDownload)
+void FormatMapSize(uint64_t sizeInBytes, string & units, size_t & sizeToDownload)
+{
+ int const mbInBytes = 1024 * 1024;
+ int const kbInBytes = 1024;
+ if (sizeInBytes > mbInBytes)
{
- int const mbInBytes = 1024 * 1024;
- int const kbInBytes = 1024;
- if (sizeInBytes > mbInBytes)
- {
- sizeToDownload = (sizeInBytes + mbInBytes - 1) / mbInBytes;
- units = "MB";
- }
- else if (sizeInBytes > kbInBytes)
- {
- sizeToDownload = (sizeInBytes + kbInBytes -1) / kbInBytes;
- units = "KB";
- }
- else
- {
- sizeToDownload = sizeInBytes;
- units = "B";
- }
+ sizeToDownload = (sizeInBytes + mbInBytes - 1) / mbInBytes;
+ units = "MB";
+ }
+ else if (sizeInBytes > kbInBytes)
+ {
+ sizeToDownload = (sizeInBytes + kbInBytes -1) / kbInBytes;
+ units = "KB";
+ }
+ else
+ {
+ sizeToDownload = sizeInBytes;
+ units = "B";
}
}
+} // namespace
void MainWindow::CreateNavigationBar()
{
@@ -343,6 +339,7 @@ void MainWindow::CreateNavigationBar()
m_trafficEnableAction->setChecked(m_pDrawWidget->GetFramework().LoadTrafficEnabled());
pToolBar->addSeparator();
+#ifndef BUILD_DESIGNER
m_selectStartRoutePoint = new QAction(QIcon(":/navig64/point-start.png"),
tr("Start point"), this);
connect(m_selectStartRoutePoint, SIGNAL(triggered()), this, SLOT(OnStartPointSelected()));
@@ -402,6 +399,7 @@ void MainWindow::CreateNavigationBar()
m_clearSelection->setToolTip(tr("Clear selection"));
pToolBar->addSeparator();
+#endif // NOT BUILD_DESIGNER
// Add search button with "checked" behavior.
m_pSearchAction = pToolBar->addAction(QIcon(":/navig64/search.png"), tr("Search"),
@@ -681,8 +679,10 @@ void MainWindow::OnBuildStyle()
build_style::BuildAndApply(m_mapcssFilePath);
// m_pDrawWidget->RefreshDrawingRules();
- bool enabled = false;
- settings::Get(kEnabledAutoRegenGeomIndex, enabled);
+ bool enabled;
+ if (!settings::Get(kEnabledAutoRegenGeomIndex, enabled))
+ enabled = false;
+
if (enabled)
{
build_style::NeedRecalculate = true;
@@ -964,5 +964,4 @@ void MainWindow::SetDefaultSurfaceFormat(bool apiOpenGLES3)
{
DrawWidget::SetDefaultSurfaceFormat(apiOpenGLES3);
}
-
} // namespace qt
diff --git a/qt/mainwindow.hpp b/qt/mainwindow.hpp
index f4ae03d9c8..425243c7ec 100644
--- a/qt/mainwindow.hpp
+++ b/qt/mainwindow.hpp
@@ -7,12 +7,12 @@
#include "platform/location.hpp"
#include "platform/location_service.hpp"
-#include "std/array.hpp"
-#include "std/unique_ptr.hpp"
-
#include <QtWidgets/QApplication>
#include <QtWidgets/QMainWindow>
+#include <array>
+#include <memory>
+
class Framework;
class QDockWidget;
class QLabel;
@@ -26,57 +26,56 @@ namespace qt
{
class MainWindow : public QMainWindow, location::LocationObserver
{
- QAction * m_pMyPositionAction;
- QAction * m_pCreateFeatureAction;
- QAction * m_selectionMode;
- QAction * m_clearSelection;
- QAction * m_pSearchAction;
- QAction * m_trafficEnableAction;
- QAction * m_saveTrafficSampleAction;
- QAction * m_quitTrafficModeAction;
- QToolButton * m_routePointsToolButton;
- QAction * m_selectStartRoutePoint;
- QAction * m_selectFinishRoutePoint;
- QAction * m_selectIntermediateRoutePoint;
-#ifdef BUILD_DESIGNER
- QString const m_mapcssFilePath;
- QAction * m_pBuildStyleAction;
- QAction * m_pRecalculateGeomIndex;
- QAction * m_pDrawDebugRectAction;
- QAction * m_pGetStatisticsAction;
- QAction * m_pRunTestsAction;
- QAction * m_pBuildPhonePackAction;
-#endif // BUILD_DESIGNER
- DrawWidget * m_pDrawWidget;
-
- // TODO(mgsergio): Make indexing more informative.
- array<QDockWidget *, 2> m_Docks;
+ DrawWidget * m_pDrawWidget = nullptr; // TODO(mgsergio): Make indexing more informative.
+ std::array<QDockWidget *, 2> m_Docks;
+
+ QPushButton * m_downloadButton = nullptr;
+ QPushButton * m_retryButton = nullptr;
+ QLabel * m_downloadingStatusLabel = nullptr;
- QPushButton * m_downloadButton;
- QPushButton * m_retryButton;
- QLabel * m_downloadingStatusLabel;
storage::TCountryId m_lastCountry;
- unique_ptr<location::LocationService> const m_locationService;
+ std::unique_ptr<location::LocationService> const m_locationService;
// This object is managed by Qt memory system.
TrafficMode * m_trafficMode = nullptr;
+ QAction * m_pMyPositionAction = nullptr;
+ QAction * m_pCreateFeatureAction = nullptr;
+ QAction * m_selectionMode = nullptr;
+ QAction * m_clearSelection = nullptr;
+ QAction * m_pSearchAction = nullptr;
+ QAction * m_trafficEnableAction = nullptr;
+ QAction * m_saveTrafficSampleAction = nullptr;
+ QAction * m_quitTrafficModeAction = nullptr;
+ QToolButton * m_routePointsToolButton = nullptr;
+ QAction * m_selectStartRoutePoint = nullptr;
+ QAction * m_selectFinishRoutePoint = nullptr;
+ QAction * m_selectIntermediateRoutePoint = nullptr;
+#ifdef BUILD_DESIGNER
+ QString const m_mapcssFilePath = nullptr;
+ QAction * m_pBuildStyleAction = nullptr;
+ QAction * m_pRecalculateGeomIndex = nullptr;
+ QAction * m_pDrawDebugRectAction = nullptr;
+ QAction * m_pGetStatisticsAction = nullptr;
+ QAction * m_pRunTestsAction = nullptr;
+ QAction * m_pBuildPhonePackAction = nullptr;
+#endif // BUILD_DESIGNER
+
Q_OBJECT
public:
MainWindow(Framework & framework, bool apiOpenGLES3, QString const & mapcssFilePath = QString());
-Q_OBJECT
-
static void SetDefaultSurfaceFormat(bool apiOpenGLES3);
protected:
string GetIniFile();
+ void OnLocationError(location::TLocationError errorCode) override;
+ void OnLocationUpdated(location::GpsInfo const & info) override;
void LocationStateModeChanged(location::EMyPositionMode mode);
-protected:
void CreatePanelImpl(size_t i, Qt::DockWidgetArea area, QString const & name,
QKeySequence const & hotkey, char const * slot);
void CreateNavigationBar();
@@ -88,10 +87,10 @@ protected:
#if defined(Q_WS_WIN)
/// to handle menu messages
- virtual bool winEvent(MSG * msg, long * result);
+ bool winEvent(MSG * msg, long * result) override;
#endif
- virtual void closeEvent(QCloseEvent * e);
+ void closeEvent(QCloseEvent * e) override;
protected Q_SLOTS:
#ifndef NO_DOWNLOADER
@@ -134,4 +133,4 @@ protected Q_SLOTS:
void OnBuildPhonePackage();
#endif // BUILD_DESIGNER
};
-}
+} // namespace qt
diff --git a/qt/preferences_dialog.cpp b/qt/preferences_dialog.cpp
index cce3e0bcde..d785d4a6e4 100644
--- a/qt/preferences_dialog.cpp
+++ b/qt/preferences_dialog.cpp
@@ -4,28 +4,15 @@
#include "platform/settings.hpp"
#include <QtGui/QIcon>
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- #include <QtGui/QCheckBox>
- #include <QtGui/QHBoxLayout>
- #include <QtGui/QVBoxLayout>
- #include <QtGui/QTableWidget>
- #include <QtGui/QHeaderView>
- #include <QtGui/QPushButton>
- #include <QtGui/QGroupBox>
- #include <QtGui/QButtonGroup>
- #include <QtGui/QRadioButton>
-#else
- #include <QtWidgets/QCheckBox>
- #include <QtWidgets/QHBoxLayout>
- #include <QtWidgets/QVBoxLayout>
- #include <QtWidgets/QTableWidget>
- #include <QtWidgets/QHeaderView>
- #include <QtWidgets/QPushButton>
- #include <QtWidgets/QGroupBox>
- #include <QtWidgets/QButtonGroup>
- #include <QtWidgets/QRadioButton>
-#endif
+#include <QtWidgets/QCheckBox>
+#include <QtWidgets/QHBoxLayout>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QTableWidget>
+#include <QtWidgets/QHeaderView>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QGroupBox>
+#include <QtWidgets/QButtonGroup>
+#include <QtWidgets/QRadioButton>
using namespace measurement_utils;
diff --git a/qt/preferences_dialog.hpp b/qt/preferences_dialog.hpp
index 3442344b4d..97d528bc98 100644
--- a/qt/preferences_dialog.hpp
+++ b/qt/preferences_dialog.hpp
@@ -3,11 +3,7 @@
#include "std/string.hpp"
#include <QtWidgets/QApplication>
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- #include <QtGui/QDialog>
-#else
- #include <QtWidgets/QDialog>
-#endif
+#include <QtWidgets/QDialog>
class QTableWidget;
class QButtonGroup;
diff --git a/qt/qt.pro b/qt/qt.pro
index a6fd1b59ea..2ad6fceb32 100644
--- a/qt/qt.pro
+++ b/qt/qt.pro
@@ -18,6 +18,17 @@ map_designer {
TARGET = MAPS.ME
}
+map_designer {
+ CP_MDPI = $$system(cp -rf $$PWD/../data/resources-mdpi_clear $$PWD/../data/resources-mdpi_design)
+ CP_HDPI = $$system(cp -rf $$PWD/../data/resources-hdpi_clear $$PWD/../data/resources-hdpi_design)
+ CP_XHDPI = $$system(cp -rf $$PWD/../data/resources-xhdpi_clear $$PWD/../data/resources-xhdpi_design)
+ CP_XXHDPI = $$system(cp -rf $$PWD/../data/resources-xxhdpi_clear $$PWD/../data/resources-xxhdpi_design)
+ CP_6PLUS = $$system(cp -rf $$PWD/../data/resources-6plus_clear $$PWD/../data/resources-6plus_design)
+ CP_DRULES = $$system(cp -f $$PWD/../data/drules_proto_clear.bin $$PWD/../data/drules_proto_design.bin)
+ CP_COLORS = $$system(cp -f $$PWD/../data/colors.txt $$PWD/../data/colors_design.txt)
+ CP_PATTERNS = $$system(cp -f $$PWD/../data/patterns.txt $$PWD/../data/patterns_design.txt)
+}
+
TEMPLATE = app
CONFIG += warn_on
QT *= core widgets gui opengl
@@ -88,6 +99,53 @@ MDPI_SKIN_RES.files = ../data/resources-mdpi_clear/symbols.sdf ../data/resources
XHDPI_SKIN_RES.path = $$DATADIR/resources-xhdpi_clear
XHDPI_SKIN_RES.files = ../data/resources-xhdpi_clear/symbols.sdf ../data/resources-xhdpi_clear/symbols.png
+map_designer {
+ DESIGN_TOOL_RES.path = $$DATADIR
+ DESIGN_TOOL_RES.files = ../data/drules_proto_design.bin \
+ ../data/colors_design.txt \
+ ../data/patterns_design.txt
+
+ DESIGN_TOOL_MDPI_RES.path = $$DATADIR/resources-mdpi_design
+ DESIGN_TOOL_MDPI_RES.files = ../data/resources-mdpi_design/symbols.png \
+ ../data/resources-mdpi_design/symbols.sdf \
+ ../data/resources-mdpi_design/symbols-ad.png \
+ ../data/resources-mdpi_design/symbols-ad.sdf \
+ ../data/resources-mdpi_design/area-hatching.png \
+ ../data/resources-mdpi_design/traffic-arrow.png
+
+ DESIGN_TOOL_HDPI_RES.path = $$DATADIR/resources-hdpi_design
+ DESIGN_TOOL_HDPI_RES.files = ../data/resources-hdpi_design/symbols.png \
+ ../data/resources-hdpi_design/symbols.sdf \
+ ../data/resources-hdpi_design/symbols-ad.png \
+ ../data/resources-hdpi_design/symbols-ad.sdf \
+ ../data/resources-hdpi_design/area-hatching.png \
+ ../data/resources-hdpi_design/traffic-arrow.png
+
+ DESIGN_TOOL_XHDPI_RES.path = $$DATADIR/resources-xhdpi_design
+ DESIGN_TOOL_XHDPI_RES.files = ../data/resources-xhdpi_design/symbols.png \
+ ../data/resources-xhdpi_design/symbols.sdf \
+ ../data/resources-xhdpi_design/symbols-ad.png \
+ ../data/resources-xhdpi_design/symbols-ad.sdf \
+ ../data/resources-xhdpi_design/area-hatching.png \
+ ../data/resources-xhdpi_design/traffic-arrow.png
+
+ DESIGN_TOOL_XXHDPI_RES.path = $$DATADIR/resources-xxhdpi_design
+ DESIGN_TOOL_XXHDPI_RES.files = ../data/resources-xxhdpi_design/symbols.png \
+ ../data/resources-xxhdpi_design/symbols.sdf \
+ ../data/resources-xxhdpi_design/symbols-ad.png \
+ ../data/resources-xxhdpi_design/symbols-ad.sdf \
+ ../data/resources-xxhdpi_design/area-hatching.png \
+ ../data/resources-xxhdpi_design/traffic-arrow.png
+
+ DESIGN_TOOL_6PLUS_RES.path = $$DATADIR/resources-6plus_design
+ DESIGN_TOOL_6PLUS_RES.files = ../data/resources-6plus_design/symbols.png \
+ ../data/resources-6plus_design/symbols.sdf \
+ ../data/resources-6plus_design/symbols-ad.png \
+ ../data/resources-6plus_design/symbols-ad.sdf \
+ ../data/resources-6plus_design/area-hatching.png \
+ ../data/resources-6plus_design/traffic-arrow.png
+}
+
FONT_RES.path = $$FONTSDIR
FONT_RES.files = ../data/01_dejavusans.ttf \
../data/02_droidsans-fallback.ttf \
@@ -108,6 +166,10 @@ MWM_RES.path = $$DATADIR
MWM_RES.files = ../data/World.mwm ../data/WorldCoasts.mwm
ALL_RESOURCES = OTHER_RES CLASSIFICATOR_RES MDPI_SKIN_RES XHDPI_SKIN_RES FONT_RES MWM_RES ICU_RES
+map_designer {
+ ALL_RESOURCES += DESIGN_TOOL_RES DESIGN_TOOL_MDPI_RES DESIGN_TOOL_HDPI_RES DESIGN_TOOL_XHDPI_RES \
+ DESIGN_TOOL_XXHDPI_RES DESIGN_TOOL_6PLUS_RES
+}
#ALL_RESOURCES += DEFAULT_SKIN_RES
linux* {
diff --git a/qt/search_panel.cpp b/qt/search_panel.cpp
index 87de683290..52111c8573 100644
--- a/qt/search_panel.cpp
+++ b/qt/search_panel.cpp
@@ -15,26 +15,14 @@
#include <functional>
#include <QtCore/QTimer>
-
#include <QtGui/QBitmap>
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- #include <QtGui/QHeaderView>
- #include <QtGui/QTableWidget>
- #include <QtGui/QLineEdit>
- #include <QtGui/QVBoxLayout>
- #include <QtGui/QHBoxLayout>
- #include <QtGui/QPushButton>
- #include <QtGui/QLabel>
-#else
- #include <QtWidgets/QHeaderView>
- #include <QtWidgets/QTableWidget>
- #include <QtWidgets/QLineEdit>
- #include <QtWidgets/QVBoxLayout>
- #include <QtWidgets/QHBoxLayout>
- #include <QtWidgets/QPushButton>
- #include <QtWidgets/QLabel>
-#endif
+#include <QtWidgets/QHeaderView>
+#include <QtWidgets/QTableWidget>
+#include <QtWidgets/QLineEdit>
+#include <QtWidgets/QVBoxLayout>
+#include <QtWidgets/QHBoxLayout>
+#include <QtWidgets/QPushButton>
+#include <QtWidgets/QLabel>
namespace qt
{
@@ -55,11 +43,7 @@ SearchPanel::SearchPanel(DrawWidget * drawWidget, QWidget * parent)
m_pTable->setSelectionBehavior(QAbstractItemView::SelectRows);
m_pTable->verticalHeader()->setVisible(false);
m_pTable->horizontalHeader()->setVisible(false);
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- m_pTable->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
-#else
m_pTable->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
-#endif
connect(m_pTable, SIGNAL(cellClicked(int, int)), this, SLOT(OnSearchPanelItemClicked(int,int)));
diff --git a/qt/search_panel.hpp b/qt/search_panel.hpp
index 2dfac7e0b2..26bb25f60d 100644
--- a/qt/search_panel.hpp
+++ b/qt/search_panel.hpp
@@ -9,12 +9,7 @@
#include <vector>
#include <QtGui/QPixmap>
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- #include <QtGui/QWidget>
-#else
- #include <QtWidgets/QWidget>
-#endif
+#include <QtWidgets/QWidget>
class QTableWidget;
class QLineEdit;
diff --git a/qt/update_dialog.cpp b/qt/update_dialog.cpp
index 4576a837e4..1fe2d25a99 100644
--- a/qt/update_dialog.cpp
+++ b/qt/update_dialog.cpp
@@ -400,13 +400,8 @@ namespace qt
m_tree->sortByColumn(KColumnIndexCountry, Qt::AscendingOrder);
m_tree->setSortingEnabled(true);
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- m_tree->header()->setResizeMode(KColumnIndexCountry, QHeaderView::ResizeToContents);
- m_tree->header()->setResizeMode(KColumnIndexStatus, QHeaderView::ResizeToContents);
-#else
m_tree->header()->setSectionResizeMode(KColumnIndexCountry, QHeaderView::ResizeToContents);
m_tree->header()->setSectionResizeMode(KColumnIndexStatus, QHeaderView::ResizeToContents);
-#endif
}
void UpdateDialog::OnCountryChanged(TCountryId const & countryId)
diff --git a/qt/update_dialog.hpp b/qt/update_dialog.hpp
index bcc03b3b43..2d958e233d 100644
--- a/qt/update_dialog.hpp
+++ b/qt/update_dialog.hpp
@@ -6,11 +6,7 @@
#include "std/vector.hpp"
#include <QtWidgets/QApplication>
-#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- #include <QtGui/QDialog>
-#else
- #include <QtWidgets/QDialog>
-#endif
+#include <QtWidgets/QDialog>
class QTreeWidget;
class QTreeWidgetItem;
diff --git a/skin_generator/.qmake.stash b/skin_generator/.qmake.stash
new file mode 100644
index 0000000000..87d4f2aa93
--- /dev/null
+++ b/skin_generator/.qmake.stash
@@ -0,0 +1,42 @@
+QMAKE_MAC_SDK.macosx.Path = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk
+QMAKE_MAC_SDK.macosx.PlatformPath = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform
+QMAKE_MAC_SDK.macosx.SDKVersion = 10.12
+QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_CC = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
+QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_CXX = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
+QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_FIX_RPATH = \
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool \
+ -id
+QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_AR = \
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar \
+ cq
+QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_RANLIB = \
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib \
+ -s
+QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_LINK = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
+QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_LINK_SHLIB = /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
+QMAKE_MAC_SDK.macx-clang.macosx.QMAKE_ACTOOL = /Applications/Xcode.app/Contents/Developer/usr/bin/actool
+QMAKE_CXX.INCDIRS = \
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 \
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include \
+ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include \
+ /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include
+QMAKE_CXX.LIBDIRS = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/lib
+QMAKE_CXX.QT_COMPILER_STDCXX = 199711L
+QMAKE_CXX.QMAKE_APPLE_CC = 6000
+QMAKE_CXX.QMAKE_APPLE_CLANG_MAJOR_VERSION = 8
+QMAKE_CXX.QMAKE_APPLE_CLANG_MINOR_VERSION = 1
+QMAKE_CXX.QMAKE_APPLE_CLANG_PATCH_VERSION = 0
+QMAKE_CXX.QMAKE_GCC_MAJOR_VERSION = 4
+QMAKE_CXX.QMAKE_GCC_MINOR_VERSION = 2
+QMAKE_CXX.QMAKE_GCC_PATCH_VERSION = 1
+QMAKE_CXX.COMPILER_MACROS = \
+ QT_COMPILER_STDCXX \
+ QMAKE_APPLE_CC \
+ QMAKE_APPLE_CLANG_MAJOR_VERSION \
+ QMAKE_APPLE_CLANG_MINOR_VERSION \
+ QMAKE_APPLE_CLANG_PATCH_VERSION \
+ QMAKE_GCC_MAJOR_VERSION \
+ QMAKE_GCC_MINOR_VERSION \
+ QMAKE_GCC_PATCH_VERSION
+QMAKE_XCODE_DEVELOPER_PATH = /Applications/Xcode.app/Contents/Developer
+QMAKE_XCODE_VERSION = 8.3.2
diff --git a/skin_generator/CMakeLists.txt b/skin_generator/CMakeLists.txt
new file mode 100644
index 0000000000..6553ff0cb9
--- /dev/null
+++ b/skin_generator/CMakeLists.txt
@@ -0,0 +1,36 @@
+project(skin_generator_cmake)
+
+add_compile_options(
+ "-std=c++11"
+ "-Wno-c++11-narrowing"
+)
+
+include_directories(
+ ${OMIM_ROOT}/3party/gflags/src
+ ${OMIM_ROOT}/3party/freetype/include
+ ${Boost_INCLUDE_DIRS}
+)
+
+set(
+ SRC
+ generator.cpp
+ generator.hpp
+ main.cpp
+)
+
+omim_add_executable(skin_generator ${SRC})
+
+omim_link_libraries(
+ skin_generator
+ geometry
+ coding
+ base
+ freetype
+ gflags
+ ${Boost_LIBRARIES}
+ ${Qt5Gui_LIBRARIES}
+ ${Qt5Widgets_LIBRARIES}
+ ${Qt5Xml_LIBRARIES}
+ ${Qt5Svg_LIBRARIES}
+ ${LIBZ}
+)
diff --git a/skin_generator/skin_generator.cpp b/skin_generator/generator.cpp
index d52e42b381..4ff87bf72e 100644
--- a/skin_generator/skin_generator.cpp
+++ b/skin_generator/generator.cpp
@@ -1,4 +1,4 @@
-#include "skin_generator.hpp"
+#include "generator.hpp"
#include "base/logging.hpp"
#include "base/math.hpp"
@@ -13,6 +13,10 @@
#include <QtXml/QDomDocument>
#include <QtCore/QDir>
+#include <boost/gil/gil_all.hpp>
+
+namespace gil = boost::gil;
+
namespace tools
{
SkinGenerator::SkinGenerator(bool needColorCorrection)
diff --git a/skin_generator/skin_generator.hpp b/skin_generator/generator.hpp
index 580dfe23bf..15f5d1e397 100644
--- a/skin_generator/skin_generator.hpp
+++ b/skin_generator/generator.hpp
@@ -12,8 +12,6 @@
#include "std/string.hpp"
#include "std/map.hpp"
-#include <boost/gil/gil_all.hpp>
-
#include <QtGui/QPainter>
#include <QtGui/QImage>
#include <QtCore/QFileInfo>
@@ -24,8 +22,6 @@
class QImage;
-namespace gil = boost::gil;
-
namespace tools
{
class SkinGenerator
diff --git a/skin_generator/main.cpp b/skin_generator/main.cpp
index 48b4b83ac1..eacc9f7a1b 100644
--- a/skin_generator/main.cpp
+++ b/skin_generator/main.cpp
@@ -1,11 +1,12 @@
-#include "skin_generator.hpp"
+#include "generator.hpp"
#include "base/logging.hpp"
#include <iostream>
+#include <QApplication>
#include <QtCore/QFile>
#include <QtCore/QString>
-#include <QApplication>
+#include <QtCore/QHash>
#include <QtXml/QXmlSimpleReader>
#include <QtXml/QXmlInputSource>
@@ -27,12 +28,14 @@ DEFINE_int32(searchIconHeight, 24, "height of the search category icon");
DEFINE_bool(colorCorrection, false, "apply color correction");
DEFINE_int32(maxSize, 2048, "max width/height of output textures");
-// Used to lock the hash seed, so the order of XML attributes is always the same.
-extern Q_CORE_EXPORT QBasicAtomicInt qt_qhash_seed;
-
int main(int argc, char *argv[])
{
- qt_qhash_seed.store(0);
+// Used to lock the hash seed, so the order of XML attributes is always the same.
+#if QT_VERSION >= QT_VERSION_CHECK(5, 6, 0)
+ qSetGlobalQHashSeed(0);
+#else
+ qputenv("QT_HASH_SEED", "0");
+#endif
try
{
google::ParseCommandLineFlags(&argc, &argv, true);
diff --git a/skin_generator/skin_generator.pro b/skin_generator/skin_generator.pro
index 51c2adb3ad..acd56a1400 100644
--- a/skin_generator/skin_generator.pro
+++ b/skin_generator/skin_generator.pro
@@ -1,12 +1,14 @@
TARGET = skin_generator
TEMPLATE = app
-CONFIG += console
+CONFIG += console
-!map_designer {
- CONFIG -= app_bundle
+!map_designer_standalone {
+ CONFIG -= app_bundle
}
ROOT_DIR = ..
+DEPENDENCIES = coding geometry freetype gflags base
+
include($$ROOT_DIR/common.pri)
QT *= core gui svg xml
@@ -23,7 +25,7 @@ INCLUDEPATH += $$ROOT_DIR/3party/boost \
$$ROOT_DIR/3party/freetype/include \
$$ROOT_DIR/3party/gflags/src
-HEADERS += skin_generator.hpp
+HEADERS += generator.hpp
SOURCES += main.cpp \
- skin_generator.cpp
+ generator.cpp
diff --git a/testing/testingmain.cpp b/testing/testingmain.cpp
index b7aba26f24..60af721c4e 100644
--- a/testing/testingmain.cpp
+++ b/testing/testingmain.cpp
@@ -24,11 +24,7 @@
#if defined(OMIM_UNIT_TEST_WITH_QT_EVENT_LOOP) && !defined(OMIM_OS_IPHONE)
#include <QtCore/Qt>
#ifdef OMIM_OS_MAC // on Mac OS X native run loop works only for QApplication :(
- #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
- #include <QtGui/QApplication>
- #else
- #include <QtWidgets/QApplication>
- #endif
+ #include <QtWidgets/QApplication>
#define QAPP QApplication
#else
#include <QtCore/QCoreApplication>
diff --git a/tools/autobuild/build_designer.sh b/tools/autobuild/build_designer.sh
deleted file mode 100644
index 2f5b77c11a..0000000000
--- a/tools/autobuild/build_designer.sh
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/bash
-set -e -x -u
-
-MY_PATH="`dirname \"$0\"`" # relative
-MY_PATH="`( cd \"$MY_PATH\" && pwd )`" # absolutized and normalized
-
-source "$MY_PATH/detect_qmake.sh"
-
-# Prints number of cores to stdout
-GetCPUCores() {
- case "$OSTYPE" in
- # it's GitBash under Windows
- cygwin) echo $NUMBER_OF_PROCESSORS
- ;;
- linux-gnu) grep -c ^processor /proc/cpuinfo 2>/dev/null
- ;;
- darwin*) sysctl -n hw.ncpu
- ;;
- *) echo "Unsupported platform in $0"
- exit 1
- ;;
- esac
- return 0
-}
-
-
-# Replaces "/cygwin/c" prefix with "c:" one on Windows platform.
-# Does nothing under other OS.
-# 1st param: path to be modified.
-StripCygwinPrefix() {
- if [[ $(GetNdkHost) == "windows-x86_64" ]]; then
- echo "c:`(echo "$1" | cut -c 12-)`"
- return 0
- fi
-
- echo "$1"
- return 0
-}
-
-# 1st param: shadow directory path
-# 2nd param: mkspec
-# 3rd param: additional qmake parameters
-BuildQt() {
- (
- SHADOW_DIR="$1"
- MKSPEC="$2"
- QMAKE_PARAMS="$3"
-
- mkdir -p "$SHADOW_DIR"
- cd "$SHADOW_DIR"
- echo "Launching qmake..."
- # This call is needed to correctly rebuild c++ sources after switching between branches with added or removed source files.
- # Otherwise we get build errors.
- "$QMAKE" -r CONFIG-=sdk CONFIG+=map_designer "$QMAKE_PARAMS" -spec "$(StripCygwinPrefix $MKSPEC)" "$(StripCygwinPrefix $MY_PATH)/../../omim.pro"
-# make clean > /dev/null || true
- make -j $(GetCPUCores)
- )
-}
diff --git a/tools/python/generate_styles_override.py b/tools/python/generate_styles_override.py
index 4cf542ff8e..4620b35306 100755
--- a/tools/python/generate_styles_override.py
+++ b/tools/python/generate_styles_override.py
@@ -10,14 +10,14 @@ def copy_style_file(style_path, drules_suffix, target_path):
print('Path {0} is not found'.format(style_path))
return
- drules_proto_path = os.path.join(style_path, 'drules_proto.bin')
+ drules_proto_path = os.path.join(style_path, 'drules_proto_design.bin')
if not os.path.exists(drules_proto_path):
print('Path {0} is not found'.format(drules_proto_path))
return
shutil.copyfile(drules_proto_path, os.path.join(target_path, 'drules_proto' + drules_suffix + '.bin'))
for density in ['6plus', 'hdpi', 'mdpi', 'xhdpi', 'xxhdpi']:
- res_path = os.path.join(style_path, 'resources-' + density)
+ res_path = os.path.join(style_path, 'resources-' + density + "_design")
if os.path.exists(res_path):
shutil.copytree(res_path, os.path.join(target_path, 'resources-' + density + drules_suffix))
diff --git a/tools/python/stylesheet/drules_info.py b/tools/python/stylesheet/drules_info.py
index 5b0f2acec6..c3e83fa534 100644
--- a/tools/python/stylesheet/drules_info.py
+++ b/tools/python/stylesheet/drules_info.py
@@ -41,9 +41,9 @@ def GetClassesZoomRange(drules_path):
zooms[1] = elem.scale
if zooms[0] != -1:
if name in result:
- if result[name][0]< zooms[0]:
+ if result[name][0] < zooms[0]:
zooms[0] = result[name][0]
- if result[name][1]> zooms[1]:
+ if result[name][1] > zooms[1]:
zooms[1] = result[name][1]
result[name] = zooms
return result
diff --git a/tools/unix/build_designer.sh b/tools/unix/build_designer.sh
index c5d4462a71..3340ed4c7a 100755
--- a/tools/unix/build_designer.sh
+++ b/tools/unix/build_designer.sh
@@ -23,8 +23,13 @@ DVER
rm -rf "$RELEASE_PATH"
(
cd "$OMIM_PATH"
- ${QMAKE-qmake} omim.pro -r -spec macx-clang CONFIG+=release CONFIG+=x86_64 CONFIG+=map_designer CONFIG+=no-tests
- make -j8
+ ${QMAKE-qmake} omim.pro -r -spec macx-clang CONFIG+=release CONFIG+=x86_64 CONFIG+=map_designer_standalone CONFIG+=no-tests
+ TMP_FILE="build_error.log"
+ if ! make -j8 2> "$TMP_FILE"; then
+ echo '--------------------'
+ cat "$TMP_FILE"
+ exit 1
+ fi
)
# Prepare app package by copying Qt, Kothic, Skin Generator, Style tests
@@ -48,9 +53,9 @@ cp "$OMIM_PATH/tools/python/generate_styles_override.py" "$MAC_RESOURCES/generat
rm -rf $MAC_RESOURCES/drules_proto*
rm -rf $MAC_RESOURCES/resources-*
for i in mdpi hdpi xhdpi xxhdpi 6plus; do
- cp -r $OMIM_PATH/data/resources-${i}_clear/ $MAC_RESOURCES/resources-$i/
+ cp -r $OMIM_PATH/data/resources-${i}_design/ $MAC_RESOURCES/resources-${i}_design/
done
-cp $OMIM_PATH/data/drules_proto_clear.bin $MAC_RESOURCES/drules_proto.bin
+cp $OMIM_PATH/data/drules_proto_design.bin $MAC_RESOURCES/drules_proto_design.bin
for i in resources-default countries-strings cuisine-strings WorldCoasts_obsolete.mwm countries.txt cuisines.txt countries_obsolete.txt packed_polygons.bin packed_polygons_obsolete.bin; do
cp -r $OMIM_PATH/data/$i $MAC_RESOURCES/
done
diff --git a/tools/unix/generate_drules.sh b/tools/unix/generate_drules.sh
index f5500eada2..766b524bdb 100755
--- a/tools/unix/generate_drules.sh
+++ b/tools/unix/generate_drules.sh
@@ -33,6 +33,9 @@ BuildDrawingRules clear night _dark
BuildDrawingRules vehicle clear _vehicle_clear
BuildDrawingRules vehicle night _vehicle_dark
+# In designer mode we use drules_proto_design file instead of standard ones
+cp $OMIM_PATH/data/drules_proto_clear.bin $OMIM_PATH/data/drules_proto_design.bin
+
echo "Merging default and vehicle styles"
python "$OMIM_PATH/tools/python/stylesheet/drules_merge.py" \
"$DATA_PATH/drules_proto_clear.bin" "$DATA_PATH/drules_proto_vehicle_clear.bin" \
diff --git a/tools/unix/generate_symbols.sh b/tools/unix/generate_symbols.sh
index ce2305d6c8..efd355bd3c 100755
--- a/tools/unix/generate_symbols.sh
+++ b/tools/unix/generate_symbols.sh
@@ -108,5 +108,12 @@ BuildSkin clear clear xhdpi 44 false _clear symbols-ad -ad
BuildSkin clear clear xxhdpi 68 false _clear symbols-ad -ad
BuildSkin clear clear 6plus 68 false _clear symbols-ad -ad
+rm -rf $OMIM_PATH/data/resources-{*}
+
+rm -rf $OMIM_PATH/data/resources-*_design
+for i in mdpi hdpi xhdpi xxhdpi 6plus; do
+ cp -r $OMIM_PATH/data/resources-${i}_clear/ $OMIM_PATH/data/resources-${i}_design/
+done
+
echo "Generate local ads symbols"
python "$LOCAL_ADS_SYMBOLS_GENERATOR" "$DATA_PATH/styles" "$DATA_PATH"
diff --git a/xcode/indexer/indexer.xcodeproj/project.pbxproj b/xcode/indexer/indexer.xcodeproj/project.pbxproj
index 1bebc96b88..9eeb3ec7f4 100644
--- a/xcode/indexer/indexer.xcodeproj/project.pbxproj
+++ b/xcode/indexer/indexer.xcodeproj/project.pbxproj
@@ -65,6 +65,7 @@
3D74ABBC1EA67C1E0063A898 /* ftypes_mapping.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3D74ABBB1EA67C1E0063A898 /* ftypes_mapping.hpp */; };
3D928F671D50F9FE001670E0 /* index_helpers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3D928F651D50F9FE001670E0 /* index_helpers.cpp */; };
3D928F681D50F9FE001670E0 /* index_helpers.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3D928F661D50F9FE001670E0 /* index_helpers.hpp */; };
+ 456B3FB41EDEEB65009B3D1F /* scales_patch.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 456B3FB31EDEEB65009B3D1F /* scales_patch.hpp */; };
45C108B11E9CFE41000FE1F6 /* polyline_point_to_int64_test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 45C108AF1E9CFE3E000FE1F6 /* polyline_point_to_int64_test.cpp */; };
45C108BD1E9D0067000FE1F6 /* libicu.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 45C108BC1E9D0067000FE1F6 /* libicu.a */; };
45C108BF1E9D008D000FE1F6 /* librouting_common.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 45C108BE1E9D008D000FE1F6 /* librouting_common.a */; };
@@ -287,6 +288,7 @@
3D74ABBB1EA67C1E0063A898 /* ftypes_mapping.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = ftypes_mapping.hpp; sourceTree = "<group>"; };
3D928F651D50F9FE001670E0 /* index_helpers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = index_helpers.cpp; sourceTree = "<group>"; };
3D928F661D50F9FE001670E0 /* index_helpers.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = index_helpers.hpp; sourceTree = "<group>"; };
+ 456B3FB31EDEEB65009B3D1F /* scales_patch.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = scales_patch.hpp; sourceTree = "<group>"; };
45C108AF1E9CFE3E000FE1F6 /* polyline_point_to_int64_test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = polyline_point_to_int64_test.cpp; sourceTree = "<group>"; };
45C108BC1E9D0067000FE1F6 /* libicu.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libicu.a; path = "/Users/r.kuznetsov/Dev/Projects/omim/xcode/icu/../../../omim-build/xcode/Debug/libicu.a"; sourceTree = "<absolute>"; };
45C108BE1E9D008D000FE1F6 /* librouting_common.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = librouting_common.a; path = "/Users/r.kuznetsov/Dev/Projects/omim/xcode/routing_common/../../../omim-build/xcode/Debug/librouting_common.a"; sourceTree = "<absolute>"; };
@@ -651,6 +653,7 @@
isa = PBXGroup;
children = (
3D452AF51EE6D3A0009EAB9B /* wheelchair.hpp */,
+ 456B3FB31EDEEB65009B3D1F /* scales_patch.hpp */,
3D74ABBB1EA67C1E0063A898 /* ftypes_mapping.hpp */,
3D928F651D50F9FE001670E0 /* index_helpers.cpp */,
3D928F661D50F9FE001670E0 /* index_helpers.hpp */,
@@ -840,6 +843,7 @@
6753413D1A3F540F00A0A8C3 /* scale_index_builder.hpp in Headers */,
675341021A3F540F00A0A8C3 /* classificator_loader.hpp in Headers */,
3D489BF41D4F87740052AA38 /* osm_editor_test.hpp in Headers */,
+ 456B3FB41EDEEB65009B3D1F /* scales_patch.hpp in Headers */,
6758AED21BB4413000C26E27 /* drules_selector_parser.hpp in Headers */,
670BAACA1D0B0BBB000302DA /* string_slice.hpp in Headers */,
6753413F1A3F540F00A0A8C3 /* scale_index.hpp in Headers */,
diff --git a/xcode/qtMapsMe/qtMapsMe.xcodeproj/project.pbxproj b/xcode/qtMapsMe/qtMapsMe.xcodeproj/project.pbxproj
index be17be82a4..a11101f6e5 100644
--- a/xcode/qtMapsMe/qtMapsMe.xcodeproj/project.pbxproj
+++ b/xcode/qtMapsMe/qtMapsMe.xcodeproj/project.pbxproj
@@ -26,6 +26,13 @@
34FFD30F1E9CEF490010AD12 /* map_widget.hpp in Sources */ = {isa = PBXBuildFile; fileRef = 34FFD2F21E9CEEA20010AD12 /* map_widget.hpp */; };
34FFD3101E9CEF490010AD12 /* resources_common.qrc in Sources */ = {isa = PBXBuildFile; fileRef = 34FFD2FD1E9CEEA20010AD12 /* resources_common.qrc */; };
450703071E9E6C7100E8C029 /* local_ads_symbols.txt in Resources */ = {isa = PBXBuildFile; fileRef = 450703061E9E6C7100E8C029 /* local_ads_symbols.txt */; };
+ 456B3FAC1EDEEB04009B3D1F /* build_common.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 456B3F9E1EDEEB04009B3D1F /* build_common.cpp */; };
+ 456B3FAD1EDEEB04009B3D1F /* build_drules.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 456B3FA01EDEEB04009B3D1F /* build_drules.cpp */; };
+ 456B3FAE1EDEEB04009B3D1F /* build_phone_pack.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 456B3FA21EDEEB04009B3D1F /* build_phone_pack.cpp */; };
+ 456B3FAF1EDEEB04009B3D1F /* build_skins.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 456B3FA41EDEEB04009B3D1F /* build_skins.cpp */; };
+ 456B3FB01EDEEB04009B3D1F /* build_statistics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 456B3FA61EDEEB04009B3D1F /* build_statistics.cpp */; };
+ 456B3FB11EDEEB04009B3D1F /* build_style.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 456B3FA81EDEEB04009B3D1F /* build_style.cpp */; };
+ 456B3FB21EDEEB04009B3D1F /* run_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 456B3FAA1EDEEB04009B3D1F /* run_tests.cpp */; };
45B5B58A1CA4216B00D93E36 /* create_feature_dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 45B5B5861CA4216B00D93E36 /* create_feature_dialog.cpp */; };
45B5B58B1CA4216B00D93E36 /* place_page_dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 45B5B5881CA4216B00D93E36 /* place_page_dialog.cpp */; };
45B5B58C1CA4219C00D93E36 /* create_feature_dialog.hpp in Sources */ = {isa = PBXBuildFile; fileRef = 45B5B5871CA4216B00D93E36 /* create_feature_dialog.hpp */; };
@@ -236,6 +243,20 @@
34FFD30B1E9CEF010010AD12 /* libicu.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libicu.a; path = "/Users/igrechuhin/Repo/omim/xcode/icu/../../../omim-build/xcode/Debug/libicu.a"; sourceTree = "<absolute>"; };
34FFD30C1E9CEF010010AD12 /* liblocal_ads.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = liblocal_ads.a; path = "/Users/igrechuhin/Repo/omim/xcode/local_ads/../../../omim-build/xcode/Debug/liblocal_ads.a"; sourceTree = "<absolute>"; };
450703061E9E6C7100E8C029 /* local_ads_symbols.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = local_ads_symbols.txt; sourceTree = "<group>"; };
+ 456B3F9E1EDEEB04009B3D1F /* build_common.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = build_common.cpp; path = build_style/build_common.cpp; sourceTree = "<group>"; };
+ 456B3F9F1EDEEB04009B3D1F /* build_common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = build_common.h; path = build_style/build_common.h; sourceTree = "<group>"; };
+ 456B3FA01EDEEB04009B3D1F /* build_drules.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = build_drules.cpp; path = build_style/build_drules.cpp; sourceTree = "<group>"; };
+ 456B3FA11EDEEB04009B3D1F /* build_drules.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = build_drules.h; path = build_style/build_drules.h; sourceTree = "<group>"; };
+ 456B3FA21EDEEB04009B3D1F /* build_phone_pack.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = build_phone_pack.cpp; path = build_style/build_phone_pack.cpp; sourceTree = "<group>"; };
+ 456B3FA31EDEEB04009B3D1F /* build_phone_pack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = build_phone_pack.h; path = build_style/build_phone_pack.h; sourceTree = "<group>"; };
+ 456B3FA41EDEEB04009B3D1F /* build_skins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = build_skins.cpp; path = build_style/build_skins.cpp; sourceTree = "<group>"; };
+ 456B3FA51EDEEB04009B3D1F /* build_skins.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = build_skins.h; path = build_style/build_skins.h; sourceTree = "<group>"; };
+ 456B3FA61EDEEB04009B3D1F /* build_statistics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = build_statistics.cpp; path = build_style/build_statistics.cpp; sourceTree = "<group>"; };
+ 456B3FA71EDEEB04009B3D1F /* build_statistics.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = build_statistics.h; path = build_style/build_statistics.h; sourceTree = "<group>"; };
+ 456B3FA81EDEEB04009B3D1F /* build_style.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = build_style.cpp; path = build_style/build_style.cpp; sourceTree = "<group>"; };
+ 456B3FA91EDEEB04009B3D1F /* build_style.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = build_style.h; path = build_style/build_style.h; sourceTree = "<group>"; };
+ 456B3FAA1EDEEB04009B3D1F /* run_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = run_tests.cpp; path = build_style/run_tests.cpp; sourceTree = "<group>"; };
+ 456B3FAB1EDEEB04009B3D1F /* run_tests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = run_tests.h; path = build_style/run_tests.h; sourceTree = "<group>"; };
45B5B5861CA4216B00D93E36 /* create_feature_dialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = create_feature_dialog.cpp; sourceTree = "<group>"; };
45B5B5871CA4216B00D93E36 /* create_feature_dialog.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = create_feature_dialog.hpp; sourceTree = "<group>"; };
45B5B5881CA4216B00D93E36 /* place_page_dialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = place_page_dialog.cpp; sourceTree = "<group>"; };
@@ -481,6 +502,27 @@
path = res;
sourceTree = "<group>";
};
+ 456B3F9D1EDEEAE5009B3D1F /* build_style */ = {
+ isa = PBXGroup;
+ children = (
+ 456B3F9E1EDEEB04009B3D1F /* build_common.cpp */,
+ 456B3F9F1EDEEB04009B3D1F /* build_common.h */,
+ 456B3FA01EDEEB04009B3D1F /* build_drules.cpp */,
+ 456B3FA11EDEEB04009B3D1F /* build_drules.h */,
+ 456B3FA21EDEEB04009B3D1F /* build_phone_pack.cpp */,
+ 456B3FA31EDEEB04009B3D1F /* build_phone_pack.h */,
+ 456B3FA41EDEEB04009B3D1F /* build_skins.cpp */,
+ 456B3FA51EDEEB04009B3D1F /* build_skins.h */,
+ 456B3FA61EDEEB04009B3D1F /* build_statistics.cpp */,
+ 456B3FA71EDEEB04009B3D1F /* build_statistics.h */,
+ 456B3FA81EDEEB04009B3D1F /* build_style.cpp */,
+ 456B3FA91EDEEB04009B3D1F /* build_style.h */,
+ 456B3FAA1EDEEB04009B3D1F /* run_tests.cpp */,
+ 456B3FAB1EDEEB04009B3D1F /* run_tests.h */,
+ );
+ name = build_style;
+ sourceTree = "<group>";
+ };
670D055E1B0C9A900013A7AC /* res */ = {
isa = PBXGroup;
children = (
@@ -564,6 +606,7 @@
6753454B1A404C6100A0A8C3 /* qtMapsMe */ = {
isa = PBXGroup;
children = (
+ 456B3F9D1EDEEAE5009B3D1F /* build_style */,
34FFD2ED1E9CEEA20010AD12 /* qt_common */,
671E78DF1E6A455D00B2859B /* trafficmodeinitdlg.ui */,
671E78D61E6A44C600B2859B /* traffic_mode.cpp */,
@@ -709,17 +752,22 @@
34FFD30F1E9CEF490010AD12 /* map_widget.hpp in Sources */,
34FFD3101E9CEF490010AD12 /* resources_common.qrc in Sources */,
671E78E91E6A4F3700B2859B /* trafficmodeinitdlg.h in Sources */,
+ 456B3FB01EDEEB04009B3D1F /* build_statistics.cpp in Sources */,
671E78E61E6A4E4A00B2859B /* traffic_mode.hpp in Sources */,
671E78E71E6A4E4A00B2859B /* traffic_panel.hpp in Sources */,
671E78E31E6A4BE300B2859B /* trafficmodeinitdlg.ui in Sources */,
45B5B58C1CA4219C00D93E36 /* create_feature_dialog.hpp in Sources */,
45B5B58D1CA4219C00D93E36 /* place_page_dialog.hpp in Sources */,
+ 456B3FAE1EDEEB04009B3D1F /* build_phone_pack.cpp in Sources */,
675340A11C528A1C002CF0D9 /* editor_dialog.hpp in Sources */,
+ 456B3FAC1EDEEB04009B3D1F /* build_common.cpp in Sources */,
675340A21C528A1C002CF0D9 /* osm_auth_dialog.hpp in Sources */,
34FFD3061E9CEEA20010AD12 /* qtoglcontextfactory.cpp in Sources */,
670D05991B0CBD5A0013A7AC /* draw_widget.hpp in Sources */,
670D059A1B0CBD5B0013A7AC /* mainwindow.hpp in Sources */,
670D05931B0CBD320013A7AC /* about.hpp in Sources */,
+ 456B3FAF1EDEEB04009B3D1F /* build_skins.cpp in Sources */,
+ 456B3FAD1EDEEB04009B3D1F /* build_drules.cpp in Sources */,
670D05941B0CBD320013A7AC /* info_dialog.hpp in Sources */,
670D05951B0CBD320013A7AC /* preferences_dialog.hpp in Sources */,
670D05961B0CBD320013A7AC /* search_panel.hpp in Sources */,
@@ -732,6 +780,7 @@
671E78DD1E6A44C600B2859B /* traffic_panel.cpp in Sources */,
6729A6691A69395E007D5872 /* resources.qrc in Sources */,
34FFD3021E9CEEA20010AD12 /* map_widget.cpp in Sources */,
+ 456B3FB11EDEEB04009B3D1F /* build_style.cpp in Sources */,
675345901A404CB200A0A8C3 /* search_panel.cpp in Sources */,
45B5B58A1CA4216B00D93E36 /* create_feature_dialog.cpp in Sources */,
675345861A404CB200A0A8C3 /* about.cpp in Sources */,
@@ -743,6 +792,7 @@
675340A01C5289E0002CF0D9 /* osm_auth_dialog.cpp in Sources */,
6753458C1A404CB200A0A8C3 /* preferences_dialog.cpp in Sources */,
6753458A1A404CB200A0A8C3 /* main.cpp in Sources */,
+ 456B3FB21EDEEB04009B3D1F /* run_tests.cpp in Sources */,
675345891A404CB200A0A8C3 /* info_dialog.cpp in Sources */,
34FFD30A1E9CEEA20010AD12 /* scale_slider.cpp in Sources */,
);