5
5
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
6
*/
7
7
8
- use super :: { make_callable_name, make_godot_fn, ConnectBuilder , GodotDeref , SignalObject } ;
8
+ use super :: { make_callable_name, make_godot_fn, ConnectBuilder , SignalObject , UniformObjectDeref } ;
9
9
use crate :: builtin:: { Callable , Variant } ;
10
10
use crate :: classes:: object:: ConnectFlags ;
11
11
use crate :: meta;
@@ -54,7 +54,7 @@ impl<C: WithBaseField> ToSignalObj<C> for C {
54
54
/// - [`connect()`][Self::connect]: Connect a global/associated function or a closure.
55
55
/// - [`connect_self()`][Self::connect_self]: Connect a method or closure that runs on the signal emitter.
56
56
/// - [`connect_other()`][Self::connect_other]: Connect a method or closure that runs on a separate object.
57
- /// - [`connect_builder ()`][Self::connect_builder ] for more complex setups (such as choosing [`ConnectFlags`] or making thread-safe connections).
57
+ /// - [`builder ()`][Self::builder ] for more complex setups (such as choosing [`ConnectFlags`] or making thread-safe connections).
58
58
///
59
59
/// # Emitting a signal
60
60
/// Code-generated signal types provide a method `emit(...)`, which adopts the names and types of the `#[signal]` parameter list.
@@ -119,8 +119,8 @@ impl<'c, C: WithSignals, Ps: meta::ParamTuple> TypedSignal<'c, C, Ps> {
119
119
/// Fully customizable connection setup.
120
120
///
121
121
/// The returned builder provides several methods to configure how to connect the signal. It needs to be finalized with a call
122
- /// to any of the builder's `connect_** ` methods.
123
- pub fn connect_builder < ' ts > ( & ' ts self ) -> ConnectBuilder < ' ts , ' c , C , Ps > {
122
+ /// to any of the builder's `connect_*` methods.
123
+ pub fn builder < ' ts > ( & ' ts self ) -> ConnectBuilder < ' ts , ' c , C , Ps > {
124
124
ConnectBuilder :: new ( self )
125
125
}
126
126
@@ -189,7 +189,7 @@ macro_rules! impl_signal_connect {
189
189
/// ```
190
190
///
191
191
/// - To connect to a method on the object that owns this signal, use [`connect_self()`][Self::connect_self].
192
- /// - If you need [`connect flags`](ConnectFlags) or cross-thread signals, use [`connect_builder ()`][Self::connect_builder ].
192
+ /// - If you need [`connect flags`](ConnectFlags) or cross-thread signals, use [`builder ()`][Self::builder ].
193
193
pub fn connect<F , R >( & self , mut function: F )
194
194
where
195
195
F : FnMut ( $( $Ps) ,* ) -> R + ' static ,
@@ -204,15 +204,15 @@ macro_rules! impl_signal_connect {
204
204
/// Connect a method (member function) with `&mut self` as the first parameter.
205
205
///
206
206
/// - To connect to methods on other objects, use [`connect_other()`][Self::connect_other].
207
- /// - If you need [`connect flags`](ConnectFlags) or cross-thread signals, use [`connect_builder ()`][Self::connect_builder ].
208
- pub fn connect_self<F , R , Decl >( & self , mut function: F )
207
+ /// - If you need [`connect flags`](ConnectFlags) or cross-thread signals, use [`builder ()`][Self::builder ].
208
+ pub fn connect_self<F , R , Declarer >( & self , mut function: F )
209
209
where
210
210
F : FnMut ( & mut C , $( $Ps) ,* ) -> R + ' static ,
211
- C : GodotDeref < Decl >,
211
+ C : UniformObjectDeref < Declarer >,
212
212
{
213
213
let mut gd = self . receiver_object( ) ;
214
214
let godot_fn = make_godot_fn( move |( $( $args, ) * ) : ( $( $Ps, ) * ) | {
215
- let mut target = C :: get_mut ( & mut gd) ;
215
+ let mut target = C :: object_as_mut ( & mut gd) ;
216
216
let target_mut = target. deref_mut( ) ;
217
217
function( target_mut, $( $args) ,* ) ;
218
218
} ) ;
@@ -231,16 +231,16 @@ macro_rules! impl_signal_connect {
231
231
/// ---
232
232
///
233
233
/// - To connect to methods on the object that owns this signal, use [`connect_self()`][Self::connect_self].
234
- /// - If you need [`connect flags`](ConnectFlags) or cross-thread signals, use [`connect_builder ()`][Self::connect_builder ].
235
- pub fn connect_other<F , R , OtherC , Decl >( & self , object: & impl ToSignalObj <OtherC >, mut method: F )
234
+ /// - If you need [`connect flags`](ConnectFlags) or cross-thread signals, use [`builder ()`][Self::builder ].
235
+ pub fn connect_other<F , R , OtherC , Declarer >( & self , object: & impl ToSignalObj <OtherC >, mut method: F )
236
236
where
237
237
F : FnMut ( & mut OtherC , $( $Ps) ,* ) -> R + ' static ,
238
- OtherC : GodotDeref < Decl >,
238
+ OtherC : UniformObjectDeref < Declarer >,
239
239
{
240
240
let mut gd = object. to_signal_obj( ) ;
241
241
242
242
let godot_fn = make_godot_fn( move |( $( $args, ) * ) : ( $( $Ps, ) * ) | {
243
- let mut target = OtherC :: get_mut ( & mut gd) ;
243
+ let mut target = OtherC :: object_as_mut ( & mut gd) ;
244
244
let target_mut = target. deref_mut( ) ;
245
245
method( target_mut, $( $args) ,* ) ;
246
246
} ) ;
0 commit comments