1 // This file was generated by gir (https://github.com/gtk-rs/gir) 2 // from gir-files (https://github.com/gtk-rs/gir-files) 3 // DO NOT EDIT 4 5 use glib_sys; 6 use gobject_sys; 7 use translate::*; 8 use value::FromValue; 9 use value::FromValueOptional; 10 use value::SetValue; 11 use value::Value; 12 use StaticType; 13 use Type; 14 15 bitflags! { 16 pub struct FileTest: u32 { 17 const IS_REGULAR = 1; 18 const IS_SYMLINK = 2; 19 const IS_DIR = 4; 20 const IS_EXECUTABLE = 8; 21 const EXISTS = 16; 22 } 23 } 24 25 #[doc(hidden)] 26 impl ToGlib for FileTest { 27 type GlibType = glib_sys::GFileTest; 28 to_glib(&self) -> glib_sys::GFileTest29 fn to_glib(&self) -> glib_sys::GFileTest { 30 self.bits() 31 } 32 } 33 34 #[doc(hidden)] 35 impl FromGlib<glib_sys::GFileTest> for FileTest { from_glib(value: glib_sys::GFileTest) -> FileTest36 fn from_glib(value: glib_sys::GFileTest) -> FileTest { 37 FileTest::from_bits_truncate(value) 38 } 39 } 40 41 bitflags! { 42 pub struct FormatSizeFlags: u32 { 43 const DEFAULT = 0; 44 const LONG_FORMAT = 1; 45 const IEC_UNITS = 2; 46 const BITS = 4; 47 } 48 } 49 50 #[doc(hidden)] 51 impl ToGlib for FormatSizeFlags { 52 type GlibType = glib_sys::GFormatSizeFlags; 53 to_glib(&self) -> glib_sys::GFormatSizeFlags54 fn to_glib(&self) -> glib_sys::GFormatSizeFlags { 55 self.bits() 56 } 57 } 58 59 #[doc(hidden)] 60 impl FromGlib<glib_sys::GFormatSizeFlags> for FormatSizeFlags { from_glib(value: glib_sys::GFormatSizeFlags) -> FormatSizeFlags61 fn from_glib(value: glib_sys::GFormatSizeFlags) -> FormatSizeFlags { 62 FormatSizeFlags::from_bits_truncate(value) 63 } 64 } 65 66 bitflags! { 67 pub struct IOCondition: u32 { 68 const IN = 1; 69 const OUT = 4; 70 const PRI = 2; 71 const ERR = 8; 72 const HUP = 16; 73 const NVAL = 32; 74 } 75 } 76 77 #[doc(hidden)] 78 impl ToGlib for IOCondition { 79 type GlibType = glib_sys::GIOCondition; 80 to_glib(&self) -> glib_sys::GIOCondition81 fn to_glib(&self) -> glib_sys::GIOCondition { 82 self.bits() 83 } 84 } 85 86 #[doc(hidden)] 87 impl FromGlib<glib_sys::GIOCondition> for IOCondition { from_glib(value: glib_sys::GIOCondition) -> IOCondition88 fn from_glib(value: glib_sys::GIOCondition) -> IOCondition { 89 IOCondition::from_bits_truncate(value) 90 } 91 } 92 93 impl StaticType for IOCondition { static_type() -> Type94 fn static_type() -> Type { 95 unsafe { from_glib(glib_sys::g_io_condition_get_type()) } 96 } 97 } 98 99 impl<'a> FromValueOptional<'a> for IOCondition { from_value_optional(value: &Value) -> Option<Self>100 unsafe fn from_value_optional(value: &Value) -> Option<Self> { 101 Some(FromValue::from_value(value)) 102 } 103 } 104 105 impl<'a> FromValue<'a> for IOCondition { from_value(value: &Value) -> Self106 unsafe fn from_value(value: &Value) -> Self { 107 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0)) 108 } 109 } 110 111 impl SetValue for IOCondition { set_value(value: &mut Value, this: &Self)112 unsafe fn set_value(value: &mut Value, this: &Self) { 113 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib()) 114 } 115 } 116 117 bitflags! { 118 pub struct KeyFileFlags: u32 { 119 const NONE = 0; 120 const KEEP_COMMENTS = 1; 121 const KEEP_TRANSLATIONS = 2; 122 } 123 } 124 125 #[doc(hidden)] 126 impl ToGlib for KeyFileFlags { 127 type GlibType = glib_sys::GKeyFileFlags; 128 to_glib(&self) -> glib_sys::GKeyFileFlags129 fn to_glib(&self) -> glib_sys::GKeyFileFlags { 130 self.bits() 131 } 132 } 133 134 #[doc(hidden)] 135 impl FromGlib<glib_sys::GKeyFileFlags> for KeyFileFlags { from_glib(value: glib_sys::GKeyFileFlags) -> KeyFileFlags136 fn from_glib(value: glib_sys::GKeyFileFlags) -> KeyFileFlags { 137 KeyFileFlags::from_bits_truncate(value) 138 } 139 } 140 141 bitflags! { 142 pub struct OptionFlags: u32 { 143 const NONE = 0; 144 const HIDDEN = 1; 145 const IN_MAIN = 2; 146 const REVERSE = 4; 147 const NO_ARG = 8; 148 const FILENAME = 16; 149 const OPTIONAL_ARG = 32; 150 const NOALIAS = 64; 151 } 152 } 153 154 #[doc(hidden)] 155 impl ToGlib for OptionFlags { 156 type GlibType = glib_sys::GOptionFlags; 157 to_glib(&self) -> glib_sys::GOptionFlags158 fn to_glib(&self) -> glib_sys::GOptionFlags { 159 self.bits() 160 } 161 } 162 163 #[doc(hidden)] 164 impl FromGlib<glib_sys::GOptionFlags> for OptionFlags { from_glib(value: glib_sys::GOptionFlags) -> OptionFlags165 fn from_glib(value: glib_sys::GOptionFlags) -> OptionFlags { 166 OptionFlags::from_bits_truncate(value) 167 } 168 } 169 170 bitflags! { 171 pub struct SpawnFlags: u32 { 172 const DEFAULT = 0; 173 const LEAVE_DESCRIPTORS_OPEN = 1; 174 const DO_NOT_REAP_CHILD = 2; 175 const SEARCH_PATH = 4; 176 const STDOUT_TO_DEV_NULL = 8; 177 const STDERR_TO_DEV_NULL = 16; 178 const CHILD_INHERITS_STDIN = 32; 179 const FILE_AND_ARGV_ZERO = 64; 180 const SEARCH_PATH_FROM_ENVP = 128; 181 const CLOEXEC_PIPES = 256; 182 } 183 } 184 185 #[doc(hidden)] 186 impl ToGlib for SpawnFlags { 187 type GlibType = glib_sys::GSpawnFlags; 188 to_glib(&self) -> glib_sys::GSpawnFlags189 fn to_glib(&self) -> glib_sys::GSpawnFlags { 190 self.bits() 191 } 192 } 193 194 #[doc(hidden)] 195 impl FromGlib<glib_sys::GSpawnFlags> for SpawnFlags { from_glib(value: glib_sys::GSpawnFlags) -> SpawnFlags196 fn from_glib(value: glib_sys::GSpawnFlags) -> SpawnFlags { 197 SpawnFlags::from_bits_truncate(value) 198 } 199 } 200