Skip to main content

gdk/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 window relative to a rectangle.
10    ///
11    /// These hints determine how the window should be positioned in the case that
12    /// the window 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 window extends beyond the left
16    /// or right edges of the monitor.
17    ///
18    /// If [`SLIDE_X`][Self::SLIDE_X] is set, the window can be shifted horizontally to fit
19    /// on-screen. If [`RESIZE_X`][Self::RESIZE_X] is set, the window 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 window horizontally
34        #[doc(alias = "GDK_ANCHOR_SLIDE_X")]
35        const SLIDE_X = ffi::GDK_ANCHOR_SLIDE_X as _;
36        /// allow sliding window vertically
37        #[doc(alias = "GDK_ANCHOR_SLIDE_Y")]
38        const SLIDE_Y = ffi::GDK_ANCHOR_SLIDE_Y as _;
39        /// allow resizing window horizontally
40        #[doc(alias = "GDK_ANCHOR_RESIZE_X")]
41        const RESIZE_X = ffi::GDK_ANCHOR_RESIZE_X as _;
42        /// allow resizing window 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 window on both axes
49        #[doc(alias = "GDK_ANCHOR_SLIDE")]
50        const SLIDE = ffi::GDK_ANCHOR_SLIDE as _;
51        /// allow resizing window 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        /// Pressure axis is present
144        #[doc(alias = "GDK_AXIS_FLAG_PRESSURE")]
145        const PRESSURE = ffi::GDK_AXIS_FLAG_PRESSURE as _;
146        /// X tilt axis is present
147        #[doc(alias = "GDK_AXIS_FLAG_XTILT")]
148        const XTILT = ffi::GDK_AXIS_FLAG_XTILT as _;
149        /// Y tilt axis is present
150        #[doc(alias = "GDK_AXIS_FLAG_YTILT")]
151        const YTILT = ffi::GDK_AXIS_FLAG_YTILT as _;
152        /// Wheel axis is present
153        #[doc(alias = "GDK_AXIS_FLAG_WHEEL")]
154        const WHEEL = ffi::GDK_AXIS_FLAG_WHEEL as _;
155        /// Distance axis is present
156        #[doc(alias = "GDK_AXIS_FLAG_DISTANCE")]
157        const DISTANCE = ffi::GDK_AXIS_FLAG_DISTANCE as _;
158        /// Z-axis rotation is present
159        #[doc(alias = "GDK_AXIS_FLAG_ROTATION")]
160        const ROTATION = ffi::GDK_AXIS_FLAG_ROTATION as _;
161        /// Slider axis is present
162        #[doc(alias = "GDK_AXIS_FLAG_SLIDER")]
163        const SLIDER = ffi::GDK_AXIS_FLAG_SLIDER as _;
164    }
165}
166
167#[doc(hidden)]
168impl IntoGlib for AxisFlags {
169    type GlibType = ffi::GdkAxisFlags;
170
171    #[inline]
172    fn into_glib(self) -> ffi::GdkAxisFlags {
173        self.bits()
174    }
175}
176
177#[doc(hidden)]
178impl FromGlib<ffi::GdkAxisFlags> for AxisFlags {
179    #[inline]
180    unsafe fn from_glib(value: ffi::GdkAxisFlags) -> Self {
181        skip_assert_initialized!();
182        Self::from_bits_truncate(value)
183    }
184}
185
186impl StaticType for AxisFlags {
187    #[inline]
188    #[doc(alias = "gdk_axis_flags_get_type")]
189    fn static_type() -> glib::Type {
190        unsafe { from_glib(ffi::gdk_axis_flags_get_type()) }
191    }
192}
193
194impl glib::HasParamSpec for AxisFlags {
195    type ParamSpec = glib::ParamSpecFlags;
196    type SetValue = Self;
197    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
198
199    fn param_spec_builder() -> Self::BuilderFn {
200        Self::ParamSpec::builder
201    }
202}
203
204impl glib::value::ValueType for AxisFlags {
205    type Type = Self;
206}
207
208unsafe impl<'a> glib::value::FromValue<'a> for AxisFlags {
209    type Checker = glib::value::GenericValueTypeChecker<Self>;
210
211    #[inline]
212    unsafe fn from_value(value: &'a glib::Value) -> Self {
213        skip_assert_initialized!();
214        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
215    }
216}
217
218impl ToValue for AxisFlags {
219    #[inline]
220    fn to_value(&self) -> glib::Value {
221        let mut value = glib::Value::for_value_type::<Self>();
222        unsafe {
223            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
224        }
225        value
226    }
227
228    #[inline]
229    fn value_type(&self) -> glib::Type {
230        Self::static_type()
231    }
232}
233
234impl From<AxisFlags> for glib::Value {
235    #[inline]
236    fn from(v: AxisFlags) -> Self {
237        skip_assert_initialized!();
238        ToValue::to_value(&v)
239    }
240}
241
242bitflags! {
243    /// Used in [`DragContext`][crate::DragContext] to indicate what the destination
244    /// should do with the dropped data.
245    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
246    #[doc(alias = "GdkDragAction")]
247    pub struct DragAction: u32 {
248        /// Means nothing, and should not be used.
249        #[doc(alias = "GDK_ACTION_DEFAULT")]
250        const DEFAULT = ffi::GDK_ACTION_DEFAULT as _;
251        /// Copy the data.
252        #[doc(alias = "GDK_ACTION_COPY")]
253        const COPY = ffi::GDK_ACTION_COPY as _;
254        /// Move the data, i.e. first copy it, then delete
255        ///  it from the source using the DELETE target of the X selection protocol.
256        #[doc(alias = "GDK_ACTION_MOVE")]
257        const MOVE = ffi::GDK_ACTION_MOVE as _;
258        /// Add a link to the data. Note that this is only
259        ///  useful if source and destination agree on what it means.
260        #[doc(alias = "GDK_ACTION_LINK")]
261        const LINK = ffi::GDK_ACTION_LINK as _;
262        /// Special action which tells the source that the
263        ///  destination will do something that the source doesn’t understand.
264        #[doc(alias = "GDK_ACTION_PRIVATE")]
265        const PRIVATE = ffi::GDK_ACTION_PRIVATE as _;
266        /// Ask the user what to do with the data.
267        #[doc(alias = "GDK_ACTION_ASK")]
268        const ASK = ffi::GDK_ACTION_ASK as _;
269    }
270}
271
272#[doc(hidden)]
273impl IntoGlib for DragAction {
274    type GlibType = ffi::GdkDragAction;
275
276    #[inline]
277    fn into_glib(self) -> ffi::GdkDragAction {
278        self.bits()
279    }
280}
281
282#[doc(hidden)]
283impl FromGlib<ffi::GdkDragAction> for DragAction {
284    #[inline]
285    unsafe fn from_glib(value: ffi::GdkDragAction) -> Self {
286        skip_assert_initialized!();
287        Self::from_bits_truncate(value)
288    }
289}
290
291impl StaticType for DragAction {
292    #[inline]
293    #[doc(alias = "gdk_drag_action_get_type")]
294    fn static_type() -> glib::Type {
295        unsafe { from_glib(ffi::gdk_drag_action_get_type()) }
296    }
297}
298
299impl glib::HasParamSpec for DragAction {
300    type ParamSpec = glib::ParamSpecFlags;
301    type SetValue = Self;
302    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
303
304    fn param_spec_builder() -> Self::BuilderFn {
305        Self::ParamSpec::builder
306    }
307}
308
309impl glib::value::ValueType for DragAction {
310    type Type = Self;
311}
312
313unsafe impl<'a> glib::value::FromValue<'a> for DragAction {
314    type Checker = glib::value::GenericValueTypeChecker<Self>;
315
316    #[inline]
317    unsafe fn from_value(value: &'a glib::Value) -> Self {
318        skip_assert_initialized!();
319        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
320    }
321}
322
323impl ToValue for DragAction {
324    #[inline]
325    fn to_value(&self) -> glib::Value {
326        let mut value = glib::Value::for_value_type::<Self>();
327        unsafe {
328            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
329        }
330        value
331    }
332
333    #[inline]
334    fn value_type(&self) -> glib::Type {
335        Self::static_type()
336    }
337}
338
339impl From<DragAction> for glib::Value {
340    #[inline]
341    fn from(v: DragAction) -> Self {
342        skip_assert_initialized!();
343        ToValue::to_value(&v)
344    }
345}
346
347bitflags! {
348    /// A set of bit-flags to indicate which events a window is to receive.
349    /// Most of these masks map onto one or more of the [`EventType`][crate::EventType] event types
350    /// above.
351    ///
352    /// See the [input handling overview][chap-input-handling] for details of
353    /// [event masks][event-masks] and [event propagation][event-propagation].
354    ///
355    /// [`POINTER_MOTION_HINT_MASK`][Self::POINTER_MOTION_HINT_MASK] is deprecated. It is a special mask
356    /// to reduce the number of [`EventType::MotionNotify`][crate::EventType::MotionNotify] events received. When using
357    /// [`POINTER_MOTION_HINT_MASK`][Self::POINTER_MOTION_HINT_MASK], fewer [`EventType::MotionNotify`][crate::EventType::MotionNotify] events will
358    /// be sent, some of which are marked as a hint (the is_hint member is
359    /// [`true`]). To receive more motion events after a motion hint event,
360    /// the application needs to asks for more, by calling
361    /// `gdk_event_request_motions()`.
362    ///
363    /// Since GTK 3.8, motion events are already compressed by default, independent
364    /// of this mechanism. This compression can be disabled with
365    /// [`Window::set_event_compression()`][crate::Window::set_event_compression()]. See the documentation of that function
366    /// for details.
367    ///
368    /// If [`TOUCH_MASK`][Self::TOUCH_MASK] is enabled, the window will receive touch events
369    /// from touch-enabled devices. Those will come as sequences of [`EventTouch`][crate::EventTouch]
370    /// with type [`EventType::TouchUpdate`][crate::EventType::TouchUpdate], enclosed by two events with
371    /// type [`EventType::TouchBegin`][crate::EventType::TouchBegin] and [`EventType::TouchEnd`][crate::EventType::TouchEnd] (or [`EventType::TouchCancel`][crate::EventType::TouchCancel]).
372    /// `gdk_event_get_event_sequence()` returns the event sequence for these
373    /// events, so different sequences may be distinguished.
374    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
375    #[doc(alias = "GdkEventMask")]
376    pub struct EventMask: u32 {
377        /// receive expose events
378        #[doc(alias = "GDK_EXPOSURE_MASK")]
379        const EXPOSURE_MASK = ffi::GDK_EXPOSURE_MASK as _;
380        /// receive all pointer motion events
381        #[doc(alias = "GDK_POINTER_MOTION_MASK")]
382        const POINTER_MOTION_MASK = ffi::GDK_POINTER_MOTION_MASK as _;
383        /// deprecated. see the explanation above
384        #[doc(alias = "GDK_POINTER_MOTION_HINT_MASK")]
385        const POINTER_MOTION_HINT_MASK = ffi::GDK_POINTER_MOTION_HINT_MASK as _;
386        /// receive pointer motion events while any button is pressed
387        #[doc(alias = "GDK_BUTTON_MOTION_MASK")]
388        const BUTTON_MOTION_MASK = ffi::GDK_BUTTON_MOTION_MASK as _;
389        /// receive pointer motion events while 1 button is pressed
390        #[doc(alias = "GDK_BUTTON1_MOTION_MASK")]
391        const BUTTON1_MOTION_MASK = ffi::GDK_BUTTON1_MOTION_MASK as _;
392        /// receive pointer motion events while 2 button is pressed
393        #[doc(alias = "GDK_BUTTON2_MOTION_MASK")]
394        const BUTTON2_MOTION_MASK = ffi::GDK_BUTTON2_MOTION_MASK as _;
395        /// receive pointer motion events while 3 button is pressed
396        #[doc(alias = "GDK_BUTTON3_MOTION_MASK")]
397        const BUTTON3_MOTION_MASK = ffi::GDK_BUTTON3_MOTION_MASK as _;
398        /// receive button press events
399        #[doc(alias = "GDK_BUTTON_PRESS_MASK")]
400        const BUTTON_PRESS_MASK = ffi::GDK_BUTTON_PRESS_MASK as _;
401        /// receive button release events
402        #[doc(alias = "GDK_BUTTON_RELEASE_MASK")]
403        const BUTTON_RELEASE_MASK = ffi::GDK_BUTTON_RELEASE_MASK as _;
404        /// receive key press events
405        #[doc(alias = "GDK_KEY_PRESS_MASK")]
406        const KEY_PRESS_MASK = ffi::GDK_KEY_PRESS_MASK as _;
407        /// receive key release events
408        #[doc(alias = "GDK_KEY_RELEASE_MASK")]
409        const KEY_RELEASE_MASK = ffi::GDK_KEY_RELEASE_MASK as _;
410        /// receive window enter events
411        #[doc(alias = "GDK_ENTER_NOTIFY_MASK")]
412        const ENTER_NOTIFY_MASK = ffi::GDK_ENTER_NOTIFY_MASK as _;
413        /// receive window leave events
414        #[doc(alias = "GDK_LEAVE_NOTIFY_MASK")]
415        const LEAVE_NOTIFY_MASK = ffi::GDK_LEAVE_NOTIFY_MASK as _;
416        /// receive focus change events
417        #[doc(alias = "GDK_FOCUS_CHANGE_MASK")]
418        const FOCUS_CHANGE_MASK = ffi::GDK_FOCUS_CHANGE_MASK as _;
419        /// receive events about window configuration change
420        #[doc(alias = "GDK_STRUCTURE_MASK")]
421        const STRUCTURE_MASK = ffi::GDK_STRUCTURE_MASK as _;
422        /// receive property change events
423        #[doc(alias = "GDK_PROPERTY_CHANGE_MASK")]
424        const PROPERTY_CHANGE_MASK = ffi::GDK_PROPERTY_CHANGE_MASK as _;
425        /// receive visibility change events
426        #[doc(alias = "GDK_VISIBILITY_NOTIFY_MASK")]
427        const VISIBILITY_NOTIFY_MASK = ffi::GDK_VISIBILITY_NOTIFY_MASK as _;
428        /// receive proximity in events
429        #[doc(alias = "GDK_PROXIMITY_IN_MASK")]
430        const PROXIMITY_IN_MASK = ffi::GDK_PROXIMITY_IN_MASK as _;
431        /// receive proximity out events
432        #[doc(alias = "GDK_PROXIMITY_OUT_MASK")]
433        const PROXIMITY_OUT_MASK = ffi::GDK_PROXIMITY_OUT_MASK as _;
434        /// receive events about window configuration changes of
435        ///  child windows
436        #[doc(alias = "GDK_SUBSTRUCTURE_MASK")]
437        const SUBSTRUCTURE_MASK = ffi::GDK_SUBSTRUCTURE_MASK as _;
438        /// receive scroll events
439        #[doc(alias = "GDK_SCROLL_MASK")]
440        const SCROLL_MASK = ffi::GDK_SCROLL_MASK as _;
441        /// receive touch events. Since 3.4
442        #[doc(alias = "GDK_TOUCH_MASK")]
443        const TOUCH_MASK = ffi::GDK_TOUCH_MASK as _;
444        /// receive smooth scrolling events. Since 3.4
445        #[doc(alias = "GDK_SMOOTH_SCROLL_MASK")]
446        const SMOOTH_SCROLL_MASK = ffi::GDK_SMOOTH_SCROLL_MASK as _;
447        /// receive touchpad gesture events. Since 3.18
448        #[doc(alias = "GDK_TOUCHPAD_GESTURE_MASK")]
449        const TOUCHPAD_GESTURE_MASK = ffi::GDK_TOUCHPAD_GESTURE_MASK as _;
450        /// receive tablet pad events. Since 3.22
451        #[doc(alias = "GDK_TABLET_PAD_MASK")]
452        const TABLET_PAD_MASK = ffi::GDK_TABLET_PAD_MASK as _;
453        /// the combination of all the above event masks.
454        #[doc(alias = "GDK_ALL_EVENTS_MASK")]
455        const ALL_EVENTS_MASK = ffi::GDK_ALL_EVENTS_MASK as _;
456    }
457}
458
459#[doc(hidden)]
460impl IntoGlib for EventMask {
461    type GlibType = ffi::GdkEventMask;
462
463    #[inline]
464    fn into_glib(self) -> ffi::GdkEventMask {
465        self.bits()
466    }
467}
468
469#[doc(hidden)]
470impl FromGlib<ffi::GdkEventMask> for EventMask {
471    #[inline]
472    unsafe fn from_glib(value: ffi::GdkEventMask) -> Self {
473        skip_assert_initialized!();
474        Self::from_bits_truncate(value)
475    }
476}
477
478impl StaticType for EventMask {
479    #[inline]
480    #[doc(alias = "gdk_event_mask_get_type")]
481    fn static_type() -> glib::Type {
482        unsafe { from_glib(ffi::gdk_event_mask_get_type()) }
483    }
484}
485
486impl glib::HasParamSpec for EventMask {
487    type ParamSpec = glib::ParamSpecFlags;
488    type SetValue = Self;
489    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
490
491    fn param_spec_builder() -> Self::BuilderFn {
492        Self::ParamSpec::builder
493    }
494}
495
496impl glib::value::ValueType for EventMask {
497    type Type = Self;
498}
499
500unsafe impl<'a> glib::value::FromValue<'a> for EventMask {
501    type Checker = glib::value::GenericValueTypeChecker<Self>;
502
503    #[inline]
504    unsafe fn from_value(value: &'a glib::Value) -> Self {
505        skip_assert_initialized!();
506        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
507    }
508}
509
510impl ToValue for EventMask {
511    #[inline]
512    fn to_value(&self) -> glib::Value {
513        let mut value = glib::Value::for_value_type::<Self>();
514        unsafe {
515            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
516        }
517        value
518    }
519
520    #[inline]
521    fn value_type(&self) -> glib::Type {
522        Self::static_type()
523    }
524}
525
526impl From<EventMask> for glib::Value {
527    #[inline]
528    fn from(v: EventMask) -> Self {
529        skip_assert_initialized!();
530        ToValue::to_value(&v)
531    }
532}
533
534bitflags! {
535    /// [`FrameClockPhase`][crate::FrameClockPhase] is used to represent the different paint clock
536    /// phases that can be requested. The elements of the enumeration
537    /// correspond to the signals of [`FrameClock`][crate::FrameClock].
538    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
539    #[doc(alias = "GdkFrameClockPhase")]
540    pub struct FrameClockPhase: u32 {
541        /// no phase
542        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_NONE")]
543        const NONE = ffi::GDK_FRAME_CLOCK_PHASE_NONE as _;
544        /// corresponds to GdkFrameClock::flush-events. Should not be handled by applications.
545        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS")]
546        const FLUSH_EVENTS = ffi::GDK_FRAME_CLOCK_PHASE_FLUSH_EVENTS as _;
547        /// corresponds to GdkFrameClock::before-paint. Should not be handled by applications.
548        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT")]
549        const BEFORE_PAINT = ffi::GDK_FRAME_CLOCK_PHASE_BEFORE_PAINT as _;
550        /// corresponds to GdkFrameClock::update.
551        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_UPDATE")]
552        const UPDATE = ffi::GDK_FRAME_CLOCK_PHASE_UPDATE as _;
553        /// corresponds to GdkFrameClock::layout.
554        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_LAYOUT")]
555        const LAYOUT = ffi::GDK_FRAME_CLOCK_PHASE_LAYOUT as _;
556        /// corresponds to GdkFrameClock::paint.
557        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_PAINT")]
558        const PAINT = ffi::GDK_FRAME_CLOCK_PHASE_PAINT as _;
559        /// corresponds to GdkFrameClock::resume-events. Should not be handled by applications.
560        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS")]
561        const RESUME_EVENTS = ffi::GDK_FRAME_CLOCK_PHASE_RESUME_EVENTS as _;
562        /// corresponds to GdkFrameClock::after-paint. Should not be handled by applications.
563        #[doc(alias = "GDK_FRAME_CLOCK_PHASE_AFTER_PAINT")]
564        const AFTER_PAINT = ffi::GDK_FRAME_CLOCK_PHASE_AFTER_PAINT as _;
565    }
566}
567
568#[doc(hidden)]
569impl IntoGlib for FrameClockPhase {
570    type GlibType = ffi::GdkFrameClockPhase;
571
572    #[inline]
573    fn into_glib(self) -> ffi::GdkFrameClockPhase {
574        self.bits()
575    }
576}
577
578#[doc(hidden)]
579impl FromGlib<ffi::GdkFrameClockPhase> for FrameClockPhase {
580    #[inline]
581    unsafe fn from_glib(value: ffi::GdkFrameClockPhase) -> Self {
582        skip_assert_initialized!();
583        Self::from_bits_truncate(value)
584    }
585}
586
587impl StaticType for FrameClockPhase {
588    #[inline]
589    #[doc(alias = "gdk_frame_clock_phase_get_type")]
590    fn static_type() -> glib::Type {
591        unsafe { from_glib(ffi::gdk_frame_clock_phase_get_type()) }
592    }
593}
594
595impl glib::HasParamSpec for FrameClockPhase {
596    type ParamSpec = glib::ParamSpecFlags;
597    type SetValue = Self;
598    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
599
600    fn param_spec_builder() -> Self::BuilderFn {
601        Self::ParamSpec::builder
602    }
603}
604
605impl glib::value::ValueType for FrameClockPhase {
606    type Type = Self;
607}
608
609unsafe impl<'a> glib::value::FromValue<'a> for FrameClockPhase {
610    type Checker = glib::value::GenericValueTypeChecker<Self>;
611
612    #[inline]
613    unsafe fn from_value(value: &'a glib::Value) -> Self {
614        skip_assert_initialized!();
615        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
616    }
617}
618
619impl ToValue for FrameClockPhase {
620    #[inline]
621    fn to_value(&self) -> glib::Value {
622        let mut value = glib::Value::for_value_type::<Self>();
623        unsafe {
624            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
625        }
626        value
627    }
628
629    #[inline]
630    fn value_type(&self) -> glib::Type {
631        Self::static_type()
632    }
633}
634
635impl From<FrameClockPhase> for glib::Value {
636    #[inline]
637    fn from(v: FrameClockPhase) -> Self {
638        skip_assert_initialized!();
639        ToValue::to_value(&v)
640    }
641}
642
643bitflags! {
644    /// A set of bit-flags to indicate the state of modifier keys and mouse buttons
645    /// in various event types. Typical modifier keys are Shift, Control, Meta,
646    /// Super, Hyper, Alt, Compose, Apple, CapsLock or ShiftLock.
647    ///
648    /// Like the X Window System, GDK supports 8 modifier keys and 5 mouse buttons.
649    ///
650    /// Since 2.10, GDK recognizes which of the Meta, Super or Hyper keys are mapped
651    /// to Mod2 - Mod5, and indicates this by setting [`SUPER_MASK`][Self::SUPER_MASK],
652    /// [`HYPER_MASK`][Self::HYPER_MASK] or [`META_MASK`][Self::META_MASK] in the state field of key events.
653    ///
654    /// Note that GDK may add internal values to events which include
655    /// reserved values such as [`MODIFIER_RESERVED_13_MASK`][Self::MODIFIER_RESERVED_13_MASK]. Your code
656    /// should preserve and ignore them. You can use [`MODIFIER_MASK`][Self::MODIFIER_MASK] to
657    /// remove all reserved values.
658    ///
659    /// Also note that the GDK X backend interprets button press events for button
660    /// 4-7 as scroll events, so [`BUTTON4_MASK`][Self::BUTTON4_MASK] and [`BUTTON5_MASK`][Self::BUTTON5_MASK] will never
661    /// be set.
662    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
663    #[doc(alias = "GdkModifierType")]
664    pub struct ModifierType: u32 {
665        /// the Shift key.
666        #[doc(alias = "GDK_SHIFT_MASK")]
667        const SHIFT_MASK = ffi::GDK_SHIFT_MASK as _;
668        /// a Lock key (depending on the modifier mapping of the
669        ///  X server this may either be CapsLock or ShiftLock).
670        #[doc(alias = "GDK_LOCK_MASK")]
671        const LOCK_MASK = ffi::GDK_LOCK_MASK as _;
672        /// the Control key.
673        #[doc(alias = "GDK_CONTROL_MASK")]
674        const CONTROL_MASK = ffi::GDK_CONTROL_MASK as _;
675        /// the fourth modifier key (it depends on the modifier
676        ///  mapping of the X server which key is interpreted as this modifier, but
677        ///  normally it is the Alt key).
678        #[doc(alias = "GDK_MOD1_MASK")]
679        const MOD1_MASK = ffi::GDK_MOD1_MASK as _;
680        /// the fifth modifier key (it depends on the modifier
681        ///  mapping of the X server which key is interpreted as this modifier).
682        #[doc(alias = "GDK_MOD2_MASK")]
683        const MOD2_MASK = ffi::GDK_MOD2_MASK as _;
684        /// the sixth modifier key (it depends on the modifier
685        ///  mapping of the X server which key is interpreted as this modifier).
686        #[doc(alias = "GDK_MOD3_MASK")]
687        const MOD3_MASK = ffi::GDK_MOD3_MASK as _;
688        /// the seventh modifier key (it depends on the modifier
689        ///  mapping of the X server which key is interpreted as this modifier).
690        #[doc(alias = "GDK_MOD4_MASK")]
691        const MOD4_MASK = ffi::GDK_MOD4_MASK as _;
692        /// the eighth modifier key (it depends on the modifier
693        ///  mapping of the X server which key is interpreted as this modifier).
694        #[doc(alias = "GDK_MOD5_MASK")]
695        const MOD5_MASK = ffi::GDK_MOD5_MASK as _;
696        /// the first mouse button.
697        #[doc(alias = "GDK_BUTTON1_MASK")]
698        const BUTTON1_MASK = ffi::GDK_BUTTON1_MASK as _;
699        /// the second mouse button.
700        #[doc(alias = "GDK_BUTTON2_MASK")]
701        const BUTTON2_MASK = ffi::GDK_BUTTON2_MASK as _;
702        /// the third mouse button.
703        #[doc(alias = "GDK_BUTTON3_MASK")]
704        const BUTTON3_MASK = ffi::GDK_BUTTON3_MASK as _;
705        /// the fourth mouse button.
706        #[doc(alias = "GDK_BUTTON4_MASK")]
707        const BUTTON4_MASK = ffi::GDK_BUTTON4_MASK as _;
708        /// the fifth mouse button.
709        #[doc(alias = "GDK_BUTTON5_MASK")]
710        const BUTTON5_MASK = ffi::GDK_BUTTON5_MASK as _;
711        /// A reserved bit flag; do not use in your own code
712        #[doc(alias = "GDK_MODIFIER_RESERVED_13_MASK")]
713        const MODIFIER_RESERVED_13_MASK = ffi::GDK_MODIFIER_RESERVED_13_MASK as _;
714        /// A reserved bit flag; do not use in your own code
715        #[doc(alias = "GDK_MODIFIER_RESERVED_14_MASK")]
716        const MODIFIER_RESERVED_14_MASK = ffi::GDK_MODIFIER_RESERVED_14_MASK as _;
717        /// A reserved bit flag; do not use in your own code
718        #[doc(alias = "GDK_MODIFIER_RESERVED_15_MASK")]
719        const MODIFIER_RESERVED_15_MASK = ffi::GDK_MODIFIER_RESERVED_15_MASK as _;
720        /// A reserved bit flag; do not use in your own code
721        #[doc(alias = "GDK_MODIFIER_RESERVED_16_MASK")]
722        const MODIFIER_RESERVED_16_MASK = ffi::GDK_MODIFIER_RESERVED_16_MASK as _;
723        /// A reserved bit flag; do not use in your own code
724        #[doc(alias = "GDK_MODIFIER_RESERVED_17_MASK")]
725        const MODIFIER_RESERVED_17_MASK = ffi::GDK_MODIFIER_RESERVED_17_MASK as _;
726        /// A reserved bit flag; do not use in your own code
727        #[doc(alias = "GDK_MODIFIER_RESERVED_18_MASK")]
728        const MODIFIER_RESERVED_18_MASK = ffi::GDK_MODIFIER_RESERVED_18_MASK as _;
729        /// A reserved bit flag; do not use in your own code
730        #[doc(alias = "GDK_MODIFIER_RESERVED_19_MASK")]
731        const MODIFIER_RESERVED_19_MASK = ffi::GDK_MODIFIER_RESERVED_19_MASK as _;
732        /// A reserved bit flag; do not use in your own code
733        #[doc(alias = "GDK_MODIFIER_RESERVED_20_MASK")]
734        const MODIFIER_RESERVED_20_MASK = ffi::GDK_MODIFIER_RESERVED_20_MASK as _;
735        /// A reserved bit flag; do not use in your own code
736        #[doc(alias = "GDK_MODIFIER_RESERVED_21_MASK")]
737        const MODIFIER_RESERVED_21_MASK = ffi::GDK_MODIFIER_RESERVED_21_MASK as _;
738        /// A reserved bit flag; do not use in your own code
739        #[doc(alias = "GDK_MODIFIER_RESERVED_22_MASK")]
740        const MODIFIER_RESERVED_22_MASK = ffi::GDK_MODIFIER_RESERVED_22_MASK as _;
741        /// A reserved bit flag; do not use in your own code
742        #[doc(alias = "GDK_MODIFIER_RESERVED_23_MASK")]
743        const MODIFIER_RESERVED_23_MASK = ffi::GDK_MODIFIER_RESERVED_23_MASK as _;
744        /// A reserved bit flag; do not use in your own code
745        #[doc(alias = "GDK_MODIFIER_RESERVED_24_MASK")]
746        const MODIFIER_RESERVED_24_MASK = ffi::GDK_MODIFIER_RESERVED_24_MASK as _;
747        /// A reserved bit flag; do not use in your own code
748        #[doc(alias = "GDK_MODIFIER_RESERVED_25_MASK")]
749        const MODIFIER_RESERVED_25_MASK = ffi::GDK_MODIFIER_RESERVED_25_MASK as _;
750        /// the Super modifier. Since 2.10
751        #[doc(alias = "GDK_SUPER_MASK")]
752        const SUPER_MASK = ffi::GDK_SUPER_MASK as _;
753        /// the Hyper modifier. Since 2.10
754        #[doc(alias = "GDK_HYPER_MASK")]
755        const HYPER_MASK = ffi::GDK_HYPER_MASK as _;
756        /// the Meta modifier. Since 2.10
757        #[doc(alias = "GDK_META_MASK")]
758        const META_MASK = ffi::GDK_META_MASK as _;
759        /// A reserved bit flag; do not use in your own code
760        #[doc(alias = "GDK_MODIFIER_RESERVED_29_MASK")]
761        const MODIFIER_RESERVED_29_MASK = ffi::GDK_MODIFIER_RESERVED_29_MASK as _;
762        /// not used in GDK itself. GTK+ uses it to differentiate
763        ///  between (keyval, modifiers) pairs from key press and release events.
764        #[doc(alias = "GDK_RELEASE_MASK")]
765        const RELEASE_MASK = ffi::GDK_RELEASE_MASK as _;
766        /// a mask covering all modifier types.
767        #[doc(alias = "GDK_MODIFIER_MASK")]
768        const MODIFIER_MASK = ffi::GDK_MODIFIER_MASK as _;
769    }
770}
771
772#[doc(hidden)]
773impl IntoGlib for ModifierType {
774    type GlibType = ffi::GdkModifierType;
775
776    #[inline]
777    fn into_glib(self) -> ffi::GdkModifierType {
778        self.bits()
779    }
780}
781
782#[doc(hidden)]
783impl FromGlib<ffi::GdkModifierType> for ModifierType {
784    #[inline]
785    unsafe fn from_glib(value: ffi::GdkModifierType) -> Self {
786        skip_assert_initialized!();
787        Self::from_bits_truncate(value)
788    }
789}
790
791impl StaticType for ModifierType {
792    #[inline]
793    #[doc(alias = "gdk_modifier_type_get_type")]
794    fn static_type() -> glib::Type {
795        unsafe { from_glib(ffi::gdk_modifier_type_get_type()) }
796    }
797}
798
799impl glib::HasParamSpec for ModifierType {
800    type ParamSpec = glib::ParamSpecFlags;
801    type SetValue = Self;
802    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
803
804    fn param_spec_builder() -> Self::BuilderFn {
805        Self::ParamSpec::builder
806    }
807}
808
809impl glib::value::ValueType for ModifierType {
810    type Type = Self;
811}
812
813unsafe impl<'a> glib::value::FromValue<'a> for ModifierType {
814    type Checker = glib::value::GenericValueTypeChecker<Self>;
815
816    #[inline]
817    unsafe fn from_value(value: &'a glib::Value) -> Self {
818        skip_assert_initialized!();
819        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
820    }
821}
822
823impl ToValue for ModifierType {
824    #[inline]
825    fn to_value(&self) -> glib::Value {
826        let mut value = glib::Value::for_value_type::<Self>();
827        unsafe {
828            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
829        }
830        value
831    }
832
833    #[inline]
834    fn value_type(&self) -> glib::Type {
835        Self::static_type()
836    }
837}
838
839impl From<ModifierType> for glib::Value {
840    #[inline]
841    fn from(v: ModifierType) -> Self {
842        skip_assert_initialized!();
843        ToValue::to_value(&v)
844    }
845}
846
847bitflags! {
848    /// Flags describing the seat capabilities.
849    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
850    #[doc(alias = "GdkSeatCapabilities")]
851    pub struct SeatCapabilities: u32 {
852        /// No input capabilities
853        #[doc(alias = "GDK_SEAT_CAPABILITY_NONE")]
854        const NONE = ffi::GDK_SEAT_CAPABILITY_NONE as _;
855        /// The seat has a pointer (e.g. mouse)
856        #[doc(alias = "GDK_SEAT_CAPABILITY_POINTER")]
857        const POINTER = ffi::GDK_SEAT_CAPABILITY_POINTER as _;
858        /// The seat has touchscreen(s) attached
859        #[doc(alias = "GDK_SEAT_CAPABILITY_TOUCH")]
860        const TOUCH = ffi::GDK_SEAT_CAPABILITY_TOUCH as _;
861        /// The seat has drawing tablet(s) attached
862        #[doc(alias = "GDK_SEAT_CAPABILITY_TABLET_STYLUS")]
863        const TABLET_STYLUS = ffi::GDK_SEAT_CAPABILITY_TABLET_STYLUS as _;
864        /// The seat has keyboard(s) attached
865        #[doc(alias = "GDK_SEAT_CAPABILITY_KEYBOARD")]
866        const KEYBOARD = ffi::GDK_SEAT_CAPABILITY_KEYBOARD as _;
867        /// The union of all pointing capabilities
868        #[doc(alias = "GDK_SEAT_CAPABILITY_ALL_POINTING")]
869        const ALL_POINTING = ffi::GDK_SEAT_CAPABILITY_ALL_POINTING as _;
870        /// The union of all capabilities
871        #[doc(alias = "GDK_SEAT_CAPABILITY_ALL")]
872        const ALL = ffi::GDK_SEAT_CAPABILITY_ALL as _;
873    }
874}
875
876#[doc(hidden)]
877impl IntoGlib for SeatCapabilities {
878    type GlibType = ffi::GdkSeatCapabilities;
879
880    #[inline]
881    fn into_glib(self) -> ffi::GdkSeatCapabilities {
882        self.bits()
883    }
884}
885
886#[doc(hidden)]
887impl FromGlib<ffi::GdkSeatCapabilities> for SeatCapabilities {
888    #[inline]
889    unsafe fn from_glib(value: ffi::GdkSeatCapabilities) -> Self {
890        skip_assert_initialized!();
891        Self::from_bits_truncate(value)
892    }
893}
894
895impl StaticType for SeatCapabilities {
896    #[inline]
897    #[doc(alias = "gdk_seat_capabilities_get_type")]
898    fn static_type() -> glib::Type {
899        unsafe { from_glib(ffi::gdk_seat_capabilities_get_type()) }
900    }
901}
902
903impl glib::HasParamSpec for SeatCapabilities {
904    type ParamSpec = glib::ParamSpecFlags;
905    type SetValue = Self;
906    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
907
908    fn param_spec_builder() -> Self::BuilderFn {
909        Self::ParamSpec::builder
910    }
911}
912
913impl glib::value::ValueType for SeatCapabilities {
914    type Type = Self;
915}
916
917unsafe impl<'a> glib::value::FromValue<'a> for SeatCapabilities {
918    type Checker = glib::value::GenericValueTypeChecker<Self>;
919
920    #[inline]
921    unsafe fn from_value(value: &'a glib::Value) -> Self {
922        skip_assert_initialized!();
923        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
924    }
925}
926
927impl ToValue for SeatCapabilities {
928    #[inline]
929    fn to_value(&self) -> glib::Value {
930        let mut value = glib::Value::for_value_type::<Self>();
931        unsafe {
932            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
933        }
934        value
935    }
936
937    #[inline]
938    fn value_type(&self) -> glib::Type {
939        Self::static_type()
940    }
941}
942
943impl From<SeatCapabilities> for glib::Value {
944    #[inline]
945    fn from(v: SeatCapabilities) -> Self {
946        skip_assert_initialized!();
947        ToValue::to_value(&v)
948    }
949}
950
951bitflags! {
952    /// These are hints originally defined by the Motif toolkit.
953    /// The window manager can use them when determining how to decorate
954    /// the window. The hint must be set before mapping the window.
955    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
956    #[doc(alias = "GdkWMDecoration")]
957    pub struct WMDecoration: u32 {
958        /// all decorations should be applied.
959        #[doc(alias = "GDK_DECOR_ALL")]
960        const ALL = ffi::GDK_DECOR_ALL as _;
961        /// a frame should be drawn around the window.
962        #[doc(alias = "GDK_DECOR_BORDER")]
963        const BORDER = ffi::GDK_DECOR_BORDER as _;
964        /// the frame should have resize handles.
965        #[doc(alias = "GDK_DECOR_RESIZEH")]
966        const RESIZEH = ffi::GDK_DECOR_RESIZEH as _;
967        /// a titlebar should be placed above the window.
968        #[doc(alias = "GDK_DECOR_TITLE")]
969        const TITLE = ffi::GDK_DECOR_TITLE as _;
970        /// a button for opening a menu should be included.
971        #[doc(alias = "GDK_DECOR_MENU")]
972        const MENU = ffi::GDK_DECOR_MENU as _;
973        /// a minimize button should be included.
974        #[doc(alias = "GDK_DECOR_MINIMIZE")]
975        const MINIMIZE = ffi::GDK_DECOR_MINIMIZE as _;
976        /// a maximize button should be included.
977        #[doc(alias = "GDK_DECOR_MAXIMIZE")]
978        const MAXIMIZE = ffi::GDK_DECOR_MAXIMIZE as _;
979    }
980}
981
982#[doc(hidden)]
983impl IntoGlib for WMDecoration {
984    type GlibType = ffi::GdkWMDecoration;
985
986    #[inline]
987    fn into_glib(self) -> ffi::GdkWMDecoration {
988        self.bits()
989    }
990}
991
992#[doc(hidden)]
993impl FromGlib<ffi::GdkWMDecoration> for WMDecoration {
994    #[inline]
995    unsafe fn from_glib(value: ffi::GdkWMDecoration) -> Self {
996        skip_assert_initialized!();
997        Self::from_bits_truncate(value)
998    }
999}
1000
1001impl StaticType for WMDecoration {
1002    #[inline]
1003    #[doc(alias = "gdk_wm_decoration_get_type")]
1004    fn static_type() -> glib::Type {
1005        unsafe { from_glib(ffi::gdk_wm_decoration_get_type()) }
1006    }
1007}
1008
1009impl glib::HasParamSpec for WMDecoration {
1010    type ParamSpec = glib::ParamSpecFlags;
1011    type SetValue = Self;
1012    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1013
1014    fn param_spec_builder() -> Self::BuilderFn {
1015        Self::ParamSpec::builder
1016    }
1017}
1018
1019impl glib::value::ValueType for WMDecoration {
1020    type Type = Self;
1021}
1022
1023unsafe impl<'a> glib::value::FromValue<'a> for WMDecoration {
1024    type Checker = glib::value::GenericValueTypeChecker<Self>;
1025
1026    #[inline]
1027    unsafe fn from_value(value: &'a glib::Value) -> Self {
1028        skip_assert_initialized!();
1029        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1030    }
1031}
1032
1033impl ToValue for WMDecoration {
1034    #[inline]
1035    fn to_value(&self) -> glib::Value {
1036        let mut value = glib::Value::for_value_type::<Self>();
1037        unsafe {
1038            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1039        }
1040        value
1041    }
1042
1043    #[inline]
1044    fn value_type(&self) -> glib::Type {
1045        Self::static_type()
1046    }
1047}
1048
1049impl From<WMDecoration> for glib::Value {
1050    #[inline]
1051    fn from(v: WMDecoration) -> Self {
1052        skip_assert_initialized!();
1053        ToValue::to_value(&v)
1054    }
1055}
1056
1057bitflags! {
1058    /// These are hints originally defined by the Motif toolkit. The window manager
1059    /// can use them when determining the functions to offer for the window. The
1060    /// hint must be set before mapping the window.
1061    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1062    #[doc(alias = "GdkWMFunction")]
1063    pub struct WMFunction: u32 {
1064        /// all functions should be offered.
1065        #[doc(alias = "GDK_FUNC_ALL")]
1066        const ALL = ffi::GDK_FUNC_ALL as _;
1067        /// the window should be resizable.
1068        #[doc(alias = "GDK_FUNC_RESIZE")]
1069        const RESIZE = ffi::GDK_FUNC_RESIZE as _;
1070        /// the window should be movable.
1071        #[doc(alias = "GDK_FUNC_MOVE")]
1072        const MOVE = ffi::GDK_FUNC_MOVE as _;
1073        /// the window should be minimizable.
1074        #[doc(alias = "GDK_FUNC_MINIMIZE")]
1075        const MINIMIZE = ffi::GDK_FUNC_MINIMIZE as _;
1076        /// the window should be maximizable.
1077        #[doc(alias = "GDK_FUNC_MAXIMIZE")]
1078        const MAXIMIZE = ffi::GDK_FUNC_MAXIMIZE as _;
1079        /// the window should be closable.
1080        #[doc(alias = "GDK_FUNC_CLOSE")]
1081        const CLOSE = ffi::GDK_FUNC_CLOSE as _;
1082    }
1083}
1084
1085#[doc(hidden)]
1086impl IntoGlib for WMFunction {
1087    type GlibType = ffi::GdkWMFunction;
1088
1089    #[inline]
1090    fn into_glib(self) -> ffi::GdkWMFunction {
1091        self.bits()
1092    }
1093}
1094
1095#[doc(hidden)]
1096impl FromGlib<ffi::GdkWMFunction> for WMFunction {
1097    #[inline]
1098    unsafe fn from_glib(value: ffi::GdkWMFunction) -> Self {
1099        skip_assert_initialized!();
1100        Self::from_bits_truncate(value)
1101    }
1102}
1103
1104impl StaticType for WMFunction {
1105    #[inline]
1106    #[doc(alias = "gdk_wm_function_get_type")]
1107    fn static_type() -> glib::Type {
1108        unsafe { from_glib(ffi::gdk_wm_function_get_type()) }
1109    }
1110}
1111
1112impl glib::HasParamSpec for WMFunction {
1113    type ParamSpec = glib::ParamSpecFlags;
1114    type SetValue = Self;
1115    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1116
1117    fn param_spec_builder() -> Self::BuilderFn {
1118        Self::ParamSpec::builder
1119    }
1120}
1121
1122impl glib::value::ValueType for WMFunction {
1123    type Type = Self;
1124}
1125
1126unsafe impl<'a> glib::value::FromValue<'a> for WMFunction {
1127    type Checker = glib::value::GenericValueTypeChecker<Self>;
1128
1129    #[inline]
1130    unsafe fn from_value(value: &'a glib::Value) -> Self {
1131        skip_assert_initialized!();
1132        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1133    }
1134}
1135
1136impl ToValue for WMFunction {
1137    #[inline]
1138    fn to_value(&self) -> glib::Value {
1139        let mut value = glib::Value::for_value_type::<Self>();
1140        unsafe {
1141            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1142        }
1143        value
1144    }
1145
1146    #[inline]
1147    fn value_type(&self) -> glib::Type {
1148        Self::static_type()
1149    }
1150}
1151
1152impl From<WMFunction> for glib::Value {
1153    #[inline]
1154    fn from(v: WMFunction) -> Self {
1155        skip_assert_initialized!();
1156        ToValue::to_value(&v)
1157    }
1158}
1159
1160bitflags! {
1161    /// Used to indicate which fields of a [`Geometry`][crate::Geometry] struct should be paid
1162    /// attention to. Also, the presence/absence of [`POS`][Self::POS],
1163    /// [`USER_POS`][Self::USER_POS], and [`USER_SIZE`][Self::USER_SIZE] is significant, though they don't
1164    /// directly refer to [`Geometry`][crate::Geometry] fields. [`USER_POS`][Self::USER_POS] will be set
1165    /// automatically by `GtkWindow` if you call `gtk_window_move()`.
1166    /// [`USER_POS`][Self::USER_POS] and [`USER_SIZE`][Self::USER_SIZE] should be set if the user
1167    /// specified a size/position using a --geometry command-line argument;
1168    /// `gtk_window_parse_geometry()` automatically sets these flags.
1169    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1170    #[doc(alias = "GdkWindowHints")]
1171    pub struct WindowHints: u32 {
1172        /// indicates that the program has positioned the window
1173        #[doc(alias = "GDK_HINT_POS")]
1174        const POS = ffi::GDK_HINT_POS as _;
1175        /// min size fields are set
1176        #[doc(alias = "GDK_HINT_MIN_SIZE")]
1177        const MIN_SIZE = ffi::GDK_HINT_MIN_SIZE as _;
1178        /// max size fields are set
1179        #[doc(alias = "GDK_HINT_MAX_SIZE")]
1180        const MAX_SIZE = ffi::GDK_HINT_MAX_SIZE as _;
1181        /// base size fields are set
1182        #[doc(alias = "GDK_HINT_BASE_SIZE")]
1183        const BASE_SIZE = ffi::GDK_HINT_BASE_SIZE as _;
1184        /// aspect ratio fields are set
1185        #[doc(alias = "GDK_HINT_ASPECT")]
1186        const ASPECT = ffi::GDK_HINT_ASPECT as _;
1187        /// resize increment fields are set
1188        #[doc(alias = "GDK_HINT_RESIZE_INC")]
1189        const RESIZE_INC = ffi::GDK_HINT_RESIZE_INC as _;
1190        /// window gravity field is set
1191        #[doc(alias = "GDK_HINT_WIN_GRAVITY")]
1192        const WIN_GRAVITY = ffi::GDK_HINT_WIN_GRAVITY as _;
1193        /// indicates that the window’s position was explicitly set
1194        ///  by the user
1195        #[doc(alias = "GDK_HINT_USER_POS")]
1196        const USER_POS = ffi::GDK_HINT_USER_POS as _;
1197        /// indicates that the window’s size was explicitly set by
1198        ///  the user
1199        #[doc(alias = "GDK_HINT_USER_SIZE")]
1200        const USER_SIZE = ffi::GDK_HINT_USER_SIZE as _;
1201    }
1202}
1203
1204#[doc(hidden)]
1205impl IntoGlib for WindowHints {
1206    type GlibType = ffi::GdkWindowHints;
1207
1208    #[inline]
1209    fn into_glib(self) -> ffi::GdkWindowHints {
1210        self.bits()
1211    }
1212}
1213
1214#[doc(hidden)]
1215impl FromGlib<ffi::GdkWindowHints> for WindowHints {
1216    #[inline]
1217    unsafe fn from_glib(value: ffi::GdkWindowHints) -> Self {
1218        skip_assert_initialized!();
1219        Self::from_bits_truncate(value)
1220    }
1221}
1222
1223impl StaticType for WindowHints {
1224    #[inline]
1225    #[doc(alias = "gdk_window_hints_get_type")]
1226    fn static_type() -> glib::Type {
1227        unsafe { from_glib(ffi::gdk_window_hints_get_type()) }
1228    }
1229}
1230
1231impl glib::HasParamSpec for WindowHints {
1232    type ParamSpec = glib::ParamSpecFlags;
1233    type SetValue = Self;
1234    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1235
1236    fn param_spec_builder() -> Self::BuilderFn {
1237        Self::ParamSpec::builder
1238    }
1239}
1240
1241impl glib::value::ValueType for WindowHints {
1242    type Type = Self;
1243}
1244
1245unsafe impl<'a> glib::value::FromValue<'a> for WindowHints {
1246    type Checker = glib::value::GenericValueTypeChecker<Self>;
1247
1248    #[inline]
1249    unsafe fn from_value(value: &'a glib::Value) -> Self {
1250        skip_assert_initialized!();
1251        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1252    }
1253}
1254
1255impl ToValue for WindowHints {
1256    #[inline]
1257    fn to_value(&self) -> glib::Value {
1258        let mut value = glib::Value::for_value_type::<Self>();
1259        unsafe {
1260            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1261        }
1262        value
1263    }
1264
1265    #[inline]
1266    fn value_type(&self) -> glib::Type {
1267        Self::static_type()
1268    }
1269}
1270
1271impl From<WindowHints> for glib::Value {
1272    #[inline]
1273    fn from(v: WindowHints) -> Self {
1274        skip_assert_initialized!();
1275        ToValue::to_value(&v)
1276    }
1277}
1278
1279bitflags! {
1280    /// Specifies the state of a toplevel window.
1281    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
1282    #[doc(alias = "GdkWindowState")]
1283    pub struct WindowState: u32 {
1284        /// the window is not shown.
1285        #[doc(alias = "GDK_WINDOW_STATE_WITHDRAWN")]
1286        const WITHDRAWN = ffi::GDK_WINDOW_STATE_WITHDRAWN as _;
1287        /// the window is minimized.
1288        #[doc(alias = "GDK_WINDOW_STATE_ICONIFIED")]
1289        const ICONIFIED = ffi::GDK_WINDOW_STATE_ICONIFIED as _;
1290        /// the window is maximized.
1291        #[doc(alias = "GDK_WINDOW_STATE_MAXIMIZED")]
1292        const MAXIMIZED = ffi::GDK_WINDOW_STATE_MAXIMIZED as _;
1293        /// the window is sticky.
1294        #[doc(alias = "GDK_WINDOW_STATE_STICKY")]
1295        const STICKY = ffi::GDK_WINDOW_STATE_STICKY as _;
1296        /// the window is maximized without
1297        ///  decorations.
1298        #[doc(alias = "GDK_WINDOW_STATE_FULLSCREEN")]
1299        const FULLSCREEN = ffi::GDK_WINDOW_STATE_FULLSCREEN as _;
1300        /// the window is kept above other windows.
1301        #[doc(alias = "GDK_WINDOW_STATE_ABOVE")]
1302        const ABOVE = ffi::GDK_WINDOW_STATE_ABOVE as _;
1303        /// the window is kept below other windows.
1304        #[doc(alias = "GDK_WINDOW_STATE_BELOW")]
1305        const BELOW = ffi::GDK_WINDOW_STATE_BELOW as _;
1306        /// the window is presented as focused (with active decorations).
1307        #[doc(alias = "GDK_WINDOW_STATE_FOCUSED")]
1308        const FOCUSED = ffi::GDK_WINDOW_STATE_FOCUSED as _;
1309        /// the window is in a tiled state, Since 3.10. Since 3.22.23, this
1310        ///  is deprecated in favor of per-edge information.
1311        #[doc(alias = "GDK_WINDOW_STATE_TILED")]
1312        const TILED = ffi::GDK_WINDOW_STATE_TILED as _;
1313        /// whether the top edge is tiled, Since 3.22.23
1314        #[doc(alias = "GDK_WINDOW_STATE_TOP_TILED")]
1315        const TOP_TILED = ffi::GDK_WINDOW_STATE_TOP_TILED as _;
1316        /// whether the top edge is resizable, Since 3.22.23
1317        #[doc(alias = "GDK_WINDOW_STATE_TOP_RESIZABLE")]
1318        const TOP_RESIZABLE = ffi::GDK_WINDOW_STATE_TOP_RESIZABLE as _;
1319        /// whether the right edge is tiled, Since 3.22.23
1320        #[doc(alias = "GDK_WINDOW_STATE_RIGHT_TILED")]
1321        const RIGHT_TILED = ffi::GDK_WINDOW_STATE_RIGHT_TILED as _;
1322        /// whether the right edge is resizable, Since 3.22.23
1323        #[doc(alias = "GDK_WINDOW_STATE_RIGHT_RESIZABLE")]
1324        const RIGHT_RESIZABLE = ffi::GDK_WINDOW_STATE_RIGHT_RESIZABLE as _;
1325        /// whether the bottom edge is tiled, Since 3.22.23
1326        #[doc(alias = "GDK_WINDOW_STATE_BOTTOM_TILED")]
1327        const BOTTOM_TILED = ffi::GDK_WINDOW_STATE_BOTTOM_TILED as _;
1328        /// whether the bottom edge is resizable, Since 3.22.23
1329        #[doc(alias = "GDK_WINDOW_STATE_BOTTOM_RESIZABLE")]
1330        const BOTTOM_RESIZABLE = ffi::GDK_WINDOW_STATE_BOTTOM_RESIZABLE as _;
1331        /// whether the left edge is tiled, Since 3.22.23
1332        #[doc(alias = "GDK_WINDOW_STATE_LEFT_TILED")]
1333        const LEFT_TILED = ffi::GDK_WINDOW_STATE_LEFT_TILED as _;
1334        /// whether the left edge is resizable, Since 3.22.23
1335        #[doc(alias = "GDK_WINDOW_STATE_LEFT_RESIZABLE")]
1336        const LEFT_RESIZABLE = ffi::GDK_WINDOW_STATE_LEFT_RESIZABLE as _;
1337    }
1338}
1339
1340#[doc(hidden)]
1341impl IntoGlib for WindowState {
1342    type GlibType = ffi::GdkWindowState;
1343
1344    #[inline]
1345    fn into_glib(self) -> ffi::GdkWindowState {
1346        self.bits()
1347    }
1348}
1349
1350#[doc(hidden)]
1351impl FromGlib<ffi::GdkWindowState> for WindowState {
1352    #[inline]
1353    unsafe fn from_glib(value: ffi::GdkWindowState) -> Self {
1354        skip_assert_initialized!();
1355        Self::from_bits_truncate(value)
1356    }
1357}
1358
1359impl StaticType for WindowState {
1360    #[inline]
1361    #[doc(alias = "gdk_window_state_get_type")]
1362    fn static_type() -> glib::Type {
1363        unsafe { from_glib(ffi::gdk_window_state_get_type()) }
1364    }
1365}
1366
1367impl glib::HasParamSpec for WindowState {
1368    type ParamSpec = glib::ParamSpecFlags;
1369    type SetValue = Self;
1370    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
1371
1372    fn param_spec_builder() -> Self::BuilderFn {
1373        Self::ParamSpec::builder
1374    }
1375}
1376
1377impl glib::value::ValueType for WindowState {
1378    type Type = Self;
1379}
1380
1381unsafe impl<'a> glib::value::FromValue<'a> for WindowState {
1382    type Checker = glib::value::GenericValueTypeChecker<Self>;
1383
1384    #[inline]
1385    unsafe fn from_value(value: &'a glib::Value) -> Self {
1386        skip_assert_initialized!();
1387        unsafe { from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0)) }
1388    }
1389}
1390
1391impl ToValue for WindowState {
1392    #[inline]
1393    fn to_value(&self) -> glib::Value {
1394        let mut value = glib::Value::for_value_type::<Self>();
1395        unsafe {
1396            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
1397        }
1398        value
1399    }
1400
1401    #[inline]
1402    fn value_type(&self) -> glib::Type {
1403        Self::static_type()
1404    }
1405}
1406
1407impl From<WindowState> for glib::Value {
1408    #[inline]
1409    fn from(v: WindowState) -> Self {
1410        skip_assert_initialized!();
1411        ToValue::to_value(&v)
1412    }
1413}