1 /**
2 Base class for window dialogs.
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.windowdialog;
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.popup;
24 import godot.inputevent;
25 import godot.texturebutton;
26 import godot.control;
27 import godot.canvasitem;
28 import godot.node;
29 /**
30 Base class for window dialogs.
31 
32 Windowdialog is the base class for all window-based dialogs. It's a by-default toplevel $(D Control) that draws a window decoration and allows motion and resizing.
33 */
34 @GodotBaseClass struct WindowDialog
35 {
36 	enum string _GODOT_internal_name = "WindowDialog";
37 public:
38 @nogc nothrow:
39 	union { godot_object _godot_object; Popup _GODOT_base; }
40 	alias _GODOT_base this;
41 	alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses);
42 	package(godot) __gshared bool _classBindingInitialized = false;
43 	package(godot) static struct _classBinding
44 	{
45 		__gshared:
46 		@GodotName("_gui_input") GodotMethod!(void, InputEvent) _guiInput;
47 		@GodotName("set_title") GodotMethod!(void, String) setTitle;
48 		@GodotName("get_title") GodotMethod!(String) getTitle;
49 		@GodotName("set_resizable") GodotMethod!(void, bool) setResizable;
50 		@GodotName("get_resizable") GodotMethod!(bool) getResizable;
51 		@GodotName("_closed") GodotMethod!(void) _closed;
52 		@GodotName("get_close_button") GodotMethod!(TextureButton) getCloseButton;
53 	}
54 	bool opEquals(in WindowDialog other) const { return _godot_object.ptr is other._godot_object.ptr; }
55 	WindowDialog opAssign(T : typeof(null))(T n) { _godot_object.ptr = null; }
56 	bool opEquals(typeof(null) n) const { return _godot_object.ptr is null; }
57 	mixin baseCasts;
58 	static WindowDialog _new()
59 	{
60 		static godot_class_constructor constructor;
61 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("WindowDialog");
62 		if(constructor is null) return typeof(this).init;
63 		return cast(WindowDialog)(constructor());
64 	}
65 	@disable new(size_t s);
66 	/**
67 	
68 	*/
69 	void _guiInput(InputEvent arg0)
70 	{
71 		Array _GODOT_args = Array.empty_array;
72 		_GODOT_args.append(arg0);
73 		String _GODOT_method_name = String("_gui_input");
74 		this.callv(_GODOT_method_name, _GODOT_args);
75 	}
76 	/**
77 	
78 	*/
79 	void setTitle(StringArg0)(in StringArg0 title)
80 	{
81 		checkClassBinding!(typeof(this))();
82 		ptrcall!(void)(_classBinding.setTitle, _godot_object, title);
83 	}
84 	/**
85 	
86 	*/
87 	String getTitle() const
88 	{
89 		checkClassBinding!(typeof(this))();
90 		return ptrcall!(String)(_classBinding.getTitle, _godot_object);
91 	}
92 	/**
93 	
94 	*/
95 	void setResizable(in bool resizable)
96 	{
97 		checkClassBinding!(typeof(this))();
98 		ptrcall!(void)(_classBinding.setResizable, _godot_object, resizable);
99 	}
100 	/**
101 	
102 	*/
103 	bool getResizable() const
104 	{
105 		checkClassBinding!(typeof(this))();
106 		return ptrcall!(bool)(_classBinding.getResizable, _godot_object);
107 	}
108 	/**
109 	
110 	*/
111 	void _closed()
112 	{
113 		Array _GODOT_args = Array.empty_array;
114 		String _GODOT_method_name = String("_closed");
115 		this.callv(_GODOT_method_name, _GODOT_args);
116 	}
117 	/**
118 	Return the close $(D TextureButton).
119 	*/
120 	TextureButton getCloseButton()
121 	{
122 		checkClassBinding!(typeof(this))();
123 		return ptrcall!(TextureButton)(_classBinding.getCloseButton, _godot_object);
124 	}
125 	/**
126 	The text displayed in the window's title bar.
127 	*/
128 	@property String windowTitle()
129 	{
130 		return getTitle();
131 	}
132 	/// ditto
133 	@property void windowTitle(String v)
134 	{
135 		setTitle(v);
136 	}
137 	/**
138 	If `true` the user can resize the window. Default value: `false`.
139 	*/
140 	@property bool resizable()
141 	{
142 		return getResizable();
143 	}
144 	/// ditto
145 	@property void resizable(bool v)
146 	{
147 		setResizable(v);
148 	}
149 }