color.gen.go 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  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/color.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. // NewEmptyColor will return a pointer to an empty
  49. // initialized Color. This is primarily used in
  50. // conjunction with MethodBindPtrCall.
  51. func NewEmptyColor() Pointer {
  52. var obj C.godot_color
  53. return Pointer{base: unsafe.Pointer(&obj)}
  54. }
  55. // NewPointerFromColor will return an unsafe pointer to the given
  56. // object. This is primarily used in conjunction with MethodBindPtrCall.
  57. func NewPointerFromColor(obj Color) Pointer {
  58. return Pointer{base: unsafe.Pointer(obj.getBase())}
  59. }
  60. // NewColorFromPointer will return a Color from the
  61. // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
  62. func NewColorFromPointer(ptr Pointer) Color {
  63. return Color{base: (*C.godot_color)(ptr.getBase())}
  64. }
  65. // Color data structure wrapper
  66. type Color struct {
  67. base *C.godot_color
  68. }
  69. // returns the wrapped C base data type for this type
  70. func (gdt Color) getBase() *C.godot_color {
  71. return gdt.base
  72. }
  73. // NewColorRgba godot_color_new_rgba [[godot_color * r_dest] [const godot_real p_r] [const godot_real p_g] [const godot_real p_b] [const godot_real p_a]] void
  74. func NewColorRgba(r Real, g Real, b Real, a Real) Color {
  75. var dest C.godot_color
  76. arg1 := r.getBase()
  77. arg2 := g.getBase()
  78. arg3 := b.getBase()
  79. arg4 := a.getBase()
  80. C.go_godot_color_new_rgba(GDNative.api, &dest, arg1, arg2, arg3, arg4)
  81. return Color{base: &dest}
  82. }
  83. // NewColorRgb godot_color_new_rgb [[godot_color * r_dest] [const godot_real p_r] [const godot_real p_g] [const godot_real p_b]] void
  84. func NewColorRgb(r Real, g Real, b Real) Color {
  85. var dest C.godot_color
  86. arg1 := r.getBase()
  87. arg2 := g.getBase()
  88. arg3 := b.getBase()
  89. C.go_godot_color_new_rgb(GDNative.api, &dest, arg1, arg2, arg3)
  90. return Color{base: &dest}
  91. }
  92. // GetR godot_color_get_r [[const godot_color * p_self]] godot_real
  93. func (gdt *Color) GetR() Real {
  94. arg0 := gdt.getBase()
  95. ret := C.go_godot_color_get_r(GDNative.api, arg0)
  96. return Real(ret)
  97. }
  98. // SetR godot_color_set_r [[godot_color * p_self] [const godot_real r]] void
  99. func (gdt *Color) SetR(r Real) {
  100. arg0 := gdt.getBase()
  101. arg1 := r.getBase()
  102. C.go_godot_color_set_r(GDNative.api, arg0, arg1)
  103. }
  104. // GetG godot_color_get_g [[const godot_color * p_self]] godot_real
  105. func (gdt *Color) GetG() Real {
  106. arg0 := gdt.getBase()
  107. ret := C.go_godot_color_get_g(GDNative.api, arg0)
  108. return Real(ret)
  109. }
  110. // SetG godot_color_set_g [[godot_color * p_self] [const godot_real g]] void
  111. func (gdt *Color) SetG(g Real) {
  112. arg0 := gdt.getBase()
  113. arg1 := g.getBase()
  114. C.go_godot_color_set_g(GDNative.api, arg0, arg1)
  115. }
  116. // GetB godot_color_get_b [[const godot_color * p_self]] godot_real
  117. func (gdt *Color) GetB() Real {
  118. arg0 := gdt.getBase()
  119. ret := C.go_godot_color_get_b(GDNative.api, arg0)
  120. return Real(ret)
  121. }
  122. // SetB godot_color_set_b [[godot_color * p_self] [const godot_real b]] void
  123. func (gdt *Color) SetB(b Real) {
  124. arg0 := gdt.getBase()
  125. arg1 := b.getBase()
  126. C.go_godot_color_set_b(GDNative.api, arg0, arg1)
  127. }
  128. // GetA godot_color_get_a [[const godot_color * p_self]] godot_real
  129. func (gdt *Color) GetA() Real {
  130. arg0 := gdt.getBase()
  131. ret := C.go_godot_color_get_a(GDNative.api, arg0)
  132. return Real(ret)
  133. }
  134. // SetA godot_color_set_a [[godot_color * p_self] [const godot_real a]] void
  135. func (gdt *Color) SetA(a Real) {
  136. arg0 := gdt.getBase()
  137. arg1 := a.getBase()
  138. C.go_godot_color_set_a(GDNative.api, arg0, arg1)
  139. }
  140. // GetH godot_color_get_h [[const godot_color * p_self]] godot_real
  141. func (gdt *Color) GetH() Real {
  142. arg0 := gdt.getBase()
  143. ret := C.go_godot_color_get_h(GDNative.api, arg0)
  144. return Real(ret)
  145. }
  146. // GetS godot_color_get_s [[const godot_color * p_self]] godot_real
  147. func (gdt *Color) GetS() Real {
  148. arg0 := gdt.getBase()
  149. ret := C.go_godot_color_get_s(GDNative.api, arg0)
  150. return Real(ret)
  151. }
  152. // GetV godot_color_get_v [[const godot_color * p_self]] godot_real
  153. func (gdt *Color) GetV() Real {
  154. arg0 := gdt.getBase()
  155. ret := C.go_godot_color_get_v(GDNative.api, arg0)
  156. return Real(ret)
  157. }
  158. // AsString godot_color_as_string [[const godot_color * p_self]] godot_string
  159. func (gdt *Color) AsString() String {
  160. arg0 := gdt.getBase()
  161. ret := C.go_godot_color_as_string(GDNative.api, arg0)
  162. utfStr := C.go_godot_string_utf8(GDNative.api, &ret)
  163. char := C.go_godot_char_string_get_data(GDNative.api, &utfStr)
  164. goStr := C.GoString(char)
  165. C.go_godot_char_string_destroy(GDNative.api, &utfStr)
  166. return String(goStr)
  167. }
  168. // ToRgba32 godot_color_to_rgba32 [[const godot_color * p_self]] godot_int
  169. func (gdt *Color) ToRgba32() Int {
  170. arg0 := gdt.getBase()
  171. ret := C.go_godot_color_to_rgba32(GDNative.api, arg0)
  172. return Int(ret)
  173. }
  174. // ToArgb32 godot_color_to_argb32 [[const godot_color * p_self]] godot_int
  175. func (gdt *Color) ToArgb32() Int {
  176. arg0 := gdt.getBase()
  177. ret := C.go_godot_color_to_argb32(GDNative.api, arg0)
  178. return Int(ret)
  179. }
  180. // Gray godot_color_gray [[const godot_color * p_self]] godot_real
  181. func (gdt *Color) Gray() Real {
  182. arg0 := gdt.getBase()
  183. ret := C.go_godot_color_gray(GDNative.api, arg0)
  184. return Real(ret)
  185. }
  186. // Inverted godot_color_inverted [[const godot_color * p_self]] godot_color
  187. func (gdt *Color) Inverted() Color {
  188. arg0 := gdt.getBase()
  189. ret := C.go_godot_color_inverted(GDNative.api, arg0)
  190. return Color{base: &ret}
  191. }
  192. // Contrasted godot_color_contrasted [[const godot_color * p_self]] godot_color
  193. func (gdt *Color) Contrasted() Color {
  194. arg0 := gdt.getBase()
  195. ret := C.go_godot_color_contrasted(GDNative.api, arg0)
  196. return Color{base: &ret}
  197. }
  198. // LinearInterpolate godot_color_linear_interpolate [[const godot_color * p_self] [const godot_color * p_b] [const godot_real p_t]] godot_color
  199. func (gdt *Color) LinearInterpolate(b Color, t Real) Color {
  200. arg0 := gdt.getBase()
  201. arg1 := b.getBase()
  202. arg2 := t.getBase()
  203. ret := C.go_godot_color_linear_interpolate(GDNative.api, arg0, arg1, arg2)
  204. return Color{base: &ret}
  205. }
  206. // Blend godot_color_blend [[const godot_color * p_self] [const godot_color * p_over]] godot_color
  207. func (gdt *Color) Blend(over Color) Color {
  208. arg0 := gdt.getBase()
  209. arg1 := over.getBase()
  210. ret := C.go_godot_color_blend(GDNative.api, arg0, arg1)
  211. return Color{base: &ret}
  212. }
  213. // ToHtml godot_color_to_html [[const godot_color * p_self] [const godot_bool p_with_alpha]] godot_string
  214. func (gdt *Color) ToHtml(withAlpha Bool) String {
  215. arg0 := gdt.getBase()
  216. arg1 := withAlpha.getBase()
  217. ret := C.go_godot_color_to_html(GDNative.api, arg0, arg1)
  218. utfStr := C.go_godot_string_utf8(GDNative.api, &ret)
  219. char := C.go_godot_char_string_get_data(GDNative.api, &utfStr)
  220. goStr := C.GoString(char)
  221. C.go_godot_char_string_destroy(GDNative.api, &utfStr)
  222. return String(goStr)
  223. }
  224. // OperatorEqual godot_color_operator_equal [[const godot_color * p_self] [const godot_color * p_b]] godot_bool
  225. func (gdt *Color) OperatorEqual(b Color) Bool {
  226. arg0 := gdt.getBase()
  227. arg1 := b.getBase()
  228. ret := C.go_godot_color_operator_equal(GDNative.api, arg0, arg1)
  229. return Bool(ret)
  230. }
  231. // OperatorLess godot_color_operator_less [[const godot_color * p_self] [const godot_color * p_b]] godot_bool
  232. func (gdt *Color) OperatorLess(b Color) Bool {
  233. arg0 := gdt.getBase()
  234. arg1 := b.getBase()
  235. ret := C.go_godot_color_operator_less(GDNative.api, arg0, arg1)
  236. return Bool(ret)
  237. }