@@ -27,7 +27,7 @@ use crate::storage::{InstanceStorage, Storage, StorageRefCounted, as_storage};
2727
2828/// Invokes `code` -- a callback that calls into user code -- and catches any panic, so it does not unwind across the FFI boundary.
2929///
30- /// `method` names the callback in the error context, e.g. `"to_string "` is reported as `MyClass::to_string ()`.
30+ /// `method` is the user-facing `I*` virtual name, not the Godot slot name -- `"on_get "` is reported as `MyClass::on_get ()`.
3131/// The caller decides how to degrade on `Err`, since each Godot callback has its own failure representation.
3232fn handle_method_panic < T : GodotClass , R > (
3333 method : & str ,
@@ -301,24 +301,24 @@ pub unsafe extern "C" fn to_string<T: cap::GodotToString>(
301301}
302302
303303#[ expect( unsafe_op_in_unsafe_fn) ] // Pointer validity asserted by Godot.
304- pub unsafe extern "C" fn on_notification < T : cap:: GodotNotification > (
304+ pub unsafe extern "C" fn notification < T : cap:: GodotNotification > (
305305 instance : sys:: GDExtensionClassInstancePtr ,
306306 what : i32 ,
307307 _reversed : sys:: GDExtensionBool ,
308308) {
309- // `get_mut()` can also panic on borrow conflicts, in addition to `__godot_notification ` itself.
309+ // `get_mut()` can also panic on borrow conflicts, in addition to `__godot_on_notification ` itself.
310310 let code = || {
311311 let storage = as_storage :: < T > ( instance) ;
312312 let mut instance = storage. get_mut ( ) ;
313313
314- T :: __godot_notification ( & mut * instance, what) ;
314+ T :: __godot_on_notification ( & mut * instance, what) ;
315315 } ;
316316
317317 let _ = handle_method_panic :: < T , _ > ( "on_notification" , code) ;
318318}
319319
320320#[ expect( unsafe_op_in_unsafe_fn) ] // Pointer validity asserted by Godot.
321- pub unsafe extern "C" fn get_property < T : cap:: GodotGet > (
321+ pub unsafe extern "C" fn get < T : cap:: GodotGet > (
322322 instance : sys:: GDExtensionClassInstancePtr ,
323323 name : sys:: GDExtensionConstStringNamePtr ,
324324 ret : sys:: GDExtensionVariantPtr ,
@@ -328,7 +328,7 @@ pub unsafe extern "C" fn get_property<T: cap::GodotGet>(
328328 let instance = T :: Recv :: instance ( storage) ;
329329 let property = StringName :: new_from_string_sys ( name) ;
330330
331- match T :: __godot_get_property ( instance, property) {
331+ match T :: __godot_on_get ( instance, property) {
332332 Some ( value) => {
333333 value. move_into_var_ptr ( ret) ;
334334 true
@@ -337,11 +337,11 @@ pub unsafe extern "C" fn get_property<T: cap::GodotGet>(
337337 }
338338 } ;
339339
340- handle_method_panic_bool :: < T > ( "get_property " , code)
340+ handle_method_panic_bool :: < T > ( "on_get " , code)
341341}
342342
343343#[ expect( unsafe_op_in_unsafe_fn) ] // Pointer validity asserted by Godot.
344- pub unsafe extern "C" fn set_property < T : cap:: GodotSet > (
344+ pub unsafe extern "C" fn set < T : cap:: GodotSet > (
345345 instance : sys:: GDExtensionClassInstancePtr ,
346346 name : sys:: GDExtensionConstStringNamePtr ,
347347 value : sys:: GDExtensionConstVariantPtr ,
@@ -353,10 +353,10 @@ pub unsafe extern "C" fn set_property<T: cap::GodotSet>(
353353 let property = StringName :: new_from_string_sys ( name) ;
354354 let value = Variant :: new_from_var_sys ( value) ;
355355
356- T :: __godot_set_property ( instance, property, value)
356+ T :: __godot_on_set ( instance, property, value)
357357 } ;
358358
359- handle_method_panic_bool :: < T > ( "set_property " , code)
359+ handle_method_panic_bool :: < T > ( "on_set " , code)
360360}
361361
362362pub unsafe extern "C" fn reference < T : GodotClass > ( instance : sys:: GDExtensionClassInstancePtr ) {
@@ -381,7 +381,7 @@ pub unsafe extern "C" fn get_property_list<T: cap::GodotGetPropertyList>(
381381 let storage = as_storage :: < T > ( instance) ;
382382 let instance = T :: Recv :: instance ( storage) ;
383383
384- let property_list = T :: __godot_get_property_list ( instance) ;
384+ let property_list = T :: __godot_on_get_property_list ( instance) ;
385385 let property_list_sys: Box < [ sys:: GDExtensionPropertyInfo ] > = property_list
386386 . into_iter ( )
387387 . map ( |prop| prop. into_owned_property_sys ( ) )
@@ -397,7 +397,7 @@ pub unsafe extern "C" fn get_property_list<T: cap::GodotGetPropertyList>(
397397 Box :: leak ( property_list_sys) . as_mut_ptr ( ) . cast_const ( )
398398 } ;
399399
400- handle_method_panic :: < T , _ > ( "get_property_list " , code) . unwrap_or_else ( |_| {
400+ handle_method_panic :: < T , _ > ( "on_get_property_list " , code) . unwrap_or_else ( |_| {
401401 // On panic, report an empty list -- `count` comes uninitialized, so it must be set in any case.
402402 * count = 0 ;
403403
@@ -453,7 +453,7 @@ unsafe fn raw_property_get_revert<T: cap::GodotPropertyGetRevert>(
453453 let instance = T :: Recv :: instance ( storage) ;
454454
455455 let property = StringName :: borrow_string_sys ( property_name) ;
456- T :: __godot_property_get_revert ( instance, property. clone ( ) )
456+ T :: __godot_on_property_get_revert ( instance, property. clone ( ) )
457457}
458458
459459/// # Safety
@@ -466,7 +466,7 @@ pub unsafe extern "C" fn property_can_revert<T: cap::GodotPropertyGetRevert>(
466466) -> sys:: GDExtensionBool {
467467 let code = || raw_property_get_revert :: < T > ( instance, property_name) . is_some ( ) ;
468468
469- handle_method_panic_bool :: < T > ( "property_can_revert " , code)
469+ handle_method_panic_bool :: < T > ( "on_property_get_revert " , code)
470470}
471471
472472/// # Safety
@@ -487,7 +487,7 @@ pub unsafe extern "C" fn property_get_revert<T: cap::GodotPropertyGetRevert>(
487487 true
488488 } ;
489489
490- handle_method_panic_bool :: < T > ( "property_get_revert " , code)
490+ handle_method_panic_bool :: < T > ( "on_property_get_revert " , code)
491491}
492492
493493/// Callback for `validate_property`.
@@ -509,14 +509,14 @@ pub unsafe extern "C" fn validate_property<T: cap::GodotValidateProperty>(
509509 let instance = T :: Recv :: instance ( storage) ;
510510
511511 let mut property_info = PropertyInfo :: new_from_sys ( property_info_ptr) ;
512- T :: __godot_validate_property ( instance, & mut property_info) ;
512+ T :: __godot_on_validate_property ( instance, & mut property_info) ;
513513
514514 // `property_info_ptr` remains valid and unchanged by the user callback.
515515 property_info. move_into_property_info_ptr ( property_info_ptr) ;
516516 true
517517 } ;
518518
519- handle_method_panic_bool :: < T > ( "validate_property " , code)
519+ handle_method_panic_bool :: < T > ( "on_validate_property " , code)
520520}
521521
522522// ----------------------------------------------------------------------------------------------------------------------------------------------
0 commit comments