diff options
author | Ivo van Dongen <info@ivovandongen.nl> | 2016-07-26 17:02:52 -0400 |
---|---|---|
committer | Ivo van Dongen <info@ivovandongen.nl> | 2016-08-02 16:58:03 -0400 |
commit | 10b2cc60a7b274f71b46976b1e9e89031b9e44ca (patch) | |
tree | 8f3cccee03e5a4205c4754f7eb723ec73d19c8b5 /platform/android/src/style/conversion/types.hpp.ejs | |
parent | ed821c06d96e414b43db6fd1505389803cb022d4 (diff) | |
download | qtlocation-mapboxgl-10b2cc60a7b274f71b46976b1e9e89031b9e44ca.tar.gz |
[android] #5610 - Runtime style api - part 2
Diffstat (limited to 'platform/android/src/style/conversion/types.hpp.ejs')
-rw-r--r-- | platform/android/src/style/conversion/types.hpp.ejs | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/platform/android/src/style/conversion/types.hpp.ejs b/platform/android/src/style/conversion/types.hpp.ejs new file mode 100644 index 0000000000..de26d061f7 --- /dev/null +++ b/platform/android/src/style/conversion/types.hpp.ejs @@ -0,0 +1,40 @@ +<% + const properties = locals.properties; +-%> +// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make style-code-android`. +#pragma once + +#include "types_string_values.hpp" +#include "../../conversion/conversion.hpp" +#include "../../conversion/constant.hpp" + +#include <mbgl/style/types.hpp> +#include <mbgl/util/optional.hpp> +#include <jni/jni.hpp> + +#include <string> + +namespace mbgl { +namespace android { +namespace conversion { + +template <> +struct Converter<jni::jobject*, mbgl::style::VisibilityType> { + Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::VisibilityType& value) const { + return convert<jni::jobject*, std::string>(env, toString(value)); + } +}; + +<% for (const property of properties) { -%> +template <> +struct Converter<jni::jobject*, mbgl::style::<%- propertyNativeType(property) %>> { + Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::<%- propertyNativeType(property) %>& value) const { + return convert<jni::jobject*, std::string>(env, toString(value)); + } +}; + +<% } -%> + +} // namespace conversion +} // namespace android +} // namespace mbgl
\ No newline at end of file |