From 0771e5046064875d323245873f457b87e8c4b447 Mon Sep 17 00:00:00 2001 From: Leith Bade Date: Mon, 22 Dec 2014 18:08:48 +1300 Subject: Rename View functions to match conventions. Also tidy up view classes and remove C style casts. Closes #656 --- src/mbgl/map/map.cpp | 14 +++++++------- src/mbgl/map/transform.cpp | 16 ++++++++-------- 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp index ea4115f05c..ea95c925c8 100644 --- a/src/mbgl/map/map.cpp +++ b/src/mbgl/map/map.cpp @@ -33,7 +33,7 @@ #include // Check libuv library version. -const static bool uv_version_check = []() { +const static bool uvVersionCheck = []() { const unsigned int version = uv_version(); const unsigned int major = (version >> 16) & 0xFF; const unsigned int minor = (version >> 8) & 0xFF; @@ -55,7 +55,7 @@ const static bool uv_version_check = []() { #include // Check zlib library version. -const static bool zlib_version_check = []() { +const static bool zlibVersionCheck = []() { const char *const version = zlibVersion(); if (version[0] != ZLIB_VERSION[0]) { throw std::runtime_error(mbgl::util::sprintf<96>( @@ -68,7 +68,7 @@ const static bool zlib_version_check = []() { #include // Check sqlite3 library version. -const static bool sqlite_version_check = []() { +const static bool sqliteVersionCheck = []() { if (sqlite3_libversion_number() != SQLITE_VERSION_NUMBER) { throw std::runtime_error(mbgl::util::sprintf<96>( "sqlite3 libversion mismatch: headers report %d, but library reports %d", @@ -287,9 +287,9 @@ void Map::terminate() { void Map::setup() { assert(std::this_thread::get_id() == mapThread); assert(painter); - view.make_active(); + view.activate(); painter->setup(); - view.make_inactive(); + view.deactivate(); } void Map::setStyleURL(const std::string &url) { @@ -613,7 +613,7 @@ void Map::prepare() { } void Map::render() { - view.make_active(); + view.activate(); assert(painter); painter->render(*style, activeSources, @@ -623,5 +623,5 @@ void Map::render() { update(); } - view.make_inactive(); + view.deactivate(); } diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp index d05d1f7446..bf79d24b5d 100644 --- a/src/mbgl/map/transform.cpp +++ b/src/mbgl/map/transform.cpp @@ -29,7 +29,7 @@ bool Transform::resize(const uint16_t w, const uint16_t h, const float ratio, if (final.width != w || final.height != h || final.pixelRatio != ratio || final.framebuffer[0] != fb_w || final.framebuffer[1] != fb_h) { - view.notify_map_change(MapChangeRegionWillChange); + view.notifyMapChange(MapChangeRegionWillChange); current.width = final.width = w; current.height = final.height = h; @@ -38,7 +38,7 @@ bool Transform::resize(const uint16_t w, const uint16_t h, const float ratio, current.framebuffer[1] = final.framebuffer[1] = fb_h; constrain(current.scale, current.y); - view.notify_map_change(MapChangeRegionDidChange); + view.notifyMapChange(MapChangeRegionDidChange); return true; } else { @@ -57,7 +57,7 @@ void Transform::moveBy(const double dx, const double dy, const timestamp duratio void Transform::_moveBy(const double dx, const double dy, const timestamp duration) { // This is only called internally, so we don't need a lock here. - view.notify_map_change(duration ? + view.notifyMapChange(duration ? MapChangeRegionWillChangeAnimated : MapChangeRegionWillChange); @@ -78,7 +78,7 @@ void Transform::_moveBy(const double dx, const double dy, const timestamp durati std::make_shared>(current.y, final.y, current.y, start, duration)); } - view.notify_map_change(duration ? + view.notifyMapChange(duration ? MapChangeRegionDidChangeAnimated : MapChangeRegionDidChange, duration); @@ -268,7 +268,7 @@ void Transform::_setScaleXY(const double new_scale, const double xn, const doubl const timestamp duration) { // This is only called internally, so we don't need a lock here. - view.notify_map_change(duration ? + view.notifyMapChange(duration ? MapChangeRegionWillChangeAnimated : MapChangeRegionWillChange); @@ -297,7 +297,7 @@ void Transform::_setScaleXY(const double new_scale, const double xn, const doubl Bc = s / 360; Cc = s / (2 * M_PI); - view.notify_map_change(duration ? + view.notifyMapChange(duration ? MapChangeRegionDidChangeAnimated : MapChangeRegionDidChange, duration); @@ -376,7 +376,7 @@ void Transform::setAngle(const double new_angle, const double cx, const double c void Transform::_setAngle(double new_angle, const timestamp duration) { // This is only called internally, so we don't need a lock here. - view.notify_map_change(duration ? + view.notifyMapChange(duration ? MapChangeRegionWillChangeAnimated : MapChangeRegionWillChange); @@ -395,7 +395,7 @@ void Transform::_setAngle(double new_angle, const timestamp duration) { current.angle, final.angle, current.angle, start, duration)); } - view.notify_map_change(duration ? + view.notifyMapChange(duration ? MapChangeRegionDidChangeAnimated : MapChangeRegionDidChange, duration); -- cgit v1.2.1