@@ -34,7 +34,7 @@ macro_rules! glib_object_impl {
34
34
/// Trait for implementors of `glib::Object` subclasses.
35
35
///
36
36
/// This allows overriding the virtual methods of `glib::Object`.
37
- pub trait ObjectImpl : ' static {
37
+ pub trait ObjectImpl : ObjectImplExt + ' static {
38
38
/// Storage for the type-specific data used during registration.
39
39
///
40
40
/// This is usually generated by the [`glib_object_impl!`] macro.
@@ -66,20 +66,6 @@ pub trait ObjectImpl: 'static {
66
66
fn constructed ( & self , obj : & Object ) {
67
67
self . parent_constructed ( obj) ;
68
68
}
69
-
70
- /// Chain up to the parent class' implementation of `glib::Object::constructed()`.
71
- ///
72
- /// Do not override this, it has no effect.
73
- fn parent_constructed ( & self , obj : & Object ) {
74
- unsafe {
75
- let data = self . get_type_data ( ) ;
76
- let parent_class = data. as_ref ( ) . get_parent_class ( ) as * mut gobject_ffi:: GObjectClass ;
77
-
78
- if let Some ( ref func) = ( * parent_class) . constructed {
79
- func ( obj. to_glib_none ( ) . 0 ) ;
80
- }
81
- }
82
- }
83
69
}
84
70
85
71
unsafe extern "C" fn get_property < T : ObjectSubclass > (
@@ -320,7 +306,29 @@ unsafe impl<T: ObjectSubclass> IsSubclassable<T> for ObjectClass {
320
306
}
321
307
}
322
308
323
- pub trait ObjectImplExt : ObjectImpl + ObjectSubclass {
309
+ pub trait ObjectImplExt {
310
+ /// Chain up to the parent class' implementation of `glib::Object::constructed()`.
311
+ fn parent_constructed ( & self , obj : & Object ) ;
312
+
313
+ fn signal_chain_from_overridden (
314
+ & self ,
315
+ token : & super :: SignalClassHandlerToken ,
316
+ values : & [ Value ] ,
317
+ ) -> Option < Value > ;
318
+ }
319
+
320
+ impl < T : ObjectImpl + ObjectSubclass > ObjectImplExt for T {
321
+ fn parent_constructed ( & self , obj : & Object ) {
322
+ unsafe {
323
+ let data = self . get_type_data ( ) ;
324
+ let parent_class = data. as_ref ( ) . get_parent_class ( ) as * mut gobject_ffi:: GObjectClass ;
325
+
326
+ if let Some ( ref func) = ( * parent_class) . constructed {
327
+ func ( obj. to_glib_none ( ) . 0 ) ;
328
+ }
329
+ }
330
+ }
331
+
324
332
fn signal_chain_from_overridden (
325
333
& self ,
326
334
token : & super :: SignalClassHandlerToken ,
@@ -336,8 +344,6 @@ pub trait ObjectImplExt: ObjectImpl + ObjectSubclass {
336
344
}
337
345
}
338
346
339
- impl < T : ObjectImpl + ObjectSubclass > ObjectImplExt for T { }
340
-
341
347
#[ cfg( test) ]
342
348
mod test {
343
349
use super :: super :: super :: object:: ObjectExt ;
0 commit comments