godot_nativescript.gen.go 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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 <nativescript/godot_nativescript.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. // MethodRpcMode is a Go wrapper for the C.godot_method_rpc_mode enum type.
  49. type MethodRpcMode int
  50. func (e MethodRpcMode) getBase() C.godot_method_rpc_mode {
  51. return C.godot_method_rpc_mode(e)
  52. }
  53. const (
  54. MethodRpcModeDisabled MethodRpcMode = 0
  55. MethodRpcModeRemote MethodRpcMode = 1
  56. MethodRpcModeMaster MethodRpcMode = 2
  57. MethodRpcModePuppet MethodRpcMode = 3
  58. MethodRpcModeSlave MethodRpcMode = 4
  59. MethodRpcModeRemotesync MethodRpcMode = 5
  60. MethodRpcModeSync MethodRpcMode = 6
  61. MethodRpcModeMastersync MethodRpcMode = 7
  62. MethodRpcModePuppetsync MethodRpcMode = 8
  63. )
  64. // MethodRpcModeLookupMap is a string-based lookup table of constants for MethodRpcMode.
  65. var MethodRpcModeLookupMap = map[string]MethodRpcMode{
  66. "MethodRpcModeDisabled": MethodRpcModeDisabled,
  67. "MethodRpcModeRemote": MethodRpcModeRemote,
  68. "MethodRpcModeMaster": MethodRpcModeMaster,
  69. "MethodRpcModePuppet": MethodRpcModePuppet,
  70. "MethodRpcModeSlave": MethodRpcModeSlave,
  71. "MethodRpcModeRemotesync": MethodRpcModeRemotesync,
  72. "MethodRpcModeSync": MethodRpcModeSync,
  73. "MethodRpcModeMastersync": MethodRpcModeMastersync,
  74. "MethodRpcModePuppetsync": MethodRpcModePuppetsync,
  75. }
  76. // PropertyHint is a Go wrapper for the C.godot_property_hint enum type.
  77. type PropertyHint int
  78. func (e PropertyHint) getBase() C.godot_property_hint {
  79. return C.godot_property_hint(e)
  80. }
  81. const (
  82. PropertyHintNone PropertyHint = 0 // < no hint provided.
  83. PropertyHintRange PropertyHint = 1 // < hint_text = "min,max,step,slider;
  84. PropertyHintExpRange PropertyHint = 2 // < hint_text = "min,max,step", exponential edit
  85. PropertyHintEnum PropertyHint = 3 // < hint_text= "val1,val2,val3,etc"
  86. PropertyHintExpEasing PropertyHint = 4 // exponential easing function (Math::ease)
  87. PropertyHintLength PropertyHint = 5 // < hint_text= "length" (as integer)
  88. PropertyHintSpriteFrame PropertyHint = 6 // FIXME: Obsolete: drop whenever we can break compat
  89. PropertyHintKeyAccel PropertyHint = 7 // < hint_text= "length" (as integer)
  90. PropertyHintFlags PropertyHint = 8 // < hint_text= "flag1,flag2,etc" (as bit flags)
  91. PropertyHintLayers2DRender PropertyHint = 9
  92. PropertyHintLayers2DPhysics PropertyHint = 10
  93. PropertyHintLayers3DRender PropertyHint = 11
  94. PropertyHintLayers3DPhysics PropertyHint = 12
  95. PropertyHintFile PropertyHint = 13 // < a file path must be passed, hint_text (optionally) is a filter "*.png,*.wav,*.doc,"
  96. PropertyHintDir PropertyHint = 14 // < a directory path must be passed
  97. PropertyHintGlobalFile PropertyHint = 15 // < a file path must be passed, hint_text (optionally) is a filter "*.png,*.wav,*.doc,"
  98. PropertyHintGlobalDir PropertyHint = 16 // < a directory path must be passed
  99. PropertyHintResourceType PropertyHint = 17 // < a resource object type
  100. PropertyHintMultilineText PropertyHint = 18 // < used for string properties that can contain multiple lines
  101. PropertyHintPlaceholderText PropertyHint = 19 // < used to set a placeholder text for string properties
  102. PropertyHintColorNoAlpha PropertyHint = 20 // < used for ignoring alpha component when editing a color
  103. PropertyHintImageCompressLossy PropertyHint = 21
  104. PropertyHintImageCompressLossless PropertyHint = 22
  105. PropertyHintObjectId PropertyHint = 23
  106. PropertyHintTypeString PropertyHint = 24 // < a type string, the hint is the base type to choose
  107. PropertyHintNodePathToEditedNode PropertyHint = 25 // < so something else can provide this (used in scripts)
  108. PropertyHintMethodOfVariantType PropertyHint = 26 // < a method of a type
  109. PropertyHintMethodOfBaseType PropertyHint = 27 // < a method of a base type
  110. PropertyHintMethodOfInstance PropertyHint = 28 // < a method of an instance
  111. PropertyHintMethodOfScript PropertyHint = 29 // < a method of a script & base
  112. PropertyHintPropertyOfVariantType PropertyHint = 30 // < a property of a type
  113. PropertyHintPropertyOfBaseType PropertyHint = 31 // < a property of a base type
  114. PropertyHintPropertyOfInstance PropertyHint = 32 // < a property of an instance
  115. PropertyHintPropertyOfScript PropertyHint = 33 // < a property of a script & base
  116. PropertyHintMax PropertyHint = 34
  117. )
  118. // PropertyHintLookupMap is a string-based lookup table of constants for PropertyHint.
  119. var PropertyHintLookupMap = map[string]PropertyHint{
  120. "PropertyHintNone": PropertyHintNone,
  121. "PropertyHintRange": PropertyHintRange,
  122. "PropertyHintExpRange": PropertyHintExpRange,
  123. "PropertyHintEnum": PropertyHintEnum,
  124. "PropertyHintExpEasing": PropertyHintExpEasing,
  125. "PropertyHintLength": PropertyHintLength,
  126. "PropertyHintSpriteFrame": PropertyHintSpriteFrame,
  127. "PropertyHintKeyAccel": PropertyHintKeyAccel,
  128. "PropertyHintFlags": PropertyHintFlags,
  129. "PropertyHintLayers2DRender": PropertyHintLayers2DRender,
  130. "PropertyHintLayers2DPhysics": PropertyHintLayers2DPhysics,
  131. "PropertyHintLayers3DRender": PropertyHintLayers3DRender,
  132. "PropertyHintLayers3DPhysics": PropertyHintLayers3DPhysics,
  133. "PropertyHintFile": PropertyHintFile,
  134. "PropertyHintDir": PropertyHintDir,
  135. "PropertyHintGlobalFile": PropertyHintGlobalFile,
  136. "PropertyHintGlobalDir": PropertyHintGlobalDir,
  137. "PropertyHintResourceType": PropertyHintResourceType,
  138. "PropertyHintMultilineText": PropertyHintMultilineText,
  139. "PropertyHintPlaceholderText": PropertyHintPlaceholderText,
  140. "PropertyHintColorNoAlpha": PropertyHintColorNoAlpha,
  141. "PropertyHintImageCompressLossy": PropertyHintImageCompressLossy,
  142. "PropertyHintImageCompressLossless": PropertyHintImageCompressLossless,
  143. "PropertyHintObjectId": PropertyHintObjectId,
  144. "PropertyHintTypeString": PropertyHintTypeString,
  145. "PropertyHintNodePathToEditedNode": PropertyHintNodePathToEditedNode,
  146. "PropertyHintMethodOfVariantType": PropertyHintMethodOfVariantType,
  147. "PropertyHintMethodOfBaseType": PropertyHintMethodOfBaseType,
  148. "PropertyHintMethodOfInstance": PropertyHintMethodOfInstance,
  149. "PropertyHintMethodOfScript": PropertyHintMethodOfScript,
  150. "PropertyHintPropertyOfVariantType": PropertyHintPropertyOfVariantType,
  151. "PropertyHintPropertyOfBaseType": PropertyHintPropertyOfBaseType,
  152. "PropertyHintPropertyOfInstance": PropertyHintPropertyOfInstance,
  153. "PropertyHintPropertyOfScript": PropertyHintPropertyOfScript,
  154. "PropertyHintMax": PropertyHintMax,
  155. }
  156. // NewEmptyPropertyAttributes will return a pointer to an empty
  157. // initialized PropertyAttributes. This is primarily used in
  158. // conjunction with MethodBindPtrCall.
  159. func NewEmptyPropertyAttributes() Pointer {
  160. var obj C.godot_property_attributes
  161. return Pointer{base: unsafe.Pointer(&obj)}
  162. }
  163. // NewPointerFromPropertyAttributes will return an unsafe pointer to the given
  164. // object. This is primarily used in conjunction with MethodBindPtrCall.
  165. func NewPointerFromPropertyAttributes(obj PropertyAttributes) Pointer {
  166. return Pointer{base: unsafe.Pointer(obj.getBase())}
  167. }
  168. // NewPropertyAttributesFromPointer will return a PropertyAttributes from the
  169. // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
  170. func NewPropertyAttributesFromPointer(ptr Pointer) PropertyAttributes {
  171. return PropertyAttributes{base: (*C.godot_property_attributes)(ptr.getBase())}
  172. }
  173. // PropertyAttributes data structure wrapper
  174. type PropertyAttributes struct {
  175. base *C.godot_property_attributes
  176. RsetType MethodRpcMode
  177. Type Int
  178. Hint PropertyHint
  179. HintString String
  180. Usage PropertyUsageFlags
  181. DefaultValue Variant
  182. }
  183. // returns the wrapped C base data type for this type
  184. func (gdt PropertyAttributes) getBase() *C.godot_property_attributes {
  185. return gdt.base
  186. }
  187. // NewEmptySignalArgument will return a pointer to an empty
  188. // initialized SignalArgument. This is primarily used in
  189. // conjunction with MethodBindPtrCall.
  190. func NewEmptySignalArgument() Pointer {
  191. var obj C.godot_signal_argument
  192. return Pointer{base: unsafe.Pointer(&obj)}
  193. }
  194. // NewPointerFromSignalArgument will return an unsafe pointer to the given
  195. // object. This is primarily used in conjunction with MethodBindPtrCall.
  196. func NewPointerFromSignalArgument(obj SignalArgument) Pointer {
  197. return Pointer{base: unsafe.Pointer(obj.getBase())}
  198. }
  199. // NewSignalArgumentFromPointer will return a SignalArgument from the
  200. // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
  201. func NewSignalArgumentFromPointer(ptr Pointer) SignalArgument {
  202. return SignalArgument{base: (*C.godot_signal_argument)(ptr.getBase())}
  203. }
  204. // SignalArgument data structure wrapper
  205. type SignalArgument struct {
  206. base *C.godot_signal_argument
  207. Name String
  208. Type Int
  209. Hint PropertyHint
  210. HintString String
  211. Usage PropertyUsageFlags
  212. DefaultValue Variant
  213. }
  214. // returns the wrapped C base data type for this type
  215. func (gdt SignalArgument) getBase() *C.godot_signal_argument {
  216. return gdt.base
  217. }
  218. // NewEmptySignal will return a pointer to an empty
  219. // initialized Signal. This is primarily used in
  220. // conjunction with MethodBindPtrCall.
  221. func NewEmptySignal() Pointer {
  222. var obj C.godot_signal
  223. return Pointer{base: unsafe.Pointer(&obj)}
  224. }
  225. // NewPointerFromSignal will return an unsafe pointer to the given
  226. // object. This is primarily used in conjunction with MethodBindPtrCall.
  227. func NewPointerFromSignal(obj Signal) Pointer {
  228. return Pointer{base: unsafe.Pointer(obj.getBase())}
  229. }
  230. // NewSignalFromPointer will return a Signal from the
  231. // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
  232. func NewSignalFromPointer(ptr Pointer) Signal {
  233. return Signal{base: (*C.godot_signal)(ptr.getBase())}
  234. }
  235. // Signal data structure wrapper
  236. type Signal struct {
  237. base *C.godot_signal
  238. Name String
  239. NumArgs Int
  240. Args []SignalArgument
  241. NumDefaultArgs Int
  242. DefaultArgs []Variant
  243. }
  244. // returns the wrapped C base data type for this type
  245. func (gdt Signal) getBase() *C.godot_signal {
  246. return gdt.base
  247. }
  248. // NewEmptyMethodArg will return a pointer to an empty
  249. // initialized MethodArg. This is primarily used in
  250. // conjunction with MethodBindPtrCall.
  251. func NewEmptyMethodArg() Pointer {
  252. var obj C.godot_method_arg
  253. return Pointer{base: unsafe.Pointer(&obj)}
  254. }
  255. // NewPointerFromMethodArg will return an unsafe pointer to the given
  256. // object. This is primarily used in conjunction with MethodBindPtrCall.
  257. func NewPointerFromMethodArg(obj MethodArg) Pointer {
  258. return Pointer{base: unsafe.Pointer(obj.getBase())}
  259. }
  260. // NewMethodArgFromPointer will return a MethodArg from the
  261. // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
  262. func NewMethodArgFromPointer(ptr Pointer) MethodArg {
  263. return MethodArg{base: (*C.godot_method_arg)(ptr.getBase())}
  264. }
  265. // MethodArg data structure wrapper
  266. type MethodArg struct {
  267. base *C.godot_method_arg
  268. Name String
  269. Type VariantType
  270. Hint PropertyHint
  271. HintString String
  272. }
  273. // returns the wrapped C base data type for this type
  274. func (gdt MethodArg) getBase() *C.godot_method_arg {
  275. return gdt.base
  276. }