123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263 |
- // Copyright © 2019 - 2020 Oscar Campos <oscar.campos@thepimpam.com>
- // 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 <gdnative/dictionary.h>
- // 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 <gdnative/aabb.h>
- #include <gdnative/array.h>
- #include <gdnative/basis.h>
- #include <gdnative/color.h>
- #include <gdnative/dictionary.h>
- #include <gdnative/gdnative.h>
- #include <gdnative/node_path.h>
- #include <gdnative/plane.h>
- #include <gdnative/pool_arrays.h>
- #include <gdnative/quat.h>
- #include <gdnative/rect2.h>
- #include <gdnative/rid.h>
- #include <gdnative/string.h>
- #include <gdnative/string_name.h>
- #include <gdnative/transform.h>
- #include <gdnative/transform2d.h>
- #include <gdnative/variant.h>
- #include <gdnative/vector2.h>
- #include <gdnative/vector3.h>
- #include <gdnative_api_struct.gen.h>
- */
- import "C"
- import "unsafe"
- // NewEmptyDictionary will return a pointer to an empty
- // initialized Dictionary. This is primarily used in
- // conjunction with MethodBindPtrCall.
- func NewEmptyDictionary() Pointer {
- var obj C.godot_dictionary
- return Pointer{base: unsafe.Pointer(&obj)}
- }
- // NewPointerFromDictionary will return an unsafe pointer to the given
- // object. This is primarily used in conjunction with MethodBindPtrCall.
- func NewPointerFromDictionary(obj Dictionary) Pointer {
- return Pointer{base: unsafe.Pointer(obj.getBase())}
- }
- // NewDictionaryFromPointer will return a Dictionary from the
- // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
- func NewDictionaryFromPointer(ptr Pointer) Dictionary {
- return Dictionary{base: (*C.godot_dictionary)(ptr.getBase())}
- }
- // Dictionary data structure wrapper
- type Dictionary struct {
- base *C.godot_dictionary
- }
- // returns the wrapped C base data type for this type
- func (gdt Dictionary) getBase() *C.godot_dictionary {
- return gdt.base
- }
- // NewDictionary godot_dictionary_new [[godot_dictionary * r_dest]] void
- func NewDictionary() Dictionary {
- var dest C.godot_dictionary
- C.go_godot_dictionary_new(GDNative.api, &dest)
- return Dictionary{base: &dest}
- }
- // NewDictionaryCopy godot_dictionary_new_copy [[godot_dictionary * r_dest] [const godot_dictionary * p_src]] void
- func NewDictionaryCopy(src Dictionary) Dictionary {
- var dest C.godot_dictionary
- arg1 := src.getBase()
- C.go_godot_dictionary_new_copy(GDNative.api, &dest, arg1)
- return Dictionary{base: &dest}
- }
- // Destroy godot_dictionary_destroy [[godot_dictionary * p_self]] void
- func (gdt *Dictionary) Destroy() {
- arg0 := gdt.getBase()
- C.go_godot_dictionary_destroy(GDNative.api, arg0)
- }
- // Size godot_dictionary_size [[const godot_dictionary * p_self]] godot_int
- func (gdt *Dictionary) Size() Int {
- arg0 := gdt.getBase()
- ret := C.go_godot_dictionary_size(GDNative.api, arg0)
- return Int(ret)
- }
- // Empty godot_dictionary_empty [[const godot_dictionary * p_self]] godot_bool
- func (gdt *Dictionary) Empty() Bool {
- arg0 := gdt.getBase()
- ret := C.go_godot_dictionary_empty(GDNative.api, arg0)
- return Bool(ret)
- }
- // Clear godot_dictionary_clear [[godot_dictionary * p_self]] void
- func (gdt *Dictionary) Clear() {
- arg0 := gdt.getBase()
- C.go_godot_dictionary_clear(GDNative.api, arg0)
- }
- // Has godot_dictionary_has [[const godot_dictionary * p_self] [const godot_variant * p_key]] godot_bool
- func (gdt *Dictionary) Has(key Variant) Bool {
- arg0 := gdt.getBase()
- arg1 := key.getBase()
- ret := C.go_godot_dictionary_has(GDNative.api, arg0, arg1)
- return Bool(ret)
- }
- // HasAll godot_dictionary_has_all [[const godot_dictionary * p_self] [const godot_array * p_keys]] godot_bool
- func (gdt *Dictionary) HasAll(keys Array) Bool {
- arg0 := gdt.getBase()
- arg1 := keys.getBase()
- ret := C.go_godot_dictionary_has_all(GDNative.api, arg0, arg1)
- return Bool(ret)
- }
- // Erase godot_dictionary_erase [[godot_dictionary * p_self] [const godot_variant * p_key]] void
- func (gdt *Dictionary) Erase(key Variant) {
- arg0 := gdt.getBase()
- arg1 := key.getBase()
- C.go_godot_dictionary_erase(GDNative.api, arg0, arg1)
- }
- // Hash godot_dictionary_hash [[const godot_dictionary * p_self]] godot_int
- func (gdt *Dictionary) Hash() Int {
- arg0 := gdt.getBase()
- ret := C.go_godot_dictionary_hash(GDNative.api, arg0)
- return Int(ret)
- }
- // Keys godot_dictionary_keys [[const godot_dictionary * p_self]] godot_array
- func (gdt *Dictionary) Keys() Array {
- arg0 := gdt.getBase()
- ret := C.go_godot_dictionary_keys(GDNative.api, arg0)
- return Array{base: &ret}
- }
- // Values godot_dictionary_values [[const godot_dictionary * p_self]] godot_array
- func (gdt *Dictionary) Values() Array {
- arg0 := gdt.getBase()
- ret := C.go_godot_dictionary_values(GDNative.api, arg0)
- return Array{base: &ret}
- }
- // Get godot_dictionary_get [[const godot_dictionary * p_self] [const godot_variant * p_key]] godot_variant
- func (gdt *Dictionary) Get(key Variant) Variant {
- arg0 := gdt.getBase()
- arg1 := key.getBase()
- ret := C.go_godot_dictionary_get(GDNative.api, arg0, arg1)
- return Variant{base: &ret}
- }
- // Set godot_dictionary_set [[godot_dictionary * p_self] [const godot_variant * p_key] [const godot_variant * p_value]] void
- func (gdt *Dictionary) Set(key Variant, value Variant) {
- arg0 := gdt.getBase()
- arg1 := key.getBase()
- arg2 := value.getBase()
- C.go_godot_dictionary_set(GDNative.api, arg0, arg1, arg2)
- }
- // OperatorIndex godot_dictionary_operator_index [[godot_dictionary * p_self] [const godot_variant * p_key]] godot_variant *
- func (gdt *Dictionary) OperatorIndex(key Variant) Variant {
- arg0 := gdt.getBase()
- arg1 := key.getBase()
- ret := C.go_godot_dictionary_operator_index(GDNative.api, arg0, arg1)
- return Variant{base: ret}
- }
- // OperatorIndexConst godot_dictionary_operator_index_const [[const godot_dictionary * p_self] [const godot_variant * p_key]] const godot_variant *
- func (gdt *Dictionary) OperatorIndexConst(key Variant) Variant {
- arg0 := gdt.getBase()
- arg1 := key.getBase()
- ret := C.go_godot_dictionary_operator_index_const(GDNative.api, arg0, arg1)
- return Variant{base: ret}
- }
- // Next godot_dictionary_next [[const godot_dictionary * p_self] [const godot_variant * p_key]] godot_variant *
- func (gdt *Dictionary) Next(key Variant) Variant {
- arg0 := gdt.getBase()
- arg1 := key.getBase()
- ret := C.go_godot_dictionary_next(GDNative.api, arg0, arg1)
- return Variant{base: ret}
- }
- // OperatorEqual godot_dictionary_operator_equal [[const godot_dictionary * p_self] [const godot_dictionary * p_b]] godot_bool
- func (gdt *Dictionary) OperatorEqual(b Dictionary) Bool {
- arg0 := gdt.getBase()
- arg1 := b.getBase()
- ret := C.go_godot_dictionary_operator_equal(GDNative.api, arg0, arg1)
- return Bool(ret)
- }
- // ToJson godot_dictionary_to_json [[const godot_dictionary * p_self]] godot_string
- func (gdt *Dictionary) ToJson() String {
- arg0 := gdt.getBase()
- ret := C.go_godot_dictionary_to_json(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)
- }
|