53 lines
1.6 KiB
Plaintext
53 lines
1.6 KiB
Plaintext
<%
|
|
const type = locals.type;
|
|
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 "layer.hpp"
|
|
#include "../transition_options.hpp"
|
|
#include <mbgl/style/layers/<%- type.replace('-', '_') %>_layer.hpp>
|
|
#include <jni/jni.hpp>
|
|
|
|
namespace mbgl {
|
|
namespace android {
|
|
|
|
class <%- camelize(type) %>Layer : public Layer {
|
|
public:
|
|
|
|
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/layers/<%- camelize(type) %>Layer"; };
|
|
|
|
static jni::Class<<%- camelize(type) %>Layer> javaClass;
|
|
|
|
static void registerNative(jni::JNIEnv&);
|
|
|
|
<% if (type === 'background') { -%>
|
|
<%- camelize(type) %>Layer(jni::JNIEnv&, jni::String);
|
|
<% } else { -%>
|
|
<%- camelize(type) %>Layer(jni::JNIEnv&, jni::String, jni::String);
|
|
<% } -%>
|
|
|
|
<%- camelize(type) %>Layer(mbgl::Map&, mbgl::style::<%- camelize(type) %>Layer&);
|
|
|
|
<%- camelize(type) %>Layer(mbgl::Map&, std::unique_ptr<mbgl::style::<%- camelize(type) %>Layer>);
|
|
|
|
~<%- camelize(type) %>Layer();
|
|
|
|
// Properties
|
|
<% for (const property of properties) { -%>
|
|
|
|
jni::Object<jni::ObjectTag> 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&);
|
|
|
|
}; // class <%- camelize(type) %>Layer
|
|
|
|
} // namespace android
|
|
} // namespace mbgl
|