variant.gen.go 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849
  1. // Copyright © 2019 - 2020 Oscar Campos <oscar.campos@thepimpam.com>
  2. // Copyright © 2017 - William Edwards
  3. //
  4. // Licensed under the Apache License, Version 2.0 (the "License");
  5. // you may not use this file except in compliance with the License.
  6. // You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software
  11. // distributed under the License is distributed on an "AS IS" BASIS,
  12. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. // See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. package gdnative
  16. // ==================================================================
  17. // This file was autogenerated by PimPam GDNative-Go binding tools
  18. // Please do not modify this file, any change will be lost
  19. // ==================================================================
  20. /*
  21. #include "gdnative.gen.h"
  22. #include <gdnative/variant.h>
  23. // Include all headers for now. TODO: Look up all the required
  24. // headers we need to import based on the method arguments and return types.
  25. #include <gdnative/aabb.h>
  26. #include <gdnative/array.h>
  27. #include <gdnative/basis.h>
  28. #include <gdnative/color.h>
  29. #include <gdnative/dictionary.h>
  30. #include <gdnative/gdnative.h>
  31. #include <gdnative/node_path.h>
  32. #include <gdnative/plane.h>
  33. #include <gdnative/pool_arrays.h>
  34. #include <gdnative/quat.h>
  35. #include <gdnative/rect2.h>
  36. #include <gdnative/rid.h>
  37. #include <gdnative/string.h>
  38. #include <gdnative/string_name.h>
  39. #include <gdnative/transform.h>
  40. #include <gdnative/transform2d.h>
  41. #include <gdnative/variant.h>
  42. #include <gdnative/vector2.h>
  43. #include <gdnative/vector3.h>
  44. #include <gdnative_api_struct.gen.h>
  45. */
  46. import "C"
  47. import "unsafe"
  48. // NewEmptyVariant will return a pointer to an empty
  49. // initialized Variant. This is primarily used in
  50. // conjunction with MethodBindPtrCall.
  51. func NewEmptyVariant() Pointer {
  52. var obj C.godot_variant
  53. return Pointer{base: unsafe.Pointer(&obj)}
  54. }
  55. // NewPointerFromVariant will return an unsafe pointer to the given
  56. // object. This is primarily used in conjunction with MethodBindPtrCall.
  57. func NewPointerFromVariant(obj Variant) Pointer {
  58. return Pointer{base: unsafe.Pointer(obj.getBase())}
  59. }
  60. // NewVariantFromPointer will return a Variant from the
  61. // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
  62. func NewVariantFromPointer(ptr Pointer) Variant {
  63. return Variant{base: (*C.godot_variant)(ptr.getBase())}
  64. }
  65. // Variant data structure wrapper
  66. type Variant struct {
  67. base *C.godot_variant
  68. }
  69. // returns the wrapped C base data type for this type
  70. func (gdt Variant) getBase() *C.godot_variant {
  71. return gdt.base
  72. }
  73. // NewVariantCopy godot_variant_new_copy [[godot_variant * r_dest] [const godot_variant * p_src]] void
  74. func NewVariantCopy(src Variant) Variant {
  75. var dest C.godot_variant
  76. arg1 := src.getBase()
  77. C.go_godot_variant_new_copy(GDNative.api, &dest, arg1)
  78. return Variant{base: &dest}
  79. }
  80. // NewVariantNil godot_variant_new_nil [[godot_variant * r_dest]] void
  81. func NewVariantNil() Variant {
  82. var dest C.godot_variant
  83. C.go_godot_variant_new_nil(GDNative.api, &dest)
  84. return Variant{base: &dest}
  85. }
  86. // NewVariantBool godot_variant_new_bool [[godot_variant * r_dest] [const godot_bool p_b]] void
  87. func NewVariantBool(b Bool) Variant {
  88. var dest C.godot_variant
  89. arg1 := b.getBase()
  90. C.go_godot_variant_new_bool(GDNative.api, &dest, arg1)
  91. return Variant{base: &dest}
  92. }
  93. // NewVariantUint godot_variant_new_uint [[godot_variant * r_dest] [const uint64_t p_i]] void
  94. func NewVariantUint(i Uint64T) Variant {
  95. var dest C.godot_variant
  96. arg1 := i.getBase()
  97. C.go_godot_variant_new_uint(GDNative.api, &dest, arg1)
  98. return Variant{base: &dest}
  99. }
  100. // NewVariantInt godot_variant_new_int [[godot_variant * r_dest] [const int64_t p_i]] void
  101. func NewVariantInt(i Int64T) Variant {
  102. var dest C.godot_variant
  103. arg1 := i.getBase()
  104. C.go_godot_variant_new_int(GDNative.api, &dest, arg1)
  105. return Variant{base: &dest}
  106. }
  107. // NewVariantReal godot_variant_new_real [[godot_variant * r_dest] [const double p_r]] void
  108. func NewVariantReal(r Double) Variant {
  109. var dest C.godot_variant
  110. arg1 := r.getBase()
  111. C.go_godot_variant_new_real(GDNative.api, &dest, arg1)
  112. return Variant{base: &dest}
  113. }
  114. // NewVariantString godot_variant_new_string [[godot_variant * r_dest] [const godot_string * p_s]] void
  115. func NewVariantString(s String) Variant {
  116. var dest C.godot_variant
  117. arg1 := s.getBase()
  118. C.go_godot_variant_new_string(GDNative.api, &dest, arg1)
  119. return Variant{base: &dest}
  120. }
  121. // NewVariantVector2 godot_variant_new_vector2 [[godot_variant * r_dest] [const godot_vector2 * p_v2]] void
  122. func NewVariantVector2(v2 Vector2) Variant {
  123. var dest C.godot_variant
  124. arg1 := v2.getBase()
  125. C.go_godot_variant_new_vector2(GDNative.api, &dest, arg1)
  126. return Variant{base: &dest}
  127. }
  128. // NewVariantRect2 godot_variant_new_rect2 [[godot_variant * r_dest] [const godot_rect2 * p_rect2]] void
  129. func NewVariantRect2(rect2 Rect2) Variant {
  130. var dest C.godot_variant
  131. arg1 := rect2.getBase()
  132. C.go_godot_variant_new_rect2(GDNative.api, &dest, arg1)
  133. return Variant{base: &dest}
  134. }
  135. // NewVariantVector3 godot_variant_new_vector3 [[godot_variant * r_dest] [const godot_vector3 * p_v3]] void
  136. func NewVariantVector3(v3 Vector3) Variant {
  137. var dest C.godot_variant
  138. arg1 := v3.getBase()
  139. C.go_godot_variant_new_vector3(GDNative.api, &dest, arg1)
  140. return Variant{base: &dest}
  141. }
  142. // NewVariantTransform2D godot_variant_new_transform2d [[godot_variant * r_dest] [const godot_transform2d * p_t2d]] void
  143. func NewVariantTransform2D(t2D Transform2D) Variant {
  144. var dest C.godot_variant
  145. arg1 := t2D.getBase()
  146. C.go_godot_variant_new_transform2d(GDNative.api, &dest, arg1)
  147. return Variant{base: &dest}
  148. }
  149. // NewVariantPlane godot_variant_new_plane [[godot_variant * r_dest] [const godot_plane * p_plane]] void
  150. func NewVariantPlane(plane Plane) Variant {
  151. var dest C.godot_variant
  152. arg1 := plane.getBase()
  153. C.go_godot_variant_new_plane(GDNative.api, &dest, arg1)
  154. return Variant{base: &dest}
  155. }
  156. // NewVariantQuat godot_variant_new_quat [[godot_variant * r_dest] [const godot_quat * p_quat]] void
  157. func NewVariantQuat(quat Quat) Variant {
  158. var dest C.godot_variant
  159. arg1 := quat.getBase()
  160. C.go_godot_variant_new_quat(GDNative.api, &dest, arg1)
  161. return Variant{base: &dest}
  162. }
  163. // NewVariantAabb godot_variant_new_aabb [[godot_variant * r_dest] [const godot_aabb * p_aabb]] void
  164. func NewVariantAabb(aabb Aabb) Variant {
  165. var dest C.godot_variant
  166. arg1 := aabb.getBase()
  167. C.go_godot_variant_new_aabb(GDNative.api, &dest, arg1)
  168. return Variant{base: &dest}
  169. }
  170. // NewVariantBasis godot_variant_new_basis [[godot_variant * r_dest] [const godot_basis * p_basis]] void
  171. func NewVariantBasis(basis Basis) Variant {
  172. var dest C.godot_variant
  173. arg1 := basis.getBase()
  174. C.go_godot_variant_new_basis(GDNative.api, &dest, arg1)
  175. return Variant{base: &dest}
  176. }
  177. // NewVariantTransform godot_variant_new_transform [[godot_variant * r_dest] [const godot_transform * p_trans]] void
  178. func NewVariantTransform(trans Transform) Variant {
  179. var dest C.godot_variant
  180. arg1 := trans.getBase()
  181. C.go_godot_variant_new_transform(GDNative.api, &dest, arg1)
  182. return Variant{base: &dest}
  183. }
  184. // NewVariantColor godot_variant_new_color [[godot_variant * r_dest] [const godot_color * p_color]] void
  185. func NewVariantColor(color Color) Variant {
  186. var dest C.godot_variant
  187. arg1 := color.getBase()
  188. C.go_godot_variant_new_color(GDNative.api, &dest, arg1)
  189. return Variant{base: &dest}
  190. }
  191. // NewVariantNodePath godot_variant_new_node_path [[godot_variant * r_dest] [const godot_node_path * p_np]] void
  192. func NewVariantNodePath(np NodePath) Variant {
  193. var dest C.godot_variant
  194. arg1 := np.getBase()
  195. C.go_godot_variant_new_node_path(GDNative.api, &dest, arg1)
  196. return Variant{base: &dest}
  197. }
  198. // NewVariantRid godot_variant_new_rid [[godot_variant * r_dest] [const godot_rid * p_rid]] void
  199. func NewVariantRid(rid Rid) Variant {
  200. var dest C.godot_variant
  201. arg1 := rid.getBase()
  202. C.go_godot_variant_new_rid(GDNative.api, &dest, arg1)
  203. return Variant{base: &dest}
  204. }
  205. // NewVariantObject godot_variant_new_object [[godot_variant * r_dest] [const godot_object * p_obj]] void
  206. func NewVariantObject(obj Object) Variant {
  207. var dest C.godot_variant
  208. arg1 := unsafe.Pointer(obj.getBase())
  209. C.go_godot_variant_new_object(GDNative.api, &dest, arg1)
  210. return Variant{base: &dest}
  211. }
  212. // NewVariantDictionary godot_variant_new_dictionary [[godot_variant * r_dest] [const godot_dictionary * p_dict]] void
  213. func NewVariantDictionary(dict Dictionary) Variant {
  214. var dest C.godot_variant
  215. arg1 := dict.getBase()
  216. C.go_godot_variant_new_dictionary(GDNative.api, &dest, arg1)
  217. return Variant{base: &dest}
  218. }
  219. // NewVariantArray godot_variant_new_array [[godot_variant * r_dest] [const godot_array * p_arr]] void
  220. func NewVariantArray(arr Array) Variant {
  221. var dest C.godot_variant
  222. arg1 := arr.getBase()
  223. C.go_godot_variant_new_array(GDNative.api, &dest, arg1)
  224. return Variant{base: &dest}
  225. }
  226. // NewVariantPoolByteArray godot_variant_new_pool_byte_array [[godot_variant * r_dest] [const godot_pool_byte_array * p_pba]] void
  227. func NewVariantPoolByteArray(pba PoolByteArray) Variant {
  228. var dest C.godot_variant
  229. arg1 := pba.getBase()
  230. C.go_godot_variant_new_pool_byte_array(GDNative.api, &dest, arg1)
  231. return Variant{base: &dest}
  232. }
  233. // NewVariantPoolIntArray godot_variant_new_pool_int_array [[godot_variant * r_dest] [const godot_pool_int_array * p_pia]] void
  234. func NewVariantPoolIntArray(pia PoolIntArray) Variant {
  235. var dest C.godot_variant
  236. arg1 := pia.getBase()
  237. C.go_godot_variant_new_pool_int_array(GDNative.api, &dest, arg1)
  238. return Variant{base: &dest}
  239. }
  240. // NewVariantPoolRealArray godot_variant_new_pool_real_array [[godot_variant * r_dest] [const godot_pool_real_array * p_pra]] void
  241. func NewVariantPoolRealArray(pra PoolRealArray) Variant {
  242. var dest C.godot_variant
  243. arg1 := pra.getBase()
  244. C.go_godot_variant_new_pool_real_array(GDNative.api, &dest, arg1)
  245. return Variant{base: &dest}
  246. }
  247. // NewVariantPoolStringArray godot_variant_new_pool_string_array [[godot_variant * r_dest] [const godot_pool_string_array * p_psa]] void
  248. func NewVariantPoolStringArray(psa PoolStringArray) Variant {
  249. var dest C.godot_variant
  250. arg1 := psa.getBase()
  251. C.go_godot_variant_new_pool_string_array(GDNative.api, &dest, arg1)
  252. return Variant{base: &dest}
  253. }
  254. // NewVariantPoolVector2Array godot_variant_new_pool_vector2_array [[godot_variant * r_dest] [const godot_pool_vector2_array * p_pv2a]] void
  255. func NewVariantPoolVector2Array(pv2A PoolVector2Array) Variant {
  256. var dest C.godot_variant
  257. arg1 := pv2A.getBase()
  258. C.go_godot_variant_new_pool_vector2_array(GDNative.api, &dest, arg1)
  259. return Variant{base: &dest}
  260. }
  261. // NewVariantPoolVector3Array godot_variant_new_pool_vector3_array [[godot_variant * r_dest] [const godot_pool_vector3_array * p_pv3a]] void
  262. func NewVariantPoolVector3Array(pv3A PoolVector3Array) Variant {
  263. var dest C.godot_variant
  264. arg1 := pv3A.getBase()
  265. C.go_godot_variant_new_pool_vector3_array(GDNative.api, &dest, arg1)
  266. return Variant{base: &dest}
  267. }
  268. // NewVariantPoolColorArray godot_variant_new_pool_color_array [[godot_variant * r_dest] [const godot_pool_color_array * p_pca]] void
  269. func NewVariantPoolColorArray(pca PoolColorArray) Variant {
  270. var dest C.godot_variant
  271. arg1 := pca.getBase()
  272. C.go_godot_variant_new_pool_color_array(GDNative.api, &dest, arg1)
  273. return Variant{base: &dest}
  274. }
  275. // AsBool godot_variant_as_bool [[const godot_variant * p_self]] godot_bool
  276. func (gdt *Variant) AsBool() Bool {
  277. arg0 := gdt.getBase()
  278. ret := C.go_godot_variant_as_bool(GDNative.api, arg0)
  279. return Bool(ret)
  280. }
  281. // AsUint godot_variant_as_uint [[const godot_variant * p_self]] uint64_t
  282. func (gdt *Variant) AsUint() Uint64T {
  283. arg0 := gdt.getBase()
  284. ret := C.go_godot_variant_as_uint(GDNative.api, arg0)
  285. return Uint64T(ret)
  286. }
  287. // AsInt godot_variant_as_int [[const godot_variant * p_self]] int64_t
  288. func (gdt *Variant) AsInt() Int64T {
  289. arg0 := gdt.getBase()
  290. ret := C.go_godot_variant_as_int(GDNative.api, arg0)
  291. return Int64T(ret)
  292. }
  293. // AsReal godot_variant_as_real [[const godot_variant * p_self]] double
  294. func (gdt *Variant) AsReal() Double {
  295. arg0 := gdt.getBase()
  296. ret := C.go_godot_variant_as_real(GDNative.api, arg0)
  297. return Double(ret)
  298. }
  299. // AsString godot_variant_as_string [[const godot_variant * p_self]] godot_string
  300. func (gdt *Variant) AsString() String {
  301. arg0 := gdt.getBase()
  302. ret := C.go_godot_variant_as_string(GDNative.api, arg0)
  303. utfStr := C.go_godot_string_utf8(GDNative.api, &ret)
  304. char := C.go_godot_char_string_get_data(GDNative.api, &utfStr)
  305. goStr := C.GoString(char)
  306. C.go_godot_char_string_destroy(GDNative.api, &utfStr)
  307. return String(goStr)
  308. }
  309. // AsVector2 godot_variant_as_vector2 [[const godot_variant * p_self]] godot_vector2
  310. func (gdt *Variant) AsVector2() Vector2 {
  311. arg0 := gdt.getBase()
  312. ret := C.go_godot_variant_as_vector2(GDNative.api, arg0)
  313. return Vector2{base: &ret}
  314. }
  315. // AsRect2 godot_variant_as_rect2 [[const godot_variant * p_self]] godot_rect2
  316. func (gdt *Variant) AsRect2() Rect2 {
  317. arg0 := gdt.getBase()
  318. ret := C.go_godot_variant_as_rect2(GDNative.api, arg0)
  319. return Rect2{base: &ret}
  320. }
  321. // AsVector3 godot_variant_as_vector3 [[const godot_variant * p_self]] godot_vector3
  322. func (gdt *Variant) AsVector3() Vector3 {
  323. arg0 := gdt.getBase()
  324. ret := C.go_godot_variant_as_vector3(GDNative.api, arg0)
  325. return Vector3{base: &ret}
  326. }
  327. // AsTransform2D godot_variant_as_transform2d [[const godot_variant * p_self]] godot_transform2d
  328. func (gdt *Variant) AsTransform2D() Transform2D {
  329. arg0 := gdt.getBase()
  330. ret := C.go_godot_variant_as_transform2d(GDNative.api, arg0)
  331. return Transform2D{base: &ret}
  332. }
  333. // AsPlane godot_variant_as_plane [[const godot_variant * p_self]] godot_plane
  334. func (gdt *Variant) AsPlane() Plane {
  335. arg0 := gdt.getBase()
  336. ret := C.go_godot_variant_as_plane(GDNative.api, arg0)
  337. return Plane{base: &ret}
  338. }
  339. // AsQuat godot_variant_as_quat [[const godot_variant * p_self]] godot_quat
  340. func (gdt *Variant) AsQuat() Quat {
  341. arg0 := gdt.getBase()
  342. ret := C.go_godot_variant_as_quat(GDNative.api, arg0)
  343. return Quat{base: &ret}
  344. }
  345. // AsAabb godot_variant_as_aabb [[const godot_variant * p_self]] godot_aabb
  346. func (gdt *Variant) AsAabb() Aabb {
  347. arg0 := gdt.getBase()
  348. ret := C.go_godot_variant_as_aabb(GDNative.api, arg0)
  349. return Aabb{base: &ret}
  350. }
  351. // AsBasis godot_variant_as_basis [[const godot_variant * p_self]] godot_basis
  352. func (gdt *Variant) AsBasis() Basis {
  353. arg0 := gdt.getBase()
  354. ret := C.go_godot_variant_as_basis(GDNative.api, arg0)
  355. return Basis{base: &ret}
  356. }
  357. // AsTransform godot_variant_as_transform [[const godot_variant * p_self]] godot_transform
  358. func (gdt *Variant) AsTransform() Transform {
  359. arg0 := gdt.getBase()
  360. ret := C.go_godot_variant_as_transform(GDNative.api, arg0)
  361. return Transform{base: &ret}
  362. }
  363. // AsColor godot_variant_as_color [[const godot_variant * p_self]] godot_color
  364. func (gdt *Variant) AsColor() Color {
  365. arg0 := gdt.getBase()
  366. ret := C.go_godot_variant_as_color(GDNative.api, arg0)
  367. return Color{base: &ret}
  368. }
  369. // AsNodePath godot_variant_as_node_path [[const godot_variant * p_self]] godot_node_path
  370. func (gdt *Variant) AsNodePath() NodePath {
  371. arg0 := gdt.getBase()
  372. ret := C.go_godot_variant_as_node_path(GDNative.api, arg0)
  373. return NodePath{base: &ret}
  374. }
  375. // AsRid godot_variant_as_rid [[const godot_variant * p_self]] godot_rid
  376. func (gdt *Variant) AsRid() Rid {
  377. arg0 := gdt.getBase()
  378. ret := C.go_godot_variant_as_rid(GDNative.api, arg0)
  379. return Rid{base: &ret}
  380. }
  381. // AsObject godot_variant_as_object [[const godot_variant * p_self]] godot_object *
  382. func (gdt *Variant) AsObject() Object {
  383. arg0 := gdt.getBase()
  384. ret := C.go_godot_variant_as_object(GDNative.api, arg0)
  385. return Object{base: (*C.godot_object)(ret)}
  386. }
  387. // AsDictionary godot_variant_as_dictionary [[const godot_variant * p_self]] godot_dictionary
  388. func (gdt *Variant) AsDictionary() Dictionary {
  389. arg0 := gdt.getBase()
  390. ret := C.go_godot_variant_as_dictionary(GDNative.api, arg0)
  391. return Dictionary{base: &ret}
  392. }
  393. // AsArray godot_variant_as_array [[const godot_variant * p_self]] godot_array
  394. func (gdt *Variant) AsArray() Array {
  395. arg0 := gdt.getBase()
  396. ret := C.go_godot_variant_as_array(GDNative.api, arg0)
  397. return Array{base: &ret}
  398. }
  399. // AsPoolByteArray godot_variant_as_pool_byte_array [[const godot_variant * p_self]] godot_pool_byte_array
  400. func (gdt *Variant) AsPoolByteArray() PoolByteArray {
  401. arg0 := gdt.getBase()
  402. ret := C.go_godot_variant_as_pool_byte_array(GDNative.api, arg0)
  403. return PoolByteArray{base: &ret}
  404. }
  405. // AsPoolIntArray godot_variant_as_pool_int_array [[const godot_variant * p_self]] godot_pool_int_array
  406. func (gdt *Variant) AsPoolIntArray() PoolIntArray {
  407. arg0 := gdt.getBase()
  408. ret := C.go_godot_variant_as_pool_int_array(GDNative.api, arg0)
  409. return PoolIntArray{base: &ret}
  410. }
  411. // AsPoolRealArray godot_variant_as_pool_real_array [[const godot_variant * p_self]] godot_pool_real_array
  412. func (gdt *Variant) AsPoolRealArray() PoolRealArray {
  413. arg0 := gdt.getBase()
  414. ret := C.go_godot_variant_as_pool_real_array(GDNative.api, arg0)
  415. return PoolRealArray{base: &ret}
  416. }
  417. // AsPoolStringArray godot_variant_as_pool_string_array [[const godot_variant * p_self]] godot_pool_string_array
  418. func (gdt *Variant) AsPoolStringArray() PoolStringArray {
  419. arg0 := gdt.getBase()
  420. ret := C.go_godot_variant_as_pool_string_array(GDNative.api, arg0)
  421. return PoolStringArray{base: &ret}
  422. }
  423. // AsPoolVector2Array godot_variant_as_pool_vector2_array [[const godot_variant * p_self]] godot_pool_vector2_array
  424. func (gdt *Variant) AsPoolVector2Array() PoolVector2Array {
  425. arg0 := gdt.getBase()
  426. ret := C.go_godot_variant_as_pool_vector2_array(GDNative.api, arg0)
  427. return PoolVector2Array{base: &ret}
  428. }
  429. // AsPoolVector3Array godot_variant_as_pool_vector3_array [[const godot_variant * p_self]] godot_pool_vector3_array
  430. func (gdt *Variant) AsPoolVector3Array() PoolVector3Array {
  431. arg0 := gdt.getBase()
  432. ret := C.go_godot_variant_as_pool_vector3_array(GDNative.api, arg0)
  433. return PoolVector3Array{base: &ret}
  434. }
  435. // AsPoolColorArray godot_variant_as_pool_color_array [[const godot_variant * p_self]] godot_pool_color_array
  436. func (gdt *Variant) AsPoolColorArray() PoolColorArray {
  437. arg0 := gdt.getBase()
  438. ret := C.go_godot_variant_as_pool_color_array(GDNative.api, arg0)
  439. return PoolColorArray{base: &ret}
  440. }
  441. // Call godot_variant_call [[godot_variant * p_self] [const godot_string * p_method] [const godot_variant ** p_args] [const godot_int p_argcount] [godot_variant_call_error * r_error]] godot_variant
  442. func (gdt *Variant) Call(method String, args []Variant, argcount Int, error VariantCallError) Variant {
  443. arg0 := gdt.getBase()
  444. arg1 := method.getBase()
  445. arg2Array := VariantArray{array: args}
  446. arg2 := arg2Array.getBase()
  447. arg3 := argcount.getBase()
  448. arg4 := error.getBase()
  449. ret := C.go_godot_variant_call(GDNative.api, arg0, arg1, arg2, arg3, arg4)
  450. return Variant{base: &ret}
  451. }
  452. // HasMethod godot_variant_has_method [[const godot_variant * p_self] [const godot_string * p_method]] godot_bool
  453. func (gdt *Variant) HasMethod(method String) Bool {
  454. arg0 := gdt.getBase()
  455. arg1 := method.getBase()
  456. ret := C.go_godot_variant_has_method(GDNative.api, arg0, arg1)
  457. return Bool(ret)
  458. }
  459. // OperatorEqual godot_variant_operator_equal [[const godot_variant * p_self] [const godot_variant * p_other]] godot_bool
  460. func (gdt *Variant) OperatorEqual(other Variant) Bool {
  461. arg0 := gdt.getBase()
  462. arg1 := other.getBase()
  463. ret := C.go_godot_variant_operator_equal(GDNative.api, arg0, arg1)
  464. return Bool(ret)
  465. }
  466. // OperatorLess godot_variant_operator_less [[const godot_variant * p_self] [const godot_variant * p_other]] godot_bool
  467. func (gdt *Variant) OperatorLess(other Variant) Bool {
  468. arg0 := gdt.getBase()
  469. arg1 := other.getBase()
  470. ret := C.go_godot_variant_operator_less(GDNative.api, arg0, arg1)
  471. return Bool(ret)
  472. }
  473. // HashCompare godot_variant_hash_compare [[const godot_variant * p_self] [const godot_variant * p_other]] godot_bool
  474. func (gdt *Variant) HashCompare(other Variant) Bool {
  475. arg0 := gdt.getBase()
  476. arg1 := other.getBase()
  477. ret := C.go_godot_variant_hash_compare(GDNative.api, arg0, arg1)
  478. return Bool(ret)
  479. }
  480. // Booleanize godot_variant_booleanize [[const godot_variant * p_self]] godot_bool
  481. func (gdt *Variant) Booleanize() Bool {
  482. arg0 := gdt.getBase()
  483. ret := C.go_godot_variant_booleanize(GDNative.api, arg0)
  484. return Bool(ret)
  485. }
  486. // Destroy godot_variant_destroy [[godot_variant * p_self]] void
  487. func (gdt *Variant) Destroy() {
  488. arg0 := gdt.getBase()
  489. C.go_godot_variant_destroy(GDNative.api, arg0)
  490. }
  491. // VariantType is a Go wrapper for the C.godot_variant_type enum type.
  492. type VariantType int
  493. func (e VariantType) getBase() C.godot_variant_type {
  494. return C.godot_variant_type(e)
  495. }
  496. const (
  497. VariantTypeNil VariantType = 0
  498. VariantTypeBool VariantType = 1
  499. VariantTypeInt VariantType = 2
  500. VariantTypeReal VariantType = 3
  501. VariantTypeString VariantType = 4
  502. VariantTypeVector2 VariantType = 5 // 5
  503. VariantTypeRect2 VariantType = 6
  504. VariantTypeVector3 VariantType = 7
  505. VariantTypeTransform2D VariantType = 8
  506. VariantTypePlane VariantType = 9
  507. VariantTypeQuat VariantType = 10 // 10
  508. VariantTypeAabb VariantType = 11
  509. VariantTypeBasis VariantType = 12
  510. VariantTypeTransform VariantType = 13
  511. VariantTypeColor VariantType = 14
  512. VariantTypeNodePath VariantType = 15 // 15
  513. VariantTypeRid VariantType = 16
  514. VariantTypeObject VariantType = 17
  515. VariantTypeDictionary VariantType = 18
  516. VariantTypeArray VariantType = 19 // 20
  517. VariantTypePoolByteArray VariantType = 20
  518. VariantTypePoolIntArray VariantType = 21
  519. VariantTypePoolRealArray VariantType = 22
  520. VariantTypePoolStringArray VariantType = 23
  521. VariantTypePoolVector2Array VariantType = 24 // 25
  522. VariantTypePoolVector3Array VariantType = 25
  523. VariantTypePoolColorArray VariantType = 26
  524. )
  525. // VariantTypeLookupMap is a string-based lookup table of constants for VariantType.
  526. var VariantTypeLookupMap = map[string]VariantType{
  527. "VariantTypeNil": VariantTypeNil,
  528. "VariantTypeBool": VariantTypeBool,
  529. "VariantTypeInt": VariantTypeInt,
  530. "VariantTypeReal": VariantTypeReal,
  531. "VariantTypeString": VariantTypeString,
  532. "VariantTypeVector2": VariantTypeVector2,
  533. "VariantTypeRect2": VariantTypeRect2,
  534. "VariantTypeVector3": VariantTypeVector3,
  535. "VariantTypeTransform2D": VariantTypeTransform2D,
  536. "VariantTypePlane": VariantTypePlane,
  537. "VariantTypeQuat": VariantTypeQuat,
  538. "VariantTypeAabb": VariantTypeAabb,
  539. "VariantTypeBasis": VariantTypeBasis,
  540. "VariantTypeTransform": VariantTypeTransform,
  541. "VariantTypeColor": VariantTypeColor,
  542. "VariantTypeNodePath": VariantTypeNodePath,
  543. "VariantTypeRid": VariantTypeRid,
  544. "VariantTypeObject": VariantTypeObject,
  545. "VariantTypeDictionary": VariantTypeDictionary,
  546. "VariantTypeArray": VariantTypeArray,
  547. "VariantTypePoolByteArray": VariantTypePoolByteArray,
  548. "VariantTypePoolIntArray": VariantTypePoolIntArray,
  549. "VariantTypePoolRealArray": VariantTypePoolRealArray,
  550. "VariantTypePoolStringArray": VariantTypePoolStringArray,
  551. "VariantTypePoolVector2Array": VariantTypePoolVector2Array,
  552. "VariantTypePoolVector3Array": VariantTypePoolVector3Array,
  553. "VariantTypePoolColorArray": VariantTypePoolColorArray,
  554. }
  555. // VariantCallErrorError is a Go wrapper for the C.godot_variant_call_error_error enum type.
  556. type VariantCallErrorError int
  557. func (e VariantCallErrorError) getBase() C.godot_variant_call_error_error {
  558. return C.godot_variant_call_error_error(e)
  559. }
  560. const (
  561. CallErrorCallOk VariantCallErrorError = 0
  562. CallErrorCallErrorInvalidMethod VariantCallErrorError = 1
  563. CallErrorCallErrorInvalidArgument VariantCallErrorError = 2
  564. CallErrorCallErrorTooManyArguments VariantCallErrorError = 3
  565. CallErrorCallErrorTooFewArguments VariantCallErrorError = 4
  566. CallErrorCallErrorInstanceIsNull VariantCallErrorError = 5
  567. )
  568. // VariantCallErrorErrorLookupMap is a string-based lookup table of constants for VariantCallErrorError.
  569. var VariantCallErrorErrorLookupMap = map[string]VariantCallErrorError{
  570. "CallErrorCallOk": CallErrorCallOk,
  571. "CallErrorCallErrorInvalidMethod": CallErrorCallErrorInvalidMethod,
  572. "CallErrorCallErrorInvalidArgument": CallErrorCallErrorInvalidArgument,
  573. "CallErrorCallErrorTooManyArguments": CallErrorCallErrorTooManyArguments,
  574. "CallErrorCallErrorTooFewArguments": CallErrorCallErrorTooFewArguments,
  575. "CallErrorCallErrorInstanceIsNull": CallErrorCallErrorInstanceIsNull,
  576. }
  577. // NewEmptyVariantCallError will return a pointer to an empty
  578. // initialized VariantCallError. This is primarily used in
  579. // conjunction with MethodBindPtrCall.
  580. func NewEmptyVariantCallError() Pointer {
  581. var obj C.godot_variant_call_error
  582. return Pointer{base: unsafe.Pointer(&obj)}
  583. }
  584. // NewPointerFromVariantCallError will return an unsafe pointer to the given
  585. // object. This is primarily used in conjunction with MethodBindPtrCall.
  586. func NewPointerFromVariantCallError(obj VariantCallError) Pointer {
  587. return Pointer{base: unsafe.Pointer(obj.getBase())}
  588. }
  589. // NewVariantCallErrorFromPointer will return a VariantCallError from the
  590. // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
  591. func NewVariantCallErrorFromPointer(ptr Pointer) VariantCallError {
  592. return VariantCallError{base: (*C.godot_variant_call_error)(ptr.getBase())}
  593. }
  594. // VariantCallError data structure wrapper
  595. type VariantCallError struct {
  596. base *C.godot_variant_call_error
  597. Error VariantCallErrorError
  598. Argument Int
  599. Expected VariantType
  600. }
  601. // returns the wrapped C base data type for this type
  602. func (gdt VariantCallError) getBase() *C.godot_variant_call_error {
  603. return gdt.base
  604. }
  605. // VariantOperator is a Go wrapper for the C.godot_variant_operator enum type.
  606. type VariantOperator int
  607. func (e VariantOperator) getBase() C.godot_variant_operator {
  608. return C.godot_variant_operator(e)
  609. }
  610. const (
  611. VariantOpEqual VariantOperator = 0
  612. VariantOpNotEqual VariantOperator = 1
  613. VariantOpLess VariantOperator = 2
  614. VariantOpLessEqual VariantOperator = 3
  615. VariantOpGreater VariantOperator = 4
  616. VariantOpGreaterEqual VariantOperator = 5
  617. VariantOpAdd VariantOperator = 6
  618. VariantOpSubtract VariantOperator = 7
  619. VariantOpMultiply VariantOperator = 8
  620. VariantOpDivide VariantOperator = 9
  621. VariantOpNegate VariantOperator = 10
  622. VariantOpPositive VariantOperator = 11
  623. VariantOpModule VariantOperator = 12
  624. VariantOpStringConcat VariantOperator = 13
  625. VariantOpShiftLeft VariantOperator = 14
  626. VariantOpShiftRight VariantOperator = 15
  627. VariantOpBitAnd VariantOperator = 16
  628. VariantOpBitOr VariantOperator = 17
  629. VariantOpBitXor VariantOperator = 18
  630. VariantOpBitNegate VariantOperator = 19
  631. VariantOpAnd VariantOperator = 20
  632. VariantOpOr VariantOperator = 21
  633. VariantOpXor VariantOperator = 22
  634. VariantOpNot VariantOperator = 23
  635. VariantOpIn VariantOperator = 24
  636. VariantOpMax VariantOperator = 25
  637. )
  638. // VariantOperatorLookupMap is a string-based lookup table of constants for VariantOperator.
  639. var VariantOperatorLookupMap = map[string]VariantOperator{
  640. "VariantOpEqual": VariantOpEqual,
  641. "VariantOpNotEqual": VariantOpNotEqual,
  642. "VariantOpLess": VariantOpLess,
  643. "VariantOpLessEqual": VariantOpLessEqual,
  644. "VariantOpGreater": VariantOpGreater,
  645. "VariantOpGreaterEqual": VariantOpGreaterEqual,
  646. "VariantOpAdd": VariantOpAdd,
  647. "VariantOpSubtract": VariantOpSubtract,
  648. "VariantOpMultiply": VariantOpMultiply,
  649. "VariantOpDivide": VariantOpDivide,
  650. "VariantOpNegate": VariantOpNegate,
  651. "VariantOpPositive": VariantOpPositive,
  652. "VariantOpModule": VariantOpModule,
  653. "VariantOpStringConcat": VariantOpStringConcat,
  654. "VariantOpShiftLeft": VariantOpShiftLeft,
  655. "VariantOpShiftRight": VariantOpShiftRight,
  656. "VariantOpBitAnd": VariantOpBitAnd,
  657. "VariantOpBitOr": VariantOpBitOr,
  658. "VariantOpBitXor": VariantOpBitXor,
  659. "VariantOpBitNegate": VariantOpBitNegate,
  660. "VariantOpAnd": VariantOpAnd,
  661. "VariantOpOr": VariantOpOr,
  662. "VariantOpXor": VariantOpXor,
  663. "VariantOpNot": VariantOpNot,
  664. "VariantOpIn": VariantOpIn,
  665. "VariantOpMax": VariantOpMax,
  666. }