1 /** 2 3 4 Copyright: 5 Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. 6 Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) 7 Copyright (c) 2017-2018 Godot-D contributors 8 9 License: $(LINK2 https://opensource.org/licenses/MIT, MIT License) 10 11 12 */ 13 module godot.editorproperty; 14 import std.meta : AliasSeq, staticIndexOf; 15 import std.traits : Unqual; 16 import godot.d.meta; 17 import godot.core; 18 import godot.c; 19 import godot.d.bind; 20 import godot.d.reference; 21 import godot.object; 22 import godot.classdb; 23 import godot.container; 24 import godot.inputevent; 25 import godot.control; 26 import godot.canvasitem; 27 import godot.node; 28 /** 29 30 */ 31 @GodotBaseClass struct EditorProperty 32 { 33 enum string _GODOT_internal_name = "EditorProperty"; 34 public: 35 @nogc nothrow: 36 union { godot_object _godot_object; Container _GODOT_base; } 37 alias _GODOT_base this; 38 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 39 package(godot) __gshared bool _classBindingInitialized = false; 40 package(godot) static struct _classBinding 41 { 42 __gshared: 43 @GodotName("update_property") GodotMethod!(void) updateProperty; 44 @GodotName("set_label") GodotMethod!(void, String) setLabel; 45 @GodotName("get_label") GodotMethod!(String) getLabel; 46 @GodotName("set_read_only") GodotMethod!(void, bool) setReadOnly; 47 @GodotName("is_read_only") GodotMethod!(bool) isReadOnly; 48 @GodotName("set_checkable") GodotMethod!(void, bool) setCheckable; 49 @GodotName("is_checkable") GodotMethod!(bool) isCheckable; 50 @GodotName("set_checked") GodotMethod!(void, bool) setChecked; 51 @GodotName("is_checked") GodotMethod!(bool) isChecked; 52 @GodotName("set_draw_red") GodotMethod!(void, bool) setDrawRed; 53 @GodotName("is_draw_red") GodotMethod!(bool) isDrawRed; 54 @GodotName("set_keying") GodotMethod!(void, bool) setKeying; 55 @GodotName("is_keying") GodotMethod!(bool) isKeying; 56 @GodotName("get_edited_property") GodotMethod!(String) getEditedProperty; 57 @GodotName("get_edited_object") GodotMethod!(GodotObject) getEditedObject; 58 @GodotName("_gui_input") GodotMethod!(void, InputEvent) _guiInput; 59 @GodotName("_focusable_focused") GodotMethod!(void, long) _focusableFocused; 60 @GodotName("get_tooltip_text") GodotMethod!(String) getTooltipText; 61 } 62 bool opEquals(in EditorProperty other) const { return _godot_object.ptr is other._godot_object.ptr; } 63 EditorProperty opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 64 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 65 mixin baseCasts; 66 static EditorProperty _new() 67 { 68 static godot_class_constructor constructor; 69 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("EditorProperty"); 70 if(constructor is null) return typeof(this).init; 71 return cast(EditorProperty)(constructor()); 72 } 73 @disable new(size_t s); 74 /** 75 76 */ 77 void updateProperty() 78 { 79 Array _GODOT_args = Array.empty_array; 80 String _GODOT_method_name = String("update_property"); 81 this.callv(_GODOT_method_name, _GODOT_args); 82 } 83 /** 84 85 */ 86 void setLabel(StringArg0)(in StringArg0 text) 87 { 88 checkClassBinding!(typeof(this))(); 89 ptrcall!(void)(_classBinding.setLabel, _godot_object, text); 90 } 91 /** 92 93 */ 94 String getLabel() const 95 { 96 checkClassBinding!(typeof(this))(); 97 return ptrcall!(String)(_classBinding.getLabel, _godot_object); 98 } 99 /** 100 101 */ 102 void setReadOnly(in bool read_only) 103 { 104 checkClassBinding!(typeof(this))(); 105 ptrcall!(void)(_classBinding.setReadOnly, _godot_object, read_only); 106 } 107 /** 108 109 */ 110 bool isReadOnly() const 111 { 112 checkClassBinding!(typeof(this))(); 113 return ptrcall!(bool)(_classBinding.isReadOnly, _godot_object); 114 } 115 /** 116 117 */ 118 void setCheckable(in bool checkable) 119 { 120 checkClassBinding!(typeof(this))(); 121 ptrcall!(void)(_classBinding.setCheckable, _godot_object, checkable); 122 } 123 /** 124 125 */ 126 bool isCheckable() const 127 { 128 checkClassBinding!(typeof(this))(); 129 return ptrcall!(bool)(_classBinding.isCheckable, _godot_object); 130 } 131 /** 132 133 */ 134 void setChecked(in bool checked) 135 { 136 checkClassBinding!(typeof(this))(); 137 ptrcall!(void)(_classBinding.setChecked, _godot_object, checked); 138 } 139 /** 140 141 */ 142 bool isChecked() const 143 { 144 checkClassBinding!(typeof(this))(); 145 return ptrcall!(bool)(_classBinding.isChecked, _godot_object); 146 } 147 /** 148 149 */ 150 void setDrawRed(in bool draw_red) 151 { 152 checkClassBinding!(typeof(this))(); 153 ptrcall!(void)(_classBinding.setDrawRed, _godot_object, draw_red); 154 } 155 /** 156 157 */ 158 bool isDrawRed() const 159 { 160 checkClassBinding!(typeof(this))(); 161 return ptrcall!(bool)(_classBinding.isDrawRed, _godot_object); 162 } 163 /** 164 165 */ 166 void setKeying(in bool keying) 167 { 168 checkClassBinding!(typeof(this))(); 169 ptrcall!(void)(_classBinding.setKeying, _godot_object, keying); 170 } 171 /** 172 173 */ 174 bool isKeying() const 175 { 176 checkClassBinding!(typeof(this))(); 177 return ptrcall!(bool)(_classBinding.isKeying, _godot_object); 178 } 179 /** 180 181 */ 182 String getEditedProperty() 183 { 184 checkClassBinding!(typeof(this))(); 185 return ptrcall!(String)(_classBinding.getEditedProperty, _godot_object); 186 } 187 /** 188 189 */ 190 GodotObject getEditedObject() 191 { 192 checkClassBinding!(typeof(this))(); 193 return ptrcall!(GodotObject)(_classBinding.getEditedObject, _godot_object); 194 } 195 /** 196 197 */ 198 void _guiInput(InputEvent arg0) 199 { 200 Array _GODOT_args = Array.empty_array; 201 _GODOT_args.append(arg0); 202 String _GODOT_method_name = String("_gui_input"); 203 this.callv(_GODOT_method_name, _GODOT_args); 204 } 205 /** 206 207 */ 208 void _focusableFocused(in long arg0) 209 { 210 Array _GODOT_args = Array.empty_array; 211 _GODOT_args.append(arg0); 212 String _GODOT_method_name = String("_focusable_focused"); 213 this.callv(_GODOT_method_name, _GODOT_args); 214 } 215 /** 216 217 */ 218 String getTooltipText() const 219 { 220 checkClassBinding!(typeof(this))(); 221 return ptrcall!(String)(_classBinding.getTooltipText, _godot_object); 222 } 223 /** 224 225 */ 226 @property String label() 227 { 228 return getLabel(); 229 } 230 /// ditto 231 @property void label(String v) 232 { 233 setLabel(v); 234 } 235 /** 236 237 */ 238 @property bool readOnly() 239 { 240 return isReadOnly(); 241 } 242 /// ditto 243 @property void readOnly(bool v) 244 { 245 setReadOnly(v); 246 } 247 /** 248 249 */ 250 @property bool checkable() 251 { 252 return isCheckable(); 253 } 254 /// ditto 255 @property void checkable(bool v) 256 { 257 setCheckable(v); 258 } 259 /** 260 261 */ 262 @property bool checked() 263 { 264 return isChecked(); 265 } 266 /// ditto 267 @property void checked(bool v) 268 { 269 setChecked(v); 270 } 271 /** 272 273 */ 274 @property bool drawRed() 275 { 276 return isDrawRed(); 277 } 278 /// ditto 279 @property void drawRed(bool v) 280 { 281 setDrawRed(v); 282 } 283 /** 284 285 */ 286 @property bool keying() 287 { 288 return isKeying(); 289 } 290 /// ditto 291 @property void keying(bool v) 292 { 293 setKeying(v); 294 } 295 }