Skip to main content

glib/gobject/auto/
flags.rs

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
5use crate::{bitflags::bitflags, ffi, prelude::*, translate::*};
6
7bitflags! {
8    /// Flags to be passed to g_object_bind_property() or
9    /// g_object_bind_property_full().
10    ///
11    /// This enumeration can be extended at later date.
12    // rustdoc-stripper-ignore-next-stop
13    /// Flags to be passed to g_object_bind_property() or
14    /// g_object_bind_property_full().
15    ///
16    /// This enumeration can be extended at later date.
17    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
18    #[doc(alias = "GBindingFlags")]
19    pub struct BindingFlags: u32 {
20        /// The default binding; if the source property
21        ///   changes, the target property is updated with its value.
22        // rustdoc-stripper-ignore-next-stop
23        /// The default binding; if the source property
24        ///   changes, the target property is updated with its value.
25        #[doc(alias = "G_BINDING_DEFAULT")]
26        const DEFAULT = crate::gobject_ffi::G_BINDING_DEFAULT as _;
27        /// Bidirectional binding; if either the
28        ///   property of the source or the property of the target changes,
29        ///   the other is updated.
30        // rustdoc-stripper-ignore-next-stop
31        /// Bidirectional binding; if either the
32        ///   property of the source or the property of the target changes,
33        ///   the other is updated.
34        #[doc(alias = "G_BINDING_BIDIRECTIONAL")]
35        const BIDIRECTIONAL = crate::gobject_ffi::G_BINDING_BIDIRECTIONAL as _;
36        /// Synchronize the values of the source and
37        ///   target properties when creating the binding; the direction of
38        ///   the synchronization is always from the source to the target.
39        // rustdoc-stripper-ignore-next-stop
40        /// Synchronize the values of the source and
41        ///   target properties when creating the binding; the direction of
42        ///   the synchronization is always from the source to the target.
43        #[doc(alias = "G_BINDING_SYNC_CREATE")]
44        const SYNC_CREATE = crate::gobject_ffi::G_BINDING_SYNC_CREATE as _;
45        /// If the two properties being bound are
46        ///   booleans, setting one to [`true`] will result in the other being
47        ///   set to [`false`] and vice versa. This flag will only work for
48        ///   boolean properties, and cannot be used when passing custom
49        ///   transformation functions to g_object_bind_property_full().
50        // rustdoc-stripper-ignore-next-stop
51        /// If the two properties being bound are
52        ///   booleans, setting one to [`true`] will result in the other being
53        ///   set to [`false`] and vice versa. This flag will only work for
54        ///   boolean properties, and cannot be used when passing custom
55        ///   transformation functions to g_object_bind_property_full().
56        #[doc(alias = "G_BINDING_INVERT_BOOLEAN")]
57        const INVERT_BOOLEAN = crate::gobject_ffi::G_BINDING_INVERT_BOOLEAN as _;
58    }
59}
60
61#[doc(hidden)]
62impl IntoGlib for BindingFlags {
63    type GlibType = crate::gobject_ffi::GBindingFlags;
64
65    #[inline]
66    fn into_glib(self) -> crate::gobject_ffi::GBindingFlags {
67        self.bits()
68    }
69}
70
71#[doc(hidden)]
72impl FromGlib<crate::gobject_ffi::GBindingFlags> for BindingFlags {
73    #[inline]
74    unsafe fn from_glib(value: crate::gobject_ffi::GBindingFlags) -> Self {
75        Self::from_bits_truncate(value)
76    }
77}
78
79impl StaticType for BindingFlags {
80    #[inline]
81    #[doc(alias = "g_binding_flags_get_type")]
82    fn static_type() -> crate::Type {
83        unsafe { from_glib(crate::gobject_ffi::g_binding_flags_get_type()) }
84    }
85}
86
87impl crate::HasParamSpec for BindingFlags {
88    type ParamSpec = crate::ParamSpecFlags;
89    type SetValue = Self;
90    type BuilderFn = fn(&str) -> crate::ParamSpecFlagsBuilder<Self>;
91
92    fn param_spec_builder() -> Self::BuilderFn {
93        Self::ParamSpec::builder
94    }
95}
96
97impl crate::value::ValueType for BindingFlags {
98    type Type = Self;
99}
100
101unsafe impl<'a> crate::value::FromValue<'a> for BindingFlags {
102    type Checker = crate::value::GenericValueTypeChecker<Self>;
103
104    #[inline]
105    unsafe fn from_value(value: &'a crate::Value) -> Self {
106        unsafe {
107            from_glib(crate::gobject_ffi::g_value_get_flags(
108                value.to_glib_none().0,
109            ))
110        }
111    }
112}
113
114impl ToValue for BindingFlags {
115    #[inline]
116    fn to_value(&self) -> crate::Value {
117        let mut value = crate::Value::for_value_type::<Self>();
118        unsafe {
119            crate::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
120        }
121        value
122    }
123
124    #[inline]
125    fn value_type(&self) -> crate::Type {
126        Self::static_type()
127    }
128}
129
130impl From<BindingFlags> for crate::Value {
131    #[inline]
132    fn from(v: BindingFlags) -> Self {
133        ToValue::to_value(&v)
134    }
135}
136
137bitflags! {
138    /// The signal flags are used to specify a signal's behaviour.
139    // rustdoc-stripper-ignore-next-stop
140    /// The signal flags are used to specify a signal's behaviour.
141    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
142    #[doc(alias = "GSignalFlags")]
143    pub struct SignalFlags: u32 {
144        /// Invoke the object method handler in the first emission stage.
145        // rustdoc-stripper-ignore-next-stop
146        /// Invoke the object method handler in the first emission stage.
147        #[doc(alias = "G_SIGNAL_RUN_FIRST")]
148        const RUN_FIRST = crate::gobject_ffi::G_SIGNAL_RUN_FIRST as _;
149        /// Invoke the object method handler in the third emission stage.
150        // rustdoc-stripper-ignore-next-stop
151        /// Invoke the object method handler in the third emission stage.
152        #[doc(alias = "G_SIGNAL_RUN_LAST")]
153        const RUN_LAST = crate::gobject_ffi::G_SIGNAL_RUN_LAST as _;
154        /// Invoke the object method handler in the last emission stage.
155        // rustdoc-stripper-ignore-next-stop
156        /// Invoke the object method handler in the last emission stage.
157        #[doc(alias = "G_SIGNAL_RUN_CLEANUP")]
158        const RUN_CLEANUP = crate::gobject_ffi::G_SIGNAL_RUN_CLEANUP as _;
159        /// Signals being emitted for an object while currently being in
160        ///  emission for this very object will not be emitted recursively,
161        ///  but instead cause the first emission to be restarted.
162        // rustdoc-stripper-ignore-next-stop
163        /// Signals being emitted for an object while currently being in
164        ///  emission for this very object will not be emitted recursively,
165        ///  but instead cause the first emission to be restarted.
166        #[doc(alias = "G_SIGNAL_NO_RECURSE")]
167        const NO_RECURSE = crate::gobject_ffi::G_SIGNAL_NO_RECURSE as _;
168        /// This signal supports "::detail" appendices to the signal name
169        ///  upon handler connections and emissions.
170        // rustdoc-stripper-ignore-next-stop
171        /// This signal supports "::detail" appendices to the signal name
172        ///  upon handler connections and emissions.
173        #[doc(alias = "G_SIGNAL_DETAILED")]
174        const DETAILED = crate::gobject_ffi::G_SIGNAL_DETAILED as _;
175        /// Action signals are signals that may freely be emitted on alive
176        ///  objects from user code via g_signal_emit() and friends, without
177        ///  the need of being embedded into extra code that performs pre or
178        ///  post emission adjustments on the object. They can also be thought
179        ///  of as object methods which can be called generically by
180        ///  third-party code.
181        // rustdoc-stripper-ignore-next-stop
182        /// Action signals are signals that may freely be emitted on alive
183        ///  objects from user code via g_signal_emit() and friends, without
184        ///  the need of being embedded into extra code that performs pre or
185        ///  post emission adjustments on the object. They can also be thought
186        ///  of as object methods which can be called generically by
187        ///  third-party code.
188        #[doc(alias = "G_SIGNAL_ACTION")]
189        const ACTION = crate::gobject_ffi::G_SIGNAL_ACTION as _;
190        /// No emissions hooks are supported for this signal.
191        // rustdoc-stripper-ignore-next-stop
192        /// No emissions hooks are supported for this signal.
193        #[doc(alias = "G_SIGNAL_NO_HOOKS")]
194        const NO_HOOKS = crate::gobject_ffi::G_SIGNAL_NO_HOOKS as _;
195        /// Varargs signal emission will always collect the arguments, even if there
196        /// are no signal handlers connected.
197        // rustdoc-stripper-ignore-next-stop
198        /// Varargs signal emission will always collect the arguments, even if there
199        /// are no signal handlers connected.
200        #[doc(alias = "G_SIGNAL_MUST_COLLECT")]
201        const MUST_COLLECT = crate::gobject_ffi::G_SIGNAL_MUST_COLLECT as _;
202        /// The signal is deprecated and will be removed in a future version.
203        ///
204        /// A warning will be generated if it is connected while running with
205        /// `G_ENABLE_DIAGNOSTIC=1`.
206        // rustdoc-stripper-ignore-next-stop
207        /// The signal is deprecated and will be removed in a future version.
208        ///
209        /// A warning will be generated if it is connected while running with
210        /// `G_ENABLE_DIAGNOSTIC=1`.
211        #[doc(alias = "G_SIGNAL_DEPRECATED")]
212        const DEPRECATED = crate::gobject_ffi::G_SIGNAL_DEPRECATED as _;
213        /// The signal accumulator was invoked for the first time.
214        ///
215        /// This flag is only used in `callback::GObject::SignalAccumulator[accumulator functions]
216        /// for the `run_type` field of the `GObject::SignalInvocationHint`, to
217        /// mark the first call to the accumulator function for a signal emission.
218        // rustdoc-stripper-ignore-next-stop
219        /// The signal accumulator was invoked for the first time.
220        ///
221        /// This flag is only used in `callback::GObject::SignalAccumulator[accumulator functions]
222        /// for the `run_type` field of the `GObject::SignalInvocationHint`, to
223        /// mark the first call to the accumulator function for a signal emission.
224        #[cfg(feature = "v2_68")]
225        #[cfg_attr(docsrs, doc(cfg(feature = "v2_68")))]
226        #[doc(alias = "G_SIGNAL_ACCUMULATOR_FIRST_RUN")]
227        const ACCUMULATOR_FIRST_RUN = crate::gobject_ffi::G_SIGNAL_ACCUMULATOR_FIRST_RUN as _;
228    }
229}
230
231#[doc(hidden)]
232impl IntoGlib for SignalFlags {
233    type GlibType = crate::gobject_ffi::GSignalFlags;
234
235    #[inline]
236    fn into_glib(self) -> crate::gobject_ffi::GSignalFlags {
237        self.bits()
238    }
239}
240
241#[doc(hidden)]
242impl FromGlib<crate::gobject_ffi::GSignalFlags> for SignalFlags {
243    #[inline]
244    unsafe fn from_glib(value: crate::gobject_ffi::GSignalFlags) -> Self {
245        Self::from_bits_truncate(value)
246    }
247}
248
249bitflags! {
250    /// Bit masks used to check or determine characteristics of a type.
251    // rustdoc-stripper-ignore-next-stop
252    /// Bit masks used to check or determine characteristics of a type.
253    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
254    #[doc(alias = "GTypeFlags")]
255    pub struct TypeFlags: u32 {
256        /// No special flags. Since: 2.74
257        // rustdoc-stripper-ignore-next-stop
258        /// No special flags. Since: 2.74
259        #[doc(alias = "G_TYPE_FLAG_NONE")]
260        const NONE = crate::gobject_ffi::G_TYPE_FLAG_NONE as _;
261        /// Indicates an abstract type. No instances can be
262        ///  created for an abstract type
263        // rustdoc-stripper-ignore-next-stop
264        /// Indicates an abstract type. No instances can be
265        ///  created for an abstract type
266        #[doc(alias = "G_TYPE_FLAG_ABSTRACT")]
267        const ABSTRACT = crate::gobject_ffi::G_TYPE_FLAG_ABSTRACT as _;
268        /// Indicates an abstract value type, i.e. a type
269        ///  that introduces a value table, but can't be used for
270        ///  g_value_init()
271        // rustdoc-stripper-ignore-next-stop
272        /// Indicates an abstract value type, i.e. a type
273        ///  that introduces a value table, but can't be used for
274        ///  g_value_init()
275        #[doc(alias = "G_TYPE_FLAG_VALUE_ABSTRACT")]
276        const VALUE_ABSTRACT = crate::gobject_ffi::G_TYPE_FLAG_VALUE_ABSTRACT as _;
277        /// Indicates a final type. A final type is a non-derivable
278        ///  leaf node in a deep derivable type hierarchy tree. Since: 2.70
279        // rustdoc-stripper-ignore-next-stop
280        /// Indicates a final type. A final type is a non-derivable
281        ///  leaf node in a deep derivable type hierarchy tree. Since: 2.70
282        #[doc(alias = "G_TYPE_FLAG_FINAL")]
283        const FINAL = crate::gobject_ffi::G_TYPE_FLAG_FINAL as _;
284        /// The type is deprecated and may be removed in a
285        ///  future version. A warning will be emitted if it is instantiated while
286        ///  running with `G_ENABLE_DIAGNOSTIC=1`. Since 2.76
287        // rustdoc-stripper-ignore-next-stop
288        /// The type is deprecated and may be removed in a
289        ///  future version. A warning will be emitted if it is instantiated while
290        ///  running with `G_ENABLE_DIAGNOSTIC=1`. Since 2.76
291        #[doc(alias = "G_TYPE_FLAG_DEPRECATED")]
292        const DEPRECATED = crate::gobject_ffi::G_TYPE_FLAG_DEPRECATED as _;
293    }
294}
295
296#[doc(hidden)]
297impl IntoGlib for TypeFlags {
298    type GlibType = crate::gobject_ffi::GTypeFlags;
299
300    #[inline]
301    fn into_glib(self) -> crate::gobject_ffi::GTypeFlags {
302        self.bits()
303    }
304}
305
306#[doc(hidden)]
307impl FromGlib<crate::gobject_ffi::GTypeFlags> for TypeFlags {
308    #[inline]
309    unsafe fn from_glib(value: crate::gobject_ffi::GTypeFlags) -> Self {
310        Self::from_bits_truncate(value)
311    }
312}