dictionary.gen.go 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  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/dictionary.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. // NewEmptyDictionary will return a pointer to an empty
  49. // initialized Dictionary. This is primarily used in
  50. // conjunction with MethodBindPtrCall.
  51. func NewEmptyDictionary() Pointer {
  52. var obj C.godot_dictionary
  53. return Pointer{base: unsafe.Pointer(&obj)}
  54. }
  55. // NewPointerFromDictionary will return an unsafe pointer to the given
  56. // object. This is primarily used in conjunction with MethodBindPtrCall.
  57. func NewPointerFromDictionary(obj Dictionary) Pointer {
  58. return Pointer{base: unsafe.Pointer(obj.getBase())}
  59. }
  60. // NewDictionaryFromPointer will return a Dictionary from the
  61. // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
  62. func NewDictionaryFromPointer(ptr Pointer) Dictionary {
  63. return Dictionary{base: (*C.godot_dictionary)(ptr.getBase())}
  64. }
  65. // Dictionary data structure wrapper
  66. type Dictionary struct {
  67. base *C.godot_dictionary
  68. }
  69. // returns the wrapped C base data type for this type
  70. func (gdt Dictionary) getBase() *C.godot_dictionary {
  71. return gdt.base
  72. }
  73. // NewDictionary godot_dictionary_new [[godot_dictionary * r_dest]] void
  74. func NewDictionary() Dictionary {
  75. var dest C.godot_dictionary
  76. C.go_godot_dictionary_new(GDNative.api, &dest)
  77. return Dictionary{base: &dest}
  78. }
  79. // NewDictionaryCopy godot_dictionary_new_copy [[godot_dictionary * r_dest] [const godot_dictionary * p_src]] void
  80. func NewDictionaryCopy(src Dictionary) Dictionary {
  81. var dest C.godot_dictionary
  82. arg1 := src.getBase()
  83. C.go_godot_dictionary_new_copy(GDNative.api, &dest, arg1)
  84. return Dictionary{base: &dest}
  85. }
  86. // Destroy godot_dictionary_destroy [[godot_dictionary * p_self]] void
  87. func (gdt *Dictionary) Destroy() {
  88. arg0 := gdt.getBase()
  89. C.go_godot_dictionary_destroy(GDNative.api, arg0)
  90. }
  91. // Size godot_dictionary_size [[const godot_dictionary * p_self]] godot_int
  92. func (gdt *Dictionary) Size() Int {
  93. arg0 := gdt.getBase()
  94. ret := C.go_godot_dictionary_size(GDNative.api, arg0)
  95. return Int(ret)
  96. }
  97. // Empty godot_dictionary_empty [[const godot_dictionary * p_self]] godot_bool
  98. func (gdt *Dictionary) Empty() Bool {
  99. arg0 := gdt.getBase()
  100. ret := C.go_godot_dictionary_empty(GDNative.api, arg0)
  101. return Bool(ret)
  102. }
  103. // Clear godot_dictionary_clear [[godot_dictionary * p_self]] void
  104. func (gdt *Dictionary) Clear() {
  105. arg0 := gdt.getBase()
  106. C.go_godot_dictionary_clear(GDNative.api, arg0)
  107. }
  108. // Has godot_dictionary_has [[const godot_dictionary * p_self] [const godot_variant * p_key]] godot_bool
  109. func (gdt *Dictionary) Has(key Variant) Bool {
  110. arg0 := gdt.getBase()
  111. arg1 := key.getBase()
  112. ret := C.go_godot_dictionary_has(GDNative.api, arg0, arg1)
  113. return Bool(ret)
  114. }
  115. // HasAll godot_dictionary_has_all [[const godot_dictionary * p_self] [const godot_array * p_keys]] godot_bool
  116. func (gdt *Dictionary) HasAll(keys Array) Bool {
  117. arg0 := gdt.getBase()
  118. arg1 := keys.getBase()
  119. ret := C.go_godot_dictionary_has_all(GDNative.api, arg0, arg1)
  120. return Bool(ret)
  121. }
  122. // Erase godot_dictionary_erase [[godot_dictionary * p_self] [const godot_variant * p_key]] void
  123. func (gdt *Dictionary) Erase(key Variant) {
  124. arg0 := gdt.getBase()
  125. arg1 := key.getBase()
  126. C.go_godot_dictionary_erase(GDNative.api, arg0, arg1)
  127. }
  128. // Hash godot_dictionary_hash [[const godot_dictionary * p_self]] godot_int
  129. func (gdt *Dictionary) Hash() Int {
  130. arg0 := gdt.getBase()
  131. ret := C.go_godot_dictionary_hash(GDNative.api, arg0)
  132. return Int(ret)
  133. }
  134. // Keys godot_dictionary_keys [[const godot_dictionary * p_self]] godot_array
  135. func (gdt *Dictionary) Keys() Array {
  136. arg0 := gdt.getBase()
  137. ret := C.go_godot_dictionary_keys(GDNative.api, arg0)
  138. return Array{base: &ret}
  139. }
  140. // Values godot_dictionary_values [[const godot_dictionary * p_self]] godot_array
  141. func (gdt *Dictionary) Values() Array {
  142. arg0 := gdt.getBase()
  143. ret := C.go_godot_dictionary_values(GDNative.api, arg0)
  144. return Array{base: &ret}
  145. }
  146. // Get godot_dictionary_get [[const godot_dictionary * p_self] [const godot_variant * p_key]] godot_variant
  147. func (gdt *Dictionary) Get(key Variant) Variant {
  148. arg0 := gdt.getBase()
  149. arg1 := key.getBase()
  150. ret := C.go_godot_dictionary_get(GDNative.api, arg0, arg1)
  151. return Variant{base: &ret}
  152. }
  153. // Set godot_dictionary_set [[godot_dictionary * p_self] [const godot_variant * p_key] [const godot_variant * p_value]] void
  154. func (gdt *Dictionary) Set(key Variant, value Variant) {
  155. arg0 := gdt.getBase()
  156. arg1 := key.getBase()
  157. arg2 := value.getBase()
  158. C.go_godot_dictionary_set(GDNative.api, arg0, arg1, arg2)
  159. }
  160. // OperatorIndex godot_dictionary_operator_index [[godot_dictionary * p_self] [const godot_variant * p_key]] godot_variant *
  161. func (gdt *Dictionary) OperatorIndex(key Variant) Variant {
  162. arg0 := gdt.getBase()
  163. arg1 := key.getBase()
  164. ret := C.go_godot_dictionary_operator_index(GDNative.api, arg0, arg1)
  165. return Variant{base: ret}
  166. }
  167. // OperatorIndexConst godot_dictionary_operator_index_const [[const godot_dictionary * p_self] [const godot_variant * p_key]] const godot_variant *
  168. func (gdt *Dictionary) OperatorIndexConst(key Variant) Variant {
  169. arg0 := gdt.getBase()
  170. arg1 := key.getBase()
  171. ret := C.go_godot_dictionary_operator_index_const(GDNative.api, arg0, arg1)
  172. return Variant{base: ret}
  173. }
  174. // Next godot_dictionary_next [[const godot_dictionary * p_self] [const godot_variant * p_key]] godot_variant *
  175. func (gdt *Dictionary) Next(key Variant) Variant {
  176. arg0 := gdt.getBase()
  177. arg1 := key.getBase()
  178. ret := C.go_godot_dictionary_next(GDNative.api, arg0, arg1)
  179. return Variant{base: ret}
  180. }
  181. // OperatorEqual godot_dictionary_operator_equal [[const godot_dictionary * p_self] [const godot_dictionary * p_b]] godot_bool
  182. func (gdt *Dictionary) OperatorEqual(b Dictionary) Bool {
  183. arg0 := gdt.getBase()
  184. arg1 := b.getBase()
  185. ret := C.go_godot_dictionary_operator_equal(GDNative.api, arg0, arg1)
  186. return Bool(ret)
  187. }
  188. // ToJson godot_dictionary_to_json [[const godot_dictionary * p_self]] godot_string
  189. func (gdt *Dictionary) ToJson() String {
  190. arg0 := gdt.getBase()
  191. ret := C.go_godot_dictionary_to_json(GDNative.api, arg0)
  192. utfStr := C.go_godot_string_utf8(GDNative.api, &ret)
  193. char := C.go_godot_char_string_get_data(GDNative.api, &utfStr)
  194. goStr := C.GoString(char)
  195. C.go_godot_char_string_destroy(GDNative.api, &utfStr)
  196. return String(goStr)
  197. }