diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2017-01-26 18:52:44 +0100 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2017-01-27 11:44:16 +0100 |
commit | 62ea1f21858c69f6921c775ba7a3de201f0514d8 (patch) | |
tree | 7a4da88706e8a5513e1e13e993b2acc212cae3b1 /platform/android/src/style | |
parent | a662508ddde4043ece36d8ea9b424368891d892c (diff) | |
download | qtlocation-mapboxgl-62ea1f21858c69f6921c775ba7a3de201f0514d8.tar.gz |
[core] remove trailing whitespace, add trailing newlines, add space after //
Diffstat (limited to 'platform/android/src/style')
29 files changed, 98 insertions, 106 deletions
diff --git a/platform/android/src/style/android_conversion.hpp b/platform/android/src/style/android_conversion.hpp index de0ac91502..8ae694d115 100644 --- a/platform/android/src/style/android_conversion.hpp +++ b/platform/android/src/style/android_conversion.hpp @@ -45,7 +45,7 @@ inline optional<mbgl::android::Value> objectMember(const mbgl::android::Value& v template <class Fn> optional<Error> eachMember(const mbgl::android::Value&, Fn&&) { - //TODO + // TODO mbgl::Log::Warning(mbgl::Event::Android, "eachMember not implemented"); return {}; } @@ -82,7 +82,7 @@ inline optional<Value> toValue(const mbgl::android::Value& value) { } else if (value.isString()) { return { value.toString() }; } else if (value.isNumber()) { - //Need to cast to a double here as the float is otherwise considered a bool... + // Need to cast to a double here as the float is otherwise considered a bool... return { (double) value.toNumber() }; } else { return {}; diff --git a/platform/android/src/style/conversion/function.hpp b/platform/android/src/style/conversion/function.hpp index 26dd5c21fd..ed383b7b56 100644 --- a/platform/android/src/style/conversion/function.hpp +++ b/platform/android/src/style/conversion/function.hpp @@ -39,10 +39,10 @@ struct Converter<jni::jobject*, mbgl::style::Function<T>> { static jni::jmethodID* constructor = &jni::GetMethodID(env, *javaClass, "<init>", "([Lcom/mapbox/mapboxsdk/style/layers/Function$Stop;)V"); static jni::jmethodID* withBase = &jni::GetMethodID(env, *javaClass, "withBase", "(F)Lcom/mapbox/mapboxsdk/style/layers/Function;"); - //Create object + // Create object jni::jobject* jfunction = &jni::NewObject(env, *javaClass, *constructor, *toFunctionStopJavaArray(env, value.getStops())); - //Set base + // Set base jni::CallMethod<jni::jobject*>(env, jfunction, *withBase, value.getBase()); return {jfunction}; @@ -51,4 +51,4 @@ struct Converter<jni::jobject*, mbgl::style::Function<T>> { } // namespace conversion } // namespace android -} // namespace mbgl
\ No newline at end of file +} // namespace mbgl diff --git a/platform/android/src/style/conversion/geojson.hpp b/platform/android/src/style/conversion/geojson.hpp index 6bc48b3700..415d96f467 100644 --- a/platform/android/src/style/conversion/geojson.hpp +++ b/platform/android/src/style/conversion/geojson.hpp @@ -19,7 +19,7 @@ namespace conversion { template <> Result<GeoJSON> convertGeoJSON(const mbgl::android::Value& value) { - //Value should be a string wrapped in an object + // Value should be a string wrapped in an object mbgl::android::Value jsonValue = value.get("data"); if(value.isNull()) { return Error { "no json data found" }; @@ -54,4 +54,4 @@ struct Converter<GeoJSON> { } // namespace conversion } // namespace style -} // namespace mbgl
\ No newline at end of file +} // namespace mbgl diff --git a/platform/android/src/style/conversion/property_value.hpp b/platform/android/src/style/conversion/property_value.hpp index 4121192f3f..a89b93794a 100644 --- a/platform/android/src/style/conversion/property_value.hpp +++ b/platform/android/src/style/conversion/property_value.hpp @@ -16,15 +16,15 @@ struct Converter<jni::jobject*, mbgl::style::PropertyValue<T>> { Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::PropertyValue<T>& value) const { if(value.isUndefined()) { - //Return a nullptr representing a Java null value + // Return a nullptr representing a Java null value return {nullptr}; } else if (value.isConstant()) { - //Time to convert the constant value + // Time to convert the constant value Result<jni::jobject*> result = convert<jni::jobject*, T>(env, value.asConstant()); return {*result}; - //return converted; + // return converted; } else if (value.isFunction()) { - //Must be a function than + // Must be a function than return convert<jni::jobject*, mbgl::style::Function<T>>(env, value.asFunction()); } else { throw std::runtime_error("Unknown property value type"); @@ -35,4 +35,4 @@ struct Converter<jni::jobject*, mbgl::style::PropertyValue<T>> { } // namespace conversion } // namespace android -} // namespace mbgl
\ No newline at end of file +} // namespace mbgl diff --git a/platform/android/src/style/conversion/types.hpp b/platform/android/src/style/conversion/types.hpp index 1c433bb264..d9921e582e 100644 --- a/platform/android/src/style/conversion/types.hpp +++ b/platform/android/src/style/conversion/types.hpp @@ -95,4 +95,4 @@ struct Converter<jni::jobject*, mbgl::style::CirclePitchScaleType> { } // namespace conversion } // namespace android -} // namespace mbgl
\ No newline at end of file +} // namespace mbgl diff --git a/platform/android/src/style/conversion/types.hpp.ejs b/platform/android/src/style/conversion/types.hpp.ejs index d248d42b72..3cd4764015 100644 --- a/platform/android/src/style/conversion/types.hpp.ejs +++ b/platform/android/src/style/conversion/types.hpp.ejs @@ -37,4 +37,4 @@ struct Converter<jni::jobject*, mbgl::style::<%- propertyNativeType(property) %> } // namespace conversion } // namespace android -} // namespace mbgl
\ No newline at end of file +} // namespace mbgl diff --git a/platform/android/src/style/conversion/types_string_values.hpp b/platform/android/src/style/conversion/types_string_values.hpp index 9f21a2fed9..e3108fdf5b 100644 --- a/platform/android/src/style/conversion/types_string_values.hpp +++ b/platform/android/src/style/conversion/types_string_values.hpp @@ -10,7 +10,7 @@ namespace mbgl { namespace android { namespace conversion { - //visibility + // visibility inline std::string toString(mbgl::style::VisibilityType value) { switch (value) { case mbgl::style::VisibilityType::Visible: @@ -24,7 +24,7 @@ namespace conversion { } } - //line-cap + // line-cap inline std::string toString(mbgl::style::LineCapType value) { switch (value) { case mbgl::style::LineCapType::Butt: @@ -41,7 +41,7 @@ namespace conversion { } } - //line-join + // line-join inline std::string toString(mbgl::style::LineJoinType value) { switch (value) { case mbgl::style::LineJoinType::Bevel: @@ -58,7 +58,7 @@ namespace conversion { } } - //symbol-placement + // symbol-placement inline std::string toString(mbgl::style::SymbolPlacementType value) { switch (value) { case mbgl::style::SymbolPlacementType::Point: @@ -72,7 +72,7 @@ namespace conversion { } } - //icon-rotation-alignment + // icon-rotation-alignment inline std::string toString(mbgl::style::AlignmentType value) { switch (value) { case mbgl::style::AlignmentType::Map: @@ -89,7 +89,7 @@ namespace conversion { } } - //icon-text-fit + // icon-text-fit inline std::string toString(mbgl::style::IconTextFitType value) { switch (value) { case mbgl::style::IconTextFitType::None: @@ -109,7 +109,7 @@ namespace conversion { } } - //text-justify + // text-justify inline std::string toString(mbgl::style::TextJustifyType value) { switch (value) { case mbgl::style::TextJustifyType::Left: @@ -126,7 +126,7 @@ namespace conversion { } } - //text-anchor + // text-anchor inline std::string toString(mbgl::style::TextAnchorType value) { switch (value) { case mbgl::style::TextAnchorType::Center: @@ -161,7 +161,7 @@ namespace conversion { } } - //text-transform + // text-transform inline std::string toString(mbgl::style::TextTransformType value) { switch (value) { case mbgl::style::TextTransformType::None: @@ -178,7 +178,7 @@ namespace conversion { } } - //fill-translate-anchor + // fill-translate-anchor inline std::string toString(mbgl::style::TranslateAnchorType value) { switch (value) { case mbgl::style::TranslateAnchorType::Map: @@ -192,7 +192,7 @@ namespace conversion { } } - //circle-pitch-scale + // circle-pitch-scale inline std::string toString(mbgl::style::CirclePitchScaleType value) { switch (value) { case mbgl::style::CirclePitchScaleType::Map: @@ -209,4 +209,4 @@ namespace conversion { } // namespace conversion } // namespace android -} // namespace mbgl
\ No newline at end of file +} // namespace mbgl diff --git a/platform/android/src/style/conversion/types_string_values.hpp.ejs b/platform/android/src/style/conversion/types_string_values.hpp.ejs index c1646baa1a..bf52919741 100644 --- a/platform/android/src/style/conversion/types_string_values.hpp.ejs +++ b/platform/android/src/style/conversion/types_string_values.hpp.ejs @@ -13,7 +13,7 @@ namespace mbgl { namespace android { namespace conversion { - //visibility + // visibility inline std::string toString(mbgl::style::VisibilityType value) { switch (value) { case mbgl::style::VisibilityType::Visible: @@ -28,7 +28,7 @@ namespace conversion { } <% for (const property of properties) { -%> - //<%- property.name %> + // <%- property.name %> inline std::string toString(mbgl::style::<%- propertyNativeType(property) %> value) { switch (value) { <% for (const value in property.values) { -%> @@ -45,4 +45,4 @@ namespace conversion { } // namespace conversion } // namespace android -} // namespace mbgl
\ No newline at end of file +} // namespace mbgl diff --git a/platform/android/src/style/conversion/url_or_tileset.hpp b/platform/android/src/style/conversion/url_or_tileset.hpp index c1801f56d0..4e502324d0 100644 --- a/platform/android/src/style/conversion/url_or_tileset.hpp +++ b/platform/android/src/style/conversion/url_or_tileset.hpp @@ -35,4 +35,4 @@ struct Converter<variant<std::string, Tileset>> { } } -}
\ No newline at end of file +} diff --git a/platform/android/src/style/layers/background_layer.cpp b/platform/android/src/style/layers/background_layer.cpp index 021ac947ad..6b013ae086 100644 --- a/platform/android/src/style/layers/background_layer.cpp +++ b/platform/android/src/style/layers/background_layer.cpp @@ -47,12 +47,12 @@ namespace android { } void BackgroundLayer::registerNative(jni::JNIEnv& env) { - //Lookup the class + // Lookup the class BackgroundLayer::javaClass = *jni::Class<BackgroundLayer>::Find(env).NewGlobalRef(env).release(); #define METHOD(MethodPtr, name) jni::MakeNativePeerMethod<decltype(MethodPtr), (MethodPtr)>(name) - //Register the peer + // Register the peer jni::RegisterNativePeer<BackgroundLayer>( env, BackgroundLayer::javaClass, "nativePtr", std::make_unique<BackgroundLayer, JNIEnv&, jni::String>, diff --git a/platform/android/src/style/layers/circle_layer.cpp b/platform/android/src/style/layers/circle_layer.cpp index 4a6ba95d31..2b33a2dd47 100644 --- a/platform/android/src/style/layers/circle_layer.cpp +++ b/platform/android/src/style/layers/circle_layer.cpp @@ -89,12 +89,12 @@ namespace android { } void CircleLayer::registerNative(jni::JNIEnv& env) { - //Lookup the class + // Lookup the class CircleLayer::javaClass = *jni::Class<CircleLayer>::Find(env).NewGlobalRef(env).release(); #define METHOD(MethodPtr, name) jni::MakeNativePeerMethod<decltype(MethodPtr), (MethodPtr)>(name) - //Register the peer + // Register the peer jni::RegisterNativePeer<CircleLayer>( env, CircleLayer::javaClass, "nativePtr", std::make_unique<CircleLayer, JNIEnv&, jni::String, jni::String>, diff --git a/platform/android/src/style/layers/custom_layer.cpp b/platform/android/src/style/layers/custom_layer.cpp index d5d330a019..9bdc308d85 100644 --- a/platform/android/src/style/layers/custom_layer.cpp +++ b/platform/android/src/style/layers/custom_layer.cpp @@ -40,12 +40,12 @@ namespace android { } void CustomLayer::registerNative(jni::JNIEnv& env) { - //Lookup the class + // Lookup the class CustomLayer::javaClass = *jni::Class<CustomLayer>::Find(env).NewGlobalRef(env).release(); #define METHOD(MethodPtr, name) jni::MakeNativePeerMethod<decltype(MethodPtr), (MethodPtr)>(name) - //Register the peer + // Register the peer jni::RegisterNativePeer<CustomLayer>( env, CustomLayer::javaClass, "nativePtr", std::make_unique<CustomLayer, JNIEnv&, jni::String, jni::jlong, jni::jlong, jni::jlong, jni::jlong>, diff --git a/platform/android/src/style/layers/fill_layer.cpp b/platform/android/src/style/layers/fill_layer.cpp index 84d47b6afe..d818314f89 100644 --- a/platform/android/src/style/layers/fill_layer.cpp +++ b/platform/android/src/style/layers/fill_layer.cpp @@ -71,12 +71,12 @@ namespace android { } void FillLayer::registerNative(jni::JNIEnv& env) { - //Lookup the class + // Lookup the class FillLayer::javaClass = *jni::Class<FillLayer>::Find(env).NewGlobalRef(env).release(); #define METHOD(MethodPtr, name) jni::MakeNativePeerMethod<decltype(MethodPtr), (MethodPtr)>(name) - //Register the peer + // Register the peer jni::RegisterNativePeer<FillLayer>( env, FillLayer::javaClass, "nativePtr", std::make_unique<FillLayer, JNIEnv&, jni::String, jni::String>, diff --git a/platform/android/src/style/layers/layer.cpp b/platform/android/src/style/layers/layer.cpp index c0c57c839d..bfc09be302 100644 --- a/platform/android/src/style/layers/layer.cpp +++ b/platform/android/src/style/layers/layer.cpp @@ -5,12 +5,12 @@ #include <mbgl/util/logging.hpp> -//Java -> C++ conversion +// Java -> C++ conversion #include <mbgl/style/conversion.hpp> #include <mbgl/style/conversion/layer.hpp> #include <mbgl/style/conversion/source.hpp> -//C++ -> Java conversion +// C++ -> Java conversion #include "../conversion/property_value.hpp" #include <string> @@ -33,15 +33,15 @@ namespace android { } void Layer::addToMap(mbgl::Map& _map, mbgl::optional<std::string> before) { - //Check to see if we own the layer first + // Check to see if we own the layer first if (!ownedLayer) { throw std::runtime_error("Cannot add layer twice"); } - //Add layer to map + // Add layer to map _map.addLayer(releaseCoreLayer(), before); - //Save pointer to the map + // Save pointer to the map this->map = &_map; } @@ -65,7 +65,7 @@ namespace android { void Layer::setLayoutProperty(jni::JNIEnv& env, jni::String jname, jni::Object<> jvalue) { Value value(env, jvalue); - //Convert and set property + // Convert and set property optional<mbgl::style::conversion::Error> error = mbgl::style::conversion::setLayoutProperty(layer, jni::Make<std::string>(env, jname), value); if (error) { mbgl::Log::Error(mbgl::Event::JNI, "Error setting property: " + jni::Make<std::string>(env, jname) + " " + error->message); @@ -76,7 +76,7 @@ namespace android { void Layer::setPaintProperty(jni::JNIEnv& env, jni::String jname, jni::Object<> jvalue) { Value value(env, jvalue); - //Convert and set property + // Convert and set property optional<mbgl::style::conversion::Error> error = mbgl::style::conversion::setPaintProperty(layer, jni::Make<std::string>(env, jname), value, mbgl::optional<std::string>()); if (error) { mbgl::Log::Error(mbgl::Event::JNI, "Error setting property: " + jni::Make<std::string>(env, jname) + " " + error->message); @@ -153,12 +153,12 @@ namespace android { jni::Class<Layer> Layer::javaClass; void Layer::registerNative(jni::JNIEnv& env) { - //Lookup the class + // Lookup the class Layer::javaClass = *jni::Class<Layer>::Find(env).NewGlobalRef(env).release(); #define METHOD(MethodPtr, name) jni::MakeNativePeerMethod<decltype(MethodPtr), (MethodPtr)>(name) - //Register the peer + // Register the peer jni::RegisterNativePeer<Layer>(env, Layer::javaClass, "nativePtr", METHOD(&Layer::getId, "nativeGetId"), METHOD(&Layer::setLayoutProperty, "nativeSetLayoutProperty"), @@ -174,5 +174,5 @@ namespace android { } -} //android -} //mbgl
\ No newline at end of file +} // namespace android +} // namespace mbgl diff --git a/platform/android/src/style/layers/layer.cpp.ejs b/platform/android/src/style/layers/layer.cpp.ejs index 500c76ea7a..9a1274965b 100644 --- a/platform/android/src/style/layers/layer.cpp.ejs +++ b/platform/android/src/style/layers/layer.cpp.ejs @@ -46,12 +46,12 @@ namespace android { } void <%- camelize(type) %>Layer::registerNative(jni::JNIEnv& env) { - //Lookup the class + // Lookup the class <%- camelize(type) %>Layer::javaClass = *jni::Class<<%- camelize(type) %>Layer>::Find(env).NewGlobalRef(env).release(); #define METHOD(MethodPtr, name) jni::MakeNativePeerMethod<decltype(MethodPtr), (MethodPtr)>(name) - //Register the peer + // Register the peer jni::RegisterNativePeer<<%- camelize(type) %>Layer>( env, <%- camelize(type) %>Layer::javaClass, "nativePtr", <% if (type === 'background') { -%> diff --git a/platform/android/src/style/layers/layer.hpp b/platform/android/src/style/layers/layer.hpp index f3cd073552..bf07adad67 100644 --- a/platform/android/src/style/layers/layer.hpp +++ b/platform/android/src/style/layers/layer.hpp @@ -49,7 +49,7 @@ public: void setPaintProperty(jni::JNIEnv&, jni::String, jni::Object<> value); - //Zoom + // Zoom jni::jfloat getMinZoom(jni::JNIEnv&); @@ -65,28 +65,24 @@ public: void setSourceLayer(jni::JNIEnv& env, jni::String sourceLayer); - //Property getters + // Property getters jni::Object<jni::ObjectTag> getVisibility(jni::JNIEnv&); protected: - //Release the owned view and return it + // Release the owned view and return it std::unique_ptr<mbgl::style::Layer> releaseCoreLayer(); - //Owned layer is set when creating a new layer, before adding it to the map + // Owned layer is set when creating a new layer, before adding it to the map std::unique_ptr<mbgl::style::Layer> ownedLayer; - //Raw reference to the layer + // Raw reference to the layer mbgl::style::Layer& layer; - //Map is set when the layer is retrieved or after adding to the map + // Map is set when the layer is retrieved or after adding to the map mbgl::Map* map; }; -} //android -} //mbgl - - - - +} // namespace android +} // namespace mbgl diff --git a/platform/android/src/style/layers/layers.cpp b/platform/android/src/style/layers/layers.cpp index 57dbf6f4b1..c8e981b966 100644 --- a/platform/android/src/style/layers/layers.cpp +++ b/platform/android/src/style/layers/layers.cpp @@ -60,5 +60,5 @@ void registerNativeLayers(jni::JNIEnv& env) { CustomLayer::registerNative(env); } -} //android -} //mbgl
\ No newline at end of file +} // namespace android +} // namespace mbgl diff --git a/platform/android/src/style/layers/layers.hpp b/platform/android/src/style/layers/layers.hpp index 0c979ec2cf..111b521c26 100644 --- a/platform/android/src/style/layers/layers.hpp +++ b/platform/android/src/style/layers/layers.hpp @@ -17,4 +17,4 @@ jni::jobject* createJavaLayerPeer(jni::JNIEnv&, mbgl::Map&, mbgl::style::Layer&) void registerNativeLayers(jni::JNIEnv&); } -}
\ No newline at end of file +} diff --git a/platform/android/src/style/layers/line_layer.cpp b/platform/android/src/style/layers/line_layer.cpp index 2dce8b618a..e53e2060c8 100644 --- a/platform/android/src/style/layers/line_layer.cpp +++ b/platform/android/src/style/layers/line_layer.cpp @@ -113,12 +113,12 @@ namespace android { } void LineLayer::registerNative(jni::JNIEnv& env) { - //Lookup the class + // Lookup the class LineLayer::javaClass = *jni::Class<LineLayer>::Find(env).NewGlobalRef(env).release(); #define METHOD(MethodPtr, name) jni::MakeNativePeerMethod<decltype(MethodPtr), (MethodPtr)>(name) - //Register the peer + // Register the peer jni::RegisterNativePeer<LineLayer>( env, LineLayer::javaClass, "nativePtr", std::make_unique<LineLayer, JNIEnv&, jni::String, jni::String>, diff --git a/platform/android/src/style/layers/raster_layer.cpp b/platform/android/src/style/layers/raster_layer.cpp index 25b26155ae..69fd634bce 100644 --- a/platform/android/src/style/layers/raster_layer.cpp +++ b/platform/android/src/style/layers/raster_layer.cpp @@ -71,12 +71,12 @@ namespace android { } void RasterLayer::registerNative(jni::JNIEnv& env) { - //Lookup the class + // Lookup the class RasterLayer::javaClass = *jni::Class<RasterLayer>::Find(env).NewGlobalRef(env).release(); #define METHOD(MethodPtr, name) jni::MakeNativePeerMethod<decltype(MethodPtr), (MethodPtr)>(name) - //Register the peer + // Register the peer jni::RegisterNativePeer<RasterLayer>( env, RasterLayer::javaClass, "nativePtr", std::make_unique<RasterLayer, JNIEnv&, jni::String, jni::String>, diff --git a/platform/android/src/style/layers/symbol_layer.cpp b/platform/android/src/style/layers/symbol_layer.cpp index 9318d42d5b..14803ae278 100644 --- a/platform/android/src/style/layers/symbol_layer.cpp +++ b/platform/android/src/style/layers/symbol_layer.cpp @@ -317,12 +317,12 @@ namespace android { } void SymbolLayer::registerNative(jni::JNIEnv& env) { - //Lookup the class + // Lookup the class SymbolLayer::javaClass = *jni::Class<SymbolLayer>::Find(env).NewGlobalRef(env).release(); #define METHOD(MethodPtr, name) jni::MakeNativePeerMethod<decltype(MethodPtr), (MethodPtr)>(name) - //Register the peer + // Register the peer jni::RegisterNativePeer<SymbolLayer>( env, SymbolLayer::javaClass, "nativePtr", std::make_unique<SymbolLayer, JNIEnv&, jni::String, jni::String>, 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<>>, diff --git a/platform/android/src/style/value.cpp b/platform/android/src/style/value.cpp index c8aad1682b..0b5d81feb1 100644 --- a/platform/android/src/style/value.cpp +++ b/platform/android/src/style/value.cpp @@ -20,7 +20,7 @@ namespace android { JNIEnv& env; }; - //Instance + // Instance Value::Value(jni::JNIEnv& env, jni::jobject* _value) : jenv(env), value(_value, ObjectDeleter(env)) {} |