1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305 |
- /**************************************************************************/
- /* gdextension_interface.h */
- /**************************************************************************/
- /* This file is part of: */
- /* GODOT ENGINE */
- /* https://godotengine.org */
- /**************************************************************************/
- /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */
- /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */
- /* */
- /* Permission is hereby granted, free of charge, to any person obtaining */
- /* a copy of this software and associated documentation files (the */
- /* "Software"), to deal in the Software without restriction, including */
- /* without limitation the rights to use, copy, modify, merge, publish, */
- /* distribute, sublicense, and/or sell copies of the Software, and to */
- /* permit persons to whom the Software is furnished to do so, subject to */
- /* the following conditions: */
- /* */
- /* The above copyright notice and this permission notice shall be */
- /* included in all copies or substantial portions of the Software. */
- /* */
- /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */
- /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */
- /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */
- /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */
- /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */
- /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */
- /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
- /**************************************************************************/
- #ifndef GDEXTENSION_INTERFACE_H
- #define GDEXTENSION_INTERFACE_H
- /* This is a C class header, you can copy it and use it directly in your own binders.
- * Together with the JSON file, you should be able to generate any binder.
- */
- #include <stddef.h>
- #include <stdint.h>
- #ifndef __cplusplus
- typedef uint32_t char32_t;
- typedef uint16_t char16_t;
- #endif
- #ifdef __cplusplus
- extern "C" {
- #endif
- /* VARIANT TYPES */
- typedef enum {
- GDEXTENSION_VARIANT_TYPE_NIL,
- /* atomic types */
- GDEXTENSION_VARIANT_TYPE_BOOL,
- GDEXTENSION_VARIANT_TYPE_INT,
- GDEXTENSION_VARIANT_TYPE_FLOAT,
- GDEXTENSION_VARIANT_TYPE_STRING,
- /* math types */
- GDEXTENSION_VARIANT_TYPE_VECTOR2,
- GDEXTENSION_VARIANT_TYPE_VECTOR2I,
- GDEXTENSION_VARIANT_TYPE_RECT2,
- GDEXTENSION_VARIANT_TYPE_RECT2I,
- GDEXTENSION_VARIANT_TYPE_VECTOR3,
- GDEXTENSION_VARIANT_TYPE_VECTOR3I,
- GDEXTENSION_VARIANT_TYPE_TRANSFORM2D,
- GDEXTENSION_VARIANT_TYPE_VECTOR4,
- GDEXTENSION_VARIANT_TYPE_VECTOR4I,
- GDEXTENSION_VARIANT_TYPE_PLANE,
- GDEXTENSION_VARIANT_TYPE_QUATERNION,
- GDEXTENSION_VARIANT_TYPE_AABB,
- GDEXTENSION_VARIANT_TYPE_BASIS,
- GDEXTENSION_VARIANT_TYPE_TRANSFORM3D,
- GDEXTENSION_VARIANT_TYPE_PROJECTION,
- /* misc types */
- GDEXTENSION_VARIANT_TYPE_COLOR,
- GDEXTENSION_VARIANT_TYPE_STRING_NAME,
- GDEXTENSION_VARIANT_TYPE_NODE_PATH,
- GDEXTENSION_VARIANT_TYPE_RID,
- GDEXTENSION_VARIANT_TYPE_OBJECT,
- GDEXTENSION_VARIANT_TYPE_CALLABLE,
- GDEXTENSION_VARIANT_TYPE_SIGNAL,
- GDEXTENSION_VARIANT_TYPE_DICTIONARY,
- GDEXTENSION_VARIANT_TYPE_ARRAY,
- /* typed arrays */
- GDEXTENSION_VARIANT_TYPE_PACKED_BYTE_ARRAY,
- GDEXTENSION_VARIANT_TYPE_PACKED_INT32_ARRAY,
- GDEXTENSION_VARIANT_TYPE_PACKED_INT64_ARRAY,
- GDEXTENSION_VARIANT_TYPE_PACKED_FLOAT32_ARRAY,
- GDEXTENSION_VARIANT_TYPE_PACKED_FLOAT64_ARRAY,
- GDEXTENSION_VARIANT_TYPE_PACKED_STRING_ARRAY,
- GDEXTENSION_VARIANT_TYPE_PACKED_VECTOR2_ARRAY,
- GDEXTENSION_VARIANT_TYPE_PACKED_VECTOR3_ARRAY,
- GDEXTENSION_VARIANT_TYPE_PACKED_COLOR_ARRAY,
- GDEXTENSION_VARIANT_TYPE_VARIANT_MAX
- } GDExtensionVariantType;
- typedef enum {
- /* comparison */
- GDEXTENSION_VARIANT_OP_EQUAL,
- GDEXTENSION_VARIANT_OP_NOT_EQUAL,
- GDEXTENSION_VARIANT_OP_LESS,
- GDEXTENSION_VARIANT_OP_LESS_EQUAL,
- GDEXTENSION_VARIANT_OP_GREATER,
- GDEXTENSION_VARIANT_OP_GREATER_EQUAL,
- /* mathematic */
- GDEXTENSION_VARIANT_OP_ADD,
- GDEXTENSION_VARIANT_OP_SUBTRACT,
- GDEXTENSION_VARIANT_OP_MULTIPLY,
- GDEXTENSION_VARIANT_OP_DIVIDE,
- GDEXTENSION_VARIANT_OP_NEGATE,
- GDEXTENSION_VARIANT_OP_POSITIVE,
- GDEXTENSION_VARIANT_OP_MODULE,
- GDEXTENSION_VARIANT_OP_POWER,
- /* bitwise */
- GDEXTENSION_VARIANT_OP_SHIFT_LEFT,
- GDEXTENSION_VARIANT_OP_SHIFT_RIGHT,
- GDEXTENSION_VARIANT_OP_BIT_AND,
- GDEXTENSION_VARIANT_OP_BIT_OR,
- GDEXTENSION_VARIANT_OP_BIT_XOR,
- GDEXTENSION_VARIANT_OP_BIT_NEGATE,
- /* logic */
- GDEXTENSION_VARIANT_OP_AND,
- GDEXTENSION_VARIANT_OP_OR,
- GDEXTENSION_VARIANT_OP_XOR,
- GDEXTENSION_VARIANT_OP_NOT,
- /* containment */
- GDEXTENSION_VARIANT_OP_IN,
- GDEXTENSION_VARIANT_OP_MAX
- } GDExtensionVariantOperator;
- // In this API there are multiple functions which expect the caller to pass a pointer
- // on return value as parameter.
- // In order to make it clear if the caller should initialize the return value or not
- // we have two flavor of types:
- // - `GDExtensionXXXPtr` for pointer on an initialized value
- // - `GDExtensionUninitializedXXXPtr` for pointer on uninitialized value
- //
- // Notes:
- // - Not respecting those requirements can seems harmless, but will lead to unexpected
- // segfault or memory leak (for instance with a specific compiler/OS, or when two
- // native extensions start doing ptrcall on each other).
- // - Initialization must be done with the function pointer returned by `variant_get_ptr_constructor`,
- // zero-initializing the variable should not be considered a valid initialization method here !
- // - Some types have no destructor (see `extension_api.json`'s `has_destructor` field), for
- // them it is always safe to skip the constructor for the return value if you are in a hurry ;-)
- typedef void *GDExtensionVariantPtr;
- typedef const void *GDExtensionConstVariantPtr;
- typedef void *GDExtensionUninitializedVariantPtr;
- typedef void *GDExtensionStringNamePtr;
- typedef const void *GDExtensionConstStringNamePtr;
- typedef void *GDExtensionUninitializedStringNamePtr;
- typedef void *GDExtensionStringPtr;
- typedef const void *GDExtensionConstStringPtr;
- typedef void *GDExtensionUninitializedStringPtr;
- typedef void *GDExtensionObjectPtr;
- typedef const void *GDExtensionConstObjectPtr;
- typedef void *GDExtensionUninitializedObjectPtr;
- typedef void *GDExtensionTypePtr;
- typedef const void *GDExtensionConstTypePtr;
- typedef void *GDExtensionUninitializedTypePtr;
- typedef const void *GDExtensionMethodBindPtr;
- typedef int64_t GDExtensionInt;
- typedef uint8_t GDExtensionBool;
- typedef uint64_t GDObjectInstanceID;
- typedef void *GDExtensionRefPtr;
- typedef const void *GDExtensionConstRefPtr;
- /* VARIANT DATA I/O */
- typedef enum {
- GDEXTENSION_CALL_OK,
- GDEXTENSION_CALL_ERROR_INVALID_METHOD,
- GDEXTENSION_CALL_ERROR_INVALID_ARGUMENT, // Expected a different variant type.
- GDEXTENSION_CALL_ERROR_TOO_MANY_ARGUMENTS, // Expected lower number of arguments.
- GDEXTENSION_CALL_ERROR_TOO_FEW_ARGUMENTS, // Expected higher number of arguments.
- GDEXTENSION_CALL_ERROR_INSTANCE_IS_NULL,
- GDEXTENSION_CALL_ERROR_METHOD_NOT_CONST, // Used for const call.
- } GDExtensionCallErrorType;
- typedef struct {
- GDExtensionCallErrorType error;
- int32_t argument;
- int32_t expected;
- } GDExtensionCallError;
- typedef void (*GDExtensionVariantFromTypeConstructorFunc)(GDExtensionUninitializedVariantPtr, GDExtensionTypePtr);
- typedef void (*GDExtensionTypeFromVariantConstructorFunc)(GDExtensionUninitializedTypePtr, GDExtensionVariantPtr);
- typedef void (*GDExtensionPtrOperatorEvaluator)(GDExtensionConstTypePtr p_left, GDExtensionConstTypePtr p_right, GDExtensionTypePtr r_result);
- typedef void (*GDExtensionPtrBuiltInMethod)(GDExtensionTypePtr p_base, const GDExtensionConstTypePtr *p_args, GDExtensionTypePtr r_return, int p_argument_count);
- typedef void (*GDExtensionPtrConstructor)(GDExtensionUninitializedTypePtr p_base, const GDExtensionConstTypePtr *p_args);
- typedef void (*GDExtensionPtrDestructor)(GDExtensionTypePtr p_base);
- typedef void (*GDExtensionPtrSetter)(GDExtensionTypePtr p_base, GDExtensionConstTypePtr p_value);
- typedef void (*GDExtensionPtrGetter)(GDExtensionConstTypePtr p_base, GDExtensionTypePtr r_value);
- typedef void (*GDExtensionPtrIndexedSetter)(GDExtensionTypePtr p_base, GDExtensionInt p_index, GDExtensionConstTypePtr p_value);
- typedef void (*GDExtensionPtrIndexedGetter)(GDExtensionConstTypePtr p_base, GDExtensionInt p_index, GDExtensionTypePtr r_value);
- typedef void (*GDExtensionPtrKeyedSetter)(GDExtensionTypePtr p_base, GDExtensionConstTypePtr p_key, GDExtensionConstTypePtr p_value);
- typedef void (*GDExtensionPtrKeyedGetter)(GDExtensionConstTypePtr p_base, GDExtensionConstTypePtr p_key, GDExtensionTypePtr r_value);
- typedef uint32_t (*GDExtensionPtrKeyedChecker)(GDExtensionConstVariantPtr p_base, GDExtensionConstVariantPtr p_key);
- typedef void (*GDExtensionPtrUtilityFunction)(GDExtensionTypePtr r_return, const GDExtensionConstTypePtr *p_args, int p_argument_count);
- typedef GDExtensionObjectPtr (*GDExtensionClassConstructor)();
- typedef void *(*GDExtensionInstanceBindingCreateCallback)(void *p_token, void *p_instance);
- typedef void (*GDExtensionInstanceBindingFreeCallback)(void *p_token, void *p_instance, void *p_binding);
- typedef GDExtensionBool (*GDExtensionInstanceBindingReferenceCallback)(void *p_token, void *p_binding, GDExtensionBool p_reference);
- typedef struct {
- GDExtensionInstanceBindingCreateCallback create_callback;
- GDExtensionInstanceBindingFreeCallback free_callback;
- GDExtensionInstanceBindingReferenceCallback reference_callback;
- } GDExtensionInstanceBindingCallbacks;
- /* EXTENSION CLASSES */
- typedef void *GDExtensionClassInstancePtr;
- typedef GDExtensionBool (*GDExtensionClassSet)(GDExtensionClassInstancePtr p_instance, GDExtensionConstStringNamePtr p_name, GDExtensionConstVariantPtr p_value);
- typedef GDExtensionBool (*GDExtensionClassGet)(GDExtensionClassInstancePtr p_instance, GDExtensionConstStringNamePtr p_name, GDExtensionVariantPtr r_ret);
- typedef uint64_t (*GDExtensionClassGetRID)(GDExtensionClassInstancePtr p_instance);
- typedef struct {
- GDExtensionVariantType type;
- GDExtensionStringNamePtr name;
- GDExtensionStringNamePtr class_name;
- uint32_t hint; // Bitfield of `PropertyHint` (defined in `extension_api.json`).
- GDExtensionStringPtr hint_string;
- uint32_t usage; // Bitfield of `PropertyUsageFlags` (defined in `extension_api.json`).
- } GDExtensionPropertyInfo;
- typedef struct {
- GDExtensionStringNamePtr name;
- GDExtensionPropertyInfo return_value;
- uint32_t flags; // Bitfield of `GDExtensionClassMethodFlags`.
- int32_t id;
- /* Arguments: `default_arguments` is an array of size `argument_count`. */
- uint32_t argument_count;
- GDExtensionPropertyInfo *arguments;
- /* Default arguments: `default_arguments` is an array of size `default_argument_count`. */
- uint32_t default_argument_count;
- GDExtensionVariantPtr *default_arguments;
- } GDExtensionMethodInfo;
- typedef const GDExtensionPropertyInfo *(*GDExtensionClassGetPropertyList)(GDExtensionClassInstancePtr p_instance, uint32_t *r_count);
- typedef void (*GDExtensionClassFreePropertyList)(GDExtensionClassInstancePtr p_instance, const GDExtensionPropertyInfo *p_list);
- typedef GDExtensionBool (*GDExtensionClassPropertyCanRevert)(GDExtensionClassInstancePtr p_instance, GDExtensionConstStringNamePtr p_name);
- typedef GDExtensionBool (*GDExtensionClassPropertyGetRevert)(GDExtensionClassInstancePtr p_instance, GDExtensionConstStringNamePtr p_name, GDExtensionVariantPtr r_ret);
- typedef void (*GDExtensionClassNotification)(GDExtensionClassInstancePtr p_instance, int32_t p_what);
- typedef void (*GDExtensionClassToString)(GDExtensionClassInstancePtr p_instance, GDExtensionBool *r_is_valid, GDExtensionStringPtr p_out);
- typedef void (*GDExtensionClassReference)(GDExtensionClassInstancePtr p_instance);
- typedef void (*GDExtensionClassUnreference)(GDExtensionClassInstancePtr p_instance);
- typedef void (*GDExtensionClassCallVirtual)(GDExtensionClassInstancePtr p_instance, const GDExtensionConstTypePtr *p_args, GDExtensionTypePtr r_ret);
- typedef GDExtensionObjectPtr (*GDExtensionClassCreateInstance)(void *p_userdata);
- typedef void (*GDExtensionClassFreeInstance)(void *p_userdata, GDExtensionClassInstancePtr p_instance);
- typedef GDExtensionClassCallVirtual (*GDExtensionClassGetVirtual)(void *p_userdata, GDExtensionConstStringNamePtr p_name);
- typedef struct {
- GDExtensionBool is_virtual;
- GDExtensionBool is_abstract;
- GDExtensionClassSet set_func;
- GDExtensionClassGet get_func;
- GDExtensionClassGetPropertyList get_property_list_func;
- GDExtensionClassFreePropertyList free_property_list_func;
- GDExtensionClassPropertyCanRevert property_can_revert_func;
- GDExtensionClassPropertyGetRevert property_get_revert_func;
- GDExtensionClassNotification notification_func;
- GDExtensionClassToString to_string_func;
- GDExtensionClassReference reference_func;
- GDExtensionClassUnreference unreference_func;
- GDExtensionClassCreateInstance create_instance_func; // (Default) constructor; mandatory. If the class is not instantiable, consider making it virtual or abstract.
- GDExtensionClassFreeInstance free_instance_func; // Destructor; mandatory.
- GDExtensionClassGetVirtual get_virtual_func; // Queries a virtual function by name and returns a callback to invoke the requested virtual function.
- GDExtensionClassGetRID get_rid_func;
- void *class_userdata; // Per-class user data, later accessible in instance bindings.
- } GDExtensionClassCreationInfo;
- typedef void *GDExtensionClassLibraryPtr;
- /* Method */
- typedef enum {
- GDEXTENSION_METHOD_FLAG_NORMAL = 1,
- GDEXTENSION_METHOD_FLAG_EDITOR = 2,
- GDEXTENSION_METHOD_FLAG_CONST = 4,
- GDEXTENSION_METHOD_FLAG_VIRTUAL = 8,
- GDEXTENSION_METHOD_FLAG_VARARG = 16,
- GDEXTENSION_METHOD_FLAG_STATIC = 32,
- GDEXTENSION_METHOD_FLAGS_DEFAULT = GDEXTENSION_METHOD_FLAG_NORMAL,
- } GDExtensionClassMethodFlags;
- typedef enum {
- GDEXTENSION_METHOD_ARGUMENT_METADATA_NONE,
- GDEXTENSION_METHOD_ARGUMENT_METADATA_INT_IS_INT8,
- GDEXTENSION_METHOD_ARGUMENT_METADATA_INT_IS_INT16,
- GDEXTENSION_METHOD_ARGUMENT_METADATA_INT_IS_INT32,
- GDEXTENSION_METHOD_ARGUMENT_METADATA_INT_IS_INT64,
- GDEXTENSION_METHOD_ARGUMENT_METADATA_INT_IS_UINT8,
- GDEXTENSION_METHOD_ARGUMENT_METADATA_INT_IS_UINT16,
- GDEXTENSION_METHOD_ARGUMENT_METADATA_INT_IS_UINT32,
- GDEXTENSION_METHOD_ARGUMENT_METADATA_INT_IS_UINT64,
- GDEXTENSION_METHOD_ARGUMENT_METADATA_REAL_IS_FLOAT,
- GDEXTENSION_METHOD_ARGUMENT_METADATA_REAL_IS_DOUBLE
- } GDExtensionClassMethodArgumentMetadata;
- typedef void (*GDExtensionClassMethodCall)(void *method_userdata, GDExtensionClassInstancePtr p_instance, const GDExtensionConstVariantPtr *p_args, GDExtensionInt p_argument_count, GDExtensionVariantPtr r_return, GDExtensionCallError *r_error);
- typedef void (*GDExtensionClassMethodValidatedCall)(void *method_userdata, GDExtensionClassInstancePtr p_instance, const GDExtensionConstVariantPtr *p_args, GDExtensionVariantPtr r_return);
- typedef void (*GDExtensionClassMethodPtrCall)(void *method_userdata, GDExtensionClassInstancePtr p_instance, const GDExtensionConstTypePtr *p_args, GDExtensionTypePtr r_ret);
- typedef struct {
- GDExtensionStringNamePtr name;
- void *method_userdata;
- GDExtensionClassMethodCall call_func;
- GDExtensionClassMethodPtrCall ptrcall_func;
- uint32_t method_flags; // Bitfield of `GDExtensionClassMethodFlags`.
- /* If `has_return_value` is false, `return_value_info` and `return_value_metadata` are ignored. */
- GDExtensionBool has_return_value;
- GDExtensionPropertyInfo *return_value_info;
- GDExtensionClassMethodArgumentMetadata return_value_metadata;
- /* Arguments: `arguments_info` and `arguments_metadata` are array of size `argument_count`.
- * Name and hint information for the argument can be omitted in release builds. Class name should always be present if it applies.
- */
- uint32_t argument_count;
- GDExtensionPropertyInfo *arguments_info;
- GDExtensionClassMethodArgumentMetadata *arguments_metadata;
- /* Default arguments: `default_arguments` is an array of size `default_argument_count`. */
- uint32_t default_argument_count;
- GDExtensionVariantPtr *default_arguments;
- } GDExtensionClassMethodInfo;
- /* SCRIPT INSTANCE EXTENSION */
- typedef void *GDExtensionScriptInstanceDataPtr; // Pointer to custom ScriptInstance native implementation.
- typedef GDExtensionBool (*GDExtensionScriptInstanceSet)(GDExtensionScriptInstanceDataPtr p_instance, GDExtensionConstStringNamePtr p_name, GDExtensionConstVariantPtr p_value);
- typedef GDExtensionBool (*GDExtensionScriptInstanceGet)(GDExtensionScriptInstanceDataPtr p_instance, GDExtensionConstStringNamePtr p_name, GDExtensionVariantPtr r_ret);
- typedef const GDExtensionPropertyInfo *(*GDExtensionScriptInstanceGetPropertyList)(GDExtensionScriptInstanceDataPtr p_instance, uint32_t *r_count);
- typedef void (*GDExtensionScriptInstanceFreePropertyList)(GDExtensionScriptInstanceDataPtr p_instance, const GDExtensionPropertyInfo *p_list);
- typedef GDExtensionVariantType (*GDExtensionScriptInstanceGetPropertyType)(GDExtensionScriptInstanceDataPtr p_instance, GDExtensionConstStringNamePtr p_name, GDExtensionBool *r_is_valid);
- typedef GDExtensionBool (*GDExtensionScriptInstancePropertyCanRevert)(GDExtensionScriptInstanceDataPtr p_instance, GDExtensionConstStringNamePtr p_name);
- typedef GDExtensionBool (*GDExtensionScriptInstancePropertyGetRevert)(GDExtensionScriptInstanceDataPtr p_instance, GDExtensionConstStringNamePtr p_name, GDExtensionVariantPtr r_ret);
- typedef GDExtensionObjectPtr (*GDExtensionScriptInstanceGetOwner)(GDExtensionScriptInstanceDataPtr p_instance);
- typedef void (*GDExtensionScriptInstancePropertyStateAdd)(GDExtensionConstStringNamePtr p_name, GDExtensionConstVariantPtr p_value, void *p_userdata);
- typedef void (*GDExtensionScriptInstanceGetPropertyState)(GDExtensionScriptInstanceDataPtr p_instance, GDExtensionScriptInstancePropertyStateAdd p_add_func, void *p_userdata);
- typedef const GDExtensionMethodInfo *(*GDExtensionScriptInstanceGetMethodList)(GDExtensionScriptInstanceDataPtr p_instance, uint32_t *r_count);
- typedef void (*GDExtensionScriptInstanceFreeMethodList)(GDExtensionScriptInstanceDataPtr p_instance, const GDExtensionMethodInfo *p_list);
- typedef GDExtensionBool (*GDExtensionScriptInstanceHasMethod)(GDExtensionScriptInstanceDataPtr p_instance, GDExtensionConstStringNamePtr p_name);
- typedef void (*GDExtensionScriptInstanceCall)(GDExtensionScriptInstanceDataPtr p_self, GDExtensionConstStringNamePtr p_method, const GDExtensionConstVariantPtr *p_args, GDExtensionInt p_argument_count, GDExtensionVariantPtr r_return, GDExtensionCallError *r_error);
- typedef void (*GDExtensionScriptInstanceNotification)(GDExtensionScriptInstanceDataPtr p_instance, int32_t p_what);
- typedef void (*GDExtensionScriptInstanceToString)(GDExtensionScriptInstanceDataPtr p_instance, GDExtensionBool *r_is_valid, GDExtensionStringPtr r_out);
- typedef void (*GDExtensionScriptInstanceRefCountIncremented)(GDExtensionScriptInstanceDataPtr p_instance);
- typedef GDExtensionBool (*GDExtensionScriptInstanceRefCountDecremented)(GDExtensionScriptInstanceDataPtr p_instance);
- typedef GDExtensionObjectPtr (*GDExtensionScriptInstanceGetScript)(GDExtensionScriptInstanceDataPtr p_instance);
- typedef GDExtensionBool (*GDExtensionScriptInstanceIsPlaceholder)(GDExtensionScriptInstanceDataPtr p_instance);
- typedef void *GDExtensionScriptLanguagePtr;
- typedef GDExtensionScriptLanguagePtr (*GDExtensionScriptInstanceGetLanguage)(GDExtensionScriptInstanceDataPtr p_instance);
- typedef void (*GDExtensionScriptInstanceFree)(GDExtensionScriptInstanceDataPtr p_instance);
- typedef void *GDExtensionScriptInstancePtr; // Pointer to ScriptInstance.
- typedef struct {
- GDExtensionScriptInstanceSet set_func;
- GDExtensionScriptInstanceGet get_func;
- GDExtensionScriptInstanceGetPropertyList get_property_list_func;
- GDExtensionScriptInstanceFreePropertyList free_property_list_func;
- GDExtensionScriptInstancePropertyCanRevert property_can_revert_func;
- GDExtensionScriptInstancePropertyGetRevert property_get_revert_func;
- GDExtensionScriptInstanceGetOwner get_owner_func;
- GDExtensionScriptInstanceGetPropertyState get_property_state_func;
- GDExtensionScriptInstanceGetMethodList get_method_list_func;
- GDExtensionScriptInstanceFreeMethodList free_method_list_func;
- GDExtensionScriptInstanceGetPropertyType get_property_type_func;
- GDExtensionScriptInstanceHasMethod has_method_func;
- GDExtensionScriptInstanceCall call_func;
- GDExtensionScriptInstanceNotification notification_func;
- GDExtensionScriptInstanceToString to_string_func;
- GDExtensionScriptInstanceRefCountIncremented refcount_incremented_func;
- GDExtensionScriptInstanceRefCountDecremented refcount_decremented_func;
- GDExtensionScriptInstanceGetScript get_script_func;
- GDExtensionScriptInstanceIsPlaceholder is_placeholder_func;
- GDExtensionScriptInstanceSet set_fallback_func;
- GDExtensionScriptInstanceGet get_fallback_func;
- GDExtensionScriptInstanceGetLanguage get_language_func;
- GDExtensionScriptInstanceFree free_func;
- } GDExtensionScriptInstanceInfo;
- /* INITIALIZATION */
- typedef enum {
- GDEXTENSION_INITIALIZATION_CORE,
- GDEXTENSION_INITIALIZATION_SERVERS,
- GDEXTENSION_INITIALIZATION_SCENE,
- GDEXTENSION_INITIALIZATION_EDITOR,
- GDEXTENSION_MAX_INITIALIZATION_LEVEL,
- } GDExtensionInitializationLevel;
- typedef struct {
- /* Minimum initialization level required.
- * If Core or Servers, the extension needs editor or game restart to take effect */
- GDExtensionInitializationLevel minimum_initialization_level;
- /* Up to the user to supply when initializing */
- void *userdata;
- /* This function will be called multiple times for each initialization level. */
- void (*initialize)(void *userdata, GDExtensionInitializationLevel p_level);
- void (*deinitialize)(void *userdata, GDExtensionInitializationLevel p_level);
- } GDExtensionInitialization;
- typedef void (*GDExtensionInterfaceFunctionPtr)();
- typedef GDExtensionInterfaceFunctionPtr (*GDExtensionInterfaceGetProcAddress)(const char *p_function_name);
- /*
- * Each GDExtension should define a C function that matches the signature of GDExtensionInitializationFunction,
- * and export it so that it can be loaded via dlopen() or equivalent for the given platform.
- *
- * For example:
- *
- * GDExtensionBool my_extension_init(GDExtensionInterfaceGetProcAddress p_get_proc_address, GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization);
- *
- * This function's name must be specified as the 'entry_symbol' in the .gdextension file.
- *
- * This makes it the entry point of the GDExtension and will be called on initialization.
- *
- * The GDExtension can then modify the r_initialization structure, setting the minimum initialization level,
- * and providing pointers to functions that will be called at various stages of initialization/shutdown.
- *
- * The rest of the GDExtension's interface to Godot consists of function pointers that can be loaded
- * by calling p_get_proc_address("...") with the name of the function.
- *
- * For example:
- *
- * GDExtensionInterfaceGetGodotVersion *get_godot_version = (GDExtensionInterfaceGetGodotVersion)p_get_proc_address("get_godot_version");
- *
- * You can then call it like a normal function:
- *
- * GDExtensionGodotVersion godot_version;
- * get_godot_version(&godot_version);
- * printf("Godot v%d.%d.%d\n", godot_version.major, godot_version.minor, godot_version.patch);
- *
- * All of these interface functions are described below, together with the name that's used to load it,
- * and the function pointer typedef that shows its signature.
- */
- typedef GDExtensionBool (*GDExtensionInitializationFunction)(GDExtensionInterfaceGetProcAddress p_get_proc_address, GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization);
- /* INTERFACE */
- typedef struct {
- uint32_t major;
- uint32_t minor;
- uint32_t patch;
- const char *string;
- } GDExtensionGodotVersion;
- /**
- * @name get_godot_version
- * @since 4.1
- *
- * Gets the Godot version that the GDExtension was loaded into.
- *
- * @param r_godot_version A pointer to the structure to write the version information into.
- */
- typedef void (*GDExtensionInterfaceGetGodotVersion)(GDExtensionGodotVersion *r_godot_version);
- /* INTERFACE: Memory */
- /**
- * @name mem_alloc
- * @since 4.1
- *
- * Allocates memory.
- *
- * @param p_bytes The amount of memory to allocate in bytes.
- *
- * @return A pointer to the allocated memory, or NULL if unsuccessful.
- */
- typedef void *(*GDExtensionInterfaceMemAlloc)(size_t p_bytes);
- /**
- * @name mem_realloc
- * @since 4.1
- *
- * Reallocates memory.
- *
- * @param p_ptr A pointer to the previously allocated memory.
- * @param p_bytes The number of bytes to resize the memory block to.
- *
- * @return A pointer to the allocated memory, or NULL if unsuccessful.
- */
- typedef void *(*GDExtensionInterfaceMemRealloc)(void *p_ptr, size_t p_bytes);
- /**
- * @name mem_free
- * @since 4.1
- *
- * Frees memory.
- *
- * @param p_ptr A pointer to the previously allocated memory.
- */
- typedef void (*GDExtensionInterfaceMemFree)(void *p_ptr);
- /* INTERFACE: Godot Core */
- /**
- * @name print_error
- * @since 4.1
- *
- * Logs an error to Godot's built-in debugger and to the OS terminal.
- *
- * @param p_description The code trigging the error.
- * @param p_function The function name where the error occurred.
- * @param p_file The file where the error occurred.
- * @param p_line The line where the error occurred.
- * @param p_editor_notify Whether or not to notify the editor.
- */
- typedef void (*GDExtensionInterfacePrintError)(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, GDExtensionBool p_editor_notify);
- /**
- * @name print_error_with_message
- * @since 4.1
- *
- * Logs an error with a message to Godot's built-in debugger and to the OS terminal.
- *
- * @param p_description The code trigging the error.
- * @param p_message The message to show along with the error.
- * @param p_function The function name where the error occurred.
- * @param p_file The file where the error occurred.
- * @param p_line The line where the error occurred.
- * @param p_editor_notify Whether or not to notify the editor.
- */
- typedef void (*GDExtensionInterfacePrintErrorWithMessage)(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, GDExtensionBool p_editor_notify);
- /**
- * @name print_warning
- * @since 4.1
- *
- * Logs a warning to Godot's built-in debugger and to the OS terminal.
- *
- * @param p_description The code trigging the warning.
- * @param p_function The function name where the warning occurred.
- * @param p_file The file where the warning occurred.
- * @param p_line The line where the warning occurred.
- * @param p_editor_notify Whether or not to notify the editor.
- */
- typedef void (*GDExtensionInterfacePrintWarning)(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, GDExtensionBool p_editor_notify);
- /**
- * @name print_warning_with_message
- * @since 4.1
- *
- * Logs a warning with a message to Godot's built-in debugger and to the OS terminal.
- *
- * @param p_description The code trigging the warning.
- * @param p_message The message to show along with the warning.
- * @param p_function The function name where the warning occurred.
- * @param p_file The file where the warning occurred.
- * @param p_line The line where the warning occurred.
- * @param p_editor_notify Whether or not to notify the editor.
- */
- typedef void (*GDExtensionInterfacePrintWarningWithMessage)(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, GDExtensionBool p_editor_notify);
- /**
- * @name print_script_error
- * @since 4.1
- *
- * Logs a script error to Godot's built-in debugger and to the OS terminal.
- *
- * @param p_description The code trigging the error.
- * @param p_function The function name where the error occurred.
- * @param p_file The file where the error occurred.
- * @param p_line The line where the error occurred.
- * @param p_editor_notify Whether or not to notify the editor.
- */
- typedef void (*GDExtensionInterfacePrintScriptError)(const char *p_description, const char *p_function, const char *p_file, int32_t p_line, GDExtensionBool p_editor_notify);
- /**
- * @name print_script_error_with_message
- * @since 4.1
- *
- * Logs a script error with a message to Godot's built-in debugger and to the OS terminal.
- *
- * @param p_description The code trigging the error.
- * @param p_message The message to show along with the error.
- * @param p_function The function name where the error occurred.
- * @param p_file The file where the error occurred.
- * @param p_line The line where the error occurred.
- * @param p_editor_notify Whether or not to notify the editor.
- */
- typedef void (*GDExtensionInterfacePrintScriptErrorWithMessage)(const char *p_description, const char *p_message, const char *p_function, const char *p_file, int32_t p_line, GDExtensionBool p_editor_notify);
- /**
- * @name get_native_struct_size
- * @since 4.1
- *
- * Gets the size of a native struct (ex. ObjectID) in bytes.
- *
- * @param p_name A pointer to a StringName identifying the struct name.
- *
- * @return The size in bytes.
- */
- typedef uint64_t (*GDExtensionInterfaceGetNativeStructSize)(GDExtensionConstStringNamePtr p_name);
- /* INTERFACE: Variant */
- /**
- * @name variant_new_copy
- * @since 4.1
- *
- * Copies one Variant into a another.
- *
- * @param r_dest A pointer to the destination Variant.
- * @param p_src A pointer to the source Variant.
- */
- typedef void (*GDExtensionInterfaceVariantNewCopy)(GDExtensionUninitializedVariantPtr r_dest, GDExtensionConstVariantPtr p_src);
- /**
- * @name variant_new_nil
- * @since 4.1
- *
- * Creates a new Variant containing nil.
- *
- * @param r_dest A pointer to the destination Variant.
- */
- typedef void (*GDExtensionInterfaceVariantNewNil)(GDExtensionUninitializedVariantPtr r_dest);
- /**
- * @name variant_destroy
- * @since 4.1
- *
- * Destroys a Variant.
- *
- * @param p_self A pointer to the Variant to destroy.
- */
- typedef void (*GDExtensionInterfaceVariantDestroy)(GDExtensionVariantPtr p_self);
- /**
- * @name variant_call
- * @since 4.1
- *
- * Calls a method on a Variant.
- *
- * @param p_self A pointer to the Variant.
- * @param p_method A pointer to a StringName identifying the method.
- * @param p_args A pointer to a C array of Variant.
- * @param p_argument_count The number of arguments.
- * @param r_return A pointer a Variant which will be assigned the return value.
- * @param r_error A pointer the structure which will hold error information.
- *
- * @see Variant::callp()
- */
- typedef void (*GDExtensionInterfaceVariantCall)(GDExtensionVariantPtr p_self, GDExtensionConstStringNamePtr p_method, const GDExtensionConstVariantPtr *p_args, GDExtensionInt p_argument_count, GDExtensionUninitializedVariantPtr r_return, GDExtensionCallError *r_error);
- /**
- * @name variant_call_static
- * @since 4.1
- *
- * Calls a static method on a Variant.
- *
- * @param p_self A pointer to the Variant.
- * @param p_method A pointer to a StringName identifying the method.
- * @param p_args A pointer to a C array of Variant.
- * @param p_argument_count The number of arguments.
- * @param r_return A pointer a Variant which will be assigned the return value.
- * @param r_error A pointer the structure which will be updated with error information.
- *
- * @see Variant::call_static()
- */
- typedef void (*GDExtensionInterfaceVariantCallStatic)(GDExtensionVariantType p_type, GDExtensionConstStringNamePtr p_method, const GDExtensionConstVariantPtr *p_args, GDExtensionInt p_argument_count, GDExtensionUninitializedVariantPtr r_return, GDExtensionCallError *r_error);
- /**
- * @name variant_evaluate
- * @since 4.1
- *
- * Evaluate an operator on two Variants.
- *
- * @param p_op The operator to evaluate.
- * @param p_a The first Variant.
- * @param p_b The second Variant.
- * @param r_return A pointer a Variant which will be assigned the return value.
- * @param r_valid A pointer to a boolean which will be set to false if the operation is invalid.
- *
- * @see Variant::evaluate()
- */
- typedef void (*GDExtensionInterfaceVariantEvaluate)(GDExtensionVariantOperator p_op, GDExtensionConstVariantPtr p_a, GDExtensionConstVariantPtr p_b, GDExtensionUninitializedVariantPtr r_return, GDExtensionBool *r_valid);
- /**
- * @name variant_set
- * @since 4.1
- *
- * Sets a key on a Variant to a value.
- *
- * @param p_self A pointer to the Variant.
- * @param p_key A pointer to a Variant representing the key.
- * @param p_value A pointer to a Variant representing the value.
- * @param r_valid A pointer to a boolean which will be set to false if the operation is invalid.
- *
- * @see Variant::set()
- */
- typedef void (*GDExtensionInterfaceVariantSet)(GDExtensionVariantPtr p_self, GDExtensionConstVariantPtr p_key, GDExtensionConstVariantPtr p_value, GDExtensionBool *r_valid);
- /**
- * @name variant_set_named
- * @since 4.1
- *
- * Sets a named key on a Variant to a value.
- *
- * @param p_self A pointer to the Variant.
- * @param p_key A pointer to a StringName representing the key.
- * @param p_value A pointer to a Variant representing the value.
- * @param r_valid A pointer to a boolean which will be set to false if the operation is invalid.
- *
- * @see Variant::set_named()
- */
- typedef void (*GDExtensionInterfaceVariantSetNamed)(GDExtensionVariantPtr p_self, GDExtensionConstStringNamePtr p_key, GDExtensionConstVariantPtr p_value, GDExtensionBool *r_valid);
- /**
- * @name variant_set_keyed
- * @since 4.1
- *
- * Sets a keyed property on a Variant to a value.
- *
- * @param p_self A pointer to the Variant.
- * @param p_key A pointer to a Variant representing the key.
- * @param p_value A pointer to a Variant representing the value.
- * @param r_valid A pointer to a boolean which will be set to false if the operation is invalid.
- *
- * @see Variant::set_keyed()
- */
- typedef void (*GDExtensionInterfaceVariantSetKeyed)(GDExtensionVariantPtr p_self, GDExtensionConstVariantPtr p_key, GDExtensionConstVariantPtr p_value, GDExtensionBool *r_valid);
- /**
- * @name variant_set_indexed
- * @since 4.1
- *
- * Sets an index on a Variant to a value.
- *
- * @param p_self A pointer to the Variant.
- * @param p_index The index.
- * @param p_value A pointer to a Variant representing the value.
- * @param r_valid A pointer to a boolean which will be set to false if the operation is invalid.
- * @param r_oob A pointer to a boolean which will be set to true if the index is out of bounds.
- */
- typedef void (*GDExtensionInterfaceVariantSetIndexed)(GDExtensionVariantPtr p_self, GDExtensionInt p_index, GDExtensionConstVariantPtr p_value, GDExtensionBool *r_valid, GDExtensionBool *r_oob);
- /**
- * @name variant_get
- * @since 4.1
- *
- * Gets the value of a key from a Variant.
- *
- * @param p_self A pointer to the Variant.
- * @param p_key A pointer to a Variant representing the key.
- * @param r_ret A pointer to a Variant which will be assigned the value.
- * @param r_valid A pointer to a boolean which will be set to false if the operation is invalid.
- */
- typedef void (*GDExtensionInterfaceVariantGet)(GDExtensionConstVariantPtr p_self, GDExtensionConstVariantPtr p_key, GDExtensionUninitializedVariantPtr r_ret, GDExtensionBool *r_valid);
- /**
- * @name variant_get_named
- * @since 4.1
- *
- * Gets the value of a named key from a Variant.
- *
- * @param p_self A pointer to the Variant.
- * @param p_key A pointer to a StringName representing the key.
- * @param r_ret A pointer to a Variant which will be assigned the value.
- * @param r_valid A pointer to a boolean which will be set to false if the operation is invalid.
- */
- typedef void (*GDExtensionInterfaceVariantGetNamed)(GDExtensionConstVariantPtr p_self, GDExtensionConstStringNamePtr p_key, GDExtensionUninitializedVariantPtr r_ret, GDExtensionBool *r_valid);
- /**
- * @name variant_get_keyed
- * @since 4.1
- *
- * Gets the value of a keyed property from a Variant.
- *
- * @param p_self A pointer to the Variant.
- * @param p_key A pointer to a Variant representing the key.
- * @param r_ret A pointer to a Variant which will be assigned the value.
- * @param r_valid A pointer to a boolean which will be set to false if the operation is invalid.
- */
- typedef void (*GDExtensionInterfaceVariantGetKeyed)(GDExtensionConstVariantPtr p_self, GDExtensionConstVariantPtr p_key, GDExtensionUninitializedVariantPtr r_ret, GDExtensionBool *r_valid);
- /**
- * @name variant_get_indexed
- * @since 4.1
- *
- * Gets the value of an index from a Variant.
- *
- * @param p_self A pointer to the Variant.
- * @param p_index The index.
- * @param r_ret A pointer to a Variant which will be assigned the value.
- * @param r_valid A pointer to a boolean which will be set to false if the operation is invalid.
- * @param r_oob A pointer to a boolean which will be set to true if the index is out of bounds.
- */
- typedef void (*GDExtensionInterfaceVariantGetIndexed)(GDExtensionConstVariantPtr p_self, GDExtensionInt p_index, GDExtensionUninitializedVariantPtr r_ret, GDExtensionBool *r_valid, GDExtensionBool *r_oob);
- /**
- * @name variant_iter_init
- * @since 4.1
- *
- * Initializes an iterator over a Variant.
- *
- * @param p_self A pointer to the Variant.
- * @param r_iter A pointer to a Variant which will be assigned the iterator.
- * @param r_valid A pointer to a boolean which will be set to false if the operation is invalid.
- *
- * @return true if the operation is valid; otherwise false.
- *
- * @see Variant::iter_init()
- */
- typedef GDExtensionBool (*GDExtensionInterfaceVariantIterInit)(GDExtensionConstVariantPtr p_self, GDExtensionUninitializedVariantPtr r_iter, GDExtensionBool *r_valid);
- /**
- * @name variant_iter_next
- * @since 4.1
- *
- * Gets the next value for an iterator over a Variant.
- *
- * @param p_self A pointer to the Variant.
- * @param r_iter A pointer to a Variant which will be assigned the iterator.
- * @param r_valid A pointer to a boolean which will be set to false if the operation is invalid.
- *
- * @return true if the operation is valid; otherwise false.
- *
- * @see Variant::iter_next()
- */
- typedef GDExtensionBool (*GDExtensionInterfaceVariantIterNext)(GDExtensionConstVariantPtr p_self, GDExtensionVariantPtr r_iter, GDExtensionBool *r_valid);
- /**
- * @name variant_iter_get
- * @since 4.1
- *
- * Gets the next value for an iterator over a Variant.
- *
- * @param p_self A pointer to the Variant.
- * @param r_iter A pointer to a Variant which will be assigned the iterator.
- * @param r_ret A pointer to a Variant which will be assigned false if the operation is invalid.
- * @param r_valid A pointer to a boolean which will be set to false if the operation is invalid.
- *
- * @see Variant::iter_get()
- */
- typedef void (*GDExtensionInterfaceVariantIterGet)(GDExtensionConstVariantPtr p_self, GDExtensionVariantPtr r_iter, GDExtensionUninitializedVariantPtr r_ret, GDExtensionBool *r_valid);
- /**
- * @name variant_hash
- * @since 4.1
- *
- * Gets the hash of a Variant.
- *
- * @param p_self A pointer to the Variant.
- *
- * @return The hash value.
- *
- * @see Variant::hash()
- */
- typedef GDExtensionInt (*GDExtensionInterfaceVariantHash)(GDExtensionConstVariantPtr p_self);
- /**
- * @name variant_recursive_hash
- * @since 4.1
- *
- * Gets the recursive hash of a Variant.
- *
- * @param p_self A pointer to the Variant.
- * @param p_recursion_count The number of recursive loops so far.
- *
- * @return The hash value.
- *
- * @see Variant::recursive_hash()
- */
- typedef GDExtensionInt (*GDExtensionInterfaceVariantRecursiveHash)(GDExtensionConstVariantPtr p_self, GDExtensionInt p_recursion_count);
- /**
- * @name variant_hash_compare
- * @since 4.1
- *
- * Compares two Variants by their hash.
- *
- * @param p_self A pointer to the Variant.
- * @param p_other A pointer to the other Variant to compare it to.
- *
- * @return The hash value.
- *
- * @see Variant::hash_compare()
- */
- typedef GDExtensionBool (*GDExtensionInterfaceVariantHashCompare)(GDExtensionConstVariantPtr p_self, GDExtensionConstVariantPtr p_other);
- /**
- * @name variant_booleanize
- * @since 4.1
- *
- * Converts a Variant to a boolean.
- *
- * @param p_self A pointer to the Variant.
- *
- * @return The boolean value of the Variant.
- */
- typedef GDExtensionBool (*GDExtensionInterfaceVariantBooleanize)(GDExtensionConstVariantPtr p_self);
- /**
- * @name variant_duplicate
- * @since 4.1
- *
- * Duplicates a Variant.
- *
- * @param p_self A pointer to the Variant.
- * @param r_ret A pointer to a Variant to store the duplicated value.
- * @param p_deep Whether or not to duplicate deeply (when supported by the Variant type).
- */
- typedef void (*GDExtensionInterfaceVariantDuplicate)(GDExtensionConstVariantPtr p_self, GDExtensionVariantPtr r_ret, GDExtensionBool p_deep);
- /**
- * @name variant_stringify
- * @since 4.1
- *
- * Converts a Variant to a string.
- *
- * @param p_self A pointer to the Variant.
- * @param r_ret A pointer to a String to store the resulting value.
- */
- typedef void (*GDExtensionInterfaceVariantStringify)(GDExtensionConstVariantPtr p_self, GDExtensionStringPtr r_ret);
- /**
- * @name variant_get_type
- * @since 4.1
- *
- * Gets the type of a Variant.
- *
- * @param p_self A pointer to the Variant.
- *
- * @return The variant type.
- */
- typedef GDExtensionVariantType (*GDExtensionInterfaceVariantGetType)(GDExtensionConstVariantPtr p_self);
- /**
- * @name variant_has_method
- * @since 4.1
- *
- * Checks if a Variant has the given method.
- *
- * @param p_self A pointer to the Variant.
- * @param p_method A pointer to a StringName with the method name.
- *
- * @return
- */
- typedef GDExtensionBool (*GDExtensionInterfaceVariantHasMethod)(GDExtensionConstVariantPtr p_self, GDExtensionConstStringNamePtr p_method);
- /**
- * @name variant_has_member
- * @since 4.1
- *
- * Checks if a type of Variant has the given member.
- *
- * @param p_type The Variant type.
- * @param p_member A pointer to a StringName with the member name.
- *
- * @return
- */
- typedef GDExtensionBool (*GDExtensionInterfaceVariantHasMember)(GDExtensionVariantType p_type, GDExtensionConstStringNamePtr p_member);
- /**
- * @name variant_has_key
- * @since 4.1
- *
- * Checks if a Variant has a key.
- *
- * @param p_self A pointer to the Variant.
- * @param p_key A pointer to a Variant representing the key.
- * @param r_valid A pointer to a boolean which will be set to false if the key doesn't exist.
- *
- * @return true if the key exists; otherwise false.
- */
- typedef GDExtensionBool (*GDExtensionInterfaceVariantHasKey)(GDExtensionConstVariantPtr p_self, GDExtensionConstVariantPtr p_key, GDExtensionBool *r_valid);
- /**
- * @name variant_get_type_name
- * @since 4.1
- *
- * Gets the name of a Variant type.
- *
- * @param p_type The Variant type.
- * @param r_name A pointer to a String to store the Variant type name.
- */
- typedef void (*GDExtensionInterfaceVariantGetTypeName)(GDExtensionVariantType p_type, GDExtensionUninitializedStringPtr r_name);
- /**
- * @name variant_can_convert
- * @since 4.1
- *
- * Checks if Variants can be converted from one type to another.
- *
- * @param p_from The Variant type to convert from.
- * @param p_to The Variant type to convert to.
- *
- * @return true if the conversion is possible; otherwise false.
- */
- typedef GDExtensionBool (*GDExtensionInterfaceVariantCanConvert)(GDExtensionVariantType p_from, GDExtensionVariantType p_to);
- /**
- * @name variant_can_convert_strict
- * @since 4.1
- *
- * Checks if Variant can be converted from one type to another using stricter rules.
- *
- * @param p_from The Variant type to convert from.
- * @param p_to The Variant type to convert to.
- *
- * @return true if the conversion is possible; otherwise false.
- */
- typedef GDExtensionBool (*GDExtensionInterfaceVariantCanConvertStrict)(GDExtensionVariantType p_from, GDExtensionVariantType p_to);
- /**
- * @name get_variant_from_type_constructor
- * @since 4.1
- *
- * Gets a pointer to a function that can create a Variant of the given type from a raw value.
- *
- * @param p_type The Variant type.
- *
- * @return A pointer to a function that can create a Variant of the given type from a raw value.
- */
- typedef GDExtensionVariantFromTypeConstructorFunc (*GDExtensionInterfaceGetVariantFromTypeConstructor)(GDExtensionVariantType p_type);
- /**
- * @name get_variant_to_type_constructor
- * @since 4.1
- *
- * Gets a pointer to a function that can get the raw value from a Variant of the given type.
- *
- * @param p_type The Variant type.
- *
- * @return A pointer to a function that can get the raw value from a Variant of the given type.
- */
- typedef GDExtensionTypeFromVariantConstructorFunc (*GDExtensionInterfaceGetVariantToTypeConstructor)(GDExtensionVariantType p_type);
- /**
- * @name variant_get_ptr_operator_evaluator
- * @since 4.1
- *
- * Gets a pointer to a function that can evaluate the given Variant operator on the given Variant types.
- *
- * @param p_operator The variant operator.
- * @param p_type_a The type of the first Variant.
- * @param p_type_b The type of the second Variant.
- *
- * @return A pointer to a function that can evaluate the given Variant operator on the given Variant types.
- */
- typedef GDExtensionPtrOperatorEvaluator (*GDExtensionInterfaceVariantGetPtrOperatorEvaluator)(GDExtensionVariantOperator p_operator, GDExtensionVariantType p_type_a, GDExtensionVariantType p_type_b);
- /**
- * @name variant_get_ptr_builtin_method
- * @since 4.1
- *
- * Gets a pointer to a function that can call a builtin method on a type of Variant.
- *
- * @param p_type The Variant type.
- * @param p_method A pointer to a StringName with the method name.
- * @param p_hash A hash representing the method signature.
- *
- * @return A pointer to a function that can call a builtin method on a type of Variant.
- */
- typedef GDExtensionPtrBuiltInMethod (*GDExtensionInterfaceVariantGetPtrBuiltinMethod)(GDExtensionVariantType p_type, GDExtensionConstStringNamePtr p_method, GDExtensionInt p_hash);
- /**
- * @name variant_get_ptr_constructor
- * @since 4.1
- *
- * Gets a pointer to a function that can call one of the constructors for a type of Variant.
- *
- * @param p_type The Variant type.
- * @param p_constructor The index of the constructor.
- *
- * @return A pointer to a function that can call one of the constructors for a type of Variant.
- */
- typedef GDExtensionPtrConstructor (*GDExtensionInterfaceVariantGetPtrConstructor)(GDExtensionVariantType p_type, int32_t p_constructor);
- /**
- * @name variant_get_ptr_destructor
- * @since 4.1
- *
- * Gets a pointer to a function than can call the destructor for a type of Variant.
- *
- * @param p_type The Variant type.
- *
- * @return A pointer to a function than can call the destructor for a type of Variant.
- */
- typedef GDExtensionPtrDestructor (*GDExtensionInterfaceVariantGetPtrDestructor)(GDExtensionVariantType p_type);
- /**
- * @name variant_construct
- * @since 4.1
- *
- * Constructs a Variant of the given type, using the first constructor that matches the given arguments.
- *
- * @param p_type The Variant type.
- * @param p_base A pointer to a Variant to store the constructed value.
- * @param p_args A pointer to a C array of Variant pointers representing the arguments for the constructor.
- * @param p_argument_count The number of arguments to pass to the constructor.
- * @param r_error A pointer the structure which will be updated with error information.
- */
- typedef void (*GDExtensionInterfaceVariantConstruct)(GDExtensionVariantType p_type, GDExtensionUninitializedVariantPtr r_base, const GDExtensionConstVariantPtr *p_args, int32_t p_argument_count, GDExtensionCallError *r_error);
- /**
- * @name variant_get_ptr_setter
- * @since 4.1
- *
- * Gets a pointer to a function that can call a member's setter on the given Variant type.
- *
- * @param p_type The Variant type.
- * @param p_member A pointer to a StringName with the member name.
- *
- * @return A pointer to a function that can call a member's setter on the given Variant type.
- */
- typedef GDExtensionPtrSetter (*GDExtensionInterfaceVariantGetPtrSetter)(GDExtensionVariantType p_type, GDExtensionConstStringNamePtr p_member);
- /**
- * @name variant_get_ptr_getter
- * @since 4.1
- *
- * Gets a pointer to a function that can call a member's getter on the given Variant type.
- *
- * @param p_type The Variant type.
- * @param p_member A pointer to a StringName with the member name.
- *
- * @return A pointer to a function that can call a member's getter on the given Variant type.
- */
- typedef GDExtensionPtrGetter (*GDExtensionInterfaceVariantGetPtrGetter)(GDExtensionVariantType p_type, GDExtensionConstStringNamePtr p_member);
- /**
- * @name variant_get_ptr_indexed_setter
- * @since 4.1
- *
- * Gets a pointer to a function that can set an index on the given Variant type.
- *
- * @param p_type The Variant type.
- *
- * @return A pointer to a function that can set an index on the given Variant type.
- */
- typedef GDExtensionPtrIndexedSetter (*GDExtensionInterfaceVariantGetPtrIndexedSetter)(GDExtensionVariantType p_type);
- /**
- * @name variant_get_ptr_indexed_getter
- * @since 4.1
- *
- * Gets a pointer to a function that can get an index on the given Variant type.
- *
- * @param p_type The Variant type.
- *
- * @return A pointer to a function that can get an index on the given Variant type.
- */
- typedef GDExtensionPtrIndexedGetter (*GDExtensionInterfaceVariantGetPtrIndexedGetter)(GDExtensionVariantType p_type);
- /**
- * @name variant_get_ptr_keyed_setter
- * @since 4.1
- *
- * Gets a pointer to a function that can set a key on the given Variant type.
- *
- * @param p_type The Variant type.
- *
- * @return A pointer to a function that can set a key on the given Variant type.
- */
- typedef GDExtensionPtrKeyedSetter (*GDExtensionInterfaceVariantGetPtrKeyedSetter)(GDExtensionVariantType p_type);
- /**
- * @name variant_get_ptr_keyed_getter
- * @since 4.1
- *
- * Gets a pointer to a function that can get a key on the given Variant type.
- *
- * @param p_type The Variant type.
- *
- * @return A pointer to a function that can get a key on the given Variant type.
- */
- typedef GDExtensionPtrKeyedGetter (*GDExtensionInterfaceVariantGetPtrKeyedGetter)(GDExtensionVariantType p_type);
- /**
- * @name variant_get_ptr_keyed_checker
- * @since 4.1
- *
- * Gets a pointer to a function that can check a key on the given Variant type.
- *
- * @param p_type The Variant type.
- *
- * @return A pointer to a function that can check a key on the given Variant type.
- */
- typedef GDExtensionPtrKeyedChecker (*GDExtensionInterfaceVariantGetPtrKeyedChecker)(GDExtensionVariantType p_type);
- /**
- * @name variant_get_constant_value
- * @since 4.1
- *
- * Gets the value of a constant from the given Variant type.
- *
- * @param p_type The Variant type.
- * @param p_constant A pointer to a StringName with the constant name.
- * @param r_ret A pointer to a Variant to store the value.
- */
- typedef void (*GDExtensionInterfaceVariantGetConstantValue)(GDExtensionVariantType p_type, GDExtensionConstStringNamePtr p_constant, GDExtensionUninitializedVariantPtr r_ret);
- /**
- * @name variant_get_ptr_utility_function
- * @since 4.1
- *
- * Gets a pointer to a function that can call a Variant utility function.
- *
- * @param p_function A pointer to a StringName with the function name.
- * @param p_hash A hash representing the function signature.
- *
- * @return A pointer to a function that can call a Variant utility function.
- */
- typedef GDExtensionPtrUtilityFunction (*GDExtensionInterfaceVariantGetPtrUtilityFunction)(GDExtensionConstStringNamePtr p_function, GDExtensionInt p_hash);
- /* INTERFACE: String Utilities */
- /**
- * @name string_new_with_latin1_chars
- * @since 4.1
- *
- * Creates a String from a Latin-1 encoded C string.
- *
- * @param r_dest A pointer to a Variant to hold the newly created String.
- * @param p_contents A pointer to a Latin-1 encoded C string (null terminated).
- */
- typedef void (*GDExtensionInterfaceStringNewWithLatin1Chars)(GDExtensionUninitializedStringPtr r_dest, const char *p_contents);
- /**
- * @name string_new_with_utf8_chars
- * @since 4.1
- *
- * Creates a String from a UTF-8 encoded C string.
- *
- * @param r_dest A pointer to a Variant to hold the newly created String.
- * @param p_contents A pointer to a UTF-8 encoded C string (null terminated).
- */
- typedef void (*GDExtensionInterfaceStringNewWithUtf8Chars)(GDExtensionUninitializedStringPtr r_dest, const char *p_contents);
- /**
- * @name string_new_with_utf16_chars
- * @since 4.1
- *
- * Creates a String from a UTF-16 encoded C string.
- *
- * @param r_dest A pointer to a Variant to hold the newly created String.
- * @param p_contents A pointer to a UTF-16 encoded C string (null terminated).
- */
- typedef void (*GDExtensionInterfaceStringNewWithUtf16Chars)(GDExtensionUninitializedStringPtr r_dest, const char16_t *p_contents);
- /**
- * @name string_new_with_utf32_chars
- * @since 4.1
- *
- * Creates a String from a UTF-32 encoded C string.
- *
- * @param r_dest A pointer to a Variant to hold the newly created String.
- * @param p_contents A pointer to a UTF-32 encoded C string (null terminated).
- */
- typedef void (*GDExtensionInterfaceStringNewWithUtf32Chars)(GDExtensionUninitializedStringPtr r_dest, const char32_t *p_contents);
- /**
- * @name string_new_with_wide_chars
- * @since 4.1
- *
- * Creates a String from a wide C string.
- *
- * @param r_dest A pointer to a Variant to hold the newly created String.
- * @param p_contents A pointer to a wide C string (null terminated).
- */
- typedef void (*GDExtensionInterfaceStringNewWithWideChars)(GDExtensionUninitializedStringPtr r_dest, const wchar_t *p_contents);
- /**
- * @name string_new_with_latin1_chars_and_len
- * @since 4.1
- *
- * Creates a String from a Latin-1 encoded C string with the given length.
- *
- * @param r_dest A pointer to a Variant to hold the newly created String.
- * @param p_contents A pointer to a Latin-1 encoded C string.
- * @param p_size The number of characters.
- */
- typedef void (*GDExtensionInterfaceStringNewWithLatin1CharsAndLen)(GDExtensionUninitializedStringPtr r_dest, const char *p_contents, GDExtensionInt p_size);
- /**
- * @name string_new_with_utf8_chars_and_len
- * @since 4.1
- *
- * Creates a String from a UTF-8 encoded C string with the given length.
- *
- * @param r_dest A pointer to a Variant to hold the newly created String.
- * @param p_contents A pointer to a UTF-8 encoded C string.
- * @param p_size The number of characters.
- */
- typedef void (*GDExtensionInterfaceStringNewWithUtf8CharsAndLen)(GDExtensionUninitializedStringPtr r_dest, const char *p_contents, GDExtensionInt p_size);
- /**
- * @name string_new_with_utf16_chars_and_len
- * @since 4.1
- *
- * Creates a String from a UTF-16 encoded C string with the given length.
- *
- * @param r_dest A pointer to a Variant to hold the newly created String.
- * @param p_contents A pointer to a UTF-16 encoded C string.
- * @param p_size The number of characters.
- */
- typedef void (*GDExtensionInterfaceStringNewWithUtf16CharsAndLen)(GDExtensionUninitializedStringPtr r_dest, const char16_t *p_contents, GDExtensionInt p_size);
- /**
- * @name string_new_with_utf32_chars_and_len
- * @since 4.1
- *
- * Creates a String from a UTF-32 encoded C string with the given length.
- *
- * @param r_dest A pointer to a Variant to hold the newly created String.
- * @param p_contents A pointer to a UTF-32 encoded C string.
- * @param p_size The number of characters.
- */
- typedef void (*GDExtensionInterfaceStringNewWithUtf32CharsAndLen)(GDExtensionUninitializedStringPtr r_dest, const char32_t *p_contents, GDExtensionInt p_size);
- /**
- * @name string_new_with_wide_chars_and_len
- * @since 4.1
- *
- * Creates a String from a wide C string with the given length.
- *
- * @param r_dest A pointer to a Variant to hold the newly created String.
- * @param p_contents A pointer to a wide C string.
- * @param p_size The number of characters.
- */
- typedef void (*GDExtensionInterfaceStringNewWithWideCharsAndLen)(GDExtensionUninitializedStringPtr r_dest, const wchar_t *p_contents, GDExtensionInt p_size);
- /**
- * @name string_to_latin1_chars
- * @since 4.1
- *
- * Converts a String to a Latin-1 encoded C string.
- *
- * It doesn't write a null terminator.
- *
- * @param p_self A pointer to the String.
- * @param r_text A pointer to the buffer to hold the resulting data. If NULL is passed in, only the length will be computed.
- * @param p_max_write_length The maximum number of characters that can be written to r_text. It has no affect on the return value.
- *
- * @return The resulting encoded string length in characters (not bytes), not including a null terminator.
- */
- typedef GDExtensionInt (*GDExtensionInterfaceStringToLatin1Chars)(GDExtensionConstStringPtr p_self, char *r_text, GDExtensionInt p_max_write_length);
- /**
- * @name string_to_utf8_chars
- * @since 4.1
- *
- * Converts a String to a UTF-8 encoded C string.
- *
- * It doesn't write a null terminator.
- *
- * @param p_self A pointer to the String.
- * @param r_text A pointer to the buffer to hold the resulting data. If NULL is passed in, only the length will be computed.
- * @param p_max_write_length The maximum number of characters that can be written to r_text. It has no affect on the return value.
- *
- * @return The resulting encoded string length in characters (not bytes), not including a null terminator.
- */
- typedef GDExtensionInt (*GDExtensionInterfaceStringToUtf8Chars)(GDExtensionConstStringPtr p_self, char *r_text, GDExtensionInt p_max_write_length);
- /**
- * @name string_to_utf16_chars
- * @since 4.1
- *
- * Converts a String to a UTF-16 encoded C string.
- *
- * It doesn't write a null terminator.
- *
- * @param p_self A pointer to the String.
- * @param r_text A pointer to the buffer to hold the resulting data. If NULL is passed in, only the length will be computed.
- * @param p_max_write_length The maximum number of characters that can be written to r_text. It has no affect on the return value.
- *
- * @return The resulting encoded string length in characters (not bytes), not including a null terminator.
- */
- typedef GDExtensionInt (*GDExtensionInterfaceStringToUtf16Chars)(GDExtensionConstStringPtr p_self, char16_t *r_text, GDExtensionInt p_max_write_length);
- /**
- * @name string_to_utf32_chars
- * @since 4.1
- *
- * Converts a String to a UTF-32 encoded C string.
- *
- * It doesn't write a null terminator.
- *
- * @param p_self A pointer to the String.
- * @param r_text A pointer to the buffer to hold the resulting data. If NULL is passed in, only the length will be computed.
- * @param p_max_write_length The maximum number of characters that can be written to r_text. It has no affect on the return value.
- *
- * @return The resulting encoded string length in characters (not bytes), not including a null terminator.
- */
- typedef GDExtensionInt (*GDExtensionInterfaceStringToUtf32Chars)(GDExtensionConstStringPtr p_self, char32_t *r_text, GDExtensionInt p_max_write_length);
- /**
- * @name string_to_wide_chars
- * @since 4.1
- *
- * Converts a String to a wide C string.
- *
- * It doesn't write a null terminator.
- *
- * @param p_self A pointer to the String.
- * @param r_text A pointer to the buffer to hold the resulting data. If NULL is passed in, only the length will be computed.
- * @param p_max_write_length The maximum number of characters that can be written to r_text. It has no affect on the return value.
- *
- * @return The resulting encoded string length in characters (not bytes), not including a null terminator.
- */
- typedef GDExtensionInt (*GDExtensionInterfaceStringToWideChars)(GDExtensionConstStringPtr p_self, wchar_t *r_text, GDExtensionInt p_max_write_length);
- /**
- * @name string_operator_index
- * @since 4.1
- *
- * Gets a pointer to the character at the given index from a String.
- *
- * @param p_self A pointer to the String.
- * @param p_index The index.
- *
- * @return A pointer to the requested character.
- */
- typedef char32_t *(*GDExtensionInterfaceStringOperatorIndex)(GDExtensionStringPtr p_self, GDExtensionInt p_index);
- /**
- * @name string_operator_index_const
- * @since 4.1
- *
- * Gets a const pointer to the character at the given index from a String.
- *
- * @param p_self A pointer to the String.
- * @param p_index The index.
- *
- * @return A const pointer to the requested character.
- */
- typedef const char32_t *(*GDExtensionInterfaceStringOperatorIndexConst)(GDExtensionConstStringPtr p_self, GDExtensionInt p_index);
- /**
- * @name string_operator_plus_eq_string
- * @since 4.1
- *
- * Appends another String to a String.
- *
- * @param p_self A pointer to the String.
- * @param p_b A pointer to the other String to append.
- */
- typedef void (*GDExtensionInterfaceStringOperatorPlusEqString)(GDExtensionStringPtr p_self, GDExtensionConstStringPtr p_b);
- /**
- * @name string_operator_plus_eq_char
- * @since 4.1
- *
- * Appends a character to a String.
- *
- * @param p_self A pointer to the String.
- * @param p_b A pointer to the character to append.
- */
- typedef void (*GDExtensionInterfaceStringOperatorPlusEqChar)(GDExtensionStringPtr p_self, char32_t p_b);
- /**
- * @name string_operator_plus_eq_cstr
- * @since 4.1
- *
- * Appends a Latin-1 encoded C string to a String.
- *
- * @param p_self A pointer to the String.
- * @param p_b A pointer to a Latin-1 encoded C string (null terminated).
- */
- typedef void (*GDExtensionInterfaceStringOperatorPlusEqCstr)(GDExtensionStringPtr p_self, const char *p_b);
- /**
- * @name string_operator_plus_eq_wcstr
- * @since 4.1
- *
- * Appends a wide C string to a String.
- *
- * @param p_self A pointer to the String.
- * @param p_b A pointer to a wide C string (null terminated).
- */
- typedef void (*GDExtensionInterfaceStringOperatorPlusEqWcstr)(GDExtensionStringPtr p_self, const wchar_t *p_b);
- /**
- * @name string_operator_plus_eq_c32str
- * @since 4.1
- *
- * Appends a UTF-32 encoded C string to a String.
- *
- * @param p_self A pointer to the String.
- * @param p_b A pointer to a UTF-32 encoded C string (null terminated).
- */
- typedef void (*GDExtensionInterfaceStringOperatorPlusEqC32str)(GDExtensionStringPtr p_self, const char32_t *p_b);
- /* INTERFACE: XMLParser Utilities */
- /**
- * @name xml_parser_open_buffer
- * @since 4.1
- *
- * Opens a raw XML buffer on an XMLParser instance.
- *
- * @param p_instance A pointer to an XMLParser object.
- * @param p_buffer A pointer to the buffer.
- * @param p_size The size of the buffer.
- *
- * @return A Godot error code (ex. OK, ERR_INVALID_DATA, etc).
- *
- * @see XMLParser::open_buffer()
- */
- typedef GDExtensionInt (*GDExtensionInterfaceXmlParserOpenBuffer)(GDExtensionObjectPtr p_instance, const uint8_t *p_buffer, size_t p_size);
- /* INTERFACE: FileAccess Utilities */
- /**
- * @name file_access_store_buffer
- * @since 4.1
- *
- * Stores the given buffer using an instance of FileAccess.
- *
- * @param p_instance A pointer to a FileAccess object.
- * @param p_src A pointer to the buffer.
- * @param p_length The size of the buffer.
- *
- * @see FileAccess::store_buffer()
- */
- typedef void (*GDExtensionInterfaceFileAccessStoreBuffer)(GDExtensionObjectPtr p_instance, const uint8_t *p_src, uint64_t p_length);
- /**
- * @name file_access_get_buffer
- * @since 4.1
- *
- * Reads the next p_length bytes into the given buffer using an instance of FileAccess.
- *
- * @param p_instance A pointer to a FileAccess object.
- * @param p_dst A pointer to the buffer to store the data.
- * @param p_length The requested number of bytes to read.
- *
- * @return The actual number of bytes read (may be less than requested).
- */
- typedef uint64_t (*GDExtensionInterfaceFileAccessGetBuffer)(GDExtensionConstObjectPtr p_instance, uint8_t *p_dst, uint64_t p_length);
- /* INTERFACE: WorkerThreadPool Utilities */
- /**
- * @name worker_thread_pool_add_native_group_task
- * @since 4.1
- *
- * Adds a group task to an instance of WorkerThreadPool.
- *
- * @param p_instance A pointer to a WorkerThreadPool object.
- * @param p_func A pointer to a function to run in the thread pool.
- * @param p_userdata A pointer to arbitrary data which will be passed to p_func.
- * @param p_tasks The number of tasks needed in the group.
- * @param p_high_priority Whether or not this is a high priority task.
- * @param p_description A pointer to a String with the task description.
- *
- * @return The task group ID.
- *
- * @see WorkerThreadPool::add_group_task()
- */
- typedef int64_t (*GDExtensionInterfaceWorkerThreadPoolAddNativeGroupTask)(GDExtensionObjectPtr p_instance, void (*p_func)(void *, uint32_t), void *p_userdata, int p_elements, int p_tasks, GDExtensionBool p_high_priority, GDExtensionConstStringPtr p_description);
- /**
- * @name worker_thread_pool_add_native_task
- * @since 4.1
- *
- * Adds a task to an instance of WorkerThreadPool.
- *
- * @param p_instance A pointer to a WorkerThreadPool object.
- * @param p_func A pointer to a function to run in the thread pool.
- * @param p_userdata A pointer to arbitrary data which will be passed to p_func.
- * @param p_high_priority Whether or not this is a high priority task.
- * @param p_description A pointer to a String with the task description.
- *
- * @return The task ID.
- */
- typedef int64_t (*GDExtensionInterfaceWorkerThreadPoolAddNativeTask)(GDExtensionObjectPtr p_instance, void (*p_func)(void *), void *p_userdata, GDExtensionBool p_high_priority, GDExtensionConstStringPtr p_description);
- /* INTERFACE: Packed Array */
- /**
- * @name packed_byte_array_operator_index
- * @since 4.1
- *
- * Gets a pointer to a byte in a PackedByteArray.
- *
- * @param p_self A pointer to a PackedByteArray object.
- * @param p_index The index of the byte to get.
- *
- * @return A pointer to the requested byte.
- */
- typedef uint8_t *(*GDExtensionInterfacePackedByteArrayOperatorIndex)(GDExtensionTypePtr p_self, GDExtensionInt p_index);
- /**
- * @name packed_byte_array_operator_index_const
- * @since 4.1
- *
- * Gets a const pointer to a byte in a PackedByteArray.
- *
- * @param p_self A const pointer to a PackedByteArray object.
- * @param p_index The index of the byte to get.
- *
- * @return A const pointer to the requested byte.
- */
- typedef const uint8_t *(*GDExtensionInterfacePackedByteArrayOperatorIndexConst)(GDExtensionConstTypePtr p_self, GDExtensionInt p_index);
- /**
- * @name packed_color_array_operator_index
- * @since 4.1
- *
- * Gets a pointer to a color in a PackedColorArray.
- *
- * @param p_self A pointer to a PackedColorArray object.
- * @param p_index The index of the Color to get.
- *
- * @return A pointer to the requested Color.
- */
- typedef GDExtensionTypePtr (*GDExtensionInterfacePackedColorArrayOperatorIndex)(GDExtensionTypePtr p_self, GDExtensionInt p_index);
- /**
- * @name packed_color_array_operator_index_const
- * @since 4.1
- *
- * Gets a const pointer to a color in a PackedColorArray.
- *
- * @param p_self A const pointer to a const PackedColorArray object.
- * @param p_index The index of the Color to get.
- *
- * @return A const pointer to the requested Color.
- */
- typedef GDExtensionTypePtr (*GDExtensionInterfacePackedColorArrayOperatorIndexConst)(GDExtensionConstTypePtr p_self, GDExtensionInt p_index);
- /**
- * @name packed_float32_array_operator_index
- * @since 4.1
- *
- * Gets a pointer to a 32-bit float in a PackedFloat32Array.
- *
- * @param p_self A pointer to a PackedFloat32Array object.
- * @param p_index The index of the float to get.
- *
- * @return A pointer to the requested 32-bit float.
- */
- typedef float *(*GDExtensionInterfacePackedFloat32ArrayOperatorIndex)(GDExtensionTypePtr p_self, GDExtensionInt p_index);
- /**
- * @name packed_float32_array_operator_index_const
- * @since 4.1
- *
- * Gets a const pointer to a 32-bit float in a PackedFloat32Array.
- *
- * @param p_self A const pointer to a PackedFloat32Array object.
- * @param p_index The index of the float to get.
- *
- * @return A const pointer to the requested 32-bit float.
- */
- typedef const float *(*GDExtensionInterfacePackedFloat32ArrayOperatorIndexConst)(GDExtensionConstTypePtr p_self, GDExtensionInt p_index);
- /**
- * @name packed_float64_array_operator_index
- * @since 4.1
- *
- * Gets a pointer to a 64-bit float in a PackedFloat64Array.
- *
- * @param p_self A pointer to a PackedFloat64Array object.
- * @param p_index The index of the float to get.
- *
- * @return A pointer to the requested 64-bit float.
- */
- typedef double *(*GDExtensionInterfacePackedFloat64ArrayOperatorIndex)(GDExtensionTypePtr p_self, GDExtensionInt p_index);
- /**
- * @name packed_float64_array_operator_index_const
- * @since 4.1
- *
- * Gets a const pointer to a 64-bit float in a PackedFloat64Array.
- *
- * @param p_self A const pointer to a PackedFloat64Array object.
- * @param p_index The index of the float to get.
- *
- * @return A const pointer to the requested 64-bit float.
- */
- typedef const double *(*GDExtensionInterfacePackedFloat64ArrayOperatorIndexConst)(GDExtensionConstTypePtr p_self, GDExtensionInt p_index);
- /**
- * @name packed_int32_array_operator_index
- * @since 4.1
- *
- * Gets a pointer to a 32-bit integer in a PackedInt32Array.
- *
- * @param p_self A pointer to a PackedInt32Array object.
- * @param p_index The index of the integer to get.
- *
- * @return A pointer to the requested 32-bit integer.
- */
- typedef int32_t *(*GDExtensionInterfacePackedInt32ArrayOperatorIndex)(GDExtensionTypePtr p_self, GDExtensionInt p_index);
- /**
- * @name packed_int32_array_operator_index_const
- * @since 4.1
- *
- * Gets a const pointer to a 32-bit integer in a PackedInt32Array.
- *
- * @param p_self A const pointer to a PackedInt32Array object.
- * @param p_index The index of the integer to get.
- *
- * @return A const pointer to the requested 32-bit integer.
- */
- typedef const int32_t *(*GDExtensionInterfacePackedInt32ArrayOperatorIndexConst)(GDExtensionConstTypePtr p_self, GDExtensionInt p_index);
- /**
- * @name packed_int64_array_operator_index
- * @since 4.1
- *
- * Gets a pointer to a 64-bit integer in a PackedInt64Array.
- *
- * @param p_self A pointer to a PackedInt64Array object.
- * @param p_index The index of the integer to get.
- *
- * @return A pointer to the requested 64-bit integer.
- */
- typedef int64_t *(*GDExtensionInterfacePackedInt64ArrayOperatorIndex)(GDExtensionTypePtr p_self, GDExtensionInt p_index);
- /**
- * @name packed_int64_array_operator_index_const
- * @since 4.1
- *
- * Gets a const pointer to a 64-bit integer in a PackedInt64Array.
- *
- * @param p_self A const pointer to a PackedInt64Array object.
- * @param p_index The index of the integer to get.
- *
- * @return A const pointer to the requested 64-bit integer.
- */
- typedef const int64_t *(*GDExtensionInterfacePackedInt64ArrayOperatorIndexConst)(GDExtensionConstTypePtr p_self, GDExtensionInt p_index);
- /**
- * @name packed_string_array_operator_index
- * @since 4.1
- *
- * Gets a pointer to a string in a PackedStringArray.
- *
- * @param p_self A pointer to a PackedStringArray object.
- * @param p_index The index of the String to get.
- *
- * @return A pointer to the requested String.
- */
- typedef GDExtensionStringPtr (*GDExtensionInterfacePackedStringArrayOperatorIndex)(GDExtensionTypePtr p_self, GDExtensionInt p_index);
- /**
- * @name packed_string_array_operator_index_const
- * @since 4.1
- *
- * Gets a const pointer to a string in a PackedStringArray.
- *
- * @param p_self A const pointer to a PackedStringArray object.
- * @param p_index The index of the String to get.
- *
- * @return A const pointer to the requested String.
- */
- typedef GDExtensionStringPtr (*GDExtensionInterfacePackedStringArrayOperatorIndexConst)(GDExtensionConstTypePtr p_self, GDExtensionInt p_index);
- /**
- * @name packed_vector2_array_operator_index
- * @since 4.1
- *
- * Gets a pointer to a Vector2 in a PackedVector2Array.
- *
- * @param p_self A pointer to a PackedVector2Array object.
- * @param p_index The index of the Vector2 to get.
- *
- * @return A pointer to the requested Vector2.
- */
- typedef GDExtensionTypePtr (*GDExtensionInterfacePackedVector2ArrayOperatorIndex)(GDExtensionTypePtr p_self, GDExtensionInt p_index);
- /**
- * @name packed_vector2_array_operator_index_const
- * @since 4.1
- *
- * Gets a const pointer to a Vector2 in a PackedVector2Array.
- *
- * @param p_self A const pointer to a PackedVector2Array object.
- * @param p_index The index of the Vector2 to get.
- *
- * @return A const pointer to the requested Vector2.
- */
- typedef GDExtensionTypePtr (*GDExtensionInterfacePackedVector2ArrayOperatorIndexConst)(GDExtensionConstTypePtr p_self, GDExtensionInt p_index);
- /**
- * @name packed_vector3_array_operator_index
- * @since 4.1
- *
- * Gets a pointer to a Vector3 in a PackedVector3Array.
- *
- * @param p_self A pointer to a PackedVector3Array object.
- * @param p_index The index of the Vector3 to get.
- *
- * @return A pointer to the requested Vector3.
- */
- typedef GDExtensionTypePtr (*GDExtensionInterfacePackedVector3ArrayOperatorIndex)(GDExtensionTypePtr p_self, GDExtensionInt p_index);
- /**
- * @name packed_vector3_array_operator_index_const
- * @since 4.1
- *
- * Gets a const pointer to a Vector3 in a PackedVector3Array.
- *
- * @param p_self A const pointer to a PackedVector3Array object.
- * @param p_index The index of the Vector3 to get.
- *
- * @return A const pointer to the requested Vector3.
- */
- typedef GDExtensionTypePtr (*GDExtensionInterfacePackedVector3ArrayOperatorIndexConst)(GDExtensionConstTypePtr p_self, GDExtensionInt p_index);
- /**
- * @name array_operator_index
- * @since 4.1
- *
- * Gets a pointer to a Variant in an Array.
- *
- * @param p_self A pointer to an Array object.
- * @param p_index The index of the Variant to get.
- *
- * @return A pointer to the requested Variant.
- */
- typedef GDExtensionVariantPtr (*GDExtensionInterfaceArrayOperatorIndex)(GDExtensionTypePtr p_self, GDExtensionInt p_index);
- /**
- * @name array_operator_index_const
- * @since 4.1
- *
- * Gets a const pointer to a Variant in an Array.
- *
- * @param p_self A const pointer to an Array object.
- * @param p_index The index of the Variant to get.
- *
- * @return A const pointer to the requested Variant.
- */
- typedef GDExtensionVariantPtr (*GDExtensionInterfaceArrayOperatorIndexConst)(GDExtensionConstTypePtr p_self, GDExtensionInt p_index);
- /**
- * @name array_ref
- * @since 4.1
- *
- * Sets an Array to be a reference to another Array object.
- *
- * @param p_self A pointer to the Array object to update.
- * @param p_from A pointer to the Array object to reference.
- */
- typedef void (*GDExtensionInterfaceArrayRef)(GDExtensionTypePtr p_self, GDExtensionConstTypePtr p_from);
- /**
- * @name array_set_typed
- * @since 4.1
- *
- * Makes an Array into a typed Array.
- *
- * @param p_self A pointer to the Array.
- * @param p_type The type of Variant the Array will store.
- * @param p_class_name A pointer to a StringName with the name of the object (if p_type is GDEXTENSION_VARIANT_TYPE_OBJECT).
- * @param p_script A pointer to a Script object (if p_type is GDEXTENSION_VARIANT_TYPE_OBJECT and the base class is extended by a script).
- */
- typedef void (*GDExtensionInterfaceArraySetTyped)(GDExtensionTypePtr p_self, GDExtensionVariantType p_type, GDExtensionConstStringNamePtr p_class_name, GDExtensionConstVariantPtr p_script);
- /* INTERFACE: Dictionary */
- /**
- * @name dictionary_operator_index
- * @since 4.1
- *
- * Gets a pointer to a Variant in a Dictionary with the given key.
- *
- * @param p_self A pointer to a Dictionary object.
- * @param p_key A pointer to a Variant representing the key.
- *
- * @return A pointer to a Variant representing the value at the given key.
- */
- typedef GDExtensionVariantPtr (*GDExtensionInterfaceDictionaryOperatorIndex)(GDExtensionTypePtr p_self, GDExtensionConstVariantPtr p_key);
- /**
- * @name dictionary_operator_index_const
- * @since 4.1
- *
- * Gets a const pointer to a Variant in a Dictionary with the given key.
- *
- * @param p_self A const pointer to a Dictionary object.
- * @param p_key A pointer to a Variant representing the key.
- *
- * @return A const pointer to a Variant representing the value at the given key.
- */
- typedef GDExtensionVariantPtr (*GDExtensionInterfaceDictionaryOperatorIndexConst)(GDExtensionConstTypePtr p_self, GDExtensionConstVariantPtr p_key);
- /* INTERFACE: Object */
- /**
- * @name object_method_bind_call
- * @since 4.1
- *
- * Calls a method on an Object.
- *
- * @param p_method_bind A pointer to the MethodBind representing the method on the Object's class.
- * @param p_instance A pointer to the Object.
- * @param p_args A pointer to a C array of Variants representing the arguments.
- * @param p_arg_count The number of arguments.
- * @param r_ret A pointer to Variant which will receive the return value.
- * @param r_error A pointer to a GDExtensionCallError struct that will receive error information.
- */
- typedef void (*GDExtensionInterfaceObjectMethodBindCall)(GDExtensionMethodBindPtr p_method_bind, GDExtensionObjectPtr p_instance, const GDExtensionConstVariantPtr *p_args, GDExtensionInt p_arg_count, GDExtensionUninitializedVariantPtr r_ret, GDExtensionCallError *r_error);
- /**
- * @name object_method_bind_ptrcall
- * @since 4.1
- *
- * Calls a method on an Object (using a "ptrcall").
- *
- * @param p_method_bind A pointer to the MethodBind representing the method on the Object's class.
- * @param p_instance A pointer to the Object.
- * @param p_args A pointer to a C array representing the arguments.
- * @param r_ret A pointer to the Object that will receive the return value.
- */
- typedef void (*GDExtensionInterfaceObjectMethodBindPtrcall)(GDExtensionMethodBindPtr p_method_bind, GDExtensionObjectPtr p_instance, const GDExtensionConstTypePtr *p_args, GDExtensionTypePtr r_ret);
- /**
- * @name object_destroy
- * @since 4.1
- *
- * Destroys an Object.
- *
- * @param p_o A pointer to the Object.
- */
- typedef void (*GDExtensionInterfaceObjectDestroy)(GDExtensionObjectPtr p_o);
- /**
- * @name global_get_singleton
- * @since 4.1
- *
- * Gets a global singleton by name.
- *
- * @param p_name A pointer to a StringName with the singleton name.
- *
- * @return A pointer to the singleton Object.
- */
- typedef GDExtensionObjectPtr (*GDExtensionInterfaceGlobalGetSingleton)(GDExtensionConstStringNamePtr p_name);
- /**
- * @name object_get_instance_binding
- * @since 4.1
- *
- * Gets a pointer representing an Object's instance binding.
- *
- * @param p_o A pointer to the Object.
- * @param p_library A token the library received by the GDExtension's entry point function.
- * @param p_callbacks A pointer to a GDExtensionInstanceBindingCallbacks struct.
- *
- * @return
- */
- typedef void *(*GDExtensionInterfaceObjectGetInstanceBinding)(GDExtensionObjectPtr p_o, void *p_token, const GDExtensionInstanceBindingCallbacks *p_callbacks);
- /**
- * @name object_set_instance_binding
- * @since 4.1
- *
- * Sets an Object's instance binding.
- *
- * @param p_o A pointer to the Object.
- * @param p_library A token the library received by the GDExtension's entry point function.
- * @param p_binding A pointer to the instance binding.
- * @param p_callbacks A pointer to a GDExtensionInstanceBindingCallbacks struct.
- */
- typedef void (*GDExtensionInterfaceObjectSetInstanceBinding)(GDExtensionObjectPtr p_o, void *p_token, void *p_binding, const GDExtensionInstanceBindingCallbacks *p_callbacks);
- /**
- * @name object_set_instance
- * @since 4.1
- *
- * Sets an extension class instance on a Object.
- *
- * @param p_o A pointer to the Object.
- * @param p_classname A pointer to a StringName with the registered extension class's name.
- * @param p_instance A pointer to the extension class instance.
- */
- typedef void (*GDExtensionInterfaceObjectSetInstance)(GDExtensionObjectPtr p_o, GDExtensionConstStringNamePtr p_classname, GDExtensionClassInstancePtr p_instance); /* p_classname should be a registered extension class and should extend the p_o object's class. */
- /**
- * @name object_get_class_name
- * @since 4.1
- *
- * Gets the class name of an Object.
- *
- * @param p_object A pointer to the Object.
- * @param p_library A pointer the library received by the GDExtension's entry point function.
- * @param r_class_name A pointer to a String to receive the class name.
- *
- * @return true if successful in getting the class name; otherwise false.
- */
- typedef GDExtensionBool (*GDExtensionInterfaceObjectGetClassName)(GDExtensionConstObjectPtr p_object, GDExtensionClassLibraryPtr p_library, GDExtensionUninitializedStringNamePtr r_class_name);
- /**
- * @name object_cast_to
- * @since 4.1
- *
- * Casts an Object to a different type.
- *
- * @param p_object A pointer to the Object.
- * @param p_class_tag A pointer uniquely identifying a built-in class in the ClassDB.
- *
- * @return Returns a pointer to the Object, or NULL if it can't be cast to the requested type.
- */
- typedef GDExtensionObjectPtr (*GDExtensionInterfaceObjectCastTo)(GDExtensionConstObjectPtr p_object, void *p_class_tag);
- /**
- * @name object_get_instance_from_id
- * @since 4.1
- *
- * Gets an Object by its instance ID.
- *
- * @param p_instance_id The instance ID.
- *
- * @return A pointer to the Object.
- */
- typedef GDExtensionObjectPtr (*GDExtensionInterfaceObjectGetInstanceFromId)(GDObjectInstanceID p_instance_id);
- /**
- * @name object_get_instance_id
- * @since 4.1
- *
- * Gets the instance ID from an Object.
- *
- * @param p_object A pointer to the Object.
- *
- * @return The instance ID.
- */
- typedef GDObjectInstanceID (*GDExtensionInterfaceObjectGetInstanceId)(GDExtensionConstObjectPtr p_object);
- /* INTERFACE: Reference */
- /**
- * @name ref_get_object
- * @since 4.1
- *
- * Gets the Object from a reference.
- *
- * @param p_ref A pointer to the reference.
- *
- * @return A pointer to the Object from the reference or NULL.
- */
- typedef GDExtensionObjectPtr (*GDExtensionInterfaceRefGetObject)(GDExtensionConstRefPtr p_ref);
- /**
- * @name ref_set_object
- * @since 4.1
- *
- * Sets the Object referred to by a reference.
- *
- * @param p_ref A pointer to the reference.
- * @param p_object A pointer to the Object to refer to.
- */
- typedef void (*GDExtensionInterfaceRefSetObject)(GDExtensionRefPtr p_ref, GDExtensionObjectPtr p_object);
- /* INTERFACE: Script Instance */
- /**
- * @name script_instance_create
- * @since 4.1
- *
- * Creates a script instance that contains the given info and instance data.
- *
- * @param p_info A pointer to a GDExtensionScriptInstanceInfo struct.
- * @param p_instance_data A pointer to a data representing the script instance in the GDExtension. This will be passed to all the function pointers on p_info.
- *
- * @return A pointer to a ScriptInstanceExtension object.
- */
- typedef GDExtensionScriptInstancePtr (*GDExtensionInterfaceScriptInstanceCreate)(const GDExtensionScriptInstanceInfo *p_info, GDExtensionScriptInstanceDataPtr p_instance_data);
- /* INTERFACE: ClassDB */
- /**
- * @name classdb_construct_object
- * @since 4.1
- *
- * Constructs an Object of the requested class.
- *
- * The passed class must be a built-in godot class, or an already-registered extension class. In both cases, object_set_instance() should be called to fully initialize the object.
- *
- * @param p_classname A pointer to a StringName with the class name.
- *
- * @return A pointer to the newly created Object.
- */
- typedef GDExtensionObjectPtr (*GDExtensionInterfaceClassdbConstructObject)(GDExtensionConstStringNamePtr p_classname);
- /**
- * @name classdb_get_method_bind
- * @since 4.1
- *
- * Gets a pointer to the MethodBind in ClassDB for the given class, method and hash.
- *
- * @param p_classname A pointer to a StringName with the class name.
- * @param p_methodname A pointer to a StringName with the method name.
- * @param p_hash A hash representing the function signature.
- *
- * @return A pointer to the MethodBind from ClassDB.
- */
- typedef GDExtensionMethodBindPtr (*GDExtensionInterfaceClassdbGetMethodBind)(GDExtensionConstStringNamePtr p_classname, GDExtensionConstStringNamePtr p_methodname, GDExtensionInt p_hash);
- /**
- * @name classdb_get_class_tag
- * @since 4.1
- *
- * Gets a pointer uniquely identifying the given built-in class in the ClassDB.
- *
- * @param p_classname A pointer to a StringName with the class name.
- *
- * @return A pointer uniquely identifying the built-in class in the ClassDB.
- */
- typedef void *(*GDExtensionInterfaceClassdbGetClassTag)(GDExtensionConstStringNamePtr p_classname);
- /* INTERFACE: ClassDB Extension */
- /**
- * @name classdb_register_extension_class
- * @since 4.1
- *
- * Registers an extension class in the ClassDB.
- *
- * Provided struct can be safely freed once the function returns.
- *
- * @param p_library A pointer the library received by the GDExtension's entry point function.
- * @param p_class_name A pointer to a StringName with the class name.
- * @param p_parent_class_name A pointer to a StringName with the parent class name.
- * @param p_extension_funcs A pointer to a GDExtensionClassCreationInfo struct.
- */
- typedef void (*GDExtensionInterfaceClassdbRegisterExtensionClass)(GDExtensionClassLibraryPtr p_library, GDExtensionConstStringNamePtr p_class_name, GDExtensionConstStringNamePtr p_parent_class_name, const GDExtensionClassCreationInfo *p_extension_funcs);
- /**
- * @name classdb_register_extension_class_method
- * @since 4.1
- *
- * Registers a method on an extension class in the ClassDB.
- *
- * Provided struct can be safely freed once the function returns.
- *
- * @param p_library A pointer the library received by the GDExtension's entry point function.
- * @param p_class_name A pointer to a StringName with the class name.
- * @param p_method_info A pointer to a GDExtensionClassMethodInfo struct.
- */
- typedef void (*GDExtensionInterfaceClassdbRegisterExtensionClassMethod)(GDExtensionClassLibraryPtr p_library, GDExtensionConstStringNamePtr p_class_name, const GDExtensionClassMethodInfo *p_method_info);
- /**
- * @name classdb_register_extension_class_integer_constant
- * @since 4.1
- *
- * Registers an integer constant on an extension class in the ClassDB.
- *
- * @param p_library A pointer the library received by the GDExtension's entry point function.
- * @param p_class_name A pointer to a StringName with the class name.
- * @param p_enum_name A pointer to a StringName with the enum name.
- * @param p_constant_name A pointer to a StringName with the constant name.
- * @param p_constant_value The constant value.
- * @param p_is_bitfield Whether or not this is a bit field.
- */
- typedef void (*GDExtensionInterfaceClassdbRegisterExtensionClassIntegerConstant)(GDExtensionClassLibraryPtr p_library, GDExtensionConstStringNamePtr p_class_name, GDExtensionConstStringNamePtr p_enum_name, GDExtensionConstStringNamePtr p_constant_name, GDExtensionInt p_constant_value, GDExtensionBool p_is_bitfield);
- /**
- * @name classdb_register_extension_class_property
- * @since 4.1
- *
- * Registers a property on an extension class in the ClassDB.
- *
- * Provided struct can be safely freed once the function returns.
- *
- * @param p_library A pointer the library received by the GDExtension's entry point function.
- * @param p_class_name A pointer to a StringName with the class name.
- * @param p_info A pointer to a GDExtensionPropertyInfo struct.
- * @param p_setter A pointer to a StringName with the name of the setter method.
- * @param p_getter A pointer to a StringName with the name of the getter method.
- */
- typedef void (*GDExtensionInterfaceClassdbRegisterExtensionClassProperty)(GDExtensionClassLibraryPtr p_library, GDExtensionConstStringNamePtr p_class_name, const GDExtensionPropertyInfo *p_info, GDExtensionConstStringNamePtr p_setter, GDExtensionConstStringNamePtr p_getter);
- /**
- * @name classdb_register_extension_class_property_group
- * @since 4.1
- *
- * Registers a property group on an extension class in the ClassDB.
- *
- * @param p_library A pointer the library received by the GDExtension's entry point function.
- * @param p_class_name A pointer to a StringName with the class name.
- * @param p_group_name A pointer to a String with the group name.
- * @param p_prefix A pointer to a String with the prefix used by properties in this group.
- */
- typedef void (*GDExtensionInterfaceClassdbRegisterExtensionClassPropertyGroup)(GDExtensionClassLibraryPtr p_library, GDExtensionConstStringNamePtr p_class_name, GDExtensionConstStringPtr p_group_name, GDExtensionConstStringPtr p_prefix);
- /**
- * @name classdb_register_extension_class_property_subgroup
- * @since 4.1
- *
- * Registers a property subgroup on an extension class in the ClassDB.
- *
- * @param p_library A pointer the library received by the GDExtension's entry point function.
- * @param p_class_name A pointer to a StringName with the class name.
- * @param p_subgroup_name A pointer to a String with the subgroup name.
- * @param p_prefix A pointer to a String with the prefix used by properties in this subgroup.
- */
- typedef void (*GDExtensionInterfaceClassdbRegisterExtensionClassPropertySubgroup)(GDExtensionClassLibraryPtr p_library, GDExtensionConstStringNamePtr p_class_name, GDExtensionConstStringPtr p_subgroup_name, GDExtensionConstStringPtr p_prefix);
- /**
- * @name classdb_register_extension_class_signal
- * @since 4.1
- *
- * Registers a signal on an extension class in the ClassDB.
- *
- * Provided structs can be safely freed once the function returns.
- *
- * @param p_library A pointer the library received by the GDExtension's entry point function.
- * @param p_class_name A pointer to a StringName with the class name.
- * @param p_signal_name A pointer to a StringName with the signal name.
- * @param p_argument_info A pointer to a GDExtensionPropertyInfo struct.
- * @param p_argument_count The number of arguments the signal receives.
- */
- typedef void (*GDExtensionInterfaceClassdbRegisterExtensionClassSignal)(GDExtensionClassLibraryPtr p_library, GDExtensionConstStringNamePtr p_class_name, GDExtensionConstStringNamePtr p_signal_name, const GDExtensionPropertyInfo *p_argument_info, GDExtensionInt p_argument_count);
- /**
- * @name classdb_unregister_extension_class
- * @since 4.1
- *
- * Unregisters an extension class in the ClassDB.
- *
- * @param p_library A pointer the library received by the GDExtension's entry point function.
- * @param p_class_name A pointer to a StringName with the class name.
- */
- typedef void (*GDExtensionInterfaceClassdbUnregisterExtensionClass)(GDExtensionClassLibraryPtr p_library, GDExtensionConstStringNamePtr p_class_name); /* Unregistering a parent class before a class that inherits it will result in failure. Inheritors must be unregistered first. */
- /**
- * @name get_library_path
- * @since 4.1
- *
- * Gets the path to the current GDExtension library.
- *
- * @param p_library A pointer the library received by the GDExtension's entry point function.
- * @param r_path A pointer to a String which will receive the path.
- */
- typedef void (*GDExtensionInterfaceGetLibraryPath)(GDExtensionClassLibraryPtr p_library, GDExtensionUninitializedStringPtr r_path);
- /**
- * @name editor_add_plugin
- * @since 4.1
- *
- * Adds an editor plugin.
- *
- * It's safe to call during initialization.
- *
- * @param p_class_name A pointer to a StringName with the name of a class (descending from EditorPlugin) which is already registered with ClassDB.
- */
- typedef void (*GDExtensionInterfaceEditorAddPlugin)(GDExtensionConstStringNamePtr p_class_name);
- /**
- * @name editor_remove_plugin
- * @since 4.1
- *
- * Removes an editor plugin.
- *
- * @param p_class_name A pointer to a StringName with the name of a class that was previously added as an editor plugin.
- */
- typedef void (*GDExtensionInterfaceEditorRemovePlugin)(GDExtensionConstStringNamePtr p_class_name);
- #ifdef __cplusplus
- }
- #endif
- #endif // GDEXTENSION_INTERFACE_H
|