@@ -268,6 +268,7 @@ typedef void (*GDExtensionClassReference)(GDExtensionClassInstancePtr p_instance
268
268
typedef void (* GDExtensionClassUnreference )(GDExtensionClassInstancePtr p_instance );
269
269
typedef void (* GDExtensionClassCallVirtual )(GDExtensionClassInstancePtr p_instance , const GDExtensionConstTypePtr * p_args , GDExtensionTypePtr r_ret );
270
270
typedef GDExtensionObjectPtr (* GDExtensionClassCreateInstance )(void * p_class_userdata );
271
+ typedef GDExtensionObjectPtr (* GDExtensionClassCreateInstance2 )(void * p_class_userdata , bool p_notify_postinitialize );
271
272
typedef void (* GDExtensionClassFreeInstance )(void * p_class_userdata , GDExtensionClassInstancePtr p_instance );
272
273
typedef GDExtensionClassInstancePtr (* GDExtensionClassRecreateInstance )(void * p_class_userdata , GDExtensionObjectPtr p_object );
273
274
typedef GDExtensionClassCallVirtual (* GDExtensionClassGetVirtual )(void * p_class_userdata , GDExtensionConstStringNamePtr p_name );
@@ -292,7 +293,7 @@ typedef struct {
292
293
GDExtensionClassGetVirtual get_virtual_func ; // Queries a virtual function by name and returns a callback to invoke the requested virtual function.
293
294
GDExtensionClassGetRID get_rid_func ;
294
295
void * class_userdata ; // Per-class user data, later accessible in instance bindings.
295
- } GDExtensionClassCreationInfo ; // Deprecated. Use GDExtensionClassCreationInfo3 instead.
296
+ } GDExtensionClassCreationInfo ; // Deprecated. Use GDExtensionClassCreationInfo4 instead.
296
297
297
298
typedef struct {
298
299
GDExtensionBool is_virtual ;
@@ -325,7 +326,7 @@ typedef struct {
325
326
GDExtensionClassCallVirtualWithData call_virtual_with_data_func ;
326
327
GDExtensionClassGetRID get_rid_func ;
327
328
void * class_userdata ; // Per-class user data, later accessible in instance bindings.
328
- } GDExtensionClassCreationInfo2 ; // Deprecated. Use GDExtensionClassCreationInfo3 instead.
329
+ } GDExtensionClassCreationInfo2 ; // Deprecated. Use GDExtensionClassCreationInfo4 instead.
329
330
330
331
typedef struct {
331
332
GDExtensionBool is_virtual ;
@@ -359,7 +360,41 @@ typedef struct {
359
360
GDExtensionClassCallVirtualWithData call_virtual_with_data_func ;
360
361
GDExtensionClassGetRID get_rid_func ;
361
362
void * class_userdata ; // Per-class user data, later accessible in instance bindings.
362
- } GDExtensionClassCreationInfo3 ;
363
+ } GDExtensionClassCreationInfo3 ; // Deprecated. Use GDExtensionClassCreationInfo4 instead.
364
+
365
+ typedef struct {
366
+ GDExtensionBool is_virtual ;
367
+ GDExtensionBool is_abstract ;
368
+ GDExtensionBool is_exposed ;
369
+ GDExtensionBool is_runtime ;
370
+ GDExtensionClassSet set_func ;
371
+ GDExtensionClassGet get_func ;
372
+ GDExtensionClassGetPropertyList get_property_list_func ;
373
+ GDExtensionClassFreePropertyList2 free_property_list_func ;
374
+ GDExtensionClassPropertyCanRevert property_can_revert_func ;
375
+ GDExtensionClassPropertyGetRevert property_get_revert_func ;
376
+ GDExtensionClassValidateProperty validate_property_func ;
377
+ GDExtensionClassNotification2 notification_func ;
378
+ GDExtensionClassToString to_string_func ;
379
+ GDExtensionClassReference reference_func ;
380
+ GDExtensionClassUnreference unreference_func ;
381
+ GDExtensionClassCreateInstance2 create_instance_func ; // (Default) constructor; mandatory. If the class is not instantiable, consider making it virtual or abstract.
382
+ GDExtensionClassFreeInstance free_instance_func ; // Destructor; mandatory.
383
+ GDExtensionClassRecreateInstance recreate_instance_func ;
384
+ // Queries a virtual function by name and returns a callback to invoke the requested virtual function.
385
+ GDExtensionClassGetVirtual get_virtual_func ;
386
+ // Paired with `call_virtual_with_data_func`, this is an alternative to `get_virtual_func` for extensions that
387
+ // need or benefit from extra data when calling virtual functions.
388
+ // Returns user data that will be passed to `call_virtual_with_data_func`.
389
+ // Returning `NULL` from this function signals to Godot that the virtual function is not overridden.
390
+ // Data returned from this function should be managed by the extension and must be valid until the extension is deinitialized.
391
+ // You should supply either `get_virtual_func`, or `get_virtual_call_data_func` with `call_virtual_with_data_func`.
392
+ GDExtensionClassGetVirtualCallData get_virtual_call_data_func ;
393
+ // Used to call virtual functions when `get_virtual_call_data_func` is not null.
394
+ GDExtensionClassCallVirtualWithData call_virtual_with_data_func ;
395
+ GDExtensionClassGetRID get_rid_func ;
396
+ void * class_userdata ; // Per-class user data, later accessible in instance bindings.
397
+ } GDExtensionClassCreationInfo4 ;
363
398
364
399
typedef void * GDExtensionClassLibraryPtr ;
365
400
@@ -2680,6 +2715,7 @@ typedef void *(*GDExtensionInterfaceCallableCustomGetUserData)(GDExtensionConstT
2680
2715
/**
2681
2716
* @name classdb_construct_object
2682
2717
* @since 4.1
2718
+ * @deprecated in Godot 4.4. Use `classdb_construct_object2` instead.
2683
2719
*
2684
2720
* Constructs an Object of the requested class.
2685
2721
*
@@ -2691,6 +2727,22 @@ typedef void *(*GDExtensionInterfaceCallableCustomGetUserData)(GDExtensionConstT
2691
2727
*/
2692
2728
typedef GDExtensionObjectPtr (* GDExtensionInterfaceClassdbConstructObject )(GDExtensionConstStringNamePtr p_classname );
2693
2729
2730
+ /**
2731
+ * @name classdb_construct_object2
2732
+ * @since 4.4
2733
+ *
2734
+ * Constructs an Object of the requested class.
2735
+ *
2736
+ * 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.
2737
+ *
2738
+ * "NOTIFICATION_POSTINITIALIZE" must be sent after construction.
2739
+ *
2740
+ * @param p_classname A pointer to a StringName with the class name.
2741
+ *
2742
+ * @return A pointer to the newly created Object.
2743
+ */
2744
+ typedef GDExtensionObjectPtr (* GDExtensionInterfaceClassdbConstructObject2 )(GDExtensionConstStringNamePtr p_classname );
2745
+
2694
2746
/**
2695
2747
* @name classdb_get_method_bind
2696
2748
* @since 4.1
@@ -2722,7 +2774,7 @@ typedef void *(*GDExtensionInterfaceClassdbGetClassTag)(GDExtensionConstStringNa
2722
2774
/**
2723
2775
* @name classdb_register_extension_class
2724
2776
* @since 4.1
2725
- * @deprecated in Godot 4.2. Use `classdb_register_extension_class3 ` instead.
2777
+ * @deprecated in Godot 4.2. Use `classdb_register_extension_class4 ` instead.
2726
2778
*
2727
2779
* Registers an extension class in the ClassDB.
2728
2780
*
@@ -2738,7 +2790,7 @@ typedef void (*GDExtensionInterfaceClassdbRegisterExtensionClass)(GDExtensionCla
2738
2790
/**
2739
2791
* @name classdb_register_extension_class2
2740
2792
* @since 4.2
2741
- * @deprecated in Godot 4.3. Use `classdb_register_extension_class3 ` instead.
2793
+ * @deprecated in Godot 4.3. Use `classdb_register_extension_class4 ` instead.
2742
2794
*
2743
2795
* Registers an extension class in the ClassDB.
2744
2796
*
@@ -2754,6 +2806,7 @@ typedef void (*GDExtensionInterfaceClassdbRegisterExtensionClass2)(GDExtensionCl
2754
2806
/**
2755
2807
* @name classdb_register_extension_class3
2756
2808
* @since 4.3
2809
+ * @deprecated in Godot 4.4. Use `classdb_register_extension_class4` instead.
2757
2810
*
2758
2811
* Registers an extension class in the ClassDB.
2759
2812
*
@@ -2766,6 +2819,21 @@ typedef void (*GDExtensionInterfaceClassdbRegisterExtensionClass2)(GDExtensionCl
2766
2819
*/
2767
2820
typedef void (* GDExtensionInterfaceClassdbRegisterExtensionClass3 )(GDExtensionClassLibraryPtr p_library , GDExtensionConstStringNamePtr p_class_name , GDExtensionConstStringNamePtr p_parent_class_name , const GDExtensionClassCreationInfo3 * p_extension_funcs );
2768
2821
2822
+ /**
2823
+ * @name classdb_register_extension_class4
2824
+ * @since 4.4
2825
+ *
2826
+ * Registers an extension class in the ClassDB.
2827
+ *
2828
+ * Provided struct can be safely freed once the function returns.
2829
+ *
2830
+ * @param p_library A pointer the library received by the GDExtension's entry point function.
2831
+ * @param p_class_name A pointer to a StringName with the class name.
2832
+ * @param p_parent_class_name A pointer to a StringName with the parent class name.
2833
+ * @param p_extension_funcs A pointer to a GDExtensionClassCreationInfo2 struct.
2834
+ */
2835
+ typedef void (* GDExtensionInterfaceClassdbRegisterExtensionClass4 )(GDExtensionClassLibraryPtr p_library , GDExtensionConstStringNamePtr p_class_name , GDExtensionConstStringNamePtr p_parent_class_name , const GDExtensionClassCreationInfo4 * p_extension_funcs );
2836
+
2769
2837
/**
2770
2838
* @name classdb_register_extension_class_method
2771
2839
* @since 4.1
0 commit comments