1 /** 2 $(D StyleBox) that displays a single line. 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.styleboxline; 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.classdb; 24 import godot.stylebox; 25 import godot.resource; 26 import godot.reference; 27 /** 28 $(D StyleBox) that displays a single line. 29 30 $(D StyleBox) that displays a single line of a given color and thickness. It can be used to draw things like separators. 31 */ 32 @GodotBaseClass struct StyleBoxLine 33 { 34 package(godot) enum string _GODOT_internal_name = "StyleBoxLine"; 35 public: 36 @nogc nothrow: 37 union { /** */ godot_object _godot_object; /** */ StyleBox _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("get_color") GodotMethod!(Color) getColor; 45 @GodotName("get_grow_begin") GodotMethod!(double) getGrowBegin; 46 @GodotName("get_grow_end") GodotMethod!(double) getGrowEnd; 47 @GodotName("get_thickness") GodotMethod!(long) getThickness; 48 @GodotName("is_vertical") GodotMethod!(bool) isVertical; 49 @GodotName("set_color") GodotMethod!(void, Color) setColor; 50 @GodotName("set_grow_begin") GodotMethod!(void, double) setGrowBegin; 51 @GodotName("set_grow_end") GodotMethod!(void, double) setGrowEnd; 52 @GodotName("set_thickness") GodotMethod!(void, long) setThickness; 53 @GodotName("set_vertical") GodotMethod!(void, bool) setVertical; 54 } 55 /// 56 pragma(inline, true) bool opEquals(in StyleBoxLine other) const 57 { return _godot_object.ptr is other._godot_object.ptr; } 58 /// 59 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 60 { _godot_object.ptr = n; return null; } 61 /// 62 pragma(inline, true) bool opEquals(typeof(null) n) const 63 { return _godot_object.ptr is n; } 64 /// 65 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 66 mixin baseCasts; 67 /// Construct a new instance of StyleBoxLine. 68 /// Note: use `memnew!StyleBoxLine` instead. 69 static StyleBoxLine _new() 70 { 71 static godot_class_constructor constructor; 72 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("StyleBoxLine"); 73 if(constructor is null) return typeof(this).init; 74 return cast(StyleBoxLine)(constructor()); 75 } 76 @disable new(size_t s); 77 /** 78 79 */ 80 Color getColor() const 81 { 82 checkClassBinding!(typeof(this))(); 83 return ptrcall!(Color)(GDNativeClassBinding.getColor, _godot_object); 84 } 85 /** 86 87 */ 88 double getGrowBegin() const 89 { 90 checkClassBinding!(typeof(this))(); 91 return ptrcall!(double)(GDNativeClassBinding.getGrowBegin, _godot_object); 92 } 93 /** 94 95 */ 96 double getGrowEnd() const 97 { 98 checkClassBinding!(typeof(this))(); 99 return ptrcall!(double)(GDNativeClassBinding.getGrowEnd, _godot_object); 100 } 101 /** 102 103 */ 104 long getThickness() const 105 { 106 checkClassBinding!(typeof(this))(); 107 return ptrcall!(long)(GDNativeClassBinding.getThickness, _godot_object); 108 } 109 /** 110 111 */ 112 bool isVertical() const 113 { 114 checkClassBinding!(typeof(this))(); 115 return ptrcall!(bool)(GDNativeClassBinding.isVertical, _godot_object); 116 } 117 /** 118 119 */ 120 void setColor(in Color color) 121 { 122 checkClassBinding!(typeof(this))(); 123 ptrcall!(void)(GDNativeClassBinding.setColor, _godot_object, color); 124 } 125 /** 126 127 */ 128 void setGrowBegin(in double offset) 129 { 130 checkClassBinding!(typeof(this))(); 131 ptrcall!(void)(GDNativeClassBinding.setGrowBegin, _godot_object, offset); 132 } 133 /** 134 135 */ 136 void setGrowEnd(in double offset) 137 { 138 checkClassBinding!(typeof(this))(); 139 ptrcall!(void)(GDNativeClassBinding.setGrowEnd, _godot_object, offset); 140 } 141 /** 142 143 */ 144 void setThickness(in long thickness) 145 { 146 checkClassBinding!(typeof(this))(); 147 ptrcall!(void)(GDNativeClassBinding.setThickness, _godot_object, thickness); 148 } 149 /** 150 151 */ 152 void setVertical(in bool vertical) 153 { 154 checkClassBinding!(typeof(this))(); 155 ptrcall!(void)(GDNativeClassBinding.setVertical, _godot_object, vertical); 156 } 157 /** 158 The line's color. 159 */ 160 @property Color color() 161 { 162 return getColor(); 163 } 164 /// ditto 165 @property void color(Color v) 166 { 167 setColor(v); 168 } 169 /** 170 The number of pixels the line will extend before the $(D StyleBoxLine)'s bounds. If set to a negative value, the line will begin inside the $(D StyleBoxLine)'s bounds. 171 */ 172 @property double growBegin() 173 { 174 return getGrowBegin(); 175 } 176 /// ditto 177 @property void growBegin(double v) 178 { 179 setGrowBegin(v); 180 } 181 /** 182 The number of pixels the line will extend past the $(D StyleBoxLine)'s bounds. If set to a negative value, the line will end inside the $(D StyleBoxLine)'s bounds. 183 */ 184 @property double growEnd() 185 { 186 return getGrowEnd(); 187 } 188 /// ditto 189 @property void growEnd(double v) 190 { 191 setGrowEnd(v); 192 } 193 /** 194 The line's thickness in pixels. 195 */ 196 @property long thickness() 197 { 198 return getThickness(); 199 } 200 /// ditto 201 @property void thickness(long v) 202 { 203 setThickness(v); 204 } 205 /** 206 If `true`, the line will be vertical. If `false`, the line will be horizontal. 207 */ 208 @property bool vertical() 209 { 210 return isVertical(); 211 } 212 /// ditto 213 @property void vertical(bool v) 214 { 215 setVertical(v); 216 } 217 }