gdnative.gen.go 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  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/gdnative.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. // Error is a Go wrapper for the C.godot_error enum type.
  49. type Error int
  50. func (e Error) getBase() C.godot_error {
  51. return C.godot_error(e)
  52. }
  53. const (
  54. Ok Error = 0 // (0)
  55. Failed Error = 1 // < Generic fail error
  56. ErrUnavailable Error = 2 // < What is requested is unsupported/unavailable
  57. ErrUnconfigured Error = 3 // < The object being used hasn't been properly set up yet
  58. ErrUnauthorized Error = 4 // < Missing credentials for requested resource
  59. ErrParameterRangeError Error = 5 // < Parameter given out of range (5)
  60. ErrOutOfMemory Error = 6 // < Out of memory
  61. ErrFileNotFound Error = 7
  62. ErrFileBadDrive Error = 8
  63. ErrFileBadPath Error = 9
  64. ErrFileNoPermission Error = 10 // (10)
  65. ErrFileAlreadyInUse Error = 11
  66. ErrFileCantOpen Error = 12
  67. ErrFileCantWrite Error = 13
  68. ErrFileCantRead Error = 14
  69. ErrFileUnrecognized Error = 15 // (15)
  70. ErrFileCorrupt Error = 16
  71. ErrFileMissingDependencies Error = 17
  72. ErrFileEof Error = 18
  73. ErrCantOpen Error = 19 // < Can't open a resource/socket/file
  74. ErrCantCreate Error = 20 // (20)
  75. ErrQueryFailed Error = 21
  76. ErrAlreadyInUse Error = 22
  77. ErrLocked Error = 23 // < resource is locked
  78. ErrTimeout Error = 24
  79. ErrCantConnect Error = 25 // (25)
  80. ErrCantResolve Error = 26
  81. ErrConnectionError Error = 27
  82. ErrCantAcquireResource Error = 28
  83. ErrCantFork Error = 29
  84. ErrInvalidData Error = 30 // < Data passed is invalid (30)
  85. ErrInvalidParameter Error = 31 // < Parameter passed is invalid
  86. ErrAlreadyExists Error = 32 // < When adding, item already exists
  87. ErrDoesNotExist Error = 33 // < When retrieving/erasing, it item does not exist
  88. ErrDatabaseCantRead Error = 34 // < database is full
  89. ErrDatabaseCantWrite Error = 35 // < database is full (35)
  90. ErrCompilationFailed Error = 36
  91. ErrMethodNotFound Error = 37
  92. ErrLinkFailed Error = 38
  93. ErrScriptFailed Error = 39
  94. ErrCyclicLink Error = 40 // (40)
  95. ErrInvalidDeclaration Error = 41
  96. ErrDuplicateSymbol Error = 42
  97. ErrParseError Error = 43
  98. ErrBusy Error = 44
  99. ErrSkip Error = 45 // (45)
  100. ErrHelp Error = 46 // < user requested help!!
  101. ErrBug Error = 47 // < a bug in the software certainly happened, due to a double check failing or unexpected behavior.
  102. ErrPrinterOnFire Error = 48 // the parallel port printer is engulfed in flames
  103. )
  104. // ErrorLookupMap is a string-based lookup table of constants for Error.
  105. var ErrorLookupMap = map[string]Error{
  106. "Ok": Ok,
  107. "Failed": Failed,
  108. "ErrUnavailable": ErrUnavailable,
  109. "ErrUnconfigured": ErrUnconfigured,
  110. "ErrUnauthorized": ErrUnauthorized,
  111. "ErrParameterRangeError": ErrParameterRangeError,
  112. "ErrOutOfMemory": ErrOutOfMemory,
  113. "ErrFileNotFound": ErrFileNotFound,
  114. "ErrFileBadDrive": ErrFileBadDrive,
  115. "ErrFileBadPath": ErrFileBadPath,
  116. "ErrFileNoPermission": ErrFileNoPermission,
  117. "ErrFileAlreadyInUse": ErrFileAlreadyInUse,
  118. "ErrFileCantOpen": ErrFileCantOpen,
  119. "ErrFileCantWrite": ErrFileCantWrite,
  120. "ErrFileCantRead": ErrFileCantRead,
  121. "ErrFileUnrecognized": ErrFileUnrecognized,
  122. "ErrFileCorrupt": ErrFileCorrupt,
  123. "ErrFileMissingDependencies": ErrFileMissingDependencies,
  124. "ErrFileEof": ErrFileEof,
  125. "ErrCantOpen": ErrCantOpen,
  126. "ErrCantCreate": ErrCantCreate,
  127. "ErrQueryFailed": ErrQueryFailed,
  128. "ErrAlreadyInUse": ErrAlreadyInUse,
  129. "ErrLocked": ErrLocked,
  130. "ErrTimeout": ErrTimeout,
  131. "ErrCantConnect": ErrCantConnect,
  132. "ErrCantResolve": ErrCantResolve,
  133. "ErrConnectionError": ErrConnectionError,
  134. "ErrCantAcquireResource": ErrCantAcquireResource,
  135. "ErrCantFork": ErrCantFork,
  136. "ErrInvalidData": ErrInvalidData,
  137. "ErrInvalidParameter": ErrInvalidParameter,
  138. "ErrAlreadyExists": ErrAlreadyExists,
  139. "ErrDoesNotExist": ErrDoesNotExist,
  140. "ErrDatabaseCantRead": ErrDatabaseCantRead,
  141. "ErrDatabaseCantWrite": ErrDatabaseCantWrite,
  142. "ErrCompilationFailed": ErrCompilationFailed,
  143. "ErrMethodNotFound": ErrMethodNotFound,
  144. "ErrLinkFailed": ErrLinkFailed,
  145. "ErrScriptFailed": ErrScriptFailed,
  146. "ErrCyclicLink": ErrCyclicLink,
  147. "ErrInvalidDeclaration": ErrInvalidDeclaration,
  148. "ErrDuplicateSymbol": ErrDuplicateSymbol,
  149. "ErrParseError": ErrParseError,
  150. "ErrBusy": ErrBusy,
  151. "ErrSkip": ErrSkip,
  152. "ErrHelp": ErrHelp,
  153. "ErrBug": ErrBug,
  154. "ErrPrinterOnFire": ErrPrinterOnFire,
  155. }
  156. // NewEmptyBool will return a pointer to an empty
  157. // initialized Bool. This is primarily used in
  158. // conjunction with MethodBindPtrCall.
  159. func NewEmptyBool() Pointer {
  160. var obj C.godot_bool
  161. return Pointer{base: unsafe.Pointer(&obj)}
  162. }
  163. // NewPointerFromBool will return an unsafe pointer to the given
  164. // object. This is primarily used in conjunction with MethodBindPtrCall.
  165. func NewPointerFromBool(obj Bool) Pointer {
  166. base := obj.getBase()
  167. return Pointer{base: unsafe.Pointer(&base)}
  168. }
  169. // NewBoolFromPointer will return a Bool from the
  170. // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
  171. func NewBoolFromPointer(ptr Pointer) Bool {
  172. base := ptr.getBase()
  173. return Bool(*(*C.godot_bool)(base))
  174. }
  175. // Bool is a Go wrapper for the base C.godot_bool type
  176. type Bool bool
  177. func (t Bool) getBase() C.godot_bool {
  178. return C.godot_bool(t)
  179. }
  180. // NewEmptyInt will return a pointer to an empty
  181. // initialized Int. This is primarily used in
  182. // conjunction with MethodBindPtrCall.
  183. func NewEmptyInt() Pointer {
  184. var obj C.godot_int
  185. return Pointer{base: unsafe.Pointer(&obj)}
  186. }
  187. // NewPointerFromInt will return an unsafe pointer to the given
  188. // object. This is primarily used in conjunction with MethodBindPtrCall.
  189. func NewPointerFromInt(obj Int) Pointer {
  190. base := obj.getBase()
  191. return Pointer{base: unsafe.Pointer(&base)}
  192. }
  193. // NewIntFromPointer will return a Int from the
  194. // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
  195. func NewIntFromPointer(ptr Pointer) Int {
  196. base := ptr.getBase()
  197. return Int(*(*C.godot_int)(base))
  198. }
  199. // Int is a Go wrapper for the base C.godot_int type
  200. type Int int
  201. func (t Int) getBase() C.godot_int {
  202. return C.godot_int(t)
  203. }
  204. // NewEmptyReal will return a pointer to an empty
  205. // initialized Real. This is primarily used in
  206. // conjunction with MethodBindPtrCall.
  207. func NewEmptyReal() Pointer {
  208. var obj C.godot_real
  209. return Pointer{base: unsafe.Pointer(&obj)}
  210. }
  211. // NewPointerFromReal will return an unsafe pointer to the given
  212. // object. This is primarily used in conjunction with MethodBindPtrCall.
  213. func NewPointerFromReal(obj Real) Pointer {
  214. base := obj.getBase()
  215. return Pointer{base: unsafe.Pointer(&base)}
  216. }
  217. // NewRealFromPointer will return a Real from the
  218. // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
  219. func NewRealFromPointer(ptr Pointer) Real {
  220. base := ptr.getBase()
  221. return Real(*(*C.godot_real)(base))
  222. }
  223. // Real is a Go wrapper for the base C.godot_real type
  224. type Real float64
  225. func (t Real) getBase() C.godot_real {
  226. return C.godot_real(t)
  227. }
  228. // NewEmptyObject will return a pointer to an empty
  229. // initialized Object. This is primarily used in
  230. // conjunction with MethodBindPtrCall.
  231. func NewEmptyObject() Pointer {
  232. var obj C.godot_object
  233. return Pointer{base: unsafe.Pointer(&obj)}
  234. }
  235. // NewPointerFromObject will return an unsafe pointer to the given
  236. // object. This is primarily used in conjunction with MethodBindPtrCall.
  237. func NewPointerFromObject(obj Object) Pointer {
  238. return Pointer{base: unsafe.Pointer(obj.getBase())}
  239. }
  240. // NewObjectFromPointer will return a Object from the
  241. // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
  242. func NewObjectFromPointer(ptr Pointer) Object {
  243. obj := (**C.godot_object)(ptr.getBase())
  244. return Object{base: *obj}
  245. }
  246. // Object data structure wrapper
  247. type Object struct {
  248. base *C.godot_object
  249. }
  250. // returns the wrapped C base data type for this type
  251. func (gdt Object) getBase() *C.godot_object {
  252. return gdt.base
  253. }
  254. // NewEmptyMethodBind will return a pointer to an empty
  255. // initialized MethodBind. This is primarily used in
  256. // conjunction with MethodBindPtrCall.
  257. func NewEmptyMethodBind() Pointer {
  258. var obj C.godot_method_bind
  259. return Pointer{base: unsafe.Pointer(&obj)}
  260. }
  261. // NewPointerFromMethodBind will return an unsafe pointer to the given
  262. // object. This is primarily used in conjunction with MethodBindPtrCall.
  263. func NewPointerFromMethodBind(obj MethodBind) Pointer {
  264. return Pointer{base: unsafe.Pointer(obj.getBase())}
  265. }
  266. // NewMethodBindFromPointer will return a MethodBind from the
  267. // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
  268. func NewMethodBindFromPointer(ptr Pointer) MethodBind {
  269. return MethodBind{base: (*C.godot_method_bind)(ptr.getBase())}
  270. }
  271. // MethodBind data structure wrapper
  272. type MethodBind struct {
  273. base *C.godot_method_bind
  274. }
  275. // returns the wrapped C base data type for this type
  276. func (gdt MethodBind) getBase() *C.godot_method_bind {
  277. return gdt.base
  278. }
  279. // NewEmptyGdnativeApiVersion will return a pointer to an empty
  280. // initialized GdnativeApiVersion. This is primarily used in
  281. // conjunction with MethodBindPtrCall.
  282. func NewEmptyGdnativeApiVersion() Pointer {
  283. var obj C.godot_gdnative_api_version
  284. return Pointer{base: unsafe.Pointer(&obj)}
  285. }
  286. // NewPointerFromGdnativeApiVersion will return an unsafe pointer to the given
  287. // object. This is primarily used in conjunction with MethodBindPtrCall.
  288. func NewPointerFromGdnativeApiVersion(obj GdnativeApiVersion) Pointer {
  289. return Pointer{base: unsafe.Pointer(obj.getBase())}
  290. }
  291. // NewGdnativeApiVersionFromPointer will return a GdnativeApiVersion from the
  292. // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
  293. func NewGdnativeApiVersionFromPointer(ptr Pointer) GdnativeApiVersion {
  294. return GdnativeApiVersion{base: (*C.godot_gdnative_api_version)(ptr.getBase())}
  295. }
  296. // GdnativeApiVersion data structure wrapper
  297. type GdnativeApiVersion struct {
  298. base *C.godot_gdnative_api_version
  299. Major Uint
  300. Minor Uint
  301. }
  302. // returns the wrapped C base data type for this type
  303. func (gdt GdnativeApiVersion) getBase() *C.godot_gdnative_api_version {
  304. return gdt.base
  305. }
  306. // NewEmptyGdnativeTerminateOptions will return a pointer to an empty
  307. // initialized GdnativeTerminateOptions. This is primarily used in
  308. // conjunction with MethodBindPtrCall.
  309. func NewEmptyGdnativeTerminateOptions() Pointer {
  310. var obj C.godot_gdnative_terminate_options
  311. return Pointer{base: unsafe.Pointer(&obj)}
  312. }
  313. // NewPointerFromGdnativeTerminateOptions will return an unsafe pointer to the given
  314. // object. This is primarily used in conjunction with MethodBindPtrCall.
  315. func NewPointerFromGdnativeTerminateOptions(obj GdnativeTerminateOptions) Pointer {
  316. return Pointer{base: unsafe.Pointer(obj.getBase())}
  317. }
  318. // NewGdnativeTerminateOptionsFromPointer will return a GdnativeTerminateOptions from the
  319. // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
  320. func NewGdnativeTerminateOptionsFromPointer(ptr Pointer) GdnativeTerminateOptions {
  321. return GdnativeTerminateOptions{base: (*C.godot_gdnative_terminate_options)(ptr.getBase())}
  322. }
  323. // GdnativeTerminateOptions data structure wrapper
  324. type GdnativeTerminateOptions struct {
  325. base *C.godot_gdnative_terminate_options
  326. InEditor Bool
  327. }
  328. // returns the wrapped C base data type for this type
  329. func (gdt GdnativeTerminateOptions) getBase() *C.godot_gdnative_terminate_options {
  330. return gdt.base
  331. }