diff options
author | Tobrun <tobrun@mapbox.com> | 2017-05-26 16:04:09 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-26 16:04:09 +0200 |
commit | 5716bd3aecc777813161292e104ac9ceba3f230a (patch) | |
tree | d9a791ddbb1821e90fe7efcd1578dea0402af07a /platform/android/src/style/light.hpp.ejs | |
parent | c392c678ab4ea560cefca59d14b215e2d4c79ecb (diff) | |
download | qtlocation-mapboxgl-5716bd3aecc777813161292e104ac9ceba3f230a.tar.gz |
[android] - add binding support for Light (#9013)
Diffstat (limited to 'platform/android/src/style/light.hpp.ejs')
-rw-r--r-- | platform/android/src/style/light.hpp.ejs | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/platform/android/src/style/light.hpp.ejs b/platform/android/src/style/light.hpp.ejs new file mode 100644 index 0000000000..18f961b9e0 --- /dev/null +++ b/platform/android/src/style/light.hpp.ejs @@ -0,0 +1,59 @@ +<% + const properties = locals.properties; +-%> +// This file is generated. Edit android/platform/scripts/generate-style-code.js, then run `make android-style-code`. + +#pragma once + +#include <mbgl/util/noncopyable.hpp> + +#include <jni/jni.hpp> +#include <mbgl/style/light.hpp> +#include "transition_options.hpp" +#include "position.hpp" +#include <mbgl/style/types.hpp> +#include <mbgl/style/property_value.hpp> + +namespace mbgl { +namespace android { + +using namespace style; + +class Light : private mbgl::util::noncopyable { +public: + + static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/light/Light"; }; + + static jni::Class<Light> javaClass; + + static void registerNative(jni::JNIEnv&); + + static jni::jobject* createJavaLightPeer(jni::JNIEnv&, mbgl::Map&, mbgl::style::Light&); + + Light(mbgl::Map&, mbgl::style::Light&); + +<% for (const property of properties) { -%> +<% if (property.name=="position") {-%> + void set<%- camelize(property.name) %>(jni::JNIEnv&, jni::Object<Position>); + jni::Object<<%- camelize(property.name) %>> get<%- camelize(property.name) %>(jni::JNIEnv&); +<% } else { -%> + void set<%- camelize(property.name) %>(jni::JNIEnv&, jni::<%- propertyJNIType(property) %>); + jni::<%- propertyJNIType(property) %> get<%- camelize(property.name) %>(jni::JNIEnv&); +<% } -%> +<% if (property.transition) { -%> + void set<%- camelize(property.name) %>Transition(jni::JNIEnv&, jlong duration, jlong delay); + jni::Object<TransitionOptions> get<%- camelize(property.name) %>Transition(jni::JNIEnv&); +<% } -%> +<% } -%> + jni::jobject* createJavaPeer(jni::JNIEnv&); + +protected: + + // Raw reference to the light + mbgl::style::Light& light; + + // Map is set when the light is retrieved + mbgl::Map* map; +}; +} // namespace android +} // namespace mbgl
\ No newline at end of file |