1use glib::translate::*;
6use glib::value::FromValue;
7use glib::value::FromValueOptional;
8use glib::value::SetValue;
9use glib::value::Value;
10use glib::StaticType;
11use glib::Type;
12use gobject_sys;
13use gtk_sys;
14
15bitflags! {
16 pub struct AccelFlags: u32 {
17 const VISIBLE = 1;
18 const LOCKED = 2;
19 const MASK = 7;
20 }
21}
22
23#[doc(hidden)]
24impl ToGlib for AccelFlags {
25 type GlibType = gtk_sys::GtkAccelFlags;
26
27 fn to_glib(&self) -> gtk_sys::GtkAccelFlags {
28 self.bits()
29 }
30}
31
32#[doc(hidden)]
33impl FromGlib<gtk_sys::GtkAccelFlags> for AccelFlags {
34 fn from_glib(value: gtk_sys::GtkAccelFlags) -> AccelFlags {
35 skip_assert_initialized!();
36 AccelFlags::from_bits_truncate(value)
37 }
38}
39
40impl StaticType for AccelFlags {
41 fn static_type() -> Type {
42 unsafe { from_glib(gtk_sys::gtk_accel_flags_get_type()) }
43 }
44}
45
46impl<'a> FromValueOptional<'a> for AccelFlags {
47 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
48 Some(FromValue::from_value(value))
49 }
50}
51
52impl<'a> FromValue<'a> for AccelFlags {
53 unsafe fn from_value(value: &Value) -> Self {
54 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
55 }
56}
57
58impl SetValue for AccelFlags {
59 unsafe fn set_value(value: &mut Value, this: &Self) {
60 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
61 }
62}
63
64bitflags! {
65 pub struct ApplicationInhibitFlags: u32 {
66 const LOGOUT = 1;
67 const SWITCH = 2;
68 const SUSPEND = 4;
69 const IDLE = 8;
70 }
71}
72
73#[doc(hidden)]
74impl ToGlib for ApplicationInhibitFlags {
75 type GlibType = gtk_sys::GtkApplicationInhibitFlags;
76
77 fn to_glib(&self) -> gtk_sys::GtkApplicationInhibitFlags {
78 self.bits()
79 }
80}
81
82#[doc(hidden)]
83impl FromGlib<gtk_sys::GtkApplicationInhibitFlags> for ApplicationInhibitFlags {
84 fn from_glib(value: gtk_sys::GtkApplicationInhibitFlags) -> ApplicationInhibitFlags {
85 skip_assert_initialized!();
86 ApplicationInhibitFlags::from_bits_truncate(value)
87 }
88}
89
90impl StaticType for ApplicationInhibitFlags {
91 fn static_type() -> Type {
92 unsafe { from_glib(gtk_sys::gtk_application_inhibit_flags_get_type()) }
93 }
94}
95
96impl<'a> FromValueOptional<'a> for ApplicationInhibitFlags {
97 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
98 Some(FromValue::from_value(value))
99 }
100}
101
102impl<'a> FromValue<'a> for ApplicationInhibitFlags {
103 unsafe fn from_value(value: &Value) -> Self {
104 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
105 }
106}
107
108impl SetValue for ApplicationInhibitFlags {
109 unsafe fn set_value(value: &mut Value, this: &Self) {
110 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
111 }
112}
113
114bitflags! {
115 pub struct CalendarDisplayOptions: u32 {
116 const SHOW_HEADING = 1;
117 const SHOW_DAY_NAMES = 2;
118 const NO_MONTH_CHANGE = 4;
119 const SHOW_WEEK_NUMBERS = 8;
120 const SHOW_DETAILS = 32;
121 }
122}
123
124#[doc(hidden)]
125impl ToGlib for CalendarDisplayOptions {
126 type GlibType = gtk_sys::GtkCalendarDisplayOptions;
127
128 fn to_glib(&self) -> gtk_sys::GtkCalendarDisplayOptions {
129 self.bits()
130 }
131}
132
133#[doc(hidden)]
134impl FromGlib<gtk_sys::GtkCalendarDisplayOptions> for CalendarDisplayOptions {
135 fn from_glib(value: gtk_sys::GtkCalendarDisplayOptions) -> CalendarDisplayOptions {
136 skip_assert_initialized!();
137 CalendarDisplayOptions::from_bits_truncate(value)
138 }
139}
140
141impl StaticType for CalendarDisplayOptions {
142 fn static_type() -> Type {
143 unsafe { from_glib(gtk_sys::gtk_calendar_display_options_get_type()) }
144 }
145}
146
147impl<'a> FromValueOptional<'a> for CalendarDisplayOptions {
148 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
149 Some(FromValue::from_value(value))
150 }
151}
152
153impl<'a> FromValue<'a> for CalendarDisplayOptions {
154 unsafe fn from_value(value: &Value) -> Self {
155 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
156 }
157}
158
159impl SetValue for CalendarDisplayOptions {
160 unsafe fn set_value(value: &mut Value, this: &Self) {
161 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
162 }
163}
164
165bitflags! {
166 pub struct CellRendererState: u32 {
167 const SELECTED = 1;
168 const PRELIT = 2;
169 const INSENSITIVE = 4;
170 const SORTED = 8;
171 const FOCUSED = 16;
172 const EXPANDABLE = 32;
173 const EXPANDED = 64;
174 }
175}
176
177#[doc(hidden)]
178impl ToGlib for CellRendererState {
179 type GlibType = gtk_sys::GtkCellRendererState;
180
181 fn to_glib(&self) -> gtk_sys::GtkCellRendererState {
182 self.bits()
183 }
184}
185
186#[doc(hidden)]
187impl FromGlib<gtk_sys::GtkCellRendererState> for CellRendererState {
188 fn from_glib(value: gtk_sys::GtkCellRendererState) -> CellRendererState {
189 skip_assert_initialized!();
190 CellRendererState::from_bits_truncate(value)
191 }
192}
193
194impl StaticType for CellRendererState {
195 fn static_type() -> Type {
196 unsafe { from_glib(gtk_sys::gtk_cell_renderer_state_get_type()) }
197 }
198}
199
200impl<'a> FromValueOptional<'a> for CellRendererState {
201 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
202 Some(FromValue::from_value(value))
203 }
204}
205
206impl<'a> FromValue<'a> for CellRendererState {
207 unsafe fn from_value(value: &Value) -> Self {
208 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
209 }
210}
211
212impl SetValue for CellRendererState {
213 unsafe fn set_value(value: &mut Value, this: &Self) {
214 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
215 }
216}
217
218bitflags! {
219 pub struct DestDefaults: u32 {
220 const MOTION = 1;
221 const HIGHLIGHT = 2;
222 const DROP = 4;
223 const ALL = 7;
224 }
225}
226
227#[doc(hidden)]
228impl ToGlib for DestDefaults {
229 type GlibType = gtk_sys::GtkDestDefaults;
230
231 fn to_glib(&self) -> gtk_sys::GtkDestDefaults {
232 self.bits()
233 }
234}
235
236#[doc(hidden)]
237impl FromGlib<gtk_sys::GtkDestDefaults> for DestDefaults {
238 fn from_glib(value: gtk_sys::GtkDestDefaults) -> DestDefaults {
239 skip_assert_initialized!();
240 DestDefaults::from_bits_truncate(value)
241 }
242}
243
244impl StaticType for DestDefaults {
245 fn static_type() -> Type {
246 unsafe { from_glib(gtk_sys::gtk_dest_defaults_get_type()) }
247 }
248}
249
250impl<'a> FromValueOptional<'a> for DestDefaults {
251 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
252 Some(FromValue::from_value(value))
253 }
254}
255
256impl<'a> FromValue<'a> for DestDefaults {
257 unsafe fn from_value(value: &Value) -> Self {
258 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
259 }
260}
261
262impl SetValue for DestDefaults {
263 unsafe fn set_value(value: &mut Value, this: &Self) {
264 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
265 }
266}
267
268bitflags! {
269 pub struct DialogFlags: u32 {
270 const MODAL = 1;
271 const DESTROY_WITH_PARENT = 2;
272 const USE_HEADER_BAR = 4;
273 }
274}
275
276#[doc(hidden)]
277impl ToGlib for DialogFlags {
278 type GlibType = gtk_sys::GtkDialogFlags;
279
280 fn to_glib(&self) -> gtk_sys::GtkDialogFlags {
281 self.bits()
282 }
283}
284
285#[doc(hidden)]
286impl FromGlib<gtk_sys::GtkDialogFlags> for DialogFlags {
287 fn from_glib(value: gtk_sys::GtkDialogFlags) -> DialogFlags {
288 skip_assert_initialized!();
289 DialogFlags::from_bits_truncate(value)
290 }
291}
292
293impl StaticType for DialogFlags {
294 fn static_type() -> Type {
295 unsafe { from_glib(gtk_sys::gtk_dialog_flags_get_type()) }
296 }
297}
298
299impl<'a> FromValueOptional<'a> for DialogFlags {
300 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
301 Some(FromValue::from_value(value))
302 }
303}
304
305impl<'a> FromValue<'a> for DialogFlags {
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 DialogFlags {
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 FileFilterFlags: u32 {
319 const FILENAME = 1;
320 const URI = 2;
321 const DISPLAY_NAME = 4;
322 const MIME_TYPE = 8;
323 }
324}
325
326#[doc(hidden)]
327impl ToGlib for FileFilterFlags {
328 type GlibType = gtk_sys::GtkFileFilterFlags;
329
330 fn to_glib(&self) -> gtk_sys::GtkFileFilterFlags {
331 self.bits()
332 }
333}
334
335#[doc(hidden)]
336impl FromGlib<gtk_sys::GtkFileFilterFlags> for FileFilterFlags {
337 fn from_glib(value: gtk_sys::GtkFileFilterFlags) -> FileFilterFlags {
338 skip_assert_initialized!();
339 FileFilterFlags::from_bits_truncate(value)
340 }
341}
342
343impl StaticType for FileFilterFlags {
344 fn static_type() -> Type {
345 unsafe { from_glib(gtk_sys::gtk_file_filter_flags_get_type()) }
346 }
347}
348
349impl<'a> FromValueOptional<'a> for FileFilterFlags {
350 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
351 Some(FromValue::from_value(value))
352 }
353}
354
355impl<'a> FromValue<'a> for FileFilterFlags {
356 unsafe fn from_value(value: &Value) -> Self {
357 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
358 }
359}
360
361impl SetValue for FileFilterFlags {
362 unsafe fn set_value(value: &mut Value, this: &Self) {
363 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
364 }
365}
366
367#[cfg(any(feature = "v3_24", feature = "dox"))]
368bitflags! {
369 pub struct FontChooserLevel: u32 {
370 const FAMILY = 0;
371 const STYLE = 1;
372 const SIZE = 2;
373 const VARIATIONS = 4;
374 const FEATURES = 8;
375 }
376}
377
378#[cfg(any(feature = "v3_24", feature = "dox"))]
379#[doc(hidden)]
380impl ToGlib for FontChooserLevel {
381 type GlibType = gtk_sys::GtkFontChooserLevel;
382
383 fn to_glib(&self) -> gtk_sys::GtkFontChooserLevel {
384 self.bits()
385 }
386}
387
388#[cfg(any(feature = "v3_24", feature = "dox"))]
389#[doc(hidden)]
390impl FromGlib<gtk_sys::GtkFontChooserLevel> for FontChooserLevel {
391 fn from_glib(value: gtk_sys::GtkFontChooserLevel) -> FontChooserLevel {
392 skip_assert_initialized!();
393 FontChooserLevel::from_bits_truncate(value)
394 }
395}
396
397#[cfg(any(feature = "v3_24", feature = "dox"))]
398impl StaticType for FontChooserLevel {
399 fn static_type() -> Type {
400 unsafe { from_glib(gtk_sys::gtk_font_chooser_level_get_type()) }
401 }
402}
403
404#[cfg(any(feature = "v3_24", feature = "dox"))]
405impl<'a> FromValueOptional<'a> for FontChooserLevel {
406 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
407 Some(FromValue::from_value(value))
408 }
409}
410
411#[cfg(any(feature = "v3_24", feature = "dox"))]
412impl<'a> FromValue<'a> for FontChooserLevel {
413 unsafe fn from_value(value: &Value) -> Self {
414 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
415 }
416}
417
418#[cfg(any(feature = "v3_24", feature = "dox"))]
419impl SetValue for FontChooserLevel {
420 unsafe fn set_value(value: &mut Value, this: &Self) {
421 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
422 }
423}
424
425bitflags! {
426 pub struct IconLookupFlags: u32 {
427 const NO_SVG = 1;
428 const FORCE_SVG = 2;
429 const USE_BUILTIN = 4;
430 const GENERIC_FALLBACK = 8;
431 const FORCE_SIZE = 16;
432 const FORCE_REGULAR = 32;
433 const FORCE_SYMBOLIC = 64;
434 const DIR_LTR = 128;
435 const DIR_RTL = 256;
436 }
437}
438
439#[doc(hidden)]
440impl ToGlib for IconLookupFlags {
441 type GlibType = gtk_sys::GtkIconLookupFlags;
442
443 fn to_glib(&self) -> gtk_sys::GtkIconLookupFlags {
444 self.bits()
445 }
446}
447
448#[doc(hidden)]
449impl FromGlib<gtk_sys::GtkIconLookupFlags> for IconLookupFlags {
450 fn from_glib(value: gtk_sys::GtkIconLookupFlags) -> IconLookupFlags {
451 skip_assert_initialized!();
452 IconLookupFlags::from_bits_truncate(value)
453 }
454}
455
456impl StaticType for IconLookupFlags {
457 fn static_type() -> Type {
458 unsafe { from_glib(gtk_sys::gtk_icon_lookup_flags_get_type()) }
459 }
460}
461
462impl<'a> FromValueOptional<'a> for IconLookupFlags {
463 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
464 Some(FromValue::from_value(value))
465 }
466}
467
468impl<'a> FromValue<'a> for IconLookupFlags {
469 unsafe fn from_value(value: &Value) -> Self {
470 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
471 }
472}
473
474impl SetValue for IconLookupFlags {
475 unsafe fn set_value(value: &mut Value, this: &Self) {
476 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
477 }
478}
479
480bitflags! {
481 pub struct InputHints: u32 {
482 const NONE = 0;
483 const SPELLCHECK = 1;
484 const NO_SPELLCHECK = 2;
485 const WORD_COMPLETION = 4;
486 const LOWERCASE = 8;
487 const UPPERCASE_CHARS = 16;
488 const UPPERCASE_WORDS = 32;
489 const UPPERCASE_SENTENCES = 64;
490 const INHIBIT_OSK = 128;
491 const VERTICAL_WRITING = 256;
492 #[cfg(any(feature = "v3_22_20", feature = "dox"))]
493 const EMOJI = 512;
494 #[cfg(any(feature = "v3_22_20", feature = "dox"))]
495 const NO_EMOJI = 1024;
496 }
497}
498
499#[doc(hidden)]
500impl ToGlib for InputHints {
501 type GlibType = gtk_sys::GtkInputHints;
502
503 fn to_glib(&self) -> gtk_sys::GtkInputHints {
504 self.bits()
505 }
506}
507
508#[doc(hidden)]
509impl FromGlib<gtk_sys::GtkInputHints> for InputHints {
510 fn from_glib(value: gtk_sys::GtkInputHints) -> InputHints {
511 skip_assert_initialized!();
512 InputHints::from_bits_truncate(value)
513 }
514}
515
516impl StaticType for InputHints {
517 fn static_type() -> Type {
518 unsafe { from_glib(gtk_sys::gtk_input_hints_get_type()) }
519 }
520}
521
522impl<'a> FromValueOptional<'a> for InputHints {
523 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
524 Some(FromValue::from_value(value))
525 }
526}
527
528impl<'a> FromValue<'a> for InputHints {
529 unsafe fn from_value(value: &Value) -> Self {
530 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
531 }
532}
533
534impl SetValue for InputHints {
535 unsafe fn set_value(value: &mut Value, this: &Self) {
536 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
537 }
538}
539
540bitflags! {
541 pub struct JunctionSides: u32 {
542 const NONE = 0;
543 const CORNER_TOPLEFT = 1;
544 const CORNER_TOPRIGHT = 2;
545 const CORNER_BOTTOMLEFT = 4;
546 const CORNER_BOTTOMRIGHT = 8;
547 const TOP = 3;
548 const BOTTOM = 12;
549 const LEFT = 5;
550 const RIGHT = 10;
551 }
552}
553
554#[doc(hidden)]
555impl ToGlib for JunctionSides {
556 type GlibType = gtk_sys::GtkJunctionSides;
557
558 fn to_glib(&self) -> gtk_sys::GtkJunctionSides {
559 self.bits()
560 }
561}
562
563#[doc(hidden)]
564impl FromGlib<gtk_sys::GtkJunctionSides> for JunctionSides {
565 fn from_glib(value: gtk_sys::GtkJunctionSides) -> JunctionSides {
566 skip_assert_initialized!();
567 JunctionSides::from_bits_truncate(value)
568 }
569}
570
571impl StaticType for JunctionSides {
572 fn static_type() -> Type {
573 unsafe { from_glib(gtk_sys::gtk_junction_sides_get_type()) }
574 }
575}
576
577impl<'a> FromValueOptional<'a> for JunctionSides {
578 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
579 Some(FromValue::from_value(value))
580 }
581}
582
583impl<'a> FromValue<'a> for JunctionSides {
584 unsafe fn from_value(value: &Value) -> Self {
585 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
586 }
587}
588
589impl SetValue for JunctionSides {
590 unsafe fn set_value(value: &mut Value, this: &Self) {
591 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
592 }
593}
594
595bitflags! {
596 pub struct PlacesOpenFlags: u32 {
597 const NORMAL = 1;
598 const NEW_TAB = 2;
599 const NEW_WINDOW = 4;
600 }
601}
602
603#[doc(hidden)]
604impl ToGlib for PlacesOpenFlags {
605 type GlibType = gtk_sys::GtkPlacesOpenFlags;
606
607 fn to_glib(&self) -> gtk_sys::GtkPlacesOpenFlags {
608 self.bits()
609 }
610}
611
612#[doc(hidden)]
613impl FromGlib<gtk_sys::GtkPlacesOpenFlags> for PlacesOpenFlags {
614 fn from_glib(value: gtk_sys::GtkPlacesOpenFlags) -> PlacesOpenFlags {
615 skip_assert_initialized!();
616 PlacesOpenFlags::from_bits_truncate(value)
617 }
618}
619
620impl StaticType for PlacesOpenFlags {
621 fn static_type() -> Type {
622 unsafe { from_glib(gtk_sys::gtk_places_open_flags_get_type()) }
623 }
624}
625
626impl<'a> FromValueOptional<'a> for PlacesOpenFlags {
627 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
628 Some(FromValue::from_value(value))
629 }
630}
631
632impl<'a> FromValue<'a> for PlacesOpenFlags {
633 unsafe fn from_value(value: &Value) -> Self {
634 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
635 }
636}
637
638impl SetValue for PlacesOpenFlags {
639 unsafe fn set_value(value: &mut Value, this: &Self) {
640 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
641 }
642}
643
644bitflags! {
645 pub struct RecentFilterFlags: u32 {
646 const URI = 1;
647 const DISPLAY_NAME = 2;
648 const MIME_TYPE = 4;
649 const APPLICATION = 8;
650 const GROUP = 16;
651 const AGE = 32;
652 }
653}
654
655#[doc(hidden)]
656impl ToGlib for RecentFilterFlags {
657 type GlibType = gtk_sys::GtkRecentFilterFlags;
658
659 fn to_glib(&self) -> gtk_sys::GtkRecentFilterFlags {
660 self.bits()
661 }
662}
663
664#[doc(hidden)]
665impl FromGlib<gtk_sys::GtkRecentFilterFlags> for RecentFilterFlags {
666 fn from_glib(value: gtk_sys::GtkRecentFilterFlags) -> RecentFilterFlags {
667 skip_assert_initialized!();
668 RecentFilterFlags::from_bits_truncate(value)
669 }
670}
671
672impl StaticType for RecentFilterFlags {
673 fn static_type() -> Type {
674 unsafe { from_glib(gtk_sys::gtk_recent_filter_flags_get_type()) }
675 }
676}
677
678impl<'a> FromValueOptional<'a> for RecentFilterFlags {
679 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
680 Some(FromValue::from_value(value))
681 }
682}
683
684impl<'a> FromValue<'a> for RecentFilterFlags {
685 unsafe fn from_value(value: &Value) -> Self {
686 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
687 }
688}
689
690impl SetValue for RecentFilterFlags {
691 unsafe fn set_value(value: &mut Value, this: &Self) {
692 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
693 }
694}
695
696bitflags! {
697 pub struct RegionFlags: u32 {
698 const EVEN = 1;
699 const ODD = 2;
700 const FIRST = 4;
701 const LAST = 8;
702 const ONLY = 16;
703 const SORTED = 32;
704 }
705}
706
707#[doc(hidden)]
708impl ToGlib for RegionFlags {
709 type GlibType = gtk_sys::GtkRegionFlags;
710
711 fn to_glib(&self) -> gtk_sys::GtkRegionFlags {
712 self.bits()
713 }
714}
715
716#[doc(hidden)]
717impl FromGlib<gtk_sys::GtkRegionFlags> for RegionFlags {
718 fn from_glib(value: gtk_sys::GtkRegionFlags) -> RegionFlags {
719 skip_assert_initialized!();
720 RegionFlags::from_bits_truncate(value)
721 }
722}
723
724impl StaticType for RegionFlags {
725 fn static_type() -> Type {
726 unsafe { from_glib(gtk_sys::gtk_region_flags_get_type()) }
727 }
728}
729
730impl<'a> FromValueOptional<'a> for RegionFlags {
731 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
732 Some(FromValue::from_value(value))
733 }
734}
735
736impl<'a> FromValue<'a> for RegionFlags {
737 unsafe fn from_value(value: &Value) -> Self {
738 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
739 }
740}
741
742impl SetValue for RegionFlags {
743 unsafe fn set_value(value: &mut Value, this: &Self) {
744 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
745 }
746}
747
748bitflags! {
749 pub struct StateFlags: u32 {
750 const NORMAL = 0;
751 const ACTIVE = 1;
752 const PRELIGHT = 2;
753 const SELECTED = 4;
754 const INSENSITIVE = 8;
755 const INCONSISTENT = 16;
756 const FOCUSED = 32;
757 const BACKDROP = 64;
758 const DIR_LTR = 128;
759 const DIR_RTL = 256;
760 const LINK = 512;
761 const VISITED = 1024;
762 const CHECKED = 2048;
763 const DROP_ACTIVE = 4096;
764 }
765}
766
767#[doc(hidden)]
768impl ToGlib for StateFlags {
769 type GlibType = gtk_sys::GtkStateFlags;
770
771 fn to_glib(&self) -> gtk_sys::GtkStateFlags {
772 self.bits()
773 }
774}
775
776#[doc(hidden)]
777impl FromGlib<gtk_sys::GtkStateFlags> for StateFlags {
778 fn from_glib(value: gtk_sys::GtkStateFlags) -> StateFlags {
779 skip_assert_initialized!();
780 StateFlags::from_bits_truncate(value)
781 }
782}
783
784impl StaticType for StateFlags {
785 fn static_type() -> Type {
786 unsafe { from_glib(gtk_sys::gtk_state_flags_get_type()) }
787 }
788}
789
790impl<'a> FromValueOptional<'a> for StateFlags {
791 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
792 Some(FromValue::from_value(value))
793 }
794}
795
796impl<'a> FromValue<'a> for StateFlags {
797 unsafe fn from_value(value: &Value) -> Self {
798 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
799 }
800}
801
802impl SetValue for StateFlags {
803 unsafe fn set_value(value: &mut Value, this: &Self) {
804 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
805 }
806}
807
808#[cfg(any(feature = "v3_20", feature = "dox"))]
809bitflags! {
810 pub struct StyleContextPrintFlags: u32 {
811 const NONE = 0;
812 const RECURSE = 1;
813 const SHOW_STYLE = 2;
814 }
815}
816
817#[cfg(any(feature = "v3_20", feature = "dox"))]
818#[doc(hidden)]
819impl ToGlib for StyleContextPrintFlags {
820 type GlibType = gtk_sys::GtkStyleContextPrintFlags;
821
822 fn to_glib(&self) -> gtk_sys::GtkStyleContextPrintFlags {
823 self.bits()
824 }
825}
826
827#[cfg(any(feature = "v3_20", feature = "dox"))]
828#[doc(hidden)]
829impl FromGlib<gtk_sys::GtkStyleContextPrintFlags> for StyleContextPrintFlags {
830 fn from_glib(value: gtk_sys::GtkStyleContextPrintFlags) -> StyleContextPrintFlags {
831 skip_assert_initialized!();
832 StyleContextPrintFlags::from_bits_truncate(value)
833 }
834}
835
836#[cfg(any(feature = "v3_20", feature = "dox"))]
837impl StaticType for StyleContextPrintFlags {
838 fn static_type() -> Type {
839 unsafe { from_glib(gtk_sys::gtk_style_context_print_flags_get_type()) }
840 }
841}
842
843#[cfg(any(feature = "v3_20", feature = "dox"))]
844impl<'a> FromValueOptional<'a> for StyleContextPrintFlags {
845 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
846 Some(FromValue::from_value(value))
847 }
848}
849
850#[cfg(any(feature = "v3_20", feature = "dox"))]
851impl<'a> FromValue<'a> for StyleContextPrintFlags {
852 unsafe fn from_value(value: &Value) -> Self {
853 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
854 }
855}
856
857#[cfg(any(feature = "v3_20", feature = "dox"))]
858impl SetValue for StyleContextPrintFlags {
859 unsafe fn set_value(value: &mut Value, this: &Self) {
860 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
861 }
862}
863
864bitflags! {
865 pub struct TargetFlags: u32 {
866 const SAME_APP = 1;
867 const SAME_WIDGET = 2;
868 const OTHER_APP = 4;
869 const OTHER_WIDGET = 8;
870 }
871}
872
873#[doc(hidden)]
874impl ToGlib for TargetFlags {
875 type GlibType = gtk_sys::GtkTargetFlags;
876
877 fn to_glib(&self) -> gtk_sys::GtkTargetFlags {
878 self.bits()
879 }
880}
881
882#[doc(hidden)]
883impl FromGlib<gtk_sys::GtkTargetFlags> for TargetFlags {
884 fn from_glib(value: gtk_sys::GtkTargetFlags) -> TargetFlags {
885 skip_assert_initialized!();
886 TargetFlags::from_bits_truncate(value)
887 }
888}
889
890impl StaticType for TargetFlags {
891 fn static_type() -> Type {
892 unsafe { from_glib(gtk_sys::gtk_target_flags_get_type()) }
893 }
894}
895
896impl<'a> FromValueOptional<'a> for TargetFlags {
897 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
898 Some(FromValue::from_value(value))
899 }
900}
901
902impl<'a> FromValue<'a> for TargetFlags {
903 unsafe fn from_value(value: &Value) -> Self {
904 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
905 }
906}
907
908impl SetValue for TargetFlags {
909 unsafe fn set_value(value: &mut Value, this: &Self) {
910 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
911 }
912}
913
914bitflags! {
915 pub struct TextSearchFlags: u32 {
916 const VISIBLE_ONLY = 1;
917 const TEXT_ONLY = 2;
918 const CASE_INSENSITIVE = 4;
919 }
920}
921
922#[doc(hidden)]
923impl ToGlib for TextSearchFlags {
924 type GlibType = gtk_sys::GtkTextSearchFlags;
925
926 fn to_glib(&self) -> gtk_sys::GtkTextSearchFlags {
927 self.bits()
928 }
929}
930
931#[doc(hidden)]
932impl FromGlib<gtk_sys::GtkTextSearchFlags> for TextSearchFlags {
933 fn from_glib(value: gtk_sys::GtkTextSearchFlags) -> TextSearchFlags {
934 skip_assert_initialized!();
935 TextSearchFlags::from_bits_truncate(value)
936 }
937}
938
939impl StaticType for TextSearchFlags {
940 fn static_type() -> Type {
941 unsafe { from_glib(gtk_sys::gtk_text_search_flags_get_type()) }
942 }
943}
944
945impl<'a> FromValueOptional<'a> for TextSearchFlags {
946 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
947 Some(FromValue::from_value(value))
948 }
949}
950
951impl<'a> FromValue<'a> for TextSearchFlags {
952 unsafe fn from_value(value: &Value) -> Self {
953 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
954 }
955}
956
957impl SetValue for TextSearchFlags {
958 unsafe fn set_value(value: &mut Value, this: &Self) {
959 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
960 }
961}
962
963bitflags! {
964 pub struct ToolPaletteDragTargets: u32 {
965 const ITEMS = 1;
966 const GROUPS = 2;
967 }
968}
969
970#[doc(hidden)]
971impl ToGlib for ToolPaletteDragTargets {
972 type GlibType = gtk_sys::GtkToolPaletteDragTargets;
973
974 fn to_glib(&self) -> gtk_sys::GtkToolPaletteDragTargets {
975 self.bits()
976 }
977}
978
979#[doc(hidden)]
980impl FromGlib<gtk_sys::GtkToolPaletteDragTargets> for ToolPaletteDragTargets {
981 fn from_glib(value: gtk_sys::GtkToolPaletteDragTargets) -> ToolPaletteDragTargets {
982 skip_assert_initialized!();
983 ToolPaletteDragTargets::from_bits_truncate(value)
984 }
985}
986
987impl StaticType for ToolPaletteDragTargets {
988 fn static_type() -> Type {
989 unsafe { from_glib(gtk_sys::gtk_tool_palette_drag_targets_get_type()) }
990 }
991}
992
993impl<'a> FromValueOptional<'a> for ToolPaletteDragTargets {
994 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
995 Some(FromValue::from_value(value))
996 }
997}
998
999impl<'a> FromValue<'a> for ToolPaletteDragTargets {
1000 unsafe fn from_value(value: &Value) -> Self {
1001 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
1002 }
1003}
1004
1005impl SetValue for ToolPaletteDragTargets {
1006 unsafe fn set_value(value: &mut Value, this: &Self) {
1007 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
1008 }
1009}
1010
1011bitflags! {
1012 pub struct TreeModelFlags: u32 {
1013 const ITERS_PERSIST = 1;
1014 const LIST_ONLY = 2;
1015 }
1016}
1017
1018#[doc(hidden)]
1019impl ToGlib for TreeModelFlags {
1020 type GlibType = gtk_sys::GtkTreeModelFlags;
1021
1022 fn to_glib(&self) -> gtk_sys::GtkTreeModelFlags {
1023 self.bits()
1024 }
1025}
1026
1027#[doc(hidden)]
1028impl FromGlib<gtk_sys::GtkTreeModelFlags> for TreeModelFlags {
1029 fn from_glib(value: gtk_sys::GtkTreeModelFlags) -> TreeModelFlags {
1030 skip_assert_initialized!();
1031 TreeModelFlags::from_bits_truncate(value)
1032 }
1033}
1034
1035impl StaticType for TreeModelFlags {
1036 fn static_type() -> Type {
1037 unsafe { from_glib(gtk_sys::gtk_tree_model_flags_get_type()) }
1038 }
1039}
1040
1041impl<'a> FromValueOptional<'a> for TreeModelFlags {
1042 unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1043 Some(FromValue::from_value(value))
1044 }
1045}
1046
1047impl<'a> FromValue<'a> for TreeModelFlags {
1048 unsafe fn from_value(value: &Value) -> Self {
1049 from_glib(gobject_sys::g_value_get_flags(value.to_glib_none().0))
1050 }
1051}
1052
1053impl SetValue for TreeModelFlags {
1054 unsafe fn set_value(value: &mut Value, this: &Self) {
1055 gobject_sys::g_value_set_flags(value.to_glib_none_mut().0, this.to_glib())
1056 }
1057}