1 /** 2 Container for splitting and adjusting. 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.splitcontainer; 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.container; 23 import godot.inputevent; 24 import godot.control; 25 import godot.canvasitem; 26 import godot.node; 27 /** 28 Container for splitting and adjusting. 29 30 Container for splitting two controls vertically or horizontally, with a grabber that allows adjusting the split offset or ratio. 31 */ 32 @GodotBaseClass struct SplitContainer 33 { 34 enum string _GODOT_internal_name = "SplitContainer"; 35 public: 36 @nogc nothrow: 37 union { godot_object _godot_object; Container _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 _classBinding 42 { 43 __gshared: 44 @GodotName("_gui_input") GodotMethod!(void, InputEvent) _guiInput; 45 @GodotName("set_split_offset") GodotMethod!(void, long) setSplitOffset; 46 @GodotName("get_split_offset") GodotMethod!(long) getSplitOffset; 47 @GodotName("set_collapsed") GodotMethod!(void, bool) setCollapsed; 48 @GodotName("is_collapsed") GodotMethod!(bool) isCollapsed; 49 @GodotName("set_dragger_visibility") GodotMethod!(void, long) setDraggerVisibility; 50 @GodotName("get_dragger_visibility") GodotMethod!(SplitContainer.DraggerVisibility) getDraggerVisibility; 51 } 52 bool opEquals(in SplitContainer other) const { return _godot_object.ptr is other._godot_object.ptr; } 53 SplitContainer opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; } 54 bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; } 55 mixin baseCasts; 56 static SplitContainer _new() 57 { 58 static godot_class_constructor constructor; 59 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("SplitContainer"); 60 if(constructor is null) return typeof(this).init; 61 return cast(SplitContainer)(constructor()); 62 } 63 @disable new(size_t s); 64 /// 65 enum DraggerVisibility : int 66 { 67 /** 68 The split dragger is visible. 69 */ 70 draggerVisible = 0, 71 /** 72 The split dragger is invisible. 73 */ 74 draggerHidden = 1, 75 /** 76 The split dragger is invisible and collapsed. 77 */ 78 draggerHiddenCollapsed = 2, 79 } 80 /// 81 enum Constants : int 82 { 83 draggerVisible = 0, 84 draggerHidden = 1, 85 draggerHiddenCollapsed = 2, 86 } 87 /** 88 89 */ 90 void _guiInput(InputEvent arg0) 91 { 92 Array _GODOT_args = Array.empty_array; 93 _GODOT_args.append(arg0); 94 String _GODOT_method_name = String("_gui_input"); 95 this.callv(_GODOT_method_name, _GODOT_args); 96 } 97 /** 98 99 */ 100 void setSplitOffset(in long offset) 101 { 102 checkClassBinding!(typeof(this))(); 103 ptrcall!(void)(_classBinding.setSplitOffset, _godot_object, offset); 104 } 105 /** 106 107 */ 108 long getSplitOffset() const 109 { 110 checkClassBinding!(typeof(this))(); 111 return ptrcall!(long)(_classBinding.getSplitOffset, _godot_object); 112 } 113 /** 114 115 */ 116 void setCollapsed(in bool collapsed) 117 { 118 checkClassBinding!(typeof(this))(); 119 ptrcall!(void)(_classBinding.setCollapsed, _godot_object, collapsed); 120 } 121 /** 122 123 */ 124 bool isCollapsed() const 125 { 126 checkClassBinding!(typeof(this))(); 127 return ptrcall!(bool)(_classBinding.isCollapsed, _godot_object); 128 } 129 /** 130 131 */ 132 void setDraggerVisibility(in long mode) 133 { 134 checkClassBinding!(typeof(this))(); 135 ptrcall!(void)(_classBinding.setDraggerVisibility, _godot_object, mode); 136 } 137 /** 138 139 */ 140 SplitContainer.DraggerVisibility getDraggerVisibility() const 141 { 142 checkClassBinding!(typeof(this))(); 143 return ptrcall!(SplitContainer.DraggerVisibility)(_classBinding.getDraggerVisibility, _godot_object); 144 } 145 /** 146 147 */ 148 @property long splitOffset() 149 { 150 return getSplitOffset(); 151 } 152 /// ditto 153 @property void splitOffset(long v) 154 { 155 setSplitOffset(v); 156 } 157 /** 158 159 */ 160 @property bool collapsed() 161 { 162 return isCollapsed(); 163 } 164 /// ditto 165 @property void collapsed(bool v) 166 { 167 setCollapsed(v); 168 } 169 /** 170 Determines whether the dragger is visible. 171 */ 172 @property SplitContainer.DraggerVisibility draggerVisibility() 173 { 174 return getDraggerVisibility(); 175 } 176 /// ditto 177 @property void draggerVisibility(long v) 178 { 179 setDraggerVisibility(v); 180 } 181 }