// This file was generated by gir (https://github.com/gtk-rs/gir) // from gir-files (https://github.com/gtk-rs/gir-files) // DO NOT EDIT use glib::object::Cast; use glib::object::IsA; use glib::signal::connect_raw; use glib::signal::SignalHandlerId; use glib::translate::*; use glib::GString; use glib_sys; use light_dm_sys; use std::boxed::Box as Box_; use std::fmt; use std::mem::transmute; glib_wrapper! { pub struct User(Object); match fn { get_type => || light_dm_sys::lightdm_user_get_type(), } } pub const NONE_USER: Option<&User> = None; pub trait UserExt: 'static { fn get_background(&self) -> Option; fn get_display_name(&self) -> Option; fn get_has_messages(&self) -> bool; fn get_home_directory(&self) -> Option; fn get_image(&self) -> Option; fn get_is_locked(&self) -> bool; fn get_language(&self) -> Option; fn get_layout(&self) -> Option; fn get_layouts(&self) -> Vec; fn get_logged_in(&self) -> bool; fn get_name(&self) -> Option; fn get_real_name(&self) -> Option; fn get_session(&self) -> Option; fn get_uid(&self) -> u32; fn connect_changed(&self, f: F) -> SignalHandlerId; fn connect_property_background_notify(&self, f: F) -> SignalHandlerId; fn connect_property_display_name_notify(&self, f: F) -> SignalHandlerId; fn connect_property_has_messages_notify(&self, f: F) -> SignalHandlerId; fn connect_property_home_directory_notify( &self, f: F, ) -> SignalHandlerId; fn connect_property_image_notify(&self, f: F) -> SignalHandlerId; fn connect_property_is_locked_notify(&self, f: F) -> SignalHandlerId; fn connect_property_language_notify(&self, f: F) -> SignalHandlerId; fn connect_property_layout_notify(&self, f: F) -> SignalHandlerId; fn connect_property_layouts_notify(&self, f: F) -> SignalHandlerId; fn connect_property_logged_in_notify(&self, f: F) -> SignalHandlerId; fn connect_property_name_notify(&self, f: F) -> SignalHandlerId; fn connect_property_real_name_notify(&self, f: F) -> SignalHandlerId; fn connect_property_session_notify(&self, f: F) -> SignalHandlerId; fn connect_property_uid_notify(&self, f: F) -> SignalHandlerId; } impl> UserExt for O { fn get_background(&self) -> Option { unsafe { from_glib_none(light_dm_sys::lightdm_user_get_background( self.as_ref().to_glib_none().0, )) } } fn get_display_name(&self) -> Option { unsafe { from_glib_none(light_dm_sys::lightdm_user_get_display_name( self.as_ref().to_glib_none().0, )) } } fn get_has_messages(&self) -> bool { unsafe { from_glib(light_dm_sys::lightdm_user_get_has_messages( self.as_ref().to_glib_none().0, )) } } fn get_home_directory(&self) -> Option { unsafe { from_glib_none(light_dm_sys::lightdm_user_get_home_directory( self.as_ref().to_glib_none().0, )) } } fn get_image(&self) -> Option { unsafe { from_glib_none(light_dm_sys::lightdm_user_get_image( self.as_ref().to_glib_none().0, )) } } fn get_is_locked(&self) -> bool { unsafe { from_glib(light_dm_sys::lightdm_user_get_is_locked( self.as_ref().to_glib_none().0, )) } } fn get_language(&self) -> Option { unsafe { from_glib_none(light_dm_sys::lightdm_user_get_language( self.as_ref().to_glib_none().0, )) } } fn get_layout(&self) -> Option { unsafe { from_glib_none(light_dm_sys::lightdm_user_get_layout( self.as_ref().to_glib_none().0, )) } } fn get_layouts(&self) -> Vec { unsafe { FromGlibPtrContainer::from_glib_none(light_dm_sys::lightdm_user_get_layouts( self.as_ref().to_glib_none().0, )) } } fn get_logged_in(&self) -> bool { unsafe { from_glib(light_dm_sys::lightdm_user_get_logged_in( self.as_ref().to_glib_none().0, )) } } fn get_name(&self) -> Option { unsafe { from_glib_none(light_dm_sys::lightdm_user_get_name( self.as_ref().to_glib_none().0, )) } } fn get_real_name(&self) -> Option { unsafe { from_glib_none(light_dm_sys::lightdm_user_get_real_name( self.as_ref().to_glib_none().0, )) } } fn get_session(&self) -> Option { unsafe { from_glib_none(light_dm_sys::lightdm_user_get_session( self.as_ref().to_glib_none().0, )) } } fn get_uid(&self) -> u32 { unsafe { light_dm_sys::lightdm_user_get_uid(self.as_ref().to_glib_none().0) } } fn connect_changed(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn changed_trampoline( this: *mut light_dm_sys::LightDMUser, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&User::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"changed\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( changed_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_property_background_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_background_trampoline( this: *mut light_dm_sys::LightDMUser, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&User::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::background\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_background_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_property_display_name_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_display_name_trampoline( this: *mut light_dm_sys::LightDMUser, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&User::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::display-name\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_display_name_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_property_has_messages_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_has_messages_trampoline( this: *mut light_dm_sys::LightDMUser, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&User::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::has-messages\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_has_messages_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_property_home_directory_notify( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_home_directory_trampoline( this: *mut light_dm_sys::LightDMUser, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&User::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::home-directory\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_home_directory_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_property_image_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_image_trampoline( this: *mut light_dm_sys::LightDMUser, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&User::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::image\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_image_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_property_is_locked_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_is_locked_trampoline( this: *mut light_dm_sys::LightDMUser, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&User::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::is-locked\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_is_locked_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_property_language_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_language_trampoline( this: *mut light_dm_sys::LightDMUser, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&User::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::language\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_language_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_property_layout_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_layout_trampoline( this: *mut light_dm_sys::LightDMUser, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&User::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::layout\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_layout_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_property_layouts_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_layouts_trampoline( this: *mut light_dm_sys::LightDMUser, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&User::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::layouts\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_layouts_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_property_logged_in_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_logged_in_trampoline( this: *mut light_dm_sys::LightDMUser, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&User::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::logged-in\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_logged_in_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_property_name_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_name_trampoline( this: *mut light_dm_sys::LightDMUser, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&User::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::name\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_name_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_property_real_name_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_real_name_trampoline( this: *mut light_dm_sys::LightDMUser, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&User::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::real-name\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_real_name_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_property_session_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_session_trampoline( this: *mut light_dm_sys::LightDMUser, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&User::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::session\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_session_trampoline:: as *const (), )), Box_::into_raw(f), ) } } fn connect_property_uid_notify(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_uid_trampoline( this: *mut light_dm_sys::LightDMUser, _param_spec: glib_sys::gpointer, f: glib_sys::gpointer, ) where P: IsA, { let f: &F = &*(f as *const F); f(&User::from_glib_borrow(this).unsafe_cast_ref()) } unsafe { let f: Box_ = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::uid\0".as_ptr() as *const _, Some(transmute::<_, unsafe extern "C" fn()>( notify_uid_trampoline:: as *const (), )), Box_::into_raw(f), ) } } } impl fmt::Display for User { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "User") } }