@@ -393,6 +393,37 @@ typedef void (*GDExtensionCallableCustomToString)(void *callable_userdata, GDExt
393
393
394
394
typedef GDExtensionInt (* GDExtensionCallableCustomGetArgumentCount )(void * callable_userdata );
395
395
396
+ typedef struct {
397
+ /* Only `call_func` and `token` are strictly required, however, `object_id` should be passed if its not a static method.
398
+ *
399
+ * `token` should point to an address that uniquely identifies the GDExtension (for example, the
400
+ * `GDExtensionClassLibraryPtr` passed to the entry symbol function.
401
+ *
402
+ * `hash_func`, `equal_func`, and `less_than_func` are optional. If not provided both `call_func` and
403
+ * `callable_userdata` together are used as the identity of the callable for hashing and comparison purposes.
404
+ *
405
+ * The hash returned by `hash_func` is cached, `hash_func` will not be called more than once per callable.
406
+ *
407
+ * `is_valid_func` is necessary if the validity of the callable can change before destruction.
408
+ *
409
+ * `free_func` is necessary if `callable_userdata` needs to be cleaned up when the callable is freed.
410
+ */
411
+ void * callable_userdata ;
412
+ void * token ;
413
+
414
+ GDObjectInstanceID object_id ;
415
+
416
+ GDExtensionCallableCustomCall call_func ;
417
+ GDExtensionCallableCustomIsValid is_valid_func ;
418
+ GDExtensionCallableCustomFree free_func ;
419
+
420
+ GDExtensionCallableCustomHash hash_func ;
421
+ GDExtensionCallableCustomEqual equal_func ;
422
+ GDExtensionCallableCustomLessThan less_than_func ;
423
+
424
+ GDExtensionCallableCustomToString to_string_func ;
425
+ } GDExtensionCallableCustomInfo ; // Deprecated. Use GDExtensionCallableCustomInfo2 instead.
426
+
396
427
typedef struct {
397
428
/* Only `call_func` and `token` are strictly required, however, `object_id` should be passed if its not a static method.
398
429
*
@@ -424,7 +455,7 @@ typedef struct {
424
455
GDExtensionCallableCustomToString to_string_func ;
425
456
426
457
GDExtensionCallableCustomGetArgumentCount get_argument_count_func ;
427
- } GDExtensionCallableCustomInfo ;
458
+ } GDExtensionCallableCustomInfo2 ;
428
459
429
460
/* SCRIPT INSTANCE EXTENSION */
430
461
@@ -509,7 +540,48 @@ typedef struct {
509
540
510
541
GDExtensionScriptInstanceFree free_func ;
511
542
512
- } GDExtensionScriptInstanceInfo ; // Deprecated. Use GDExtensionScriptInstanceInfo2 instead.
543
+ } GDExtensionScriptInstanceInfo ; // Deprecated. Use GDExtensionScriptInstanceInfo3 instead.
544
+
545
+ typedef struct {
546
+ GDExtensionScriptInstanceSet set_func ;
547
+ GDExtensionScriptInstanceGet get_func ;
548
+ GDExtensionScriptInstanceGetPropertyList get_property_list_func ;
549
+ GDExtensionScriptInstanceFreePropertyList free_property_list_func ;
550
+ GDExtensionScriptInstanceGetClassCategory get_class_category_func ; // Optional. Set to NULL for the default behavior.
551
+
552
+ GDExtensionScriptInstancePropertyCanRevert property_can_revert_func ;
553
+ GDExtensionScriptInstancePropertyGetRevert property_get_revert_func ;
554
+
555
+ GDExtensionScriptInstanceGetOwner get_owner_func ;
556
+ GDExtensionScriptInstanceGetPropertyState get_property_state_func ;
557
+
558
+ GDExtensionScriptInstanceGetMethodList get_method_list_func ;
559
+ GDExtensionScriptInstanceFreeMethodList free_method_list_func ;
560
+ GDExtensionScriptInstanceGetPropertyType get_property_type_func ;
561
+ GDExtensionScriptInstanceValidateProperty validate_property_func ;
562
+
563
+ GDExtensionScriptInstanceHasMethod has_method_func ;
564
+
565
+ GDExtensionScriptInstanceCall call_func ;
566
+ GDExtensionScriptInstanceNotification2 notification_func ;
567
+
568
+ GDExtensionScriptInstanceToString to_string_func ;
569
+
570
+ GDExtensionScriptInstanceRefCountIncremented refcount_incremented_func ;
571
+ GDExtensionScriptInstanceRefCountDecremented refcount_decremented_func ;
572
+
573
+ GDExtensionScriptInstanceGetScript get_script_func ;
574
+
575
+ GDExtensionScriptInstanceIsPlaceholder is_placeholder_func ;
576
+
577
+ GDExtensionScriptInstanceSet set_fallback_func ;
578
+ GDExtensionScriptInstanceGet get_fallback_func ;
579
+
580
+ GDExtensionScriptInstanceGetLanguage get_language_func ;
581
+
582
+ GDExtensionScriptInstanceFree free_func ;
583
+
584
+ } GDExtensionScriptInstanceInfo2 ; // Deprecated. Use GDExtensionScriptInstanceInfo3 instead.
513
585
514
586
typedef struct {
515
587
GDExtensionScriptInstanceSet set_func ;
@@ -552,7 +624,7 @@ typedef struct {
552
624
553
625
GDExtensionScriptInstanceFree free_func ;
554
626
555
- } GDExtensionScriptInstanceInfo2 ;
627
+ } GDExtensionScriptInstanceInfo3 ;
556
628
557
629
/* INITIALIZATION */
558
630
@@ -2320,6 +2392,7 @@ typedef GDExtensionScriptInstancePtr (*GDExtensionInterfaceScriptInstanceCreate)
2320
2392
/**
2321
2393
* @name script_instance_create2
2322
2394
* @since 4.2
2395
+ * @deprecated in Godot 4.3. Use `script_instance_create3` instead.
2323
2396
*
2324
2397
* Creates a script instance that contains the given info and instance data.
2325
2398
*
@@ -2330,6 +2403,19 @@ typedef GDExtensionScriptInstancePtr (*GDExtensionInterfaceScriptInstanceCreate)
2330
2403
*/
2331
2404
typedef GDExtensionScriptInstancePtr (* GDExtensionInterfaceScriptInstanceCreate2 )(const GDExtensionScriptInstanceInfo2 * p_info , GDExtensionScriptInstanceDataPtr p_instance_data );
2332
2405
2406
+ /**
2407
+ * @name script_instance_create3
2408
+ * @since 4.3
2409
+ *
2410
+ * Creates a script instance that contains the given info and instance data.
2411
+ *
2412
+ * @param p_info A pointer to a GDExtensionScriptInstanceInfo3 struct.
2413
+ * @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.
2414
+ *
2415
+ * @return A pointer to a ScriptInstanceExtension object.
2416
+ */
2417
+ typedef GDExtensionScriptInstancePtr (* GDExtensionInterfaceScriptInstanceCreate3 )(const GDExtensionScriptInstanceInfo3 * p_info , GDExtensionScriptInstanceDataPtr p_instance_data );
2418
+
2333
2419
/**
2334
2420
* @name placeholder_script_instance_create
2335
2421
* @since 4.2
@@ -2379,6 +2465,7 @@ typedef GDExtensionScriptInstanceDataPtr (*GDExtensionInterfaceObjectGetScriptIn
2379
2465
/**
2380
2466
* @name callable_custom_create
2381
2467
* @since 4.2
2468
+ * @deprecated in Godot 4.3. Use `callable_custom_create2` instead.
2382
2469
*
2383
2470
* Creates a custom Callable object from a function pointer.
2384
2471
*
@@ -2389,6 +2476,19 @@ typedef GDExtensionScriptInstanceDataPtr (*GDExtensionInterfaceObjectGetScriptIn
2389
2476
*/
2390
2477
typedef void (* GDExtensionInterfaceCallableCustomCreate )(GDExtensionUninitializedTypePtr r_callable , GDExtensionCallableCustomInfo * p_callable_custom_info );
2391
2478
2479
+ /**
2480
+ * @name callable_custom_create2
2481
+ * @since 4.3
2482
+ *
2483
+ * Creates a custom Callable object from a function pointer.
2484
+ *
2485
+ * Provided struct can be safely freed once the function returns.
2486
+ *
2487
+ * @param r_callable A pointer that will receive the new Callable.
2488
+ * @param p_callable_custom_info The info required to construct a Callable.
2489
+ */
2490
+ typedef void (* GDExtensionInterfaceCallableCustomCreate2 )(GDExtensionUninitializedTypePtr r_callable , GDExtensionCallableCustomInfo2 * p_callable_custom_info );
2491
+
2392
2492
/**
2393
2493
* @name callable_custom_get_userdata
2394
2494
* @since 4.2
0 commit comments