1use gdk_sys;
6use glib::translate::*;
7use glib::value::FromValue;
8use glib::value::FromValueOptional;
9use glib::value::SetValue;
10use glib::value::Value;
11use glib::StaticType;
12use glib::Type;
13use gobject_sys;
14
15#[cfg(any(feature = "v3_22", feature = "dox"))]
16bitflags! {
17 pub struct AnchorHints: u32 {
18 const FLIP_X = 1;
19 const FLIP_Y = 2;
20 const SLIDE_X = 4;
21 const SLIDE_Y = 8;
22 const RESIZE_X = 16;
23 const RESIZE_Y = 32;
24 const FLIP = 3;
25 const SLIDE = 12;
26 const RESIZE = 48;
27 }
28}
29
30#[cfg(any(feature = "v3_22", feature = "dox"))]
31#[doc(hidden)]
32impl ToGlib for AnchorHints {
33 type GlibType = gdk_sys::GdkAnchorHints;
34
35 fn to_glib(&self) -> gdk_sys::GdkAnchorHints {
36 self.bits()
37 }
38}
39
40#[cfg(any(feature = "v3_22", feature = "dox"))]
41#[doc(hidden)]
42impl FromGlib<gdk_sys::GdkAnchorHints> for AnchorHints {
43 fn from_glib(value: gdk_sys::GdkAnchorHints) -> AnchorHints {
44 skip_assert_initialized!();
45 AnchorHints::from_bits_truncate(value)
46 }
47}
48
49#[cfg(any(feature = "v3_22", feature = "dox"))]
50impl StaticType for AnchorHints {
51 fn static_type() -> Type {
52 unsafe { from_glib(gdk_sys::gdk_anchor_hints_get_type()) }
53 }
54}
55
56#[cfg(any(feature = "v3_22", feature = "dox"))]
57impl<'a> FromValueOptional<'a> for AnchorHints {
58 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
59 Some(FromValue::from_value(value))
60 }
61}
62
63#[cfg(any(feature = "v3_22", feature = "dox"))]
64impl<'a> FromValue<'a> for AnchorHints {
65 unsafe fn from_value(value: &Value) -> Self {
66 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
67 }
68}
69
70#[cfg(any(feature = "v3_22", feature = "dox"))]
71impl SetValue for AnchorHints {
72 unsafe fn set_value(value: &mut Value, this: &Self) {
73 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
74 }
75}
76
77#[cfg(any(feature = "v3_22", feature = "dox"))]
78bitflags! {
79 pub struct AxisFlags: u32 {
80 const X = 2;
81 const Y = 4;
82 const PRESSURE = 8;
83 const XTILT = 16;
84 const YTILT = 32;
85 const WHEEL = 64;
86 const DISTANCE = 128;
87 const ROTATION = 256;
88 const SLIDER = 512;
89 }
90}
91
92#[cfg(any(feature = "v3_22", feature = "dox"))]
93#[doc(hidden)]
94impl ToGlib for AxisFlags {
95 type GlibType = gdk_sys::GdkAxisFlags;
96
97 fn to_glib(&self) -> gdk_sys::GdkAxisFlags {
98 self.bits()
99 }
100}
101
102#[cfg(any(feature = "v3_22", feature = "dox"))]
103#[doc(hidden)]
104impl FromGlib<gdk_sys::GdkAxisFlags> for AxisFlags {
105 fn from_glib(value: gdk_sys::GdkAxisFlags) -> AxisFlags {
106 skip_assert_initialized!();
107 AxisFlags::from_bits_truncate(value)
108 }
109}
110
111#[cfg(any(feature = "v3_22", feature = "dox"))]
112impl StaticType for AxisFlags {
113 fn static_type() -> Type {
114 unsafe { from_glib(gdk_sys::gdk_axis_flags_get_type()) }
115 }
116}
117
118#[cfg(any(feature = "v3_22", feature = "dox"))]
119impl<'a> FromValueOptional<'a> for AxisFlags {
120 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
121 Some(FromValue::from_value(value))
122 }
123}
124
125#[cfg(any(feature = "v3_22", feature = "dox"))]
126impl<'a> FromValue<'a> for AxisFlags {
127 unsafe fn from_value(value: &Value) -> Self {
128 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
129 }
130}
131
132#[cfg(any(feature = "v3_22", feature = "dox"))]
133impl SetValue for AxisFlags {
134 unsafe fn set_value(value: &mut Value, this: &Self) {
135 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
136 }
137}
138
139bitflags! {
140 pub struct DragAction: u32 {
141 const DEFAULT = 1;
142 const COPY = 2;
143 const MOVE = 4;
144 const LINK = 8;
145 const PRIVATE = 16;
146 const ASK = 32;
147 }
148}
149
150#[doc(hidden)]
151impl ToGlib for DragAction {
152 type GlibType = gdk_sys::GdkDragAction;
153
154 fn to_glib(&self) -> gdk_sys::GdkDragAction {
155 self.bits()
156 }
157}
158
159#[doc(hidden)]
160impl FromGlib<gdk_sys::GdkDragAction> for DragAction {
161 fn from_glib(value: gdk_sys::GdkDragAction) -> DragAction {
162 skip_assert_initialized!();
163 DragAction::from_bits_truncate(value)
164 }
165}
166
167impl StaticType for DragAction {
168 fn static_type() -> Type {
169 unsafe { from_glib(gdk_sys::gdk_drag_action_get_type()) }
170 }
171}
172
173impl<'a> FromValueOptional<'a> for DragAction {
174 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
175 Some(FromValue::from_value(value))
176 }
177}
178
179impl<'a> FromValue<'a> for DragAction {
180 unsafe fn from_value(value: &Value) -> Self {
181 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
182 }
183}
184
185impl SetValue for DragAction {
186 unsafe fn set_value(value: &mut Value, this: &Self) {
187 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
188 }
189}
190
191bitflags! {
192 pub struct EventMask: u32 {
193 const EXPOSURE_MASK = 2;
194 const POINTER_MOTION_MASK = 4;
195 const POINTER_MOTION_HINT_MASK = 8;
196 const BUTTON_MOTION_MASK = 16;
197 const BUTTON1_MOTION_MASK = 32;
198 const BUTTON2_MOTION_MASK = 64;
199 const BUTTON3_MOTION_MASK = 128;
200 const BUTTON_PRESS_MASK = 256;
201 const BUTTON_RELEASE_MASK = 512;
202 const KEY_PRESS_MASK = 1024;
203 const KEY_RELEASE_MASK = 2048;
204 const ENTER_NOTIFY_MASK = 4096;
205 const LEAVE_NOTIFY_MASK = 8192;
206 const FOCUS_CHANGE_MASK = 16384;
207 const STRUCTURE_MASK = 32768;
208 const PROPERTY_CHANGE_MASK = 65536;
209 const VISIBILITY_NOTIFY_MASK = 131072;
210 const PROXIMITY_IN_MASK = 262144;
211 const PROXIMITY_OUT_MASK = 524288;
212 const SUBSTRUCTURE_MASK = 1048576;
213 const SCROLL_MASK = 2097152;
214 const TOUCH_MASK = 4194304;
215 const SMOOTH_SCROLL_MASK = 8388608;
216 const TOUCHPAD_GESTURE_MASK = 16777216;
217 const TABLET_PAD_MASK = 33554432;
218 const ALL_EVENTS_MASK = 67108862;
219 }
220}
221
222#[doc(hidden)]
223impl ToGlib for EventMask {
224 type GlibType = gdk_sys::GdkEventMask;
225
226 fn to_glib(&self) -> gdk_sys::GdkEventMask {
227 self.bits()
228 }
229}
230
231#[doc(hidden)]
232impl FromGlib<gdk_sys::GdkEventMask> for EventMask {
233 fn from_glib(value: gdk_sys::GdkEventMask) -> EventMask {
234 skip_assert_initialized!();
235 EventMask::from_bits_truncate(value)
236 }
237}
238
239impl StaticType for EventMask {
240 fn static_type() -> Type {
241 unsafe { from_glib(gdk_sys::gdk_event_mask_get_type()) }
242 }
243}
244
245impl<'a> FromValueOptional<'a> for EventMask {
246 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
247 Some(FromValue::from_value(value))
248 }
249}
250
251impl<'a> FromValue<'a> for EventMask {
252 unsafe fn from_value(value: &Value) -> Self {
253 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
254 }
255}
256
257impl SetValue for EventMask {
258 unsafe fn set_value(value: &mut Value, this: &Self) {
259 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
260 }
261}
262
263bitflags! {
264 pub struct FrameClockPhase: u32 {
265 const NONE = 0;
266 const FLUSH_EVENTS = 1;
267 const BEFORE_PAINT = 2;
268 const UPDATE = 4;
269 const LAYOUT = 8;
270 const PAINT = 16;
271 const RESUME_EVENTS = 32;
272 const AFTER_PAINT = 64;
273 }
274}
275
276#[doc(hidden)]
277impl ToGlib for FrameClockPhase {
278 type GlibType = gdk_sys::GdkFrameClockPhase;
279
280 fn to_glib(&self) -> gdk_sys::GdkFrameClockPhase {
281 self.bits()
282 }
283}
284
285#[doc(hidden)]
286impl FromGlib<gdk_sys::GdkFrameClockPhase> for FrameClockPhase {
287 fn from_glib(value: gdk_sys::GdkFrameClockPhase) -> FrameClockPhase {
288 skip_assert_initialized!();
289 FrameClockPhase::from_bits_truncate(value)
290 }
291}
292
293impl StaticType for FrameClockPhase {
294 fn static_type() -> Type {
295 unsafe { from_glib(gdk_sys::gdk_frame_clock_phase_get_type()) }
296 }
297}
298
299impl<'a> FromValueOptional<'a> for FrameClockPhase {
300 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
301 Some(FromValue::from_value(value))
302 }
303}
304
305impl<'a> FromValue<'a> for FrameClockPhase {
306 unsafe fn from_value(value: &Value) -> Self {
307 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
308 }
309}
310
311impl SetValue for FrameClockPhase {
312 unsafe fn set_value(value: &mut Value, this: &Self) {
313 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
314 }
315}
316
317bitflags! {
318 pub struct ModifierType: u32 {
319 const SHIFT_MASK = 1;
320 const LOCK_MASK = 2;
321 const CONTROL_MASK = 4;
322 const MOD1_MASK = 8;
323 const MOD2_MASK = 16;
324 const MOD3_MASK = 32;
325 const MOD4_MASK = 64;
326 const MOD5_MASK = 128;
327 const BUTTON1_MASK = 256;
328 const BUTTON2_MASK = 512;
329 const BUTTON3_MASK = 1024;
330 const BUTTON4_MASK = 2048;
331 const BUTTON5_MASK = 4096;
332 const MODIFIER_RESERVED_13_MASK = 8192;
333 const MODIFIER_RESERVED_14_MASK = 16384;
334 const MODIFIER_RESERVED_15_MASK = 32768;
335 const MODIFIER_RESERVED_16_MASK = 65536;
336 const MODIFIER_RESERVED_17_MASK = 131072;
337 const MODIFIER_RESERVED_18_MASK = 262144;
338 const MODIFIER_RESERVED_19_MASK = 524288;
339 const MODIFIER_RESERVED_20_MASK = 1048576;
340 const MODIFIER_RESERVED_21_MASK = 2097152;
341 const MODIFIER_RESERVED_22_MASK = 4194304;
342 const MODIFIER_RESERVED_23_MASK = 8388608;
343 const MODIFIER_RESERVED_24_MASK = 16777216;
344 const MODIFIER_RESERVED_25_MASK = 33554432;
345 const SUPER_MASK = 67108864;
346 const HYPER_MASK = 134217728;
347 const META_MASK = 268435456;
348 const MODIFIER_RESERVED_29_MASK = 536870912;
349 const RELEASE_MASK = 1073741824;
350 const MODIFIER_MASK = 1543512063;
351 }
352}
353
354#[doc(hidden)]
355impl ToGlib for ModifierType {
356 type GlibType = gdk_sys::GdkModifierType;
357
358 fn to_glib(&self) -> gdk_sys::GdkModifierType {
359 self.bits()
360 }
361}
362
363#[doc(hidden)]
364impl FromGlib<gdk_sys::GdkModifierType> for ModifierType {
365 fn from_glib(value: gdk_sys::GdkModifierType) -> ModifierType {
366 skip_assert_initialized!();
367 ModifierType::from_bits_truncate(value)
368 }
369}
370
371impl StaticType for ModifierType {
372 fn static_type() -> Type {
373 unsafe { from_glib(gdk_sys::gdk_modifier_type_get_type()) }
374 }
375}
376
377impl<'a> FromValueOptional<'a> for ModifierType {
378 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
379 Some(FromValue::from_value(value))
380 }
381}
382
383impl<'a> FromValue<'a> for ModifierType {
384 unsafe fn from_value(value: &Value) -> Self {
385 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
386 }
387}
388
389impl SetValue for ModifierType {
390 unsafe fn set_value(value: &mut Value, this: &Self) {
391 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
392 }
393}
394
395#[cfg(any(feature = "v3_20", feature = "dox"))]
396bitflags! {
397 pub struct SeatCapabilities: u32 {
398 const NONE = 0;
399 const POINTER = 1;
400 const TOUCH = 2;
401 const TABLET_STYLUS = 4;
402 const KEYBOARD = 8;
403 const ALL_POINTING = 7;
404 const ALL = 15;
405 }
406}
407
408#[cfg(any(feature = "v3_20", feature = "dox"))]
409#[doc(hidden)]
410impl ToGlib for SeatCapabilities {
411 type GlibType = gdk_sys::GdkSeatCapabilities;
412
413 fn to_glib(&self) -> gdk_sys::GdkSeatCapabilities {
414 self.bits()
415 }
416}
417
418#[cfg(any(feature = "v3_20", feature = "dox"))]
419#[doc(hidden)]
420impl FromGlib<gdk_sys::GdkSeatCapabilities> for SeatCapabilities {
421 fn from_glib(value: gdk_sys::GdkSeatCapabilities) -> SeatCapabilities {
422 skip_assert_initialized!();
423 SeatCapabilities::from_bits_truncate(value)
424 }
425}
426
427#[cfg(any(feature = "v3_20", feature = "dox"))]
428impl StaticType for SeatCapabilities {
429 fn static_type() -> Type {
430 unsafe { from_glib(gdk_sys::gdk_seat_capabilities_get_type()) }
431 }
432}
433
434#[cfg(any(feature = "v3_20", feature = "dox"))]
435impl<'a> FromValueOptional<'a> for SeatCapabilities {
436 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
437 Some(FromValue::from_value(value))
438 }
439}
440
441#[cfg(any(feature = "v3_20", feature = "dox"))]
442impl<'a> FromValue<'a> for SeatCapabilities {
443 unsafe fn from_value(value: &Value) -> Self {
444 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
445 }
446}
447
448#[cfg(any(feature = "v3_20", feature = "dox"))]
449impl SetValue for SeatCapabilities {
450 unsafe fn set_value(value: &mut Value, this: &Self) {
451 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
452 }
453}
454
455bitflags! {
456 pub struct WMDecoration: u32 {
457 const ALL = 1;
458 const BORDER = 2;
459 const RESIZEH = 4;
460 const TITLE = 8;
461 const MENU = 16;
462 const MINIMIZE = 32;
463 const MAXIMIZE = 64;
464 }
465}
466
467#[doc(hidden)]
468impl ToGlib for WMDecoration {
469 type GlibType = gdk_sys::GdkWMDecoration;
470
471 fn to_glib(&self) -> gdk_sys::GdkWMDecoration {
472 self.bits()
473 }
474}
475
476#[doc(hidden)]
477impl FromGlib<gdk_sys::GdkWMDecoration> for WMDecoration {
478 fn from_glib(value: gdk_sys::GdkWMDecoration) -> WMDecoration {
479 skip_assert_initialized!();
480 WMDecoration::from_bits_truncate(value)
481 }
482}
483
484impl StaticType for WMDecoration {
485 fn static_type() -> Type {
486 unsafe { from_glib(gdk_sys::gdk_wm_decoration_get_type()) }
487 }
488}
489
490impl<'a> FromValueOptional<'a> for WMDecoration {
491 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
492 Some(FromValue::from_value(value))
493 }
494}
495
496impl<'a> FromValue<'a> for WMDecoration {
497 unsafe fn from_value(value: &Value) -> Self {
498 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
499 }
500}
501
502impl SetValue for WMDecoration {
503 unsafe fn set_value(value: &mut Value, this: &Self) {
504 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
505 }
506}
507
508bitflags! {
509 pub struct WMFunction: u32 {
510 const ALL = 1;
511 const RESIZE = 2;
512 const MOVE = 4;
513 const MINIMIZE = 8;
514 const MAXIMIZE = 16;
515 const CLOSE = 32;
516 }
517}
518
519#[doc(hidden)]
520impl ToGlib for WMFunction {
521 type GlibType = gdk_sys::GdkWMFunction;
522
523 fn to_glib(&self) -> gdk_sys::GdkWMFunction {
524 self.bits()
525 }
526}
527
528#[doc(hidden)]
529impl FromGlib<gdk_sys::GdkWMFunction> for WMFunction {
530 fn from_glib(value: gdk_sys::GdkWMFunction) -> WMFunction {
531 skip_assert_initialized!();
532 WMFunction::from_bits_truncate(value)
533 }
534}
535
536impl StaticType for WMFunction {
537 fn static_type() -> Type {
538 unsafe { from_glib(gdk_sys::gdk_wm_function_get_type()) }
539 }
540}
541
542impl<'a> FromValueOptional<'a> for WMFunction {
543 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
544 Some(FromValue::from_value(value))
545 }
546}
547
548impl<'a> FromValue<'a> for WMFunction {
549 unsafe fn from_value(value: &Value) -> Self {
550 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
551 }
552}
553
554impl SetValue for WMFunction {
555 unsafe fn set_value(value: &mut Value, this: &Self) {
556 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
557 }
558}
559
560bitflags! {
561 pub struct WindowHints: u32 {
562 const POS = 1;
563 const MIN_SIZE = 2;
564 const MAX_SIZE = 4;
565 const BASE_SIZE = 8;
566 const ASPECT = 16;
567 const RESIZE_INC = 32;
568 const WIN_GRAVITY = 64;
569 const USER_POS = 128;
570 const USER_SIZE = 256;
571 }
572}
573
574#[doc(hidden)]
575impl ToGlib for WindowHints {
576 type GlibType = gdk_sys::GdkWindowHints;
577
578 fn to_glib(&self) -> gdk_sys::GdkWindowHints {
579 self.bits()
580 }
581}
582
583#[doc(hidden)]
584impl FromGlib<gdk_sys::GdkWindowHints> for WindowHints {
585 fn from_glib(value: gdk_sys::GdkWindowHints) -> WindowHints {
586 skip_assert_initialized!();
587 WindowHints::from_bits_truncate(value)
588 }
589}
590
591impl StaticType for WindowHints {
592 fn static_type() -> Type {
593 unsafe { from_glib(gdk_sys::gdk_window_hints_get_type()) }
594 }
595}
596
597impl<'a> FromValueOptional<'a> for WindowHints {
598 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
599 Some(FromValue::from_value(value))
600 }
601}
602
603impl<'a> FromValue<'a> for WindowHints {
604 unsafe fn from_value(value: &Value) -> Self {
605 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
606 }
607}
608
609impl SetValue for WindowHints {
610 unsafe fn set_value(value: &mut Value, this: &Self) {
611 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
612 }
613}
614
615bitflags! {
616 pub struct WindowState: u32 {
617 const WITHDRAWN = 1;
618 const ICONIFIED = 2;
619 const MAXIMIZED = 4;
620 const STICKY = 8;
621 const FULLSCREEN = 16;
622 const ABOVE = 32;
623 const BELOW = 64;
624 const FOCUSED = 128;
625 const TILED = 256;
626 const TOP_TILED = 512;
627 const TOP_RESIZABLE = 1024;
628 const RIGHT_TILED = 2048;
629 const RIGHT_RESIZABLE = 4096;
630 const BOTTOM_TILED = 8192;
631 const BOTTOM_RESIZABLE = 16384;
632 const LEFT_TILED = 32768;
633 const LEFT_RESIZABLE = 65536;
634 }
635}
636
637#[doc(hidden)]
638impl ToGlib for WindowState {
639 type GlibType = gdk_sys::GdkWindowState;
640
641 fn to_glib(&self) -> gdk_sys::GdkWindowState {
642 self.bits()
643 }
644}
645
646#[doc(hidden)]
647impl FromGlib<gdk_sys::GdkWindowState> for WindowState {
648 fn from_glib(value: gdk_sys::GdkWindowState) -> WindowState {
649 skip_assert_initialized!();
650 WindowState::from_bits_truncate(value)
651 }
652}
653
654impl StaticType for WindowState {
655 fn static_type() -> Type {
656 unsafe { from_glib(gdk_sys::gdk_window_state_get_type()) }
657 }
658}
659
660impl<'a> FromValueOptional<'a> for WindowState {
661 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
662 Some(FromValue::from_value(value))
663 }
664}
665
666impl<'a> FromValue<'a> for WindowState {
667 unsafe fn from_value(value: &Value) -> Self {
668 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
669 }
670}
671
672impl SetValue for WindowState {
673 unsafe fn set_value(value: &mut Value, this: &Self) {
674 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
675 }
676}