@@ -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 , GDExtensionBool 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,40 @@ 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
+ void * class_userdata ; // Per-class user data, later accessible in instance bindings.
396
+ } GDExtensionClassCreationInfo4 ;
363
397
364
398
typedef void * GDExtensionClassLibraryPtr ;
365
399
@@ -2708,6 +2742,7 @@ typedef void *(*GDExtensionInterfaceCallableCustomGetUserData)(GDExtensionConstT
2708
2742
/**
2709
2743
* @name classdb_construct_object
2710
2744
* @since 4.1
2745
+ * @deprecated in Godot 4.4. Use `classdb_construct_object2` instead.
2711
2746
*
2712
2747
* Constructs an Object of the requested class.
2713
2748
*
@@ -2719,6 +2754,22 @@ typedef void *(*GDExtensionInterfaceCallableCustomGetUserData)(GDExtensionConstT
2719
2754
*/
2720
2755
typedef GDExtensionObjectPtr (* GDExtensionInterfaceClassdbConstructObject )(GDExtensionConstStringNamePtr p_classname );
2721
2756
2757
+ /**
2758
+ * @name classdb_construct_object2
2759
+ * @since 4.4
2760
+ *
2761
+ * Constructs an Object of the requested class.
2762
+ *
2763
+ * 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.
2764
+ *
2765
+ * "NOTIFICATION_POSTINITIALIZE" must be sent after construction.
2766
+ *
2767
+ * @param p_classname A pointer to a StringName with the class name.
2768
+ *
2769
+ * @return A pointer to the newly created Object.
2770
+ */
2771
+ typedef GDExtensionObjectPtr (* GDExtensionInterfaceClassdbConstructObject2 )(GDExtensionConstStringNamePtr p_classname );
2772
+
2722
2773
/**
2723
2774
* @name classdb_get_method_bind
2724
2775
* @since 4.1
@@ -2750,7 +2801,7 @@ typedef void *(*GDExtensionInterfaceClassdbGetClassTag)(GDExtensionConstStringNa
2750
2801
/**
2751
2802
* @name classdb_register_extension_class
2752
2803
* @since 4.1
2753
- * @deprecated in Godot 4.2. Use `classdb_register_extension_class3 ` instead.
2804
+ * @deprecated in Godot 4.2. Use `classdb_register_extension_class4 ` instead.
2754
2805
*
2755
2806
* Registers an extension class in the ClassDB.
2756
2807
*
@@ -2766,7 +2817,7 @@ typedef void (*GDExtensionInterfaceClassdbRegisterExtensionClass)(GDExtensionCla
2766
2817
/**
2767
2818
* @name classdb_register_extension_class2
2768
2819
* @since 4.2
2769
- * @deprecated in Godot 4.3. Use `classdb_register_extension_class3 ` instead.
2820
+ * @deprecated in Godot 4.3. Use `classdb_register_extension_class4 ` instead.
2770
2821
*
2771
2822
* Registers an extension class in the ClassDB.
2772
2823
*
@@ -2782,6 +2833,7 @@ typedef void (*GDExtensionInterfaceClassdbRegisterExtensionClass2)(GDExtensionCl
2782
2833
/**
2783
2834
* @name classdb_register_extension_class3
2784
2835
* @since 4.3
2836
+ * @deprecated in Godot 4.4. Use `classdb_register_extension_class4` instead.
2785
2837
*
2786
2838
* Registers an extension class in the ClassDB.
2787
2839
*
@@ -2794,6 +2846,21 @@ typedef void (*GDExtensionInterfaceClassdbRegisterExtensionClass2)(GDExtensionCl
2794
2846
*/
2795
2847
typedef void (* GDExtensionInterfaceClassdbRegisterExtensionClass3 )(GDExtensionClassLibraryPtr p_library , GDExtensionConstStringNamePtr p_class_name , GDExtensionConstStringNamePtr p_parent_class_name , const GDExtensionClassCreationInfo3 * p_extension_funcs );
2796
2848
2849
+ /**
2850
+ * @name classdb_register_extension_class4
2851
+ * @since 4.4
2852
+ *
2853
+ * Registers an extension class in the ClassDB.
2854
+ *
2855
+ * Provided struct can be safely freed once the function returns.
2856
+ *
2857
+ * @param p_library A pointer the library received by the GDExtension's entry point function.
2858
+ * @param p_class_name A pointer to a StringName with the class name.
2859
+ * @param p_parent_class_name A pointer to a StringName with the parent class name.
2860
+ * @param p_extension_funcs A pointer to a GDExtensionClassCreationInfo2 struct.
2861
+ */
2862
+ typedef void (* GDExtensionInterfaceClassdbRegisterExtensionClass4 )(GDExtensionClassLibraryPtr p_library , GDExtensionConstStringNamePtr p_class_name , GDExtensionConstStringNamePtr p_parent_class_name , const GDExtensionClassCreationInfo4 * p_extension_funcs );
2863
+
2797
2864
/**
2798
2865
* @name classdb_register_extension_class_method
2799
2866
* @since 4.1
0 commit comments