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
45use crate::{bitflags::bitflags, ffi, prelude::*, translate::*};
67bitflags! {
8/// Flags to be passed to [`ObjectExt::bind_property()`][crate::prelude::ObjectExt::bind_property()] or
9 /// [`ObjectExt::bind_property_full()`][crate::prelude::ObjectExt::bind_property_full()].
10 ///
11 /// This enumeration can be extended at later date.
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
13 #[doc(alias = "GBindingFlags")]
14pub struct BindingFlags: u32 {
15/// The default binding; if the source property
16 /// changes, the target property is updated with its value.
17#[doc(alias = "G_BINDING_DEFAULT")]
18const DEFAULT = crate::gobject_ffi::G_BINDING_DEFAULT as _;
19/// Bidirectional binding; if either the
20 /// property of the source or the property of the target changes,
21 /// the other is updated.
22#[doc(alias = "G_BINDING_BIDIRECTIONAL")]
23const BIDIRECTIONAL = crate::gobject_ffi::G_BINDING_BIDIRECTIONAL as _;
24/// Synchronize the values of the source and
25 /// target properties when creating the binding; the direction of
26 /// the synchronization is always from the source to the target.
27#[doc(alias = "G_BINDING_SYNC_CREATE")]
28const SYNC_CREATE = crate::gobject_ffi::G_BINDING_SYNC_CREATE as _;
29/// If the two properties being bound are
30 /// booleans, setting one to [`true`] will result in the other being
31 /// set to [`false`] and vice versa. This flag will only work for
32 /// boolean properties, and cannot be used when passing custom
33 /// transformation functions to [`ObjectExt::bind_property_full()`][crate::prelude::ObjectExt::bind_property_full()].
34#[doc(alias = "G_BINDING_INVERT_BOOLEAN")]
35const INVERT_BOOLEAN = crate::gobject_ffi::G_BINDING_INVERT_BOOLEAN as _;
36 }
37}
3839#[doc(hidden)]
40impl IntoGlibfor BindingFlags {
41type GlibType = crate::gobject_ffi::GBindingFlags;
4243#[inline]
44fn into_glib(self) -> crate::gobject_ffi::GBindingFlags {
45self.bits()
46 }
47}
4849#[doc(hidden)]
50impl FromGlib<crate::gobject_ffi::GBindingFlags> for BindingFlags {
51#[inline]
52unsafe fn from_glib(value: crate::gobject_ffi::GBindingFlags) -> Self {
53Self::from_bits_truncate(value)
54 }
55}
5657impl StaticTypefor BindingFlags {
58#[inline]
59 #[doc(alias = "g_binding_flags_get_type")]
60fn static_type() -> crate::Type {
61unsafe { from_glib(crate::gobject_ffi::g_binding_flags_get_type()) }
62 }
63}
6465impl crate::HasParamSpecfor BindingFlags {
66type ParamSpec = crate::ParamSpecFlags;
67type SetValue = Self;
68type BuilderFn = fn(&str) -> crate::ParamSpecFlagsBuilder<Self>;
6970fn param_spec_builder() -> Self::BuilderFn {
71Self::ParamSpec::builder
72 }
73}
7475impl crate::value::ValueTypefor BindingFlags {
76type Type = Self;
77}
7879unsafe impl<'a> crate::value::FromValue<'a> for BindingFlags {
80type Checker = crate::value::GenericValueTypeChecker<Self>;
8182#[inline]
83unsafe fn from_value(value: &'a crate::Value) -> Self {
84from_glib(crate::gobject_ffi::g_value_get_flags(
85value.to_glib_none().0,
86 ))
87 }
88}
8990impl ToValuefor BindingFlags {
91#[inline]
92fn to_value(&self) -> crate::Value {
93let mut value = crate::Value::for_value_type::<Self>();
94unsafe {
95crate::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
96 }
97value98 }
99100#[inline]
101fn value_type(&self) -> crate::Type {
102Self::static_type()
103 }
104}
105106impl From<BindingFlags> for crate::Value {
107#[inline]
108fn from(v: BindingFlags) -> Self {
109ToValue::to_value(&v)
110 }
111}
112113bitflags! {
114/// The signal flags are used to specify a signal's behaviour.
115#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
116 #[doc(alias = "GSignalFlags")]
117pub struct SignalFlags: u32 {
118/// Invoke the object method handler in the first emission stage.
119#[doc(alias = "G_SIGNAL_RUN_FIRST")]
120const RUN_FIRST = crate::gobject_ffi::G_SIGNAL_RUN_FIRST as _;
121/// Invoke the object method handler in the third emission stage.
122#[doc(alias = "G_SIGNAL_RUN_LAST")]
123const RUN_LAST = crate::gobject_ffi::G_SIGNAL_RUN_LAST as _;
124/// Invoke the object method handler in the last emission stage.
125#[doc(alias = "G_SIGNAL_RUN_CLEANUP")]
126const RUN_CLEANUP = crate::gobject_ffi::G_SIGNAL_RUN_CLEANUP as _;
127/// Signals being emitted for an object while currently being in
128 /// emission for this very object will not be emitted recursively,
129 /// but instead cause the first emission to be restarted.
130#[doc(alias = "G_SIGNAL_NO_RECURSE")]
131const NO_RECURSE = crate::gobject_ffi::G_SIGNAL_NO_RECURSE as _;
132/// This signal supports "::detail" appendices to the signal name
133 /// upon handler connections and emissions.
134#[doc(alias = "G_SIGNAL_DETAILED")]
135const DETAILED = crate::gobject_ffi::G_SIGNAL_DETAILED as _;
136/// Action signals are signals that may freely be emitted on alive
137 /// objects from user code via `g_signal_emit()` and friends, without
138 /// the need of being embedded into extra code that performs pre or
139 /// post emission adjustments on the object. They can also be thought
140 /// of as object methods which can be called generically by
141 /// third-party code.
142#[doc(alias = "G_SIGNAL_ACTION")]
143const ACTION = crate::gobject_ffi::G_SIGNAL_ACTION as _;
144/// No emissions hooks are supported for this signal.
145#[doc(alias = "G_SIGNAL_NO_HOOKS")]
146const NO_HOOKS = crate::gobject_ffi::G_SIGNAL_NO_HOOKS as _;
147/// Varargs signal emission will always collect the arguments, even if there
148 /// are no signal handlers connected.
149#[doc(alias = "G_SIGNAL_MUST_COLLECT")]
150const MUST_COLLECT = crate::gobject_ffi::G_SIGNAL_MUST_COLLECT as _;
151/// The signal is deprecated and will be removed in a future version.
152 ///
153 /// A warning will be generated if it is connected while running with
154 /// `G_ENABLE_DIAGNOSTIC=1`.
155#[doc(alias = "G_SIGNAL_DEPRECATED")]
156const DEPRECATED = crate::gobject_ffi::G_SIGNAL_DEPRECATED as _;
157/// The signal accumulator was invoked for the first time.
158 ///
159 /// This flag is only used in [callback[`Object`][crate::Object]][accumulator functions]
160 /// for the `run_type` field of the [struct[`Object`][crate::Object]], to
161 /// mark the first call to the accumulator function for a signal emission.
162#[cfg(feature = "v2_68")]
163 #[cfg_attr(docsrs, doc(cfg(feature = "v2_68")))]
164 #[doc(alias = "G_SIGNAL_ACCUMULATOR_FIRST_RUN")]
165const ACCUMULATOR_FIRST_RUN = crate::gobject_ffi::G_SIGNAL_ACCUMULATOR_FIRST_RUN as _;
166 }
167}
168169#[doc(hidden)]
170impl IntoGlibfor SignalFlags {
171type GlibType = crate::gobject_ffi::GSignalFlags;
172173#[inline]
174fn into_glib(self) -> crate::gobject_ffi::GSignalFlags {
175self.bits()
176 }
177}
178179#[doc(hidden)]
180impl FromGlib<crate::gobject_ffi::GSignalFlags> for SignalFlags {
181#[inline]
182unsafe fn from_glib(value: crate::gobject_ffi::GSignalFlags) -> Self {
183Self::from_bits_truncate(value)
184 }
185}
186187bitflags! {
188/// Bit masks used to check or determine characteristics of a type.
189#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
190 #[doc(alias = "GTypeFlags")]
191pub struct TypeFlags: u32 {
192/// No special flags. Since: 2.74
193#[doc(alias = "G_TYPE_FLAG_NONE")]
194const NONE = crate::gobject_ffi::G_TYPE_FLAG_NONE as _;
195/// Indicates an abstract type. No instances can be
196 /// created for an abstract type
197#[doc(alias = "G_TYPE_FLAG_ABSTRACT")]
198const ABSTRACT = crate::gobject_ffi::G_TYPE_FLAG_ABSTRACT as _;
199/// Indicates an abstract value type, i.e. a type
200 /// that introduces a value table, but can't be used for
201 /// [`Value::init()`][crate::Value::init()]
202#[doc(alias = "G_TYPE_FLAG_VALUE_ABSTRACT")]
203const VALUE_ABSTRACT = crate::gobject_ffi::G_TYPE_FLAG_VALUE_ABSTRACT as _;
204/// Indicates a final type. A final type is a non-derivable
205 /// leaf node in a deep derivable type hierarchy tree. Since: 2.70
206#[doc(alias = "G_TYPE_FLAG_FINAL")]
207const FINAL = crate::gobject_ffi::G_TYPE_FLAG_FINAL as _;
208/// The type is deprecated and may be removed in a
209 /// future version. A warning will be emitted if it is instantiated while
210 /// running with `G_ENABLE_DIAGNOSTIC=1`. Since 2.76
211#[doc(alias = "G_TYPE_FLAG_DEPRECATED")]
212const DEPRECATED = crate::gobject_ffi::G_TYPE_FLAG_DEPRECATED as _;
213 }
214}
215216#[doc(hidden)]
217impl IntoGlibfor TypeFlags {
218type GlibType = crate::gobject_ffi::GTypeFlags;
219220#[inline]
221fn into_glib(self) -> crate::gobject_ffi::GTypeFlags {
222self.bits()
223 }
224}
225226#[doc(hidden)]
227impl FromGlib<crate::gobject_ffi::GTypeFlags> for TypeFlags {
228#[inline]
229unsafe fn from_glib(value: crate::gobject_ffi::GTypeFlags) -> Self {
230Self::from_bits_truncate(value)
231 }
232}