summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuardiola31337 <pablo.guardiola@mapbox.com>2017-05-11 15:33:04 +0200
committerGuardiola31337 <pablo.guardiola@mapbox.com>2017-05-25 17:10:31 +0200
commitff65edaac1f9350f24e042370048dd53eeb0d6a0 (patch)
tree079ce71925322f483879a14e1d18ef10dfe28df4
parent7e3dac61810a8f67ece66d62aeec7b51fb7daeac (diff)
downloadqtlocation-mapboxgl-ff65edaac1f9350f24e042370048dd53eeb0d6a0.tar.gz
[android] WIP add filter converter
-rw-r--r--platform/android/src/style/conversion/filter.hpp12
-rw-r--r--platform/android/src/style/filter.cpp17
-rw-r--r--platform/android/src/style/filter.hpp24
3 files changed, 53 insertions, 0 deletions
diff --git a/platform/android/src/style/conversion/filter.hpp b/platform/android/src/style/conversion/filter.hpp
index 1f0abcf3a4..55aa7091c6 100644
--- a/platform/android/src/style/conversion/filter.hpp
+++ b/platform/android/src/style/conversion/filter.hpp
@@ -1,6 +1,8 @@
#pragma once
#include "../android_conversion.hpp"
+#include "../filter.hpp"
+#include "../../conversion/conversion.hpp"
#include <mbgl/style/conversion.hpp>
#include <mbgl/style/conversion/filter.hpp>
@@ -27,6 +29,16 @@ inline optional<mbgl::style::Filter> toFilter(jni::JNIEnv& env, jni::Array<jni::
return filter;
}
+template <>
+struct Converter<jni::Object<android::style::Filter>, mbgl::style::Filter> {
+ Result<jni::Object<android::style::Filter>> operator()(jni::JNIEnv& env, const mbgl::style::Filter& value) const {
+ using namespace mbgl::android::style;
+ auto filter = jni::Object<android::style::Filter>(*convert<jni::jobject*>(env, value));
+
+ return filter;
+ }
+};
+
} // namespace conversion
} // namespace android
} // namespace mbgl \ No newline at end of file
diff --git a/platform/android/src/style/filter.cpp b/platform/android/src/style/filter.cpp
new file mode 100644
index 0000000000..40954578f0
--- /dev/null
+++ b/platform/android/src/style/filter.cpp
@@ -0,0 +1,17 @@
+#include "filter.hpp"
+
+namespace mbgl {
+namespace android {
+namespace style {
+
+void Filter::registerNative(jni::JNIEnv& env) {
+ // Lookup the class
+ Filter::javaClass = *jni::Class<Filter>::Find(env).NewGlobalRef(env).release();
+}
+
+jni::Class<Filter> Filter::javaClass;
+
+
+} // namespace style
+} // namespace android
+} // namespace mbgl \ No newline at end of file
diff --git a/platform/android/src/style/filter.hpp b/platform/android/src/style/filter.hpp
new file mode 100644
index 0000000000..335295df51
--- /dev/null
+++ b/platform/android/src/style/filter.hpp
@@ -0,0 +1,24 @@
+#pragma once
+
+#include <mbgl/util/noncopyable.hpp>
+
+#include <jni/jni.hpp>
+
+namespace mbgl {
+namespace android {
+namespace style {
+
+class Filter : private mbgl::util::noncopyable {
+public:
+
+ static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/layers/Filter"; };
+
+ static jni::Class<Filter> javaClass;
+
+ static void registerNative(jni::JNIEnv&);
+
+};
+
+} // namespace style
+} // namespace android
+} // namespace mbgl \ No newline at end of file