// Copyright © 2019 - 2020 Oscar Campos // Copyright © 2017 - William Edwards // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package gdnative // ================================================================== // This file was autogenerated by PimPam GDNative-Go binding tools // Please do not modify this file, any change will be lost // ================================================================== /* #include "gdnative.gen.h" #include // Include all headers for now. TODO: Look up all the required // headers we need to import based on the method arguments and return types. #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include */ import "C" import "unsafe" // NewEmptyColor will return a pointer to an empty // initialized Color. This is primarily used in // conjunction with MethodBindPtrCall. func NewEmptyColor() Pointer { var obj C.godot_color return Pointer{base: unsafe.Pointer(&obj)} } // NewPointerFromColor will return an unsafe pointer to the given // object. This is primarily used in conjunction with MethodBindPtrCall. func NewPointerFromColor(obj Color) Pointer { return Pointer{base: unsafe.Pointer(obj.getBase())} } // NewColorFromPointer will return a Color from the // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall. func NewColorFromPointer(ptr Pointer) Color { return Color{base: (*C.godot_color)(ptr.getBase())} } // Color data structure wrapper type Color struct { base *C.godot_color } // returns the wrapped C base data type for this type func (gdt Color) getBase() *C.godot_color { return gdt.base } // 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 func NewColorRgba(r Real, g Real, b Real, a Real) Color { var dest C.godot_color arg1 := r.getBase() arg2 := g.getBase() arg3 := b.getBase() arg4 := a.getBase() C.go_godot_color_new_rgba(GDNative.api, &dest, arg1, arg2, arg3, arg4) return Color{base: &dest} } // 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 func NewColorRgb(r Real, g Real, b Real) Color { var dest C.godot_color arg1 := r.getBase() arg2 := g.getBase() arg3 := b.getBase() C.go_godot_color_new_rgb(GDNative.api, &dest, arg1, arg2, arg3) return Color{base: &dest} } // GetR godot_color_get_r [[const godot_color * p_self]] godot_real func (gdt *Color) GetR() Real { arg0 := gdt.getBase() ret := C.go_godot_color_get_r(GDNative.api, arg0) return Real(ret) } // SetR godot_color_set_r [[godot_color * p_self] [const godot_real r]] void func (gdt *Color) SetR(r Real) { arg0 := gdt.getBase() arg1 := r.getBase() C.go_godot_color_set_r(GDNative.api, arg0, arg1) } // GetG godot_color_get_g [[const godot_color * p_self]] godot_real func (gdt *Color) GetG() Real { arg0 := gdt.getBase() ret := C.go_godot_color_get_g(GDNative.api, arg0) return Real(ret) } // SetG godot_color_set_g [[godot_color * p_self] [const godot_real g]] void func (gdt *Color) SetG(g Real) { arg0 := gdt.getBase() arg1 := g.getBase() C.go_godot_color_set_g(GDNative.api, arg0, arg1) } // GetB godot_color_get_b [[const godot_color * p_self]] godot_real func (gdt *Color) GetB() Real { arg0 := gdt.getBase() ret := C.go_godot_color_get_b(GDNative.api, arg0) return Real(ret) } // SetB godot_color_set_b [[godot_color * p_self] [const godot_real b]] void func (gdt *Color) SetB(b Real) { arg0 := gdt.getBase() arg1 := b.getBase() C.go_godot_color_set_b(GDNative.api, arg0, arg1) } // GetA godot_color_get_a [[const godot_color * p_self]] godot_real func (gdt *Color) GetA() Real { arg0 := gdt.getBase() ret := C.go_godot_color_get_a(GDNative.api, arg0) return Real(ret) } // SetA godot_color_set_a [[godot_color * p_self] [const godot_real a]] void func (gdt *Color) SetA(a Real) { arg0 := gdt.getBase() arg1 := a.getBase() C.go_godot_color_set_a(GDNative.api, arg0, arg1) } // GetH godot_color_get_h [[const godot_color * p_self]] godot_real func (gdt *Color) GetH() Real { arg0 := gdt.getBase() ret := C.go_godot_color_get_h(GDNative.api, arg0) return Real(ret) } // GetS godot_color_get_s [[const godot_color * p_self]] godot_real func (gdt *Color) GetS() Real { arg0 := gdt.getBase() ret := C.go_godot_color_get_s(GDNative.api, arg0) return Real(ret) } // GetV godot_color_get_v [[const godot_color * p_self]] godot_real func (gdt *Color) GetV() Real { arg0 := gdt.getBase() ret := C.go_godot_color_get_v(GDNative.api, arg0) return Real(ret) } // AsString godot_color_as_string [[const godot_color * p_self]] godot_string func (gdt *Color) AsString() String { arg0 := gdt.getBase() ret := C.go_godot_color_as_string(GDNative.api, arg0) utfStr := C.go_godot_string_utf8(GDNative.api, &ret) char := C.go_godot_char_string_get_data(GDNative.api, &utfStr) goStr := C.GoString(char) C.go_godot_char_string_destroy(GDNative.api, &utfStr) return String(goStr) } // ToRgba32 godot_color_to_rgba32 [[const godot_color * p_self]] godot_int func (gdt *Color) ToRgba32() Int { arg0 := gdt.getBase() ret := C.go_godot_color_to_rgba32(GDNative.api, arg0) return Int(ret) } // ToArgb32 godot_color_to_argb32 [[const godot_color * p_self]] godot_int func (gdt *Color) ToArgb32() Int { arg0 := gdt.getBase() ret := C.go_godot_color_to_argb32(GDNative.api, arg0) return Int(ret) } // Gray godot_color_gray [[const godot_color * p_self]] godot_real func (gdt *Color) Gray() Real { arg0 := gdt.getBase() ret := C.go_godot_color_gray(GDNative.api, arg0) return Real(ret) } // Inverted godot_color_inverted [[const godot_color * p_self]] godot_color func (gdt *Color) Inverted() Color { arg0 := gdt.getBase() ret := C.go_godot_color_inverted(GDNative.api, arg0) return Color{base: &ret} } // Contrasted godot_color_contrasted [[const godot_color * p_self]] godot_color func (gdt *Color) Contrasted() Color { arg0 := gdt.getBase() ret := C.go_godot_color_contrasted(GDNative.api, arg0) return Color{base: &ret} } // LinearInterpolate godot_color_linear_interpolate [[const godot_color * p_self] [const godot_color * p_b] [const godot_real p_t]] godot_color func (gdt *Color) LinearInterpolate(b Color, t Real) Color { arg0 := gdt.getBase() arg1 := b.getBase() arg2 := t.getBase() ret := C.go_godot_color_linear_interpolate(GDNative.api, arg0, arg1, arg2) return Color{base: &ret} } // Blend godot_color_blend [[const godot_color * p_self] [const godot_color * p_over]] godot_color func (gdt *Color) Blend(over Color) Color { arg0 := gdt.getBase() arg1 := over.getBase() ret := C.go_godot_color_blend(GDNative.api, arg0, arg1) return Color{base: &ret} } // ToHtml godot_color_to_html [[const godot_color * p_self] [const godot_bool p_with_alpha]] godot_string func (gdt *Color) ToHtml(withAlpha Bool) String { arg0 := gdt.getBase() arg1 := withAlpha.getBase() ret := C.go_godot_color_to_html(GDNative.api, arg0, arg1) utfStr := C.go_godot_string_utf8(GDNative.api, &ret) char := C.go_godot_char_string_get_data(GDNative.api, &utfStr) goStr := C.GoString(char) C.go_godot_char_string_destroy(GDNative.api, &utfStr) return String(goStr) } // OperatorEqual godot_color_operator_equal [[const godot_color * p_self] [const godot_color * p_b]] godot_bool func (gdt *Color) OperatorEqual(b Color) Bool { arg0 := gdt.getBase() arg1 := b.getBase() ret := C.go_godot_color_operator_equal(GDNative.api, arg0, arg1) return Bool(ret) } // OperatorLess godot_color_operator_less [[const godot_color * p_self] [const godot_color * p_b]] godot_bool func (gdt *Color) OperatorLess(b Color) Bool { arg0 := gdt.getBase() arg1 := b.getBase() ret := C.go_godot_color_operator_less(GDNative.api, arg0, arg1) return Bool(ret) }