summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-06-30 14:22:29 +0200
committerGitHub <noreply@github.com>2019-06-30 14:22:29 +0200
commite2bbf2cba3dc97998cff0be5cbda2d7e3b7151b0 (patch)
tree1784ee303025841edb69093ce9dbddba85933b09 /core
parent82604195b4c2c80777f7ecaa547194c6a208e8cf (diff)
parent0db138a621c8ce67864379c2bf69fda54c380178 (diff)
Merge pull request #30184 from akien-mga/doc-property-defval
doc: Add default values to all properties
Diffstat (limited to 'core')
-rw-r--r--core/bind/core_bind.cpp20
-rw-r--r--core/bind/core_bind.h3
2 files changed, 23 insertions, 0 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index 44573a0d97..da7b15da94 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -1317,6 +1317,26 @@ void _OS::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "window_position"), "set_window_position", "get_window_position");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2, "window_size"), "set_window_size", "get_window_size");
+ // Those default values need to be specified for the docs generator,
+ // to avoid using values from the documentation writer's own OS instance.
+ ADD_PROPERTY_DEFAULT("clipboard", "");
+ ADD_PROPERTY_DEFAULT("current_screen", 0);
+ ADD_PROPERTY_DEFAULT("exit_code", 0);
+ ADD_PROPERTY_DEFAULT("vsync_enabled", true);
+ ADD_PROPERTY_DEFAULT("low_processor_usage_mode", false);
+ ADD_PROPERTY_DEFAULT("keep_screen_on", true);
+ ADD_PROPERTY_DEFAULT("min_window_size", Vector2());
+ ADD_PROPERTY_DEFAULT("max_window_size", Vector2());
+ ADD_PROPERTY_DEFAULT("screen_orientation", 0);
+ ADD_PROPERTY_DEFAULT("window_borderless", false);
+ ADD_PROPERTY_DEFAULT("window_per_pixel_transparency_enabled", false);
+ ADD_PROPERTY_DEFAULT("window_fullscreen", false);
+ ADD_PROPERTY_DEFAULT("window_maximized", false);
+ ADD_PROPERTY_DEFAULT("window_minimized", false);
+ ADD_PROPERTY_DEFAULT("window_resizable", true);
+ ADD_PROPERTY_DEFAULT("window_position", Vector2());
+ ADD_PROPERTY_DEFAULT("window_size", Vector2());
+
BIND_ENUM_CONSTANT(VIDEO_DRIVER_GLES2);
BIND_ENUM_CONSTANT(VIDEO_DRIVER_GLES3);
diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h
index 2885e7c0e0..3be5a08752 100644
--- a/core/bind/core_bind.h
+++ b/core/bind/core_bind.h
@@ -805,6 +805,9 @@ public:
void set_result(const Variant &p_result);
Variant get_result() const;
+
+ JSONParseResult() :
+ error_line(-1) {}
};
class _JSON : public Object {