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, prelude::*, translate::*};
6use std::fmt;
7
8bitflags! {
9 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
10 #[doc(alias = "GBindingFlags")]
11 pub struct BindingFlags: u32 {
12 #[doc(alias = "G_BINDING_DEFAULT")]
13 const DEFAULT = gobject_ffi::G_BINDING_DEFAULT as _;
14 #[doc(alias = "G_BINDING_BIDIRECTIONAL")]
15 const BIDIRECTIONAL = gobject_ffi::G_BINDING_BIDIRECTIONAL as _;
16 #[doc(alias = "G_BINDING_SYNC_CREATE")]
17 const SYNC_CREATE = gobject_ffi::G_BINDING_SYNC_CREATE as _;
18 #[doc(alias = "G_BINDING_INVERT_BOOLEAN")]
19 const INVERT_BOOLEAN = gobject_ffi::G_BINDING_INVERT_BOOLEAN as _;
20 }
21}
22
23impl fmt::Display for BindingFlags {
24 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
25 <Self as fmt::Debug>::fmt(self, f)
26 }
27}
28
29#[doc(hidden)]
30impl IntoGlib for BindingFlags {
31 type GlibType = gobject_ffi::GBindingFlags;
32
33 #[inline]
34 fn into_glib(self) -> gobject_ffi::GBindingFlags {
35 self.bits()
36 }
37}
38
39#[doc(hidden)]
40impl FromGlib<gobject_ffi::GBindingFlags> for BindingFlags {
41 #[inline]
42 unsafe fn from_glib(value: gobject_ffi::GBindingFlags) -> Self {
43 Self::from_bits_truncate(bits:value)
44 }
45}
46
47impl StaticType for BindingFlags {
48 #[inline]
49 #[doc(alias = "g_binding_flags_get_type")]
50 fn static_type() -> crate::Type {
51 unsafe { from_glib(val:gobject_ffi::g_binding_flags_get_type()) }
52 }
53}
54
55impl crate::HasParamSpec for BindingFlags {
56 type ParamSpec = crate::ParamSpecFlags;
57 type SetValue = Self;
58 type BuilderFn = fn(&str) -> crate::ParamSpecFlagsBuilder<Self>;
59
60 fn param_spec_builder() -> Self::BuilderFn {
61 Self::ParamSpec::builder
62 }
63}
64
65impl crate::value::ValueType for BindingFlags {
66 type Type = Self;
67}
68
69unsafe impl<'a> crate::value::FromValue<'a> for BindingFlags {
70 type Checker = crate::value::GenericValueTypeChecker<Self>;
71
72 #[inline]
73 unsafe fn from_value(value: &'a crate::Value) -> Self {
74 from_glib(val:crate::gobject_ffi::g_value_get_flags(
75 value.to_glib_none().0,
76 ))
77 }
78}
79
80impl ToValue for BindingFlags {
81 #[inline]
82 fn to_value(&self) -> crate::Value {
83 let mut value: Value = crate::Value::for_value_type::<Self>();
84 unsafe {
85 crate::gobject_ffi::g_value_set_flags(value:value.to_glib_none_mut().0, self.into_glib());
86 }
87 value
88 }
89
90 #[inline]
91 fn value_type(&self) -> crate::Type {
92 Self::static_type()
93 }
94}
95
96impl From<BindingFlags> for crate::Value {
97 #[inline]
98 fn from(v: BindingFlags) -> Self {
99 ToValue::to_value(&v)
100 }
101}
102
103bitflags! {
104 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
105 #[doc(alias = "GSignalFlags")]
106 pub struct SignalFlags: u32 {
107 #[doc(alias = "G_SIGNAL_RUN_FIRST")]
108 const RUN_FIRST = gobject_ffi::G_SIGNAL_RUN_FIRST as _;
109 #[doc(alias = "G_SIGNAL_RUN_LAST")]
110 const RUN_LAST = gobject_ffi::G_SIGNAL_RUN_LAST as _;
111 #[doc(alias = "G_SIGNAL_RUN_CLEANUP")]
112 const RUN_CLEANUP = gobject_ffi::G_SIGNAL_RUN_CLEANUP as _;
113 #[doc(alias = "G_SIGNAL_NO_RECURSE")]
114 const NO_RECURSE = gobject_ffi::G_SIGNAL_NO_RECURSE as _;
115 #[doc(alias = "G_SIGNAL_DETAILED")]
116 const DETAILED = gobject_ffi::G_SIGNAL_DETAILED as _;
117 #[doc(alias = "G_SIGNAL_ACTION")]
118 const ACTION = gobject_ffi::G_SIGNAL_ACTION as _;
119 #[doc(alias = "G_SIGNAL_NO_HOOKS")]
120 const NO_HOOKS = gobject_ffi::G_SIGNAL_NO_HOOKS as _;
121 #[doc(alias = "G_SIGNAL_MUST_COLLECT")]
122 const MUST_COLLECT = gobject_ffi::G_SIGNAL_MUST_COLLECT as _;
123 #[doc(alias = "G_SIGNAL_DEPRECATED")]
124 const DEPRECATED = gobject_ffi::G_SIGNAL_DEPRECATED as _;
125 #[doc(alias = "G_SIGNAL_ACCUMULATOR_FIRST_RUN")]
126 const ACCUMULATOR_FIRST_RUN = gobject_ffi::G_SIGNAL_ACCUMULATOR_FIRST_RUN as _;
127 }
128}
129
130impl fmt::Display for SignalFlags {
131 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
132 <Self as fmt::Debug>::fmt(self, f)
133 }
134}
135
136#[doc(hidden)]
137impl IntoGlib for SignalFlags {
138 type GlibType = gobject_ffi::GSignalFlags;
139
140 #[inline]
141 fn into_glib(self) -> gobject_ffi::GSignalFlags {
142 self.bits()
143 }
144}
145
146#[doc(hidden)]
147impl FromGlib<gobject_ffi::GSignalFlags> for SignalFlags {
148 #[inline]
149 unsafe fn from_glib(value: gobject_ffi::GSignalFlags) -> Self {
150 Self::from_bits_truncate(bits:value)
151 }
152}
153