Skip to main content

gdk4/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::ffi;
6use glib::{bitflags::bitflags, prelude::*, translate::*};
7
8bitflags! {
9    /// Positioning hints for aligning a surface relative to a rectangle.
10    ///
11    /// These hints determine how the surface should be positioned in the case that
12    /// the surface would fall off-screen if placed in its ideal position.
13    ///
14    /// For example, [`FLIP_X`][Self::FLIP_X] will replace [`Gravity::NorthWest`][crate::Gravity::NorthWest] with
15    /// [`Gravity::NorthEast`][crate::Gravity::NorthEast] and vice versa if the surface extends beyond the left
16    /// or right edges of the monitor.
17    ///
18    /// If [`SLIDE_X`][Self::SLIDE_X] is set, the surface can be shifted horizontally to fit
19    /// on-screen. If [`RESIZE_X`][Self::RESIZE_X] is set, the surface can be shrunken
20    /// horizontally to fit.
21    ///
22    /// In general, when multiple flags are set, flipping should take precedence over
23    /// sliding, which should take precedence over resizing.
24    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
25    #[doc(alias = "GdkAnchorHints")]
26    pub struct AnchorHints: u32 {
27        /// allow flipping anchors horizontally
28        #[doc(alias = "GDK_ANCHOR_FLIP_X")]
29        const FLIP_X = ffi::GDK_ANCHOR_FLIP_X as _;
30        /// allow flipping anchors vertically
31        #[doc(alias = "GDK_ANCHOR_FLIP_Y")]
32        const FLIP_Y = ffi::GDK_ANCHOR_FLIP_Y as _;
33        /// allow sliding surface horizontally
34        #[doc(alias = "GDK_ANCHOR_SLIDE_X")]
35        const SLIDE_X = ffi::GDK_ANCHOR_SLIDE_X as _;
36        /// allow sliding surface vertically
37        #[doc(alias = "GDK_ANCHOR_SLIDE_Y")]
38        const SLIDE_Y = ffi::GDK_ANCHOR_SLIDE_Y as _;
39        /// allow resizing surface horizontally
40        #[doc(alias = "GDK_ANCHOR_RESIZE_X")]
41        const RESIZE_X = ffi::GDK_ANCHOR_RESIZE_X as _;
42        /// allow resizing surface vertically
43        #[doc(alias = "GDK_ANCHOR_RESIZE_Y")]
44        const RESIZE_Y = ffi::GDK_ANCHOR_RESIZE_Y as _;
45        /// allow flipping anchors on both axes
46        #[doc(alias = "GDK_ANCHOR_FLIP")]
47        const FLIP = ffi::GDK_ANCHOR_FLIP as _;
48        /// allow sliding surface on both axes
49        #[doc(alias = "GDK_ANCHOR_SLIDE")]
50        const SLIDE = ffi::GDK_ANCHOR_SLIDE as _;
51        /// allow resizing surface on both axes
52        #[doc(alias = "GDK_ANCHOR_RESIZE")]
53        const RESIZE = ffi::GDK_ANCHOR_RESIZE as _;
54    }
55}
56
57#[doc(hidden)]
58impl IntoGlib for AnchorHints {
59    type GlibType = ffi::GdkAnchorHints;
60
61    #[inline]
62    fn into_glib(self) -> ffi::GdkAnchorHints {
63        self.bits()
64    }
65}
66
67#[doc(hidden)]
68impl FromGlib<ffi::GdkAnchorHints> for AnchorHints {
69    #[inline]
70    unsafe fn from_glib(value: ffi::GdkAnchorHints) -> Self {
71        skip_assert_initialized!();
72        Self::from_bits_truncate(value)
73    }
74}
75
76impl StaticType for AnchorHints {
77    #[inline]
78    #[doc(alias = "gdk_anchor_hints_get_type")]
79    fn static_type() -> glib::Type {
80        unsafe { from_glib(ffi::gdk_anchor_hints_get_type()) }
81    }
82}
83
84impl glib::HasParamSpec for AnchorHints {
85    type ParamSpec = glib::ParamSpecFlags;
86    type SetValue = Self;
87    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
88
89    fn param_spec_builder() -> Self::BuilderFn {
90        Self::ParamSpec::builder
91    }
92}
93
94impl glib::value::ValueType for AnchorHints {
95    type Type = Self;
96}
97
98unsafe impl<'a> glib::value::FromValue<'a> for AnchorHints {
99    type Checker = glib::value::GenericValueTypeChecker<Self>;
100
101    #[inline]
102    unsafe fn from_value(value: &'a glib::Value) -> Self {
103        skip_assert_initialized!();
104        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
105    }
106}
107
108impl ToValue for AnchorHints {
109    #[inline]
110    fn to_value(&self) -> glib::Value {
111        let mut value = glib::Value::for_value_type::<Self>();
112        unsafe {
113            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
114        }
115        value
116    }
117
118    #[inline]
119    fn value_type(&self) -> glib::Type {
120        Self::static_type()
121    }
122}
123
124impl From<AnchorHints> for glib::Value {
125    #[inline]
126    fn from(v: AnchorHints) -> Self {
127        skip_assert_initialized!();
128        ToValue::to_value(&v)
129    }
130}
131
132bitflags! {
133    /// Flags describing the current capabilities of a device/tool.
134    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
135    #[doc(alias = "GdkAxisFlags")]
136    pub struct AxisFlags: u32 {
137        /// X axis is present
138        #[doc(alias = "GDK_AXIS_FLAG_X")]
139        const X = ffi::GDK_AXIS_FLAG_X as _;
140        /// Y axis is present
141        #[doc(alias = "GDK_AXIS_FLAG_Y")]
142        const Y = ffi::GDK_AXIS_FLAG_Y as _;
143        /// Scroll X delta axis is present
144        #[doc(alias = "GDK_AXIS_FLAG_DELTA_X")]
145        const DELTA_X = ffi::GDK_AXIS_FLAG_DELTA_X as _;
146        /// Scroll Y delta axis is present
147        #[doc(alias = "GDK_AXIS_FLAG_DELTA_Y")]
148        const DELTA_Y = ffi::GDK_AXIS_FLAG_DELTA_Y as _;
149        /// Pressure axis is present
150        #[doc(alias = "GDK_AXIS_FLAG_PRESSURE")]
151        const PRESSURE = ffi::GDK_AXIS_FLAG_PRESSURE as _;
152        /// X tilt axis is present
153        #[doc(alias = "GDK_AXIS_FLAG_XTILT")]
154        const XTILT = ffi::GDK_AXIS_FLAG_XTILT as _;
155        /// Y tilt axis is present
156        #[doc(alias = "GDK_AXIS_FLAG_YTILT")]
157        const YTILT = ffi::GDK_AXIS_FLAG_YTILT as _;
158        /// Wheel axis is present
159        #[doc(alias = "GDK_AXIS_FLAG_WHEEL")]
160        const WHEEL = ffi::GDK_AXIS_FLAG_WHEEL as _;
161        /// Distance axis is present
162        #[doc(alias = "GDK_AXIS_FLAG_DISTANCE")]
163        const DISTANCE = ffi::GDK_AXIS_FLAG_DISTANCE as _;
164        /// Z-axis rotation is present
165        #[doc(alias = "GDK_AXIS_FLAG_ROTATION")]
166        const ROTATION = ffi::GDK_AXIS_FLAG_ROTATION as _;
167        /// Slider axis is present
168        #[doc(alias = "GDK_AXIS_FLAG_SLIDER")]
169        const SLIDER = ffi::GDK_AXIS_FLAG_SLIDER as _;
170    }
171}
172
173#[doc(hidden)]
174impl IntoGlib for AxisFlags {
175    type GlibType = ffi::GdkAxisFlags;
176
177    #[inline]
178    fn into_glib(self) -> ffi::GdkAxisFlags {
179        self.bits()
180    }
181}
182
183#[doc(hidden)]
184impl FromGlib<ffi::GdkAxisFlags> for AxisFlags {
185    #[inline]
186    unsafe fn from_glib(value: ffi::GdkAxisFlags) -> Self {
187        skip_assert_initialized!();
188        Self::from_bits_truncate(value)
189    }
190}
191
192impl StaticType for AxisFlags {
193    #[inline]
194    #[doc(alias = "gdk_axis_flags_get_type")]
195    fn static_type() -> glib::Type {
196        unsafe { from_glib(ffi::gdk_axis_flags_get_type()) }
197    }
198}
199
200impl glib::HasParamSpec for AxisFlags {
201    type ParamSpec = glib::ParamSpecFlags;
202    type SetValue = Self;
203    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
204
205    fn param_spec_builder() -> Self::BuilderFn {
206        Self::ParamSpec::builder
207    }
208}
209
210impl glib::value::ValueType for AxisFlags {
211    type Type = Self;
212}
213
214unsafe impl<'a> glib::value::FromValue<'a> for AxisFlags {
215    type Checker = glib::value::GenericValueTypeChecker<Self>;
216
217    #[inline]
218    unsafe fn from_value(value: &'a glib::Value) -> Self {
219        skip_assert_initialized!();
220        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
221    }
222}
223
224impl ToValue for AxisFlags {
225    #[inline]
226    fn to_value(&self) -> glib::Value {
227        let mut value = glib::Value::for_value_type::<Self>();
228        unsafe {
229            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
230        }
231        value
232    }
233
234    #[inline]
235    fn value_type(&self) -> glib::Type {
236        Self::static_type()
237    }
238}
239
240impl From<AxisFlags> for glib::Value {
241    #[inline]
242    fn from(v: AxisFlags) -> Self {
243        skip_assert_initialized!();
244        ToValue::to_value(&v)
245    }
246}
247
248bitflags! {
249    /// Used in [`Drop`][crate::Drop] and [`Drag`][crate::Drag] to indicate the actions that the
250    /// destination can and should do with the dropped data.
251    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
252    #[doc(alias = "GdkDragAction")]
253    pub struct DragAction: u32 {
254        /// No action.
255        #[cfg(feature = "v4_20")]
256        #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
257        #[doc(alias = "GDK_ACTION_NONE")]
258        const NONE = ffi::GDK_ACTION_NONE as _;
259        /// Copy the data.
260        #[doc(alias = "GDK_ACTION_COPY")]
261        const COPY = ffi::GDK_ACTION_COPY as _;
262        /// Move the data, i.e. first copy it, then delete
263        ///   it from the source using the DELETE target of the X selection protocol.
264        #[doc(alias = "GDK_ACTION_MOVE")]
265        const MOVE = ffi::GDK_ACTION_MOVE as _;
266        /// Add a link to the data. Note that this is only
267        ///   useful if source and destination agree on what it means, and is not
268        ///   supported on all platforms.
269        #[doc(alias = "GDK_ACTION_LINK")]
270        const LINK = ffi::GDK_ACTION_LINK as _;
271        /// Ask the user what to do with the data.
272        #[doc(alias = "GDK_ACTION_ASK")]
273        const ASK = ffi::GDK_ACTION_ASK as _;
274    }
275}
276
277impl DragAction {
278    #[doc(alias = "gdk_drag_action_is_unique")]
279    pub fn is_unique(self) -> bool {
280        assert_initialized_main_thread!();
281        unsafe { from_glib(ffi::gdk_drag_action_is_unique(self.into_glib())) }
282    }
283}
284
285#[doc(hidden)]
286impl IntoGlib for DragAction {
287    type GlibType = ffi::GdkDragAction;
288
289    #[inline]
290    fn into_glib(self) -> ffi::GdkDragAction {
291        self.bits()
292    }
293}
294
295#[doc(hidden)]
296impl FromGlib<ffi::GdkDragAction> for DragAction {
297    #[inline]
298    unsafe fn from_glib(value: ffi::GdkDragAction) -> Self {
299        skip_assert_initialized!();
300        Self::from_bits_truncate(value)
301    }
302}
303
304impl StaticType for DragAction {
305    #[inline]
306    #[doc(alias = "gdk_drag_action_get_type")]
307    fn static_type() -> glib::Type {
308        unsafe { from_glib(ffi::gdk_drag_action_get_type()) }
309    }
310}
311
312impl glib::HasParamSpec for DragAction {
313    type ParamSpec = glib::ParamSpecFlags;
314    type SetValue = Self;
315    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
316
317    fn param_spec_builder() -> Self::BuilderFn {
318        Self::ParamSpec::builder
319    }
320}
321
322impl glib::value::ValueType for DragAction {
323    type Type = Self;
324}
325
326unsafe impl<'a> glib::value::FromValue<'a> for DragAction {
327    type Checker = glib::value::GenericValueTypeChecker<Self>;
328
329    #[inline]
330    unsafe fn from_value(value: &'a glib::Value) -> Self {
331        skip_assert_initialized!();
332        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
333    }
334}
335
336impl ToValue for DragAction {
337    #[inline]
338    fn to_value(&self) -> glib::Value {
339        let mut value = glib::Value::for_value_type::<Self>();
340        unsafe {
341            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
342        }
343        value
344    }
345
346    #[inline]
347    fn value_type(&self) -> glib::Type {
348        Self::static_type()
349    }
350}
351
352impl From<DragAction> for glib::Value {
353    #[inline]
354    fn from(v: DragAction) -> Self {
355        skip_assert_initialized!();
356        ToValue::to_value(&v)
357    }
358}
359
360bitflags! {
361    /// Used to represent the different paint clock phases that can be requested.
362    ///
363    /// The elements of the enumeration correspond to the signals of [`FrameClock`][crate::FrameClock].
364    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
365    #[doc(alias = "GdkFrameClockPhase")]
366    pub struct FrameClockPhase: u32 {
367        /// no phase
368        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_NONE")]
369        const NONE = ffi::GDK_FRAME_CLOCK_PHASE_NONE as _;
370        /// corresponds to GdkFrameClock::flush-events. Should not be handled by applications.
371        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS")]
372        const FLUSH_EVENTS = ffi::GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS as _;
373        /// corresponds to GdkFrameClock::before-paint. Should not be handled by applications.
374        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT")]
375        const BEFORE_PAINT = ffi::GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT as _;
376        /// corresponds to GdkFrameClock::update.
377        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_UPDATE")]
378        const UPDATE = ffi::GDK_FRAME_CLOCK_PHASE_UPDATE as _;
379        /// corresponds to GdkFrameClock::layout. Should not be handled by applications.
380        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_LAYOUT")]
381        const LAYOUT = ffi::GDK_FRAME_CLOCK_PHASE_LAYOUT as _;
382        /// corresponds to GdkFrameClock::paint.
383        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_PAINT")]
384        const PAINT = ffi::GDK_FRAME_CLOCK_PHASE_PAINT as _;
385        /// corresponds to GdkFrameClock::resume-events. Should not be handled by applications.
386        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS")]
387        const RESUME_EVENTS = ffi::GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS as _;
388        /// corresponds to GdkFrameClock::after-paint. Should not be handled by applications.
389        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_AFTER_PAINT")]
390        const AFTER_PAINT = ffi::GDK_FRAME_CLOCK_PHASE_AFTER_PAINT as _;
391    }
392}
393
394#[doc(hidden)]
395impl IntoGlib for FrameClockPhase {
396    type GlibType = ffi::GdkFrameClockPhase;
397
398    #[inline]
399    fn into_glib(self) -> ffi::GdkFrameClockPhase {
400        self.bits()
401    }
402}
403
404#[doc(hidden)]
405impl FromGlib<ffi::GdkFrameClockPhase> for FrameClockPhase {
406    #[inline]
407    unsafe fn from_glib(value: ffi::GdkFrameClockPhase) -> Self {
408        skip_assert_initialized!();
409        Self::from_bits_truncate(value)
410    }
411}
412
413impl StaticType for FrameClockPhase {
414    #[inline]
415    #[doc(alias = "gdk_frame_clock_phase_get_type")]
416    fn static_type() -> glib::Type {
417        unsafe { from_glib(ffi::gdk_frame_clock_phase_get_type()) }
418    }
419}
420
421impl glib::HasParamSpec for FrameClockPhase {
422    type ParamSpec = glib::ParamSpecFlags;
423    type SetValue = Self;
424    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
425
426    fn param_spec_builder() -> Self::BuilderFn {
427        Self::ParamSpec::builder
428    }
429}
430
431impl glib::value::ValueType for FrameClockPhase {
432    type Type = Self;
433}
434
435unsafe impl<'a> glib::value::FromValue<'a> for FrameClockPhase {
436    type Checker = glib::value::GenericValueTypeChecker<Self>;
437
438    #[inline]
439    unsafe fn from_value(value: &'a glib::Value) -> Self {
440        skip_assert_initialized!();
441        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
442    }
443}
444
445impl ToValue for FrameClockPhase {
446    #[inline]
447    fn to_value(&self) -> glib::Value {
448        let mut value = glib::Value::for_value_type::<Self>();
449        unsafe {
450            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
451        }
452        value
453    }
454
455    #[inline]
456    fn value_type(&self) -> glib::Type {
457        Self::static_type()
458    }
459}
460
461impl From<FrameClockPhase> for glib::Value {
462    #[inline]
463    fn from(v: FrameClockPhase) -> Self {
464        skip_assert_initialized!();
465        ToValue::to_value(&v)
466    }
467}
468
469#[cfg(feature = "v4_6")]
470bitflags! {
471    /// The list of the different APIs that GdkGLContext can potentially support.
472    #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
473    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
474    #[doc(alias = "GdkGLAPI")]
475    pub struct GLAPI: u32 {
476        /// The OpenGL API
477        #[doc(alias = "GDK_GL_API_GL")]
478        const GL = ffi::GDK_GL_API_GL as _;
479        /// The OpenGL ES API
480        #[doc(alias = "GDK_GL_API_GLES")]
481        const GLES = ffi::GDK_GL_API_GLES as _;
482    }
483}
484
485#[cfg(feature = "v4_6")]
486#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
487#[doc(hidden)]
488impl IntoGlib for GLAPI {
489    type GlibType = ffi::GdkGLAPI;
490
491    #[inline]
492    fn into_glib(self) -> ffi::GdkGLAPI {
493        self.bits()
494    }
495}
496
497#[cfg(feature = "v4_6")]
498#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
499#[doc(hidden)]
500impl FromGlib<ffi::GdkGLAPI> for GLAPI {
501    #[inline]
502    unsafe fn from_glib(value: ffi::GdkGLAPI) -> Self {
503        skip_assert_initialized!();
504        Self::from_bits_truncate(value)
505    }
506}
507
508#[cfg(feature = "v4_6")]
509#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
510impl StaticType for GLAPI {
511    #[inline]
512    #[doc(alias = "gdk_gl_api_get_type")]
513    fn static_type() -> glib::Type {
514        unsafe { from_glib(ffi::gdk_gl_api_get_type()) }
515    }
516}
517
518#[cfg(feature = "v4_6")]
519#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
520impl glib::HasParamSpec for GLAPI {
521    type ParamSpec = glib::ParamSpecFlags;
522    type SetValue = Self;
523    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
524
525    fn param_spec_builder() -> Self::BuilderFn {
526        Self::ParamSpec::builder
527    }
528}
529
530#[cfg(feature = "v4_6")]
531#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
532impl glib::value::ValueType for GLAPI {
533    type Type = Self;
534}
535
536#[cfg(feature = "v4_6")]
537#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
538unsafe impl<'a> glib::value::FromValue<'a> for GLAPI {
539    type Checker = glib::value::GenericValueTypeChecker<Self>;
540
541    #[inline]
542    unsafe fn from_value(value: &'a glib::Value) -> Self {
543        skip_assert_initialized!();
544        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
545    }
546}
547
548#[cfg(feature = "v4_6")]
549#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
550impl ToValue for GLAPI {
551    #[inline]
552    fn to_value(&self) -> glib::Value {
553        let mut value = glib::Value::for_value_type::<Self>();
554        unsafe {
555            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
556        }
557        value
558    }
559
560    #[inline]
561    fn value_type(&self) -> glib::Type {
562        Self::static_type()
563    }
564}
565
566#[cfg(feature = "v4_6")]
567#[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
568impl From<GLAPI> for glib::Value {
569    #[inline]
570    fn from(v: GLAPI) -> Self {
571        skip_assert_initialized!();
572        ToValue::to_value(&v)
573    }
574}
575
576bitflags! {
577    /// Flags to indicate the state of modifier keys and mouse buttons
578    /// in events.
579    ///
580    /// Typical modifier keys are Shift, Control, Meta, Super, Hyper, Alt, Compose,
581    /// Apple, CapsLock or ShiftLock.
582    ///
583    /// Note that GDK may add internal values to events which include values outside
584    /// of this enumeration. Your code should preserve and ignore them. You can use
585    /// `GDK_MODIFIER_MASK` to remove all private values.
586    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
587    #[doc(alias = "GdkModifierType")]
588    pub struct ModifierType: u32 {
589        /// No modifier.
590        #[cfg(feature = "v4_14")]
591        #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
592        #[doc(alias = "GDK_NO_MODIFIER_MASK")]
593        const NO_MODIFIER_MASK = ffi::GDK_NO_MODIFIER_MASK as _;
594        /// the Shift key.
595        #[doc(alias = "GDK_SHIFT_MASK")]
596        const SHIFT_MASK = ffi::GDK_SHIFT_MASK as _;
597        /// ).
598        #[doc(alias = "GDK_LOCK_MASK")]
599        const LOCK_MASK = ffi::GDK_LOCK_MASK as _;
600        /// the Control key.
601        #[doc(alias = "GDK_CONTROL_MASK")]
602        const CONTROL_MASK = ffi::GDK_CONTROL_MASK as _;
603        ///  key).
604        #[doc(alias = "GDK_ALT_MASK")]
605        const ALT_MASK = ffi::GDK_ALT_MASK as _;
606        /// the first mouse button.
607        #[doc(alias = "GDK_BUTTON1_MASK")]
608        const BUTTON1_MASK = ffi::GDK_BUTTON1_MASK as _;
609        /// the second mouse button.
610        #[doc(alias = "GDK_BUTTON2_MASK")]
611        const BUTTON2_MASK = ffi::GDK_BUTTON2_MASK as _;
612        /// the third mouse button.
613        #[doc(alias = "GDK_BUTTON3_MASK")]
614        const BUTTON3_MASK = ffi::GDK_BUTTON3_MASK as _;
615        /// the fourth mouse button.
616        #[doc(alias = "GDK_BUTTON4_MASK")]
617        const BUTTON4_MASK = ffi::GDK_BUTTON4_MASK as _;
618        /// the fifth mouse button.
619        #[doc(alias = "GDK_BUTTON5_MASK")]
620        const BUTTON5_MASK = ffi::GDK_BUTTON5_MASK as _;
621        /// the Super modifier.
622        #[doc(alias = "GDK_SUPER_MASK")]
623        const SUPER_MASK = ffi::GDK_SUPER_MASK as _;
624        /// the Hyper modifier.
625        #[doc(alias = "GDK_HYPER_MASK")]
626        const HYPER_MASK = ffi::GDK_HYPER_MASK as _;
627        /// the Meta modifier. Maps to Command on macOS.
628        #[doc(alias = "GDK_META_MASK")]
629        const META_MASK = ffi::GDK_META_MASK as _;
630    }
631}
632
633#[doc(hidden)]
634impl IntoGlib for ModifierType {
635    type GlibType = ffi::GdkModifierType;
636
637    #[inline]
638    fn into_glib(self) -> ffi::GdkModifierType {
639        self.bits()
640    }
641}
642
643#[doc(hidden)]
644impl FromGlib<ffi::GdkModifierType> for ModifierType {
645    #[inline]
646    unsafe fn from_glib(value: ffi::GdkModifierType) -> Self {
647        skip_assert_initialized!();
648        Self::from_bits_truncate(value)
649    }
650}
651
652impl StaticType for ModifierType {
653    #[inline]
654    #[doc(alias = "gdk_modifier_type_get_type")]
655    fn static_type() -> glib::Type {
656        unsafe { from_glib(ffi::gdk_modifier_type_get_type()) }
657    }
658}
659
660impl glib::HasParamSpec for ModifierType {
661    type ParamSpec = glib::ParamSpecFlags;
662    type SetValue = Self;
663    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
664
665    fn param_spec_builder() -> Self::BuilderFn {
666        Self::ParamSpec::builder
667    }
668}
669
670impl glib::value::ValueType for ModifierType {
671    type Type = Self;
672}
673
674unsafe impl<'a> glib::value::FromValue<'a> for ModifierType {
675    type Checker = glib::value::GenericValueTypeChecker<Self>;
676
677    #[inline]
678    unsafe fn from_value(value: &'a glib::Value) -> Self {
679        skip_assert_initialized!();
680        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
681    }
682}
683
684impl ToValue for ModifierType {
685    #[inline]
686    fn to_value(&self) -> glib::Value {
687        let mut value = glib::Value::for_value_type::<Self>();
688        unsafe {
689            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
690        }
691        value
692    }
693
694    #[inline]
695    fn value_type(&self) -> glib::Type {
696        Self::static_type()
697    }
698}
699
700impl From<ModifierType> for glib::Value {
701    #[inline]
702    fn from(v: ModifierType) -> Self {
703        skip_assert_initialized!();
704        ToValue::to_value(&v)
705    }
706}
707
708bitflags! {
709    /// Flags about a paintable object.
710    ///
711    /// Implementations use these for optimizations such as caching.
712    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
713    #[doc(alias = "GdkPaintableFlags")]
714    pub struct PaintableFlags: u32 {
715        /// The size is immutable.
716        ///   The [`invalidate-size`][struct@crate::Paintable#invalidate-size] signal will never be
717        ///   emitted.
718        #[doc(alias = "GDK_PAINTABLE_STATIC_SIZE")]
719        const STATIC_SIZE = ffi::GDK_PAINTABLE_STATIC_SIZE as _;
720        /// The content is immutable.
721        ///   The [`invalidate-contents`][struct@crate::Paintable#invalidate-contents] signal will never be
722        ///   emitted.
723        #[doc(alias = "GDK_PAINTABLE_STATIC_CONTENTS")]
724        const STATIC_CONTENTS = ffi::GDK_PAINTABLE_STATIC_CONTENTS as _;
725    }
726}
727
728#[doc(hidden)]
729impl IntoGlib for PaintableFlags {
730    type GlibType = ffi::GdkPaintableFlags;
731
732    #[inline]
733    fn into_glib(self) -> ffi::GdkPaintableFlags {
734        self.bits()
735    }
736}
737
738#[doc(hidden)]
739impl FromGlib<ffi::GdkPaintableFlags> for PaintableFlags {
740    #[inline]
741    unsafe fn from_glib(value: ffi::GdkPaintableFlags) -> Self {
742        skip_assert_initialized!();
743        Self::from_bits_truncate(value)
744    }
745}
746
747impl StaticType for PaintableFlags {
748    #[inline]
749    #[doc(alias = "gdk_paintable_flags_get_type")]
750    fn static_type() -> glib::Type {
751        unsafe { from_glib(ffi::gdk_paintable_flags_get_type()) }
752    }
753}
754
755impl glib::HasParamSpec for PaintableFlags {
756    type ParamSpec = glib::ParamSpecFlags;
757    type SetValue = Self;
758    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
759
760    fn param_spec_builder() -> Self::BuilderFn {
761        Self::ParamSpec::builder
762    }
763}
764
765impl glib::value::ValueType for PaintableFlags {
766    type Type = Self;
767}
768
769unsafe impl<'a> glib::value::FromValue<'a> for PaintableFlags {
770    type Checker = glib::value::GenericValueTypeChecker<Self>;
771
772    #[inline]
773    unsafe fn from_value(value: &'a glib::Value) -> Self {
774        skip_assert_initialized!();
775        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
776    }
777}
778
779impl ToValue for PaintableFlags {
780    #[inline]
781    fn to_value(&self) -> glib::Value {
782        let mut value = glib::Value::for_value_type::<Self>();
783        unsafe {
784            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
785        }
786        value
787    }
788
789    #[inline]
790    fn value_type(&self) -> glib::Type {
791        Self::static_type()
792    }
793}
794
795impl From<PaintableFlags> for glib::Value {
796    #[inline]
797    fn from(v: PaintableFlags) -> Self {
798        skip_assert_initialized!();
799        ToValue::to_value(&v)
800    }
801}
802
803bitflags! {
804    /// Flags describing the seat capabilities.
805    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
806    #[doc(alias = "GdkSeatCapabilities")]
807    pub struct SeatCapabilities: u32 {
808        /// No input capabilities
809        #[doc(alias = "GDK_SEAT_CAPABILITY_NONE")]
810        const NONE = ffi::GDK_SEAT_CAPABILITY_NONE as _;
811        /// The seat has a pointer (e.g. mouse)
812        #[doc(alias = "GDK_SEAT_CAPABILITY_POINTER")]
813        const POINTER = ffi::GDK_SEAT_CAPABILITY_POINTER as _;
814        /// The seat has touchscreen(s) attached
815        #[doc(alias = "GDK_SEAT_CAPABILITY_TOUCH")]
816        const TOUCH = ffi::GDK_SEAT_CAPABILITY_TOUCH as _;
817        /// The seat has drawing tablet(s) attached
818        #[doc(alias = "GDK_SEAT_CAPABILITY_TABLET_STYLUS")]
819        const TABLET_STYLUS = ffi::GDK_SEAT_CAPABILITY_TABLET_STYLUS as _;
820        /// The seat has keyboard(s) attached
821        #[doc(alias = "GDK_SEAT_CAPABILITY_KEYBOARD")]
822        const KEYBOARD = ffi::GDK_SEAT_CAPABILITY_KEYBOARD as _;
823        /// The seat has drawing tablet pad(s) attached
824        #[doc(alias = "GDK_SEAT_CAPABILITY_TABLET_PAD")]
825        const TABLET_PAD = ffi::GDK_SEAT_CAPABILITY_TABLET_PAD as _;
826        /// The union of all pointing capabilities
827        #[doc(alias = "GDK_SEAT_CAPABILITY_ALL_POINTING")]
828        const ALL_POINTING = ffi::GDK_SEAT_CAPABILITY_ALL_POINTING as _;
829        /// The union of all capabilities
830        #[doc(alias = "GDK_SEAT_CAPABILITY_ALL")]
831        const ALL = ffi::GDK_SEAT_CAPABILITY_ALL as _;
832    }
833}
834
835#[doc(hidden)]
836impl IntoGlib for SeatCapabilities {
837    type GlibType = ffi::GdkSeatCapabilities;
838
839    #[inline]
840    fn into_glib(self) -> ffi::GdkSeatCapabilities {
841        self.bits()
842    }
843}
844
845#[doc(hidden)]
846impl FromGlib<ffi::GdkSeatCapabilities> for SeatCapabilities {
847    #[inline]
848    unsafe fn from_glib(value: ffi::GdkSeatCapabilities) -> Self {
849        skip_assert_initialized!();
850        Self::from_bits_truncate(value)
851    }
852}
853
854impl StaticType for SeatCapabilities {
855    #[inline]
856    #[doc(alias = "gdk_seat_capabilities_get_type")]
857    fn static_type() -> glib::Type {
858        unsafe { from_glib(ffi::gdk_seat_capabilities_get_type()) }
859    }
860}
861
862impl glib::HasParamSpec for SeatCapabilities {
863    type ParamSpec = glib::ParamSpecFlags;
864    type SetValue = Self;
865    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
866
867    fn param_spec_builder() -> Self::BuilderFn {
868        Self::ParamSpec::builder
869    }
870}
871
872impl glib::value::ValueType for SeatCapabilities {
873    type Type = Self;
874}
875
876unsafe impl<'a> glib::value::FromValue<'a> for SeatCapabilities {
877    type Checker = glib::value::GenericValueTypeChecker<Self>;
878
879    #[inline]
880    unsafe fn from_value(value: &'a glib::Value) -> Self {
881        skip_assert_initialized!();
882        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
883    }
884}
885
886impl ToValue for SeatCapabilities {
887    #[inline]
888    fn to_value(&self) -> glib::Value {
889        let mut value = glib::Value::for_value_type::<Self>();
890        unsafe {
891            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
892        }
893        value
894    }
895
896    #[inline]
897    fn value_type(&self) -> glib::Type {
898        Self::static_type()
899    }
900}
901
902impl From<SeatCapabilities> for glib::Value {
903    #[inline]
904    fn from(v: SeatCapabilities) -> Self {
905        skip_assert_initialized!();
906        ToValue::to_value(&v)
907    }
908}
909
910#[cfg(feature = "v4_20")]
911bitflags! {
912    /// Reflects what features a [`Toplevel`][crate::Toplevel] supports.
913    #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
914    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
915    #[doc(alias = "GdkToplevelCapabilities")]
916    pub struct ToplevelCapabilities: u32 {
917        /// Whether tiled window states are supported.
918        #[cfg(feature = "v4_20")]
919        #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
920        #[doc(alias = "GDK_TOPLEVEL_CAPABILITIES_EDGE_CONSTRAINTS")]
921        const EDGE_CONSTRAINTS = ffi::GDK_TOPLEVEL_CAPABILITIES_EDGE_CONSTRAINTS as _;
922        /// Whether inhibiting system shortcuts is supported.
923        /// See [`ToplevelExt::inhibit_system_shortcuts()`][crate::prelude::ToplevelExt::inhibit_system_shortcuts()].
924        #[cfg(feature = "v4_20")]
925        #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
926        #[doc(alias = "GDK_TOPLEVEL_CAPABILITIES_INHIBIT_SHORTCUTS")]
927        const INHIBIT_SHORTCUTS = ffi::GDK_TOPLEVEL_CAPABILITIES_INHIBIT_SHORTCUTS as _;
928        /// Whether titlebar gestures are supported.
929        /// See [`ToplevelExt::titlebar_gesture()`][crate::prelude::ToplevelExt::titlebar_gesture()].
930        #[cfg(feature = "v4_20")]
931        #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
932        #[doc(alias = "GDK_TOPLEVEL_CAPABILITIES_TITLEBAR_GESTURES")]
933        const TITLEBAR_GESTURES = ffi::GDK_TOPLEVEL_CAPABILITIES_TITLEBAR_GESTURES as _;
934        /// Whether showing the window menu is supported.
935        /// See [`ToplevelExt::show_window_menu()`][crate::prelude::ToplevelExt::show_window_menu()].
936        #[cfg(feature = "v4_20")]
937        #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
938        #[doc(alias = "GDK_TOPLEVEL_CAPABILITIES_WINDOW_MENU")]
939        const WINDOW_MENU = ffi::GDK_TOPLEVEL_CAPABILITIES_WINDOW_MENU as _;
940        /// Whether the toplevel can be maximized.
941        #[cfg(feature = "v4_20")]
942        #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
943        #[doc(alias = "GDK_TOPLEVEL_CAPABILITIES_MAXIMIZE")]
944        const MAXIMIZE = ffi::GDK_TOPLEVEL_CAPABILITIES_MAXIMIZE as _;
945        /// Whether the toplevel can be made fullscreen.
946        #[cfg(feature = "v4_20")]
947        #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
948        #[doc(alias = "GDK_TOPLEVEL_CAPABILITIES_FULLSCREEN")]
949        const FULLSCREEN = ffi::GDK_TOPLEVEL_CAPABILITIES_FULLSCREEN as _;
950        /// Whether the toplevel can be minimized.
951        /// See [`ToplevelExt::minimize()`][crate::prelude::ToplevelExt::minimize()].
952        #[cfg(feature = "v4_20")]
953        #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
954        #[doc(alias = "GDK_TOPLEVEL_CAPABILITIES_MINIMIZE")]
955        const MINIMIZE = ffi::GDK_TOPLEVEL_CAPABILITIES_MINIMIZE as _;
956        /// Whether the toplevel can be lowered.
957        /// See [`ToplevelExt::lower()`][crate::prelude::ToplevelExt::lower()].
958        #[cfg(feature = "v4_20")]
959        #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
960        #[doc(alias = "GDK_TOPLEVEL_CAPABILITIES_LOWER")]
961        const LOWER = ffi::GDK_TOPLEVEL_CAPABILITIES_LOWER as _;
962    }
963}
964
965#[cfg(feature = "v4_20")]
966#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
967#[doc(hidden)]
968impl IntoGlib for ToplevelCapabilities {
969    type GlibType = ffi::GdkToplevelCapabilities;
970
971    #[inline]
972    fn into_glib(self) -> ffi::GdkToplevelCapabilities {
973        self.bits()
974    }
975}
976
977#[cfg(feature = "v4_20")]
978#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
979#[doc(hidden)]
980impl FromGlib<ffi::GdkToplevelCapabilities> for ToplevelCapabilities {
981    #[inline]
982    unsafe fn from_glib(value: ffi::GdkToplevelCapabilities) -> Self {
983        skip_assert_initialized!();
984        Self::from_bits_truncate(value)
985    }
986}
987
988#[cfg(feature = "v4_20")]
989#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
990impl StaticType for ToplevelCapabilities {
991    #[inline]
992    #[doc(alias = "gdk_toplevel_capabilities_get_type")]
993    fn static_type() -> glib::Type {
994        unsafe { from_glib(ffi::gdk_toplevel_capabilities_get_type()) }
995    }
996}
997
998#[cfg(feature = "v4_20")]
999#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1000impl glib::HasParamSpec for ToplevelCapabilities {
1001    type ParamSpec = glib::ParamSpecFlags;
1002    type SetValue = Self;
1003    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1004
1005    fn param_spec_builder() -> Self::BuilderFn {
1006        Self::ParamSpec::builder
1007    }
1008}
1009
1010#[cfg(feature = "v4_20")]
1011#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1012impl glib::value::ValueType for ToplevelCapabilities {
1013    type Type = Self;
1014}
1015
1016#[cfg(feature = "v4_20")]
1017#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1018unsafe impl<'a> glib::value::FromValue<'a> for ToplevelCapabilities {
1019    type Checker = glib::value::GenericValueTypeChecker<Self>;
1020
1021    #[inline]
1022    unsafe fn from_value(value: &'a glib::Value) -> Self {
1023        skip_assert_initialized!();
1024        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1025    }
1026}
1027
1028#[cfg(feature = "v4_20")]
1029#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1030impl ToValue for ToplevelCapabilities {
1031    #[inline]
1032    fn to_value(&self) -> glib::Value {
1033        let mut value = glib::Value::for_value_type::<Self>();
1034        unsafe {
1035            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1036        }
1037        value
1038    }
1039
1040    #[inline]
1041    fn value_type(&self) -> glib::Type {
1042        Self::static_type()
1043    }
1044}
1045
1046#[cfg(feature = "v4_20")]
1047#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
1048impl From<ToplevelCapabilities> for glib::Value {
1049    #[inline]
1050    fn from(v: ToplevelCapabilities) -> Self {
1051        skip_assert_initialized!();
1052        ToValue::to_value(&v)
1053    }
1054}
1055
1056bitflags! {
1057    /// Specifies the state of a toplevel surface.
1058    ///
1059    /// On platforms that support information about individual edges, the
1060    /// [`TILED`][Self::TILED] state will be set whenever any of the individual
1061    /// tiled states is set. On platforms that lack that support, the tiled state
1062    /// will give an indication of tiledness without any of the per-edge states
1063    /// being set.
1064    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1065    #[doc(alias = "GdkToplevelState")]
1066    pub struct ToplevelState: u32 {
1067        /// the surface is minimized
1068        #[doc(alias = "GDK_TOPLEVEL_STATE_MINIMIZED")]
1069        const MINIMIZED = ffi::GDK_TOPLEVEL_STATE_MINIMIZED as _;
1070        /// the surface is maximized
1071        #[doc(alias = "GDK_TOPLEVEL_STATE_MAXIMIZED")]
1072        const MAXIMIZED = ffi::GDK_TOPLEVEL_STATE_MAXIMIZED as _;
1073        /// the surface is sticky
1074        #[doc(alias = "GDK_TOPLEVEL_STATE_STICKY")]
1075        const STICKY = ffi::GDK_TOPLEVEL_STATE_STICKY as _;
1076        /// the surface is maximized without decorations
1077        #[doc(alias = "GDK_TOPLEVEL_STATE_FULLSCREEN")]
1078        const FULLSCREEN = ffi::GDK_TOPLEVEL_STATE_FULLSCREEN as _;
1079        /// the surface is kept above other surfaces
1080        #[doc(alias = "GDK_TOPLEVEL_STATE_ABOVE")]
1081        const ABOVE = ffi::GDK_TOPLEVEL_STATE_ABOVE as _;
1082        /// the surface is kept below other surfaces
1083        #[doc(alias = "GDK_TOPLEVEL_STATE_BELOW")]
1084        const BELOW = ffi::GDK_TOPLEVEL_STATE_BELOW as _;
1085        /// the surface is presented as focused (with active decorations)
1086        #[doc(alias = "GDK_TOPLEVEL_STATE_FOCUSED")]
1087        const FOCUSED = ffi::GDK_TOPLEVEL_STATE_FOCUSED as _;
1088        /// the surface is in a tiled state
1089        #[doc(alias = "GDK_TOPLEVEL_STATE_TILED")]
1090        const TILED = ffi::GDK_TOPLEVEL_STATE_TILED as _;
1091        /// whether the top edge is tiled
1092        #[doc(alias = "GDK_TOPLEVEL_STATE_TOP_TILED")]
1093        const TOP_TILED = ffi::GDK_TOPLEVEL_STATE_TOP_TILED as _;
1094        /// whether the top edge is resizable
1095        #[doc(alias = "GDK_TOPLEVEL_STATE_TOP_RESIZABLE")]
1096        const TOP_RESIZABLE = ffi::GDK_TOPLEVEL_STATE_TOP_RESIZABLE as _;
1097        /// whether the right edge is tiled
1098        #[doc(alias = "GDK_TOPLEVEL_STATE_RIGHT_TILED")]
1099        const RIGHT_TILED = ffi::GDK_TOPLEVEL_STATE_RIGHT_TILED as _;
1100        /// whether the right edge is resizable
1101        #[doc(alias = "GDK_TOPLEVEL_STATE_RIGHT_RESIZABLE")]
1102        const RIGHT_RESIZABLE = ffi::GDK_TOPLEVEL_STATE_RIGHT_RESIZABLE as _;
1103        /// whether the bottom edge is tiled
1104        #[doc(alias = "GDK_TOPLEVEL_STATE_BOTTOM_TILED")]
1105        const BOTTOM_TILED = ffi::GDK_TOPLEVEL_STATE_BOTTOM_TILED as _;
1106        /// whether the bottom edge is resizable
1107        #[doc(alias = "GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE")]
1108        const BOTTOM_RESIZABLE = ffi::GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE as _;
1109        /// whether the left edge is tiled
1110        #[doc(alias = "GDK_TOPLEVEL_STATE_LEFT_TILED")]
1111        const LEFT_TILED = ffi::GDK_TOPLEVEL_STATE_LEFT_TILED as _;
1112        /// whether the left edge is resizable
1113        #[doc(alias = "GDK_TOPLEVEL_STATE_LEFT_RESIZABLE")]
1114        const LEFT_RESIZABLE = ffi::GDK_TOPLEVEL_STATE_LEFT_RESIZABLE as _;
1115        /// The surface is not visible to the user.
1116        #[cfg(feature = "v4_12")]
1117        #[cfg_attr(docsrs, doc(cfg(feature = "v4_12")))]
1118        #[doc(alias = "GDK_TOPLEVEL_STATE_SUSPENDED")]
1119        const SUSPENDED = ffi::GDK_TOPLEVEL_STATE_SUSPENDED as _;
1120    }
1121}
1122
1123#[doc(hidden)]
1124impl IntoGlib for ToplevelState {
1125    type GlibType = ffi::GdkToplevelState;
1126
1127    #[inline]
1128    fn into_glib(self) -> ffi::GdkToplevelState {
1129        self.bits()
1130    }
1131}
1132
1133#[doc(hidden)]
1134impl FromGlib<ffi::GdkToplevelState> for ToplevelState {
1135    #[inline]
1136    unsafe fn from_glib(value: ffi::GdkToplevelState) -> Self {
1137        skip_assert_initialized!();
1138        Self::from_bits_truncate(value)
1139    }
1140}
1141
1142impl StaticType for ToplevelState {
1143    #[inline]
1144    #[doc(alias = "gdk_toplevel_state_get_type")]
1145    fn static_type() -> glib::Type {
1146        unsafe { from_glib(ffi::gdk_toplevel_state_get_type()) }
1147    }
1148}
1149
1150impl glib::HasParamSpec for ToplevelState {
1151    type ParamSpec = glib::ParamSpecFlags;
1152    type SetValue = Self;
1153    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1154
1155    fn param_spec_builder() -> Self::BuilderFn {
1156        Self::ParamSpec::builder
1157    }
1158}
1159
1160impl glib::value::ValueType for ToplevelState {
1161    type Type = Self;
1162}
1163
1164unsafe impl<'a> glib::value::FromValue<'a> for ToplevelState {
1165    type Checker = glib::value::GenericValueTypeChecker<Self>;
1166
1167    #[inline]
1168    unsafe fn from_value(value: &'a glib::Value) -> Self {
1169        skip_assert_initialized!();
1170        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1171    }
1172}
1173
1174impl ToValue for ToplevelState {
1175    #[inline]
1176    fn to_value(&self) -> glib::Value {
1177        let mut value = glib::Value::for_value_type::<Self>();
1178        unsafe {
1179            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1180        }
1181        value
1182    }
1183
1184    #[inline]
1185    fn value_type(&self) -> glib::Type {
1186        Self::static_type()
1187    }
1188}
1189
1190impl From<ToplevelState> for glib::Value {
1191    #[inline]
1192    fn from(v: ToplevelState) -> Self {
1193        skip_assert_initialized!();
1194        ToValue::to_value(&v)
1195    }
1196}