1 /*************************************************************************/ 2 /* gdextension_interface.h */ 3 /*************************************************************************/ 4 /* This file is part of: */ 5 /* GODOT ENGINE */ 6 /* https://godotengine.org */ 7 /*************************************************************************/ 8 /* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ 9 /* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */ 10 /* */ 11 /* Permission is hereby granted, free of charge, to any person obtaining */ 12 /* a copy of this software and associated documentation files (the */ 13 /* "Software"), to deal in the Software without restriction, including */ 14 /* without limitation the rights to use, copy, modify, merge, publish, */ 15 /* distribute, sublicense, and/or sell copies of the Software, and to */ 16 /* permit persons to whom the Software is furnished to do so, subject to */ 17 /* the following conditions: */ 18 /* */ 19 /* The above copyright notice and this permission notice shall be */ 20 /* included in all copies or substantial portions of the Software. */ 21 /* */ 22 /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ 23 /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ 24 /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ 25 /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ 26 /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ 27 /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ 28 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 29 /*************************************************************************/ 30 31 /* This is a C class header, you can copy it and use it directly in your own binders. 32 * Together with the JSON file, you should be able to generate any binder. 33 */ 34 35 module godot.abi.gdextension_binding; 36 37 import godot.abi.types; 38 import core.stdc.config; 39 public import core.stdc.stddef : wchar_t; 40 41 extern (C): 42 //@nogc nothrow: 43 44 /* VARIANT TYPES */ 45 46 alias GDExtensionVariantType = int; 47 enum : GDExtensionVariantType { 48 GDEXTENSION_VARIANT_TYPE_NIL, 49 50 /* atomic types */ 51 GDEXTENSION_VARIANT_TYPE_BOOL, 52 GDEXTENSION_VARIANT_TYPE_INT, 53 GDEXTENSION_VARIANT_TYPE_FLOAT, 54 GDEXTENSION_VARIANT_TYPE_STRING, 55 56 /* math types */ 57 GDEXTENSION_VARIANT_TYPE_VECTOR2, 58 GDEXTENSION_VARIANT_TYPE_VECTOR2I, 59 GDEXTENSION_VARIANT_TYPE_RECT2, 60 GDEXTENSION_VARIANT_TYPE_RECT2I, 61 GDEXTENSION_VARIANT_TYPE_VECTOR3, 62 GDEXTENSION_VARIANT_TYPE_VECTOR3I, 63 GDEXTENSION_VARIANT_TYPE_TRANSFORM2D, 64 GDEXTENSION_VARIANT_TYPE_VECTOR4, 65 GDEXTENSION_VARIANT_TYPE_VECTOR4I, 66 GDEXTENSION_VARIANT_TYPE_PLANE, 67 GDEXTENSION_VARIANT_TYPE_QUATERNION, 68 GDEXTENSION_VARIANT_TYPE_AABB, 69 GDEXTENSION_VARIANT_TYPE_BASIS, 70 GDEXTENSION_VARIANT_TYPE_TRANSFORM3D, 71 GDEXTENSION_VARIANT_TYPE_PROJECTION, 72 73 /* misc types */ 74 GDEXTENSION_VARIANT_TYPE_COLOR, 75 GDEXTENSION_VARIANT_TYPE_STRING_NAME, 76 GDEXTENSION_VARIANT_TYPE_NODE_PATH, 77 GDEXTENSION_VARIANT_TYPE_RID, 78 GDEXTENSION_VARIANT_TYPE_OBJECT, 79 GDEXTENSION_VARIANT_TYPE_CALLABLE, 80 GDEXTENSION_VARIANT_TYPE_SIGNAL, 81 GDEXTENSION_VARIANT_TYPE_DICTIONARY, 82 GDEXTENSION_VARIANT_TYPE_ARRAY, 83 84 /* typed arrays */ 85 GDEXTENSION_VARIANT_TYPE_PACKED_BYTE_ARRAY, 86 GDEXTENSION_VARIANT_TYPE_PACKED_INT32_ARRAY, 87 GDEXTENSION_VARIANT_TYPE_PACKED_INT64_ARRAY, 88 GDEXTENSION_VARIANT_TYPE_PACKED_FLOAT32_ARRAY, 89 GDEXTENSION_VARIANT_TYPE_PACKED_FLOAT64_ARRAY, 90 GDEXTENSION_VARIANT_TYPE_PACKED_STRING_ARRAY, 91 GDEXTENSION_VARIANT_TYPE_PACKED_VECTOR2_ARRAY, 92 GDEXTENSION_VARIANT_TYPE_PACKED_VECTOR3_ARRAY, 93 GDEXTENSION_VARIANT_TYPE_PACKED_COLOR_ARRAY, 94 95 GDEXTENSION_VARIANT_TYPE_VARIANT_MAX 96 } 97 98 alias GDExtensionVariantOperator = int; 99 enum : GDExtensionVariantOperator { 100 /* comparison */ 101 GDEXTENSION_VARIANT_OP_EQUAL, 102 GDEXTENSION_VARIANT_OP_NOT_EQUAL, 103 GDEXTENSION_VARIANT_OP_LESS, 104 GDEXTENSION_VARIANT_OP_LESS_EQUAL, 105 GDEXTENSION_VARIANT_OP_GREATER, 106 GDEXTENSION_VARIANT_OP_GREATER_EQUAL, 107 108 /* mathematic */ 109 GDEXTENSION_VARIANT_OP_ADD, 110 GDEXTENSION_VARIANT_OP_SUBTRACT, 111 GDEXTENSION_VARIANT_OP_MULTIPLY, 112 GDEXTENSION_VARIANT_OP_DIVIDE, 113 GDEXTENSION_VARIANT_OP_NEGATE, 114 GDEXTENSION_VARIANT_OP_POSITIVE, 115 GDEXTENSION_VARIANT_OP_MODULE, 116 GDEXTENSION_VARIANT_OP_POWER, 117 118 /* bitwise */ 119 GDEXTENSION_VARIANT_OP_SHIFT_LEFT, 120 GDEXTENSION_VARIANT_OP_SHIFT_RIGHT, 121 GDEXTENSION_VARIANT_OP_BIT_AND, 122 GDEXTENSION_VARIANT_OP_BIT_OR, 123 GDEXTENSION_VARIANT_OP_BIT_XOR, 124 GDEXTENSION_VARIANT_OP_BIT_NEGATE, 125 126 /* logic */ 127 GDEXTENSION_VARIANT_OP_AND, 128 GDEXTENSION_VARIANT_OP_OR, 129 GDEXTENSION_VARIANT_OP_XOR, 130 GDEXTENSION_VARIANT_OP_NOT, 131 132 /* containment */ 133 GDEXTENSION_VARIANT_OP_IN, 134 GDEXTENSION_VARIANT_OP_MAX 135 136 } 137 138 alias GDExtensionVariantPtr = void*; 139 alias GDExtensionConstVariantPtr = const(void)*; 140 alias GDExtensionStringNamePtr = void*; 141 alias GDExtensionConstStringNamePtr = const(void)*; 142 alias GDExtensionStringPtr = void*; 143 alias GDExtensionConstStringPtr = const(void)*; 144 alias GDExtensionObjectPtr = void*; 145 alias GDExtensionConstObjectPtr = const(void)*; 146 alias GDExtensionTypePtr = void*; 147 alias GDExtensionConstTypePtr = const(void)*; 148 alias GDExtensionMethodBindPtr = const(void)*; 149 alias GDExtensionInt = int64_t; 150 alias GDExtensionBool = uint8_t; 151 alias GDObjectInstanceID = uint64_t; 152 alias GDExtensionRefPtr = void*; 153 alias GDExtensionConstRefPtr = const(void)*; 154 155 /* VARIANT DATA I/O */ 156 157 alias GDExtensionCallErrorType = int; 158 enum : GDExtensionCallErrorType { 159 GDEXTENSION_CALL_OK, 160 GDEXTENSION_CALL_ERROR_INVALID_METHOD, 161 GDEXTENSION_CALL_ERROR_INVALID_ARGUMENT, // Expected a different variant type. 162 GDEXTENSION_CALL_ERROR_TOO_MANY_ARGUMENTS, // Expected lower number of arguments. 163 GDEXTENSION_CALL_ERROR_TOO_FEW_ARGUMENTS, // Expected higher number of arguments. 164 GDEXTENSION_CALL_ERROR_INSTANCE_IS_NULL, 165 GDEXTENSION_CALL_ERROR_METHOD_NOT_CONST, // Used for const call. 166 167 } 168 169 struct GDExtensionCallError { 170 //@nogc nothrow: 171 GDExtensionCallErrorType error; 172 int32_t argument; 173 int32_t expected; 174 } 175 176 alias GDExtensionVariantFromTypeConstructorFunc = void function(GDExtensionVariantPtr, GDExtensionTypePtr); 177 alias GDExtensionTypeFromVariantConstructorFunc = void function(GDExtensionTypePtr, GDExtensionVariantPtr); 178 alias GDExtensionPtrOperatorEvaluator = void function(const GDExtensionTypePtr p_left, const GDExtensionTypePtr p_right, GDExtensionTypePtr r_result); 179 alias GDExtensionPtrBuiltInMethod = void function(GDExtensionTypePtr p_base, const GDExtensionTypePtr* p_args, GDExtensionTypePtr r_return, int p_argument_count); 180 alias GDExtensionPtrConstructor = void function(GDExtensionTypePtr p_base, const GDExtensionTypePtr* p_args); 181 alias GDExtensionPtrDestructor = void function(GDExtensionTypePtr p_base); 182 alias GDExtensionPtrSetter = void function(GDExtensionTypePtr p_base, const GDExtensionTypePtr p_value); 183 alias GDExtensionPtrGetter = void function(const GDExtensionTypePtr p_base, GDExtensionTypePtr r_value); 184 alias GDExtensionPtrIndexedSetter = void function(GDExtensionTypePtr p_base, GDExtensionInt p_index, const GDExtensionTypePtr p_value); 185 alias GDExtensionPtrIndexedGetter = void function(const GDExtensionTypePtr p_base, GDExtensionInt p_index, GDExtensionTypePtr r_value); 186 alias GDExtensionPtrKeyedSetter = void function(GDExtensionTypePtr p_base, const GDExtensionTypePtr p_key, const GDExtensionTypePtr p_value); 187 alias GDExtensionPtrKeyedGetter = void function(const GDExtensionTypePtr p_base, const GDExtensionTypePtr p_key, GDExtensionTypePtr r_value); 188 alias GDExtensionPtrKeyedChecker = uint32_t function(const GDExtensionVariantPtr p_base, const GDExtensionVariantPtr p_key); 189 alias GDExtensionPtrUtilityFunction = void function(GDExtensionTypePtr r_return, const GDExtensionTypePtr* p_arguments, int p_argument_count); 190 191 alias GDExtensionClassConstructor = GDExtensionObjectPtr function(); 192 193 alias GDExtensionInstanceBindingCreateCallback = void* function(void* p_token, void* p_instance); 194 alias GDExtensionInstanceBindingFreeCallback = void function(void* p_token, void* p_instance, void* p_binding); 195 alias GDExtensionInstanceBindingReferenceCallback = GDExtensionBool function( 196 void* p_token, void* p_binding, GDExtensionBool p_reference); 197 198 struct GDExtensionInstanceBindingCallbacks { 199 //@nogc nothrow: 200 GDExtensionInstanceBindingCreateCallback create_callback; 201 GDExtensionInstanceBindingFreeCallback free_callback; 202 GDExtensionInstanceBindingReferenceCallback reference_callback; 203 } 204 205 /* EXTENSION CLASSES */ 206 207 alias GDExtensionClassInstancePtr = void*; 208 209 alias GDExtensionClassSet = GDExtensionBool function(GDExtensionClassInstancePtr p_instance, const GDExtensionStringNamePtr p_name, const GDExtensionVariantPtr p_value); 210 alias GDExtensionClassGet = GDExtensionBool function(GDExtensionClassInstancePtr p_instance, const GDExtensionStringNamePtr p_name, GDExtensionVariantPtr r_ret); 211 alias GDExtensionClassGetRID = uint64_t function(GDExtensionClassInstancePtr p_instance); 212 213 struct GDExtensionPropertyInfo { 214 //@nogc nothrow: 215 GDExtensionVariantType type; 216 GDExtensionStringNamePtr name; 217 GDExtensionStringNamePtr class_name; 218 uint32_t hint; // Bitfield of `PropertyHint` (defined in `extension_api.json`). 219 GDExtensionStringNamePtr hint_string; 220 uint32_t usage; // Bitfield of `PropertyUsageFlags` (defined in `extension_api.json`). 221 } 222 223 struct GDExtensionMethodInfo { 224 //@nogc nothrow: 225 GDExtensionStringNamePtr name; 226 GDExtensionPropertyInfo return_value; 227 uint32_t flags; // Bitfield of `GDExtensionClassMethodFlags`. 228 int32_t id; 229 230 /* Arguments: `default_arguments` is an array of size `argument_count`. */ 231 uint32_t argument_count; 232 GDExtensionPropertyInfo* arguments; 233 234 /* Default arguments: `default_arguments` is an array of size `default_argument_count`. */ 235 uint32_t default_argument_count; 236 GDExtensionVariantPtr* default_arguments; 237 } 238 239 alias GDExtensionClassGetPropertyList = const GDExtensionPropertyInfo* function( 240 GDExtensionClassInstancePtr p_instance, uint32_t* r_count); 241 alias GDExtensionClassFreePropertyList = void function( 242 GDExtensionClassInstancePtr p_instance, const GDExtensionPropertyInfo* p_list); 243 alias GDExtensionClassPropertyCanRevert = GDExtensionBool function( 244 GDExtensionClassInstancePtr p_instance, const GDExtensionStringNamePtr p_name); 245 alias GDExtensionClassPropertyGetRevert = GDExtensionBool function( 246 GDExtensionClassInstancePtr p_instance, const GDExtensionStringNamePtr p_name, GDExtensionVariantPtr r_ret); 247 alias GDExtensionClassNotification = void function( 248 GDExtensionClassInstancePtr p_instance, int32_t p_what); 249 alias GDExtensionClassToString = void function( 250 GDExtensionClassInstancePtr p_instance, GDExtensionBool *r_is_valid, GDExtensionStringPtr p_out); 251 alias GDExtensionClassReference = void function(GDExtensionClassInstancePtr p_instance); 252 alias GDExtensionClassUnreference = void function(GDExtensionClassInstancePtr p_instance); 253 alias GDExtensionClassCallVirtual = void function(GDExtensionClassInstancePtr p_instance, const GDExtensionTypePtr* p_args, GDExtensionTypePtr r_ret); 254 alias GDExtensionClassCreateInstance = GDExtensionObjectPtr function(void* p_userdata); 255 alias GDExtensionClassFreeInstance = void function(void* p_userdata, GDExtensionClassInstancePtr p_instance); 256 alias GDExtensionClassGetVirtual = GDExtensionClassCallVirtual function( 257 void* p_userdata, const GDExtensionStringNamePtr p_name); 258 259 struct GDExtensionClassCreationInfo { 260 //@nogc nothrow: 261 GDExtensionBool is_virtual; 262 GDExtensionBool is_abstract; 263 GDExtensionClassSet set_func; 264 GDExtensionClassGet get_func; 265 GDExtensionClassGetPropertyList get_property_list_func; 266 GDExtensionClassFreePropertyList free_property_list_func; 267 GDExtensionClassPropertyCanRevert property_can_revert_func; 268 GDExtensionClassPropertyGetRevert property_get_revert_func; 269 GDExtensionClassNotification notification_func; 270 GDExtensionClassToString to_string_func; 271 GDExtensionClassReference reference_func; 272 GDExtensionClassUnreference unreference_func; 273 GDExtensionClassCreateInstance create_instance_func; // (Default) constructor; mandatory. If the class is not instantiable, consider making it virtual or abstract. 274 GDExtensionClassFreeInstance free_instance_func; // Destructor; mandatory. 275 GDExtensionClassGetVirtual get_virtual_func; // Queries a virtual function by name and returns a callback to invoke the requested virtual function. 276 GDExtensionClassGetRID get_rid_func; 277 void* class_userdata; // Per-class user data, later accessible in instance bindings. 278 } 279 280 alias GDExtensionClassLibraryPtr = void*; 281 282 /* Method */ 283 284 alias GDExtensionClassMethodFlags = int; 285 enum : GDExtensionClassMethodFlags { 286 GDEXTENSION_METHOD_FLAG_NORMAL = 1, 287 GDEXTENSION_METHOD_FLAG_EDITOR = 2, 288 GDEXTENSION_METHOD_FLAG_CONST = 4, 289 GDEXTENSION_METHOD_FLAG_VIRTUAL = 8, 290 GDEXTENSION_METHOD_FLAG_VARARG = 16, 291 GDEXTENSION_METHOD_FLAG_STATIC = 32, 292 GDEXTENSION_METHOD_FLAGS_DEFAULT = GDEXTENSION_METHOD_FLAG_NORMAL, 293 } 294 295 alias GDExtensionClassMethodArgumentMetadata = int; 296 enum : GDExtensionClassMethodArgumentMetadata { 297 GDEXTENSION_METHOD_ARGUMENT_METADATA_NONE, 298 GDEXTENSION_METHOD_ARGUMENT_METADATA_INT_IS_INT8, 299 GDEXTENSION_METHOD_ARGUMENT_METADATA_INT_IS_INT16, 300 GDEXTENSION_METHOD_ARGUMENT_METADATA_INT_IS_INT32, 301 GDEXTENSION_METHOD_ARGUMENT_METADATA_INT_IS_INT64, 302 GDEXTENSION_METHOD_ARGUMENT_METADATA_INT_IS_UINT8, 303 GDEXTENSION_METHOD_ARGUMENT_METADATA_INT_IS_UINT16, 304 GDEXTENSION_METHOD_ARGUMENT_METADATA_INT_IS_UINT32, 305 GDEXTENSION_METHOD_ARGUMENT_METADATA_INT_IS_UINT64, 306 GDEXTENSION_METHOD_ARGUMENT_METADATA_REAL_IS_FLOAT, 307 GDEXTENSION_METHOD_ARGUMENT_METADATA_REAL_IS_DOUBLE 308 } 309 310 alias GDExtensionClassMethodCall = void function(void* method_userdata, GDExtensionClassInstancePtr p_instance, const(GDExtensionVariantPtr)* p_args, GDExtensionInt p_argument_count, GDExtensionVariantPtr r_return, GDExtensionCallError* r_error); 311 alias GDExtensionClassMethodPtrCall = void function(void* method_userdata, GDExtensionClassInstancePtr p_instance, const(GDExtensionTypePtr)* p_args, GDExtensionTypePtr r_ret); 312 313 /* passing -1 as argument in the following functions refers to the return type */ 314 alias GDExtensionClassMethodGetArgumentType = GDExtensionVariantType function( 315 void* p_method_userdata, int32_t p_argument); 316 alias GDExtensionClassMethodGetArgumentInfo = void function( 317 void* p_method_userdata, int32_t p_argument, GDExtensionPropertyInfo* r_info); 318 alias GDExtensionClassMethodGetArgumentMetadata = GDExtensionClassMethodArgumentMetadata function( 319 void* p_method_userdata, int32_t p_argument); 320 321 struct GDExtensionClassMethodInfo { 322 //@nogc nothrow: 323 GDExtensionStringNamePtr name; 324 void* method_userdata; 325 GDExtensionClassMethodCall call_func; 326 GDExtensionClassMethodPtrCall ptrcall_func; 327 uint32_t method_flags; // Bitfield of `GDExtensionClassMethodFlags`. 328 329 /* If `has_return_value` is false, `return_value_info` and `return_value_metadata` are ignored. */ 330 GDExtensionBool has_return_value; 331 GDExtensionPropertyInfo* return_value_info; 332 GDExtensionClassMethodArgumentMetadata return_value_metadata; 333 334 /* Arguments: `arguments_info` and `arguments_metadata` are array of size `argument_count`. 335 * Name and hint information for the argument can be omitted in release builds. Class name should always be present if it applies. 336 */ 337 uint32_t argument_count; 338 GDExtensionPropertyInfo* arguments_info; 339 GDExtensionClassMethodArgumentMetadata* arguments_metadata; 340 341 /* Default arguments: `default_arguments` is an array of size `default_argument_count`. */ 342 uint32_t default_argument_count; 343 GDExtensionVariantPtr* default_arguments; 344 } 345 346 /* SCRIPT INSTANCE EXTENSION */ 347 348 alias GDExtensionScriptInstanceDataPtr = void*; // Pointer to custom ScriptInstance native implementation. 349 350 alias GDExtensionScriptInstanceSet = GDExtensionBool function(GDExtensionScriptInstanceDataPtr p_instance, const GDExtensionStringNamePtr p_name, const GDExtensionVariantPtr p_value); 351 alias GDExtensionScriptInstanceGet = GDExtensionBool function(GDExtensionScriptInstanceDataPtr p_instance, const GDExtensionStringNamePtr p_name, GDExtensionVariantPtr r_ret); 352 alias GDExtensionScriptInstanceGetPropertyList = const GDExtensionPropertyInfo function( 353 GDExtensionScriptInstanceDataPtr p_instance, uint32_t* r_count); 354 alias GDExtensionScriptInstanceFreePropertyList = void function( 355 GDExtensionScriptInstanceDataPtr p_instance, const GDExtensionPropertyInfo* p_list); 356 alias GDExtensionScriptInstanceGetPropertyType = GDExtensionVariantType function( 357 GDExtensionScriptInstanceDataPtr p_instance, const GDExtensionStringNamePtr p_name, GDExtensionBool* r_is_valid); 358 359 alias GDExtensionScriptInstancePropertyCanRevert = GDExtensionBool function( 360 GDExtensionScriptInstanceDataPtr p_instance, const GDExtensionStringNamePtr p_name); 361 alias GDExtensionScriptInstancePropertyGetRevert = GDExtensionBool function( 362 GDExtensionScriptInstanceDataPtr p_instance, const GDExtensionStringNamePtr p_name, GDExtensionVariantPtr r_ret); 363 364 alias GDExtensionScriptInstanceGetOwner = GDExtensionObjectPtr function( 365 GDExtensionScriptInstanceDataPtr p_instance); 366 alias GDExtensionScriptInstancePropertyStateAdd = void function( 367 const GDExtensionStringNamePtr p_name, const GDExtensionVariantPtr p_value, void* p_userdata); 368 alias GDExtensionScriptInstanceGetPropertyState = void function(GDExtensionScriptInstanceDataPtr p_instance, GDExtensionScriptInstancePropertyStateAdd p_add_func, void* p_userdata); 369 370 alias GDExtensionScriptInstanceGetMethodList = const GDExtensionMethodInfo function( 371 GDExtensionScriptInstanceDataPtr p_instance, uint32_t* r_count); 372 alias GDExtensionScriptInstanceFreeMethodList = void function( 373 GDExtensionScriptInstanceDataPtr p_instance, const GDExtensionMethodInfo* p_list); 374 375 alias GDExtensionScriptInstanceHasMethod = GDExtensionBool function( 376 GDExtensionScriptInstanceDataPtr p_instance, const GDExtensionStringNamePtr p_name); 377 378 alias GDExtensionScriptInstanceCall = void function( 379 GDExtensionScriptInstanceDataPtr p_self, const GDExtensionStringNamePtr p_method, const GDExtensionVariantPtr* p_args, const GDExtensionInt p_argument_count, GDExtensionVariantPtr r_return, GDExtensionCallError* r_error); 380 alias GDExtensionScriptInstanceNotification = void function( 381 GDExtensionScriptInstanceDataPtr p_instance, int32_t p_what); 382 alias GDExtensionScriptInstanceToString = void function( 383 GDExtensionScriptInstanceDataPtr p_instance, GDExtensionBool* r_is_valid, GDExtensionStringPtr r_out); 384 385 alias GDExtensionScriptInstanceRefCountIncremented = void function( 386 GDExtensionScriptInstanceDataPtr p_instance); 387 alias GDExtensionScriptInstanceRefCountDecremented = GDExtensionBool function( 388 GDExtensionScriptInstanceDataPtr p_instance); 389 390 alias GDExtensionScriptInstanceGetScript = GDExtensionObjectPtr function( 391 GDExtensionScriptInstanceDataPtr p_instance); 392 alias GDExtensionScriptInstanceIsPlaceholder = GDExtensionBool function( 393 GDExtensionScriptInstanceDataPtr p_instance); 394 395 alias GDExtensionScriptLanguagePtr = void*; 396 397 alias GDExtensionScriptInstanceGetLanguage = GDExtensionScriptLanguagePtr function( 398 GDExtensionScriptInstanceDataPtr p_instance); 399 400 alias GDExtensionScriptInstanceFree = void function( 401 GDExtensionScriptInstanceDataPtr p_instance); 402 403 alias GDExtensionScriptInstancePtr = void*; // Pointer to ScriptInstance. 404 405 struct GDExtensionScriptInstanceInfo { 406 //@nogc nothrow: 407 GDExtensionScriptInstanceSet set_func; 408 GDExtensionScriptInstanceGet get_func; 409 GDExtensionScriptInstanceGetPropertyList get_property_list_func; 410 GDExtensionScriptInstanceFreePropertyList free_property_list_func; 411 412 GDExtensionScriptInstancePropertyCanRevert property_can_revert_func; 413 GDExtensionScriptInstancePropertyGetRevert property_get_revert_func; 414 415 GDExtensionScriptInstanceGetOwner get_owner_func; 416 GDExtensionScriptInstanceGetPropertyState get_property_state_func; 417 418 GDExtensionScriptInstanceGetMethodList get_method_list_func; 419 GDExtensionScriptInstanceFreeMethodList free_method_list_func; 420 GDExtensionScriptInstanceGetPropertyType get_property_type_func; 421 422 GDExtensionScriptInstanceHasMethod has_method_func; 423 424 GDExtensionScriptInstanceCall call_func; 425 GDExtensionScriptInstanceNotification notification_func; 426 427 GDExtensionScriptInstanceToString to_string_func; 428 429 GDExtensionScriptInstanceRefCountIncremented refcount_incremented_func; 430 GDExtensionScriptInstanceRefCountDecremented refcount_decremented_func; 431 432 GDExtensionScriptInstanceGetScript get_script_func; 433 434 GDExtensionScriptInstanceIsPlaceholder is_placeholder_func; 435 436 GDExtensionScriptInstanceSet set_fallback_func; 437 GDExtensionScriptInstanceGet get_fallback_func; 438 439 GDExtensionScriptInstanceGetLanguage get_language_func; 440 441 GDExtensionScriptInstanceFree free_func; 442 } 443 444 /* INTERFACE */ 445 446 struct GDExtensionInterface { 447 //@nogc nothrow: 448 uint32_t version_major; 449 uint32_t version_minor; 450 uint32_t version_patch; 451 const(char)* version_string; 452 453 /* GODOT CORE */ 454 455 void* function(size_t p_bytes) mem_alloc; 456 void* function(void* p_ptr, size_t p_bytes) mem_realloc; 457 void function(void* p_ptr) mem_free; 458 459 nothrow void function(const(char)* p_description, const(char)* p_function, const(char)* p_file, int32_t p_line, GDExtensionBool p_editor_notify) print_error; 460 nothrow void function(const(char)* p_description, const(char)* p_message, const(char)* p_function, const(char)* p_file, int32_t p_line, GDExtensionBool p_editor_notify) print_error_with_message; 461 nothrow void function(const(char)* p_description, const(char)* p_function, const(char)* p_file, int32_t p_line, GDExtensionBool p_editor_notify) print_warning; 462 nothrow void function(const(char)* p_description, const(char)* p_message, const(char)* p_function, const(char)* p_file, int32_t p_line, GDExtensionBool p_editor_notify) print_warning_with_message; 463 nothrow void function(const(char)* p_description, const(char)* p_function, const(char)* p_file, int32_t p_line, GDExtensionBool p_editor_notify) print_script_error; 464 nothrow void function(const(char)* p_description, const(char)* p_message, const(char)* p_function, const(char)* p_file, int32_t p_line, GDExtensionBool p_editor_notify) print_script_error_with_message; 465 466 uint64_t function(const GDExtensionStringNamePtr p_name) get_native_struct_size; 467 468 /* GODOT VARIANT */ 469 470 /* variant general */ 471 void function(GDExtensionVariantPtr r_dest, const GDExtensionVariantPtr p_src) variant_new_copy; 472 void function(GDExtensionVariantPtr r_dest) variant_new_nil; 473 void function(GDExtensionVariantPtr p_self) variant_destroy; 474 475 /* variant type */ 476 void function(GDExtensionVariantPtr p_self, const GDExtensionStringNamePtr p_method, const GDExtensionVariantPtr* p_args, const GDExtensionInt p_argument_count, GDExtensionVariantPtr r_return, GDExtensionCallError* r_error) variant_call; 477 void function(GDExtensionVariantType p_type, const GDExtensionStringNamePtr p_method, const GDExtensionVariantPtr* p_args, const GDExtensionInt p_argument_count, GDExtensionVariantPtr r_return, GDExtensionCallError* r_error) variant_call_static; 478 void function(GDExtensionVariantOperator p_op, const GDExtensionVariantPtr p_a, const GDExtensionVariantPtr p_b, GDExtensionVariantPtr r_return, GDExtensionBool* r_valid) variant_evaluate; 479 void function(GDExtensionVariantPtr p_self, const GDExtensionVariantPtr p_key, const GDExtensionVariantPtr p_value, GDExtensionBool* r_valid) variant_set; 480 void function(GDExtensionVariantPtr p_self, const GDExtensionStringNamePtr p_key, const GDExtensionVariantPtr p_value, GDExtensionBool* r_valid) variant_set_named; 481 void function(GDExtensionVariantPtr p_self, const GDExtensionVariantPtr p_key, const GDExtensionVariantPtr p_value, GDExtensionBool* r_valid) variant_set_keyed; 482 void function(GDExtensionVariantPtr p_self, GDExtensionInt p_index, const GDExtensionVariantPtr p_value, GDExtensionBool* r_valid, GDExtensionBool* r_oob) variant_set_indexed; 483 void function(const GDExtensionVariantPtr p_self, const GDExtensionVariantPtr p_key, GDExtensionVariantPtr r_ret, GDExtensionBool* r_valid) variant_get; 484 void function(const GDExtensionVariantPtr p_self, const GDExtensionStringNamePtr p_key, GDExtensionVariantPtr r_ret, GDExtensionBool* r_valid) variant_get_named; 485 void function(const GDExtensionVariantPtr p_self, const GDExtensionVariantPtr p_key, GDExtensionVariantPtr r_ret, GDExtensionBool* r_valid) variant_get_keyed; 486 void function(const GDExtensionVariantPtr p_self, GDExtensionInt p_index, GDExtensionVariantPtr r_ret, GDExtensionBool* r_valid, GDExtensionBool* r_oob) variant_get_indexed; 487 GDExtensionBool function(const GDExtensionVariantPtr p_self, GDExtensionVariantPtr r_iter, GDExtensionBool* r_valid) variant_iter_init; 488 GDExtensionBool function(const GDExtensionVariantPtr p_self, GDExtensionVariantPtr r_iter, GDExtensionBool* r_valid) variant_iter_next; 489 void function(const GDExtensionVariantPtr p_self, GDExtensionVariantPtr r_iter, GDExtensionVariantPtr r_ret, GDExtensionBool* r_valid) variant_iter_get; 490 GDExtensionInt function(const GDExtensionVariantPtr p_self) variant_hash; 491 GDExtensionInt function(const GDExtensionVariantPtr p_self, GDExtensionInt p_recursion_count) variant_recursive_hash; 492 GDExtensionBool function(const GDExtensionVariantPtr p_self, const GDExtensionVariantPtr p_other) variant_hash_compare; 493 GDExtensionBool function(const GDExtensionVariantPtr p_self) variant_booleanize; 494 void function(const GDExtensionVariantPtr p_self, GDExtensionVariantPtr r_ret, GDExtensionBool p_deep) variant_duplicate; 495 void function(const GDExtensionVariantPtr p_self, GDExtensionStringPtr r_ret) variant_stringify; 496 497 GDExtensionVariantType function(const GDExtensionVariantPtr p_self) variant_get_type; 498 GDExtensionBool function(const GDExtensionVariantPtr p_self, const GDExtensionStringNamePtr p_method) variant_has_method; 499 GDExtensionBool function(GDExtensionVariantType p_type, const GDExtensionStringNamePtr p_member) variant_has_member; 500 GDExtensionBool function(const GDExtensionVariantPtr p_self, const GDExtensionVariantPtr p_key, GDExtensionBool* r_valid) variant_has_key; 501 void function(GDExtensionVariantType p_type, GDExtensionStringPtr r_name) variant_get_type_name; 502 GDExtensionBool function(GDExtensionVariantType p_from, GDExtensionVariantType p_to) variant_can_convert; 503 GDExtensionBool function(GDExtensionVariantType p_from, GDExtensionVariantType p_to) variant_can_convert_strict; 504 505 /* ptrcalls */ 506 GDExtensionVariantFromTypeConstructorFunc function(GDExtensionVariantType p_type) get_variant_from_type_constructor; 507 GDExtensionTypeFromVariantConstructorFunc function(GDExtensionVariantType p_type) get_variant_to_type_constructor; 508 GDExtensionPtrOperatorEvaluator function(GDExtensionVariantOperator p_operator, GDExtensionVariantType p_type_a, GDExtensionVariantType p_type_b) variant_get_ptr_operator_evaluator; 509 GDExtensionPtrBuiltInMethod function(GDExtensionVariantType p_type, const GDExtensionStringNamePtr p_method, GDExtensionInt p_hash) variant_get_ptr_builtin_method; 510 GDExtensionPtrConstructor function(GDExtensionVariantType p_type, int32_t p_constructor) variant_get_ptr_constructor; 511 GDExtensionPtrDestructor function(GDExtensionVariantType p_type) variant_get_ptr_destructor; 512 void function(GDExtensionVariantType p_type, GDExtensionVariantPtr p_base, const(GDExtensionVariantPtr)* p_args, int32_t p_argument_count, GDExtensionCallError* r_error) variant_construct; 513 GDExtensionPtrSetter function(GDExtensionVariantType p_type, const GDExtensionStringNamePtr p_member) variant_get_ptr_setter; 514 GDExtensionPtrGetter function(GDExtensionVariantType p_type, const GDExtensionStringNamePtr p_member) variant_get_ptr_getter; 515 GDExtensionPtrIndexedSetter function(GDExtensionVariantType p_type) variant_get_ptr_indexed_setter; 516 GDExtensionPtrIndexedGetter function(GDExtensionVariantType p_type) variant_get_ptr_indexed_getter; 517 GDExtensionPtrKeyedSetter function(GDExtensionVariantType p_type) variant_get_ptr_keyed_setter; 518 GDExtensionPtrKeyedGetter function(GDExtensionVariantType p_type) variant_get_ptr_keyed_getter; 519 GDExtensionPtrKeyedChecker function(GDExtensionVariantType p_type) variant_get_ptr_keyed_checker; 520 void function(GDExtensionVariantType p_type, const GDExtensionStringNamePtr p_constant, GDExtensionVariantPtr r_ret) variant_get_constant_value; 521 GDExtensionPtrUtilityFunction function(const GDExtensionStringNamePtr p_function, GDExtensionInt p_hash) variant_get_ptr_utility_function; 522 523 /* extra utilities */ 524 void function(GDExtensionStringPtr r_dest, const(char)* p_contents) string_new_with_latin1_chars; 525 void function(GDExtensionStringPtr r_dest, const(char)* p_contents) string_new_with_utf8_chars; 526 void function(GDExtensionStringPtr r_dest, const(char16_t)* p_contents) string_new_with_utf16_chars; 527 void function(GDExtensionStringPtr r_dest, const(char32_t)* p_contents) string_new_with_utf32_chars; 528 void function(GDExtensionStringPtr r_dest, const(wchar_t)* p_contents) string_new_with_wide_chars; 529 void function(GDExtensionStringPtr r_dest, const(char)* p_contents, const GDExtensionInt p_size) string_new_with_latin1_chars_and_len; 530 void function(GDExtensionStringPtr r_dest, const(char)* p_contents, const GDExtensionInt p_size) string_new_with_utf8_chars_and_len; 531 void function(GDExtensionStringPtr r_dest, const(char16_t)* p_contents, const GDExtensionInt p_size) string_new_with_utf16_chars_and_len; 532 void function(GDExtensionStringPtr r_dest, const(char32_t)* p_contents, const GDExtensionInt p_size) string_new_with_utf32_chars_and_len; 533 void function(GDExtensionStringPtr r_dest, const(wchar_t)* p_contents, const GDExtensionInt p_size) string_new_with_wide_chars_and_len; 534 535 /* Information about the following functions: 536 * - The return value is the resulting encoded string length. 537 * - The length returned is in characters, not in bytes. It also does not include a trailing zero. 538 * - These functions also do not write trailing zero, If you need it, write it yourself at the position indicated by the length (and make sure to allocate it). 539 * - Passing NULL in r_text means only the length is computed (again, without including trailing zero). 540 * - p_max_write_length argument is in characters, not bytes. It will be ignored if r_text is NULL. 541 * - p_max_write_length argument does not affect the return value, it's only to cap write length. 542 */ 543 GDExtensionInt function(const GDExtensionStringPtr p_self, char* r_text, GDExtensionInt p_max_write_length) string_to_latin1_chars; 544 GDExtensionInt function(const GDExtensionStringPtr p_self, char* r_text, GDExtensionInt p_max_write_length) string_to_utf8_chars; 545 GDExtensionInt function(const GDExtensionStringPtr p_self, char16_t* r_text, GDExtensionInt p_max_write_length) string_to_utf16_chars; 546 GDExtensionInt function(const GDExtensionStringPtr p_self, char32_t* r_text, GDExtensionInt p_max_write_length) string_to_utf32_chars; 547 GDExtensionInt function(const GDExtensionStringPtr p_self, wchar_t* r_text, GDExtensionInt p_max_write_length) string_to_wide_chars; 548 char32_t* function(GDExtensionStringPtr p_self, GDExtensionInt p_index) string_operator_index; 549 const(char32_t)* function(const GDExtensionStringPtr p_self, GDExtensionInt p_index) string_operator_index_const; 550 551 void function(GDExtensionStringPtr p_self, GDExtensionConstStringPtr p_b) string_operator_plus_eq_string; 552 void function(GDExtensionStringPtr p_self, char32_t p_b) string_operator_plus_eq_char; 553 void function(GDExtensionStringPtr p_self, const(char)* p_b) string_operator_plus_eq_cstr; 554 void function(GDExtensionStringPtr p_self, const(wchar_t)* p_b) string_operator_plus_eq_wcstr; 555 void function(GDExtensionStringPtr p_self, const(char32_t)* p_b) string_operator_plus_eq_c32str; 556 557 /* XMLParser extra utilities */ 558 559 GDExtensionInt function(GDExtensionObjectPtr p_instance, const(uint8_t)* p_buffer, size_t p_size) xml_parser_open_buffer; 560 561 /* FileAccess extra utilities */ 562 563 void function(GDExtensionObjectPtr p_instance, const(uint8_t)* p_src, uint64_t p_length) file_access_store_buffer; 564 uint64_t function(GDExtensionConstObjectPtr p_instance, uint8_t* p_dst, uint64_t p_length) file_access_get_buffer; 565 566 /* WorkerThreadPool extra utilities */ 567 568 int64_t function(GDExtensionObjectPtr p_instance, void function(void*, uint32_t) p_func, void* p_userdata, int p_elements, int p_tasks, GDExtensionBool p_high_priority, GDExtensionConstStringPtr p_description) worker_thread_pool_add_native_group_task; 569 int64_t function(GDExtensionObjectPtr p_instance, void function(void*) p_func, void* p_userdata, GDExtensionBool p_high_priority, GDExtensionConstStringPtr p_description) worker_thread_pool_add_native_task; 570 571 572 /* Packed array functions */ 573 574 uint8_t* function(GDExtensionTypePtr p_self, GDExtensionInt p_index) packed_byte_array_operator_index; // p_self should be a PackedByteArray 575 const(uint8_t)* function(const GDExtensionTypePtr p_self, GDExtensionInt p_index) packed_byte_array_operator_index_const; // p_self should be a PackedByteArray 576 577 GDExtensionTypePtr function(GDExtensionTypePtr p_self, GDExtensionInt p_index) packed_color_array_operator_index; // p_self should be a PackedColorArray, returns Color ptr 578 GDExtensionTypePtr function(const GDExtensionTypePtr p_self, GDExtensionInt p_index) packed_color_array_operator_index_const; // p_self should be a PackedColorArray, returns Color ptr 579 580 float* function(GDExtensionTypePtr p_self, GDExtensionInt p_index) packed_float32_array_operator_index; // p_self should be a PackedFloat32Array 581 const(float)* function(const GDExtensionTypePtr p_self, GDExtensionInt p_index) packed_float32_array_operator_index_const; // p_self should be a PackedFloat32Array 582 double* function(GDExtensionTypePtr p_self, GDExtensionInt p_index) packed_float64_array_operator_index; // p_self should be a PackedFloat64Array 583 const(double)* function(const GDExtensionTypePtr p_self, GDExtensionInt p_index) packed_float64_array_operator_index_const; // p_self should be a PackedFloat64Array 584 585 int32_t* function(GDExtensionTypePtr p_self, GDExtensionInt p_index) packed_int32_array_operator_index; // p_self should be a PackedInt32Array 586 const(int32_t)* function(const GDExtensionTypePtr p_self, GDExtensionInt p_index) packed_int32_array_operator_index_const; // p_self should be a PackedInt32Array 587 int64_t* function(GDExtensionTypePtr p_self, GDExtensionInt p_index) packed_int64_array_operator_index; // p_self should be a PackedInt32Array 588 const(int64_t)* function(const GDExtensionTypePtr p_self, GDExtensionInt p_index) packed_int64_array_operator_index_const; // p_self should be a PackedInt32Array 589 590 GDExtensionStringPtr function(GDExtensionTypePtr p_self, GDExtensionInt p_index) packed_string_array_operator_index; // p_self should be a PackedStringArray 591 GDExtensionStringPtr function(const GDExtensionTypePtr p_self, GDExtensionInt p_index) packed_string_array_operator_index_const; // p_self should be a PackedStringArray 592 593 GDExtensionTypePtr function(GDExtensionTypePtr p_self, GDExtensionInt p_index) packed_vector2_array_operator_index; // p_self should be a PackedVector2Array, returns Vector2 ptr 594 GDExtensionTypePtr function(const GDExtensionTypePtr p_self, GDExtensionInt p_index) packed_vector2_array_operator_index_const; // p_self should be a PackedVector2Array, returns Vector2 ptr 595 GDExtensionTypePtr function(GDExtensionTypePtr p_self, GDExtensionInt p_index) packed_vector3_array_operator_index; // p_self should be a PackedVector3Array, returns Vector3 ptr 596 GDExtensionTypePtr function(const GDExtensionTypePtr p_self, GDExtensionInt p_index) packed_vector3_array_operator_index_const; // p_self should be a PackedVector3Array, returns Vector3 ptr 597 598 GDExtensionVariantPtr function(GDExtensionTypePtr p_self, GDExtensionInt p_index) array_operator_index; // p_self should be an Array ptr 599 GDExtensionVariantPtr function(const GDExtensionTypePtr p_self, GDExtensionInt p_index) array_operator_index_const; // p_self should be an Array ptr 600 void function(GDExtensionTypePtr p_self, GDExtensionConstTypePtr p_from) array_ref; // p_self should be an Array ptr 601 void function(GDExtensionTypePtr p_self, GDExtensionVariantType p_type, GDExtensionConstStringNamePtr p_class_name, GDExtensionConstVariantPtr p_script) array_set_typed; // p_self should be an Array ptr 602 603 /* Dictionary functions */ 604 605 GDExtensionVariantPtr function(GDExtensionTypePtr p_self, const GDExtensionVariantPtr p_key) dictionary_operator_index; // p_self should be an Dictionary ptr 606 GDExtensionVariantPtr function(const GDExtensionTypePtr p_self, const GDExtensionVariantPtr p_key) dictionary_operator_index_const; // p_self should be an Dictionary ptr 607 608 /* OBJECT */ 609 610 void function(const GDExtensionMethodBindPtr p_method_bind, GDExtensionObjectPtr p_instance, const GDExtensionVariantPtr* p_args, GDExtensionInt p_arg_count, GDExtensionVariantPtr r_ret, GDExtensionCallError* r_error) object_method_bind_call; 611 void function(const GDExtensionMethodBindPtr p_method_bind, GDExtensionObjectPtr p_instance, const GDExtensionTypePtr* p_args, GDExtensionTypePtr r_ret) object_method_bind_ptrcall; 612 void function(GDExtensionObjectPtr p_o) object_destroy; 613 GDExtensionObjectPtr function(const GDExtensionStringNamePtr p_name) global_get_singleton; 614 615 void* function(GDExtensionObjectPtr p_o, void* p_token, const GDExtensionInstanceBindingCallbacks* p_callbacks) object_get_instance_binding; 616 void function(GDExtensionObjectPtr p_o, void* p_token, void* p_binding, const GDExtensionInstanceBindingCallbacks* p_callbacks) object_set_instance_binding; 617 618 void function(GDExtensionObjectPtr p_o, const GDExtensionStringNamePtr p_classname, GDExtensionClassInstancePtr p_instance) object_set_instance; /* p_classname should be a registered extension class and should extend the p_o object's class. */ 619 620 GDExtensionObjectPtr function(const GDExtensionObjectPtr p_object, void* p_class_tag) object_cast_to; 621 GDExtensionObjectPtr function(GDObjectInstanceID p_instance_id) object_get_instance_from_id; 622 GDObjectInstanceID function(const GDExtensionObjectPtr p_object) object_get_instance_id; 623 624 /* REFERENCE */ 625 626 GDExtensionObjectPtr function(GDExtensionConstRefPtr p_ref) ref_get_object; 627 void function(GDExtensionRefPtr p_ref, GDExtensionObjectPtr p_object) ref_set_object; 628 629 /* SCRIPT INSTANCE */ 630 631 GDExtensionScriptInstancePtr function(const GDExtensionScriptInstanceInfo* p_info, GDExtensionScriptInstanceDataPtr p_instance_data) script_instance_create; 632 633 /* CLASSDB */ 634 635 GDExtensionObjectPtr function(const GDExtensionStringNamePtr p_classname) classdb_construct_object; /* The passed class must be a built-in godot class, or an already-registered extension class. In both case, object_set_instance should be called to fully initialize the object. */ 636 GDExtensionMethodBindPtr function(const GDExtensionStringNamePtr p_classname, const GDExtensionStringNamePtr p_methodname, GDExtensionInt p_hash) classdb_get_method_bind; 637 void* function(const GDExtensionStringNamePtr p_classname) classdb_get_class_tag; 638 639 /* CLASSDB EXTENSION */ 640 641 /* Provided parameters for `classdb_register_extension_*` can be safely freed once the function returns. */ 642 void function(const GDExtensionClassLibraryPtr p_library, const GDExtensionStringNamePtr p_class_name, const GDExtensionStringNamePtr p_parent_class_name, const GDExtensionClassCreationInfo* p_extension_funcs) classdb_register_extension_class; 643 void function(const GDExtensionClassLibraryPtr p_library, const GDExtensionStringNamePtr p_class_name, const GDExtensionClassMethodInfo* p_method_info) classdb_register_extension_class_method; 644 void function(const GDExtensionClassLibraryPtr p_library, const GDExtensionStringNamePtr p_class_name, const GDExtensionStringNamePtr p_enum_name, const GDExtensionStringNamePtr p_constant_name, GDExtensionInt p_constant_value, GDExtensionBool p_is_bitfield) classdb_register_extension_class_integer_constant; 645 void function(const GDExtensionClassLibraryPtr p_library, const GDExtensionStringNamePtr p_class_name, const GDExtensionPropertyInfo* p_info, const GDExtensionStringNamePtr p_setter, const GDExtensionStringNamePtr p_getter) classdb_register_extension_class_property; 646 void function(const GDExtensionClassLibraryPtr p_library, const GDExtensionStringNamePtr p_class_name, const GDExtensionStringPtr p_group_name, const GDExtensionStringPtr p_prefix) classdb_register_extension_class_property_group; 647 void function(const GDExtensionClassLibraryPtr p_library, const GDExtensionStringNamePtr p_class_name, const GDExtensionStringPtr p_subgroup_name, const GDExtensionStringPtr p_prefix) classdb_register_extension_class_property_subgroup; 648 void function(const GDExtensionClassLibraryPtr p_library, const GDExtensionStringNamePtr p_class_name, const GDExtensionStringNamePtr p_signal_name, const GDExtensionPropertyInfo* p_argument_info, GDExtensionInt p_argument_count) classdb_register_extension_class_signal; 649 void function(const GDExtensionClassLibraryPtr p_library, const GDExtensionStringNamePtr p_class_name) classdb_unregister_extension_class; /* Unregistering a parent class before a class that inherits it will result in failure. Inheritors must be unregistered first. */ 650 651 void function(const GDExtensionClassLibraryPtr p_library, GDExtensionStringPtr r_path) get_library_path; 652 653 } 654 655 /* INITIALIZATION */ 656 alias GDExtensionInitializationLevel = int; 657 enum : GDExtensionInitializationLevel { 658 GDEXTENSION_INITIALIZATION_CORE, 659 GDEXTENSION_INITIALIZATION_SERVERS, 660 GDEXTENSION_INITIALIZATION_SCENE, 661 GDEXTENSION_INITIALIZATION_EDITOR, 662 GDEXTENSION_MAX_INITIALIZATION_LEVEL, 663 } 664 665 struct GDExtensionInitialization { 666 //@nogc nothrow: 667 /* Minimum initialization level required. 668 * If Core or Servers, the extension needs editor or game restart to take effect */ 669 GDExtensionInitializationLevel minimum_initialization_level; 670 /* Up to the user to supply when initializing */ 671 void* userdata; 672 /* This function will be called multiple times for each initialization level. */ 673 void function(void* userdata, GDExtensionInitializationLevel p_level) initialize; 674 void function(void* userdata, GDExtensionInitializationLevel p_level) deinitialize; 675 } 676 677 /* Define a C function prototype that implements the function below and expose it to dlopen() (or similar). 678 * This is the entry point of the GDExtension library and will be called on initialization. 679 * It can be used to set up different init levels, which are called during various stages of initialization/shutdown. 680 * The function name must be a unique one specified in the .gdextension config file. 681 */ 682 alias GDExtensionInitializationFunction = GDExtensionBool function(const GDExtensionInterface* p_interface, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization* r_initialization);