diff options
-rw-r--r-- | android/cpp/jni.cpp (renamed from android/cpp/JNI.cpp) | 7 | ||||
-rw-r--r-- | android/cpp/native_map_view.cpp (renamed from android/cpp/NativeMapView.cpp) | 9 | ||||
-rw-r--r-- | android/mapboxgl-app.gyp | 4 | ||||
-rw-r--r-- | include/mbgl/android/jni.hpp | 37 | ||||
-rw-r--r-- | include/mbgl/android/log.hpp (renamed from android/cpp/log.h) | 6 | ||||
-rw-r--r-- | include/mbgl/android/native_map_view.hpp (renamed from android/cpp/NativeMapView.hpp) | 40 | ||||
-rw-r--r-- | platform/android/cache_database_data.cpp | 2 | ||||
-rw-r--r-- | platform/default/http_request_baton_curl.cpp | 4 |
8 files changed, 61 insertions, 48 deletions
diff --git a/android/cpp/JNI.cpp b/android/cpp/jni.cpp index 708063f240..45b8f7fd20 100644 --- a/android/cpp/JNI.cpp +++ b/android/cpp/jni.cpp @@ -11,9 +11,10 @@ #include <android/native_window_jni.h> -#include "log.h" - -#include "NativeMapView.hpp" +#include <mbgl/map/map.hpp> +#include <mbgl/android/jni.hpp> +#include <mbgl/android/log.hpp> +#include <mbgl/android/native_map_view.hpp> #pragma clang diagnostic ignored "-Wunused-parameter" diff --git a/android/cpp/NativeMapView.cpp b/android/cpp/native_map_view.cpp index 5644b284dd..ab06275f03 100644 --- a/android/cpp/NativeMapView.cpp +++ b/android/cpp/native_map_view.cpp @@ -5,12 +5,13 @@ #include <GLES2/gl2.h> +#include <mbgl/android/log.hpp> +#include <mbgl/android/native_map_view.hpp> + +#include <mbgl/map/map.hpp> #include <mbgl/platform/platform.hpp> #include <mbgl/platform/android/log_android.hpp> - -#include "log.h" - -#include "NativeMapView.hpp" +#include <mbgl/android/jni.hpp> namespace mbgl { namespace android { diff --git a/android/mapboxgl-app.gyp b/android/mapboxgl-app.gyp index ac8937fb38..118669542b 100644 --- a/android/mapboxgl-app.gyp +++ b/android/mapboxgl-app.gyp @@ -8,8 +8,8 @@ 'product_name': 'mapbox-gl', 'type': 'shared_library', 'sources': [ - './cpp/NativeMapView.cpp', - './cpp/JNI.cpp', + './cpp/native_map_view.cpp', + './cpp/jni.cpp', ], 'cflags_cc': [ '-I<(boost_root)/include', diff --git a/include/mbgl/android/jni.hpp b/include/mbgl/android/jni.hpp new file mode 100644 index 0000000000..c1af07c64f --- /dev/null +++ b/include/mbgl/android/jni.hpp @@ -0,0 +1,37 @@ +#ifndef MBGL_ANDROID_JNI +#define MBGL_ANDROID_JNI + +#include <string> +#include <jni.h> + +namespace mbgl { +namespace android { + +extern std::string cache_path; +extern std::string data_path; + +extern jmethodID on_map_changed_id; + +extern jclass lon_lat_class; +extern jmethodID lon_lat_constructor_id; +extern jfieldID lon_lat_lon_id; +extern jfieldID lon_lat_lat_id; + +extern jclass lon_lat_zoom_class; +extern jmethodID lon_lat_zoom_constructor_id; +extern jfieldID lon_lat_zoom_lon_id; +extern jfieldID lon_lat_zoom_lat_id; +extern jfieldID lon_lat_zoom_zoom_id; + +extern jclass runtime_exception_class; + +extern jmethodID list_to_array_id; + +extern jclass array_list_class; +extern jmethodID array_list_constructor_id; +extern jmethodID array_list_add_id; + +} +} + +#endif diff --git a/android/cpp/log.h b/include/mbgl/android/log.hpp index 3cf2038533..50b6bec1e7 100644 --- a/android/cpp/log.h +++ b/include/mbgl/android/log.hpp @@ -1,5 +1,5 @@ -#ifndef LOG_H -#define LOG_H +#ifndef MBGL_ANDROID_LOG +#define MBGL_ANDROID_LOG #include <android/log.h> @@ -22,4 +22,4 @@ #define LOG_WARN(fmt, args...) __android_log_print(ANDROID_LOG_WARN, __FILE__ ":" S__LINE__, fmt, ##args) #define LOG_ERROR(fmt, args...) __android_log_print(ANDROID_LOG_ERROR, __FILE__ ":" S__LINE__, fmt, ##args) -#endif // LOG_H +#endif diff --git a/android/cpp/NativeMapView.hpp b/include/mbgl/android/native_map_view.hpp index 75aba6985b..04949abe1a 100644 --- a/android/cpp/NativeMapView.hpp +++ b/include/mbgl/android/native_map_view.hpp @@ -1,43 +1,15 @@ -#ifndef MAP_VIEW_HPP -#define MAP_VIEW_HPP +#ifndef MBGL_ANDROID_NATIVE_MAP_VIEW +#define MBGL_ANDROID_NATIVE_MAP_VIEW +#include <mbgl/map/view.hpp> #include <string> - #include <jni.h> - #include <android/native_window.h> - #include <EGL/egl.h> -#include <mbgl/mbgl.hpp> - namespace mbgl { namespace android { -extern std::string cache_path; -extern std::string data_path; - -extern jmethodID on_map_changed_id; - -extern jclass lon_lat_class; -extern jmethodID lon_lat_constructor_id; -extern jfieldID lon_lat_lon_id; -extern jfieldID lon_lat_lat_id; - -extern jclass lon_lat_zoom_class; -extern jmethodID lon_lat_zoom_constructor_id; -extern jfieldID lon_lat_zoom_lon_id; -extern jfieldID lon_lat_zoom_lat_id; -extern jfieldID lon_lat_zoom_zoom_id; - -extern jclass runtime_exception_class; - -extern jmethodID list_to_array_id; - -extern jclass array_list_class; -extern jmethodID array_list_constructor_id; -extern jmethodID array_list_add_id; - class MBGLView; class NativeMapView { @@ -116,7 +88,7 @@ private: NativeMapView* nativeView = nullptr; }; -} // namespace android -} // namespace mbgl +} +} -#endif // MAP_VIEW_HPP +#endif diff --git a/platform/android/cache_database_data.cpp b/platform/android/cache_database_data.cpp index 61c4efc15b..5f13a44f68 100644 --- a/platform/android/cache_database_data.cpp +++ b/platform/android/cache_database_data.cpp @@ -1,5 +1,5 @@ #include <mbgl/platform/platform.hpp> -#include "../../android/cpp/NativeMapView.hpp" +#include <mbgl/android/jni.hpp> namespace mbgl { namespace platform { diff --git a/platform/default/http_request_baton_curl.cpp b/platform/default/http_request_baton_curl.cpp index 5238283fdb..a88b949e01 100644 --- a/platform/default/http_request_baton_curl.cpp +++ b/platform/default/http_request_baton_curl.cpp @@ -1,8 +1,10 @@ +#include <mbgl/mbgl.hpp> #include <mbgl/storage/http_request_baton.hpp> #include <mbgl/util/uv-messenger.h> #include <mbgl/util/time.hpp> + #ifdef __ANDROID__ - #include "../../android/cpp/NativeMapView.hpp" + #include <mbgl/android/jni.hpp> #endif #include <uv.h> |