123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379 |
- // 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/gdnative.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"
- // Error is a Go wrapper for the C.godot_error enum type.
- type Error int
- func (e Error) getBase() C.godot_error {
- return C.godot_error(e)
- }
- const (
- Ok Error = 0 // (0)
- Failed Error = 1 // < Generic fail error
- ErrUnavailable Error = 2 // < What is requested is unsupported/unavailable
- ErrUnconfigured Error = 3 // < The object being used hasn't been properly set up yet
- ErrUnauthorized Error = 4 // < Missing credentials for requested resource
- ErrParameterRangeError Error = 5 // < Parameter given out of range (5)
- ErrOutOfMemory Error = 6 // < Out of memory
- ErrFileNotFound Error = 7
- ErrFileBadDrive Error = 8
- ErrFileBadPath Error = 9
- ErrFileNoPermission Error = 10 // (10)
- ErrFileAlreadyInUse Error = 11
- ErrFileCantOpen Error = 12
- ErrFileCantWrite Error = 13
- ErrFileCantRead Error = 14
- ErrFileUnrecognized Error = 15 // (15)
- ErrFileCorrupt Error = 16
- ErrFileMissingDependencies Error = 17
- ErrFileEof Error = 18
- ErrCantOpen Error = 19 // < Can't open a resource/socket/file
- ErrCantCreate Error = 20 // (20)
- ErrQueryFailed Error = 21
- ErrAlreadyInUse Error = 22
- ErrLocked Error = 23 // < resource is locked
- ErrTimeout Error = 24
- ErrCantConnect Error = 25 // (25)
- ErrCantResolve Error = 26
- ErrConnectionError Error = 27
- ErrCantAcquireResource Error = 28
- ErrCantFork Error = 29
- ErrInvalidData Error = 30 // < Data passed is invalid (30)
- ErrInvalidParameter Error = 31 // < Parameter passed is invalid
- ErrAlreadyExists Error = 32 // < When adding, item already exists
- ErrDoesNotExist Error = 33 // < When retrieving/erasing, it item does not exist
- ErrDatabaseCantRead Error = 34 // < database is full
- ErrDatabaseCantWrite Error = 35 // < database is full (35)
- ErrCompilationFailed Error = 36
- ErrMethodNotFound Error = 37
- ErrLinkFailed Error = 38
- ErrScriptFailed Error = 39
- ErrCyclicLink Error = 40 // (40)
- ErrInvalidDeclaration Error = 41
- ErrDuplicateSymbol Error = 42
- ErrParseError Error = 43
- ErrBusy Error = 44
- ErrSkip Error = 45 // (45)
- ErrHelp Error = 46 // < user requested help!!
- ErrBug Error = 47 // < a bug in the software certainly happened, due to a double check failing or unexpected behavior.
- ErrPrinterOnFire Error = 48 // the parallel port printer is engulfed in flames
- )
- // ErrorLookupMap is a string-based lookup table of constants for Error.
- var ErrorLookupMap = map[string]Error{
- "Ok": Ok,
- "Failed": Failed,
- "ErrUnavailable": ErrUnavailable,
- "ErrUnconfigured": ErrUnconfigured,
- "ErrUnauthorized": ErrUnauthorized,
- "ErrParameterRangeError": ErrParameterRangeError,
- "ErrOutOfMemory": ErrOutOfMemory,
- "ErrFileNotFound": ErrFileNotFound,
- "ErrFileBadDrive": ErrFileBadDrive,
- "ErrFileBadPath": ErrFileBadPath,
- "ErrFileNoPermission": ErrFileNoPermission,
- "ErrFileAlreadyInUse": ErrFileAlreadyInUse,
- "ErrFileCantOpen": ErrFileCantOpen,
- "ErrFileCantWrite": ErrFileCantWrite,
- "ErrFileCantRead": ErrFileCantRead,
- "ErrFileUnrecognized": ErrFileUnrecognized,
- "ErrFileCorrupt": ErrFileCorrupt,
- "ErrFileMissingDependencies": ErrFileMissingDependencies,
- "ErrFileEof": ErrFileEof,
- "ErrCantOpen": ErrCantOpen,
- "ErrCantCreate": ErrCantCreate,
- "ErrQueryFailed": ErrQueryFailed,
- "ErrAlreadyInUse": ErrAlreadyInUse,
- "ErrLocked": ErrLocked,
- "ErrTimeout": ErrTimeout,
- "ErrCantConnect": ErrCantConnect,
- "ErrCantResolve": ErrCantResolve,
- "ErrConnectionError": ErrConnectionError,
- "ErrCantAcquireResource": ErrCantAcquireResource,
- "ErrCantFork": ErrCantFork,
- "ErrInvalidData": ErrInvalidData,
- "ErrInvalidParameter": ErrInvalidParameter,
- "ErrAlreadyExists": ErrAlreadyExists,
- "ErrDoesNotExist": ErrDoesNotExist,
- "ErrDatabaseCantRead": ErrDatabaseCantRead,
- "ErrDatabaseCantWrite": ErrDatabaseCantWrite,
- "ErrCompilationFailed": ErrCompilationFailed,
- "ErrMethodNotFound": ErrMethodNotFound,
- "ErrLinkFailed": ErrLinkFailed,
- "ErrScriptFailed": ErrScriptFailed,
- "ErrCyclicLink": ErrCyclicLink,
- "ErrInvalidDeclaration": ErrInvalidDeclaration,
- "ErrDuplicateSymbol": ErrDuplicateSymbol,
- "ErrParseError": ErrParseError,
- "ErrBusy": ErrBusy,
- "ErrSkip": ErrSkip,
- "ErrHelp": ErrHelp,
- "ErrBug": ErrBug,
- "ErrPrinterOnFire": ErrPrinterOnFire,
- }
- // NewEmptyBool will return a pointer to an empty
- // initialized Bool. This is primarily used in
- // conjunction with MethodBindPtrCall.
- func NewEmptyBool() Pointer {
- var obj C.godot_bool
- return Pointer{base: unsafe.Pointer(&obj)}
- }
- // NewPointerFromBool will return an unsafe pointer to the given
- // object. This is primarily used in conjunction with MethodBindPtrCall.
- func NewPointerFromBool(obj Bool) Pointer {
- base := obj.getBase()
- return Pointer{base: unsafe.Pointer(&base)}
- }
- // NewBoolFromPointer will return a Bool from the
- // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
- func NewBoolFromPointer(ptr Pointer) Bool {
- base := ptr.getBase()
- return Bool(*(*C.godot_bool)(base))
- }
- // Bool is a Go wrapper for the base C.godot_bool type
- type Bool bool
- func (t Bool) getBase() C.godot_bool {
- return C.godot_bool(t)
- }
- // NewEmptyInt will return a pointer to an empty
- // initialized Int. This is primarily used in
- // conjunction with MethodBindPtrCall.
- func NewEmptyInt() Pointer {
- var obj C.godot_int
- return Pointer{base: unsafe.Pointer(&obj)}
- }
- // NewPointerFromInt will return an unsafe pointer to the given
- // object. This is primarily used in conjunction with MethodBindPtrCall.
- func NewPointerFromInt(obj Int) Pointer {
- base := obj.getBase()
- return Pointer{base: unsafe.Pointer(&base)}
- }
- // NewIntFromPointer will return a Int from the
- // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
- func NewIntFromPointer(ptr Pointer) Int {
- base := ptr.getBase()
- return Int(*(*C.godot_int)(base))
- }
- // Int is a Go wrapper for the base C.godot_int type
- type Int int
- func (t Int) getBase() C.godot_int {
- return C.godot_int(t)
- }
- // NewEmptyReal will return a pointer to an empty
- // initialized Real. This is primarily used in
- // conjunction with MethodBindPtrCall.
- func NewEmptyReal() Pointer {
- var obj C.godot_real
- return Pointer{base: unsafe.Pointer(&obj)}
- }
- // NewPointerFromReal will return an unsafe pointer to the given
- // object. This is primarily used in conjunction with MethodBindPtrCall.
- func NewPointerFromReal(obj Real) Pointer {
- base := obj.getBase()
- return Pointer{base: unsafe.Pointer(&base)}
- }
- // NewRealFromPointer will return a Real from the
- // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
- func NewRealFromPointer(ptr Pointer) Real {
- base := ptr.getBase()
- return Real(*(*C.godot_real)(base))
- }
- // Real is a Go wrapper for the base C.godot_real type
- type Real float64
- func (t Real) getBase() C.godot_real {
- return C.godot_real(t)
- }
- // NewEmptyObject will return a pointer to an empty
- // initialized Object. This is primarily used in
- // conjunction with MethodBindPtrCall.
- func NewEmptyObject() Pointer {
- var obj C.godot_object
- return Pointer{base: unsafe.Pointer(&obj)}
- }
- // NewPointerFromObject will return an unsafe pointer to the given
- // object. This is primarily used in conjunction with MethodBindPtrCall.
- func NewPointerFromObject(obj Object) Pointer {
- return Pointer{base: unsafe.Pointer(obj.getBase())}
- }
- // NewObjectFromPointer will return a Object from the
- // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
- func NewObjectFromPointer(ptr Pointer) Object {
- obj := (**C.godot_object)(ptr.getBase())
- return Object{base: *obj}
- }
- // Object data structure wrapper
- type Object struct {
- base *C.godot_object
- }
- // returns the wrapped C base data type for this type
- func (gdt Object) getBase() *C.godot_object {
- return gdt.base
- }
- // NewEmptyMethodBind will return a pointer to an empty
- // initialized MethodBind. This is primarily used in
- // conjunction with MethodBindPtrCall.
- func NewEmptyMethodBind() Pointer {
- var obj C.godot_method_bind
- return Pointer{base: unsafe.Pointer(&obj)}
- }
- // NewPointerFromMethodBind will return an unsafe pointer to the given
- // object. This is primarily used in conjunction with MethodBindPtrCall.
- func NewPointerFromMethodBind(obj MethodBind) Pointer {
- return Pointer{base: unsafe.Pointer(obj.getBase())}
- }
- // NewMethodBindFromPointer will return a MethodBind from the
- // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
- func NewMethodBindFromPointer(ptr Pointer) MethodBind {
- return MethodBind{base: (*C.godot_method_bind)(ptr.getBase())}
- }
- // MethodBind data structure wrapper
- type MethodBind struct {
- base *C.godot_method_bind
- }
- // returns the wrapped C base data type for this type
- func (gdt MethodBind) getBase() *C.godot_method_bind {
- return gdt.base
- }
- // NewEmptyGdnativeApiVersion will return a pointer to an empty
- // initialized GdnativeApiVersion. This is primarily used in
- // conjunction with MethodBindPtrCall.
- func NewEmptyGdnativeApiVersion() Pointer {
- var obj C.godot_gdnative_api_version
- return Pointer{base: unsafe.Pointer(&obj)}
- }
- // NewPointerFromGdnativeApiVersion will return an unsafe pointer to the given
- // object. This is primarily used in conjunction with MethodBindPtrCall.
- func NewPointerFromGdnativeApiVersion(obj GdnativeApiVersion) Pointer {
- return Pointer{base: unsafe.Pointer(obj.getBase())}
- }
- // NewGdnativeApiVersionFromPointer will return a GdnativeApiVersion from the
- // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
- func NewGdnativeApiVersionFromPointer(ptr Pointer) GdnativeApiVersion {
- return GdnativeApiVersion{base: (*C.godot_gdnative_api_version)(ptr.getBase())}
- }
- // GdnativeApiVersion data structure wrapper
- type GdnativeApiVersion struct {
- base *C.godot_gdnative_api_version
- Major Uint
- Minor Uint
- }
- // returns the wrapped C base data type for this type
- func (gdt GdnativeApiVersion) getBase() *C.godot_gdnative_api_version {
- return gdt.base
- }
- // NewEmptyGdnativeTerminateOptions will return a pointer to an empty
- // initialized GdnativeTerminateOptions. This is primarily used in
- // conjunction with MethodBindPtrCall.
- func NewEmptyGdnativeTerminateOptions() Pointer {
- var obj C.godot_gdnative_terminate_options
- return Pointer{base: unsafe.Pointer(&obj)}
- }
- // NewPointerFromGdnativeTerminateOptions will return an unsafe pointer to the given
- // object. This is primarily used in conjunction with MethodBindPtrCall.
- func NewPointerFromGdnativeTerminateOptions(obj GdnativeTerminateOptions) Pointer {
- return Pointer{base: unsafe.Pointer(obj.getBase())}
- }
- // NewGdnativeTerminateOptionsFromPointer will return a GdnativeTerminateOptions from the
- // given unsafe pointer. This is primarily used in conjunction with MethodBindPtrCall.
- func NewGdnativeTerminateOptionsFromPointer(ptr Pointer) GdnativeTerminateOptions {
- return GdnativeTerminateOptions{base: (*C.godot_gdnative_terminate_options)(ptr.getBase())}
- }
- // GdnativeTerminateOptions data structure wrapper
- type GdnativeTerminateOptions struct {
- base *C.godot_gdnative_terminate_options
- InEditor Bool
- }
- // returns the wrapped C base data type for this type
- func (gdt GdnativeTerminateOptions) getBase() *C.godot_gdnative_terminate_options {
- return gdt.base
- }
|