1 /** 2 Flat button helper class. 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.toolbutton; 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.button; 25 import godot.basebutton; 26 import godot.control; 27 import godot.canvasitem; 28 import godot.node; 29 /** 30 Flat button helper class. 31 32 This is a helper class to generate a flat $(D Button) (see $(D Button.flat)), creating a $(D ToolButton) is equivalent to: 33 34 35 var btn = Button.new() 36 btn.flat = true 37 38 39 */ 40 @GodotBaseClass struct ToolButton 41 { 42 package(godot) enum string _GODOT_internal_name = "ToolButton"; 43 public: 44 @nogc nothrow: 45 union { /** */ godot_object _godot_object; /** */ Button _GODOT_base; } 46 alias _GODOT_base this; 47 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 48 package(godot) __gshared bool _classBindingInitialized = false; 49 package(godot) static struct GDNativeClassBinding 50 { 51 __gshared: 52 } 53 /// 54 pragma(inline, true) bool opEquals(in ToolButton other) const 55 { return _godot_object.ptr is other._godot_object.ptr; } 56 /// 57 pragma(inline, true) typeof(null) opAssign(typeof(null) n) 58 { _godot_object.ptr = n; return null; } 59 /// 60 pragma(inline, true) bool opEquals(typeof(null) n) const 61 { return _godot_object.ptr is n; } 62 /// 63 size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; } 64 mixin baseCasts; 65 /// Construct a new instance of ToolButton. 66 /// Note: use `memnew!ToolButton` instead. 67 static ToolButton _new() 68 { 69 static godot_class_constructor constructor; 70 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("ToolButton"); 71 if(constructor is null) return typeof(this).init; 72 return cast(ToolButton)(constructor()); 73 } 74 @disable new(size_t s); 75 }