diff options
Diffstat (limited to 'core/os/os.h')
| -rw-r--r-- | core/os/os.h | 20 | 
1 files changed, 15 insertions, 5 deletions
diff --git a/core/os/os.h b/core/os/os.h index 396555970a..4ae8a354e5 100644 --- a/core/os/os.h +++ b/core/os/os.h @@ -45,6 +45,8 @@  	@author Juan Linietsky <reduzio@gmail.com>  */ +class Mutex; +  class OS {  	static OS *singleton; @@ -77,6 +79,7 @@ protected:  public:  	typedef void (*ImeCallback)(void *p_inp, String p_text, Point2 p_selection); +	typedef bool (*HasServerFeatureCallback)(const String &p_feature);  	enum PowerState {  		POWERSTATE_UNKNOWN, /**< cannot determine power status */ @@ -121,6 +124,7 @@ public:  protected:  	friend class Main; +	HasServerFeatureCallback has_server_feature_callback;  	RenderThreadMode _render_thread_mode;  	// functions used by main to initialize/deinitialize the OS @@ -146,8 +150,8 @@ public:  	static OS *get_singleton();  	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, ...); +	void print(const char *p_format, ...) _PRINTF_FORMAT_ATTRIBUTE_2_3; +	void printerr(const char *p_format, ...) _PRINTF_FORMAT_ATTRIBUTE_2_3;  	virtual void alert(const String &p_alert, const String &p_title = "ALERT!") = 0;  	virtual String get_stdin_string(bool p_block = true) = 0; @@ -258,7 +262,7 @@ public:  	virtual int get_low_processor_usage_mode_sleep_usec() const;  	virtual String get_executable_path() const; -	virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false) = 0; +	virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false, Mutex *p_pipe_mutex = NULL) = 0;  	virtual Error kill(const ProcessID &p_pid) = 0;  	virtual int get_process_id() const; @@ -375,8 +379,9 @@ public:  	// 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 void set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot) = 0; +	virtual void set_cursor_shape(CursorShape p_shape); +	virtual CursorShape get_cursor_shape() const; +	virtual void set_custom_mouse_cursor(const RES &p_cursor, CursorShape p_shape, const Vector2 &p_hotspot);  	virtual bool get_swap_ok_cancel() { return false; }  	virtual void dump_memory_to_file(const char *p_file); @@ -507,6 +512,8 @@ public:  	virtual void force_process_input(){};  	bool has_feature(const String &p_feature); +	void set_has_server_feature_callback(HasServerFeatureCallback p_callback); +  	bool is_layered_allowed() const { return _allow_layered; }  	bool is_hidpi_allowed() const { return _allow_hidpi; } @@ -514,6 +521,9 @@ public:  	bool is_restart_on_exit_set() const;  	List<String> get_restart_on_exit_arguments() const; +	virtual bool request_permission(const String &p_name) { return true; } + +	virtual void process_and_drop_events() {}  	OS();  	virtual ~OS();  };  |