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.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.button; 24 import godot.basebutton; 25 import godot.control; 26 import godot.canvasitem; 27 import godot.node; 28 /** 29 Flat button helper class. 30 31 This is a helper class to generate a flat $(D Button) (see $(D Button.setFlat)), creating a ToolButton is equivalent to: 32 33 34 var btn = Button.new() 35 btn.set_flat(true) 36 37 38 */ 39 @GodotBaseClass struct ToolButton 40 { 41 enum string _GODOT_internal_name = "ToolButton"; 42 public: 43 @nogc nothrow: 44 union { godot_object _godot_object; Button _GODOT_base; } 45 alias _GODOT_base this; 46 alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses); 47 package(godot) __gshared bool _classBindingInitialized = false; 48 package(godot) static struct _classBinding 49 { 50 __gshared: 51 } 52 bool opEquals(in ToolButton other) const { return _godot_object.ptr is other._godot_object.ptr; } 53 ToolButton 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 ToolButton _new() 57 { 58 static godot_class_constructor constructor; 59 if(constructor is null) constructor = _godot_api.godot_get_class_constructor("ToolButton"); 60 if(constructor is null) return typeof(this).init; 61 return cast(ToolButton)(constructor()); 62 } 63 @disable new(size_t s); 64 }