alsatimer/auto/
flags.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from
3// from gir-files (https://github.com/gtk-rs/gir-files)
4// DO NOT EDIT
5
6use crate::ffi;
7use glib::{bitflags::bitflags, prelude::*, translate::*};
8
9bitflags! {
10    /// A set of flags for the information of timer device.
11    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
12    #[doc(alias = "ALSATimerDeviceInfoFlag")]
13    pub struct DeviceInfoFlag: u32 {
14        /// The timer device is slave to any timer device.
15        #[doc(alias = "ALSATIMER_DEVICE_INFO_FLAG_SLAVE")]
16        const SLAVE = ffi::ALSATIMER_DEVICE_INFO_FLAG_SLAVE as _;
17    }
18}
19
20#[doc(hidden)]
21impl IntoGlib for DeviceInfoFlag {
22    type GlibType = ffi::ALSATimerDeviceInfoFlag;
23
24    #[inline]
25    fn into_glib(self) -> ffi::ALSATimerDeviceInfoFlag {
26        self.bits()
27    }
28}
29
30#[doc(hidden)]
31impl FromGlib<ffi::ALSATimerDeviceInfoFlag> for DeviceInfoFlag {
32    #[inline]
33    unsafe fn from_glib(value: ffi::ALSATimerDeviceInfoFlag) -> Self {
34        Self::from_bits_truncate(value)
35    }
36}
37
38impl StaticType for DeviceInfoFlag {
39    #[inline]
40    #[doc(alias = "alsatimer_device_info_flag_get_type")]
41    fn static_type() -> glib::Type {
42        unsafe { from_glib(ffi::alsatimer_device_info_flag_get_type()) }
43    }
44}
45
46impl glib::HasParamSpec for DeviceInfoFlag {
47    type ParamSpec = glib::ParamSpecFlags;
48    type SetValue = Self;
49    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
50
51    fn param_spec_builder() -> Self::BuilderFn {
52        Self::ParamSpec::builder
53    }
54}
55
56impl glib::value::ValueType for DeviceInfoFlag {
57    type Type = Self;
58}
59
60unsafe impl<'a> glib::value::FromValue<'a> for DeviceInfoFlag {
61    type Checker = glib::value::GenericValueTypeChecker<Self>;
62
63    #[inline]
64    unsafe fn from_value(value: &'a glib::Value) -> Self {
65        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
66    }
67}
68
69impl ToValue for DeviceInfoFlag {
70    #[inline]
71    fn to_value(&self) -> glib::Value {
72        let mut value = glib::Value::for_value_type::<Self>();
73        unsafe {
74            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
75        }
76        value
77    }
78
79    #[inline]
80    fn value_type(&self) -> glib::Type {
81        Self::static_type()
82    }
83}
84
85impl From<DeviceInfoFlag> for glib::Value {
86    #[inline]
87    fn from(v: DeviceInfoFlag) -> Self {
88        ToValue::to_value(&v)
89    }
90}
91
92bitflags! {
93    /// A set of flags for the parameters of user client.
94    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
95    #[doc(alias = "ALSATimerInstanceParamFlag")]
96    pub struct InstanceParamFlag: u32 {
97        /// The instance receives any events after configured.
98        #[doc(alias = "ALSATIMER_INSTANCE_PARAM_FLAG_AUTO")]
99        const AUTO = ffi::ALSATIMER_INSTANCE_PARAM_FLAG_AUTO as _;
100        /// The instance occupies the attached timer device.
101        #[doc(alias = "ALSATIMER_INSTANCE_PARAM_FLAG_EXCLUSIVE")]
102        const EXCLUSIVE = ffi::ALSATIMER_INSTANCE_PARAM_FLAG_EXCLUSIVE as _;
103        /// The instance receives early event after configured even if not started.
104        #[doc(alias = "ALSATIMER_INSTANCE_PARAM_FLAG_EARLY_EVENT")]
105        const EARLY_EVENT = ffi::ALSATIMER_INSTANCE_PARAM_FLAG_EARLY_EVENT as _;
106    }
107}
108
109#[doc(hidden)]
110impl IntoGlib for InstanceParamFlag {
111    type GlibType = ffi::ALSATimerInstanceParamFlag;
112
113    #[inline]
114    fn into_glib(self) -> ffi::ALSATimerInstanceParamFlag {
115        self.bits()
116    }
117}
118
119#[doc(hidden)]
120impl FromGlib<ffi::ALSATimerInstanceParamFlag> for InstanceParamFlag {
121    #[inline]
122    unsafe fn from_glib(value: ffi::ALSATimerInstanceParamFlag) -> Self {
123        Self::from_bits_truncate(value)
124    }
125}
126
127impl StaticType for InstanceParamFlag {
128    #[inline]
129    #[doc(alias = "alsatimer_instance_param_flag_get_type")]
130    fn static_type() -> glib::Type {
131        unsafe { from_glib(ffi::alsatimer_instance_param_flag_get_type()) }
132    }
133}
134
135impl glib::HasParamSpec for InstanceParamFlag {
136    type ParamSpec = glib::ParamSpecFlags;
137    type SetValue = Self;
138    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
139
140    fn param_spec_builder() -> Self::BuilderFn {
141        Self::ParamSpec::builder
142    }
143}
144
145impl glib::value::ValueType for InstanceParamFlag {
146    type Type = Self;
147}
148
149unsafe impl<'a> glib::value::FromValue<'a> for InstanceParamFlag {
150    type Checker = glib::value::GenericValueTypeChecker<Self>;
151
152    #[inline]
153    unsafe fn from_value(value: &'a glib::Value) -> Self {
154        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
155    }
156}
157
158impl ToValue for InstanceParamFlag {
159    #[inline]
160    fn to_value(&self) -> glib::Value {
161        let mut value = glib::Value::for_value_type::<Self>();
162        unsafe {
163            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
164        }
165        value
166    }
167
168    #[inline]
169    fn value_type(&self) -> glib::Type {
170        Self::static_type()
171    }
172}
173
174impl From<InstanceParamFlag> for glib::Value {
175    #[inline]
176    fn from(v: InstanceParamFlag) -> Self {
177        ToValue::to_value(&v)
178    }
179}