summaryrefslogtreecommitdiff
path: root/core/os/os.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/os/os.h')
-rw-r--r--core/os/os.h28
1 files changed, 16 insertions, 12 deletions
diff --git a/core/os/os.h b/core/os/os.h
index 3806217f55..6fcfd71332 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -32,6 +32,7 @@
#include "engine.h"
#include "image.h"
+#include "io/logger.h"
#include "list.h"
#include "os/main_loop.h"
#include "ustring.h"
@@ -61,6 +62,11 @@ class OS {
void *_stack_bottom;
+ Logger *_logger;
+
+protected:
+ void _set_logger(Logger *p_logger);
+
public:
typedef void (*ImeCallback)(void *p_inp, String p_text, Point2 p_selection);
@@ -108,6 +114,7 @@ protected:
virtual int get_audio_driver_count() const = 0;
virtual const char *get_audio_driver_name(int p_driver) const = 0;
+ virtual void initialize_logger();
virtual void initialize_core() = 0;
virtual void initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) = 0;
@@ -127,18 +134,10 @@ public:
static OS *get_singleton();
- enum ErrorType {
- ERR_ERROR,
- ERR_WARNING,
- ERR_SCRIPT,
- ERR_SHADER
- };
+ void print_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, Logger::ErrorType p_type = Logger::ERR_ERROR);
+ void print(const char *p_format, ...);
+ void printerr(const char *p_format, ...);
- virtual void print_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, ErrorType p_type = ERR_ERROR);
-
- virtual void print(const char *p_format, ...);
- virtual void printerr(const char *p_format, ...);
- virtual void vprint(const char *p_format, va_list p_list, bool p_stderr = false) = 0;
virtual void alert(const String &p_alert, const String &p_title = "ALERT!") = 0;
virtual String get_stdin_string(bool p_block = true) = 0;
@@ -284,6 +283,8 @@ public:
virtual bool can_draw() const = 0;
+ virtual bool is_userfs_persistent() const { return true; }
+
bool is_stdout_verbose() const;
virtual void disable_crash_handler() {}
@@ -314,6 +315,9 @@ public:
virtual void show_virtual_keyboard(const String &p_existing_text, const Rect2 &p_screen_rect = Rect2());
virtual void hide_virtual_keyboard();
+ // returns height of the currently shown virtual keyboard (0 if keyboard is hidden)
+ virtual int get_virtual_keyboard_height() const;
+
virtual void set_cursor_shape(CursorShape p_shape) = 0;
virtual bool get_swap_ok_cancel() { return false; }
@@ -426,7 +430,7 @@ public:
virtual int get_power_seconds_left();
virtual int get_power_percent_left();
- bool check_feature_support(const String &p_feature);
+ bool has_feature(const String &p_feature);
/**
* Returns the stack bottom of the main thread of the application.