summaryrefslogtreecommitdiffstats
path: root/test/src/example.h
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2021-08-19 14:51:41 -0300
committerBastiaan Olij <mux213@gmail.com>2021-09-27 23:08:08 +1000
commitb3a4a2cf9360cad559d11eeab8940c1cfc0b32d0 (patch)
treeb06ac4a05a7904a0ebd7f468f32a8012fda64883 /test/src/example.h
parent8bcf32a61946620017f61568f4aa10070db4bd4e (diff)
downloadredot-cpp-b3a4a2cf9360cad559d11eeab8940c1cfc0b32d0.tar.gz
Add sample test project
Diffstat (limited to 'test/src/example.h')
-rw-r--r--test/src/example.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/test/src/example.h b/test/src/example.h
new file mode 100644
index 0000000..0b054e5
--- /dev/null
+++ b/test/src/example.h
@@ -0,0 +1,50 @@
+#ifndef EXAMPLE_CLASS_H
+#define EXAMPLE_CLASS_H
+
+#include <godot_cpp/classes/control.hpp>
+#include <godot_cpp/classes/global_constants.hpp>
+#include <godot_cpp/classes/viewport.hpp>
+
+#include <godot_cpp/core/binder_common.hpp>
+
+using namespace godot;
+
+class Example : public Control {
+ GDCLASS(Example, Control);
+
+protected:
+ static void _bind_methods();
+
+private:
+ Vector2 custom_position;
+
+public:
+ // Constants.
+ enum Constants {
+ FIRST,
+ ANSWER_TO_EVERYTHING = 42,
+ };
+
+ enum {
+ CONSTANT_WITHOUT_ENUM = 314,
+ };
+
+ // Functions
+ void simple_func();
+ void simple_const_func() const;
+ String return_something(const String &base);
+ Viewport *return_something_const() const;
+ Variant varargs_func(const Variant **args, GDNativeInt arg_count, GDNativeCallError &error);
+ void emit_custom_signal(const String &name, int value);
+
+ // Property
+ void set_custom_position(const Vector2 &pos);
+ Vector2 get_custom_position() const;
+
+ // Virtual function override
+ virtual bool _has_point(const Vector2 &point);
+};
+
+VARIANT_ENUM_CAST(Example, Constants);
+
+#endif // ! EXAMPLE_CLASS_H