1 /**
2 A Visual Script node used to annotate the script.
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.visualscriptcomment;
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.visualscriptnode;
25 /**
26 A Visual Script node used to annotate the script.
27 
28 A Visual Script node used to display annotations in the script, so that code may be documented.
29 Comment nodes can be resized so they encompass a group of nodes.
30 */
31 @GodotBaseClass struct VisualScriptComment
32 {
33 	package(godot) enum string _GODOT_internal_name = "VisualScriptComment";
34 public:
35 @nogc nothrow:
36 	union { /** */ godot_object _godot_object; /** */ VisualScriptNode _GODOT_base; }
37 	alias _GODOT_base this;
38 	alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses);
39 	package(godot) __gshared bool _classBindingInitialized = false;
40 	package(godot) static struct GDNativeClassBinding
41 	{
42 		__gshared:
43 		@GodotName("get_description") GodotMethod!(String) getDescription;
44 		@GodotName("get_size") GodotMethod!(Vector2) getSize;
45 		@GodotName("get_title") GodotMethod!(String) getTitle;
46 		@GodotName("set_description") GodotMethod!(void, String) setDescription;
47 		@GodotName("set_size") GodotMethod!(void, Vector2) setSize;
48 		@GodotName("set_title") GodotMethod!(void, String) setTitle;
49 	}
50 	/// 
51 	pragma(inline, true) bool opEquals(in VisualScriptComment other) const
52 	{ return _godot_object.ptr is other._godot_object.ptr; }
53 	/// 
54 	pragma(inline, true) typeof(null) opAssign(typeof(null) n)
55 	{ _godot_object.ptr = n; return null; }
56 	/// 
57 	pragma(inline, true) bool opEquals(typeof(null) n) const
58 	{ return _godot_object.ptr is n; }
59 	/// 
60 	size_t toHash() const @trusted { return cast(size_t)_godot_object.ptr; }
61 	mixin baseCasts;
62 	/// Construct a new instance of VisualScriptComment.
63 	/// Note: use `memnew!VisualScriptComment` instead.
64 	static VisualScriptComment _new()
65 	{
66 		static godot_class_constructor constructor;
67 		if(constructor is null) constructor = _godot_api.godot_get_class_constructor("VisualScriptComment");
68 		if(constructor is null) return typeof(this).init;
69 		return cast(VisualScriptComment)(constructor());
70 	}
71 	@disable new(size_t s);
72 	/**
73 	
74 	*/
75 	String getDescription() const
76 	{
77 		checkClassBinding!(typeof(this))();
78 		return ptrcall!(String)(GDNativeClassBinding.getDescription, _godot_object);
79 	}
80 	/**
81 	
82 	*/
83 	Vector2 getSize() const
84 	{
85 		checkClassBinding!(typeof(this))();
86 		return ptrcall!(Vector2)(GDNativeClassBinding.getSize, _godot_object);
87 	}
88 	/**
89 	
90 	*/
91 	String getTitle() const
92 	{
93 		checkClassBinding!(typeof(this))();
94 		return ptrcall!(String)(GDNativeClassBinding.getTitle, _godot_object);
95 	}
96 	/**
97 	
98 	*/
99 	void setDescription(in String description)
100 	{
101 		checkClassBinding!(typeof(this))();
102 		ptrcall!(void)(GDNativeClassBinding.setDescription, _godot_object, description);
103 	}
104 	/**
105 	
106 	*/
107 	void setSize(in Vector2 size)
108 	{
109 		checkClassBinding!(typeof(this))();
110 		ptrcall!(void)(GDNativeClassBinding.setSize, _godot_object, size);
111 	}
112 	/**
113 	
114 	*/
115 	void setTitle(in String title)
116 	{
117 		checkClassBinding!(typeof(this))();
118 		ptrcall!(void)(GDNativeClassBinding.setTitle, _godot_object, title);
119 	}
120 	/**
121 	The text inside the comment node.
122 	*/
123 	@property String description()
124 	{
125 		return getDescription();
126 	}
127 	/// ditto
128 	@property void description(String v)
129 	{
130 		setDescription(v);
131 	}
132 	/**
133 	The comment node's size (in pixels).
134 	*/
135 	@property Vector2 size()
136 	{
137 		return getSize();
138 	}
139 	/// ditto
140 	@property void size(Vector2 v)
141 	{
142 		setSize(v);
143 	}
144 	/**
145 	The comment node's title.
146 	*/
147 	@property String title()
148 	{
149 		return getTitle();
150 	}
151 	/// ditto
152 	@property void title(String v)
153 	{
154 		setTitle(v);
155 	}
156 }