summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/bind/core_bind.cpp91
-rw-r--r--core/bind/core_bind.h20
-rw-r--r--core/os/os.h24
3 files changed, 132 insertions, 3 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 8d18acdc23..858f5cec27 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -176,6 +176,76 @@ bool _OS::is_video_mode_fullscreen(int p_screen) const {
}
+#ifdef NEW_WM_API
+int _OS::get_screen_count() const {
+ return OS::get_singleton()->get_screen_count();
+}
+
+int _OS::get_screen() const {
+ return OS::get_singleton()->get_screen();
+}
+
+void _OS::set_screen(int p_screen) {
+ OS::get_singleton()->set_screen(p_screen);
+}
+
+Point2 _OS::get_screen_position(int p_screen) const {
+ return OS::get_singleton()->get_screen_position(p_screen);
+}
+
+Size2 _OS::get_screen_size(int p_screen) const {
+ return OS::get_singleton()->get_screen_size(p_screen);
+}
+
+Point2 _OS::get_window_position() const {
+ return OS::get_singleton()->get_window_position();
+}
+
+void _OS::set_window_position(const Point2& p_position) {
+ OS::get_singleton()->set_window_position(p_position);
+}
+
+Size2 _OS::get_window_size() const {
+ return OS::get_singleton()->get_window_size();
+}
+
+void _OS::set_window_size(const Size2& p_size) {
+ OS::get_singleton()->set_window_size(p_size);
+}
+
+void _OS::set_fullscreen(bool p_enabled) {
+ OS::get_singleton()->set_fullscreen(p_enabled);
+}
+
+bool _OS::is_fullscreen() const {
+ return OS::get_singleton()->is_fullscreen();
+}
+
+void _OS::set_resizable(bool p_enabled) {
+ OS::get_singleton()->set_resizable(p_enabled);
+}
+
+bool _OS::is_resizable() const {
+ return OS::get_singleton()->is_resizable();
+}
+
+void _OS::set_minimized(bool p_enabled) {
+ OS::get_singleton()->set_minimized(p_enabled);
+}
+
+bool _OS::is_minimized() const {
+ return OS::get_singleton()->is_minimized();
+}
+
+void _OS::set_maximized(bool p_enabled) {
+ OS::get_singleton()->set_maximized(p_enabled);
+}
+
+bool _OS::is_maximized() const {
+ return OS::get_singleton()->is_maximized();
+}
+#endif
+
void _OS::set_use_file_access_save_and_swap(bool p_enable) {
FileAccess::set_backup_save(p_enable);
@@ -186,7 +256,6 @@ bool _OS::is_video_mode_resizable(int p_screen) const {
OS::VideoMode vm;
vm = OS::get_singleton()->get_video_mode(p_screen);
return vm.resizable;
-
}
Array _OS::get_fullscreen_mode_list(int p_screen) const {
@@ -637,6 +706,26 @@ void _OS::_bind_methods() {
ObjectTypeDB::bind_method(_MD("is_video_mode_resizable","screen"),&_OS::is_video_mode_resizable,DEFVAL(0));
ObjectTypeDB::bind_method(_MD("get_fullscreen_mode_list","screen"),&_OS::get_fullscreen_mode_list,DEFVAL(0));
+#ifdef NEW_WM_API
+ ObjectTypeDB::bind_method(_MD("get_screen_count"),&_OS::get_screen_count);
+ ObjectTypeDB::bind_method(_MD("get_screen"),&_OS::get_screen);
+ ObjectTypeDB::bind_method(_MD("set_screen"),&_OS::set_screen);
+ ObjectTypeDB::bind_method(_MD("get_screen_position"),&_OS::get_screen_position,DEFVAL(0));
+ ObjectTypeDB::bind_method(_MD("get_screen_size"),&_OS::get_screen_size,DEFVAL(0));
+ ObjectTypeDB::bind_method(_MD("get_window_position"),&_OS::get_window_position);
+ ObjectTypeDB::bind_method(_MD("set_window_position"),&_OS::set_window_position);
+ ObjectTypeDB::bind_method(_MD("get_window_size"),&_OS::get_window_size);
+ ObjectTypeDB::bind_method(_MD("set_window_size"),&_OS::set_window_size);
+ ObjectTypeDB::bind_method(_MD("set_fullscreen","enabled"),&_OS::set_fullscreen);
+ ObjectTypeDB::bind_method(_MD("is_fullscreen"),&_OS::is_fullscreen);
+ ObjectTypeDB::bind_method(_MD("set_resizable","enabled"),&_OS::set_resizable);
+ ObjectTypeDB::bind_method(_MD("is_resizable"),&_OS::is_resizable);
+ ObjectTypeDB::bind_method(_MD("set_minimized", "enabled"),&_OS::set_minimized);
+ ObjectTypeDB::bind_method(_MD("is_minimized"),&_OS::is_minimized);
+ ObjectTypeDB::bind_method(_MD("set_maximized", "enabled"),&_OS::set_maximized);
+ ObjectTypeDB::bind_method(_MD("is_maximized"),&_OS::is_maximized);
+#endif
+
ObjectTypeDB::bind_method(_MD("set_iterations_per_second","iterations_per_second"),&_OS::set_iterations_per_second);
ObjectTypeDB::bind_method(_MD("get_iterations_per_second"),&_OS::get_iterations_per_second);
ObjectTypeDB::bind_method(_MD("set_target_fps","target_fps"),&_OS::set_target_fps);
diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h
index 057ad90fe9..1a80e35221 100644
--- a/core/bind/core_bind.h
+++ b/core/bind/core_bind.h
@@ -108,6 +108,26 @@ public:
bool is_video_mode_resizable(int p_screen=0) const;
Array get_fullscreen_mode_list(int p_screen=0) const;
+#ifdef NEW_WM_API
+ virtual int get_screen_count() const;
+ virtual int get_screen() const;
+ virtual void set_screen(int p_screen);
+ virtual Point2 get_screen_position(int p_screen=0) const;
+ virtual Size2 get_screen_size(int p_screen=0) const;
+ virtual Point2 get_window_position() const;
+ virtual void set_window_position(const Point2& p_position);
+ virtual Size2 get_window_size() const;
+ virtual void set_window_size(const Size2& p_size);
+ virtual void set_fullscreen(bool p_enabled);
+ virtual bool is_fullscreen() const;
+ virtual void set_resizable(bool p_enabled);
+ virtual bool is_resizable() const;
+ virtual void set_minimized(bool p_enabled);
+ virtual bool is_minimized() const;
+ virtual void set_maximized(bool p_enabled);
+ virtual bool is_maximized() const;
+#endif
+
Error native_video_play(String p_path, float p_volume, String p_audio_track, String p_subtitle_track);
bool native_video_is_playing();
void native_video_pause();
diff --git a/core/os/os.h b/core/os/os.h
index d4deff2f5e..6301bd495f 100644
--- a/core/os/os.h
+++ b/core/os/os.h
@@ -73,7 +73,7 @@ public:
bool fullscreen;
bool resizable;
float get_aspect() const { return (float)width/(float)height; }
- VideoMode(int p_width=640,int p_height=480,bool p_fullscreen=false, bool p_resizable = true) { width=p_width; height=p_height; fullscreen=p_fullscreen; resizable = p_resizable; }
+ VideoMode(int p_width=640,int p_height=480,bool p_fullscreen=false, bool p_resizable = true) {width=p_width; height=p_height; fullscreen=p_fullscreen; resizable = p_resizable; }
};
protected:
friend class Main;
@@ -149,7 +149,27 @@ public:
virtual void set_video_mode(const VideoMode& p_video_mode,int p_screen=0)=0;
virtual VideoMode get_video_mode(int p_screen=0) const=0;
virtual void get_fullscreen_mode_list(List<VideoMode> *p_list,int p_screen=0) const=0;
-
+
+#ifdef NEW_WM_API
+ virtual int get_screen_count() const=0;
+ virtual int get_screen() const=0;
+ virtual void set_screen(int p_screen)=0;
+ virtual Point2 get_screen_position(int p_screen=0) const=0;
+ virtual Size2 get_screen_size(int p_screen=0) const=0;
+ virtual Point2 get_window_position() const=0;
+ virtual void set_window_position(const Point2& p_position)=0;
+ virtual Size2 get_window_size() const=0;
+ virtual void set_window_size(const Size2 p_size)=0;
+ virtual void set_fullscreen(bool p_enabled)=0;
+ virtual bool is_fullscreen() const=0;
+ virtual void set_resizable(bool p_enabled)=0;
+ virtual bool is_resizable() const=0;
+ virtual void set_minimized(bool p_enabled)=0;
+ virtual bool is_minimized() const=0;
+ virtual void set_maximized(bool p_enabled)=0;
+ virtual bool is_maximized() const=0;
+#endif
+
virtual void set_iterations_per_second(int p_ips);
virtual int get_iterations_per_second() const;