Debian Codegraph @

modules/mono/interop_types.h

raw symbols SCIP
1 /**************************************************************************/
2 /* interop_types.h */
3 /**************************************************************************/
4 /* This file is part of: */
5 /* GODOT ENGINE */
6 /* https://godotengine.org */
7 /**************************************************************************/
8 /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
9 /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
10 /* */
11 /* Permission is hereby granted, free of charge, to any person obtaining */
12 /* a copy of this software and associated documentation files (the */
13 /* "Software"), to deal in the Software without restriction, including */
14 /* without limitation the rights to use, copy, modify, merge, publish, */
15 /* distribute, sublicense, and/or sell copies of the Software, and to */
16 /* permit persons to whom the Software is furnished to do so, subject to */
17 /* the following conditions: */
18 /* */
19 /* The above copyright notice and this permission notice shall be */
20 /* included in all copies or substantial portions of the Software. */
21 /* */
22 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
23 /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
24 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
25 /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
26 /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
27 /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
28 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
29 /**************************************************************************/
30
31 #pragma once
32
33 #include "core/math/math_defs.h"
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 // This is taken from the old GDNative, which was removed.
40
41 #define GODOT_VARIANT_SIZE (sizeof(real_t) * 4 + sizeof(int64_t))
42
43 typedef struct {
44 uint8_t _dont_touch_that[GODOT_VARIANT_SIZE];
45 } godot_variant;
46
47 #define GODOT_ARRAY_SIZE sizeof(void *)
48
49 typedef struct {
50 uint8_t _dont_touch_that[GODOT_ARRAY_SIZE];
51 } godot_array;
52
53 #define GODOT_DICTIONARY_SIZE sizeof(void *)
54
55 typedef struct {
56 uint8_t _dont_touch_that[GODOT_DICTIONARY_SIZE];
57 } godot_dictionary;
58
59 #define GODOT_STRING_SIZE sizeof(void *)
60
61 typedef struct {
62 uint8_t _dont_touch_that[GODOT_STRING_SIZE];
63 } godot_string;
64
65 #define GODOT_STRING_NAME_SIZE sizeof(void *)
66
67 typedef struct {
68 uint8_t _dont_touch_that[GODOT_STRING_NAME_SIZE];
69 } godot_string_name;
70
71 #define GODOT_PACKED_ARRAY_SIZE (2 * sizeof(void *))
72
73 typedef struct {
74 uint8_t _dont_touch_that[GODOT_PACKED_ARRAY_SIZE];
75 } godot_packed_array;
76
77 #define GODOT_VECTOR2_SIZE (sizeof(real_t) * 2)
78
79 typedef struct {
80 uint8_t _dont_touch_that[GODOT_VECTOR2_SIZE];
81 } godot_vector2;
82
83 #define GODOT_VECTOR2I_SIZE (sizeof(int32_t) * 2)
84
85 typedef struct {
86 uint8_t _dont_touch_that[GODOT_VECTOR2I_SIZE];
87 } godot_vector2i;
88
89 #define GODOT_RECT2_SIZE (sizeof(real_t) * 4)
90
91 typedef struct godot_rect2 {
92 uint8_t _dont_touch_that[GODOT_RECT2_SIZE];
93 } godot_rect2;
94
95 #define GODOT_RECT2I_SIZE (sizeof(int32_t) * 4)
96
97 typedef struct godot_rect2i {
98 uint8_t _dont_touch_that[GODOT_RECT2I_SIZE];
99 } godot_rect2i;
100
101 #define GODOT_VECTOR3_SIZE (sizeof(real_t) * 3)
102
103 typedef struct {
104 uint8_t _dont_touch_that[GODOT_VECTOR3_SIZE];
105 } godot_vector3;
106
107 #define GODOT_VECTOR3I_SIZE (sizeof(int32_t) * 3)
108
109 typedef struct {
110 uint8_t _dont_touch_that[GODOT_VECTOR3I_SIZE];
111 } godot_vector3i;
112
113 #define GODOT_TRANSFORM2D_SIZE (sizeof(real_t) * 6)
114
115 typedef struct {
116 uint8_t _dont_touch_that[GODOT_TRANSFORM2D_SIZE];
117 } godot_transform2d;
118
119 #define GODOT_VECTOR4_SIZE (sizeof(real_t) * 4)
120
121 typedef struct {
122 uint8_t _dont_touch_that[GODOT_VECTOR4_SIZE];
123 } godot_vector4;
124
125 #define GODOT_VECTOR4I_SIZE (sizeof(int32_t) * 4)
126
127 typedef struct {
128 uint8_t _dont_touch_that[GODOT_VECTOR4I_SIZE];
129 } godot_vector4i;
130
131 #define GODOT_PLANE_SIZE (sizeof(real_t) * 4)
132
133 typedef struct {
134 uint8_t _dont_touch_that[GODOT_PLANE_SIZE];
135 } godot_plane;
136
137 #define GODOT_QUATERNION_SIZE (sizeof(real_t) * 4)
138
139 typedef struct {
140 uint8_t _dont_touch_that[GODOT_QUATERNION_SIZE];
141 } godot_quaternion;
142
143 #define GODOT_AABB_SIZE (sizeof(real_t) * 6)
144
145 typedef struct {
146 uint8_t _dont_touch_that[GODOT_AABB_SIZE];
147 } godot_aabb;
148
149 #define GODOT_BASIS_SIZE (sizeof(real_t) * 9)
150
151 typedef struct {
152 uint8_t _dont_touch_that[GODOT_BASIS_SIZE];
153 } godot_basis;
154
155 #define GODOT_TRANSFORM3D_SIZE (sizeof(real_t) * 12)
156
157 typedef struct {
158 uint8_t _dont_touch_that[GODOT_TRANSFORM3D_SIZE];
159 } godot_transform3d;
160
161 #define GODOT_PROJECTION_SIZE (sizeof(real_t) * 4 * 4)
162
163 typedef struct {
164 uint8_t _dont_touch_that[GODOT_PROJECTION_SIZE];
165 } godot_projection;
166
167 // Colors should always use 32-bit floats, so don't use real_t here.
168 #define GODOT_COLOR_SIZE (sizeof(float) * 4)
169
170 typedef struct {
171 uint8_t _dont_touch_that[GODOT_COLOR_SIZE];
172 } godot_color;
173
174 #define GODOT_NODE_PATH_SIZE sizeof(void *)
175
176 typedef struct {
177 uint8_t _dont_touch_that[GODOT_NODE_PATH_SIZE];
178 } godot_node_path;
179
180 #define GODOT_RID_SIZE sizeof(uint64_t)
181
182 typedef struct {
183 uint8_t _dont_touch_that[GODOT_RID_SIZE];
184 } godot_rid;
185
186 // Alignment hardcoded in `core/variant/callable.h`.
187 #define GODOT_CALLABLE_SIZE (16)
188
189 typedef struct {
190 uint8_t _dont_touch_that[GODOT_CALLABLE_SIZE];
191 } godot_callable;
192
193 // Alignment hardcoded in `core/variant/callable.h`.
194 #define GODOT_SIGNAL_SIZE (16)
195
196 typedef struct {
197 uint8_t _dont_touch_that[GODOT_SIGNAL_SIZE];
198 } godot_signal;
199
200 #ifdef __cplusplus
201 }
202 #endif