diff options
author | Leith Bade <leith@mapbox.com> | 2014-12-04 01:10:43 +1100 |
---|---|---|
committer | Leith Bade <leith@mapbox.com> | 2014-12-04 01:10:43 +1100 |
commit | 14cdd9c96fb6eb9b2d6de4eb521ad50ebe1654ba (patch) | |
tree | 4270e25a7494939afa83be3642a54475636a1aac /android | |
parent | a26ef7f33df475b6a0e90a0f4362f18802bafe8f (diff) | |
download | qtlocation-mapboxgl-14cdd9c96fb6eb9b2d6de4eb521ad50ebe1654ba.tar.gz |
Rename lots of things
Diffstat (limited to 'android')
-rw-r--r-- | android/cpp/jni.cpp | 730 | ||||
-rw-r--r-- | android/cpp/native_map_view.cpp | 150 | ||||
-rw-r--r-- | android/java/lib/src/main/java/com/mapbox/mapboxgl/lib/NativeMapView.java | 8 |
3 files changed, 444 insertions, 444 deletions
diff --git a/android/cpp/jni.cpp b/android/cpp/jni.cpp index f08964a546..de3c64c04f 100644 --- a/android/cpp/jni.cpp +++ b/android/cpp/jni.cpp @@ -35,35 +35,35 @@ namespace mbgl { namespace android { -std::string cache_path; -std::string data_path; -std::string apk_path; +std::string cachePath; +std::string dataPath; +std::string apkPath; -jmethodID on_map_changed_id = nullptr; -jmethodID on_fps_changed_id = nullptr; +jmethodID onMapChangedId = nullptr; +jmethodID onFpsChangedId = nullptr; -jclass lon_lat_class = nullptr; -jmethodID lon_lat_constructor_id = nullptr; -jfieldID lon_lat_lon_id = nullptr; -jfieldID lon_lat_lat_id = nullptr; +jclass lonLatClass = nullptr; +jmethodID lonLatConstructorId = nullptr; +jfieldID lonLatLonId = nullptr; +jfieldID lonLatLatId = nullptr; -jclass lon_lat_zoom_class = nullptr; -jmethodID lon_lat_zoom_constructor_id = nullptr; -jfieldID lon_lat_zoom_lon_id = nullptr; -jfieldID lon_lat_zoom_lat_id = nullptr; -jfieldID lon_lat_zoom_zoom_id = nullptr; +jclass lonLatZoomClass = nullptr; +jmethodID lonLatZoomConstructorId = nullptr; +jfieldID lonLatZoomLonId = nullptr; +jfieldID lonLatZoomLatId = nullptr; +jfieldID lonLatZoomZoomId = nullptr; -jclass runtime_exception_class = nullptr; -jclass null_pointer_exception_class = nullptr; +jclass runtimeExceptionClass = nullptr; +jclass nullPointerExceptionClass = nullptr; -jmethodID list_to_array_id = nullptr; +jmethodID listToArrayId = nullptr; -jclass array_list_class = nullptr; -jmethodID array_list_constructor_id = nullptr; -jmethodID array_list_add_id = nullptr; +jclass arrayListClass = nullptr; +jmethodID arraylistConstructorId = nullptr; +jmethodID arrayListAddId = nullptr; bool throw_error(JNIEnv* env, const char* msg) { - if (env->ThrowNew(runtime_exception_class, msg) < 0) { + if (env->ThrowNew(runtimeExceptionClass, msg) < 0) { env->ExceptionDescribe(); return false; } @@ -75,7 +75,7 @@ std::string std_string_from_jstring(JNIEnv* env, jstring jstr) { std::string str; if (jstr == nullptr) { - if (env->ThrowNew(null_pointer_exception_class, "String cannot be null.") < 0) { + if (env->ThrowNew(nullPointerExceptionClass, "String cannot be null.") < 0) { env->ExceptionDescribe(); return str; } @@ -118,7 +118,7 @@ std::vector<std::string> std_vector_string_from_jobject(JNIEnv* env, jobject jli std::vector<std::string> vector; if (jlist == nullptr) { - if (env->ThrowNew(null_pointer_exception_class, "List cannot be null.") < 0) { + if (env->ThrowNew(nullPointerExceptionClass, "List cannot be null.") < 0) { env->ExceptionDescribe(); return vector; } @@ -126,7 +126,7 @@ std::vector<std::string> std_vector_string_from_jobject(JNIEnv* env, jobject jli return vector; } - jobjectArray array = reinterpret_cast<jobjectArray>(env->CallObjectMethod(jlist, list_to_array_id)); + jobjectArray array = reinterpret_cast<jobjectArray>(env->CallObjectMethod(jlist, listToArrayId)); if (env->ExceptionCheck() || (array == nullptr)) { env->ExceptionDescribe(); return vector; @@ -152,14 +152,14 @@ std::vector<std::string> std_vector_string_from_jobject(JNIEnv* env, jobject jli } jobject std_vector_string_to_jobject(JNIEnv* env, std::vector<std::string> vector) { - jobject jlist = env->NewObject(array_list_class, array_list_constructor_id); + jobject jlist = env->NewObject(arrayListClass, arrayListConstructorId); if (jlist == nullptr) { env->ExceptionDescribe(); return nullptr; } for (std::string str : vector) { - env->CallBooleanMethod(jlist, array_list_add_id, std_string_to_jstring(env, str)); + env->CallBooleanMethod(jlist, arrayListAddId, std_string_to_jstring(env, str)); if (env->ExceptionCheck()) { env->ExceptionDescribe(); return nullptr; @@ -176,302 +176,302 @@ namespace { using namespace mbgl::android; -jlong JNICALL nativeCreate(JNIEnv* env, jobject obj, jstring cache_path_, jstring data_path_, jstring apk_path_) { +jlong JNICALL nativeCreate(JNIEnv* env, jobject obj, jstring cachePath_, jstring dataPath_, jstring apkPath_) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeCreate"); - cache_path = std_string_from_jstring(env, cache_path_); - data_path = std_string_from_jstring(env, data_path_); - apk_path = std_string_from_jstring(env, apk_path_); - NativeMapView* native_map_view = nullptr; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view = new NativeMapView(env, obj))); - if (native_map_view == nullptr) { + cachePath = std_string_from_jstring(env, cachePath_); + dataPath = std_string_from_jstring(env, dataPath_); + apkPath = std_string_from_jstring(env, apkPath_); + NativeMapView* nativeMapView = nullptr; + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView = new NativeMapView(env, obj))); + if (nativeMapView == nullptr) { throw_error(env, "Unable to create NativeMapView."); return 0; } - jlong map_view_ptr = reinterpret_cast<jlong>(native_map_view); - return map_view_ptr; + jlong mapViewPtr = reinterpret_cast<jlong>(nativeMapView); + return mapViewPtr; } -void JNICALL nativeDestroy(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeDestroy(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeDestroy"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - delete native_map_view; - native_map_view = nullptr; + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + delete nativeMapView; + nativeMapView = nullptr; } -void JNICALL nativeInitializeDisplay(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeInitializeDisplay(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeInitializeDisplay"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); bool ret = false; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->initializeDisplay())); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->initializeDisplay())); if (!ret) { throw_error(env, "Unable to initialize GL display."); } } -void JNICALL nativeTerminateDisplay(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeTerminateDisplay(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeTerminateDisplay"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->terminateDisplay())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->terminateDisplay())); } -void JNICALL nativeInitializeContext(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeInitializeContext(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeInitializeContext"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); bool ret = false; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->initializeContext())); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->initializeContext())); if (!ret) { throw_error(env, "Unable to initialize GL context."); } } -void JNICALL nativeTerminateContext(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeTerminateContext(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeTerminateContext"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->terminateContext())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->terminateContext())); } -void JNICALL nativeCreateSurface(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jobject surface) { +void JNICALL nativeCreateSurface(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jobject surface) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeCreateSurface"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); bool ret = false; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->createSurface(ANativeWindow_fromSurface(env, surface)))); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->createSurface(ANativeWindow_fromSurface(env, surface)))); if (!ret) { throw_error(env, "Unable to create GL surface."); } } -void JNICALL nativeDestroySurface(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeDestroySurface(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeDestroySurface"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->destroySurface())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->destroySurface())); } -void JNICALL nativeStart(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeStart(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeStart"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->start())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->start())); } -void JNICALL nativeStop(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeStop(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeStop"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->stop())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->stop())); } -void JNICALL nativePause(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativePause(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativePause"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->pause())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->pause())); } -void JNICALL nativeResume(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeResume(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeResume"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->resume())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->resume())); } -void JNICALL nativeRun(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeRun(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeRun"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().run())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().run())); } -void JNICALL nativeRerender(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeRerender(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeRerender"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().rerender())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().rerender())); } -void JNICALL nativeUpdate(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeUpdate(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeUpdate"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().update())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().update())); } -void JNICALL nativeCleanup(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeCleanup(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeCleanup"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().cleanup())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().cleanup())); } -void JNICALL nativeTerminate(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeTerminate(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeTerminate"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().terminate())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().terminate())); } -jboolean JNICALL nativeNeedsSwap(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jboolean JNICALL nativeNeedsSwap(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeNeedsSwap"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jboolean ret = false; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->getMap().needsSwap())); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->getMap().needsSwap())); return ret; } -void JNICALL nativeSwapped(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeSwapped(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSwapped"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, (native_map_view->getMap().swapped()))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, (nativeMapView->getMap().swapped()))); } -void JNICALL nativeResize(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jint width, jint height, jfloat ratio) { +void JNICALL nativeResize(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jint width, jint height, jfloat ratio) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeResize"); - assert(native_map_view_ptr != 0); + assert(nativeMapViewPtr != 0); assert(width >= 0); assert(height >= 0); assert(width <= UINT16_MAX); assert(height <= UINT16_MAX); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().resize(width, height, ratio))); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().resize(width, height, ratio))); } -void JNICALL nativeResize(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jint width, jint height, jfloat ratio, jint fb_width, jint fb_height) { +void JNICALL nativeResize(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jint width, jint height, jfloat ratio, jint fbWidth, jint fbHeight) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeResize"); - assert(native_map_view_ptr != 0); + assert(nativeMapViewPtr != 0); assert(width >= 0); assert(height >= 0); assert(width <= UINT16_MAX); assert(height <= UINT16_MAX); - assert(fb_width >= 0); - assert(fb_height >= 0); - assert(fb_width <= UINT16_MAX); - assert(fb_height <= UINT16_MAX); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().resize(width, height, ratio, fb_width, fb_height))); + assert(fbWidth >= 0); + assert(fbHeight >= 0); + assert(fbWidth <= UINT16_MAX); + assert(fbHeight <= UINT16_MAX); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().resize(width, height, ratio, fbWidth, fbHeight))); } -void JNICALL nativeSetAppliedClasses(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jobject classes) { +void JNICALL nativeSetAppliedClasses(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jobject classes) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetAppliedClasses"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setAppliedClasses(std_vector_string_from_jobject(env, classes)))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setAppliedClasses(std_vector_string_from_jobject(env, classes)))); } -jobject JNICALL nativeGetAppliedClasses(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jobject JNICALL nativeGetAppliedClasses(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetAppliedClasses"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jobject ret = nullptr; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = std_vector_string_to_jobject(env, native_map_view->getMap().getAppliedClasses()))); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = std_vector_string_to_jobject(env, nativeMapView->getMap().getAppliedClasses()))); return ret; } -void JNICALL nativeSetDefaultTransitionDuration(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jlong duration_milliseconds) { +void JNICALL nativeSetDefaultTransitionDuration(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jlong milliseconds) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetDefaultTransitionDuration"); - assert(native_map_view_ptr != 0); - assert(duration_milliseconds >= 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setDefaultTransitionDuration(duration_milliseconds))); + assert(nativeMapViewPtr != 0); + assert(milliseconds >= 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setDefaultTransitionDuration(milliseconds))); } -jlong JNICALL nativeGetDefaultTransitionDuration(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jlong JNICALL nativeGetDefaultTransitionDuration(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetDefaultTransitionDuration"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jlong ret = 0; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->getMap().getDefaultTransitionDuration())); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->getMap().getDefaultTransitionDuration())); return ret; } -void JNICALL nativeSetStyleURL(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jstring url) { +void JNICALL nativeSetStyleURL(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jstring url) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetStyleURL"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setStyleURL(std_string_from_jstring(env, url)))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setStyleURL(std_string_from_jstring(env, url)))); } -void JNICALL nativeSetStyleJSON(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jstring new_style_json, jstring base) { +void JNICALL nativeSetStyleJSON(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jstring newStyleJson, jstring base) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetStyleJSON"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setStyleJSON(std_string_from_jstring(env, new_style_json), std_string_from_jstring(env, base)))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setStyleJSON(std_string_from_jstring(env, newStyleJson), std_string_from_jstring(env, base)))); } -jstring JNICALL nativeGetStyleJSON(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jstring JNICALL nativeGetStyleJSON(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetStyleJSON"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jstring ret = nullptr; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = std_string_to_jstring(env, native_map_view->getMap().getStyleJSON()))); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = std_string_to_jstring(env, nativeMapView->getMap().getStyleJSON()))); return ret; } -void JNICALL nativeSetAccessToken(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jstring access_token) { +void JNICALL nativeSetAccessToken(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jstring accessToken) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetAccessToken"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setAccessToken(std_string_from_jstring(env, access_token)))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setAccessToken(std_string_from_jstring(env, accessToken)))); } -jstring JNICALL nativeGetAccessToken(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jstring JNICALL nativeGetAccessToken(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetAccessToken"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jstring ret = nullptr; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = std_string_to_jstring(env, native_map_view->getMap().getAccessToken()))); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = std_string_to_jstring(env, nativeMapView->getMap().getAccessToken()))); return ret; } -void JNICALL nativeCancelTransitions(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeCancelTransitions(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeCancelTransitions"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().cancelTransitions())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().cancelTransitions())); } -void JNICALL nativeMoveBy(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jdouble dx, jdouble dy, jdouble duration) { +void JNICALL nativeMoveBy(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jdouble dx, jdouble dy, jdouble duration) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeMoveBy"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().moveBy(dx, dy, duration))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().moveBy(dx, dy, duration))); } -void JNICALL nativeSetLonLat(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jobject lon_lat, jdouble duration) { +void JNICALL nativeSetLonLat(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jobject lonLat, jdouble duration) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetLonLat"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); - double lon = env->GetDoubleField(lon_lat, lon_lat_lon_id); + double lon = env->GetDoubleField(lonLat, lonLatLonId); if (env->ExceptionCheck()) { env->ExceptionDescribe(); return; } - double lat = env->GetDoubleField(lon_lat, lon_lat_lat_id); + double lat = env->GetDoubleField(lonLat, lonLatLatId); if (env->ExceptionCheck()) { env->ExceptionDescribe(); return; } - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setLonLat(lon, lat, duration))); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setLonLat(lon, lat, duration))); } -jobject JNICALL nativeGetLonLat(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jobject JNICALL nativeGetLonLat(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetLonLat"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); double lon = 0.0, lat = 0.0; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().getLonLat(lon, lat))); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().getLonLat(lon, lat))); - jobject ret = env->NewObject(lon_lat_class, lon_lat_constructor_id, lon, lat); + jobject ret = env->NewObject(lonLatClass, lonLatConstructorId, lon, lat); if (ret == nullptr) { env->ExceptionDescribe(); return nullptr; @@ -480,100 +480,100 @@ jobject JNICALL nativeGetLonLat(JNIEnv* env, jobject obj, jlong native_map_view_ return ret; } -void JNICALL nativeStartPanning(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeStartPanning(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeStartPanning"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().startPanning())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().startPanning())); } -void JNICALL nativeStopPanning(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeStopPanning(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeStopPanning"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().stopPanning())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().stopPanning())); } -void JNICALL nativeResetPosition(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeResetPosition(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeResetPosition"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().resetPosition())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().resetPosition())); } -void JNICALL nativeScaleBy(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jdouble ds, jdouble cx, jdouble cy, jdouble duration) { +void JNICALL nativeScaleBy(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jdouble ds, jdouble cx, jdouble cy, jdouble duration) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeScaleBy"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().scaleBy(ds, cx, cy, duration))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().scaleBy(ds, cx, cy, duration))); } -void JNICALL nativeSetScale(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jdouble scale, jdouble cx, jdouble cy, jdouble duration) { +void JNICALL nativeSetScale(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jdouble scale, jdouble cx, jdouble cy, jdouble duration) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetScale"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setScale(scale, cx, cy, duration))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setScale(scale, cx, cy, duration))); } -jdouble JNICALL nativeGetScale(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jdouble JNICALL nativeGetScale(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetScale"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jdouble ret = 0.0; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->getMap().getScale())); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->getMap().getScale())); return ret; } -void JNICALL nativeSetZoom(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jdouble zoom, jdouble duration) { +void JNICALL nativeSetZoom(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jdouble zoom, jdouble duration) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetZoom"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setZoom(zoom, duration))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setZoom(zoom, duration))); } -jdouble JNICALL nativeGetZoom(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jdouble JNICALL nativeGetZoom(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetZoom"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jdouble ret = 0.0; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->getMap().getZoom())); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->getMap().getZoom())); return ret; } -void JNICALL nativeSetLonLatZoom(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jobject lon_lat_zoom, jdouble duration) { +void JNICALL nativeSetLonLatZoom(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jobject lonLatZoom, jdouble duration) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetLonLatZoom"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); - double lon = env->GetDoubleField(lon_lat_zoom, lon_lat_zoom_lon_id); + double lon = env->GetDoubleField(lonLatZoom, lonLatZoomLonId); if (env->ExceptionCheck()) { env->ExceptionDescribe(); return; } - double lat = env->GetDoubleField(lon_lat_zoom, lon_lat_zoom_lat_id); + double lat = env->GetDoubleField(lonLatZoom, lonLatZoomLatId); if (env->ExceptionCheck()) { env->ExceptionDescribe(); return; } - double zoom = env->GetDoubleField(lon_lat_zoom, lon_lat_zoom_zoom_id); + double zoom = env->GetDoubleField(lonLatZoom, lonLatZoomZoomId); if (env->ExceptionCheck()) { env->ExceptionDescribe(); return; } - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setLonLatZoom(lon, lat, zoom, duration))); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setLonLatZoom(lon, lat, zoom, duration))); } -jobject JNICALL nativeGetLonLatZoom(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jobject JNICALL nativeGetLonLatZoom(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetLonLatZoom"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); double lon = 0.0, lat = 0.0, zoom = 0.0; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().getLonLatZoom(lon, lat, zoom))); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().getLonLatZoom(lon, lat, zoom))); - jobject ret = env->NewObject(lon_lat_zoom_class, lon_lat_zoom_constructor_id, lon, lat, zoom); + jobject ret = env->NewObject(lonLatZoomClass, lonLatZoomConstructorId, lon, lat, zoom); if (ret == nullptr) { env->ExceptionDescribe(); return nullptr; @@ -582,124 +582,124 @@ jobject JNICALL nativeGetLonLatZoom(JNIEnv* env, jobject obj, jlong native_map_v return ret; } -void JNICALL nativeResetZoom(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeResetZoom(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeResetZoom"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().resetZoom())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().resetZoom())); } -void JNICALL nativeStartScaling(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeStartScaling(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeStartScaling"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().startScaling())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().startScaling())); } -void JNICALL nativeStopScaling(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeStopScaling(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeStopScaling"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().stopScaling())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().stopScaling())); } -jdouble JNICALL nativeGetMinZoom(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jdouble JNICALL nativeGetMinZoom(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetMinZoom"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jdouble ret = 0.0; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->getMap().getMinZoom())); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->getMap().getMinZoom())); return ret; } -jdouble JNICALL nativeGetMaxZoom(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jdouble JNICALL nativeGetMaxZoom(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetMaxZoom"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jdouble ret = 0.0; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->getMap().getMaxZoom())); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->getMap().getMaxZoom())); return ret; } -void JNICALL nativeRotateBy(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jdouble sx, jdouble sy, jdouble ex, jdouble ey, jdouble duration) { +void JNICALL nativeRotateBy(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jdouble sx, jdouble sy, jdouble ex, jdouble ey, jdouble duration) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeRotateBy"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().rotateBy(sx, sy, ex, ey, duration))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().rotateBy(sx, sy, ex, ey, duration))); } -void JNICALL nativeSetBearing(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jdouble degrees, jdouble duration) { +void JNICALL nativeSetBearing(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jdouble degrees, jdouble duration) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetBearing"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setBearing(degrees, duration))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setBearing(degrees, duration))); } -void JNICALL nativeSetBearing(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jdouble degrees, jdouble cx, jdouble cy) { +void JNICALL nativeSetBearing(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jdouble degrees, jdouble cx, jdouble cy) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetBearing"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setBearing(degrees, cx, cy))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setBearing(degrees, cx, cy))); } -jdouble JNICALL nativeGetBearing(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jdouble JNICALL nativeGetBearing(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetBearing"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jdouble ret = 0.0; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->getMap().getBearing())); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->getMap().getBearing())); return ret; } -void JNICALL nativeResetNorth(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeResetNorth(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeResetNorth"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().resetNorth())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().resetNorth())); } -void JNICALL nativeStartRotating(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeStartRotating(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeStartRotating"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().startRotating())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().startRotating())); } -void JNICALL nativeStopRotating(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeStopRotating(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeStopRotating"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().stopRotating())); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().stopRotating())); } -void JNICALL nativeSetDebug(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jboolean debug) { +void JNICALL nativeSetDebug(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jboolean debug) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetDebug"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setDebug(debug); native_map_view->enableFps(debug))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setDebug(debug); nativeMapView->enableFps(debug))); } -void JNICALL nativeToggleDebug(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +void JNICALL nativeToggleDebug(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeToggleDebug"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().toggleDebug(); native_map_view->enableFps(native_map_view->getMap().getDebug()))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().toggleDebug(); nativeMapView->enableFps(nativeMapView->getMap().getDebug()))); } -jboolean JNICALL nativeGetDebug(JNIEnv* env, jobject obj, jlong native_map_view_ptr) { +jboolean JNICALL nativeGetDebug(JNIEnv* env, jobject obj, jlong nativeMapViewPtr) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeGetDebug"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); jboolean ret = false; - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = native_map_view->getMap().getDebug())); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, ret = nativeMapView->getMap().getDebug())); return ret; } -void JNICALL nativeSetReachability(JNIEnv* env, jobject obj, jlong native_map_view_ptr, jboolean status) { +void JNICALL nativeSetReachability(JNIEnv* env, jobject obj, jlong nativeMapViewPtr, jboolean status) { mbgl::Log::Debug(mbgl::Event::JNI, "nativeSetReachability"); - assert(native_map_view_ptr != 0); - NativeMapView* native_map_view = reinterpret_cast<NativeMapView*>(native_map_view_ptr); - COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, native_map_view->getMap().setReachability(status))); + assert(nativeMapViewPtr != 0); + NativeMapView* nativeMapView = reinterpret_cast<NativeMapView*>(nativeMapViewPtr); + COFFEE_TRY_JNI(env, CPP_TRY_JNI(env, nativeMapView->getMap().setReachability(status))); } } @@ -718,116 +718,116 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { return JNI_ERR; } - lon_lat_class = env->FindClass("com/mapbox/mapboxgl/lib/LonLat"); - if (lon_lat_class == nullptr) { + lonLatClass = env->FindClass("com/mapbox/mapboxgl/lib/LonLat"); + if (lonLatClass == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lon_lat_constructor_id = env->GetMethodID(lon_lat_class, "<init>", "(DD)V"); - if (lon_lat_constructor_id == nullptr) { + lonLatConstructorId = env->GetMethodID(lonLatClass, "<init>", "(DD)V"); + if (lonLatConstructorId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lon_lat_lon_id = env->GetFieldID(lon_lat_class, "lon", "D"); - if (lon_lat_lon_id == nullptr) { + lonLatLonId = env->GetFieldID(lonLatClass, "lon", "D"); + if (lonLatLonId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lon_lat_lat_id = env->GetFieldID(lon_lat_class, "lat", "D"); - if (lon_lat_lat_id == nullptr) { + lonLatLatId = env->GetFieldID(lonLatClass, "lat", "D"); + if (lonLatLatId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lon_lat_zoom_class = env->FindClass("com/mapbox/mapboxgl/lib/LonLatZoom"); - if (lon_lat_class == nullptr) { + lonLatZoomClass = env->FindClass("com/mapbox/mapboxgl/lib/LonLatZoom"); + if (lonLatClass == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lon_lat_zoom_constructor_id = env->GetMethodID(lon_lat_zoom_class, "<init>", "(DDD)V"); - if (lon_lat_zoom_constructor_id == nullptr) { + lonLatZoomConstructorId = env->GetMethodID(lonLatZoomClass, "<init>", "(DDD)V"); + if (lonLatZoomConstructorId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lon_lat_zoom_lon_id = env->GetFieldID(lon_lat_zoom_class, "lon", "D"); - if (lon_lat_zoom_lon_id == nullptr) { + lonLatZoomLonId = env->GetFieldID(lonLatZoomClass, "lon", "D"); + if (lonLatZoomLonId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lon_lat_zoom_lat_id = env->GetFieldID(lon_lat_zoom_class, "lat", "D"); - if (lon_lat_zoom_lat_id == nullptr) { + lonLatZoomLatId = env->GetFieldID(lonLatZoomClass, "lat", "D"); + if (lonLatZoomLatId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lon_lat_zoom_zoom_id = env->GetFieldID(lon_lat_zoom_class, "zoom", "D"); - if (lon_lat_zoom_zoom_id == nullptr) { + lonLatZoomZoomId = env->GetFieldID(lonLatZoomClass, "zoom", "D"); + if (lonLatZoomZoomId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - jclass native_map_view_class = env->FindClass("com/mapbox/mapboxgl/lib/NativeMapView"); - if (native_map_view_class == nullptr) { + jclass nativeMapViewClass = env->FindClass("com/mapbox/mapboxgl/lib/NativeMapView"); + if (nativeMapViewClass == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - on_map_changed_id = env->GetMethodID(native_map_view_class, "onMapChanged", "()V"); - if (on_map_changed_id == nullptr) { + onMapChangedId = env->GetMethodID(nativeMapViewClass, "onMapChanged", "()V"); + if (onMapChangedId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - on_fps_changed_id = env->GetMethodID(native_map_view_class, "onFpsChanged", "(D)V"); - if (on_fps_changed_id == nullptr) { + onFpsChangedId = env->GetMethodID(nativeMapViewClass, "onFpsChanged", "(D)V"); + if (onFpsChangedId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - runtime_exception_class = env->FindClass("java/lang/RuntimeException"); - if (runtime_exception_class == nullptr) { + runtimeExceptionClass = env->FindClass("java/lang/RuntimeException"); + if (runtimeExceptionClass == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - null_pointer_exception_class = env->FindClass("java/lang/NullPointerException"); - if (null_pointer_exception_class == nullptr) { + nullPointerExceptionClass = env->FindClass("java/lang/NullPointerException"); + if (nullPointerExceptionClass == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - jclass list_class = env->FindClass("java/util/List"); - if (list_class == nullptr) { + jclass listClass = env->FindClass("java/util/List"); + if (listClass == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - list_to_array_id = env->GetMethodID(list_class, "toArray", "()[Ljava/lang/Object;"); - if (list_to_array_id == nullptr) { + listToArrayId = env->GetMethodID(listClass, "toArray", "()[Ljava/lang/Object;"); + if (listToArrayId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - array_list_class = env->FindClass("java/util/ArrayList"); - if (array_list_class == nullptr) { + arrayListClass = env->FindClass("java/util/ArrayList"); + if (arrayListClass == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - array_list_constructor_id = env->GetMethodID(array_list_class, "<init>", "()V"); - if (array_list_constructor_id == nullptr) { + arrayListConstructorId = env->GetMethodID(arrayListClass, "<init>", "()V"); + if (arrayListConstructorId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - array_list_add_id = env->GetMethodID(array_list_class, "add", "(Ljava/lang/Object;)Z"); - if (array_list_add_id == nullptr) { + arrayListAddId = env->GetMethodID(arrayListClass, "add", "(Ljava/lang/Object;)Z"); + if (arrayListAddId == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } @@ -896,48 +896,48 @@ extern "C" JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *reserved) { { "nativeSetReachability", "(JZ)V", reinterpret_cast<void*>(&nativeSetReachability) } }}; - if (env->RegisterNatives(native_map_view_class, methods.data(), methods.size()) < 0) { + if (env->RegisterNatives(nativeMapViewClass, methods.data(), methods.size()) < 0) { env->ExceptionDescribe(); return JNI_ERR; } - lon_lat_class = reinterpret_cast<jclass>(env->NewGlobalRef(lon_lat_class)); - if (lon_lat_class == nullptr) { + lonLatClass = reinterpret_cast<jclass>(env->NewGlobalRef(lonLatClass)); + if (lonLatClass == nullptr) { env->ExceptionDescribe(); return JNI_ERR; } - lon_lat_zoom_class = reinterpret_cast<jclass>(env->NewGlobalRef(lon_lat_zoom_class)); - if (lon_lat_zoom_class == nullptr) { + lonLatZoomClass = reinterpret_cast<jclass>(env->NewGlobalRef(lonLatZoomClass)); + if (lonLatZoomClass == nullptr) { env->ExceptionDescribe(); - env->DeleteGlobalRef(lon_lat_class); + env->DeleteGlobalRef(lonLatClass); return JNI_ERR; } - runtime_exception_class = reinterpret_cast<jclass>(env->NewGlobalRef(runtime_exception_class)); - if (runtime_exception_class == nullptr) { + runtimeExceptionClass = reinterpret_cast<jclass>(env->NewGlobalRef(runtimeExceptionClass)); + if (runtimeExceptionClass == nullptr) { env->ExceptionDescribe(); - env->DeleteGlobalRef(lon_lat_class); - env->DeleteGlobalRef(lon_lat_zoom_class); + env->DeleteGlobalRef(lonLatClass); + env->DeleteGlobalRef(lonLatZoomClass); return JNI_ERR; } - null_pointer_exception_class = reinterpret_cast<jclass>(env->NewGlobalRef(null_pointer_exception_class)); - if (runtime_exception_class == nullptr) { + nullPointerExceptionClass = reinterpret_cast<jclass>(env->NewGlobalRef(nullPointerExceptionClass)); + if (nullPointerExceptionClass == nullptr) { env->ExceptionDescribe(); - env->DeleteGlobalRef(lon_lat_class); - env->DeleteGlobalRef(lon_lat_zoom_class); - env->DeleteGlobalRef(runtime_exception_class); + env->DeleteGlobalRef(lonLatClass); + env->DeleteGlobalRef(lonLatZoomClass); + env->DeleteGlobalRef(runtimeExceptionClass); return JNI_ERR; } - array_list_class = reinterpret_cast<jclass>(env->NewGlobalRef(array_list_class)); - if (array_list_class == nullptr) { + arrayListClass = reinterpret_cast<jclass>(env->NewGlobalRef(arrayListClass)); + if (arrayListClass == nullptr) { env->ExceptionDescribe(); - env->DeleteGlobalRef(lon_lat_class); - env->DeleteGlobalRef(lon_lat_zoom_class); - env->DeleteGlobalRef(runtime_exception_class); - env->DeleteGlobalRef(null_pointer_exception_class); + env->DeleteGlobalRef(lonLatClass); + env->DeleteGlobalRef(lonLatZoomClass); + env->DeleteGlobalRef(runtimeExceptionClass); + env->DeleteGlobalRef(nullPointerExceptionClass); return JNI_ERR; } @@ -954,34 +954,34 @@ extern "C" JNIEXPORT void JNICALL JNI_OnUnload(JavaVM *vm, void *reserved) { return; } - env->DeleteGlobalRef(lon_lat_class); - lon_lat_class = nullptr; - lon_lat_constructor_id = nullptr; - lon_lat_lon_id = nullptr; - lon_lat_lat_id = nullptr; + env->DeleteGlobalRef(lonLatClass); + lonLatClass = nullptr; + lonLatConstructorId = nullptr; + lonLatLonId = nullptr; + lonLatLatId = nullptr; - env->DeleteGlobalRef(lon_lat_zoom_class); - lon_lat_zoom_class = nullptr; - lon_lat_zoom_constructor_id = nullptr; - lon_lat_zoom_lon_id = nullptr; - lon_lat_zoom_lat_id = nullptr; - lon_lat_zoom_zoom_id = nullptr; + env->DeleteGlobalRef(lonLatZoomClass); + lonLatZoomClass = nullptr; + lonLatZoomConstructorId = nullptr; + lonLatZoomLonId = nullptr; + lonLatZoomLatId = nullptr; + lonLatZoomZoomId = nullptr; - on_map_changed_id = nullptr; - on_fps_changed_id = nullptr; + onMapChangedId = nullptr; + onFpsChangedId = nullptr; - env->DeleteGlobalRef(runtime_exception_class); - runtime_exception_class = nullptr; + env->DeleteGlobalRef(runtimeExceptionClass); + runtimeExceptionClass = nullptr; - env->DeleteGlobalRef(null_pointer_exception_class); - null_pointer_exception_class = nullptr; + env->DeleteGlobalRef(nullPointerExceptionClass); + nullPointerExceptionClass = nullptr; - list_to_array_id = nullptr; + listToArrayId = nullptr; - env->DeleteGlobalRef(array_list_class); - array_list_class = nullptr; - array_list_constructor_id = nullptr; - array_list_add_id = nullptr; + env->DeleteGlobalRef(arrayListClass); + arrayListClass = nullptr; + arrayListConstructorId = nullptr; + arrayListAddId = nullptr; } } diff --git a/android/cpp/native_map_view.cpp b/android/cpp/native_map_view.cpp index 58e11b425c..1e387e0fa0 100644 --- a/android/cpp/native_map_view.cpp +++ b/android/cpp/native_map_view.cpp @@ -161,13 +161,13 @@ bool NativeMapView::initializeDisplay() { // Detect if we are in emulator char prop[PROP_VALUE_MAX]; __system_property_get("ro.kernel.qemu", prop); - bool in_emulator = strtol(prop, nullptr, 0) == 1; - if (in_emulator) { + bool inEmulator = strtol(prop, nullptr, 0) == 1; + if (inEmulator) { mbgl::Log::Warning(mbgl::Event::Android, "In emulator! Enabling hacks :-("); } // Get all configs at least RGB 565 with 16 depth and 8 stencil - EGLint config_attribs[] = { + EGLint configAttribs[] = { EGL_CONFIG_CAVEAT, EGL_NONE, EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_SURFACE_TYPE, EGL_WINDOW_BIT, @@ -177,30 +177,30 @@ bool NativeMapView::initializeDisplay() { EGL_BLUE_SIZE, 5, EGL_DEPTH_SIZE, 16, EGL_STENCIL_SIZE, 8, - (in_emulator ? EGL_NONE : EGL_CONFORMANT), EGL_OPENGL_ES2_BIT, // Ugly hack - (in_emulator ? EGL_NONE : EGL_COLOR_BUFFER_TYPE), EGL_RGB_BUFFER, // Ugly hack + (inEmulator ? EGL_NONE : EGL_CONFORMANT), EGL_OPENGL_ES2_BIT, // Ugly hack + (inEmulator ? EGL_NONE : EGL_COLOR_BUFFER_TYPE), EGL_RGB_BUFFER, // Ugly hack EGL_NONE }; - EGLint num_configs; - if (!eglChooseConfig(display, config_attribs, nullptr, 0, &num_configs)) { + EGLint numConfigs; + if (!eglChooseConfig(display, configAttribs, nullptr, 0, &numConfigs)) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglChooseConfig(NULL) returned error %d", eglGetError()); terminateDisplay(); return false; } - if (num_configs < 1) { + if (numConfigs < 1) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglChooseConfig() returned no configs."); terminateDisplay(); return false; } - const std::unique_ptr<EGLConfig[]> configs = mbgl::util::make_unique<EGLConfig[]>(num_configs); - if (!eglChooseConfig(display, config_attribs, configs.get(), num_configs, &num_configs)) { + const std::unique_ptr<EGLConfig[]> configs = mbgl::util::make_unique<EGLConfig[]>(numConfigs); + if (!eglChooseConfig(display, configAttribs, configs.get(), numConfigs, &numConfigs)) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglChooseConfig() returned error %d", eglGetError()); terminateDisplay(); return false; } - config = chooseConfig(configs.get(), num_configs); + config = chooseConfig(configs.get(), numConfigs); if (config == nullptr) { mbgl::Log::Error(mbgl::Event::OpenGL, "No config chosen"); terminateDisplay(); @@ -251,11 +251,11 @@ bool NativeMapView::initializeContext() { assert(context == EGL_NO_CONTEXT); assert(config != nullptr); - const EGLint context_attribs[] = { + const EGLint contextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE }; - context = eglCreateContext(display, config, EGL_NO_CONTEXT, context_attribs); + context = eglCreateContext(display, config, EGL_NO_CONTEXT, contextAttribs); if (context == EGL_NO_CONTEXT) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglCreateContext() returned error %d", eglGetError()); terminateContext(); @@ -267,8 +267,8 @@ bool NativeMapView::initializeContext() { void NativeMapView::terminateContext() { mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::terminateContext"); - if (display != EGL_NO_DISPLAY) { + if (!eglMakeCurrent(display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT)) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglMakeCurrent(EGL_NO_CONTEXT) returned error %d", eglGetError()); @@ -298,18 +298,18 @@ bool NativeMapView::createSurface(ANativeWindow* window_) { ANativeWindow_setBuffersGeometry(window, 0, 0, format); - const EGLint surface_attribs[] = { + const EGLint surfaceAttribs[] = { EGL_NONE }; - surface = eglCreateWindowSurface(display, config, window, surface_attribs); + surface = eglCreateWindowSurface(display, config, window, surfaceAttribs); if (surface == EGL_NO_SURFACE) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglCreateWindowSurface() returned error %d", eglGetError()); destroySurface(); return false; } - if (!first_time) { - first_time = true; + if (!firstTime) { + firstTime = true; if (!eglMakeCurrent(display, surface, surface, context)) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglMakeCurrent() returned error %d", eglGetError()); @@ -385,15 +385,15 @@ typedef enum { // Tuple is <buffer_format, depth_stencil_format, is_not_conformant, is_caveat, config_num, config_id> typedef std::tuple<BufferFormat, DepthStencilFormat, bool, bool, int, EGLConfig> ConfigProperties; -EGLConfig NativeMapView::chooseConfig(const EGLConfig configs[], EGLint num_configs) { - mbgl::Log::Info(mbgl::Event::OpenGL, "Found %d configs", num_configs); +EGLConfig NativeMapView::chooseConfig(const EGLConfig configs[], EGLint numConfigs) { + mbgl::Log::Info(mbgl::Event::OpenGL, "Found %d configs", numConfigs); // Create a list of configs that pass our filters - std::list<ConfigProperties> config_list; - for (int i = 0; i < num_configs; i++) { + std::list<ConfigProperties> configList; + for (int i = 0; i < numConfigs; i++) { mbgl::Log::Info(mbgl::Event::OpenGL, "Config %d:", i); - EGLint caveat, conformant, bits, red, green, blue, alpha, alpha_mask, depth, stencil, sample_buffers, samples; + EGLint caveat, conformant, bits, red, green, blue, alpha, alphaMask, depth, stencil, sampleBuffers, samples; if (!eglGetConfigAttrib(display, configs[i], EGL_CONFIG_CAVEAT, &caveat)) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglGetConfigAttrib(EGL_CONFIG_CAVEAT) returned error %d", eglGetError()); @@ -430,7 +430,7 @@ EGLConfig NativeMapView::chooseConfig(const EGLConfig configs[], EGLint num_conf return nullptr; } - if (!eglGetConfigAttrib(display, configs[i], EGL_ALPHA_MASK_SIZE, &alpha_mask)) { + if (!eglGetConfigAttrib(display, configs[i], EGL_ALPHA_MASK_SIZE, &alphaMask)) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglGetConfigAttrib(EGL_ALPHA_MASK_SIZE) returned error %d", eglGetError()); return nullptr; } @@ -445,7 +445,7 @@ EGLConfig NativeMapView::chooseConfig(const EGLConfig configs[], EGLint num_conf return nullptr; } - if (!eglGetConfigAttrib(display, configs[i], EGL_SAMPLE_BUFFERS, &sample_buffers)) { + if (!eglGetConfigAttrib(display, configs[i], EGL_SAMPLE_BUFFERS, &sampleBuffers)) { mbgl::Log::Error(mbgl::Event::OpenGL, "eglGetConfigAttrib(EGL_SAMPLE_BUFFERS) returned error %d", eglGetError()); return nullptr; } @@ -462,76 +462,76 @@ EGLConfig NativeMapView::chooseConfig(const EGLConfig configs[], EGLint num_conf mbgl::Log::Info(mbgl::Event::OpenGL, "...Green: %d", green); mbgl::Log::Info(mbgl::Event::OpenGL, "...Blue: %d", blue); mbgl::Log::Info(mbgl::Event::OpenGL, "...Alpha: %d", alpha); - mbgl::Log::Info(mbgl::Event::OpenGL, "...Alpha mask: %d", alpha_mask); + mbgl::Log::Info(mbgl::Event::OpenGL, "...Alpha mask: %d", alphaMask); mbgl::Log::Info(mbgl::Event::OpenGL, "...Depth: %d", depth); mbgl::Log::Info(mbgl::Event::OpenGL, "...Stencil: %d", stencil); - mbgl::Log::Info(mbgl::Event::OpenGL, "...Sample buffers: %d", sample_buffers); + mbgl::Log::Info(mbgl::Event::OpenGL, "...Sample buffers: %d", sampleBuffers); mbgl::Log::Info(mbgl::Event::OpenGL, "...Samples: %d", samples); - bool config_ok = true; - config_ok &= (depth == 24) || (depth == 16); - config_ok &= stencil == 8; - config_ok &= sample_buffers == 0; - config_ok &= samples == 0; + bool configOk = true; + configOk &= (depth == 24) || (depth == 16); + configOk &= stencil == 8; + configOk &= sampleBuffers == 0; + configOk &= samples == 0; // Filter our configs first for depth, stencil and anti-aliasing - if (config_ok) { + if (configOk) { // Work out the config's buffer format - BufferFormat buffer_format; + BufferFormat bufferFormat; if ((bits == 16) && (red == 5) && (green == 6) && (blue == 5) && (alpha == 0)) { - buffer_format = Format16Bit; + bufferFormat = Format16Bit; } else if ((bits == 32) && (red == 8) && (green == 8) && (blue == 8) && (alpha == 0)) { - buffer_format = Format32BitNoAlpha; + bufferFormat = Format32BitNoAlpha; } else if ((bits == 32) && (red == 8) && (green == 8) && (blue == 8) && (alpha == 8)) { - buffer_format = Format32BitAlpha; + bufferFormat = Format32BitAlpha; } else if ((bits == 24) && (red == 8) && (green == 8) && (blue == 8) && (alpha == 0)) { - buffer_format = Format24Bit; + bufferFormat = Format24Bit; } else { - buffer_format = Unknown; + bufferFormat = Unknown; } // Work out the config's depth stencil format - DepthStencilFormat depth_stencil_format; + DepthStencilFormat depthStencilFormat; if ((depth == 16) && (stencil == 8)) { - depth_stencil_format = Format16Depth8Stencil; + depthStencilFormat = Format16Depth8Stencil; } else { - depth_stencil_format = Format24Depth8Stencil; + depthStencilFormat = Format24Depth8Stencil; } - bool is_not_conformant = (conformant & EGL_OPENGL_ES2_BIT) != EGL_OPENGL_ES2_BIT; - bool is_caveat = caveat != EGL_NONE; - EGLConfig config_id = configs[i]; + bool isNotConformant = (conformant & EGL_OPENGL_ES2_BIT) != EGL_OPENGL_ES2_BIT; + bool isCaveat = caveat != EGL_NONE; + EGLConfig configId = configs[i]; // Ignore formats we don't recognise - if (buffer_format != Unknown) + if (bufferFormat != Unknown) { - config_list.push_back(std::make_tuple(buffer_format, depth_stencil_format, is_not_conformant, is_caveat, i, config_id)); + configList.push_back(std::make_tuple(bufferFormat, depthStencilFormat, isNotConformant, isCaveat, i, configId)); } } } - if (config_list.empty()) { + if (configList.empty()) { mbgl::Log::Error(mbgl::Event::OpenGL, "Config list was empty."); } // Sort the configs to find the best one - config_list.sort(); - using_depth24 = std::get<1>(config_list.front()) == Format24Depth8Stencil; - bool is_conformant = !std::get<2>(config_list.front()); - bool is_caveat = std::get<3>(config_list.front()); - int config_num = std::get<4>(config_list.front()); - EGLConfig config_id = std::get<5>(config_list.front()); + configList.sort(); + usingDepth24 = std::get<1>(configList.front()) == Format24Depth8Stencil; + bool isConformant = !std::get<2>(configList.front()); + bool isCaveat = std::get<3>(configList.front()); + int configNum = std::get<4>(configList.front()); + EGLConfig configId = std::get<5>(configList.front()); - mbgl::Log::Info(mbgl::Event::OpenGL, "Chosen config is %d", config_num); + mbgl::Log::Info(mbgl::Event::OpenGL, "Chosen config is %d", configNum); - if (is_caveat) { + if (isCaveat) { mbgl::Log::Warning(mbgl::Event::OpenGL, "Chosen config has a caveat."); } - if (!is_conformant) { + if (!isConformant) { mbgl::Log::Warning(mbgl::Event::OpenGL, "Chosen config is not conformant."); } - return config_id; + return configId; } void NativeMapView::start() { @@ -578,13 +578,13 @@ void NativeMapView::loadExtensions() { if (extensions.find("GL_OES_packed_depth_stencil") != std::string::npos) { mbgl::Log::Info(mbgl::Event::OpenGL, "Using GL_OES_packed_depth_stencil."); - gl::is_packed_depth_stencil_supported = true; + gl::isPackedDepthStencilSupported = true; } if (extensions.find("GL_OES_depth24") != std::string::npos) { mbgl::Log::Info(mbgl::Event::OpenGL, "Using GL_OES_depth24."); - if (using_depth24) { - gl::is_depth24_supported = true; + if (usingDepth24) { + gl::isDepth24Supported = true; } else { mbgl::Log::Info(mbgl::Event::OpenGL, "Preferring 16 bit depth."); } @@ -600,11 +600,11 @@ void NativeMapView::stop() { } -void NativeMapView::pause(bool wait_for_pause) { - mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::pause %s", (wait_for_pause) ? "true" : "false"); +void NativeMapView::pause(bool waitForPause) { + mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::pause %s", (waitForPause) ? "true" : "false"); if ((display != EGL_NO_DISPLAY) && (context != EGL_NO_CONTEXT)) { - map.pause(wait_for_pause); + map.pause(waitForPause); } } @@ -651,7 +651,7 @@ void NativeMapView::notifyMapChange() { } } - env->CallVoidMethod(obj, on_map_changed_id); + env->CallVoidMethod(obj, onMapChangedId); if (env->ExceptionCheck()) { env->ExceptionDescribe(); } @@ -668,28 +668,28 @@ void NativeMapView::notifyMapChange() { void NativeMapView::enableFps(bool enable) { mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::enableFps()"); - fps_enabled = enable; + fpsEnabled = enable; } void NativeMapView::updateFps() { mbgl::Log::Debug(mbgl::Event::Android, "NativeMapView::updateFps()"); - if (!fps_enabled) { + if (!fpsEnabled) { return; } static int frames = 0; - static int64_t time_elapsed = 0LL; + static int64_t timeElapsed = 0LL; frames++; struct timespec now; clock_gettime(CLOCK_MONOTONIC, &now); - int64_t current_time = now.tv_sec*1000000000LL + now.tv_nsec; + int64_t currentTime = now.tv_sec*1000000000LL + now.tv_nsec; - if (current_time - time_elapsed >= 1) { - fps = frames / ((current_time - time_elapsed) / 1E9); + if (currentTime - timeElapsed >= 1) { + fps = frames / ((currentTime - timeElapsed) / 1E9); mbgl::Log::Debug(mbgl::Event::Render, "FPS: %4.2f", fps); - time_elapsed = current_time; + timeElapsed = currentTime; frames = 0; } @@ -704,8 +704,8 @@ void NativeMapView::updateFps() { jint ret; JNIEnv* env = nullptr; - bool detach = false; - ret = vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6); + bool detach = false; + ret = vm->GetEnv(reinterpret_cast<void**>(&env), JNI_VERSION_1_6); if (ret != JNI_OK) { if (ret != JNI_EDETACHED) { mbgl::Log::Error(mbgl::Event::JNI, "GetEnv() failed with %i", ret); @@ -720,7 +720,7 @@ void NativeMapView::updateFps() { } } - env->CallVoidMethod(obj, on_fps_changed_id, fps); + env->CallVoidMethod(obj, onFpsChangedId, fps); if (env->ExceptionCheck()) { env->ExceptionDescribe(); } diff --git a/android/java/lib/src/main/java/com/mapbox/mapboxgl/lib/NativeMapView.java b/android/java/lib/src/main/java/com/mapbox/mapboxgl/lib/NativeMapView.java index 190dee4237..a10a825d5e 100644 --- a/android/java/lib/src/main/java/com/mapbox/mapboxgl/lib/NativeMapView.java +++ b/android/java/lib/src/main/java/com/mapbox/mapboxgl/lib/NativeMapView.java @@ -187,14 +187,14 @@ class NativeMapView { return nativeGetDefaultTransitionDuration(mNativeMapViewPtr); } - public void setDefaultTransitionDuration(long durationMilliseconds) { - if (durationMilliseconds < 0) { + public void setDefaultTransitionDuration(long milliseconds) { + if (milliseconds < 0) { throw new IllegalArgumentException( "durationMilliseconds cannot be negative."); } nativeSetDefaultTransitionDuration(mNativeMapViewPtr, - durationMilliseconds); + milliseconds); } public void setStyleUrl(String url) { @@ -456,7 +456,7 @@ class NativeMapView { private native List<String> nativeGetAppliedClasses(long nativeMapViewPtr); private native void nativeSetDefaultTransitionDuration( - long nativeMapViewPtr, long durationMilliseconds); + long nativeMapViewPtr, long milliseconds); private native long nativeGetDefaultTransitionDuration(long nativeMapViewPtr); |