From 66d91af035b665debf3b5d55453b13c4d2efd695 Mon Sep 17 00:00:00 2001 From: ExMix Date: Fri, 23 Jan 2015 19:16:35 +0300 Subject: [drape] build android with drape --- map/address_finder.cpp | 3 +- map/alfa_animation_task.cpp | 6 +- map/anim_phase_chain.cpp | 3 +- map/bookmark.cpp | 55 ++- map/bookmark.hpp | 3 + map/bookmark_manager.cpp | 193 ++++----- map/bookmark_manager.hpp | 6 +- map/compass_arrow.cpp | 176 +++----- map/compass_arrow.hpp | 27 +- map/country_status_display.hpp | 48 +-- map/framework.cpp | 861 ++++++++++++++------------------------- map/framework.hpp | 94 +---- map/information_display.cpp | 270 ++++++------ map/information_display.hpp | 33 +- map/location_state.cpp | 229 ++--------- map/location_state.hpp | 33 +- map/map_tests/bookmarks_test.cpp | 10 +- map/map_tests/map_tests.pro | 2 +- map/map_tests/mwm_url_tests.cpp | 3 +- map/map_tests/navigator_test.cpp | 6 +- map/mwm_url.cpp | 8 +- map/mwm_url.hpp | 2 +- map/navigator.cpp | 39 +- map/navigator.hpp | 8 +- map/pin_click_manager.cpp | 17 +- map/pin_click_manager.hpp | 3 - map/rotate_screen_task.cpp | 6 +- map/ruler.cpp | 490 +++++++++++----------- map/ruler.hpp | 26 +- map/track.cpp | 73 ++-- map/track.hpp | 28 +- map/user_mark.hpp | 8 +- map/user_mark_container.cpp | 145 ++++--- map/user_mark_container.hpp | 8 +- map/user_mark_dl_cache.cpp | 156 ++++--- map/user_mark_dl_cache.hpp | 25 +- 36 files changed, 1240 insertions(+), 1863 deletions(-) (limited to 'map') diff --git a/map/address_finder.cpp b/map/address_finder.cpp index 07c6950292..8d340122c6 100644 --- a/map/address_finder.cpp +++ b/map/address_finder.cpp @@ -1,6 +1,7 @@ #include "map/framework.hpp" #include "search/result.hpp" +#include "drape_frontend/visual_params.hpp" #include "indexer/classificator.hpp" #include "indexer/feature_visibility.hpp" @@ -164,7 +165,7 @@ namespace void Framework::GetFeatureTypes(m2::PointD const & pxPoint, vector & types) const { m2::AnyRectD rect; - m_navigator.GetTouchRect(pxPoint, TOUCH_PIXEL_RADIUS * GetVisualScale(), rect); + m_navigator.GetTouchRect(pxPoint, TOUCH_PIXEL_RADIUS * df::VisualParams::Instance().GetVisualScale(), rect); // This scale should fit in geometry scales range. int const scale = min(GetDrawScale(), scales::GetUpperScale()); diff --git a/map/alfa_animation_task.cpp b/map/alfa_animation_task.cpp index 5a65277a7b..b9450f06b0 100644 --- a/map/alfa_animation_task.cpp +++ b/map/alfa_animation_task.cpp @@ -28,7 +28,8 @@ void AlfaAnimationTask::OnStart(double ts) { m_timeStart = ts; BaseT::OnStart(ts); - m_f->Invalidate(); + ///@TODO UVR + //m_f->Invalidate(); } void AlfaAnimationTask::OnStep(double ts) @@ -48,5 +49,6 @@ void AlfaAnimationTask::OnStep(double ts) m_current = m_start + t * (m_end - m_start); } - m_f->Invalidate(); + ///@TODO UVR + //m_f->Invalidate(); } diff --git a/map/anim_phase_chain.cpp b/map/anim_phase_chain.cpp index 5915ce82cf..a6b6661d53 100644 --- a/map/anim_phase_chain.cpp +++ b/map/anim_phase_chain.cpp @@ -49,7 +49,8 @@ void AnimPhaseChain::OnStep(double ts) double t = elapsedTime / phase->m_timeInterval; m_scale = m_startScale + t * (phase->m_endScale - m_startScale); - m_f.Invalidate(); + ///@TODO UVR + //m_f.Invalidate(); } void InitDefaultPinAnim(AnimPhaseChain * chain) diff --git a/map/bookmark.cpp b/map/bookmark.cpp index ca2395f4c9..d635db1570 100644 --- a/map/bookmark.cpp +++ b/map/bookmark.cpp @@ -8,6 +8,7 @@ #include "base/scope_guard.hpp" + #include "graphics/depth_constants.hpp" #include "indexer/mercator.hpp" @@ -17,6 +18,9 @@ #include "coding/internal/file_data.hpp" #include "coding/hex.hpp" +#include "drape/drape_global.hpp" +#include "drape/color.hpp" + #include "platform/platform.hpp" #include "base/stl_add.hpp" @@ -31,6 +35,23 @@ unique_ptr Bookmark::Copy() const return unique_ptr(new UserMarkCopy(this, false)); } +///@TODO UVR +//graphics::DisplayList * Bookmark::GetDisplayList(UserMarkDLCache * cache) const +//{ +// return cache->FindUserMark(UserMarkDLCache::Key(GetType(), dp::Bottom, GetContainer()->GetDepth())); +//} + +double Bookmark::GetAnimScaleFactor() const +{ + return m_animScaleFactor; +} + +m2::PointD const & Bookmark::GetPixelOffset() const +{ + static m2::PointD s_offset(0.0, 3.0); + return s_offset; +} + shared_ptr Bookmark::CreateAnimTask(Framework & fm) { m_animScaleFactor = 0.0; @@ -73,7 +94,7 @@ void BookmarkCategory::ReplaceBookmark(size_t index, BookmarkData const & bm) } BookmarkCategory::BookmarkCategory(const string & name, Framework & framework) - : base_t(graphics::bookmarkDepth, framework) + : base_t(0.0/*graphics::bookmarkDepth*/, framework) , m_name(name) , m_blockAnimation(false) { @@ -166,14 +187,14 @@ size_t BookmarkCategory::FindBookmark(Bookmark const * bookmark) const namespace { -string const kPlacemark = "Placemark"; -string const kStyle = "Style"; -string const kDocument = "Document"; -string const kStyleMap = "StyleMap"; -string const kStyleUrl = "styleUrl"; -string const kPair = "Pair"; + string const kPlacemark = "Placemark"; + string const kStyle = "Style"; + string const kDocument = "Document"; + string const kStyleMap = "StyleMap"; + string const kStyleUrl = "styleUrl"; + string const kPair = "Pair"; -graphics::Color const kDefaultTrackColor = graphics::Color::fromARGB(0xFF33CCFF); + dp::Color const kDefaultTrackColor = dp::Extract(0xFF33CCFF); string PointToString(m2::PointD const & org) { @@ -210,12 +231,12 @@ graphics::Color const kDefaultTrackColor = graphics::Color::fromARGB(0xFF33CCFF) vector m_tags; GeometryType m_geometryType; m2::PolylineD m_points; - graphics::Color m_trackColor; + dp::Color m_trackColor; string m_styleId; string m_mapStyleId; string m_styleUrlKey; - map m_styleUrl2Color; + map m_styleUrl2Color; map m_mapStyle2Style; string m_name; @@ -322,10 +343,10 @@ graphics::Color const kDefaultTrackColor = graphics::Color::fromARGB(0xFF33CCFF) string fromHex = FromHex(value); ASSERT(fromHex.size() == 4, ("Invalid color passed")); // Color positions in HEX – aabbggrr - m_trackColor = graphics::Color(fromHex[3], fromHex[2], fromHex[1], fromHex[0]); + m_trackColor = dp::Color(fromHex[3], fromHex[2], fromHex[1], fromHex[0]); } - bool GetColorForStyle(string const & styleUrl, graphics::Color & color) + bool GetColorForStyle(string const & styleUrl, dp::Color & color) { if (styleUrl.empty()) return false; @@ -751,12 +772,12 @@ void BookmarkCategory::SaveToKML(ostream & s) s << "\n"; s << "