@@ -118,6 +118,10 @@ pub trait ApplicationImpl:
118118 fn dbus_unregister ( & self , connection : & DBusConnection , object_path : & str ) {
119119 self . parent_dbus_unregister ( connection, object_path)
120120 }
121+
122+ fn name_lost ( & self ) -> bool {
123+ self . parent_name_lost ( )
124+ }
121125}
122126
123127pub trait ApplicationImplExt : ApplicationImpl {
@@ -316,6 +320,21 @@ pub trait ApplicationImplExt: ApplicationImpl {
316320 ) ;
317321 }
318322 }
323+
324+ fn parent_name_lost ( & self ) -> bool {
325+ unsafe {
326+ let data = Self :: type_data ( ) ;
327+ let parent_class = data. as_ref ( ) . parent_class ( ) as * mut ffi:: GApplicationClass ;
328+ let f = ( * parent_class)
329+ . name_lost
330+ . expect ( "No parent class implementation for \" name_lost\" " ) ;
331+ bool:: from_glib ( f ( self
332+ . obj ( )
333+ . unsafe_cast_ref :: < Application > ( )
334+ . to_glib_none ( )
335+ . 0 ) )
336+ }
337+ }
319338}
320339
321340impl < T : ApplicationImpl > ApplicationImplExt for T { }
@@ -338,6 +357,7 @@ unsafe impl<T: ApplicationImpl> IsSubclassable<T> for Application {
338357 klass. handle_local_options = Some ( application_handle_local_options :: < T > ) ;
339358 klass. dbus_register = Some ( application_dbus_register :: < T > ) ;
340359 klass. dbus_unregister = Some ( application_dbus_unregister :: < T > ) ;
360+ klass. name_lost = Some ( application_name_lost :: < T > ) ;
341361 }
342362}
343363
@@ -478,6 +498,14 @@ unsafe extern "C" fn application_dbus_unregister<T: ApplicationImpl>(
478498 ) ;
479499}
480500
501+ unsafe extern "C" fn application_name_lost < T : ApplicationImpl > (
502+ ptr : * mut ffi:: GApplication ,
503+ ) -> glib:: ffi:: gboolean {
504+ let instance = & * ( ptr as * mut T :: Instance ) ;
505+ let imp = instance. imp ( ) ;
506+ imp. name_lost ( ) . into_glib ( )
507+ }
508+
481509#[ cfg( test) ]
482510mod tests {
483511 use super :: * ;
0 commit comments