// 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::translate::*; use glib::GString; use glib::StaticType; use glib::ToValue; use light_dm_sys; use std::fmt; glib_wrapper! { pub struct Layout(Object); match fn { get_type => || light_dm_sys::lightdm_layout_get_type(), } } #[derive(Clone, Default)] pub struct LayoutBuilder { description: Option, name: Option, short_description: Option, } impl LayoutBuilder { pub fn new() -> Self { Self::default() } pub fn build(self) -> Layout { let mut properties: Vec<(&str, &dyn ToValue)> = vec![]; if let Some(ref description) = self.description { properties.push(("description", description)); } if let Some(ref name) = self.name { properties.push(("name", name)); } if let Some(ref short_description) = self.short_description { properties.push(("short-description", short_description)); } glib::Object::new(Layout::static_type(), &properties) .expect("object new") .downcast() .expect("downcast") } pub fn description(mut self, description: &str) -> Self { self.description = Some(description.to_string()); self } pub fn name(mut self, name: &str) -> Self { self.name = Some(name.to_string()); self } pub fn short_description(mut self, short_description: &str) -> Self { self.short_description = Some(short_description.to_string()); self } } pub const NONE_LAYOUT: Option<&Layout> = None; pub trait LayoutExt: 'static { fn get_description(&self) -> Option; fn get_name(&self) -> Option; fn get_short_description(&self) -> Option; } impl> LayoutExt for O { fn get_description(&self) -> Option { unsafe { from_glib_none(light_dm_sys::lightdm_layout_get_description( self.as_ref().to_glib_none().0, )) } } fn get_name(&self) -> Option { unsafe { from_glib_none(light_dm_sys::lightdm_layout_get_name( self.as_ref().to_glib_none().0, )) } } fn get_short_description(&self) -> Option { unsafe { from_glib_none(light_dm_sys::lightdm_layout_get_short_description( self.as_ref().to_glib_none().0, )) } } } impl fmt::Display for Layout { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "Layout") } }