diff options
Diffstat (limited to 'platform/android/os_android.h')
-rw-r--r-- | platform/android/os_android.h | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/platform/android/os_android.h b/platform/android/os_android.h index 843b3c4788..9ed7ba5fac 100644 --- a/platform/android/os_android.h +++ b/platform/android/os_android.h @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2017 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -63,6 +63,7 @@ typedef int (*OpenURIFunc)(const String&); typedef String (*GetDataDirFunc)(); typedef String (*GetLocaleFunc)(); typedef String (*GetModelFunc)(); +typedef int (*GetScreenDPIFunc)(); typedef String (*GetUniqueIDFunc)(); typedef void (*ShowVirtualKeyboardFunc)(const String&); typedef void (*HideVirtualKeyboardFunc)(); @@ -74,6 +75,7 @@ typedef bool (*VideoIsPlayingFunc)(); typedef void (*VideoPauseFunc)(); typedef void (*VideoStopFunc)(); typedef void (*SetKeepScreenOnFunc)(bool p_enabled); +typedef void (*AlertFunc)(const String&, const String&); class OS_Android : public OS_Unix { public: @@ -89,7 +91,7 @@ public: JOY_EVENT_HAT = 2 }; - struct JoystickEvent { + struct JoypadEvent { int device; int type; @@ -123,6 +125,8 @@ private: PhysicsServer *physics_server; Physics2DServer *physics_2d_server; + mutable String data_dir_cache; + #if 0 AudioDriverAndroid audio_driver_android; #else @@ -139,6 +143,7 @@ private: GetDataDirFunc get_data_dir_func; GetLocaleFunc get_locale_func; GetModelFunc get_model_func; + GetScreenDPIFunc get_screen_dpi_func; ShowVirtualKeyboardFunc show_virtual_keyboard_func; HideVirtualKeyboardFunc hide_virtual_keyboard_func; SetScreenOrientationFunc set_screen_orientation_func; @@ -150,6 +155,7 @@ private: VideoPauseFunc video_pause_func; VideoStopFunc video_stop_func; SetKeepScreenOnFunc set_keep_screen_on_func; + AlertFunc alert_func; public: @@ -177,7 +183,7 @@ public: virtual void vprint(const char* p_format, va_list p_list, bool p_stderr=false); virtual void print(const char *p_format, ... ); - virtual void alert(const String& p_alert); + virtual void alert(const String& p_alert,const String& p_title="ALERT!"); virtual void set_mouse_show(bool p_show); @@ -207,7 +213,7 @@ public: void main_loop_begin(); bool main_loop_iterate(); - void main_loop_request_quit(); + void main_loop_request_go_back(); void main_loop_end(); void main_loop_focusout(); void main_loop_focusin(); @@ -232,6 +238,7 @@ public: virtual String get_resource_dir() const; virtual String get_locale() const; virtual String get_model_name() const; + virtual int get_screen_dpi(int p_screen=0) const; virtual String get_unique_ID() const; @@ -240,8 +247,9 @@ public: void process_accelerometer(const Vector3& p_accelerometer); void process_magnetometer(const Vector3& p_magnetometer); + void process_gyroscope(const Vector3& p_gyroscope); void process_touch(int p_what,int p_pointer, const Vector<TouchPos>& p_points); - void process_joy_event(JoystickEvent p_event); + void process_joy_event(JoypadEvent p_event); void process_event(InputEvent p_event); void init_video_mode(int p_video_width,int p_video_height); @@ -254,7 +262,7 @@ public: virtual String get_joy_guid(int p_device) const; void joy_connection_changed(int p_device, bool p_connected, String p_name); - OS_Android(GFXInitFunc p_gfx_init_func,void*p_gfx_init_ud, OpenURIFunc p_open_uri_func, GetDataDirFunc p_get_data_dir_func,GetLocaleFunc p_get_locale_func,GetModelFunc p_get_model_func, ShowVirtualKeyboardFunc p_show_vk, HideVirtualKeyboardFunc p_hide_vk, SetScreenOrientationFunc p_screen_orient,GetUniqueIDFunc p_get_unique_id,GetSystemDirFunc p_get_sdir_func, VideoPlayFunc p_video_play_func, VideoIsPlayingFunc p_video_is_playing_func, VideoPauseFunc p_video_pause_func, VideoStopFunc p_video_stop_func, SetKeepScreenOnFunc p_set_keep_screen_on_func, bool p_use_apk_expansion); + OS_Android(GFXInitFunc p_gfx_init_func,void*p_gfx_init_ud, OpenURIFunc p_open_uri_func, GetDataDirFunc p_get_data_dir_func,GetLocaleFunc p_get_locale_func,GetModelFunc p_get_model_func, GetScreenDPIFunc p_get_screen_dpi_func, ShowVirtualKeyboardFunc p_show_vk, HideVirtualKeyboardFunc p_hide_vk, SetScreenOrientationFunc p_screen_orient,GetUniqueIDFunc p_get_unique_id,GetSystemDirFunc p_get_sdir_func, VideoPlayFunc p_video_play_func, VideoIsPlayingFunc p_video_is_playing_func, VideoPauseFunc p_video_pause_func, VideoStopFunc p_video_stop_func, SetKeepScreenOnFunc p_set_keep_screen_on_func, AlertFunc p_alert_func, bool p_use_apk_expansion); ~OS_Android(); }; |