Move JNI bindings code from mapbox-gl-native to this repo. (#301)

This commit is contained in:
Igor Tarasov
2020-04-02 19:45:56 +03:00
committed by GitHub
parent 620bda356c
commit daecbed823
178 changed files with 14422 additions and 2 deletions

View File

@@ -0,0 +1,41 @@
#pragma once
#include <jni/jni.hpp>
#include <mbgl/gl/custom_layer.hpp>
#include <mbgl/gl/custom_layer_factory.hpp>
#include "layer.hpp"
namespace mbgl {
namespace android {
class CustomLayer : public Layer {
public:
using SuperTag = Layer;
static constexpr auto Name() { return "com/mapbox/mapboxsdk/style/layers/CustomLayer"; };
static void registerNative(jni::JNIEnv&);
CustomLayer(jni::JNIEnv&, const jni::String&, jni::jlong);
CustomLayer(mbgl::style::CustomLayer&);
CustomLayer(std::unique_ptr<mbgl::style::CustomLayer>);
~CustomLayer();
jni::Local<jni::Object<Layer>> createJavaPeer(jni::JNIEnv&);
}; // class CustomLayer
class CustomJavaLayerPeerFactory final : public JavaLayerPeerFactory, public mbgl::CustomLayerFactory {
public:
~CustomJavaLayerPeerFactory() override;
// JavaLayerPeerFactory overrides.
jni::Local<jni::Object<Layer>> createJavaLayerPeer(jni::JNIEnv&, mbgl::style::Layer&) final;
jni::Local<jni::Object<Layer>> createJavaLayerPeer(jni::JNIEnv& env, std::unique_ptr<mbgl::style::Layer>) final;
void registerNative(jni::JNIEnv&) final;
LayerFactory* getLayerFactory() final { return this; }
}; // class CustomJavaLayerPeerFactory
} // namespace android
} // namespace mbgl