diff options
Diffstat (limited to 'platform/android/src/style/sources')
-rw-r--r-- | platform/android/src/style/sources/geojson_source.cpp | 10 | ||||
-rw-r--r-- | platform/android/src/style/sources/raster_source.cpp | 4 | ||||
-rw-r--r-- | platform/android/src/style/sources/source.cpp | 18 | ||||
-rw-r--r-- | platform/android/src/style/sources/source.hpp | 16 | ||||
-rw-r--r-- | platform/android/src/style/sources/sources.cpp | 2 | ||||
-rw-r--r-- | platform/android/src/style/sources/sources.hpp | 8 | ||||
-rw-r--r-- | platform/android/src/style/sources/vector_source.cpp | 4 |
7 files changed, 29 insertions, 33 deletions
diff --git a/platform/android/src/style/sources/geojson_source.cpp b/platform/android/src/style/sources/geojson_source.cpp index 234dccb315..37ce0644c1 100644 --- a/platform/android/src/style/sources/geojson_source.cpp +++ b/platform/android/src/style/sources/geojson_source.cpp @@ -27,19 +27,19 @@ namespace android { void GeoJSONSource::setGeoJSON(jni::JNIEnv& env, jni::Object<> json) { using namespace mbgl::style::conversion; - //Convert the jni object + // Convert the jni object Result<GeoJSON> converted = convert<GeoJSON>(Value(env, json)); if(!converted) { mbgl::Log::Error(mbgl::Event::JNI, "Error setting geo json: " + converted.error().message); return; } - //Update the core source + // Update the core source source.as<mbgl::style::GeoJSONSource>()->GeoJSONSource::setGeoJSON(*converted); } void GeoJSONSource::setURL(jni::JNIEnv& env, jni::String url) { - //Update the core source + // Update the core source source.as<mbgl::style::GeoJSONSource>()->GeoJSONSource::setURL(jni::Make<std::string>(env, url)); } @@ -51,12 +51,12 @@ namespace android { } void GeoJSONSource::registerNative(jni::JNIEnv& env) { - //Lookup the class + // Lookup the class GeoJSONSource::javaClass = *jni::Class<GeoJSONSource>::Find(env).NewGlobalRef(env).release(); #define METHOD(MethodPtr, name) jni::MakeNativePeerMethod<decltype(MethodPtr), (MethodPtr)>(name) - //Register the peer + // Register the peer jni::RegisterNativePeer<GeoJSONSource>( env, GeoJSONSource::javaClass, "nativePtr", std::make_unique<GeoJSONSource, JNIEnv&, jni::String, jni::Object<>>, diff --git a/platform/android/src/style/sources/raster_source.cpp b/platform/android/src/style/sources/raster_source.cpp index b56b56676d..42ac4cda99 100644 --- a/platform/android/src/style/sources/raster_source.cpp +++ b/platform/android/src/style/sources/raster_source.cpp @@ -36,12 +36,12 @@ namespace android { } void RasterSource::registerNative(jni::JNIEnv& env) { - //Lookup the class + // Lookup the class RasterSource::javaClass = *jni::Class<RasterSource>::Find(env).NewGlobalRef(env).release(); #define METHOD(MethodPtr, name) jni::MakeNativePeerMethod<decltype(MethodPtr), (MethodPtr)>(name) - //Register the peer + // Register the peer jni::RegisterNativePeer<RasterSource>( env, RasterSource::javaClass, "nativePtr", std::make_unique<RasterSource, JNIEnv&, jni::String, jni::Object<>, jni::jint>, diff --git a/platform/android/src/style/sources/source.cpp b/platform/android/src/style/sources/source.cpp index aca7bd6a84..b780de5627 100644 --- a/platform/android/src/style/sources/source.cpp +++ b/platform/android/src/style/sources/source.cpp @@ -5,11 +5,11 @@ #include <mbgl/util/logging.hpp> -//Java -> C++ conversion +// Java -> C++ conversion #include <mbgl/style/conversion.hpp> #include <mbgl/style/conversion/source.hpp> -//C++ -> Java conversion +// C++ -> Java conversion #include "../conversion/property_value.hpp" #include <string> @@ -44,15 +44,15 @@ namespace android { } void Source::addToMap(mbgl::Map& _map) { - //Check to see if we own the source first + // Check to see if we own the source first if (!ownedSource) { throw std::runtime_error("Cannot add source twice"); } - //Add source to map + // Add source to map _map.addSource(releaseCoreSource()); - //Save pointer to the map + // Save pointer to the map this->map = &_map; } @@ -64,17 +64,17 @@ namespace android { jni::Class<Source> Source::javaClass; void Source::registerNative(jni::JNIEnv& env) { - //Lookup the class + // Lookup the class Source::javaClass = *jni::Class<Source>::Find(env).NewGlobalRef(env).release(); #define METHOD(MethodPtr, name) jni::MakeNativePeerMethod<decltype(MethodPtr), (MethodPtr)>(name) - //Register the peer + // Register the peer jni::RegisterNativePeer<Source>(env, Source::javaClass, "nativePtr", METHOD(&Source::getId, "nativeGetId") ); } -} //android -} //mbgl
\ No newline at end of file +} // namespace android +} // namespace mbgl diff --git a/platform/android/src/style/sources/source.hpp b/platform/android/src/style/sources/source.hpp index 0e5d354d93..9a9d504d68 100644 --- a/platform/android/src/style/sources/source.hpp +++ b/platform/android/src/style/sources/source.hpp @@ -46,22 +46,18 @@ public: jni::String getId(jni::JNIEnv&); protected: - //Release the owned view and return it + // Release the owned view and return it std::unique_ptr<mbgl::style::Source> releaseCoreSource(); - //Set on newly created sources until added to the map + // Set on newly created sources until added to the map std::unique_ptr<mbgl::style::Source> ownedSource; - //Raw pointer that is valid until the source is removed from the map + // Raw pointer that is valid until the source is removed from the map mbgl::style::Source& source; - //Map pointer is valid for newly created sources only after adding to the map + // Map pointer is valid for newly created sources only after adding to the map mbgl::Map* map; }; -} //android -} //mbgl - - - - +} // namespace android +} // namespace mbgl diff --git a/platform/android/src/style/sources/sources.cpp b/platform/android/src/style/sources/sources.cpp index 210acd607f..cae4bb47b2 100644 --- a/platform/android/src/style/sources/sources.cpp +++ b/platform/android/src/style/sources/sources.cpp @@ -43,4 +43,4 @@ void registerNativeSources(jni::JNIEnv& env) { } } -}
\ No newline at end of file +} diff --git a/platform/android/src/style/sources/sources.hpp b/platform/android/src/style/sources/sources.hpp index 3038873733..09a8b35067 100644 --- a/platform/android/src/style/sources/sources.hpp +++ b/platform/android/src/style/sources/sources.hpp @@ -9,12 +9,12 @@ namespace mbgl { namespace android { - + mbgl::android::Source* initializeSourcePeer(mbgl::Map&, mbgl::style::Source&); - + jni::jobject* createJavaSourcePeer(jni::JNIEnv&, mbgl::Map&, mbgl::style::Source&); - + void registerNativeSources(jni::JNIEnv&); } -}
\ No newline at end of file +} diff --git a/platform/android/src/style/sources/vector_source.cpp b/platform/android/src/style/sources/vector_source.cpp index 0d065a3348..e60d8d4641 100644 --- a/platform/android/src/style/sources/vector_source.cpp +++ b/platform/android/src/style/sources/vector_source.cpp @@ -35,12 +35,12 @@ namespace android { } void VectorSource::registerNative(jni::JNIEnv& env) { - //Lookup the class + // Lookup the class VectorSource::javaClass = *jni::Class<VectorSource>::Find(env).NewGlobalRef(env).release(); #define METHOD(MethodPtr, name) jni::MakeNativePeerMethod<decltype(MethodPtr), (MethodPtr)>(name) - //Register the peer + // Register the peer jni::RegisterNativePeer<VectorSource>( env, VectorSource::javaClass, "nativePtr", std::make_unique<VectorSource, JNIEnv&, jni::String, jni::Object<>>, |