array.gen.go 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  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/array.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. // NewEmptyArray will return a pointer to an empty
  49. // initialized Array. This is primarily used in
  50. // conjunction with MethodBindPtrCall.
  51. func NewEmptyArray() Pointer {
  52. var obj C.godot_array
  53. return Pointer{base: unsafe.Pointer(&obj)}
  54. }
  55. // NewPointerFromArray will return an unsafe pointer to the given
  56. // object. This is primarily used in conjunction with MethodBindPtrCall.
  57. func NewPointerFromArray(obj Array) Pointer {
  58. return Pointer{base: unsafe.Pointer(obj.getBase())}
  59. }
  60. // NewArrayFromPointer will return a Array from the
  61. // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
  62. func NewArrayFromPointer(ptr Pointer) Array {
  63. return Array{base: (*C.godot_array)(ptr.getBase())}
  64. }
  65. // Array data structure wrapper
  66. type Array struct {
  67. base *C.godot_array
  68. }
  69. // returns the wrapped C base data type for this type
  70. func (gdt Array) getBase() *C.godot_array {
  71. return gdt.base
  72. }
  73. // NewArray godot_array_new [[godot_array * r_dest]] void
  74. func NewArray() Array {
  75. var dest C.godot_array
  76. C.go_godot_array_new(GDNative.api, &dest)
  77. return Array{base: &dest}
  78. }
  79. // NewArrayCopy godot_array_new_copy [[godot_array * r_dest] [const godot_array * p_src]] void
  80. func NewArrayCopy(src Array) Array {
  81. var dest C.godot_array
  82. arg1 := src.getBase()
  83. C.go_godot_array_new_copy(GDNative.api, &dest, arg1)
  84. return Array{base: &dest}
  85. }
  86. // NewArrayPoolColorArray godot_array_new_pool_color_array [[godot_array * r_dest] [const godot_pool_color_array * p_pca]] void
  87. func NewArrayPoolColorArray(pca PoolColorArray) Array {
  88. var dest C.godot_array
  89. arg1 := pca.getBase()
  90. C.go_godot_array_new_pool_color_array(GDNative.api, &dest, arg1)
  91. return Array{base: &dest}
  92. }
  93. // NewArrayPoolVector3Array godot_array_new_pool_vector3_array [[godot_array * r_dest] [const godot_pool_vector3_array * p_pv3a]] void
  94. func NewArrayPoolVector3Array(pv3A PoolVector3Array) Array {
  95. var dest C.godot_array
  96. arg1 := pv3A.getBase()
  97. C.go_godot_array_new_pool_vector3_array(GDNative.api, &dest, arg1)
  98. return Array{base: &dest}
  99. }
  100. // NewArrayPoolVector2Array godot_array_new_pool_vector2_array [[godot_array * r_dest] [const godot_pool_vector2_array * p_pv2a]] void
  101. func NewArrayPoolVector2Array(pv2A PoolVector2Array) Array {
  102. var dest C.godot_array
  103. arg1 := pv2A.getBase()
  104. C.go_godot_array_new_pool_vector2_array(GDNative.api, &dest, arg1)
  105. return Array{base: &dest}
  106. }
  107. // NewArrayPoolStringArray godot_array_new_pool_string_array [[godot_array * r_dest] [const godot_pool_string_array * p_psa]] void
  108. func NewArrayPoolStringArray(psa PoolStringArray) Array {
  109. var dest C.godot_array
  110. arg1 := psa.getBase()
  111. C.go_godot_array_new_pool_string_array(GDNative.api, &dest, arg1)
  112. return Array{base: &dest}
  113. }
  114. // NewArrayPoolRealArray godot_array_new_pool_real_array [[godot_array * r_dest] [const godot_pool_real_array * p_pra]] void
  115. func NewArrayPoolRealArray(pra PoolRealArray) Array {
  116. var dest C.godot_array
  117. arg1 := pra.getBase()
  118. C.go_godot_array_new_pool_real_array(GDNative.api, &dest, arg1)
  119. return Array{base: &dest}
  120. }
  121. // NewArrayPoolIntArray godot_array_new_pool_int_array [[godot_array * r_dest] [const godot_pool_int_array * p_pia]] void
  122. func NewArrayPoolIntArray(pia PoolIntArray) Array {
  123. var dest C.godot_array
  124. arg1 := pia.getBase()
  125. C.go_godot_array_new_pool_int_array(GDNative.api, &dest, arg1)
  126. return Array{base: &dest}
  127. }
  128. // NewArrayPoolByteArray godot_array_new_pool_byte_array [[godot_array * r_dest] [const godot_pool_byte_array * p_pba]] void
  129. func NewArrayPoolByteArray(pba PoolByteArray) Array {
  130. var dest C.godot_array
  131. arg1 := pba.getBase()
  132. C.go_godot_array_new_pool_byte_array(GDNative.api, &dest, arg1)
  133. return Array{base: &dest}
  134. }
  135. // Set godot_array_set [[godot_array * p_self] [const godot_int p_idx] [const godot_variant * p_value]] void
  136. func (gdt *Array) Set(idx Int, value Variant) {
  137. arg0 := gdt.getBase()
  138. arg1 := idx.getBase()
  139. arg2 := value.getBase()
  140. C.go_godot_array_set(GDNative.api, arg0, arg1, arg2)
  141. }
  142. // Get godot_array_get [[const godot_array * p_self] [const godot_int p_idx]] godot_variant
  143. func (gdt *Array) Get(idx Int) Variant {
  144. arg0 := gdt.getBase()
  145. arg1 := idx.getBase()
  146. ret := C.go_godot_array_get(GDNative.api, arg0, arg1)
  147. return Variant{base: &ret}
  148. }
  149. // OperatorIndex godot_array_operator_index [[godot_array * p_self] [const godot_int p_idx]] godot_variant *
  150. func (gdt *Array) OperatorIndex(idx Int) Variant {
  151. arg0 := gdt.getBase()
  152. arg1 := idx.getBase()
  153. ret := C.go_godot_array_operator_index(GDNative.api, arg0, arg1)
  154. return Variant{base: ret}
  155. }
  156. // OperatorIndexConst godot_array_operator_index_const [[const godot_array * p_self] [const godot_int p_idx]] const godot_variant *
  157. func (gdt *Array) OperatorIndexConst(idx Int) Variant {
  158. arg0 := gdt.getBase()
  159. arg1 := idx.getBase()
  160. ret := C.go_godot_array_operator_index_const(GDNative.api, arg0, arg1)
  161. return Variant{base: ret}
  162. }
  163. // Append godot_array_append [[godot_array * p_self] [const godot_variant * p_value]] void
  164. func (gdt *Array) Append(value Variant) {
  165. arg0 := gdt.getBase()
  166. arg1 := value.getBase()
  167. C.go_godot_array_append(GDNative.api, arg0, arg1)
  168. }
  169. // Clear godot_array_clear [[godot_array * p_self]] void
  170. func (gdt *Array) Clear() {
  171. arg0 := gdt.getBase()
  172. C.go_godot_array_clear(GDNative.api, arg0)
  173. }
  174. // Count godot_array_count [[const godot_array * p_self] [const godot_variant * p_value]] godot_int
  175. func (gdt *Array) Count(value Variant) Int {
  176. arg0 := gdt.getBase()
  177. arg1 := value.getBase()
  178. ret := C.go_godot_array_count(GDNative.api, arg0, arg1)
  179. return Int(ret)
  180. }
  181. // Empty godot_array_empty [[const godot_array * p_self]] godot_bool
  182. func (gdt *Array) Empty() Bool {
  183. arg0 := gdt.getBase()
  184. ret := C.go_godot_array_empty(GDNative.api, arg0)
  185. return Bool(ret)
  186. }
  187. // Erase godot_array_erase [[godot_array * p_self] [const godot_variant * p_value]] void
  188. func (gdt *Array) Erase(value Variant) {
  189. arg0 := gdt.getBase()
  190. arg1 := value.getBase()
  191. C.go_godot_array_erase(GDNative.api, arg0, arg1)
  192. }
  193. // Front godot_array_front [[const godot_array * p_self]] godot_variant
  194. func (gdt *Array) Front() Variant {
  195. arg0 := gdt.getBase()
  196. ret := C.go_godot_array_front(GDNative.api, arg0)
  197. return Variant{base: &ret}
  198. }
  199. // Back godot_array_back [[const godot_array * p_self]] godot_variant
  200. func (gdt *Array) Back() Variant {
  201. arg0 := gdt.getBase()
  202. ret := C.go_godot_array_back(GDNative.api, arg0)
  203. return Variant{base: &ret}
  204. }
  205. // Find godot_array_find [[const godot_array * p_self] [const godot_variant * p_what] [const godot_int p_from]] godot_int
  206. func (gdt *Array) Find(what Variant, from Int) Int {
  207. arg0 := gdt.getBase()
  208. arg1 := what.getBase()
  209. arg2 := from.getBase()
  210. ret := C.go_godot_array_find(GDNative.api, arg0, arg1, arg2)
  211. return Int(ret)
  212. }
  213. // FindLast godot_array_find_last [[const godot_array * p_self] [const godot_variant * p_what]] godot_int
  214. func (gdt *Array) FindLast(what Variant) Int {
  215. arg0 := gdt.getBase()
  216. arg1 := what.getBase()
  217. ret := C.go_godot_array_find_last(GDNative.api, arg0, arg1)
  218. return Int(ret)
  219. }
  220. // Has godot_array_has [[const godot_array * p_self] [const godot_variant * p_value]] godot_bool
  221. func (gdt *Array) Has(value Variant) Bool {
  222. arg0 := gdt.getBase()
  223. arg1 := value.getBase()
  224. ret := C.go_godot_array_has(GDNative.api, arg0, arg1)
  225. return Bool(ret)
  226. }
  227. // Hash godot_array_hash [[const godot_array * p_self]] godot_int
  228. func (gdt *Array) Hash() Int {
  229. arg0 := gdt.getBase()
  230. ret := C.go_godot_array_hash(GDNative.api, arg0)
  231. return Int(ret)
  232. }
  233. // Insert godot_array_insert [[godot_array * p_self] [const godot_int p_pos] [const godot_variant * p_value]] void
  234. func (gdt *Array) Insert(pos Int, value Variant) {
  235. arg0 := gdt.getBase()
  236. arg1 := pos.getBase()
  237. arg2 := value.getBase()
  238. C.go_godot_array_insert(GDNative.api, arg0, arg1, arg2)
  239. }
  240. // Invert godot_array_invert [[godot_array * p_self]] void
  241. func (gdt *Array) Invert() {
  242. arg0 := gdt.getBase()
  243. C.go_godot_array_invert(GDNative.api, arg0)
  244. }
  245. // PopBack godot_array_pop_back [[godot_array * p_self]] godot_variant
  246. func (gdt *Array) PopBack() Variant {
  247. arg0 := gdt.getBase()
  248. ret := C.go_godot_array_pop_back(GDNative.api, arg0)
  249. return Variant{base: &ret}
  250. }
  251. // PopFront godot_array_pop_front [[godot_array * p_self]] godot_variant
  252. func (gdt *Array) PopFront() Variant {
  253. arg0 := gdt.getBase()
  254. ret := C.go_godot_array_pop_front(GDNative.api, arg0)
  255. return Variant{base: &ret}
  256. }
  257. // PushBack godot_array_push_back [[godot_array * p_self] [const godot_variant * p_value]] void
  258. func (gdt *Array) PushBack(value Variant) {
  259. arg0 := gdt.getBase()
  260. arg1 := value.getBase()
  261. C.go_godot_array_push_back(GDNative.api, arg0, arg1)
  262. }
  263. // PushFront godot_array_push_front [[godot_array * p_self] [const godot_variant * p_value]] void
  264. func (gdt *Array) PushFront(value Variant) {
  265. arg0 := gdt.getBase()
  266. arg1 := value.getBase()
  267. C.go_godot_array_push_front(GDNative.api, arg0, arg1)
  268. }
  269. // Remove godot_array_remove [[godot_array * p_self] [const godot_int p_idx]] void
  270. func (gdt *Array) Remove(idx Int) {
  271. arg0 := gdt.getBase()
  272. arg1 := idx.getBase()
  273. C.go_godot_array_remove(GDNative.api, arg0, arg1)
  274. }
  275. // Resize godot_array_resize [[godot_array * p_self] [const godot_int p_size]] void
  276. func (gdt *Array) Resize(size Int) {
  277. arg0 := gdt.getBase()
  278. arg1 := size.getBase()
  279. C.go_godot_array_resize(GDNative.api, arg0, arg1)
  280. }
  281. // Rfind godot_array_rfind [[const godot_array * p_self] [const godot_variant * p_what] [const godot_int p_from]] godot_int
  282. func (gdt *Array) Rfind(what Variant, from Int) Int {
  283. arg0 := gdt.getBase()
  284. arg1 := what.getBase()
  285. arg2 := from.getBase()
  286. ret := C.go_godot_array_rfind(GDNative.api, arg0, arg1, arg2)
  287. return Int(ret)
  288. }
  289. // Size godot_array_size [[const godot_array * p_self]] godot_int
  290. func (gdt *Array) Size() Int {
  291. arg0 := gdt.getBase()
  292. ret := C.go_godot_array_size(GDNative.api, arg0)
  293. return Int(ret)
  294. }
  295. // Sort godot_array_sort [[godot_array * p_self]] void
  296. func (gdt *Array) Sort() {
  297. arg0 := gdt.getBase()
  298. C.go_godot_array_sort(GDNative.api, arg0)
  299. }
  300. // SortCustom godot_array_sort_custom [[godot_array * p_self] [godot_object * p_obj] [const godot_string * p_func]] void
  301. func (gdt *Array) SortCustom(obj Object, function String) {
  302. arg0 := gdt.getBase()
  303. arg1 := unsafe.Pointer(obj.getBase())
  304. arg2 := function.getBase()
  305. C.go_godot_array_sort_custom(GDNative.api, arg0, arg1, arg2)
  306. }
  307. // Bsearch godot_array_bsearch [[godot_array * p_self] [const godot_variant * p_value] [const godot_bool p_before]] godot_int
  308. func (gdt *Array) Bsearch(value Variant, before Bool) Int {
  309. arg0 := gdt.getBase()
  310. arg1 := value.getBase()
  311. arg2 := before.getBase()
  312. ret := C.go_godot_array_bsearch(GDNative.api, arg0, arg1, arg2)
  313. return Int(ret)
  314. }
  315. // BsearchCustom godot_array_bsearch_custom [[godot_array * p_self] [const godot_variant * p_value] [godot_object * p_obj] [const godot_string * p_func] [const godot_bool p_before]] godot_int
  316. func (gdt *Array) BsearchCustom(value Variant, obj Object, function String, before Bool) Int {
  317. arg0 := gdt.getBase()
  318. arg1 := value.getBase()
  319. arg2 := unsafe.Pointer(obj.getBase())
  320. arg3 := function.getBase()
  321. arg4 := before.getBase()
  322. ret := C.go_godot_array_bsearch_custom(GDNative.api, arg0, arg1, arg2, arg3, arg4)
  323. return Int(ret)
  324. }
  325. // Destroy godot_array_destroy [[godot_array * p_self]] void
  326. func (gdt *Array) Destroy() {
  327. arg0 := gdt.getBase()
  328. C.go_godot_array_destroy(GDNative.api, arg0)
  329. }