| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
#pragma once |
| 32 |
|
| 33 |
#include "jni_utils.h" |
| 34 |
|
| 35 |
#include "core/math/rect2i.h" |
| 36 |
#include "core/variant/typed_array.h" |
| 37 |
|
| 38 |
#include <android/log.h> |
| 39 |
#include <jni.h> |
| 40 |
|
| 41 |
|
| 42 |
class GodotIOJavaWrapper { |
| 43 |
private: |
| 44 |
jobject godot_io_instance; |
| 45 |
jclass cls; |
| 46 |
|
| 47 |
jmethodID _open_URI = 0; |
| 48 |
jmethodID _get_cache_dir = 0; |
| 49 |
jmethodID _get_data_dir = 0; |
| 50 |
jmethodID _get_temp_dir = 0; |
| 51 |
jmethodID _get_display_cutouts = 0; |
| 52 |
jmethodID _get_display_rotation = 0; |
| 53 |
jmethodID _get_display_safe_area = 0; |
| 54 |
jmethodID _get_locale = 0; |
| 55 |
jmethodID _get_model = 0; |
| 56 |
jmethodID _get_screen_DPI = 0; |
| 57 |
jmethodID _get_scaled_density = 0; |
| 58 |
jmethodID _get_screen_refresh_rate = 0; |
| 59 |
jmethodID _get_unique_id = 0; |
| 60 |
jmethodID _show_keyboard = 0; |
| 61 |
jmethodID _hide_keyboard = 0; |
| 62 |
jmethodID _has_hardware_keyboard = 0; |
| 63 |
jmethodID _set_screen_orientation = 0; |
| 64 |
jmethodID _get_screen_orientation = 0; |
| 65 |
jmethodID _get_system_dir = 0; |
| 66 |
|
| 67 |
public: |
| 68 |
GodotIOJavaWrapper(JNIEnv *p_env, jobject p_godot_io_instance); |
| 69 |
~GodotIOJavaWrapper(); |
| 70 |
|
| 71 |
jobject get_instance(); |
| 72 |
|
| 73 |
Error open_uri(const String &p_uri); |
| 74 |
String get_cache_dir(); |
| 75 |
String get_temp_dir(); |
| 76 |
String get_user_data_dir(const String &p_user_dir); |
| 77 |
String get_locale(); |
| 78 |
String get_model(); |
| 79 |
int get_screen_dpi(); |
| 80 |
float get_scaled_density(); |
| 81 |
float get_screen_refresh_rate(float fallback); |
| 82 |
TypedArray<Rect2> get_display_cutouts(); |
| 83 |
Rect2i get_display_safe_area(); |
| 84 |
String get_unique_id(); |
| 85 |
bool has_vk(); |
| 86 |
bool has_hardware_keyboard(); |
| 87 |
void show_vk(const String &p_existing, int p_type, int p_max_input_length, int p_cursor_start, int p_cursor_end); |
| 88 |
void hide_vk(); |
| 89 |
int get_vk_height(); |
| 90 |
void set_vk_height(int p_height); |
| 91 |
void set_screen_orientation(int p_orient); |
| 92 |
int get_screen_orientation(); |
| 93 |
String get_system_dir(int p_dir, bool p_shared_storage); |
| 94 |
int get_display_rotation(); |
| 95 |
}; |