1 /** 2 A tab used to edit properties of the selected node. 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.editorinspector; 14 import std.meta : AliasSeq, staticIndexOf; 15 import std.traits : Unqual; 16 import godot.d.traits; 17 import godot.core; 18 import godot.c; 19 import godot.d.bind; 20 import godot.d.reference; 21 import godot.globalenums; 22 import godot.object; 23 import godot.scrollcontainer; 24 import godot.node; 25 import godot.resource; 26 /** 27 A tab used to edit properties of the selected node. 28 29 The editor inspector is by default located on the right-hand side of the editor. It's used to edit the properties of the selected node. For example, you can select a node such as $(D Sprite) then edit its transform through the inspector tool. The editor inspector is an essential tool in the game development workflow. 30 $(B Note:) This class shouldn't be instantiated directly. Instead, access the singleton using $(D EditorInterface.getInspector). 31 */ 32 @GodotBaseClass struct EditorInspector 33 { 34 package(godot) enum string _GODOT_internal_name = "EditorInspector"; 35 public: 36 @nogc nothrow: 37 union { /** */ godot_object _godot_object; /** */ ScrollContainer _GODOT_base; } 38 alias _GODOT_base this; 39 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 40 package(godot) __gshared bool _classBindingInitialized = false; 41 package(godot) static struct GDNativeClassBinding 42 { 43 __gshared: 44 @GodotName("_edit_request_change") GodotMethod!(void, GodotObject, String) _editRequestChange; 45 @GodotName("_feature_profile_changed") GodotMethod!(void) _featureProfileChanged; 46 @GodotName("_filter_changed") GodotMethod!(void, String) _filterChanged; 47 @GodotName("_multiple_properties_changed") GodotMethod!(void, PoolStringArray, Array) _multiplePropertiesChanged; 48 @GodotName("_node_removed") GodotMethod!(void, Node) _nodeRemoved; 49 @GodotName("_object_id_selected") GodotMethod!(void, String, long) _objectIdSelected; 50 @GodotName("_property_changed") GodotMethod!(void, String, Variant, String, bool) _propertyChanged; 51 @GodotName("_property_changed_update_all") GodotMethod!(void, String, Variant, String, bool) _propertyChangedUpdateAll; 52 @GodotName("_property_checked") GodotMethod!(void, String, bool) _propertyChecked; 53 @GodotName("_property_keyed") GodotMethod!(void, String, bool) _propertyKeyed; 54 @GodotName("_property_keyed_with_value") GodotMethod!(void, String, Variant, bool) _propertyKeyedWithValue; 55 @GodotName("_property_selected") GodotMethod!(void, String, long) _propertySelected; 56 @GodotName("_resource_selected") GodotMethod!(void, String, Resource) _resourceSelected; 57 @GodotName("_vscroll_changed") GodotMethod!(void, double) _vscrollChanged; 58 @GodotName("refresh") GodotMethod!(void) refresh; 59 } 60 /// 61 pragma(inline, true) bool opEquals(in EditorInspector other) const 62 { return _godot_object.ptr is other._godot_object.ptr; } 63 /// 64 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 65 { _godot_object.ptr = n; return null; } 66 /// 67 pragma(inline, true) bool opEquals(typeof(null) n) const 68 { return _godot_object.ptr is n; } 69 /// 70 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 71 mixin baseCasts; 72 /// Construct a new instance of EditorInspector. 73 /// Note: use `memnew!EditorInspector` instead. 74 static EditorInspector _new() 75 { 76 static godot_class_constructor constructor; 77 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("EditorInspector"); 78 if(constructor is null) return typeof(this).init; 79 return cast(EditorInspector)(constructor()); 80 } 81 @disable new(size_t s); 82 /** 83 84 */ 85 void _editRequestChange(GodotObject arg0, in String arg1) 86 { 87 Array _GODOT_args = Array.make(); 88 _GODOT_args.append(arg0); 89 _GODOT_args.append(arg1); 90 String _GODOT_method_name = String("_edit_request_change"); 91 this.callv(_GODOT_method_name, _GODOT_args); 92 } 93 /** 94 95 */ 96 void _featureProfileChanged() 97 { 98 Array _GODOT_args = Array.make(); 99 String _GODOT_method_name = String("_feature_profile_changed"); 100 this.callv(_GODOT_method_name, _GODOT_args); 101 } 102 /** 103 104 */ 105 void _filterChanged(in String arg0) 106 { 107 Array _GODOT_args = Array.make(); 108 _GODOT_args.append(arg0); 109 String _GODOT_method_name = String("_filter_changed"); 110 this.callv(_GODOT_method_name, _GODOT_args); 111 } 112 /** 113 114 */ 115 void _multiplePropertiesChanged(in PoolStringArray arg0, in Array arg1) 116 { 117 Array _GODOT_args = Array.make(); 118 _GODOT_args.append(arg0); 119 _GODOT_args.append(arg1); 120 String _GODOT_method_name = String("_multiple_properties_changed"); 121 this.callv(_GODOT_method_name, _GODOT_args); 122 } 123 /** 124 125 */ 126 void _nodeRemoved(Node arg0) 127 { 128 Array _GODOT_args = Array.make(); 129 _GODOT_args.append(arg0); 130 String _GODOT_method_name = String("_node_removed"); 131 this.callv(_GODOT_method_name, _GODOT_args); 132 } 133 /** 134 135 */ 136 void _objectIdSelected(in String arg0, in long arg1) 137 { 138 Array _GODOT_args = Array.make(); 139 _GODOT_args.append(arg0); 140 _GODOT_args.append(arg1); 141 String _GODOT_method_name = String("_object_id_selected"); 142 this.callv(_GODOT_method_name, _GODOT_args); 143 } 144 /** 145 146 */ 147 void _propertyChanged(VariantArg1)(in String arg0, in VariantArg1 arg1, in String arg2 = gs!"", in bool arg3 = false) 148 { 149 Array _GODOT_args = Array.make(); 150 _GODOT_args.append(arg0); 151 _GODOT_args.append(arg1); 152 _GODOT_args.append(arg2); 153 _GODOT_args.append(arg3); 154 String _GODOT_method_name = String("_property_changed"); 155 this.callv(_GODOT_method_name, _GODOT_args); 156 } 157 /** 158 159 */ 160 void _propertyChangedUpdateAll(VariantArg1)(in String arg0, in VariantArg1 arg1, in String arg2, in bool arg3) 161 { 162 Array _GODOT_args = Array.make(); 163 _GODOT_args.append(arg0); 164 _GODOT_args.append(arg1); 165 _GODOT_args.append(arg2); 166 _GODOT_args.append(arg3); 167 String _GODOT_method_name = String("_property_changed_update_all"); 168 this.callv(_GODOT_method_name, _GODOT_args); 169 } 170 /** 171 172 */ 173 void _propertyChecked(in String arg0, in bool arg1) 174 { 175 Array _GODOT_args = Array.make(); 176 _GODOT_args.append(arg0); 177 _GODOT_args.append(arg1); 178 String _GODOT_method_name = String("_property_checked"); 179 this.callv(_GODOT_method_name, _GODOT_args); 180 } 181 /** 182 183 */ 184 void _propertyKeyed(in String arg0, in bool arg1) 185 { 186 Array _GODOT_args = Array.make(); 187 _GODOT_args.append(arg0); 188 _GODOT_args.append(arg1); 189 String _GODOT_method_name = String("_property_keyed"); 190 this.callv(_GODOT_method_name, _GODOT_args); 191 } 192 /** 193 194 */ 195 void _propertyKeyedWithValue(VariantArg1)(in String arg0, in VariantArg1 arg1, in bool arg2) 196 { 197 Array _GODOT_args = Array.make(); 198 _GODOT_args.append(arg0); 199 _GODOT_args.append(arg1); 200 _GODOT_args.append(arg2); 201 String _GODOT_method_name = String("_property_keyed_with_value"); 202 this.callv(_GODOT_method_name, _GODOT_args); 203 } 204 /** 205 206 */ 207 void _propertySelected(in String arg0, in long arg1) 208 { 209 Array _GODOT_args = Array.make(); 210 _GODOT_args.append(arg0); 211 _GODOT_args.append(arg1); 212 String _GODOT_method_name = String("_property_selected"); 213 this.callv(_GODOT_method_name, _GODOT_args); 214 } 215 /** 216 217 */ 218 void _resourceSelected(in String arg0, Resource arg1) 219 { 220 Array _GODOT_args = Array.make(); 221 _GODOT_args.append(arg0); 222 _GODOT_args.append(arg1); 223 String _GODOT_method_name = String("_resource_selected"); 224 this.callv(_GODOT_method_name, _GODOT_args); 225 } 226 /** 227 228 */ 229 void _vscrollChanged(in double arg0) 230 { 231 Array _GODOT_args = Array.make(); 232 _GODOT_args.append(arg0); 233 String _GODOT_method_name = String("_vscroll_changed"); 234 this.callv(_GODOT_method_name, _GODOT_args); 235 } 236 /** 237 Refreshes the inspector. 238 $(B Note:) To save on CPU resources, calling this method will do nothing if the time specified in `docks/property_editor/auto_refresh_interval` editor setting hasn't passed yet since this method was last called. (By default, this interval is set to 0.3 seconds.) 239 */ 240 void refresh() 241 { 242 checkClassBinding!(typeof(this))(); 243 ptrcall!(void)(GDNativeClassBinding.refresh, _godot_object); 244 } 245 }