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 
5 use glib::error::ErrorDomain;
6 use glib::translate::*;
7 use glib::value::FromValue;
8 use glib::value::FromValueOptional;
9 use glib::value::SetValue;
10 use glib::value::Value;
11 use glib::Quark;
12 use glib::StaticType;
13 use glib::Type;
14 use gobject_sys;
15 use gtk_sys;
16 use std::fmt;
17 
18 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
19 pub enum Align {
20     Fill,
21     Start,
22     End,
23     Center,
24     Baseline,
25     #[doc(hidden)]
26     __Unknown(i32),
27 }
28 
29 impl fmt::Display for Align {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result30     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
31         write!(
32             f,
33             "Align::{}",
34             match *self {
35                 Align::Fill => "Fill",
36                 Align::Start => "Start",
37                 Align::End => "End",
38                 Align::Center => "Center",
39                 Align::Baseline => "Baseline",
40                 _ => "Unknown",
41             }
42         )
43     }
44 }
45 
46 #[doc(hidden)]
47 impl ToGlib for Align {
48     type GlibType = gtk_sys::GtkAlign;
49 
to_glib(&self) -> gtk_sys::GtkAlign50     fn to_glib(&self) -> gtk_sys::GtkAlign {
51         match *self {
52             Align::Fill => gtk_sys::GTK_ALIGN_FILL,
53             Align::Start => gtk_sys::GTK_ALIGN_START,
54             Align::End => gtk_sys::GTK_ALIGN_END,
55             Align::Center => gtk_sys::GTK_ALIGN_CENTER,
56             Align::Baseline => gtk_sys::GTK_ALIGN_BASELINE,
57             Align::__Unknown(value) => value,
58         }
59     }
60 }
61 
62 #[doc(hidden)]
63 impl FromGlib<gtk_sys::GtkAlign> for Align {
from_glib(value: gtk_sys::GtkAlign) -> Self64     fn from_glib(value: gtk_sys::GtkAlign) -> Self {
65         skip_assert_initialized!();
66         match value {
67             0 => Align::Fill,
68             1 => Align::Start,
69             2 => Align::End,
70             3 => Align::Center,
71             4 => Align::Baseline,
72             value => Align::__Unknown(value),
73         }
74     }
75 }
76 
77 impl StaticType for Align {
static_type() -> Type78     fn static_type() -> Type {
79         unsafe { from_glib(gtk_sys::gtk_align_get_type()) }
80     }
81 }
82 
83 impl<'a> FromValueOptional<'a> for Align {
from_value_optional(value: &Value) -> Option<Self>84     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
85         Some(FromValue::from_value(value))
86     }
87 }
88 
89 impl<'a> FromValue<'a> for Align {
from_value(value: &Value) -> Self90     unsafe fn from_value(value: &Value) -> Self {
91         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
92     }
93 }
94 
95 impl SetValue for Align {
set_value(value: &mut Value, this: &Self)96     unsafe fn set_value(value: &mut Value, this: &Self) {
97         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
98     }
99 }
100 
101 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
102 pub enum ArrowType {
103     Up,
104     Down,
105     Left,
106     Right,
107     None,
108     #[doc(hidden)]
109     __Unknown(i32),
110 }
111 
112 impl fmt::Display for ArrowType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result113     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
114         write!(
115             f,
116             "ArrowType::{}",
117             match *self {
118                 ArrowType::Up => "Up",
119                 ArrowType::Down => "Down",
120                 ArrowType::Left => "Left",
121                 ArrowType::Right => "Right",
122                 ArrowType::None => "None",
123                 _ => "Unknown",
124             }
125         )
126     }
127 }
128 
129 #[doc(hidden)]
130 impl ToGlib for ArrowType {
131     type GlibType = gtk_sys::GtkArrowType;
132 
to_glib(&self) -> gtk_sys::GtkArrowType133     fn to_glib(&self) -> gtk_sys::GtkArrowType {
134         match *self {
135             ArrowType::Up => gtk_sys::GTK_ARROW_UP,
136             ArrowType::Down => gtk_sys::GTK_ARROW_DOWN,
137             ArrowType::Left => gtk_sys::GTK_ARROW_LEFT,
138             ArrowType::Right => gtk_sys::GTK_ARROW_RIGHT,
139             ArrowType::None => gtk_sys::GTK_ARROW_NONE,
140             ArrowType::__Unknown(value) => value,
141         }
142     }
143 }
144 
145 #[doc(hidden)]
146 impl FromGlib<gtk_sys::GtkArrowType> for ArrowType {
from_glib(value: gtk_sys::GtkArrowType) -> Self147     fn from_glib(value: gtk_sys::GtkArrowType) -> Self {
148         skip_assert_initialized!();
149         match value {
150             0 => ArrowType::Up,
151             1 => ArrowType::Down,
152             2 => ArrowType::Left,
153             3 => ArrowType::Right,
154             4 => ArrowType::None,
155             value => ArrowType::__Unknown(value),
156         }
157     }
158 }
159 
160 impl StaticType for ArrowType {
static_type() -> Type161     fn static_type() -> Type {
162         unsafe { from_glib(gtk_sys::gtk_arrow_type_get_type()) }
163     }
164 }
165 
166 impl<'a> FromValueOptional<'a> for ArrowType {
from_value_optional(value: &Value) -> Option<Self>167     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
168         Some(FromValue::from_value(value))
169     }
170 }
171 
172 impl<'a> FromValue<'a> for ArrowType {
from_value(value: &Value) -> Self173     unsafe fn from_value(value: &Value) -> Self {
174         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
175     }
176 }
177 
178 impl SetValue for ArrowType {
set_value(value: &mut Value, this: &Self)179     unsafe fn set_value(value: &mut Value, this: &Self) {
180         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
181     }
182 }
183 
184 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
185 pub enum AssistantPageType {
186     Content,
187     Intro,
188     Confirm,
189     Summary,
190     Progress,
191     Custom,
192     #[doc(hidden)]
193     __Unknown(i32),
194 }
195 
196 impl fmt::Display for AssistantPageType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result197     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
198         write!(
199             f,
200             "AssistantPageType::{}",
201             match *self {
202                 AssistantPageType::Content => "Content",
203                 AssistantPageType::Intro => "Intro",
204                 AssistantPageType::Confirm => "Confirm",
205                 AssistantPageType::Summary => "Summary",
206                 AssistantPageType::Progress => "Progress",
207                 AssistantPageType::Custom => "Custom",
208                 _ => "Unknown",
209             }
210         )
211     }
212 }
213 
214 #[doc(hidden)]
215 impl ToGlib for AssistantPageType {
216     type GlibType = gtk_sys::GtkAssistantPageType;
217 
to_glib(&self) -> gtk_sys::GtkAssistantPageType218     fn to_glib(&self) -> gtk_sys::GtkAssistantPageType {
219         match *self {
220             AssistantPageType::Content => gtk_sys::GTK_ASSISTANT_PAGE_CONTENT,
221             AssistantPageType::Intro => gtk_sys::GTK_ASSISTANT_PAGE_INTRO,
222             AssistantPageType::Confirm => gtk_sys::GTK_ASSISTANT_PAGE_CONFIRM,
223             AssistantPageType::Summary => gtk_sys::GTK_ASSISTANT_PAGE_SUMMARY,
224             AssistantPageType::Progress => gtk_sys::GTK_ASSISTANT_PAGE_PROGRESS,
225             AssistantPageType::Custom => gtk_sys::GTK_ASSISTANT_PAGE_CUSTOM,
226             AssistantPageType::__Unknown(value) => value,
227         }
228     }
229 }
230 
231 #[doc(hidden)]
232 impl FromGlib<gtk_sys::GtkAssistantPageType> for AssistantPageType {
from_glib(value: gtk_sys::GtkAssistantPageType) -> Self233     fn from_glib(value: gtk_sys::GtkAssistantPageType) -> Self {
234         skip_assert_initialized!();
235         match value {
236             0 => AssistantPageType::Content,
237             1 => AssistantPageType::Intro,
238             2 => AssistantPageType::Confirm,
239             3 => AssistantPageType::Summary,
240             4 => AssistantPageType::Progress,
241             5 => AssistantPageType::Custom,
242             value => AssistantPageType::__Unknown(value),
243         }
244     }
245 }
246 
247 impl StaticType for AssistantPageType {
static_type() -> Type248     fn static_type() -> Type {
249         unsafe { from_glib(gtk_sys::gtk_assistant_page_type_get_type()) }
250     }
251 }
252 
253 impl<'a> FromValueOptional<'a> for AssistantPageType {
from_value_optional(value: &Value) -> Option<Self>254     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
255         Some(FromValue::from_value(value))
256     }
257 }
258 
259 impl<'a> FromValue<'a> for AssistantPageType {
from_value(value: &Value) -> Self260     unsafe fn from_value(value: &Value) -> Self {
261         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
262     }
263 }
264 
265 impl SetValue for AssistantPageType {
set_value(value: &mut Value, this: &Self)266     unsafe fn set_value(value: &mut Value, this: &Self) {
267         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
268     }
269 }
270 
271 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
272 pub enum BaselinePosition {
273     Top,
274     Center,
275     Bottom,
276     #[doc(hidden)]
277     __Unknown(i32),
278 }
279 
280 impl fmt::Display for BaselinePosition {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result281     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
282         write!(
283             f,
284             "BaselinePosition::{}",
285             match *self {
286                 BaselinePosition::Top => "Top",
287                 BaselinePosition::Center => "Center",
288                 BaselinePosition::Bottom => "Bottom",
289                 _ => "Unknown",
290             }
291         )
292     }
293 }
294 
295 #[doc(hidden)]
296 impl ToGlib for BaselinePosition {
297     type GlibType = gtk_sys::GtkBaselinePosition;
298 
to_glib(&self) -> gtk_sys::GtkBaselinePosition299     fn to_glib(&self) -> gtk_sys::GtkBaselinePosition {
300         match *self {
301             BaselinePosition::Top => gtk_sys::GTK_BASELINE_POSITION_TOP,
302             BaselinePosition::Center => gtk_sys::GTK_BASELINE_POSITION_CENTER,
303             BaselinePosition::Bottom => gtk_sys::GTK_BASELINE_POSITION_BOTTOM,
304             BaselinePosition::__Unknown(value) => value,
305         }
306     }
307 }
308 
309 #[doc(hidden)]
310 impl FromGlib<gtk_sys::GtkBaselinePosition> for BaselinePosition {
from_glib(value: gtk_sys::GtkBaselinePosition) -> Self311     fn from_glib(value: gtk_sys::GtkBaselinePosition) -> Self {
312         skip_assert_initialized!();
313         match value {
314             0 => BaselinePosition::Top,
315             1 => BaselinePosition::Center,
316             2 => BaselinePosition::Bottom,
317             value => BaselinePosition::__Unknown(value),
318         }
319     }
320 }
321 
322 impl StaticType for BaselinePosition {
static_type() -> Type323     fn static_type() -> Type {
324         unsafe { from_glib(gtk_sys::gtk_baseline_position_get_type()) }
325     }
326 }
327 
328 impl<'a> FromValueOptional<'a> for BaselinePosition {
from_value_optional(value: &Value) -> Option<Self>329     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
330         Some(FromValue::from_value(value))
331     }
332 }
333 
334 impl<'a> FromValue<'a> for BaselinePosition {
from_value(value: &Value) -> Self335     unsafe fn from_value(value: &Value) -> Self {
336         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
337     }
338 }
339 
340 impl SetValue for BaselinePosition {
set_value(value: &mut Value, this: &Self)341     unsafe fn set_value(value: &mut Value, this: &Self) {
342         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
343     }
344 }
345 
346 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
347 pub enum BorderStyle {
348     None,
349     Solid,
350     Inset,
351     Outset,
352     Hidden,
353     Dotted,
354     Dashed,
355     Double,
356     Groove,
357     Ridge,
358     #[doc(hidden)]
359     __Unknown(i32),
360 }
361 
362 impl fmt::Display for BorderStyle {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result363     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
364         write!(
365             f,
366             "BorderStyle::{}",
367             match *self {
368                 BorderStyle::None => "None",
369                 BorderStyle::Solid => "Solid",
370                 BorderStyle::Inset => "Inset",
371                 BorderStyle::Outset => "Outset",
372                 BorderStyle::Hidden => "Hidden",
373                 BorderStyle::Dotted => "Dotted",
374                 BorderStyle::Dashed => "Dashed",
375                 BorderStyle::Double => "Double",
376                 BorderStyle::Groove => "Groove",
377                 BorderStyle::Ridge => "Ridge",
378                 _ => "Unknown",
379             }
380         )
381     }
382 }
383 
384 #[doc(hidden)]
385 impl ToGlib for BorderStyle {
386     type GlibType = gtk_sys::GtkBorderStyle;
387 
to_glib(&self) -> gtk_sys::GtkBorderStyle388     fn to_glib(&self) -> gtk_sys::GtkBorderStyle {
389         match *self {
390             BorderStyle::None => gtk_sys::GTK_BORDER_STYLE_NONE,
391             BorderStyle::Solid => gtk_sys::GTK_BORDER_STYLE_SOLID,
392             BorderStyle::Inset => gtk_sys::GTK_BORDER_STYLE_INSET,
393             BorderStyle::Outset => gtk_sys::GTK_BORDER_STYLE_OUTSET,
394             BorderStyle::Hidden => gtk_sys::GTK_BORDER_STYLE_HIDDEN,
395             BorderStyle::Dotted => gtk_sys::GTK_BORDER_STYLE_DOTTED,
396             BorderStyle::Dashed => gtk_sys::GTK_BORDER_STYLE_DASHED,
397             BorderStyle::Double => gtk_sys::GTK_BORDER_STYLE_DOUBLE,
398             BorderStyle::Groove => gtk_sys::GTK_BORDER_STYLE_GROOVE,
399             BorderStyle::Ridge => gtk_sys::GTK_BORDER_STYLE_RIDGE,
400             BorderStyle::__Unknown(value) => value,
401         }
402     }
403 }
404 
405 #[doc(hidden)]
406 impl FromGlib<gtk_sys::GtkBorderStyle> for BorderStyle {
from_glib(value: gtk_sys::GtkBorderStyle) -> Self407     fn from_glib(value: gtk_sys::GtkBorderStyle) -> Self {
408         skip_assert_initialized!();
409         match value {
410             0 => BorderStyle::None,
411             1 => BorderStyle::Solid,
412             2 => BorderStyle::Inset,
413             3 => BorderStyle::Outset,
414             4 => BorderStyle::Hidden,
415             5 => BorderStyle::Dotted,
416             6 => BorderStyle::Dashed,
417             7 => BorderStyle::Double,
418             8 => BorderStyle::Groove,
419             9 => BorderStyle::Ridge,
420             value => BorderStyle::__Unknown(value),
421         }
422     }
423 }
424 
425 impl StaticType for BorderStyle {
static_type() -> Type426     fn static_type() -> Type {
427         unsafe { from_glib(gtk_sys::gtk_border_style_get_type()) }
428     }
429 }
430 
431 impl<'a> FromValueOptional<'a> for BorderStyle {
from_value_optional(value: &Value) -> Option<Self>432     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
433         Some(FromValue::from_value(value))
434     }
435 }
436 
437 impl<'a> FromValue<'a> for BorderStyle {
from_value(value: &Value) -> Self438     unsafe fn from_value(value: &Value) -> Self {
439         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
440     }
441 }
442 
443 impl SetValue for BorderStyle {
set_value(value: &mut Value, this: &Self)444     unsafe fn set_value(value: &mut Value, this: &Self) {
445         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
446     }
447 }
448 
449 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
450 pub enum BuilderError {
451     InvalidTypeFunction,
452     UnhandledTag,
453     MissingAttribute,
454     InvalidAttribute,
455     InvalidTag,
456     MissingPropertyValue,
457     InvalidValue,
458     VersionMismatch,
459     DuplicateId,
460     ObjectTypeRefused,
461     TemplateMismatch,
462     InvalidProperty,
463     InvalidSignal,
464     InvalidId,
465     #[doc(hidden)]
466     __Unknown(i32),
467 }
468 
469 impl fmt::Display for BuilderError {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result470     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
471         write!(
472             f,
473             "BuilderError::{}",
474             match *self {
475                 BuilderError::InvalidTypeFunction => "InvalidTypeFunction",
476                 BuilderError::UnhandledTag => "UnhandledTag",
477                 BuilderError::MissingAttribute => "MissingAttribute",
478                 BuilderError::InvalidAttribute => "InvalidAttribute",
479                 BuilderError::InvalidTag => "InvalidTag",
480                 BuilderError::MissingPropertyValue => "MissingPropertyValue",
481                 BuilderError::InvalidValue => "InvalidValue",
482                 BuilderError::VersionMismatch => "VersionMismatch",
483                 BuilderError::DuplicateId => "DuplicateId",
484                 BuilderError::ObjectTypeRefused => "ObjectTypeRefused",
485                 BuilderError::TemplateMismatch => "TemplateMismatch",
486                 BuilderError::InvalidProperty => "InvalidProperty",
487                 BuilderError::InvalidSignal => "InvalidSignal",
488                 BuilderError::InvalidId => "InvalidId",
489                 _ => "Unknown",
490             }
491         )
492     }
493 }
494 
495 #[doc(hidden)]
496 impl ToGlib for BuilderError {
497     type GlibType = gtk_sys::GtkBuilderError;
498 
to_glib(&self) -> gtk_sys::GtkBuilderError499     fn to_glib(&self) -> gtk_sys::GtkBuilderError {
500         match *self {
501             BuilderError::InvalidTypeFunction => gtk_sys::GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION,
502             BuilderError::UnhandledTag => gtk_sys::GTK_BUILDER_ERROR_UNHANDLED_TAG,
503             BuilderError::MissingAttribute => gtk_sys::GTK_BUILDER_ERROR_MISSING_ATTRIBUTE,
504             BuilderError::InvalidAttribute => gtk_sys::GTK_BUILDER_ERROR_INVALID_ATTRIBUTE,
505             BuilderError::InvalidTag => gtk_sys::GTK_BUILDER_ERROR_INVALID_TAG,
506             BuilderError::MissingPropertyValue => gtk_sys::GTK_BUILDER_ERROR_MISSING_PROPERTY_VALUE,
507             BuilderError::InvalidValue => gtk_sys::GTK_BUILDER_ERROR_INVALID_VALUE,
508             BuilderError::VersionMismatch => gtk_sys::GTK_BUILDER_ERROR_VERSION_MISMATCH,
509             BuilderError::DuplicateId => gtk_sys::GTK_BUILDER_ERROR_DUPLICATE_ID,
510             BuilderError::ObjectTypeRefused => gtk_sys::GTK_BUILDER_ERROR_OBJECT_TYPE_REFUSED,
511             BuilderError::TemplateMismatch => gtk_sys::GTK_BUILDER_ERROR_TEMPLATE_MISMATCH,
512             BuilderError::InvalidProperty => gtk_sys::GTK_BUILDER_ERROR_INVALID_PROPERTY,
513             BuilderError::InvalidSignal => gtk_sys::GTK_BUILDER_ERROR_INVALID_SIGNAL,
514             BuilderError::InvalidId => gtk_sys::GTK_BUILDER_ERROR_INVALID_ID,
515             BuilderError::__Unknown(value) => value,
516         }
517     }
518 }
519 
520 #[doc(hidden)]
521 impl FromGlib<gtk_sys::GtkBuilderError> for BuilderError {
from_glib(value: gtk_sys::GtkBuilderError) -> Self522     fn from_glib(value: gtk_sys::GtkBuilderError) -> Self {
523         skip_assert_initialized!();
524         match value {
525             0 => BuilderError::InvalidTypeFunction,
526             1 => BuilderError::UnhandledTag,
527             2 => BuilderError::MissingAttribute,
528             3 => BuilderError::InvalidAttribute,
529             4 => BuilderError::InvalidTag,
530             5 => BuilderError::MissingPropertyValue,
531             6 => BuilderError::InvalidValue,
532             7 => BuilderError::VersionMismatch,
533             8 => BuilderError::DuplicateId,
534             9 => BuilderError::ObjectTypeRefused,
535             10 => BuilderError::TemplateMismatch,
536             11 => BuilderError::InvalidProperty,
537             12 => BuilderError::InvalidSignal,
538             13 => BuilderError::InvalidId,
539             value => BuilderError::__Unknown(value),
540         }
541     }
542 }
543 
544 impl ErrorDomain for BuilderError {
domain() -> Quark545     fn domain() -> Quark {
546         skip_assert_initialized!();
547         unsafe { from_glib(gtk_sys::gtk_builder_error_quark()) }
548     }
549 
code(self) -> i32550     fn code(self) -> i32 {
551         self.to_glib()
552     }
553 
from(code: i32) -> Option<Self>554     fn from(code: i32) -> Option<Self> {
555         skip_assert_initialized!();
556         match code {
557             0 => Some(BuilderError::InvalidTypeFunction),
558             1 => Some(BuilderError::UnhandledTag),
559             2 => Some(BuilderError::MissingAttribute),
560             3 => Some(BuilderError::InvalidAttribute),
561             4 => Some(BuilderError::InvalidTag),
562             5 => Some(BuilderError::MissingPropertyValue),
563             6 => Some(BuilderError::InvalidValue),
564             7 => Some(BuilderError::VersionMismatch),
565             8 => Some(BuilderError::DuplicateId),
566             9 => Some(BuilderError::ObjectTypeRefused),
567             10 => Some(BuilderError::TemplateMismatch),
568             11 => Some(BuilderError::InvalidProperty),
569             12 => Some(BuilderError::InvalidSignal),
570             13 => Some(BuilderError::InvalidId),
571             value => Some(BuilderError::__Unknown(value)),
572         }
573     }
574 }
575 
576 impl StaticType for BuilderError {
static_type() -> Type577     fn static_type() -> Type {
578         unsafe { from_glib(gtk_sys::gtk_builder_error_get_type()) }
579     }
580 }
581 
582 impl<'a> FromValueOptional<'a> for BuilderError {
from_value_optional(value: &Value) -> Option<Self>583     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
584         Some(FromValue::from_value(value))
585     }
586 }
587 
588 impl<'a> FromValue<'a> for BuilderError {
from_value(value: &Value) -> Self589     unsafe fn from_value(value: &Value) -> Self {
590         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
591     }
592 }
593 
594 impl SetValue for BuilderError {
set_value(value: &mut Value, this: &Self)595     unsafe fn set_value(value: &mut Value, this: &Self) {
596         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
597     }
598 }
599 
600 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
601 pub enum ButtonBoxStyle {
602     Spread,
603     Edge,
604     Start,
605     End,
606     Center,
607     Expand,
608     #[doc(hidden)]
609     __Unknown(i32),
610 }
611 
612 impl fmt::Display for ButtonBoxStyle {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result613     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
614         write!(
615             f,
616             "ButtonBoxStyle::{}",
617             match *self {
618                 ButtonBoxStyle::Spread => "Spread",
619                 ButtonBoxStyle::Edge => "Edge",
620                 ButtonBoxStyle::Start => "Start",
621                 ButtonBoxStyle::End => "End",
622                 ButtonBoxStyle::Center => "Center",
623                 ButtonBoxStyle::Expand => "Expand",
624                 _ => "Unknown",
625             }
626         )
627     }
628 }
629 
630 #[doc(hidden)]
631 impl ToGlib for ButtonBoxStyle {
632     type GlibType = gtk_sys::GtkButtonBoxStyle;
633 
to_glib(&self) -> gtk_sys::GtkButtonBoxStyle634     fn to_glib(&self) -> gtk_sys::GtkButtonBoxStyle {
635         match *self {
636             ButtonBoxStyle::Spread => gtk_sys::GTK_BUTTONBOX_SPREAD,
637             ButtonBoxStyle::Edge => gtk_sys::GTK_BUTTONBOX_EDGE,
638             ButtonBoxStyle::Start => gtk_sys::GTK_BUTTONBOX_START,
639             ButtonBoxStyle::End => gtk_sys::GTK_BUTTONBOX_END,
640             ButtonBoxStyle::Center => gtk_sys::GTK_BUTTONBOX_CENTER,
641             ButtonBoxStyle::Expand => gtk_sys::GTK_BUTTONBOX_EXPAND,
642             ButtonBoxStyle::__Unknown(value) => value,
643         }
644     }
645 }
646 
647 #[doc(hidden)]
648 impl FromGlib<gtk_sys::GtkButtonBoxStyle> for ButtonBoxStyle {
from_glib(value: gtk_sys::GtkButtonBoxStyle) -> Self649     fn from_glib(value: gtk_sys::GtkButtonBoxStyle) -> Self {
650         skip_assert_initialized!();
651         match value {
652             1 => ButtonBoxStyle::Spread,
653             2 => ButtonBoxStyle::Edge,
654             3 => ButtonBoxStyle::Start,
655             4 => ButtonBoxStyle::End,
656             5 => ButtonBoxStyle::Center,
657             6 => ButtonBoxStyle::Expand,
658             value => ButtonBoxStyle::__Unknown(value),
659         }
660     }
661 }
662 
663 impl StaticType for ButtonBoxStyle {
static_type() -> Type664     fn static_type() -> Type {
665         unsafe { from_glib(gtk_sys::gtk_button_box_style_get_type()) }
666     }
667 }
668 
669 impl<'a> FromValueOptional<'a> for ButtonBoxStyle {
from_value_optional(value: &Value) -> Option<Self>670     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
671         Some(FromValue::from_value(value))
672     }
673 }
674 
675 impl<'a> FromValue<'a> for ButtonBoxStyle {
from_value(value: &Value) -> Self676     unsafe fn from_value(value: &Value) -> Self {
677         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
678     }
679 }
680 
681 impl SetValue for ButtonBoxStyle {
set_value(value: &mut Value, this: &Self)682     unsafe fn set_value(value: &mut Value, this: &Self) {
683         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
684     }
685 }
686 
687 #[cfg(any(feature = "v3_16", feature = "dox"))]
688 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
689 pub enum ButtonRole {
690     Normal,
691     Check,
692     Radio,
693     #[doc(hidden)]
694     __Unknown(i32),
695 }
696 
697 #[cfg(any(feature = "v3_16", feature = "dox"))]
698 impl fmt::Display for ButtonRole {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result699     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
700         write!(
701             f,
702             "ButtonRole::{}",
703             match *self {
704                 ButtonRole::Normal => "Normal",
705                 ButtonRole::Check => "Check",
706                 ButtonRole::Radio => "Radio",
707                 _ => "Unknown",
708             }
709         )
710     }
711 }
712 
713 #[cfg(any(feature = "v3_16", feature = "dox"))]
714 #[doc(hidden)]
715 impl ToGlib for ButtonRole {
716     type GlibType = gtk_sys::GtkButtonRole;
717 
to_glib(&self) -> gtk_sys::GtkButtonRole718     fn to_glib(&self) -> gtk_sys::GtkButtonRole {
719         match *self {
720             ButtonRole::Normal => gtk_sys::GTK_BUTTON_ROLE_NORMAL,
721             ButtonRole::Check => gtk_sys::GTK_BUTTON_ROLE_CHECK,
722             ButtonRole::Radio => gtk_sys::GTK_BUTTON_ROLE_RADIO,
723             ButtonRole::__Unknown(value) => value,
724         }
725     }
726 }
727 
728 #[cfg(any(feature = "v3_16", feature = "dox"))]
729 #[doc(hidden)]
730 impl FromGlib<gtk_sys::GtkButtonRole> for ButtonRole {
from_glib(value: gtk_sys::GtkButtonRole) -> Self731     fn from_glib(value: gtk_sys::GtkButtonRole) -> Self {
732         skip_assert_initialized!();
733         match value {
734             0 => ButtonRole::Normal,
735             1 => ButtonRole::Check,
736             2 => ButtonRole::Radio,
737             value => ButtonRole::__Unknown(value),
738         }
739     }
740 }
741 
742 #[cfg(any(feature = "v3_16", feature = "dox"))]
743 impl StaticType for ButtonRole {
static_type() -> Type744     fn static_type() -> Type {
745         unsafe { from_glib(gtk_sys::gtk_button_role_get_type()) }
746     }
747 }
748 
749 #[cfg(any(feature = "v3_16", feature = "dox"))]
750 impl<'a> FromValueOptional<'a> for ButtonRole {
from_value_optional(value: &Value) -> Option<Self>751     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
752         Some(FromValue::from_value(value))
753     }
754 }
755 
756 #[cfg(any(feature = "v3_16", feature = "dox"))]
757 impl<'a> FromValue<'a> for ButtonRole {
from_value(value: &Value) -> Self758     unsafe fn from_value(value: &Value) -> Self {
759         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
760     }
761 }
762 
763 #[cfg(any(feature = "v3_16", feature = "dox"))]
764 impl SetValue for ButtonRole {
set_value(value: &mut Value, this: &Self)765     unsafe fn set_value(value: &mut Value, this: &Self) {
766         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
767     }
768 }
769 
770 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
771 pub enum ButtonsType {
772     None,
773     Ok,
774     Close,
775     Cancel,
776     YesNo,
777     OkCancel,
778     #[doc(hidden)]
779     __Unknown(i32),
780 }
781 
782 impl fmt::Display for ButtonsType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result783     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
784         write!(
785             f,
786             "ButtonsType::{}",
787             match *self {
788                 ButtonsType::None => "None",
789                 ButtonsType::Ok => "Ok",
790                 ButtonsType::Close => "Close",
791                 ButtonsType::Cancel => "Cancel",
792                 ButtonsType::YesNo => "YesNo",
793                 ButtonsType::OkCancel => "OkCancel",
794                 _ => "Unknown",
795             }
796         )
797     }
798 }
799 
800 #[doc(hidden)]
801 impl ToGlib for ButtonsType {
802     type GlibType = gtk_sys::GtkButtonsType;
803 
to_glib(&self) -> gtk_sys::GtkButtonsType804     fn to_glib(&self) -> gtk_sys::GtkButtonsType {
805         match *self {
806             ButtonsType::None => gtk_sys::GTK_BUTTONS_NONE,
807             ButtonsType::Ok => gtk_sys::GTK_BUTTONS_OK,
808             ButtonsType::Close => gtk_sys::GTK_BUTTONS_CLOSE,
809             ButtonsType::Cancel => gtk_sys::GTK_BUTTONS_CANCEL,
810             ButtonsType::YesNo => gtk_sys::GTK_BUTTONS_YES_NO,
811             ButtonsType::OkCancel => gtk_sys::GTK_BUTTONS_OK_CANCEL,
812             ButtonsType::__Unknown(value) => value,
813         }
814     }
815 }
816 
817 #[doc(hidden)]
818 impl FromGlib<gtk_sys::GtkButtonsType> for ButtonsType {
from_glib(value: gtk_sys::GtkButtonsType) -> Self819     fn from_glib(value: gtk_sys::GtkButtonsType) -> Self {
820         skip_assert_initialized!();
821         match value {
822             0 => ButtonsType::None,
823             1 => ButtonsType::Ok,
824             2 => ButtonsType::Close,
825             3 => ButtonsType::Cancel,
826             4 => ButtonsType::YesNo,
827             5 => ButtonsType::OkCancel,
828             value => ButtonsType::__Unknown(value),
829         }
830     }
831 }
832 
833 impl StaticType for ButtonsType {
static_type() -> Type834     fn static_type() -> Type {
835         unsafe { from_glib(gtk_sys::gtk_buttons_type_get_type()) }
836     }
837 }
838 
839 impl<'a> FromValueOptional<'a> for ButtonsType {
from_value_optional(value: &Value) -> Option<Self>840     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
841         Some(FromValue::from_value(value))
842     }
843 }
844 
845 impl<'a> FromValue<'a> for ButtonsType {
from_value(value: &Value) -> Self846     unsafe fn from_value(value: &Value) -> Self {
847         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
848     }
849 }
850 
851 impl SetValue for ButtonsType {
set_value(value: &mut Value, this: &Self)852     unsafe fn set_value(value: &mut Value, this: &Self) {
853         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
854     }
855 }
856 
857 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
858 pub enum CellRendererAccelMode {
859     Gtk,
860     Other,
861     ModifierTap,
862     #[doc(hidden)]
863     __Unknown(i32),
864 }
865 
866 impl fmt::Display for CellRendererAccelMode {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result867     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
868         write!(
869             f,
870             "CellRendererAccelMode::{}",
871             match *self {
872                 CellRendererAccelMode::Gtk => "Gtk",
873                 CellRendererAccelMode::Other => "Other",
874                 CellRendererAccelMode::ModifierTap => "ModifierTap",
875                 _ => "Unknown",
876             }
877         )
878     }
879 }
880 
881 #[doc(hidden)]
882 impl ToGlib for CellRendererAccelMode {
883     type GlibType = gtk_sys::GtkCellRendererAccelMode;
884 
to_glib(&self) -> gtk_sys::GtkCellRendererAccelMode885     fn to_glib(&self) -> gtk_sys::GtkCellRendererAccelMode {
886         match *self {
887             CellRendererAccelMode::Gtk => gtk_sys::GTK_CELL_RENDERER_ACCEL_MODE_GTK,
888             CellRendererAccelMode::Other => gtk_sys::GTK_CELL_RENDERER_ACCEL_MODE_OTHER,
889             CellRendererAccelMode::ModifierTap => {
890                 gtk_sys::GTK_CELL_RENDERER_ACCEL_MODE_MODIFIER_TAP
891             }
892             CellRendererAccelMode::__Unknown(value) => value,
893         }
894     }
895 }
896 
897 #[doc(hidden)]
898 impl FromGlib<gtk_sys::GtkCellRendererAccelMode> for CellRendererAccelMode {
from_glib(value: gtk_sys::GtkCellRendererAccelMode) -> Self899     fn from_glib(value: gtk_sys::GtkCellRendererAccelMode) -> Self {
900         skip_assert_initialized!();
901         match value {
902             0 => CellRendererAccelMode::Gtk,
903             1 => CellRendererAccelMode::Other,
904             2 => CellRendererAccelMode::ModifierTap,
905             value => CellRendererAccelMode::__Unknown(value),
906         }
907     }
908 }
909 
910 impl StaticType for CellRendererAccelMode {
static_type() -> Type911     fn static_type() -> Type {
912         unsafe { from_glib(gtk_sys::gtk_cell_renderer_accel_mode_get_type()) }
913     }
914 }
915 
916 impl<'a> FromValueOptional<'a> for CellRendererAccelMode {
from_value_optional(value: &Value) -> Option<Self>917     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
918         Some(FromValue::from_value(value))
919     }
920 }
921 
922 impl<'a> FromValue<'a> for CellRendererAccelMode {
from_value(value: &Value) -> Self923     unsafe fn from_value(value: &Value) -> Self {
924         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
925     }
926 }
927 
928 impl SetValue for CellRendererAccelMode {
set_value(value: &mut Value, this: &Self)929     unsafe fn set_value(value: &mut Value, this: &Self) {
930         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
931     }
932 }
933 
934 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
935 pub enum CellRendererMode {
936     Inert,
937     Activatable,
938     Editable,
939     #[doc(hidden)]
940     __Unknown(i32),
941 }
942 
943 impl fmt::Display for CellRendererMode {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result944     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
945         write!(
946             f,
947             "CellRendererMode::{}",
948             match *self {
949                 CellRendererMode::Inert => "Inert",
950                 CellRendererMode::Activatable => "Activatable",
951                 CellRendererMode::Editable => "Editable",
952                 _ => "Unknown",
953             }
954         )
955     }
956 }
957 
958 #[doc(hidden)]
959 impl ToGlib for CellRendererMode {
960     type GlibType = gtk_sys::GtkCellRendererMode;
961 
to_glib(&self) -> gtk_sys::GtkCellRendererMode962     fn to_glib(&self) -> gtk_sys::GtkCellRendererMode {
963         match *self {
964             CellRendererMode::Inert => gtk_sys::GTK_CELL_RENDERER_MODE_INERT,
965             CellRendererMode::Activatable => gtk_sys::GTK_CELL_RENDERER_MODE_ACTIVATABLE,
966             CellRendererMode::Editable => gtk_sys::GTK_CELL_RENDERER_MODE_EDITABLE,
967             CellRendererMode::__Unknown(value) => value,
968         }
969     }
970 }
971 
972 #[doc(hidden)]
973 impl FromGlib<gtk_sys::GtkCellRendererMode> for CellRendererMode {
from_glib(value: gtk_sys::GtkCellRendererMode) -> Self974     fn from_glib(value: gtk_sys::GtkCellRendererMode) -> Self {
975         skip_assert_initialized!();
976         match value {
977             0 => CellRendererMode::Inert,
978             1 => CellRendererMode::Activatable,
979             2 => CellRendererMode::Editable,
980             value => CellRendererMode::__Unknown(value),
981         }
982     }
983 }
984 
985 impl StaticType for CellRendererMode {
static_type() -> Type986     fn static_type() -> Type {
987         unsafe { from_glib(gtk_sys::gtk_cell_renderer_mode_get_type()) }
988     }
989 }
990 
991 impl<'a> FromValueOptional<'a> for CellRendererMode {
from_value_optional(value: &Value) -> Option<Self>992     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
993         Some(FromValue::from_value(value))
994     }
995 }
996 
997 impl<'a> FromValue<'a> for CellRendererMode {
from_value(value: &Value) -> Self998     unsafe fn from_value(value: &Value) -> Self {
999         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1000     }
1001 }
1002 
1003 impl SetValue for CellRendererMode {
set_value(value: &mut Value, this: &Self)1004     unsafe fn set_value(value: &mut Value, this: &Self) {
1005         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1006     }
1007 }
1008 
1009 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1010 pub enum CornerType {
1011     TopLeft,
1012     BottomLeft,
1013     TopRight,
1014     BottomRight,
1015     #[doc(hidden)]
1016     __Unknown(i32),
1017 }
1018 
1019 impl fmt::Display for CornerType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1020     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1021         write!(
1022             f,
1023             "CornerType::{}",
1024             match *self {
1025                 CornerType::TopLeft => "TopLeft",
1026                 CornerType::BottomLeft => "BottomLeft",
1027                 CornerType::TopRight => "TopRight",
1028                 CornerType::BottomRight => "BottomRight",
1029                 _ => "Unknown",
1030             }
1031         )
1032     }
1033 }
1034 
1035 #[doc(hidden)]
1036 impl ToGlib for CornerType {
1037     type GlibType = gtk_sys::GtkCornerType;
1038 
to_glib(&self) -> gtk_sys::GtkCornerType1039     fn to_glib(&self) -> gtk_sys::GtkCornerType {
1040         match *self {
1041             CornerType::TopLeft => gtk_sys::GTK_CORNER_TOP_LEFT,
1042             CornerType::BottomLeft => gtk_sys::GTK_CORNER_BOTTOM_LEFT,
1043             CornerType::TopRight => gtk_sys::GTK_CORNER_TOP_RIGHT,
1044             CornerType::BottomRight => gtk_sys::GTK_CORNER_BOTTOM_RIGHT,
1045             CornerType::__Unknown(value) => value,
1046         }
1047     }
1048 }
1049 
1050 #[doc(hidden)]
1051 impl FromGlib<gtk_sys::GtkCornerType> for CornerType {
from_glib(value: gtk_sys::GtkCornerType) -> Self1052     fn from_glib(value: gtk_sys::GtkCornerType) -> Self {
1053         skip_assert_initialized!();
1054         match value {
1055             0 => CornerType::TopLeft,
1056             1 => CornerType::BottomLeft,
1057             2 => CornerType::TopRight,
1058             3 => CornerType::BottomRight,
1059             value => CornerType::__Unknown(value),
1060         }
1061     }
1062 }
1063 
1064 impl StaticType for CornerType {
static_type() -> Type1065     fn static_type() -> Type {
1066         unsafe { from_glib(gtk_sys::gtk_corner_type_get_type()) }
1067     }
1068 }
1069 
1070 impl<'a> FromValueOptional<'a> for CornerType {
from_value_optional(value: &Value) -> Option<Self>1071     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1072         Some(FromValue::from_value(value))
1073     }
1074 }
1075 
1076 impl<'a> FromValue<'a> for CornerType {
from_value(value: &Value) -> Self1077     unsafe fn from_value(value: &Value) -> Self {
1078         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1079     }
1080 }
1081 
1082 impl SetValue for CornerType {
set_value(value: &mut Value, this: &Self)1083     unsafe fn set_value(value: &mut Value, this: &Self) {
1084         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1085     }
1086 }
1087 
1088 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1089 pub enum CssProviderError {
1090     Failed,
1091     Syntax,
1092     Import,
1093     Name,
1094     Deprecated,
1095     UnknownValue,
1096     #[doc(hidden)]
1097     __Unknown(i32),
1098 }
1099 
1100 impl fmt::Display for CssProviderError {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1101     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1102         write!(
1103             f,
1104             "CssProviderError::{}",
1105             match *self {
1106                 CssProviderError::Failed => "Failed",
1107                 CssProviderError::Syntax => "Syntax",
1108                 CssProviderError::Import => "Import",
1109                 CssProviderError::Name => "Name",
1110                 CssProviderError::Deprecated => "Deprecated",
1111                 CssProviderError::UnknownValue => "UnknownValue",
1112                 _ => "Unknown",
1113             }
1114         )
1115     }
1116 }
1117 
1118 #[doc(hidden)]
1119 impl ToGlib for CssProviderError {
1120     type GlibType = gtk_sys::GtkCssProviderError;
1121 
to_glib(&self) -> gtk_sys::GtkCssProviderError1122     fn to_glib(&self) -> gtk_sys::GtkCssProviderError {
1123         match *self {
1124             CssProviderError::Failed => gtk_sys::GTK_CSS_PROVIDER_ERROR_FAILED,
1125             CssProviderError::Syntax => gtk_sys::GTK_CSS_PROVIDER_ERROR_SYNTAX,
1126             CssProviderError::Import => gtk_sys::GTK_CSS_PROVIDER_ERROR_IMPORT,
1127             CssProviderError::Name => gtk_sys::GTK_CSS_PROVIDER_ERROR_NAME,
1128             CssProviderError::Deprecated => gtk_sys::GTK_CSS_PROVIDER_ERROR_DEPRECATED,
1129             CssProviderError::UnknownValue => gtk_sys::GTK_CSS_PROVIDER_ERROR_UNKNOWN_VALUE,
1130             CssProviderError::__Unknown(value) => value,
1131         }
1132     }
1133 }
1134 
1135 #[doc(hidden)]
1136 impl FromGlib<gtk_sys::GtkCssProviderError> for CssProviderError {
from_glib(value: gtk_sys::GtkCssProviderError) -> Self1137     fn from_glib(value: gtk_sys::GtkCssProviderError) -> Self {
1138         skip_assert_initialized!();
1139         match value {
1140             0 => CssProviderError::Failed,
1141             1 => CssProviderError::Syntax,
1142             2 => CssProviderError::Import,
1143             3 => CssProviderError::Name,
1144             4 => CssProviderError::Deprecated,
1145             5 => CssProviderError::UnknownValue,
1146             value => CssProviderError::__Unknown(value),
1147         }
1148     }
1149 }
1150 
1151 impl ErrorDomain for CssProviderError {
domain() -> Quark1152     fn domain() -> Quark {
1153         skip_assert_initialized!();
1154         unsafe { from_glib(gtk_sys::gtk_css_provider_error_quark()) }
1155     }
1156 
code(self) -> i321157     fn code(self) -> i32 {
1158         self.to_glib()
1159     }
1160 
from(code: i32) -> Option<Self>1161     fn from(code: i32) -> Option<Self> {
1162         skip_assert_initialized!();
1163         match code {
1164             0 => Some(CssProviderError::Failed),
1165             1 => Some(CssProviderError::Syntax),
1166             2 => Some(CssProviderError::Import),
1167             3 => Some(CssProviderError::Name),
1168             4 => Some(CssProviderError::Deprecated),
1169             5 => Some(CssProviderError::UnknownValue),
1170             _ => Some(CssProviderError::Failed),
1171         }
1172     }
1173 }
1174 
1175 impl StaticType for CssProviderError {
static_type() -> Type1176     fn static_type() -> Type {
1177         unsafe { from_glib(gtk_sys::gtk_css_provider_error_get_type()) }
1178     }
1179 }
1180 
1181 impl<'a> FromValueOptional<'a> for CssProviderError {
from_value_optional(value: &Value) -> Option<Self>1182     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1183         Some(FromValue::from_value(value))
1184     }
1185 }
1186 
1187 impl<'a> FromValue<'a> for CssProviderError {
from_value(value: &Value) -> Self1188     unsafe fn from_value(value: &Value) -> Self {
1189         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1190     }
1191 }
1192 
1193 impl SetValue for CssProviderError {
set_value(value: &mut Value, this: &Self)1194     unsafe fn set_value(value: &mut Value, this: &Self) {
1195         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1196     }
1197 }
1198 
1199 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1200 pub enum CssSectionType {
1201     Document,
1202     Import,
1203     ColorDefinition,
1204     BindingSet,
1205     Ruleset,
1206     Selector,
1207     Declaration,
1208     Value,
1209     Keyframes,
1210     #[doc(hidden)]
1211     __Unknown(i32),
1212 }
1213 
1214 impl fmt::Display for CssSectionType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1215     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1216         write!(
1217             f,
1218             "CssSectionType::{}",
1219             match *self {
1220                 CssSectionType::Document => "Document",
1221                 CssSectionType::Import => "Import",
1222                 CssSectionType::ColorDefinition => "ColorDefinition",
1223                 CssSectionType::BindingSet => "BindingSet",
1224                 CssSectionType::Ruleset => "Ruleset",
1225                 CssSectionType::Selector => "Selector",
1226                 CssSectionType::Declaration => "Declaration",
1227                 CssSectionType::Value => "Value",
1228                 CssSectionType::Keyframes => "Keyframes",
1229                 _ => "Unknown",
1230             }
1231         )
1232     }
1233 }
1234 
1235 #[doc(hidden)]
1236 impl ToGlib for CssSectionType {
1237     type GlibType = gtk_sys::GtkCssSectionType;
1238 
to_glib(&self) -> gtk_sys::GtkCssSectionType1239     fn to_glib(&self) -> gtk_sys::GtkCssSectionType {
1240         match *self {
1241             CssSectionType::Document => gtk_sys::GTK_CSS_SECTION_DOCUMENT,
1242             CssSectionType::Import => gtk_sys::GTK_CSS_SECTION_IMPORT,
1243             CssSectionType::ColorDefinition => gtk_sys::GTK_CSS_SECTION_COLOR_DEFINITION,
1244             CssSectionType::BindingSet => gtk_sys::GTK_CSS_SECTION_BINDING_SET,
1245             CssSectionType::Ruleset => gtk_sys::GTK_CSS_SECTION_RULESET,
1246             CssSectionType::Selector => gtk_sys::GTK_CSS_SECTION_SELECTOR,
1247             CssSectionType::Declaration => gtk_sys::GTK_CSS_SECTION_DECLARATION,
1248             CssSectionType::Value => gtk_sys::GTK_CSS_SECTION_VALUE,
1249             CssSectionType::Keyframes => gtk_sys::GTK_CSS_SECTION_KEYFRAMES,
1250             CssSectionType::__Unknown(value) => value,
1251         }
1252     }
1253 }
1254 
1255 #[doc(hidden)]
1256 impl FromGlib<gtk_sys::GtkCssSectionType> for CssSectionType {
from_glib(value: gtk_sys::GtkCssSectionType) -> Self1257     fn from_glib(value: gtk_sys::GtkCssSectionType) -> Self {
1258         skip_assert_initialized!();
1259         match value {
1260             0 => CssSectionType::Document,
1261             1 => CssSectionType::Import,
1262             2 => CssSectionType::ColorDefinition,
1263             3 => CssSectionType::BindingSet,
1264             4 => CssSectionType::Ruleset,
1265             5 => CssSectionType::Selector,
1266             6 => CssSectionType::Declaration,
1267             7 => CssSectionType::Value,
1268             8 => CssSectionType::Keyframes,
1269             value => CssSectionType::__Unknown(value),
1270         }
1271     }
1272 }
1273 
1274 impl StaticType for CssSectionType {
static_type() -> Type1275     fn static_type() -> Type {
1276         unsafe { from_glib(gtk_sys::gtk_css_section_type_get_type()) }
1277     }
1278 }
1279 
1280 impl<'a> FromValueOptional<'a> for CssSectionType {
from_value_optional(value: &Value) -> Option<Self>1281     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1282         Some(FromValue::from_value(value))
1283     }
1284 }
1285 
1286 impl<'a> FromValue<'a> for CssSectionType {
from_value(value: &Value) -> Self1287     unsafe fn from_value(value: &Value) -> Self {
1288         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1289     }
1290 }
1291 
1292 impl SetValue for CssSectionType {
set_value(value: &mut Value, this: &Self)1293     unsafe fn set_value(value: &mut Value, this: &Self) {
1294         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1295     }
1296 }
1297 
1298 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1299 pub enum DeleteType {
1300     Chars,
1301     WordEnds,
1302     Words,
1303     DisplayLines,
1304     DisplayLineEnds,
1305     ParagraphEnds,
1306     Paragraphs,
1307     Whitespace,
1308     #[doc(hidden)]
1309     __Unknown(i32),
1310 }
1311 
1312 impl fmt::Display for DeleteType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1313     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1314         write!(
1315             f,
1316             "DeleteType::{}",
1317             match *self {
1318                 DeleteType::Chars => "Chars",
1319                 DeleteType::WordEnds => "WordEnds",
1320                 DeleteType::Words => "Words",
1321                 DeleteType::DisplayLines => "DisplayLines",
1322                 DeleteType::DisplayLineEnds => "DisplayLineEnds",
1323                 DeleteType::ParagraphEnds => "ParagraphEnds",
1324                 DeleteType::Paragraphs => "Paragraphs",
1325                 DeleteType::Whitespace => "Whitespace",
1326                 _ => "Unknown",
1327             }
1328         )
1329     }
1330 }
1331 
1332 #[doc(hidden)]
1333 impl ToGlib for DeleteType {
1334     type GlibType = gtk_sys::GtkDeleteType;
1335 
to_glib(&self) -> gtk_sys::GtkDeleteType1336     fn to_glib(&self) -> gtk_sys::GtkDeleteType {
1337         match *self {
1338             DeleteType::Chars => gtk_sys::GTK_DELETE_CHARS,
1339             DeleteType::WordEnds => gtk_sys::GTK_DELETE_WORD_ENDS,
1340             DeleteType::Words => gtk_sys::GTK_DELETE_WORDS,
1341             DeleteType::DisplayLines => gtk_sys::GTK_DELETE_DISPLAY_LINES,
1342             DeleteType::DisplayLineEnds => gtk_sys::GTK_DELETE_DISPLAY_LINE_ENDS,
1343             DeleteType::ParagraphEnds => gtk_sys::GTK_DELETE_PARAGRAPH_ENDS,
1344             DeleteType::Paragraphs => gtk_sys::GTK_DELETE_PARAGRAPHS,
1345             DeleteType::Whitespace => gtk_sys::GTK_DELETE_WHITESPACE,
1346             DeleteType::__Unknown(value) => value,
1347         }
1348     }
1349 }
1350 
1351 #[doc(hidden)]
1352 impl FromGlib<gtk_sys::GtkDeleteType> for DeleteType {
from_glib(value: gtk_sys::GtkDeleteType) -> Self1353     fn from_glib(value: gtk_sys::GtkDeleteType) -> Self {
1354         skip_assert_initialized!();
1355         match value {
1356             0 => DeleteType::Chars,
1357             1 => DeleteType::WordEnds,
1358             2 => DeleteType::Words,
1359             3 => DeleteType::DisplayLines,
1360             4 => DeleteType::DisplayLineEnds,
1361             5 => DeleteType::ParagraphEnds,
1362             6 => DeleteType::Paragraphs,
1363             7 => DeleteType::Whitespace,
1364             value => DeleteType::__Unknown(value),
1365         }
1366     }
1367 }
1368 
1369 impl StaticType for DeleteType {
static_type() -> Type1370     fn static_type() -> Type {
1371         unsafe { from_glib(gtk_sys::gtk_delete_type_get_type()) }
1372     }
1373 }
1374 
1375 impl<'a> FromValueOptional<'a> for DeleteType {
from_value_optional(value: &Value) -> Option<Self>1376     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1377         Some(FromValue::from_value(value))
1378     }
1379 }
1380 
1381 impl<'a> FromValue<'a> for DeleteType {
from_value(value: &Value) -> Self1382     unsafe fn from_value(value: &Value) -> Self {
1383         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1384     }
1385 }
1386 
1387 impl SetValue for DeleteType {
set_value(value: &mut Value, this: &Self)1388     unsafe fn set_value(value: &mut Value, this: &Self) {
1389         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1390     }
1391 }
1392 
1393 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1394 pub enum DirectionType {
1395     TabForward,
1396     TabBackward,
1397     Up,
1398     Down,
1399     Left,
1400     Right,
1401     #[doc(hidden)]
1402     __Unknown(i32),
1403 }
1404 
1405 impl fmt::Display for DirectionType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1406     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1407         write!(
1408             f,
1409             "DirectionType::{}",
1410             match *self {
1411                 DirectionType::TabForward => "TabForward",
1412                 DirectionType::TabBackward => "TabBackward",
1413                 DirectionType::Up => "Up",
1414                 DirectionType::Down => "Down",
1415                 DirectionType::Left => "Left",
1416                 DirectionType::Right => "Right",
1417                 _ => "Unknown",
1418             }
1419         )
1420     }
1421 }
1422 
1423 #[doc(hidden)]
1424 impl ToGlib for DirectionType {
1425     type GlibType = gtk_sys::GtkDirectionType;
1426 
to_glib(&self) -> gtk_sys::GtkDirectionType1427     fn to_glib(&self) -> gtk_sys::GtkDirectionType {
1428         match *self {
1429             DirectionType::TabForward => gtk_sys::GTK_DIR_TAB_FORWARD,
1430             DirectionType::TabBackward => gtk_sys::GTK_DIR_TAB_BACKWARD,
1431             DirectionType::Up => gtk_sys::GTK_DIR_UP,
1432             DirectionType::Down => gtk_sys::GTK_DIR_DOWN,
1433             DirectionType::Left => gtk_sys::GTK_DIR_LEFT,
1434             DirectionType::Right => gtk_sys::GTK_DIR_RIGHT,
1435             DirectionType::__Unknown(value) => value,
1436         }
1437     }
1438 }
1439 
1440 #[doc(hidden)]
1441 impl FromGlib<gtk_sys::GtkDirectionType> for DirectionType {
from_glib(value: gtk_sys::GtkDirectionType) -> Self1442     fn from_glib(value: gtk_sys::GtkDirectionType) -> Self {
1443         skip_assert_initialized!();
1444         match value {
1445             0 => DirectionType::TabForward,
1446             1 => DirectionType::TabBackward,
1447             2 => DirectionType::Up,
1448             3 => DirectionType::Down,
1449             4 => DirectionType::Left,
1450             5 => DirectionType::Right,
1451             value => DirectionType::__Unknown(value),
1452         }
1453     }
1454 }
1455 
1456 impl StaticType for DirectionType {
static_type() -> Type1457     fn static_type() -> Type {
1458         unsafe { from_glib(gtk_sys::gtk_direction_type_get_type()) }
1459     }
1460 }
1461 
1462 impl<'a> FromValueOptional<'a> for DirectionType {
from_value_optional(value: &Value) -> Option<Self>1463     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1464         Some(FromValue::from_value(value))
1465     }
1466 }
1467 
1468 impl<'a> FromValue<'a> for DirectionType {
from_value(value: &Value) -> Self1469     unsafe fn from_value(value: &Value) -> Self {
1470         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1471     }
1472 }
1473 
1474 impl SetValue for DirectionType {
set_value(value: &mut Value, this: &Self)1475     unsafe fn set_value(value: &mut Value, this: &Self) {
1476         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1477     }
1478 }
1479 
1480 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1481 pub enum DragResult {
1482     Success,
1483     NoTarget,
1484     UserCancelled,
1485     TimeoutExpired,
1486     GrabBroken,
1487     Error,
1488     #[doc(hidden)]
1489     __Unknown(i32),
1490 }
1491 
1492 impl fmt::Display for DragResult {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1493     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1494         write!(
1495             f,
1496             "DragResult::{}",
1497             match *self {
1498                 DragResult::Success => "Success",
1499                 DragResult::NoTarget => "NoTarget",
1500                 DragResult::UserCancelled => "UserCancelled",
1501                 DragResult::TimeoutExpired => "TimeoutExpired",
1502                 DragResult::GrabBroken => "GrabBroken",
1503                 DragResult::Error => "Error",
1504                 _ => "Unknown",
1505             }
1506         )
1507     }
1508 }
1509 
1510 #[doc(hidden)]
1511 impl ToGlib for DragResult {
1512     type GlibType = gtk_sys::GtkDragResult;
1513 
to_glib(&self) -> gtk_sys::GtkDragResult1514     fn to_glib(&self) -> gtk_sys::GtkDragResult {
1515         match *self {
1516             DragResult::Success => gtk_sys::GTK_DRAG_RESULT_SUCCESS,
1517             DragResult::NoTarget => gtk_sys::GTK_DRAG_RESULT_NO_TARGET,
1518             DragResult::UserCancelled => gtk_sys::GTK_DRAG_RESULT_USER_CANCELLED,
1519             DragResult::TimeoutExpired => gtk_sys::GTK_DRAG_RESULT_TIMEOUT_EXPIRED,
1520             DragResult::GrabBroken => gtk_sys::GTK_DRAG_RESULT_GRAB_BROKEN,
1521             DragResult::Error => gtk_sys::GTK_DRAG_RESULT_ERROR,
1522             DragResult::__Unknown(value) => value,
1523         }
1524     }
1525 }
1526 
1527 #[doc(hidden)]
1528 impl FromGlib<gtk_sys::GtkDragResult> for DragResult {
from_glib(value: gtk_sys::GtkDragResult) -> Self1529     fn from_glib(value: gtk_sys::GtkDragResult) -> Self {
1530         skip_assert_initialized!();
1531         match value {
1532             0 => DragResult::Success,
1533             1 => DragResult::NoTarget,
1534             2 => DragResult::UserCancelled,
1535             3 => DragResult::TimeoutExpired,
1536             4 => DragResult::GrabBroken,
1537             5 => DragResult::Error,
1538             value => DragResult::__Unknown(value),
1539         }
1540     }
1541 }
1542 
1543 impl StaticType for DragResult {
static_type() -> Type1544     fn static_type() -> Type {
1545         unsafe { from_glib(gtk_sys::gtk_drag_result_get_type()) }
1546     }
1547 }
1548 
1549 impl<'a> FromValueOptional<'a> for DragResult {
from_value_optional(value: &Value) -> Option<Self>1550     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1551         Some(FromValue::from_value(value))
1552     }
1553 }
1554 
1555 impl<'a> FromValue<'a> for DragResult {
from_value(value: &Value) -> Self1556     unsafe fn from_value(value: &Value) -> Self {
1557         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1558     }
1559 }
1560 
1561 impl SetValue for DragResult {
set_value(value: &mut Value, this: &Self)1562     unsafe fn set_value(value: &mut Value, this: &Self) {
1563         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1564     }
1565 }
1566 
1567 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1568 pub enum EntryIconPosition {
1569     Primary,
1570     Secondary,
1571     #[doc(hidden)]
1572     __Unknown(i32),
1573 }
1574 
1575 impl fmt::Display for EntryIconPosition {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1576     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1577         write!(
1578             f,
1579             "EntryIconPosition::{}",
1580             match *self {
1581                 EntryIconPosition::Primary => "Primary",
1582                 EntryIconPosition::Secondary => "Secondary",
1583                 _ => "Unknown",
1584             }
1585         )
1586     }
1587 }
1588 
1589 #[doc(hidden)]
1590 impl ToGlib for EntryIconPosition {
1591     type GlibType = gtk_sys::GtkEntryIconPosition;
1592 
to_glib(&self) -> gtk_sys::GtkEntryIconPosition1593     fn to_glib(&self) -> gtk_sys::GtkEntryIconPosition {
1594         match *self {
1595             EntryIconPosition::Primary => gtk_sys::GTK_ENTRY_ICON_PRIMARY,
1596             EntryIconPosition::Secondary => gtk_sys::GTK_ENTRY_ICON_SECONDARY,
1597             EntryIconPosition::__Unknown(value) => value,
1598         }
1599     }
1600 }
1601 
1602 #[doc(hidden)]
1603 impl FromGlib<gtk_sys::GtkEntryIconPosition> for EntryIconPosition {
from_glib(value: gtk_sys::GtkEntryIconPosition) -> Self1604     fn from_glib(value: gtk_sys::GtkEntryIconPosition) -> Self {
1605         skip_assert_initialized!();
1606         match value {
1607             0 => EntryIconPosition::Primary,
1608             1 => EntryIconPosition::Secondary,
1609             value => EntryIconPosition::__Unknown(value),
1610         }
1611     }
1612 }
1613 
1614 impl StaticType for EntryIconPosition {
static_type() -> Type1615     fn static_type() -> Type {
1616         unsafe { from_glib(gtk_sys::gtk_entry_icon_position_get_type()) }
1617     }
1618 }
1619 
1620 impl<'a> FromValueOptional<'a> for EntryIconPosition {
from_value_optional(value: &Value) -> Option<Self>1621     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1622         Some(FromValue::from_value(value))
1623     }
1624 }
1625 
1626 impl<'a> FromValue<'a> for EntryIconPosition {
from_value(value: &Value) -> Self1627     unsafe fn from_value(value: &Value) -> Self {
1628         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1629     }
1630 }
1631 
1632 impl SetValue for EntryIconPosition {
set_value(value: &mut Value, this: &Self)1633     unsafe fn set_value(value: &mut Value, this: &Self) {
1634         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1635     }
1636 }
1637 
1638 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1639 pub enum EventSequenceState {
1640     None,
1641     Claimed,
1642     Denied,
1643     #[doc(hidden)]
1644     __Unknown(i32),
1645 }
1646 
1647 impl fmt::Display for EventSequenceState {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1648     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1649         write!(
1650             f,
1651             "EventSequenceState::{}",
1652             match *self {
1653                 EventSequenceState::None => "None",
1654                 EventSequenceState::Claimed => "Claimed",
1655                 EventSequenceState::Denied => "Denied",
1656                 _ => "Unknown",
1657             }
1658         )
1659     }
1660 }
1661 
1662 #[doc(hidden)]
1663 impl ToGlib for EventSequenceState {
1664     type GlibType = gtk_sys::GtkEventSequenceState;
1665 
to_glib(&self) -> gtk_sys::GtkEventSequenceState1666     fn to_glib(&self) -> gtk_sys::GtkEventSequenceState {
1667         match *self {
1668             EventSequenceState::None => gtk_sys::GTK_EVENT_SEQUENCE_NONE,
1669             EventSequenceState::Claimed => gtk_sys::GTK_EVENT_SEQUENCE_CLAIMED,
1670             EventSequenceState::Denied => gtk_sys::GTK_EVENT_SEQUENCE_DENIED,
1671             EventSequenceState::__Unknown(value) => value,
1672         }
1673     }
1674 }
1675 
1676 #[doc(hidden)]
1677 impl FromGlib<gtk_sys::GtkEventSequenceState> for EventSequenceState {
from_glib(value: gtk_sys::GtkEventSequenceState) -> Self1678     fn from_glib(value: gtk_sys::GtkEventSequenceState) -> Self {
1679         skip_assert_initialized!();
1680         match value {
1681             0 => EventSequenceState::None,
1682             1 => EventSequenceState::Claimed,
1683             2 => EventSequenceState::Denied,
1684             value => EventSequenceState::__Unknown(value),
1685         }
1686     }
1687 }
1688 
1689 impl StaticType for EventSequenceState {
static_type() -> Type1690     fn static_type() -> Type {
1691         unsafe { from_glib(gtk_sys::gtk_event_sequence_state_get_type()) }
1692     }
1693 }
1694 
1695 impl<'a> FromValueOptional<'a> for EventSequenceState {
from_value_optional(value: &Value) -> Option<Self>1696     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1697         Some(FromValue::from_value(value))
1698     }
1699 }
1700 
1701 impl<'a> FromValue<'a> for EventSequenceState {
from_value(value: &Value) -> Self1702     unsafe fn from_value(value: &Value) -> Self {
1703         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1704     }
1705 }
1706 
1707 impl SetValue for EventSequenceState {
set_value(value: &mut Value, this: &Self)1708     unsafe fn set_value(value: &mut Value, this: &Self) {
1709         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1710     }
1711 }
1712 
1713 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1714 pub enum FileChooserAction {
1715     Open,
1716     Save,
1717     SelectFolder,
1718     CreateFolder,
1719     #[doc(hidden)]
1720     __Unknown(i32),
1721 }
1722 
1723 impl fmt::Display for FileChooserAction {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1724     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1725         write!(
1726             f,
1727             "FileChooserAction::{}",
1728             match *self {
1729                 FileChooserAction::Open => "Open",
1730                 FileChooserAction::Save => "Save",
1731                 FileChooserAction::SelectFolder => "SelectFolder",
1732                 FileChooserAction::CreateFolder => "CreateFolder",
1733                 _ => "Unknown",
1734             }
1735         )
1736     }
1737 }
1738 
1739 #[doc(hidden)]
1740 impl ToGlib for FileChooserAction {
1741     type GlibType = gtk_sys::GtkFileChooserAction;
1742 
to_glib(&self) -> gtk_sys::GtkFileChooserAction1743     fn to_glib(&self) -> gtk_sys::GtkFileChooserAction {
1744         match *self {
1745             FileChooserAction::Open => gtk_sys::GTK_FILE_CHOOSER_ACTION_OPEN,
1746             FileChooserAction::Save => gtk_sys::GTK_FILE_CHOOSER_ACTION_SAVE,
1747             FileChooserAction::SelectFolder => gtk_sys::GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
1748             FileChooserAction::CreateFolder => gtk_sys::GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER,
1749             FileChooserAction::__Unknown(value) => value,
1750         }
1751     }
1752 }
1753 
1754 #[doc(hidden)]
1755 impl FromGlib<gtk_sys::GtkFileChooserAction> for FileChooserAction {
from_glib(value: gtk_sys::GtkFileChooserAction) -> Self1756     fn from_glib(value: gtk_sys::GtkFileChooserAction) -> Self {
1757         skip_assert_initialized!();
1758         match value {
1759             0 => FileChooserAction::Open,
1760             1 => FileChooserAction::Save,
1761             2 => FileChooserAction::SelectFolder,
1762             3 => FileChooserAction::CreateFolder,
1763             value => FileChooserAction::__Unknown(value),
1764         }
1765     }
1766 }
1767 
1768 impl StaticType for FileChooserAction {
static_type() -> Type1769     fn static_type() -> Type {
1770         unsafe { from_glib(gtk_sys::gtk_file_chooser_action_get_type()) }
1771     }
1772 }
1773 
1774 impl<'a> FromValueOptional<'a> for FileChooserAction {
from_value_optional(value: &Value) -> Option<Self>1775     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1776         Some(FromValue::from_value(value))
1777     }
1778 }
1779 
1780 impl<'a> FromValue<'a> for FileChooserAction {
from_value(value: &Value) -> Self1781     unsafe fn from_value(value: &Value) -> Self {
1782         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1783     }
1784 }
1785 
1786 impl SetValue for FileChooserAction {
set_value(value: &mut Value, this: &Self)1787     unsafe fn set_value(value: &mut Value, this: &Self) {
1788         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1789     }
1790 }
1791 
1792 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1793 pub enum FileChooserConfirmation {
1794     Confirm,
1795     AcceptFilename,
1796     SelectAgain,
1797     #[doc(hidden)]
1798     __Unknown(i32),
1799 }
1800 
1801 impl fmt::Display for FileChooserConfirmation {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1802     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1803         write!(
1804             f,
1805             "FileChooserConfirmation::{}",
1806             match *self {
1807                 FileChooserConfirmation::Confirm => "Confirm",
1808                 FileChooserConfirmation::AcceptFilename => "AcceptFilename",
1809                 FileChooserConfirmation::SelectAgain => "SelectAgain",
1810                 _ => "Unknown",
1811             }
1812         )
1813     }
1814 }
1815 
1816 #[doc(hidden)]
1817 impl ToGlib for FileChooserConfirmation {
1818     type GlibType = gtk_sys::GtkFileChooserConfirmation;
1819 
to_glib(&self) -> gtk_sys::GtkFileChooserConfirmation1820     fn to_glib(&self) -> gtk_sys::GtkFileChooserConfirmation {
1821         match *self {
1822             FileChooserConfirmation::Confirm => gtk_sys::GTK_FILE_CHOOSER_CONFIRMATION_CONFIRM,
1823             FileChooserConfirmation::AcceptFilename => {
1824                 gtk_sys::GTK_FILE_CHOOSER_CONFIRMATION_ACCEPT_FILENAME
1825             }
1826             FileChooserConfirmation::SelectAgain => {
1827                 gtk_sys::GTK_FILE_CHOOSER_CONFIRMATION_SELECT_AGAIN
1828             }
1829             FileChooserConfirmation::__Unknown(value) => value,
1830         }
1831     }
1832 }
1833 
1834 #[doc(hidden)]
1835 impl FromGlib<gtk_sys::GtkFileChooserConfirmation> for FileChooserConfirmation {
from_glib(value: gtk_sys::GtkFileChooserConfirmation) -> Self1836     fn from_glib(value: gtk_sys::GtkFileChooserConfirmation) -> Self {
1837         skip_assert_initialized!();
1838         match value {
1839             0 => FileChooserConfirmation::Confirm,
1840             1 => FileChooserConfirmation::AcceptFilename,
1841             2 => FileChooserConfirmation::SelectAgain,
1842             value => FileChooserConfirmation::__Unknown(value),
1843         }
1844     }
1845 }
1846 
1847 impl StaticType for FileChooserConfirmation {
static_type() -> Type1848     fn static_type() -> Type {
1849         unsafe { from_glib(gtk_sys::gtk_file_chooser_confirmation_get_type()) }
1850     }
1851 }
1852 
1853 impl<'a> FromValueOptional<'a> for FileChooserConfirmation {
from_value_optional(value: &Value) -> Option<Self>1854     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1855         Some(FromValue::from_value(value))
1856     }
1857 }
1858 
1859 impl<'a> FromValue<'a> for FileChooserConfirmation {
from_value(value: &Value) -> Self1860     unsafe fn from_value(value: &Value) -> Self {
1861         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1862     }
1863 }
1864 
1865 impl SetValue for FileChooserConfirmation {
set_value(value: &mut Value, this: &Self)1866     unsafe fn set_value(value: &mut Value, this: &Self) {
1867         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1868     }
1869 }
1870 
1871 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1872 pub enum FileChooserError {
1873     Nonexistent,
1874     BadFilename,
1875     AlreadyExists,
1876     IncompleteHostname,
1877     #[doc(hidden)]
1878     __Unknown(i32),
1879 }
1880 
1881 impl fmt::Display for FileChooserError {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1882     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1883         write!(
1884             f,
1885             "FileChooserError::{}",
1886             match *self {
1887                 FileChooserError::Nonexistent => "Nonexistent",
1888                 FileChooserError::BadFilename => "BadFilename",
1889                 FileChooserError::AlreadyExists => "AlreadyExists",
1890                 FileChooserError::IncompleteHostname => "IncompleteHostname",
1891                 _ => "Unknown",
1892             }
1893         )
1894     }
1895 }
1896 
1897 #[doc(hidden)]
1898 impl ToGlib for FileChooserError {
1899     type GlibType = gtk_sys::GtkFileChooserError;
1900 
to_glib(&self) -> gtk_sys::GtkFileChooserError1901     fn to_glib(&self) -> gtk_sys::GtkFileChooserError {
1902         match *self {
1903             FileChooserError::Nonexistent => gtk_sys::GTK_FILE_CHOOSER_ERROR_NONEXISTENT,
1904             FileChooserError::BadFilename => gtk_sys::GTK_FILE_CHOOSER_ERROR_BAD_FILENAME,
1905             FileChooserError::AlreadyExists => gtk_sys::GTK_FILE_CHOOSER_ERROR_ALREADY_EXISTS,
1906             FileChooserError::IncompleteHostname => {
1907                 gtk_sys::GTK_FILE_CHOOSER_ERROR_INCOMPLETE_HOSTNAME
1908             }
1909             FileChooserError::__Unknown(value) => value,
1910         }
1911     }
1912 }
1913 
1914 #[doc(hidden)]
1915 impl FromGlib<gtk_sys::GtkFileChooserError> for FileChooserError {
from_glib(value: gtk_sys::GtkFileChooserError) -> Self1916     fn from_glib(value: gtk_sys::GtkFileChooserError) -> Self {
1917         skip_assert_initialized!();
1918         match value {
1919             0 => FileChooserError::Nonexistent,
1920             1 => FileChooserError::BadFilename,
1921             2 => FileChooserError::AlreadyExists,
1922             3 => FileChooserError::IncompleteHostname,
1923             value => FileChooserError::__Unknown(value),
1924         }
1925     }
1926 }
1927 
1928 impl ErrorDomain for FileChooserError {
domain() -> Quark1929     fn domain() -> Quark {
1930         skip_assert_initialized!();
1931         unsafe { from_glib(gtk_sys::gtk_file_chooser_error_quark()) }
1932     }
1933 
code(self) -> i321934     fn code(self) -> i32 {
1935         self.to_glib()
1936     }
1937 
from(code: i32) -> Option<Self>1938     fn from(code: i32) -> Option<Self> {
1939         skip_assert_initialized!();
1940         match code {
1941             0 => Some(FileChooserError::Nonexistent),
1942             1 => Some(FileChooserError::BadFilename),
1943             2 => Some(FileChooserError::AlreadyExists),
1944             3 => Some(FileChooserError::IncompleteHostname),
1945             value => Some(FileChooserError::__Unknown(value)),
1946         }
1947     }
1948 }
1949 
1950 impl StaticType for FileChooserError {
static_type() -> Type1951     fn static_type() -> Type {
1952         unsafe { from_glib(gtk_sys::gtk_file_chooser_error_get_type()) }
1953     }
1954 }
1955 
1956 impl<'a> FromValueOptional<'a> for FileChooserError {
from_value_optional(value: &Value) -> Option<Self>1957     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
1958         Some(FromValue::from_value(value))
1959     }
1960 }
1961 
1962 impl<'a> FromValue<'a> for FileChooserError {
from_value(value: &Value) -> Self1963     unsafe fn from_value(value: &Value) -> Self {
1964         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
1965     }
1966 }
1967 
1968 impl SetValue for FileChooserError {
set_value(value: &mut Value, this: &Self)1969     unsafe fn set_value(value: &mut Value, this: &Self) {
1970         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
1971     }
1972 }
1973 
1974 #[deprecated]
1975 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
1976 pub enum IMPreeditStyle {
1977     Nothing,
1978     Callback,
1979     None,
1980     #[doc(hidden)]
1981     __Unknown(i32),
1982 }
1983 
1984 #[deprecated]
1985 impl fmt::Display for IMPreeditStyle {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1986     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1987         write!(
1988             f,
1989             "IMPreeditStyle::{}",
1990             match *self {
1991                 IMPreeditStyle::Nothing => "Nothing",
1992                 IMPreeditStyle::Callback => "Callback",
1993                 IMPreeditStyle::None => "None",
1994                 _ => "Unknown",
1995             }
1996         )
1997     }
1998 }
1999 
2000 #[deprecated]
2001 #[doc(hidden)]
2002 impl ToGlib for IMPreeditStyle {
2003     type GlibType = gtk_sys::GtkIMPreeditStyle;
2004 
to_glib(&self) -> gtk_sys::GtkIMPreeditStyle2005     fn to_glib(&self) -> gtk_sys::GtkIMPreeditStyle {
2006         match *self {
2007             IMPreeditStyle::Nothing => gtk_sys::GTK_IM_PREEDIT_NOTHING,
2008             IMPreeditStyle::Callback => gtk_sys::GTK_IM_PREEDIT_CALLBACK,
2009             IMPreeditStyle::None => gtk_sys::GTK_IM_PREEDIT_NONE,
2010             IMPreeditStyle::__Unknown(value) => value,
2011         }
2012     }
2013 }
2014 
2015 #[deprecated]
2016 #[doc(hidden)]
2017 impl FromGlib<gtk_sys::GtkIMPreeditStyle> for IMPreeditStyle {
from_glib(value: gtk_sys::GtkIMPreeditStyle) -> Self2018     fn from_glib(value: gtk_sys::GtkIMPreeditStyle) -> Self {
2019         skip_assert_initialized!();
2020         match value {
2021             0 => IMPreeditStyle::Nothing,
2022             1 => IMPreeditStyle::Callback,
2023             2 => IMPreeditStyle::None,
2024             value => IMPreeditStyle::__Unknown(value),
2025         }
2026     }
2027 }
2028 
2029 #[deprecated]
2030 impl StaticType for IMPreeditStyle {
static_type() -> Type2031     fn static_type() -> Type {
2032         unsafe { from_glib(gtk_sys::gtk_im_preedit_style_get_type()) }
2033     }
2034 }
2035 
2036 #[deprecated]
2037 impl<'a> FromValueOptional<'a> for IMPreeditStyle {
from_value_optional(value: &Value) -> Option<Self>2038     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2039         Some(FromValue::from_value(value))
2040     }
2041 }
2042 
2043 #[deprecated]
2044 impl<'a> FromValue<'a> for IMPreeditStyle {
from_value(value: &Value) -> Self2045     unsafe fn from_value(value: &Value) -> Self {
2046         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2047     }
2048 }
2049 
2050 #[deprecated]
2051 impl SetValue for IMPreeditStyle {
set_value(value: &mut Value, this: &Self)2052     unsafe fn set_value(value: &mut Value, this: &Self) {
2053         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2054     }
2055 }
2056 
2057 #[deprecated]
2058 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2059 pub enum IMStatusStyle {
2060     Nothing,
2061     Callback,
2062     None,
2063     #[doc(hidden)]
2064     __Unknown(i32),
2065 }
2066 
2067 #[deprecated]
2068 impl fmt::Display for IMStatusStyle {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result2069     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2070         write!(
2071             f,
2072             "IMStatusStyle::{}",
2073             match *self {
2074                 IMStatusStyle::Nothing => "Nothing",
2075                 IMStatusStyle::Callback => "Callback",
2076                 IMStatusStyle::None => "None",
2077                 _ => "Unknown",
2078             }
2079         )
2080     }
2081 }
2082 
2083 #[deprecated]
2084 #[doc(hidden)]
2085 impl ToGlib for IMStatusStyle {
2086     type GlibType = gtk_sys::GtkIMStatusStyle;
2087 
to_glib(&self) -> gtk_sys::GtkIMStatusStyle2088     fn to_glib(&self) -> gtk_sys::GtkIMStatusStyle {
2089         match *self {
2090             IMStatusStyle::Nothing => gtk_sys::GTK_IM_STATUS_NOTHING,
2091             IMStatusStyle::Callback => gtk_sys::GTK_IM_STATUS_CALLBACK,
2092             IMStatusStyle::None => gtk_sys::GTK_IM_STATUS_NONE,
2093             IMStatusStyle::__Unknown(value) => value,
2094         }
2095     }
2096 }
2097 
2098 #[deprecated]
2099 #[doc(hidden)]
2100 impl FromGlib<gtk_sys::GtkIMStatusStyle> for IMStatusStyle {
from_glib(value: gtk_sys::GtkIMStatusStyle) -> Self2101     fn from_glib(value: gtk_sys::GtkIMStatusStyle) -> Self {
2102         skip_assert_initialized!();
2103         match value {
2104             0 => IMStatusStyle::Nothing,
2105             1 => IMStatusStyle::Callback,
2106             2 => IMStatusStyle::None,
2107             value => IMStatusStyle::__Unknown(value),
2108         }
2109     }
2110 }
2111 
2112 #[deprecated]
2113 impl StaticType for IMStatusStyle {
static_type() -> Type2114     fn static_type() -> Type {
2115         unsafe { from_glib(gtk_sys::gtk_im_status_style_get_type()) }
2116     }
2117 }
2118 
2119 #[deprecated]
2120 impl<'a> FromValueOptional<'a> for IMStatusStyle {
from_value_optional(value: &Value) -> Option<Self>2121     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2122         Some(FromValue::from_value(value))
2123     }
2124 }
2125 
2126 #[deprecated]
2127 impl<'a> FromValue<'a> for IMStatusStyle {
from_value(value: &Value) -> Self2128     unsafe fn from_value(value: &Value) -> Self {
2129         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2130     }
2131 }
2132 
2133 #[deprecated]
2134 impl SetValue for IMStatusStyle {
set_value(value: &mut Value, this: &Self)2135     unsafe fn set_value(value: &mut Value, this: &Self) {
2136         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2137     }
2138 }
2139 
2140 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2141 pub enum IconSize {
2142     Invalid,
2143     Menu,
2144     SmallToolbar,
2145     LargeToolbar,
2146     Button,
2147     Dnd,
2148     Dialog,
2149     #[doc(hidden)]
2150     __Unknown(i32),
2151 }
2152 
2153 impl fmt::Display for IconSize {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result2154     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2155         write!(
2156             f,
2157             "IconSize::{}",
2158             match *self {
2159                 IconSize::Invalid => "Invalid",
2160                 IconSize::Menu => "Menu",
2161                 IconSize::SmallToolbar => "SmallToolbar",
2162                 IconSize::LargeToolbar => "LargeToolbar",
2163                 IconSize::Button => "Button",
2164                 IconSize::Dnd => "Dnd",
2165                 IconSize::Dialog => "Dialog",
2166                 _ => "Unknown",
2167             }
2168         )
2169     }
2170 }
2171 
2172 #[doc(hidden)]
2173 impl ToGlib for IconSize {
2174     type GlibType = gtk_sys::GtkIconSize;
2175 
to_glib(&self) -> gtk_sys::GtkIconSize2176     fn to_glib(&self) -> gtk_sys::GtkIconSize {
2177         match *self {
2178             IconSize::Invalid => gtk_sys::GTK_ICON_SIZE_INVALID,
2179             IconSize::Menu => gtk_sys::GTK_ICON_SIZE_MENU,
2180             IconSize::SmallToolbar => gtk_sys::GTK_ICON_SIZE_SMALL_TOOLBAR,
2181             IconSize::LargeToolbar => gtk_sys::GTK_ICON_SIZE_LARGE_TOOLBAR,
2182             IconSize::Button => gtk_sys::GTK_ICON_SIZE_BUTTON,
2183             IconSize::Dnd => gtk_sys::GTK_ICON_SIZE_DND,
2184             IconSize::Dialog => gtk_sys::GTK_ICON_SIZE_DIALOG,
2185             IconSize::__Unknown(value) => value,
2186         }
2187     }
2188 }
2189 
2190 #[doc(hidden)]
2191 impl FromGlib<gtk_sys::GtkIconSize> for IconSize {
from_glib(value: gtk_sys::GtkIconSize) -> Self2192     fn from_glib(value: gtk_sys::GtkIconSize) -> Self {
2193         skip_assert_initialized!();
2194         match value {
2195             0 => IconSize::Invalid,
2196             1 => IconSize::Menu,
2197             2 => IconSize::SmallToolbar,
2198             3 => IconSize::LargeToolbar,
2199             4 => IconSize::Button,
2200             5 => IconSize::Dnd,
2201             6 => IconSize::Dialog,
2202             value => IconSize::__Unknown(value),
2203         }
2204     }
2205 }
2206 
2207 impl StaticType for IconSize {
static_type() -> Type2208     fn static_type() -> Type {
2209         unsafe { from_glib(gtk_sys::gtk_icon_size_get_type()) }
2210     }
2211 }
2212 
2213 impl<'a> FromValueOptional<'a> for IconSize {
from_value_optional(value: &Value) -> Option<Self>2214     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2215         Some(FromValue::from_value(value))
2216     }
2217 }
2218 
2219 impl<'a> FromValue<'a> for IconSize {
from_value(value: &Value) -> Self2220     unsafe fn from_value(value: &Value) -> Self {
2221         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2222     }
2223 }
2224 
2225 impl SetValue for IconSize {
set_value(value: &mut Value, this: &Self)2226     unsafe fn set_value(value: &mut Value, this: &Self) {
2227         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2228     }
2229 }
2230 
2231 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2232 pub enum IconThemeError {
2233     NotFound,
2234     Failed,
2235     #[doc(hidden)]
2236     __Unknown(i32),
2237 }
2238 
2239 impl fmt::Display for IconThemeError {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result2240     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2241         write!(
2242             f,
2243             "IconThemeError::{}",
2244             match *self {
2245                 IconThemeError::NotFound => "NotFound",
2246                 IconThemeError::Failed => "Failed",
2247                 _ => "Unknown",
2248             }
2249         )
2250     }
2251 }
2252 
2253 #[doc(hidden)]
2254 impl ToGlib for IconThemeError {
2255     type GlibType = gtk_sys::GtkIconThemeError;
2256 
to_glib(&self) -> gtk_sys::GtkIconThemeError2257     fn to_glib(&self) -> gtk_sys::GtkIconThemeError {
2258         match *self {
2259             IconThemeError::NotFound => gtk_sys::GTK_ICON_THEME_NOT_FOUND,
2260             IconThemeError::Failed => gtk_sys::GTK_ICON_THEME_FAILED,
2261             IconThemeError::__Unknown(value) => value,
2262         }
2263     }
2264 }
2265 
2266 #[doc(hidden)]
2267 impl FromGlib<gtk_sys::GtkIconThemeError> for IconThemeError {
from_glib(value: gtk_sys::GtkIconThemeError) -> Self2268     fn from_glib(value: gtk_sys::GtkIconThemeError) -> Self {
2269         skip_assert_initialized!();
2270         match value {
2271             0 => IconThemeError::NotFound,
2272             1 => IconThemeError::Failed,
2273             value => IconThemeError::__Unknown(value),
2274         }
2275     }
2276 }
2277 
2278 impl ErrorDomain for IconThemeError {
domain() -> Quark2279     fn domain() -> Quark {
2280         skip_assert_initialized!();
2281         unsafe { from_glib(gtk_sys::gtk_icon_theme_error_quark()) }
2282     }
2283 
code(self) -> i322284     fn code(self) -> i32 {
2285         self.to_glib()
2286     }
2287 
from(code: i32) -> Option<Self>2288     fn from(code: i32) -> Option<Self> {
2289         skip_assert_initialized!();
2290         match code {
2291             0 => Some(IconThemeError::NotFound),
2292             1 => Some(IconThemeError::Failed),
2293             _ => Some(IconThemeError::Failed),
2294         }
2295     }
2296 }
2297 
2298 impl StaticType for IconThemeError {
static_type() -> Type2299     fn static_type() -> Type {
2300         unsafe { from_glib(gtk_sys::gtk_icon_theme_error_get_type()) }
2301     }
2302 }
2303 
2304 impl<'a> FromValueOptional<'a> for IconThemeError {
from_value_optional(value: &Value) -> Option<Self>2305     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2306         Some(FromValue::from_value(value))
2307     }
2308 }
2309 
2310 impl<'a> FromValue<'a> for IconThemeError {
from_value(value: &Value) -> Self2311     unsafe fn from_value(value: &Value) -> Self {
2312         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2313     }
2314 }
2315 
2316 impl SetValue for IconThemeError {
set_value(value: &mut Value, this: &Self)2317     unsafe fn set_value(value: &mut Value, this: &Self) {
2318         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2319     }
2320 }
2321 
2322 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2323 pub enum IconViewDropPosition {
2324     NoDrop,
2325     DropInto,
2326     DropLeft,
2327     DropRight,
2328     DropAbove,
2329     DropBelow,
2330     #[doc(hidden)]
2331     __Unknown(i32),
2332 }
2333 
2334 impl fmt::Display for IconViewDropPosition {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result2335     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2336         write!(
2337             f,
2338             "IconViewDropPosition::{}",
2339             match *self {
2340                 IconViewDropPosition::NoDrop => "NoDrop",
2341                 IconViewDropPosition::DropInto => "DropInto",
2342                 IconViewDropPosition::DropLeft => "DropLeft",
2343                 IconViewDropPosition::DropRight => "DropRight",
2344                 IconViewDropPosition::DropAbove => "DropAbove",
2345                 IconViewDropPosition::DropBelow => "DropBelow",
2346                 _ => "Unknown",
2347             }
2348         )
2349     }
2350 }
2351 
2352 #[doc(hidden)]
2353 impl ToGlib for IconViewDropPosition {
2354     type GlibType = gtk_sys::GtkIconViewDropPosition;
2355 
to_glib(&self) -> gtk_sys::GtkIconViewDropPosition2356     fn to_glib(&self) -> gtk_sys::GtkIconViewDropPosition {
2357         match *self {
2358             IconViewDropPosition::NoDrop => gtk_sys::GTK_ICON_VIEW_NO_DROP,
2359             IconViewDropPosition::DropInto => gtk_sys::GTK_ICON_VIEW_DROP_INTO,
2360             IconViewDropPosition::DropLeft => gtk_sys::GTK_ICON_VIEW_DROP_LEFT,
2361             IconViewDropPosition::DropRight => gtk_sys::GTK_ICON_VIEW_DROP_RIGHT,
2362             IconViewDropPosition::DropAbove => gtk_sys::GTK_ICON_VIEW_DROP_ABOVE,
2363             IconViewDropPosition::DropBelow => gtk_sys::GTK_ICON_VIEW_DROP_BELOW,
2364             IconViewDropPosition::__Unknown(value) => value,
2365         }
2366     }
2367 }
2368 
2369 #[doc(hidden)]
2370 impl FromGlib<gtk_sys::GtkIconViewDropPosition> for IconViewDropPosition {
from_glib(value: gtk_sys::GtkIconViewDropPosition) -> Self2371     fn from_glib(value: gtk_sys::GtkIconViewDropPosition) -> Self {
2372         skip_assert_initialized!();
2373         match value {
2374             0 => IconViewDropPosition::NoDrop,
2375             1 => IconViewDropPosition::DropInto,
2376             2 => IconViewDropPosition::DropLeft,
2377             3 => IconViewDropPosition::DropRight,
2378             4 => IconViewDropPosition::DropAbove,
2379             5 => IconViewDropPosition::DropBelow,
2380             value => IconViewDropPosition::__Unknown(value),
2381         }
2382     }
2383 }
2384 
2385 impl StaticType for IconViewDropPosition {
static_type() -> Type2386     fn static_type() -> Type {
2387         unsafe { from_glib(gtk_sys::gtk_icon_view_drop_position_get_type()) }
2388     }
2389 }
2390 
2391 impl<'a> FromValueOptional<'a> for IconViewDropPosition {
from_value_optional(value: &Value) -> Option<Self>2392     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2393         Some(FromValue::from_value(value))
2394     }
2395 }
2396 
2397 impl<'a> FromValue<'a> for IconViewDropPosition {
from_value(value: &Value) -> Self2398     unsafe fn from_value(value: &Value) -> Self {
2399         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2400     }
2401 }
2402 
2403 impl SetValue for IconViewDropPosition {
set_value(value: &mut Value, this: &Self)2404     unsafe fn set_value(value: &mut Value, this: &Self) {
2405         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2406     }
2407 }
2408 
2409 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2410 pub enum ImageType {
2411     Empty,
2412     Pixbuf,
2413     Stock,
2414     IconSet,
2415     Animation,
2416     IconName,
2417     Gicon,
2418     Surface,
2419     #[doc(hidden)]
2420     __Unknown(i32),
2421 }
2422 
2423 impl fmt::Display for ImageType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result2424     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2425         write!(
2426             f,
2427             "ImageType::{}",
2428             match *self {
2429                 ImageType::Empty => "Empty",
2430                 ImageType::Pixbuf => "Pixbuf",
2431                 ImageType::Stock => "Stock",
2432                 ImageType::IconSet => "IconSet",
2433                 ImageType::Animation => "Animation",
2434                 ImageType::IconName => "IconName",
2435                 ImageType::Gicon => "Gicon",
2436                 ImageType::Surface => "Surface",
2437                 _ => "Unknown",
2438             }
2439         )
2440     }
2441 }
2442 
2443 #[doc(hidden)]
2444 impl ToGlib for ImageType {
2445     type GlibType = gtk_sys::GtkImageType;
2446 
to_glib(&self) -> gtk_sys::GtkImageType2447     fn to_glib(&self) -> gtk_sys::GtkImageType {
2448         match *self {
2449             ImageType::Empty => gtk_sys::GTK_IMAGE_EMPTY,
2450             ImageType::Pixbuf => gtk_sys::GTK_IMAGE_PIXBUF,
2451             ImageType::Stock => gtk_sys::GTK_IMAGE_STOCK,
2452             ImageType::IconSet => gtk_sys::GTK_IMAGE_ICON_SET,
2453             ImageType::Animation => gtk_sys::GTK_IMAGE_ANIMATION,
2454             ImageType::IconName => gtk_sys::GTK_IMAGE_ICON_NAME,
2455             ImageType::Gicon => gtk_sys::GTK_IMAGE_GICON,
2456             ImageType::Surface => gtk_sys::GTK_IMAGE_SURFACE,
2457             ImageType::__Unknown(value) => value,
2458         }
2459     }
2460 }
2461 
2462 #[doc(hidden)]
2463 impl FromGlib<gtk_sys::GtkImageType> for ImageType {
from_glib(value: gtk_sys::GtkImageType) -> Self2464     fn from_glib(value: gtk_sys::GtkImageType) -> Self {
2465         skip_assert_initialized!();
2466         match value {
2467             0 => ImageType::Empty,
2468             1 => ImageType::Pixbuf,
2469             2 => ImageType::Stock,
2470             3 => ImageType::IconSet,
2471             4 => ImageType::Animation,
2472             5 => ImageType::IconName,
2473             6 => ImageType::Gicon,
2474             7 => ImageType::Surface,
2475             value => ImageType::__Unknown(value),
2476         }
2477     }
2478 }
2479 
2480 impl StaticType for ImageType {
static_type() -> Type2481     fn static_type() -> Type {
2482         unsafe { from_glib(gtk_sys::gtk_image_type_get_type()) }
2483     }
2484 }
2485 
2486 impl<'a> FromValueOptional<'a> for ImageType {
from_value_optional(value: &Value) -> Option<Self>2487     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2488         Some(FromValue::from_value(value))
2489     }
2490 }
2491 
2492 impl<'a> FromValue<'a> for ImageType {
from_value(value: &Value) -> Self2493     unsafe fn from_value(value: &Value) -> Self {
2494         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2495     }
2496 }
2497 
2498 impl SetValue for ImageType {
set_value(value: &mut Value, this: &Self)2499     unsafe fn set_value(value: &mut Value, this: &Self) {
2500         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2501     }
2502 }
2503 
2504 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2505 pub enum InputPurpose {
2506     FreeForm,
2507     Alpha,
2508     Digits,
2509     Number,
2510     Phone,
2511     Url,
2512     Email,
2513     Name,
2514     Password,
2515     Pin,
2516     #[doc(hidden)]
2517     __Unknown(i32),
2518 }
2519 
2520 impl fmt::Display for InputPurpose {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result2521     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2522         write!(
2523             f,
2524             "InputPurpose::{}",
2525             match *self {
2526                 InputPurpose::FreeForm => "FreeForm",
2527                 InputPurpose::Alpha => "Alpha",
2528                 InputPurpose::Digits => "Digits",
2529                 InputPurpose::Number => "Number",
2530                 InputPurpose::Phone => "Phone",
2531                 InputPurpose::Url => "Url",
2532                 InputPurpose::Email => "Email",
2533                 InputPurpose::Name => "Name",
2534                 InputPurpose::Password => "Password",
2535                 InputPurpose::Pin => "Pin",
2536                 _ => "Unknown",
2537             }
2538         )
2539     }
2540 }
2541 
2542 #[doc(hidden)]
2543 impl ToGlib for InputPurpose {
2544     type GlibType = gtk_sys::GtkInputPurpose;
2545 
to_glib(&self) -> gtk_sys::GtkInputPurpose2546     fn to_glib(&self) -> gtk_sys::GtkInputPurpose {
2547         match *self {
2548             InputPurpose::FreeForm => gtk_sys::GTK_INPUT_PURPOSE_FREE_FORM,
2549             InputPurpose::Alpha => gtk_sys::GTK_INPUT_PURPOSE_ALPHA,
2550             InputPurpose::Digits => gtk_sys::GTK_INPUT_PURPOSE_DIGITS,
2551             InputPurpose::Number => gtk_sys::GTK_INPUT_PURPOSE_NUMBER,
2552             InputPurpose::Phone => gtk_sys::GTK_INPUT_PURPOSE_PHONE,
2553             InputPurpose::Url => gtk_sys::GTK_INPUT_PURPOSE_URL,
2554             InputPurpose::Email => gtk_sys::GTK_INPUT_PURPOSE_EMAIL,
2555             InputPurpose::Name => gtk_sys::GTK_INPUT_PURPOSE_NAME,
2556             InputPurpose::Password => gtk_sys::GTK_INPUT_PURPOSE_PASSWORD,
2557             InputPurpose::Pin => gtk_sys::GTK_INPUT_PURPOSE_PIN,
2558             InputPurpose::__Unknown(value) => value,
2559         }
2560     }
2561 }
2562 
2563 #[doc(hidden)]
2564 impl FromGlib<gtk_sys::GtkInputPurpose> for InputPurpose {
from_glib(value: gtk_sys::GtkInputPurpose) -> Self2565     fn from_glib(value: gtk_sys::GtkInputPurpose) -> Self {
2566         skip_assert_initialized!();
2567         match value {
2568             0 => InputPurpose::FreeForm,
2569             1 => InputPurpose::Alpha,
2570             2 => InputPurpose::Digits,
2571             3 => InputPurpose::Number,
2572             4 => InputPurpose::Phone,
2573             5 => InputPurpose::Url,
2574             6 => InputPurpose::Email,
2575             7 => InputPurpose::Name,
2576             8 => InputPurpose::Password,
2577             9 => InputPurpose::Pin,
2578             value => InputPurpose::__Unknown(value),
2579         }
2580     }
2581 }
2582 
2583 impl StaticType for InputPurpose {
static_type() -> Type2584     fn static_type() -> Type {
2585         unsafe { from_glib(gtk_sys::gtk_input_purpose_get_type()) }
2586     }
2587 }
2588 
2589 impl<'a> FromValueOptional<'a> for InputPurpose {
from_value_optional(value: &Value) -> Option<Self>2590     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2591         Some(FromValue::from_value(value))
2592     }
2593 }
2594 
2595 impl<'a> FromValue<'a> for InputPurpose {
from_value(value: &Value) -> Self2596     unsafe fn from_value(value: &Value) -> Self {
2597         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2598     }
2599 }
2600 
2601 impl SetValue for InputPurpose {
set_value(value: &mut Value, this: &Self)2602     unsafe fn set_value(value: &mut Value, this: &Self) {
2603         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2604     }
2605 }
2606 
2607 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2608 pub enum Justification {
2609     Left,
2610     Right,
2611     Center,
2612     Fill,
2613     #[doc(hidden)]
2614     __Unknown(i32),
2615 }
2616 
2617 impl fmt::Display for Justification {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result2618     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2619         write!(
2620             f,
2621             "Justification::{}",
2622             match *self {
2623                 Justification::Left => "Left",
2624                 Justification::Right => "Right",
2625                 Justification::Center => "Center",
2626                 Justification::Fill => "Fill",
2627                 _ => "Unknown",
2628             }
2629         )
2630     }
2631 }
2632 
2633 #[doc(hidden)]
2634 impl ToGlib for Justification {
2635     type GlibType = gtk_sys::GtkJustification;
2636 
to_glib(&self) -> gtk_sys::GtkJustification2637     fn to_glib(&self) -> gtk_sys::GtkJustification {
2638         match *self {
2639             Justification::Left => gtk_sys::GTK_JUSTIFY_LEFT,
2640             Justification::Right => gtk_sys::GTK_JUSTIFY_RIGHT,
2641             Justification::Center => gtk_sys::GTK_JUSTIFY_CENTER,
2642             Justification::Fill => gtk_sys::GTK_JUSTIFY_FILL,
2643             Justification::__Unknown(value) => value,
2644         }
2645     }
2646 }
2647 
2648 #[doc(hidden)]
2649 impl FromGlib<gtk_sys::GtkJustification> for Justification {
from_glib(value: gtk_sys::GtkJustification) -> Self2650     fn from_glib(value: gtk_sys::GtkJustification) -> Self {
2651         skip_assert_initialized!();
2652         match value {
2653             0 => Justification::Left,
2654             1 => Justification::Right,
2655             2 => Justification::Center,
2656             3 => Justification::Fill,
2657             value => Justification::__Unknown(value),
2658         }
2659     }
2660 }
2661 
2662 impl StaticType for Justification {
static_type() -> Type2663     fn static_type() -> Type {
2664         unsafe { from_glib(gtk_sys::gtk_justification_get_type()) }
2665     }
2666 }
2667 
2668 impl<'a> FromValueOptional<'a> for Justification {
from_value_optional(value: &Value) -> Option<Self>2669     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2670         Some(FromValue::from_value(value))
2671     }
2672 }
2673 
2674 impl<'a> FromValue<'a> for Justification {
from_value(value: &Value) -> Self2675     unsafe fn from_value(value: &Value) -> Self {
2676         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2677     }
2678 }
2679 
2680 impl SetValue for Justification {
set_value(value: &mut Value, this: &Self)2681     unsafe fn set_value(value: &mut Value, this: &Self) {
2682         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2683     }
2684 }
2685 
2686 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2687 pub enum LevelBarMode {
2688     Continuous,
2689     Discrete,
2690     #[doc(hidden)]
2691     __Unknown(i32),
2692 }
2693 
2694 impl fmt::Display for LevelBarMode {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result2695     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2696         write!(
2697             f,
2698             "LevelBarMode::{}",
2699             match *self {
2700                 LevelBarMode::Continuous => "Continuous",
2701                 LevelBarMode::Discrete => "Discrete",
2702                 _ => "Unknown",
2703             }
2704         )
2705     }
2706 }
2707 
2708 #[doc(hidden)]
2709 impl ToGlib for LevelBarMode {
2710     type GlibType = gtk_sys::GtkLevelBarMode;
2711 
to_glib(&self) -> gtk_sys::GtkLevelBarMode2712     fn to_glib(&self) -> gtk_sys::GtkLevelBarMode {
2713         match *self {
2714             LevelBarMode::Continuous => gtk_sys::GTK_LEVEL_BAR_MODE_CONTINUOUS,
2715             LevelBarMode::Discrete => gtk_sys::GTK_LEVEL_BAR_MODE_DISCRETE,
2716             LevelBarMode::__Unknown(value) => value,
2717         }
2718     }
2719 }
2720 
2721 #[doc(hidden)]
2722 impl FromGlib<gtk_sys::GtkLevelBarMode> for LevelBarMode {
from_glib(value: gtk_sys::GtkLevelBarMode) -> Self2723     fn from_glib(value: gtk_sys::GtkLevelBarMode) -> Self {
2724         skip_assert_initialized!();
2725         match value {
2726             0 => LevelBarMode::Continuous,
2727             1 => LevelBarMode::Discrete,
2728             value => LevelBarMode::__Unknown(value),
2729         }
2730     }
2731 }
2732 
2733 impl StaticType for LevelBarMode {
static_type() -> Type2734     fn static_type() -> Type {
2735         unsafe { from_glib(gtk_sys::gtk_level_bar_mode_get_type()) }
2736     }
2737 }
2738 
2739 impl<'a> FromValueOptional<'a> for LevelBarMode {
from_value_optional(value: &Value) -> Option<Self>2740     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2741         Some(FromValue::from_value(value))
2742     }
2743 }
2744 
2745 impl<'a> FromValue<'a> for LevelBarMode {
from_value(value: &Value) -> Self2746     unsafe fn from_value(value: &Value) -> Self {
2747         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2748     }
2749 }
2750 
2751 impl SetValue for LevelBarMode {
set_value(value: &mut Value, this: &Self)2752     unsafe fn set_value(value: &mut Value, this: &Self) {
2753         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2754     }
2755 }
2756 
2757 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2758 pub enum License {
2759     Unknown,
2760     Custom,
2761     Gpl20,
2762     Gpl30,
2763     Lgpl21,
2764     Lgpl30,
2765     Bsd,
2766     MitX11,
2767     Artistic,
2768     Gpl20Only,
2769     Gpl30Only,
2770     Lgpl21Only,
2771     Lgpl30Only,
2772     Agpl30,
2773     Agpl30Only,
2774     #[doc(hidden)]
2775     __Unknown(i32),
2776 }
2777 
2778 impl fmt::Display for License {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result2779     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2780         write!(
2781             f,
2782             "License::{}",
2783             match *self {
2784                 License::Unknown => "Unknown",
2785                 License::Custom => "Custom",
2786                 License::Gpl20 => "Gpl20",
2787                 License::Gpl30 => "Gpl30",
2788                 License::Lgpl21 => "Lgpl21",
2789                 License::Lgpl30 => "Lgpl30",
2790                 License::Bsd => "Bsd",
2791                 License::MitX11 => "MitX11",
2792                 License::Artistic => "Artistic",
2793                 License::Gpl20Only => "Gpl20Only",
2794                 License::Gpl30Only => "Gpl30Only",
2795                 License::Lgpl21Only => "Lgpl21Only",
2796                 License::Lgpl30Only => "Lgpl30Only",
2797                 License::Agpl30 => "Agpl30",
2798                 License::Agpl30Only => "Agpl30Only",
2799                 _ => "Unknown",
2800             }
2801         )
2802     }
2803 }
2804 
2805 #[doc(hidden)]
2806 impl ToGlib for License {
2807     type GlibType = gtk_sys::GtkLicense;
2808 
to_glib(&self) -> gtk_sys::GtkLicense2809     fn to_glib(&self) -> gtk_sys::GtkLicense {
2810         match *self {
2811             License::Unknown => gtk_sys::GTK_LICENSE_UNKNOWN,
2812             License::Custom => gtk_sys::GTK_LICENSE_CUSTOM,
2813             License::Gpl20 => gtk_sys::GTK_LICENSE_GPL_2_0,
2814             License::Gpl30 => gtk_sys::GTK_LICENSE_GPL_3_0,
2815             License::Lgpl21 => gtk_sys::GTK_LICENSE_LGPL_2_1,
2816             License::Lgpl30 => gtk_sys::GTK_LICENSE_LGPL_3_0,
2817             License::Bsd => gtk_sys::GTK_LICENSE_BSD,
2818             License::MitX11 => gtk_sys::GTK_LICENSE_MIT_X11,
2819             License::Artistic => gtk_sys::GTK_LICENSE_ARTISTIC,
2820             License::Gpl20Only => gtk_sys::GTK_LICENSE_GPL_2_0_ONLY,
2821             License::Gpl30Only => gtk_sys::GTK_LICENSE_GPL_3_0_ONLY,
2822             License::Lgpl21Only => gtk_sys::GTK_LICENSE_LGPL_2_1_ONLY,
2823             License::Lgpl30Only => gtk_sys::GTK_LICENSE_LGPL_3_0_ONLY,
2824             License::Agpl30 => gtk_sys::GTK_LICENSE_AGPL_3_0,
2825             License::Agpl30Only => gtk_sys::GTK_LICENSE_AGPL_3_0_ONLY,
2826             License::__Unknown(value) => value,
2827         }
2828     }
2829 }
2830 
2831 #[doc(hidden)]
2832 impl FromGlib<gtk_sys::GtkLicense> for License {
from_glib(value: gtk_sys::GtkLicense) -> Self2833     fn from_glib(value: gtk_sys::GtkLicense) -> Self {
2834         skip_assert_initialized!();
2835         match value {
2836             0 => License::Unknown,
2837             1 => License::Custom,
2838             2 => License::Gpl20,
2839             3 => License::Gpl30,
2840             4 => License::Lgpl21,
2841             5 => License::Lgpl30,
2842             6 => License::Bsd,
2843             7 => License::MitX11,
2844             8 => License::Artistic,
2845             9 => License::Gpl20Only,
2846             10 => License::Gpl30Only,
2847             11 => License::Lgpl21Only,
2848             12 => License::Lgpl30Only,
2849             13 => License::Agpl30,
2850             14 => License::Agpl30Only,
2851             value => License::__Unknown(value),
2852         }
2853     }
2854 }
2855 
2856 impl StaticType for License {
static_type() -> Type2857     fn static_type() -> Type {
2858         unsafe { from_glib(gtk_sys::gtk_license_get_type()) }
2859     }
2860 }
2861 
2862 impl<'a> FromValueOptional<'a> for License {
from_value_optional(value: &Value) -> Option<Self>2863     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2864         Some(FromValue::from_value(value))
2865     }
2866 }
2867 
2868 impl<'a> FromValue<'a> for License {
from_value(value: &Value) -> Self2869     unsafe fn from_value(value: &Value) -> Self {
2870         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2871     }
2872 }
2873 
2874 impl SetValue for License {
set_value(value: &mut Value, this: &Self)2875     unsafe fn set_value(value: &mut Value, this: &Self) {
2876         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2877     }
2878 }
2879 
2880 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2881 pub enum MenuDirectionType {
2882     Parent,
2883     Child,
2884     Next,
2885     Prev,
2886     #[doc(hidden)]
2887     __Unknown(i32),
2888 }
2889 
2890 impl fmt::Display for MenuDirectionType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result2891     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2892         write!(
2893             f,
2894             "MenuDirectionType::{}",
2895             match *self {
2896                 MenuDirectionType::Parent => "Parent",
2897                 MenuDirectionType::Child => "Child",
2898                 MenuDirectionType::Next => "Next",
2899                 MenuDirectionType::Prev => "Prev",
2900                 _ => "Unknown",
2901             }
2902         )
2903     }
2904 }
2905 
2906 #[doc(hidden)]
2907 impl ToGlib for MenuDirectionType {
2908     type GlibType = gtk_sys::GtkMenuDirectionType;
2909 
to_glib(&self) -> gtk_sys::GtkMenuDirectionType2910     fn to_glib(&self) -> gtk_sys::GtkMenuDirectionType {
2911         match *self {
2912             MenuDirectionType::Parent => gtk_sys::GTK_MENU_DIR_PARENT,
2913             MenuDirectionType::Child => gtk_sys::GTK_MENU_DIR_CHILD,
2914             MenuDirectionType::Next => gtk_sys::GTK_MENU_DIR_NEXT,
2915             MenuDirectionType::Prev => gtk_sys::GTK_MENU_DIR_PREV,
2916             MenuDirectionType::__Unknown(value) => value,
2917         }
2918     }
2919 }
2920 
2921 #[doc(hidden)]
2922 impl FromGlib<gtk_sys::GtkMenuDirectionType> for MenuDirectionType {
from_glib(value: gtk_sys::GtkMenuDirectionType) -> Self2923     fn from_glib(value: gtk_sys::GtkMenuDirectionType) -> Self {
2924         skip_assert_initialized!();
2925         match value {
2926             0 => MenuDirectionType::Parent,
2927             1 => MenuDirectionType::Child,
2928             2 => MenuDirectionType::Next,
2929             3 => MenuDirectionType::Prev,
2930             value => MenuDirectionType::__Unknown(value),
2931         }
2932     }
2933 }
2934 
2935 impl StaticType for MenuDirectionType {
static_type() -> Type2936     fn static_type() -> Type {
2937         unsafe { from_glib(gtk_sys::gtk_menu_direction_type_get_type()) }
2938     }
2939 }
2940 
2941 impl<'a> FromValueOptional<'a> for MenuDirectionType {
from_value_optional(value: &Value) -> Option<Self>2942     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
2943         Some(FromValue::from_value(value))
2944     }
2945 }
2946 
2947 impl<'a> FromValue<'a> for MenuDirectionType {
from_value(value: &Value) -> Self2948     unsafe fn from_value(value: &Value) -> Self {
2949         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
2950     }
2951 }
2952 
2953 impl SetValue for MenuDirectionType {
set_value(value: &mut Value, this: &Self)2954     unsafe fn set_value(value: &mut Value, this: &Self) {
2955         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
2956     }
2957 }
2958 
2959 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
2960 pub enum MessageType {
2961     Info,
2962     Warning,
2963     Question,
2964     Error,
2965     Other,
2966     #[doc(hidden)]
2967     __Unknown(i32),
2968 }
2969 
2970 impl fmt::Display for MessageType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result2971     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2972         write!(
2973             f,
2974             "MessageType::{}",
2975             match *self {
2976                 MessageType::Info => "Info",
2977                 MessageType::Warning => "Warning",
2978                 MessageType::Question => "Question",
2979                 MessageType::Error => "Error",
2980                 MessageType::Other => "Other",
2981                 _ => "Unknown",
2982             }
2983         )
2984     }
2985 }
2986 
2987 #[doc(hidden)]
2988 impl ToGlib for MessageType {
2989     type GlibType = gtk_sys::GtkMessageType;
2990 
to_glib(&self) -> gtk_sys::GtkMessageType2991     fn to_glib(&self) -> gtk_sys::GtkMessageType {
2992         match *self {
2993             MessageType::Info => gtk_sys::GTK_MESSAGE_INFO,
2994             MessageType::Warning => gtk_sys::GTK_MESSAGE_WARNING,
2995             MessageType::Question => gtk_sys::GTK_MESSAGE_QUESTION,
2996             MessageType::Error => gtk_sys::GTK_MESSAGE_ERROR,
2997             MessageType::Other => gtk_sys::GTK_MESSAGE_OTHER,
2998             MessageType::__Unknown(value) => value,
2999         }
3000     }
3001 }
3002 
3003 #[doc(hidden)]
3004 impl FromGlib<gtk_sys::GtkMessageType> for MessageType {
from_glib(value: gtk_sys::GtkMessageType) -> Self3005     fn from_glib(value: gtk_sys::GtkMessageType) -> Self {
3006         skip_assert_initialized!();
3007         match value {
3008             0 => MessageType::Info,
3009             1 => MessageType::Warning,
3010             2 => MessageType::Question,
3011             3 => MessageType::Error,
3012             4 => MessageType::Other,
3013             value => MessageType::__Unknown(value),
3014         }
3015     }
3016 }
3017 
3018 impl StaticType for MessageType {
static_type() -> Type3019     fn static_type() -> Type {
3020         unsafe { from_glib(gtk_sys::gtk_message_type_get_type()) }
3021     }
3022 }
3023 
3024 impl<'a> FromValueOptional<'a> for MessageType {
from_value_optional(value: &Value) -> Option<Self>3025     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3026         Some(FromValue::from_value(value))
3027     }
3028 }
3029 
3030 impl<'a> FromValue<'a> for MessageType {
from_value(value: &Value) -> Self3031     unsafe fn from_value(value: &Value) -> Self {
3032         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3033     }
3034 }
3035 
3036 impl SetValue for MessageType {
set_value(value: &mut Value, this: &Self)3037     unsafe fn set_value(value: &mut Value, this: &Self) {
3038         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3039     }
3040 }
3041 
3042 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3043 pub enum MovementStep {
3044     LogicalPositions,
3045     VisualPositions,
3046     Words,
3047     DisplayLines,
3048     DisplayLineEnds,
3049     Paragraphs,
3050     ParagraphEnds,
3051     Pages,
3052     BufferEnds,
3053     HorizontalPages,
3054     #[doc(hidden)]
3055     __Unknown(i32),
3056 }
3057 
3058 impl fmt::Display for MovementStep {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result3059     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3060         write!(
3061             f,
3062             "MovementStep::{}",
3063             match *self {
3064                 MovementStep::LogicalPositions => "LogicalPositions",
3065                 MovementStep::VisualPositions => "VisualPositions",
3066                 MovementStep::Words => "Words",
3067                 MovementStep::DisplayLines => "DisplayLines",
3068                 MovementStep::DisplayLineEnds => "DisplayLineEnds",
3069                 MovementStep::Paragraphs => "Paragraphs",
3070                 MovementStep::ParagraphEnds => "ParagraphEnds",
3071                 MovementStep::Pages => "Pages",
3072                 MovementStep::BufferEnds => "BufferEnds",
3073                 MovementStep::HorizontalPages => "HorizontalPages",
3074                 _ => "Unknown",
3075             }
3076         )
3077     }
3078 }
3079 
3080 #[doc(hidden)]
3081 impl ToGlib for MovementStep {
3082     type GlibType = gtk_sys::GtkMovementStep;
3083 
to_glib(&self) -> gtk_sys::GtkMovementStep3084     fn to_glib(&self) -> gtk_sys::GtkMovementStep {
3085         match *self {
3086             MovementStep::LogicalPositions => gtk_sys::GTK_MOVEMENT_LOGICAL_POSITIONS,
3087             MovementStep::VisualPositions => gtk_sys::GTK_MOVEMENT_VISUAL_POSITIONS,
3088             MovementStep::Words => gtk_sys::GTK_MOVEMENT_WORDS,
3089             MovementStep::DisplayLines => gtk_sys::GTK_MOVEMENT_DISPLAY_LINES,
3090             MovementStep::DisplayLineEnds => gtk_sys::GTK_MOVEMENT_DISPLAY_LINE_ENDS,
3091             MovementStep::Paragraphs => gtk_sys::GTK_MOVEMENT_PARAGRAPHS,
3092             MovementStep::ParagraphEnds => gtk_sys::GTK_MOVEMENT_PARAGRAPH_ENDS,
3093             MovementStep::Pages => gtk_sys::GTK_MOVEMENT_PAGES,
3094             MovementStep::BufferEnds => gtk_sys::GTK_MOVEMENT_BUFFER_ENDS,
3095             MovementStep::HorizontalPages => gtk_sys::GTK_MOVEMENT_HORIZONTAL_PAGES,
3096             MovementStep::__Unknown(value) => value,
3097         }
3098     }
3099 }
3100 
3101 #[doc(hidden)]
3102 impl FromGlib<gtk_sys::GtkMovementStep> for MovementStep {
from_glib(value: gtk_sys::GtkMovementStep) -> Self3103     fn from_glib(value: gtk_sys::GtkMovementStep) -> Self {
3104         skip_assert_initialized!();
3105         match value {
3106             0 => MovementStep::LogicalPositions,
3107             1 => MovementStep::VisualPositions,
3108             2 => MovementStep::Words,
3109             3 => MovementStep::DisplayLines,
3110             4 => MovementStep::DisplayLineEnds,
3111             5 => MovementStep::Paragraphs,
3112             6 => MovementStep::ParagraphEnds,
3113             7 => MovementStep::Pages,
3114             8 => MovementStep::BufferEnds,
3115             9 => MovementStep::HorizontalPages,
3116             value => MovementStep::__Unknown(value),
3117         }
3118     }
3119 }
3120 
3121 impl StaticType for MovementStep {
static_type() -> Type3122     fn static_type() -> Type {
3123         unsafe { from_glib(gtk_sys::gtk_movement_step_get_type()) }
3124     }
3125 }
3126 
3127 impl<'a> FromValueOptional<'a> for MovementStep {
from_value_optional(value: &Value) -> Option<Self>3128     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3129         Some(FromValue::from_value(value))
3130     }
3131 }
3132 
3133 impl<'a> FromValue<'a> for MovementStep {
from_value(value: &Value) -> Self3134     unsafe fn from_value(value: &Value) -> Self {
3135         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3136     }
3137 }
3138 
3139 impl SetValue for MovementStep {
set_value(value: &mut Value, this: &Self)3140     unsafe fn set_value(value: &mut Value, this: &Self) {
3141         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3142     }
3143 }
3144 
3145 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3146 pub enum NotebookTab {
3147     First,
3148     Last,
3149     #[doc(hidden)]
3150     __Unknown(i32),
3151 }
3152 
3153 impl fmt::Display for NotebookTab {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result3154     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3155         write!(
3156             f,
3157             "NotebookTab::{}",
3158             match *self {
3159                 NotebookTab::First => "First",
3160                 NotebookTab::Last => "Last",
3161                 _ => "Unknown",
3162             }
3163         )
3164     }
3165 }
3166 
3167 #[doc(hidden)]
3168 impl ToGlib for NotebookTab {
3169     type GlibType = gtk_sys::GtkNotebookTab;
3170 
to_glib(&self) -> gtk_sys::GtkNotebookTab3171     fn to_glib(&self) -> gtk_sys::GtkNotebookTab {
3172         match *self {
3173             NotebookTab::First => gtk_sys::GTK_NOTEBOOK_TAB_FIRST,
3174             NotebookTab::Last => gtk_sys::GTK_NOTEBOOK_TAB_LAST,
3175             NotebookTab::__Unknown(value) => value,
3176         }
3177     }
3178 }
3179 
3180 #[doc(hidden)]
3181 impl FromGlib<gtk_sys::GtkNotebookTab> for NotebookTab {
from_glib(value: gtk_sys::GtkNotebookTab) -> Self3182     fn from_glib(value: gtk_sys::GtkNotebookTab) -> Self {
3183         skip_assert_initialized!();
3184         match value {
3185             0 => NotebookTab::First,
3186             1 => NotebookTab::Last,
3187             value => NotebookTab::__Unknown(value),
3188         }
3189     }
3190 }
3191 
3192 impl StaticType for NotebookTab {
static_type() -> Type3193     fn static_type() -> Type {
3194         unsafe { from_glib(gtk_sys::gtk_notebook_tab_get_type()) }
3195     }
3196 }
3197 
3198 impl<'a> FromValueOptional<'a> for NotebookTab {
from_value_optional(value: &Value) -> Option<Self>3199     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3200         Some(FromValue::from_value(value))
3201     }
3202 }
3203 
3204 impl<'a> FromValue<'a> for NotebookTab {
from_value(value: &Value) -> Self3205     unsafe fn from_value(value: &Value) -> Self {
3206         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3207     }
3208 }
3209 
3210 impl SetValue for NotebookTab {
set_value(value: &mut Value, this: &Self)3211     unsafe fn set_value(value: &mut Value, this: &Self) {
3212         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3213     }
3214 }
3215 
3216 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3217 pub enum NumberUpLayout {
3218     Lrtb,
3219     Lrbt,
3220     Rltb,
3221     Rlbt,
3222     Tblr,
3223     Tbrl,
3224     Btlr,
3225     Btrl,
3226     #[doc(hidden)]
3227     __Unknown(i32),
3228 }
3229 
3230 impl fmt::Display for NumberUpLayout {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result3231     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3232         write!(
3233             f,
3234             "NumberUpLayout::{}",
3235             match *self {
3236                 NumberUpLayout::Lrtb => "Lrtb",
3237                 NumberUpLayout::Lrbt => "Lrbt",
3238                 NumberUpLayout::Rltb => "Rltb",
3239                 NumberUpLayout::Rlbt => "Rlbt",
3240                 NumberUpLayout::Tblr => "Tblr",
3241                 NumberUpLayout::Tbrl => "Tbrl",
3242                 NumberUpLayout::Btlr => "Btlr",
3243                 NumberUpLayout::Btrl => "Btrl",
3244                 _ => "Unknown",
3245             }
3246         )
3247     }
3248 }
3249 
3250 #[doc(hidden)]
3251 impl ToGlib for NumberUpLayout {
3252     type GlibType = gtk_sys::GtkNumberUpLayout;
3253 
to_glib(&self) -> gtk_sys::GtkNumberUpLayout3254     fn to_glib(&self) -> gtk_sys::GtkNumberUpLayout {
3255         match *self {
3256             NumberUpLayout::Lrtb => gtk_sys::GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM,
3257             NumberUpLayout::Lrbt => gtk_sys::GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP,
3258             NumberUpLayout::Rltb => gtk_sys::GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM,
3259             NumberUpLayout::Rlbt => gtk_sys::GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP,
3260             NumberUpLayout::Tblr => gtk_sys::GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT,
3261             NumberUpLayout::Tbrl => gtk_sys::GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT,
3262             NumberUpLayout::Btlr => gtk_sys::GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT,
3263             NumberUpLayout::Btrl => gtk_sys::GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT,
3264             NumberUpLayout::__Unknown(value) => value,
3265         }
3266     }
3267 }
3268 
3269 #[doc(hidden)]
3270 impl FromGlib<gtk_sys::GtkNumberUpLayout> for NumberUpLayout {
from_glib(value: gtk_sys::GtkNumberUpLayout) -> Self3271     fn from_glib(value: gtk_sys::GtkNumberUpLayout) -> Self {
3272         skip_assert_initialized!();
3273         match value {
3274             0 => NumberUpLayout::Lrtb,
3275             1 => NumberUpLayout::Lrbt,
3276             2 => NumberUpLayout::Rltb,
3277             3 => NumberUpLayout::Rlbt,
3278             4 => NumberUpLayout::Tblr,
3279             5 => NumberUpLayout::Tbrl,
3280             6 => NumberUpLayout::Btlr,
3281             7 => NumberUpLayout::Btrl,
3282             value => NumberUpLayout::__Unknown(value),
3283         }
3284     }
3285 }
3286 
3287 impl StaticType for NumberUpLayout {
static_type() -> Type3288     fn static_type() -> Type {
3289         unsafe { from_glib(gtk_sys::gtk_number_up_layout_get_type()) }
3290     }
3291 }
3292 
3293 impl<'a> FromValueOptional<'a> for NumberUpLayout {
from_value_optional(value: &Value) -> Option<Self>3294     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3295         Some(FromValue::from_value(value))
3296     }
3297 }
3298 
3299 impl<'a> FromValue<'a> for NumberUpLayout {
from_value(value: &Value) -> Self3300     unsafe fn from_value(value: &Value) -> Self {
3301         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3302     }
3303 }
3304 
3305 impl SetValue for NumberUpLayout {
set_value(value: &mut Value, this: &Self)3306     unsafe fn set_value(value: &mut Value, this: &Self) {
3307         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3308     }
3309 }
3310 
3311 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3312 pub enum Orientation {
3313     Horizontal,
3314     Vertical,
3315     #[doc(hidden)]
3316     __Unknown(i32),
3317 }
3318 
3319 impl fmt::Display for Orientation {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result3320     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3321         write!(
3322             f,
3323             "Orientation::{}",
3324             match *self {
3325                 Orientation::Horizontal => "Horizontal",
3326                 Orientation::Vertical => "Vertical",
3327                 _ => "Unknown",
3328             }
3329         )
3330     }
3331 }
3332 
3333 #[doc(hidden)]
3334 impl ToGlib for Orientation {
3335     type GlibType = gtk_sys::GtkOrientation;
3336 
to_glib(&self) -> gtk_sys::GtkOrientation3337     fn to_glib(&self) -> gtk_sys::GtkOrientation {
3338         match *self {
3339             Orientation::Horizontal => gtk_sys::GTK_ORIENTATION_HORIZONTAL,
3340             Orientation::Vertical => gtk_sys::GTK_ORIENTATION_VERTICAL,
3341             Orientation::__Unknown(value) => value,
3342         }
3343     }
3344 }
3345 
3346 #[doc(hidden)]
3347 impl FromGlib<gtk_sys::GtkOrientation> for Orientation {
from_glib(value: gtk_sys::GtkOrientation) -> Self3348     fn from_glib(value: gtk_sys::GtkOrientation) -> Self {
3349         skip_assert_initialized!();
3350         match value {
3351             0 => Orientation::Horizontal,
3352             1 => Orientation::Vertical,
3353             value => Orientation::__Unknown(value),
3354         }
3355     }
3356 }
3357 
3358 impl StaticType for Orientation {
static_type() -> Type3359     fn static_type() -> Type {
3360         unsafe { from_glib(gtk_sys::gtk_orientation_get_type()) }
3361     }
3362 }
3363 
3364 impl<'a> FromValueOptional<'a> for Orientation {
from_value_optional(value: &Value) -> Option<Self>3365     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3366         Some(FromValue::from_value(value))
3367     }
3368 }
3369 
3370 impl<'a> FromValue<'a> for Orientation {
from_value(value: &Value) -> Self3371     unsafe fn from_value(value: &Value) -> Self {
3372         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3373     }
3374 }
3375 
3376 impl SetValue for Orientation {
set_value(value: &mut Value, this: &Self)3377     unsafe fn set_value(value: &mut Value, this: &Self) {
3378         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3379     }
3380 }
3381 
3382 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3383 pub enum PackDirection {
3384     Ltr,
3385     Rtl,
3386     Ttb,
3387     Btt,
3388     #[doc(hidden)]
3389     __Unknown(i32),
3390 }
3391 
3392 impl fmt::Display for PackDirection {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result3393     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3394         write!(
3395             f,
3396             "PackDirection::{}",
3397             match *self {
3398                 PackDirection::Ltr => "Ltr",
3399                 PackDirection::Rtl => "Rtl",
3400                 PackDirection::Ttb => "Ttb",
3401                 PackDirection::Btt => "Btt",
3402                 _ => "Unknown",
3403             }
3404         )
3405     }
3406 }
3407 
3408 #[doc(hidden)]
3409 impl ToGlib for PackDirection {
3410     type GlibType = gtk_sys::GtkPackDirection;
3411 
to_glib(&self) -> gtk_sys::GtkPackDirection3412     fn to_glib(&self) -> gtk_sys::GtkPackDirection {
3413         match *self {
3414             PackDirection::Ltr => gtk_sys::GTK_PACK_DIRECTION_LTR,
3415             PackDirection::Rtl => gtk_sys::GTK_PACK_DIRECTION_RTL,
3416             PackDirection::Ttb => gtk_sys::GTK_PACK_DIRECTION_TTB,
3417             PackDirection::Btt => gtk_sys::GTK_PACK_DIRECTION_BTT,
3418             PackDirection::__Unknown(value) => value,
3419         }
3420     }
3421 }
3422 
3423 #[doc(hidden)]
3424 impl FromGlib<gtk_sys::GtkPackDirection> for PackDirection {
from_glib(value: gtk_sys::GtkPackDirection) -> Self3425     fn from_glib(value: gtk_sys::GtkPackDirection) -> Self {
3426         skip_assert_initialized!();
3427         match value {
3428             0 => PackDirection::Ltr,
3429             1 => PackDirection::Rtl,
3430             2 => PackDirection::Ttb,
3431             3 => PackDirection::Btt,
3432             value => PackDirection::__Unknown(value),
3433         }
3434     }
3435 }
3436 
3437 impl StaticType for PackDirection {
static_type() -> Type3438     fn static_type() -> Type {
3439         unsafe { from_glib(gtk_sys::gtk_pack_direction_get_type()) }
3440     }
3441 }
3442 
3443 impl<'a> FromValueOptional<'a> for PackDirection {
from_value_optional(value: &Value) -> Option<Self>3444     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3445         Some(FromValue::from_value(value))
3446     }
3447 }
3448 
3449 impl<'a> FromValue<'a> for PackDirection {
from_value(value: &Value) -> Self3450     unsafe fn from_value(value: &Value) -> Self {
3451         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3452     }
3453 }
3454 
3455 impl SetValue for PackDirection {
set_value(value: &mut Value, this: &Self)3456     unsafe fn set_value(value: &mut Value, this: &Self) {
3457         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3458     }
3459 }
3460 
3461 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3462 pub enum PackType {
3463     Start,
3464     End,
3465     #[doc(hidden)]
3466     __Unknown(i32),
3467 }
3468 
3469 impl fmt::Display for PackType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result3470     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3471         write!(
3472             f,
3473             "PackType::{}",
3474             match *self {
3475                 PackType::Start => "Start",
3476                 PackType::End => "End",
3477                 _ => "Unknown",
3478             }
3479         )
3480     }
3481 }
3482 
3483 #[doc(hidden)]
3484 impl ToGlib for PackType {
3485     type GlibType = gtk_sys::GtkPackType;
3486 
to_glib(&self) -> gtk_sys::GtkPackType3487     fn to_glib(&self) -> gtk_sys::GtkPackType {
3488         match *self {
3489             PackType::Start => gtk_sys::GTK_PACK_START,
3490             PackType::End => gtk_sys::GTK_PACK_END,
3491             PackType::__Unknown(value) => value,
3492         }
3493     }
3494 }
3495 
3496 #[doc(hidden)]
3497 impl FromGlib<gtk_sys::GtkPackType> for PackType {
from_glib(value: gtk_sys::GtkPackType) -> Self3498     fn from_glib(value: gtk_sys::GtkPackType) -> Self {
3499         skip_assert_initialized!();
3500         match value {
3501             0 => PackType::Start,
3502             1 => PackType::End,
3503             value => PackType::__Unknown(value),
3504         }
3505     }
3506 }
3507 
3508 impl StaticType for PackType {
static_type() -> Type3509     fn static_type() -> Type {
3510         unsafe { from_glib(gtk_sys::gtk_pack_type_get_type()) }
3511     }
3512 }
3513 
3514 impl<'a> FromValueOptional<'a> for PackType {
from_value_optional(value: &Value) -> Option<Self>3515     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3516         Some(FromValue::from_value(value))
3517     }
3518 }
3519 
3520 impl<'a> FromValue<'a> for PackType {
from_value(value: &Value) -> Self3521     unsafe fn from_value(value: &Value) -> Self {
3522         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3523     }
3524 }
3525 
3526 impl SetValue for PackType {
set_value(value: &mut Value, this: &Self)3527     unsafe fn set_value(value: &mut Value, this: &Self) {
3528         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3529     }
3530 }
3531 
3532 #[cfg(any(feature = "v3_22", feature = "dox"))]
3533 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3534 pub enum PadActionType {
3535     Button,
3536     Ring,
3537     Strip,
3538     #[doc(hidden)]
3539     __Unknown(i32),
3540 }
3541 
3542 #[cfg(any(feature = "v3_22", feature = "dox"))]
3543 impl fmt::Display for PadActionType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result3544     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3545         write!(
3546             f,
3547             "PadActionType::{}",
3548             match *self {
3549                 PadActionType::Button => "Button",
3550                 PadActionType::Ring => "Ring",
3551                 PadActionType::Strip => "Strip",
3552                 _ => "Unknown",
3553             }
3554         )
3555     }
3556 }
3557 
3558 #[cfg(any(feature = "v3_22", feature = "dox"))]
3559 #[doc(hidden)]
3560 impl ToGlib for PadActionType {
3561     type GlibType = gtk_sys::GtkPadActionType;
3562 
to_glib(&self) -> gtk_sys::GtkPadActionType3563     fn to_glib(&self) -> gtk_sys::GtkPadActionType {
3564         match *self {
3565             PadActionType::Button => gtk_sys::GTK_PAD_ACTION_BUTTON,
3566             PadActionType::Ring => gtk_sys::GTK_PAD_ACTION_RING,
3567             PadActionType::Strip => gtk_sys::GTK_PAD_ACTION_STRIP,
3568             PadActionType::__Unknown(value) => value,
3569         }
3570     }
3571 }
3572 
3573 #[cfg(any(feature = "v3_22", feature = "dox"))]
3574 #[doc(hidden)]
3575 impl FromGlib<gtk_sys::GtkPadActionType> for PadActionType {
from_glib(value: gtk_sys::GtkPadActionType) -> Self3576     fn from_glib(value: gtk_sys::GtkPadActionType) -> Self {
3577         skip_assert_initialized!();
3578         match value {
3579             0 => PadActionType::Button,
3580             1 => PadActionType::Ring,
3581             2 => PadActionType::Strip,
3582             value => PadActionType::__Unknown(value),
3583         }
3584     }
3585 }
3586 
3587 #[cfg(any(feature = "v3_22", feature = "dox"))]
3588 impl StaticType for PadActionType {
static_type() -> Type3589     fn static_type() -> Type {
3590         unsafe { from_glib(gtk_sys::gtk_pad_action_type_get_type()) }
3591     }
3592 }
3593 
3594 #[cfg(any(feature = "v3_22", feature = "dox"))]
3595 impl<'a> FromValueOptional<'a> for PadActionType {
from_value_optional(value: &Value) -> Option<Self>3596     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3597         Some(FromValue::from_value(value))
3598     }
3599 }
3600 
3601 #[cfg(any(feature = "v3_22", feature = "dox"))]
3602 impl<'a> FromValue<'a> for PadActionType {
from_value(value: &Value) -> Self3603     unsafe fn from_value(value: &Value) -> Self {
3604         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3605     }
3606 }
3607 
3608 #[cfg(any(feature = "v3_22", feature = "dox"))]
3609 impl SetValue for PadActionType {
set_value(value: &mut Value, this: &Self)3610     unsafe fn set_value(value: &mut Value, this: &Self) {
3611         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3612     }
3613 }
3614 
3615 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3616 pub enum PageOrientation {
3617     Portrait,
3618     Landscape,
3619     ReversePortrait,
3620     ReverseLandscape,
3621     #[doc(hidden)]
3622     __Unknown(i32),
3623 }
3624 
3625 impl fmt::Display for PageOrientation {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result3626     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3627         write!(
3628             f,
3629             "PageOrientation::{}",
3630             match *self {
3631                 PageOrientation::Portrait => "Portrait",
3632                 PageOrientation::Landscape => "Landscape",
3633                 PageOrientation::ReversePortrait => "ReversePortrait",
3634                 PageOrientation::ReverseLandscape => "ReverseLandscape",
3635                 _ => "Unknown",
3636             }
3637         )
3638     }
3639 }
3640 
3641 #[doc(hidden)]
3642 impl ToGlib for PageOrientation {
3643     type GlibType = gtk_sys::GtkPageOrientation;
3644 
to_glib(&self) -> gtk_sys::GtkPageOrientation3645     fn to_glib(&self) -> gtk_sys::GtkPageOrientation {
3646         match *self {
3647             PageOrientation::Portrait => gtk_sys::GTK_PAGE_ORIENTATION_PORTRAIT,
3648             PageOrientation::Landscape => gtk_sys::GTK_PAGE_ORIENTATION_LANDSCAPE,
3649             PageOrientation::ReversePortrait => gtk_sys::GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT,
3650             PageOrientation::ReverseLandscape => gtk_sys::GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE,
3651             PageOrientation::__Unknown(value) => value,
3652         }
3653     }
3654 }
3655 
3656 #[doc(hidden)]
3657 impl FromGlib<gtk_sys::GtkPageOrientation> for PageOrientation {
from_glib(value: gtk_sys::GtkPageOrientation) -> Self3658     fn from_glib(value: gtk_sys::GtkPageOrientation) -> Self {
3659         skip_assert_initialized!();
3660         match value {
3661             0 => PageOrientation::Portrait,
3662             1 => PageOrientation::Landscape,
3663             2 => PageOrientation::ReversePortrait,
3664             3 => PageOrientation::ReverseLandscape,
3665             value => PageOrientation::__Unknown(value),
3666         }
3667     }
3668 }
3669 
3670 impl StaticType for PageOrientation {
static_type() -> Type3671     fn static_type() -> Type {
3672         unsafe { from_glib(gtk_sys::gtk_page_orientation_get_type()) }
3673     }
3674 }
3675 
3676 impl<'a> FromValueOptional<'a> for PageOrientation {
from_value_optional(value: &Value) -> Option<Self>3677     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3678         Some(FromValue::from_value(value))
3679     }
3680 }
3681 
3682 impl<'a> FromValue<'a> for PageOrientation {
from_value(value: &Value) -> Self3683     unsafe fn from_value(value: &Value) -> Self {
3684         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3685     }
3686 }
3687 
3688 impl SetValue for PageOrientation {
set_value(value: &mut Value, this: &Self)3689     unsafe fn set_value(value: &mut Value, this: &Self) {
3690         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3691     }
3692 }
3693 
3694 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3695 pub enum PageSet {
3696     All,
3697     Even,
3698     Odd,
3699     #[doc(hidden)]
3700     __Unknown(i32),
3701 }
3702 
3703 impl fmt::Display for PageSet {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result3704     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3705         write!(
3706             f,
3707             "PageSet::{}",
3708             match *self {
3709                 PageSet::All => "All",
3710                 PageSet::Even => "Even",
3711                 PageSet::Odd => "Odd",
3712                 _ => "Unknown",
3713             }
3714         )
3715     }
3716 }
3717 
3718 #[doc(hidden)]
3719 impl ToGlib for PageSet {
3720     type GlibType = gtk_sys::GtkPageSet;
3721 
to_glib(&self) -> gtk_sys::GtkPageSet3722     fn to_glib(&self) -> gtk_sys::GtkPageSet {
3723         match *self {
3724             PageSet::All => gtk_sys::GTK_PAGE_SET_ALL,
3725             PageSet::Even => gtk_sys::GTK_PAGE_SET_EVEN,
3726             PageSet::Odd => gtk_sys::GTK_PAGE_SET_ODD,
3727             PageSet::__Unknown(value) => value,
3728         }
3729     }
3730 }
3731 
3732 #[doc(hidden)]
3733 impl FromGlib<gtk_sys::GtkPageSet> for PageSet {
from_glib(value: gtk_sys::GtkPageSet) -> Self3734     fn from_glib(value: gtk_sys::GtkPageSet) -> Self {
3735         skip_assert_initialized!();
3736         match value {
3737             0 => PageSet::All,
3738             1 => PageSet::Even,
3739             2 => PageSet::Odd,
3740             value => PageSet::__Unknown(value),
3741         }
3742     }
3743 }
3744 
3745 impl StaticType for PageSet {
static_type() -> Type3746     fn static_type() -> Type {
3747         unsafe { from_glib(gtk_sys::gtk_page_set_get_type()) }
3748     }
3749 }
3750 
3751 impl<'a> FromValueOptional<'a> for PageSet {
from_value_optional(value: &Value) -> Option<Self>3752     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3753         Some(FromValue::from_value(value))
3754     }
3755 }
3756 
3757 impl<'a> FromValue<'a> for PageSet {
from_value(value: &Value) -> Self3758     unsafe fn from_value(value: &Value) -> Self {
3759         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3760     }
3761 }
3762 
3763 impl SetValue for PageSet {
set_value(value: &mut Value, this: &Self)3764     unsafe fn set_value(value: &mut Value, this: &Self) {
3765         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3766     }
3767 }
3768 
3769 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3770 pub enum PanDirection {
3771     Left,
3772     Right,
3773     Up,
3774     Down,
3775     #[doc(hidden)]
3776     __Unknown(i32),
3777 }
3778 
3779 impl fmt::Display for PanDirection {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result3780     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3781         write!(
3782             f,
3783             "PanDirection::{}",
3784             match *self {
3785                 PanDirection::Left => "Left",
3786                 PanDirection::Right => "Right",
3787                 PanDirection::Up => "Up",
3788                 PanDirection::Down => "Down",
3789                 _ => "Unknown",
3790             }
3791         )
3792     }
3793 }
3794 
3795 #[doc(hidden)]
3796 impl ToGlib for PanDirection {
3797     type GlibType = gtk_sys::GtkPanDirection;
3798 
to_glib(&self) -> gtk_sys::GtkPanDirection3799     fn to_glib(&self) -> gtk_sys::GtkPanDirection {
3800         match *self {
3801             PanDirection::Left => gtk_sys::GTK_PAN_DIRECTION_LEFT,
3802             PanDirection::Right => gtk_sys::GTK_PAN_DIRECTION_RIGHT,
3803             PanDirection::Up => gtk_sys::GTK_PAN_DIRECTION_UP,
3804             PanDirection::Down => gtk_sys::GTK_PAN_DIRECTION_DOWN,
3805             PanDirection::__Unknown(value) => value,
3806         }
3807     }
3808 }
3809 
3810 #[doc(hidden)]
3811 impl FromGlib<gtk_sys::GtkPanDirection> for PanDirection {
from_glib(value: gtk_sys::GtkPanDirection) -> Self3812     fn from_glib(value: gtk_sys::GtkPanDirection) -> Self {
3813         skip_assert_initialized!();
3814         match value {
3815             0 => PanDirection::Left,
3816             1 => PanDirection::Right,
3817             2 => PanDirection::Up,
3818             3 => PanDirection::Down,
3819             value => PanDirection::__Unknown(value),
3820         }
3821     }
3822 }
3823 
3824 impl StaticType for PanDirection {
static_type() -> Type3825     fn static_type() -> Type {
3826         unsafe { from_glib(gtk_sys::gtk_pan_direction_get_type()) }
3827     }
3828 }
3829 
3830 impl<'a> FromValueOptional<'a> for PanDirection {
from_value_optional(value: &Value) -> Option<Self>3831     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3832         Some(FromValue::from_value(value))
3833     }
3834 }
3835 
3836 impl<'a> FromValue<'a> for PanDirection {
from_value(value: &Value) -> Self3837     unsafe fn from_value(value: &Value) -> Self {
3838         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3839     }
3840 }
3841 
3842 impl SetValue for PanDirection {
set_value(value: &mut Value, this: &Self)3843     unsafe fn set_value(value: &mut Value, this: &Self) {
3844         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3845     }
3846 }
3847 
3848 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3849 pub enum PolicyType {
3850     Always,
3851     Automatic,
3852     Never,
3853     External,
3854     #[doc(hidden)]
3855     __Unknown(i32),
3856 }
3857 
3858 impl fmt::Display for PolicyType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result3859     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3860         write!(
3861             f,
3862             "PolicyType::{}",
3863             match *self {
3864                 PolicyType::Always => "Always",
3865                 PolicyType::Automatic => "Automatic",
3866                 PolicyType::Never => "Never",
3867                 PolicyType::External => "External",
3868                 _ => "Unknown",
3869             }
3870         )
3871     }
3872 }
3873 
3874 #[doc(hidden)]
3875 impl ToGlib for PolicyType {
3876     type GlibType = gtk_sys::GtkPolicyType;
3877 
to_glib(&self) -> gtk_sys::GtkPolicyType3878     fn to_glib(&self) -> gtk_sys::GtkPolicyType {
3879         match *self {
3880             PolicyType::Always => gtk_sys::GTK_POLICY_ALWAYS,
3881             PolicyType::Automatic => gtk_sys::GTK_POLICY_AUTOMATIC,
3882             PolicyType::Never => gtk_sys::GTK_POLICY_NEVER,
3883             PolicyType::External => gtk_sys::GTK_POLICY_EXTERNAL,
3884             PolicyType::__Unknown(value) => value,
3885         }
3886     }
3887 }
3888 
3889 #[doc(hidden)]
3890 impl FromGlib<gtk_sys::GtkPolicyType> for PolicyType {
from_glib(value: gtk_sys::GtkPolicyType) -> Self3891     fn from_glib(value: gtk_sys::GtkPolicyType) -> Self {
3892         skip_assert_initialized!();
3893         match value {
3894             0 => PolicyType::Always,
3895             1 => PolicyType::Automatic,
3896             2 => PolicyType::Never,
3897             3 => PolicyType::External,
3898             value => PolicyType::__Unknown(value),
3899         }
3900     }
3901 }
3902 
3903 impl StaticType for PolicyType {
static_type() -> Type3904     fn static_type() -> Type {
3905         unsafe { from_glib(gtk_sys::gtk_policy_type_get_type()) }
3906     }
3907 }
3908 
3909 impl<'a> FromValueOptional<'a> for PolicyType {
from_value_optional(value: &Value) -> Option<Self>3910     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3911         Some(FromValue::from_value(value))
3912     }
3913 }
3914 
3915 impl<'a> FromValue<'a> for PolicyType {
from_value(value: &Value) -> Self3916     unsafe fn from_value(value: &Value) -> Self {
3917         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3918     }
3919 }
3920 
3921 impl SetValue for PolicyType {
set_value(value: &mut Value, this: &Self)3922     unsafe fn set_value(value: &mut Value, this: &Self) {
3923         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
3924     }
3925 }
3926 
3927 #[cfg(any(feature = "v3_20", feature = "dox"))]
3928 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
3929 pub enum PopoverConstraint {
3930     None,
3931     Window,
3932     #[doc(hidden)]
3933     __Unknown(i32),
3934 }
3935 
3936 #[cfg(any(feature = "v3_20", feature = "dox"))]
3937 impl fmt::Display for PopoverConstraint {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result3938     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3939         write!(
3940             f,
3941             "PopoverConstraint::{}",
3942             match *self {
3943                 PopoverConstraint::None => "None",
3944                 PopoverConstraint::Window => "Window",
3945                 _ => "Unknown",
3946             }
3947         )
3948     }
3949 }
3950 
3951 #[cfg(any(feature = "v3_20", feature = "dox"))]
3952 #[doc(hidden)]
3953 impl ToGlib for PopoverConstraint {
3954     type GlibType = gtk_sys::GtkPopoverConstraint;
3955 
to_glib(&self) -> gtk_sys::GtkPopoverConstraint3956     fn to_glib(&self) -> gtk_sys::GtkPopoverConstraint {
3957         match *self {
3958             PopoverConstraint::None => gtk_sys::GTK_POPOVER_CONSTRAINT_NONE,
3959             PopoverConstraint::Window => gtk_sys::GTK_POPOVER_CONSTRAINT_WINDOW,
3960             PopoverConstraint::__Unknown(value) => value,
3961         }
3962     }
3963 }
3964 
3965 #[cfg(any(feature = "v3_20", feature = "dox"))]
3966 #[doc(hidden)]
3967 impl FromGlib<gtk_sys::GtkPopoverConstraint> for PopoverConstraint {
from_glib(value: gtk_sys::GtkPopoverConstraint) -> Self3968     fn from_glib(value: gtk_sys::GtkPopoverConstraint) -> Self {
3969         skip_assert_initialized!();
3970         match value {
3971             0 => PopoverConstraint::None,
3972             1 => PopoverConstraint::Window,
3973             value => PopoverConstraint::__Unknown(value),
3974         }
3975     }
3976 }
3977 
3978 #[cfg(any(feature = "v3_20", feature = "dox"))]
3979 impl StaticType for PopoverConstraint {
static_type() -> Type3980     fn static_type() -> Type {
3981         unsafe { from_glib(gtk_sys::gtk_popover_constraint_get_type()) }
3982     }
3983 }
3984 
3985 #[cfg(any(feature = "v3_20", feature = "dox"))]
3986 impl<'a> FromValueOptional<'a> for PopoverConstraint {
from_value_optional(value: &Value) -> Option<Self>3987     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
3988         Some(FromValue::from_value(value))
3989     }
3990 }
3991 
3992 #[cfg(any(feature = "v3_20", feature = "dox"))]
3993 impl<'a> FromValue<'a> for PopoverConstraint {
from_value(value: &Value) -> Self3994     unsafe fn from_value(value: &Value) -> Self {
3995         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
3996     }
3997 }
3998 
3999 #[cfg(any(feature = "v3_20", feature = "dox"))]
4000 impl SetValue for PopoverConstraint {
set_value(value: &mut Value, this: &Self)4001     unsafe fn set_value(value: &mut Value, this: &Self) {
4002         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
4003     }
4004 }
4005 
4006 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4007 pub enum PositionType {
4008     Left,
4009     Right,
4010     Top,
4011     Bottom,
4012     #[doc(hidden)]
4013     __Unknown(i32),
4014 }
4015 
4016 impl fmt::Display for PositionType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result4017     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4018         write!(
4019             f,
4020             "PositionType::{}",
4021             match *self {
4022                 PositionType::Left => "Left",
4023                 PositionType::Right => "Right",
4024                 PositionType::Top => "Top",
4025                 PositionType::Bottom => "Bottom",
4026                 _ => "Unknown",
4027             }
4028         )
4029     }
4030 }
4031 
4032 #[doc(hidden)]
4033 impl ToGlib for PositionType {
4034     type GlibType = gtk_sys::GtkPositionType;
4035 
to_glib(&self) -> gtk_sys::GtkPositionType4036     fn to_glib(&self) -> gtk_sys::GtkPositionType {
4037         match *self {
4038             PositionType::Left => gtk_sys::GTK_POS_LEFT,
4039             PositionType::Right => gtk_sys::GTK_POS_RIGHT,
4040             PositionType::Top => gtk_sys::GTK_POS_TOP,
4041             PositionType::Bottom => gtk_sys::GTK_POS_BOTTOM,
4042             PositionType::__Unknown(value) => value,
4043         }
4044     }
4045 }
4046 
4047 #[doc(hidden)]
4048 impl FromGlib<gtk_sys::GtkPositionType> for PositionType {
from_glib(value: gtk_sys::GtkPositionType) -> Self4049     fn from_glib(value: gtk_sys::GtkPositionType) -> Self {
4050         skip_assert_initialized!();
4051         match value {
4052             0 => PositionType::Left,
4053             1 => PositionType::Right,
4054             2 => PositionType::Top,
4055             3 => PositionType::Bottom,
4056             value => PositionType::__Unknown(value),
4057         }
4058     }
4059 }
4060 
4061 impl StaticType for PositionType {
static_type() -> Type4062     fn static_type() -> Type {
4063         unsafe { from_glib(gtk_sys::gtk_position_type_get_type()) }
4064     }
4065 }
4066 
4067 impl<'a> FromValueOptional<'a> for PositionType {
from_value_optional(value: &Value) -> Option<Self>4068     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
4069         Some(FromValue::from_value(value))
4070     }
4071 }
4072 
4073 impl<'a> FromValue<'a> for PositionType {
from_value(value: &Value) -> Self4074     unsafe fn from_value(value: &Value) -> Self {
4075         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
4076     }
4077 }
4078 
4079 impl SetValue for PositionType {
set_value(value: &mut Value, this: &Self)4080     unsafe fn set_value(value: &mut Value, this: &Self) {
4081         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
4082     }
4083 }
4084 
4085 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4086 pub enum PrintDuplex {
4087     Simplex,
4088     Horizontal,
4089     Vertical,
4090     #[doc(hidden)]
4091     __Unknown(i32),
4092 }
4093 
4094 impl fmt::Display for PrintDuplex {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result4095     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4096         write!(
4097             f,
4098             "PrintDuplex::{}",
4099             match *self {
4100                 PrintDuplex::Simplex => "Simplex",
4101                 PrintDuplex::Horizontal => "Horizontal",
4102                 PrintDuplex::Vertical => "Vertical",
4103                 _ => "Unknown",
4104             }
4105         )
4106     }
4107 }
4108 
4109 #[doc(hidden)]
4110 impl ToGlib for PrintDuplex {
4111     type GlibType = gtk_sys::GtkPrintDuplex;
4112 
to_glib(&self) -> gtk_sys::GtkPrintDuplex4113     fn to_glib(&self) -> gtk_sys::GtkPrintDuplex {
4114         match *self {
4115             PrintDuplex::Simplex => gtk_sys::GTK_PRINT_DUPLEX_SIMPLEX,
4116             PrintDuplex::Horizontal => gtk_sys::GTK_PRINT_DUPLEX_HORIZONTAL,
4117             PrintDuplex::Vertical => gtk_sys::GTK_PRINT_DUPLEX_VERTICAL,
4118             PrintDuplex::__Unknown(value) => value,
4119         }
4120     }
4121 }
4122 
4123 #[doc(hidden)]
4124 impl FromGlib<gtk_sys::GtkPrintDuplex> for PrintDuplex {
from_glib(value: gtk_sys::GtkPrintDuplex) -> Self4125     fn from_glib(value: gtk_sys::GtkPrintDuplex) -> Self {
4126         skip_assert_initialized!();
4127         match value {
4128             0 => PrintDuplex::Simplex,
4129             1 => PrintDuplex::Horizontal,
4130             2 => PrintDuplex::Vertical,
4131             value => PrintDuplex::__Unknown(value),
4132         }
4133     }
4134 }
4135 
4136 impl StaticType for PrintDuplex {
static_type() -> Type4137     fn static_type() -> Type {
4138         unsafe { from_glib(gtk_sys::gtk_print_duplex_get_type()) }
4139     }
4140 }
4141 
4142 impl<'a> FromValueOptional<'a> for PrintDuplex {
from_value_optional(value: &Value) -> Option<Self>4143     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
4144         Some(FromValue::from_value(value))
4145     }
4146 }
4147 
4148 impl<'a> FromValue<'a> for PrintDuplex {
from_value(value: &Value) -> Self4149     unsafe fn from_value(value: &Value) -> Self {
4150         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
4151     }
4152 }
4153 
4154 impl SetValue for PrintDuplex {
set_value(value: &mut Value, this: &Self)4155     unsafe fn set_value(value: &mut Value, this: &Self) {
4156         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
4157     }
4158 }
4159 
4160 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4161 pub enum PrintError {
4162     General,
4163     InternalError,
4164     Nomem,
4165     InvalidFile,
4166     #[doc(hidden)]
4167     __Unknown(i32),
4168 }
4169 
4170 impl fmt::Display for PrintError {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result4171     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4172         write!(
4173             f,
4174             "PrintError::{}",
4175             match *self {
4176                 PrintError::General => "General",
4177                 PrintError::InternalError => "InternalError",
4178                 PrintError::Nomem => "Nomem",
4179                 PrintError::InvalidFile => "InvalidFile",
4180                 _ => "Unknown",
4181             }
4182         )
4183     }
4184 }
4185 
4186 #[doc(hidden)]
4187 impl ToGlib for PrintError {
4188     type GlibType = gtk_sys::GtkPrintError;
4189 
to_glib(&self) -> gtk_sys::GtkPrintError4190     fn to_glib(&self) -> gtk_sys::GtkPrintError {
4191         match *self {
4192             PrintError::General => gtk_sys::GTK_PRINT_ERROR_GENERAL,
4193             PrintError::InternalError => gtk_sys::GTK_PRINT_ERROR_INTERNAL_ERROR,
4194             PrintError::Nomem => gtk_sys::GTK_PRINT_ERROR_NOMEM,
4195             PrintError::InvalidFile => gtk_sys::GTK_PRINT_ERROR_INVALID_FILE,
4196             PrintError::__Unknown(value) => value,
4197         }
4198     }
4199 }
4200 
4201 #[doc(hidden)]
4202 impl FromGlib<gtk_sys::GtkPrintError> for PrintError {
from_glib(value: gtk_sys::GtkPrintError) -> Self4203     fn from_glib(value: gtk_sys::GtkPrintError) -> Self {
4204         skip_assert_initialized!();
4205         match value {
4206             0 => PrintError::General,
4207             1 => PrintError::InternalError,
4208             2 => PrintError::Nomem,
4209             3 => PrintError::InvalidFile,
4210             value => PrintError::__Unknown(value),
4211         }
4212     }
4213 }
4214 
4215 impl ErrorDomain for PrintError {
domain() -> Quark4216     fn domain() -> Quark {
4217         skip_assert_initialized!();
4218         unsafe { from_glib(gtk_sys::gtk_print_error_quark()) }
4219     }
4220 
code(self) -> i324221     fn code(self) -> i32 {
4222         self.to_glib()
4223     }
4224 
from(code: i32) -> Option<Self>4225     fn from(code: i32) -> Option<Self> {
4226         skip_assert_initialized!();
4227         match code {
4228             0 => Some(PrintError::General),
4229             1 => Some(PrintError::InternalError),
4230             2 => Some(PrintError::Nomem),
4231             3 => Some(PrintError::InvalidFile),
4232             value => Some(PrintError::__Unknown(value)),
4233         }
4234     }
4235 }
4236 
4237 impl StaticType for PrintError {
static_type() -> Type4238     fn static_type() -> Type {
4239         unsafe { from_glib(gtk_sys::gtk_print_error_get_type()) }
4240     }
4241 }
4242 
4243 impl<'a> FromValueOptional<'a> for PrintError {
from_value_optional(value: &Value) -> Option<Self>4244     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
4245         Some(FromValue::from_value(value))
4246     }
4247 }
4248 
4249 impl<'a> FromValue<'a> for PrintError {
from_value(value: &Value) -> Self4250     unsafe fn from_value(value: &Value) -> Self {
4251         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
4252     }
4253 }
4254 
4255 impl SetValue for PrintError {
set_value(value: &mut Value, this: &Self)4256     unsafe fn set_value(value: &mut Value, this: &Self) {
4257         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
4258     }
4259 }
4260 
4261 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4262 pub enum PrintOperationAction {
4263     PrintDialog,
4264     Print,
4265     Preview,
4266     Export,
4267     #[doc(hidden)]
4268     __Unknown(i32),
4269 }
4270 
4271 impl fmt::Display for PrintOperationAction {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result4272     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4273         write!(
4274             f,
4275             "PrintOperationAction::{}",
4276             match *self {
4277                 PrintOperationAction::PrintDialog => "PrintDialog",
4278                 PrintOperationAction::Print => "Print",
4279                 PrintOperationAction::Preview => "Preview",
4280                 PrintOperationAction::Export => "Export",
4281                 _ => "Unknown",
4282             }
4283         )
4284     }
4285 }
4286 
4287 #[doc(hidden)]
4288 impl ToGlib for PrintOperationAction {
4289     type GlibType = gtk_sys::GtkPrintOperationAction;
4290 
to_glib(&self) -> gtk_sys::GtkPrintOperationAction4291     fn to_glib(&self) -> gtk_sys::GtkPrintOperationAction {
4292         match *self {
4293             PrintOperationAction::PrintDialog => gtk_sys::GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
4294             PrintOperationAction::Print => gtk_sys::GTK_PRINT_OPERATION_ACTION_PRINT,
4295             PrintOperationAction::Preview => gtk_sys::GTK_PRINT_OPERATION_ACTION_PREVIEW,
4296             PrintOperationAction::Export => gtk_sys::GTK_PRINT_OPERATION_ACTION_EXPORT,
4297             PrintOperationAction::__Unknown(value) => value,
4298         }
4299     }
4300 }
4301 
4302 #[doc(hidden)]
4303 impl FromGlib<gtk_sys::GtkPrintOperationAction> for PrintOperationAction {
from_glib(value: gtk_sys::GtkPrintOperationAction) -> Self4304     fn from_glib(value: gtk_sys::GtkPrintOperationAction) -> Self {
4305         skip_assert_initialized!();
4306         match value {
4307             0 => PrintOperationAction::PrintDialog,
4308             1 => PrintOperationAction::Print,
4309             2 => PrintOperationAction::Preview,
4310             3 => PrintOperationAction::Export,
4311             value => PrintOperationAction::__Unknown(value),
4312         }
4313     }
4314 }
4315 
4316 impl StaticType for PrintOperationAction {
static_type() -> Type4317     fn static_type() -> Type {
4318         unsafe { from_glib(gtk_sys::gtk_print_operation_action_get_type()) }
4319     }
4320 }
4321 
4322 impl<'a> FromValueOptional<'a> for PrintOperationAction {
from_value_optional(value: &Value) -> Option<Self>4323     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
4324         Some(FromValue::from_value(value))
4325     }
4326 }
4327 
4328 impl<'a> FromValue<'a> for PrintOperationAction {
from_value(value: &Value) -> Self4329     unsafe fn from_value(value: &Value) -> Self {
4330         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
4331     }
4332 }
4333 
4334 impl SetValue for PrintOperationAction {
set_value(value: &mut Value, this: &Self)4335     unsafe fn set_value(value: &mut Value, this: &Self) {
4336         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
4337     }
4338 }
4339 
4340 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4341 pub enum PrintOperationResult {
4342     Error,
4343     Apply,
4344     Cancel,
4345     InProgress,
4346     #[doc(hidden)]
4347     __Unknown(i32),
4348 }
4349 
4350 impl fmt::Display for PrintOperationResult {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result4351     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4352         write!(
4353             f,
4354             "PrintOperationResult::{}",
4355             match *self {
4356                 PrintOperationResult::Error => "Error",
4357                 PrintOperationResult::Apply => "Apply",
4358                 PrintOperationResult::Cancel => "Cancel",
4359                 PrintOperationResult::InProgress => "InProgress",
4360                 _ => "Unknown",
4361             }
4362         )
4363     }
4364 }
4365 
4366 #[doc(hidden)]
4367 impl ToGlib for PrintOperationResult {
4368     type GlibType = gtk_sys::GtkPrintOperationResult;
4369 
to_glib(&self) -> gtk_sys::GtkPrintOperationResult4370     fn to_glib(&self) -> gtk_sys::GtkPrintOperationResult {
4371         match *self {
4372             PrintOperationResult::Error => gtk_sys::GTK_PRINT_OPERATION_RESULT_ERROR,
4373             PrintOperationResult::Apply => gtk_sys::GTK_PRINT_OPERATION_RESULT_APPLY,
4374             PrintOperationResult::Cancel => gtk_sys::GTK_PRINT_OPERATION_RESULT_CANCEL,
4375             PrintOperationResult::InProgress => gtk_sys::GTK_PRINT_OPERATION_RESULT_IN_PROGRESS,
4376             PrintOperationResult::__Unknown(value) => value,
4377         }
4378     }
4379 }
4380 
4381 #[doc(hidden)]
4382 impl FromGlib<gtk_sys::GtkPrintOperationResult> for PrintOperationResult {
from_glib(value: gtk_sys::GtkPrintOperationResult) -> Self4383     fn from_glib(value: gtk_sys::GtkPrintOperationResult) -> Self {
4384         skip_assert_initialized!();
4385         match value {
4386             0 => PrintOperationResult::Error,
4387             1 => PrintOperationResult::Apply,
4388             2 => PrintOperationResult::Cancel,
4389             3 => PrintOperationResult::InProgress,
4390             value => PrintOperationResult::__Unknown(value),
4391         }
4392     }
4393 }
4394 
4395 impl StaticType for PrintOperationResult {
static_type() -> Type4396     fn static_type() -> Type {
4397         unsafe { from_glib(gtk_sys::gtk_print_operation_result_get_type()) }
4398     }
4399 }
4400 
4401 impl<'a> FromValueOptional<'a> for PrintOperationResult {
from_value_optional(value: &Value) -> Option<Self>4402     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
4403         Some(FromValue::from_value(value))
4404     }
4405 }
4406 
4407 impl<'a> FromValue<'a> for PrintOperationResult {
from_value(value: &Value) -> Self4408     unsafe fn from_value(value: &Value) -> Self {
4409         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
4410     }
4411 }
4412 
4413 impl SetValue for PrintOperationResult {
set_value(value: &mut Value, this: &Self)4414     unsafe fn set_value(value: &mut Value, this: &Self) {
4415         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
4416     }
4417 }
4418 
4419 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4420 pub enum PrintPages {
4421     All,
4422     Current,
4423     Ranges,
4424     Selection,
4425     #[doc(hidden)]
4426     __Unknown(i32),
4427 }
4428 
4429 impl fmt::Display for PrintPages {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result4430     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4431         write!(
4432             f,
4433             "PrintPages::{}",
4434             match *self {
4435                 PrintPages::All => "All",
4436                 PrintPages::Current => "Current",
4437                 PrintPages::Ranges => "Ranges",
4438                 PrintPages::Selection => "Selection",
4439                 _ => "Unknown",
4440             }
4441         )
4442     }
4443 }
4444 
4445 #[doc(hidden)]
4446 impl ToGlib for PrintPages {
4447     type GlibType = gtk_sys::GtkPrintPages;
4448 
to_glib(&self) -> gtk_sys::GtkPrintPages4449     fn to_glib(&self) -> gtk_sys::GtkPrintPages {
4450         match *self {
4451             PrintPages::All => gtk_sys::GTK_PRINT_PAGES_ALL,
4452             PrintPages::Current => gtk_sys::GTK_PRINT_PAGES_CURRENT,
4453             PrintPages::Ranges => gtk_sys::GTK_PRINT_PAGES_RANGES,
4454             PrintPages::Selection => gtk_sys::GTK_PRINT_PAGES_SELECTION,
4455             PrintPages::__Unknown(value) => value,
4456         }
4457     }
4458 }
4459 
4460 #[doc(hidden)]
4461 impl FromGlib<gtk_sys::GtkPrintPages> for PrintPages {
from_glib(value: gtk_sys::GtkPrintPages) -> Self4462     fn from_glib(value: gtk_sys::GtkPrintPages) -> Self {
4463         skip_assert_initialized!();
4464         match value {
4465             0 => PrintPages::All,
4466             1 => PrintPages::Current,
4467             2 => PrintPages::Ranges,
4468             3 => PrintPages::Selection,
4469             value => PrintPages::__Unknown(value),
4470         }
4471     }
4472 }
4473 
4474 impl StaticType for PrintPages {
static_type() -> Type4475     fn static_type() -> Type {
4476         unsafe { from_glib(gtk_sys::gtk_print_pages_get_type()) }
4477     }
4478 }
4479 
4480 impl<'a> FromValueOptional<'a> for PrintPages {
from_value_optional(value: &Value) -> Option<Self>4481     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
4482         Some(FromValue::from_value(value))
4483     }
4484 }
4485 
4486 impl<'a> FromValue<'a> for PrintPages {
from_value(value: &Value) -> Self4487     unsafe fn from_value(value: &Value) -> Self {
4488         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
4489     }
4490 }
4491 
4492 impl SetValue for PrintPages {
set_value(value: &mut Value, this: &Self)4493     unsafe fn set_value(value: &mut Value, this: &Self) {
4494         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
4495     }
4496 }
4497 
4498 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4499 pub enum PrintQuality {
4500     Low,
4501     Normal,
4502     High,
4503     Draft,
4504     #[doc(hidden)]
4505     __Unknown(i32),
4506 }
4507 
4508 impl fmt::Display for PrintQuality {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result4509     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4510         write!(
4511             f,
4512             "PrintQuality::{}",
4513             match *self {
4514                 PrintQuality::Low => "Low",
4515                 PrintQuality::Normal => "Normal",
4516                 PrintQuality::High => "High",
4517                 PrintQuality::Draft => "Draft",
4518                 _ => "Unknown",
4519             }
4520         )
4521     }
4522 }
4523 
4524 #[doc(hidden)]
4525 impl ToGlib for PrintQuality {
4526     type GlibType = gtk_sys::GtkPrintQuality;
4527 
to_glib(&self) -> gtk_sys::GtkPrintQuality4528     fn to_glib(&self) -> gtk_sys::GtkPrintQuality {
4529         match *self {
4530             PrintQuality::Low => gtk_sys::GTK_PRINT_QUALITY_LOW,
4531             PrintQuality::Normal => gtk_sys::GTK_PRINT_QUALITY_NORMAL,
4532             PrintQuality::High => gtk_sys::GTK_PRINT_QUALITY_HIGH,
4533             PrintQuality::Draft => gtk_sys::GTK_PRINT_QUALITY_DRAFT,
4534             PrintQuality::__Unknown(value) => value,
4535         }
4536     }
4537 }
4538 
4539 #[doc(hidden)]
4540 impl FromGlib<gtk_sys::GtkPrintQuality> for PrintQuality {
from_glib(value: gtk_sys::GtkPrintQuality) -> Self4541     fn from_glib(value: gtk_sys::GtkPrintQuality) -> Self {
4542         skip_assert_initialized!();
4543         match value {
4544             0 => PrintQuality::Low,
4545             1 => PrintQuality::Normal,
4546             2 => PrintQuality::High,
4547             3 => PrintQuality::Draft,
4548             value => PrintQuality::__Unknown(value),
4549         }
4550     }
4551 }
4552 
4553 impl StaticType for PrintQuality {
static_type() -> Type4554     fn static_type() -> Type {
4555         unsafe { from_glib(gtk_sys::gtk_print_quality_get_type()) }
4556     }
4557 }
4558 
4559 impl<'a> FromValueOptional<'a> for PrintQuality {
from_value_optional(value: &Value) -> Option<Self>4560     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
4561         Some(FromValue::from_value(value))
4562     }
4563 }
4564 
4565 impl<'a> FromValue<'a> for PrintQuality {
from_value(value: &Value) -> Self4566     unsafe fn from_value(value: &Value) -> Self {
4567         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
4568     }
4569 }
4570 
4571 impl SetValue for PrintQuality {
set_value(value: &mut Value, this: &Self)4572     unsafe fn set_value(value: &mut Value, this: &Self) {
4573         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
4574     }
4575 }
4576 
4577 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4578 pub enum PrintStatus {
4579     Initial,
4580     Preparing,
4581     GeneratingData,
4582     SendingData,
4583     Pending,
4584     PendingIssue,
4585     Printing,
4586     Finished,
4587     FinishedAborted,
4588     #[doc(hidden)]
4589     __Unknown(i32),
4590 }
4591 
4592 impl fmt::Display for PrintStatus {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result4593     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4594         write!(
4595             f,
4596             "PrintStatus::{}",
4597             match *self {
4598                 PrintStatus::Initial => "Initial",
4599                 PrintStatus::Preparing => "Preparing",
4600                 PrintStatus::GeneratingData => "GeneratingData",
4601                 PrintStatus::SendingData => "SendingData",
4602                 PrintStatus::Pending => "Pending",
4603                 PrintStatus::PendingIssue => "PendingIssue",
4604                 PrintStatus::Printing => "Printing",
4605                 PrintStatus::Finished => "Finished",
4606                 PrintStatus::FinishedAborted => "FinishedAborted",
4607                 _ => "Unknown",
4608             }
4609         )
4610     }
4611 }
4612 
4613 #[doc(hidden)]
4614 impl ToGlib for PrintStatus {
4615     type GlibType = gtk_sys::GtkPrintStatus;
4616 
to_glib(&self) -> gtk_sys::GtkPrintStatus4617     fn to_glib(&self) -> gtk_sys::GtkPrintStatus {
4618         match *self {
4619             PrintStatus::Initial => gtk_sys::GTK_PRINT_STATUS_INITIAL,
4620             PrintStatus::Preparing => gtk_sys::GTK_PRINT_STATUS_PREPARING,
4621             PrintStatus::GeneratingData => gtk_sys::GTK_PRINT_STATUS_GENERATING_DATA,
4622             PrintStatus::SendingData => gtk_sys::GTK_PRINT_STATUS_SENDING_DATA,
4623             PrintStatus::Pending => gtk_sys::GTK_PRINT_STATUS_PENDING,
4624             PrintStatus::PendingIssue => gtk_sys::GTK_PRINT_STATUS_PENDING_ISSUE,
4625             PrintStatus::Printing => gtk_sys::GTK_PRINT_STATUS_PRINTING,
4626             PrintStatus::Finished => gtk_sys::GTK_PRINT_STATUS_FINISHED,
4627             PrintStatus::FinishedAborted => gtk_sys::GTK_PRINT_STATUS_FINISHED_ABORTED,
4628             PrintStatus::__Unknown(value) => value,
4629         }
4630     }
4631 }
4632 
4633 #[doc(hidden)]
4634 impl FromGlib<gtk_sys::GtkPrintStatus> for PrintStatus {
from_glib(value: gtk_sys::GtkPrintStatus) -> Self4635     fn from_glib(value: gtk_sys::GtkPrintStatus) -> Self {
4636         skip_assert_initialized!();
4637         match value {
4638             0 => PrintStatus::Initial,
4639             1 => PrintStatus::Preparing,
4640             2 => PrintStatus::GeneratingData,
4641             3 => PrintStatus::SendingData,
4642             4 => PrintStatus::Pending,
4643             5 => PrintStatus::PendingIssue,
4644             6 => PrintStatus::Printing,
4645             7 => PrintStatus::Finished,
4646             8 => PrintStatus::FinishedAborted,
4647             value => PrintStatus::__Unknown(value),
4648         }
4649     }
4650 }
4651 
4652 impl StaticType for PrintStatus {
static_type() -> Type4653     fn static_type() -> Type {
4654         unsafe { from_glib(gtk_sys::gtk_print_status_get_type()) }
4655     }
4656 }
4657 
4658 impl<'a> FromValueOptional<'a> for PrintStatus {
from_value_optional(value: &Value) -> Option<Self>4659     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
4660         Some(FromValue::from_value(value))
4661     }
4662 }
4663 
4664 impl<'a> FromValue<'a> for PrintStatus {
from_value(value: &Value) -> Self4665     unsafe fn from_value(value: &Value) -> Self {
4666         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
4667     }
4668 }
4669 
4670 impl SetValue for PrintStatus {
set_value(value: &mut Value, this: &Self)4671     unsafe fn set_value(value: &mut Value, this: &Self) {
4672         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
4673     }
4674 }
4675 
4676 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4677 pub enum PropagationPhase {
4678     None,
4679     Capture,
4680     Bubble,
4681     Target,
4682     #[doc(hidden)]
4683     __Unknown(i32),
4684 }
4685 
4686 impl fmt::Display for PropagationPhase {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result4687     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4688         write!(
4689             f,
4690             "PropagationPhase::{}",
4691             match *self {
4692                 PropagationPhase::None => "None",
4693                 PropagationPhase::Capture => "Capture",
4694                 PropagationPhase::Bubble => "Bubble",
4695                 PropagationPhase::Target => "Target",
4696                 _ => "Unknown",
4697             }
4698         )
4699     }
4700 }
4701 
4702 #[doc(hidden)]
4703 impl ToGlib for PropagationPhase {
4704     type GlibType = gtk_sys::GtkPropagationPhase;
4705 
to_glib(&self) -> gtk_sys::GtkPropagationPhase4706     fn to_glib(&self) -> gtk_sys::GtkPropagationPhase {
4707         match *self {
4708             PropagationPhase::None => gtk_sys::GTK_PHASE_NONE,
4709             PropagationPhase::Capture => gtk_sys::GTK_PHASE_CAPTURE,
4710             PropagationPhase::Bubble => gtk_sys::GTK_PHASE_BUBBLE,
4711             PropagationPhase::Target => gtk_sys::GTK_PHASE_TARGET,
4712             PropagationPhase::__Unknown(value) => value,
4713         }
4714     }
4715 }
4716 
4717 #[doc(hidden)]
4718 impl FromGlib<gtk_sys::GtkPropagationPhase> for PropagationPhase {
from_glib(value: gtk_sys::GtkPropagationPhase) -> Self4719     fn from_glib(value: gtk_sys::GtkPropagationPhase) -> Self {
4720         skip_assert_initialized!();
4721         match value {
4722             0 => PropagationPhase::None,
4723             1 => PropagationPhase::Capture,
4724             2 => PropagationPhase::Bubble,
4725             3 => PropagationPhase::Target,
4726             value => PropagationPhase::__Unknown(value),
4727         }
4728     }
4729 }
4730 
4731 impl StaticType for PropagationPhase {
static_type() -> Type4732     fn static_type() -> Type {
4733         unsafe { from_glib(gtk_sys::gtk_propagation_phase_get_type()) }
4734     }
4735 }
4736 
4737 impl<'a> FromValueOptional<'a> for PropagationPhase {
from_value_optional(value: &Value) -> Option<Self>4738     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
4739         Some(FromValue::from_value(value))
4740     }
4741 }
4742 
4743 impl<'a> FromValue<'a> for PropagationPhase {
from_value(value: &Value) -> Self4744     unsafe fn from_value(value: &Value) -> Self {
4745         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
4746     }
4747 }
4748 
4749 impl SetValue for PropagationPhase {
set_value(value: &mut Value, this: &Self)4750     unsafe fn set_value(value: &mut Value, this: &Self) {
4751         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
4752     }
4753 }
4754 
4755 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4756 pub enum RecentChooserError {
4757     NotFound,
4758     InvalidUri,
4759     #[doc(hidden)]
4760     __Unknown(i32),
4761 }
4762 
4763 impl fmt::Display for RecentChooserError {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result4764     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4765         write!(
4766             f,
4767             "RecentChooserError::{}",
4768             match *self {
4769                 RecentChooserError::NotFound => "NotFound",
4770                 RecentChooserError::InvalidUri => "InvalidUri",
4771                 _ => "Unknown",
4772             }
4773         )
4774     }
4775 }
4776 
4777 #[doc(hidden)]
4778 impl ToGlib for RecentChooserError {
4779     type GlibType = gtk_sys::GtkRecentChooserError;
4780 
to_glib(&self) -> gtk_sys::GtkRecentChooserError4781     fn to_glib(&self) -> gtk_sys::GtkRecentChooserError {
4782         match *self {
4783             RecentChooserError::NotFound => gtk_sys::GTK_RECENT_CHOOSER_ERROR_NOT_FOUND,
4784             RecentChooserError::InvalidUri => gtk_sys::GTK_RECENT_CHOOSER_ERROR_INVALID_URI,
4785             RecentChooserError::__Unknown(value) => value,
4786         }
4787     }
4788 }
4789 
4790 #[doc(hidden)]
4791 impl FromGlib<gtk_sys::GtkRecentChooserError> for RecentChooserError {
from_glib(value: gtk_sys::GtkRecentChooserError) -> Self4792     fn from_glib(value: gtk_sys::GtkRecentChooserError) -> Self {
4793         skip_assert_initialized!();
4794         match value {
4795             0 => RecentChooserError::NotFound,
4796             1 => RecentChooserError::InvalidUri,
4797             value => RecentChooserError::__Unknown(value),
4798         }
4799     }
4800 }
4801 
4802 impl ErrorDomain for RecentChooserError {
domain() -> Quark4803     fn domain() -> Quark {
4804         skip_assert_initialized!();
4805         unsafe { from_glib(gtk_sys::gtk_recent_chooser_error_quark()) }
4806     }
4807 
code(self) -> i324808     fn code(self) -> i32 {
4809         self.to_glib()
4810     }
4811 
from(code: i32) -> Option<Self>4812     fn from(code: i32) -> Option<Self> {
4813         skip_assert_initialized!();
4814         match code {
4815             0 => Some(RecentChooserError::NotFound),
4816             1 => Some(RecentChooserError::InvalidUri),
4817             value => Some(RecentChooserError::__Unknown(value)),
4818         }
4819     }
4820 }
4821 
4822 impl StaticType for RecentChooserError {
static_type() -> Type4823     fn static_type() -> Type {
4824         unsafe { from_glib(gtk_sys::gtk_recent_chooser_error_get_type()) }
4825     }
4826 }
4827 
4828 impl<'a> FromValueOptional<'a> for RecentChooserError {
from_value_optional(value: &Value) -> Option<Self>4829     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
4830         Some(FromValue::from_value(value))
4831     }
4832 }
4833 
4834 impl<'a> FromValue<'a> for RecentChooserError {
from_value(value: &Value) -> Self4835     unsafe fn from_value(value: &Value) -> Self {
4836         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
4837     }
4838 }
4839 
4840 impl SetValue for RecentChooserError {
set_value(value: &mut Value, this: &Self)4841     unsafe fn set_value(value: &mut Value, this: &Self) {
4842         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
4843     }
4844 }
4845 
4846 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4847 pub enum RecentManagerError {
4848     NotFound,
4849     InvalidUri,
4850     InvalidEncoding,
4851     NotRegistered,
4852     Read,
4853     Write,
4854     Unknown,
4855     #[doc(hidden)]
4856     __Unknown(i32),
4857 }
4858 
4859 impl fmt::Display for RecentManagerError {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result4860     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4861         write!(
4862             f,
4863             "RecentManagerError::{}",
4864             match *self {
4865                 RecentManagerError::NotFound => "NotFound",
4866                 RecentManagerError::InvalidUri => "InvalidUri",
4867                 RecentManagerError::InvalidEncoding => "InvalidEncoding",
4868                 RecentManagerError::NotRegistered => "NotRegistered",
4869                 RecentManagerError::Read => "Read",
4870                 RecentManagerError::Write => "Write",
4871                 RecentManagerError::Unknown => "Unknown",
4872                 _ => "Unknown",
4873             }
4874         )
4875     }
4876 }
4877 
4878 #[doc(hidden)]
4879 impl ToGlib for RecentManagerError {
4880     type GlibType = gtk_sys::GtkRecentManagerError;
4881 
to_glib(&self) -> gtk_sys::GtkRecentManagerError4882     fn to_glib(&self) -> gtk_sys::GtkRecentManagerError {
4883         match *self {
4884             RecentManagerError::NotFound => gtk_sys::GTK_RECENT_MANAGER_ERROR_NOT_FOUND,
4885             RecentManagerError::InvalidUri => gtk_sys::GTK_RECENT_MANAGER_ERROR_INVALID_URI,
4886             RecentManagerError::InvalidEncoding => {
4887                 gtk_sys::GTK_RECENT_MANAGER_ERROR_INVALID_ENCODING
4888             }
4889             RecentManagerError::NotRegistered => gtk_sys::GTK_RECENT_MANAGER_ERROR_NOT_REGISTERED,
4890             RecentManagerError::Read => gtk_sys::GTK_RECENT_MANAGER_ERROR_READ,
4891             RecentManagerError::Write => gtk_sys::GTK_RECENT_MANAGER_ERROR_WRITE,
4892             RecentManagerError::Unknown => gtk_sys::GTK_RECENT_MANAGER_ERROR_UNKNOWN,
4893             RecentManagerError::__Unknown(value) => value,
4894         }
4895     }
4896 }
4897 
4898 #[doc(hidden)]
4899 impl FromGlib<gtk_sys::GtkRecentManagerError> for RecentManagerError {
from_glib(value: gtk_sys::GtkRecentManagerError) -> Self4900     fn from_glib(value: gtk_sys::GtkRecentManagerError) -> Self {
4901         skip_assert_initialized!();
4902         match value {
4903             0 => RecentManagerError::NotFound,
4904             1 => RecentManagerError::InvalidUri,
4905             2 => RecentManagerError::InvalidEncoding,
4906             3 => RecentManagerError::NotRegistered,
4907             4 => RecentManagerError::Read,
4908             5 => RecentManagerError::Write,
4909             6 => RecentManagerError::Unknown,
4910             value => RecentManagerError::__Unknown(value),
4911         }
4912     }
4913 }
4914 
4915 impl ErrorDomain for RecentManagerError {
domain() -> Quark4916     fn domain() -> Quark {
4917         skip_assert_initialized!();
4918         unsafe { from_glib(gtk_sys::gtk_recent_manager_error_quark()) }
4919     }
4920 
code(self) -> i324921     fn code(self) -> i32 {
4922         self.to_glib()
4923     }
4924 
from(code: i32) -> Option<Self>4925     fn from(code: i32) -> Option<Self> {
4926         skip_assert_initialized!();
4927         match code {
4928             0 => Some(RecentManagerError::NotFound),
4929             1 => Some(RecentManagerError::InvalidUri),
4930             2 => Some(RecentManagerError::InvalidEncoding),
4931             3 => Some(RecentManagerError::NotRegistered),
4932             4 => Some(RecentManagerError::Read),
4933             5 => Some(RecentManagerError::Write),
4934             6 => Some(RecentManagerError::Unknown),
4935             value => Some(RecentManagerError::__Unknown(value)),
4936         }
4937     }
4938 }
4939 
4940 impl StaticType for RecentManagerError {
static_type() -> Type4941     fn static_type() -> Type {
4942         unsafe { from_glib(gtk_sys::gtk_recent_manager_error_get_type()) }
4943     }
4944 }
4945 
4946 impl<'a> FromValueOptional<'a> for RecentManagerError {
from_value_optional(value: &Value) -> Option<Self>4947     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
4948         Some(FromValue::from_value(value))
4949     }
4950 }
4951 
4952 impl<'a> FromValue<'a> for RecentManagerError {
from_value(value: &Value) -> Self4953     unsafe fn from_value(value: &Value) -> Self {
4954         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
4955     }
4956 }
4957 
4958 impl SetValue for RecentManagerError {
set_value(value: &mut Value, this: &Self)4959     unsafe fn set_value(value: &mut Value, this: &Self) {
4960         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
4961     }
4962 }
4963 
4964 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
4965 pub enum RecentSortType {
4966     None,
4967     Mru,
4968     Lru,
4969     Custom,
4970     #[doc(hidden)]
4971     __Unknown(i32),
4972 }
4973 
4974 impl fmt::Display for RecentSortType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result4975     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
4976         write!(
4977             f,
4978             "RecentSortType::{}",
4979             match *self {
4980                 RecentSortType::None => "None",
4981                 RecentSortType::Mru => "Mru",
4982                 RecentSortType::Lru => "Lru",
4983                 RecentSortType::Custom => "Custom",
4984                 _ => "Unknown",
4985             }
4986         )
4987     }
4988 }
4989 
4990 #[doc(hidden)]
4991 impl ToGlib for RecentSortType {
4992     type GlibType = gtk_sys::GtkRecentSortType;
4993 
to_glib(&self) -> gtk_sys::GtkRecentSortType4994     fn to_glib(&self) -> gtk_sys::GtkRecentSortType {
4995         match *self {
4996             RecentSortType::None => gtk_sys::GTK_RECENT_SORT_NONE,
4997             RecentSortType::Mru => gtk_sys::GTK_RECENT_SORT_MRU,
4998             RecentSortType::Lru => gtk_sys::GTK_RECENT_SORT_LRU,
4999             RecentSortType::Custom => gtk_sys::GTK_RECENT_SORT_CUSTOM,
5000             RecentSortType::__Unknown(value) => value,
5001         }
5002     }
5003 }
5004 
5005 #[doc(hidden)]
5006 impl FromGlib<gtk_sys::GtkRecentSortType> for RecentSortType {
from_glib(value: gtk_sys::GtkRecentSortType) -> Self5007     fn from_glib(value: gtk_sys::GtkRecentSortType) -> Self {
5008         skip_assert_initialized!();
5009         match value {
5010             0 => RecentSortType::None,
5011             1 => RecentSortType::Mru,
5012             2 => RecentSortType::Lru,
5013             3 => RecentSortType::Custom,
5014             value => RecentSortType::__Unknown(value),
5015         }
5016     }
5017 }
5018 
5019 impl StaticType for RecentSortType {
static_type() -> Type5020     fn static_type() -> Type {
5021         unsafe { from_glib(gtk_sys::gtk_recent_sort_type_get_type()) }
5022     }
5023 }
5024 
5025 impl<'a> FromValueOptional<'a> for RecentSortType {
from_value_optional(value: &Value) -> Option<Self>5026     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
5027         Some(FromValue::from_value(value))
5028     }
5029 }
5030 
5031 impl<'a> FromValue<'a> for RecentSortType {
from_value(value: &Value) -> Self5032     unsafe fn from_value(value: &Value) -> Self {
5033         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
5034     }
5035 }
5036 
5037 impl SetValue for RecentSortType {
set_value(value: &mut Value, this: &Self)5038     unsafe fn set_value(value: &mut Value, this: &Self) {
5039         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
5040     }
5041 }
5042 
5043 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5044 pub enum ReliefStyle {
5045     Normal,
5046     Half,
5047     None,
5048     #[doc(hidden)]
5049     __Unknown(i32),
5050 }
5051 
5052 impl fmt::Display for ReliefStyle {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result5053     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5054         write!(
5055             f,
5056             "ReliefStyle::{}",
5057             match *self {
5058                 ReliefStyle::Normal => "Normal",
5059                 ReliefStyle::Half => "Half",
5060                 ReliefStyle::None => "None",
5061                 _ => "Unknown",
5062             }
5063         )
5064     }
5065 }
5066 
5067 #[doc(hidden)]
5068 impl ToGlib for ReliefStyle {
5069     type GlibType = gtk_sys::GtkReliefStyle;
5070 
to_glib(&self) -> gtk_sys::GtkReliefStyle5071     fn to_glib(&self) -> gtk_sys::GtkReliefStyle {
5072         match *self {
5073             ReliefStyle::Normal => gtk_sys::GTK_RELIEF_NORMAL,
5074             ReliefStyle::Half => gtk_sys::GTK_RELIEF_HALF,
5075             ReliefStyle::None => gtk_sys::GTK_RELIEF_NONE,
5076             ReliefStyle::__Unknown(value) => value,
5077         }
5078     }
5079 }
5080 
5081 #[doc(hidden)]
5082 impl FromGlib<gtk_sys::GtkReliefStyle> for ReliefStyle {
from_glib(value: gtk_sys::GtkReliefStyle) -> Self5083     fn from_glib(value: gtk_sys::GtkReliefStyle) -> Self {
5084         skip_assert_initialized!();
5085         match value {
5086             0 => ReliefStyle::Normal,
5087             1 => ReliefStyle::Half,
5088             2 => ReliefStyle::None,
5089             value => ReliefStyle::__Unknown(value),
5090         }
5091     }
5092 }
5093 
5094 impl StaticType for ReliefStyle {
static_type() -> Type5095     fn static_type() -> Type {
5096         unsafe { from_glib(gtk_sys::gtk_relief_style_get_type()) }
5097     }
5098 }
5099 
5100 impl<'a> FromValueOptional<'a> for ReliefStyle {
from_value_optional(value: &Value) -> Option<Self>5101     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
5102         Some(FromValue::from_value(value))
5103     }
5104 }
5105 
5106 impl<'a> FromValue<'a> for ReliefStyle {
from_value(value: &Value) -> Self5107     unsafe fn from_value(value: &Value) -> Self {
5108         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
5109     }
5110 }
5111 
5112 impl SetValue for ReliefStyle {
set_value(value: &mut Value, this: &Self)5113     unsafe fn set_value(value: &mut Value, this: &Self) {
5114         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
5115     }
5116 }
5117 
5118 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5119 pub enum ResizeMode {
5120     Parent,
5121     Queue,
5122     Immediate,
5123     #[doc(hidden)]
5124     __Unknown(i32),
5125 }
5126 
5127 impl fmt::Display for ResizeMode {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result5128     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5129         write!(
5130             f,
5131             "ResizeMode::{}",
5132             match *self {
5133                 ResizeMode::Parent => "Parent",
5134                 ResizeMode::Queue => "Queue",
5135                 ResizeMode::Immediate => "Immediate",
5136                 _ => "Unknown",
5137             }
5138         )
5139     }
5140 }
5141 
5142 #[doc(hidden)]
5143 impl ToGlib for ResizeMode {
5144     type GlibType = gtk_sys::GtkResizeMode;
5145 
to_glib(&self) -> gtk_sys::GtkResizeMode5146     fn to_glib(&self) -> gtk_sys::GtkResizeMode {
5147         match *self {
5148             ResizeMode::Parent => gtk_sys::GTK_RESIZE_PARENT,
5149             ResizeMode::Queue => gtk_sys::GTK_RESIZE_QUEUE,
5150             ResizeMode::Immediate => gtk_sys::GTK_RESIZE_IMMEDIATE,
5151             ResizeMode::__Unknown(value) => value,
5152         }
5153     }
5154 }
5155 
5156 #[doc(hidden)]
5157 impl FromGlib<gtk_sys::GtkResizeMode> for ResizeMode {
from_glib(value: gtk_sys::GtkResizeMode) -> Self5158     fn from_glib(value: gtk_sys::GtkResizeMode) -> Self {
5159         skip_assert_initialized!();
5160         match value {
5161             0 => ResizeMode::Parent,
5162             1 => ResizeMode::Queue,
5163             2 => ResizeMode::Immediate,
5164             value => ResizeMode::__Unknown(value),
5165         }
5166     }
5167 }
5168 
5169 impl StaticType for ResizeMode {
static_type() -> Type5170     fn static_type() -> Type {
5171         unsafe { from_glib(gtk_sys::gtk_resize_mode_get_type()) }
5172     }
5173 }
5174 
5175 impl<'a> FromValueOptional<'a> for ResizeMode {
from_value_optional(value: &Value) -> Option<Self>5176     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
5177         Some(FromValue::from_value(value))
5178     }
5179 }
5180 
5181 impl<'a> FromValue<'a> for ResizeMode {
from_value(value: &Value) -> Self5182     unsafe fn from_value(value: &Value) -> Self {
5183         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
5184     }
5185 }
5186 
5187 impl SetValue for ResizeMode {
set_value(value: &mut Value, this: &Self)5188     unsafe fn set_value(value: &mut Value, this: &Self) {
5189         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
5190     }
5191 }
5192 
5193 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5194 pub enum RevealerTransitionType {
5195     None,
5196     Crossfade,
5197     SlideRight,
5198     SlideLeft,
5199     SlideUp,
5200     SlideDown,
5201     #[doc(hidden)]
5202     __Unknown(i32),
5203 }
5204 
5205 impl fmt::Display for RevealerTransitionType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result5206     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5207         write!(
5208             f,
5209             "RevealerTransitionType::{}",
5210             match *self {
5211                 RevealerTransitionType::None => "None",
5212                 RevealerTransitionType::Crossfade => "Crossfade",
5213                 RevealerTransitionType::SlideRight => "SlideRight",
5214                 RevealerTransitionType::SlideLeft => "SlideLeft",
5215                 RevealerTransitionType::SlideUp => "SlideUp",
5216                 RevealerTransitionType::SlideDown => "SlideDown",
5217                 _ => "Unknown",
5218             }
5219         )
5220     }
5221 }
5222 
5223 #[doc(hidden)]
5224 impl ToGlib for RevealerTransitionType {
5225     type GlibType = gtk_sys::GtkRevealerTransitionType;
5226 
to_glib(&self) -> gtk_sys::GtkRevealerTransitionType5227     fn to_glib(&self) -> gtk_sys::GtkRevealerTransitionType {
5228         match *self {
5229             RevealerTransitionType::None => gtk_sys::GTK_REVEALER_TRANSITION_TYPE_NONE,
5230             RevealerTransitionType::Crossfade => gtk_sys::GTK_REVEALER_TRANSITION_TYPE_CROSSFADE,
5231             RevealerTransitionType::SlideRight => gtk_sys::GTK_REVEALER_TRANSITION_TYPE_SLIDE_RIGHT,
5232             RevealerTransitionType::SlideLeft => gtk_sys::GTK_REVEALER_TRANSITION_TYPE_SLIDE_LEFT,
5233             RevealerTransitionType::SlideUp => gtk_sys::GTK_REVEALER_TRANSITION_TYPE_SLIDE_UP,
5234             RevealerTransitionType::SlideDown => gtk_sys::GTK_REVEALER_TRANSITION_TYPE_SLIDE_DOWN,
5235             RevealerTransitionType::__Unknown(value) => value,
5236         }
5237     }
5238 }
5239 
5240 #[doc(hidden)]
5241 impl FromGlib<gtk_sys::GtkRevealerTransitionType> for RevealerTransitionType {
from_glib(value: gtk_sys::GtkRevealerTransitionType) -> Self5242     fn from_glib(value: gtk_sys::GtkRevealerTransitionType) -> Self {
5243         skip_assert_initialized!();
5244         match value {
5245             0 => RevealerTransitionType::None,
5246             1 => RevealerTransitionType::Crossfade,
5247             2 => RevealerTransitionType::SlideRight,
5248             3 => RevealerTransitionType::SlideLeft,
5249             4 => RevealerTransitionType::SlideUp,
5250             5 => RevealerTransitionType::SlideDown,
5251             value => RevealerTransitionType::__Unknown(value),
5252         }
5253     }
5254 }
5255 
5256 impl StaticType for RevealerTransitionType {
static_type() -> Type5257     fn static_type() -> Type {
5258         unsafe { from_glib(gtk_sys::gtk_revealer_transition_type_get_type()) }
5259     }
5260 }
5261 
5262 impl<'a> FromValueOptional<'a> for RevealerTransitionType {
from_value_optional(value: &Value) -> Option<Self>5263     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
5264         Some(FromValue::from_value(value))
5265     }
5266 }
5267 
5268 impl<'a> FromValue<'a> for RevealerTransitionType {
from_value(value: &Value) -> Self5269     unsafe fn from_value(value: &Value) -> Self {
5270         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
5271     }
5272 }
5273 
5274 impl SetValue for RevealerTransitionType {
set_value(value: &mut Value, this: &Self)5275     unsafe fn set_value(value: &mut Value, this: &Self) {
5276         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
5277     }
5278 }
5279 
5280 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5281 pub enum ScrollStep {
5282     Steps,
5283     Pages,
5284     Ends,
5285     HorizontalSteps,
5286     HorizontalPages,
5287     HorizontalEnds,
5288     #[doc(hidden)]
5289     __Unknown(i32),
5290 }
5291 
5292 impl fmt::Display for ScrollStep {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result5293     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5294         write!(
5295             f,
5296             "ScrollStep::{}",
5297             match *self {
5298                 ScrollStep::Steps => "Steps",
5299                 ScrollStep::Pages => "Pages",
5300                 ScrollStep::Ends => "Ends",
5301                 ScrollStep::HorizontalSteps => "HorizontalSteps",
5302                 ScrollStep::HorizontalPages => "HorizontalPages",
5303                 ScrollStep::HorizontalEnds => "HorizontalEnds",
5304                 _ => "Unknown",
5305             }
5306         )
5307     }
5308 }
5309 
5310 #[doc(hidden)]
5311 impl ToGlib for ScrollStep {
5312     type GlibType = gtk_sys::GtkScrollStep;
5313 
to_glib(&self) -> gtk_sys::GtkScrollStep5314     fn to_glib(&self) -> gtk_sys::GtkScrollStep {
5315         match *self {
5316             ScrollStep::Steps => gtk_sys::GTK_SCROLL_STEPS,
5317             ScrollStep::Pages => gtk_sys::GTK_SCROLL_PAGES,
5318             ScrollStep::Ends => gtk_sys::GTK_SCROLL_ENDS,
5319             ScrollStep::HorizontalSteps => gtk_sys::GTK_SCROLL_HORIZONTAL_STEPS,
5320             ScrollStep::HorizontalPages => gtk_sys::GTK_SCROLL_HORIZONTAL_PAGES,
5321             ScrollStep::HorizontalEnds => gtk_sys::GTK_SCROLL_HORIZONTAL_ENDS,
5322             ScrollStep::__Unknown(value) => value,
5323         }
5324     }
5325 }
5326 
5327 #[doc(hidden)]
5328 impl FromGlib<gtk_sys::GtkScrollStep> for ScrollStep {
from_glib(value: gtk_sys::GtkScrollStep) -> Self5329     fn from_glib(value: gtk_sys::GtkScrollStep) -> Self {
5330         skip_assert_initialized!();
5331         match value {
5332             0 => ScrollStep::Steps,
5333             1 => ScrollStep::Pages,
5334             2 => ScrollStep::Ends,
5335             3 => ScrollStep::HorizontalSteps,
5336             4 => ScrollStep::HorizontalPages,
5337             5 => ScrollStep::HorizontalEnds,
5338             value => ScrollStep::__Unknown(value),
5339         }
5340     }
5341 }
5342 
5343 impl StaticType for ScrollStep {
static_type() -> Type5344     fn static_type() -> Type {
5345         unsafe { from_glib(gtk_sys::gtk_scroll_step_get_type()) }
5346     }
5347 }
5348 
5349 impl<'a> FromValueOptional<'a> for ScrollStep {
from_value_optional(value: &Value) -> Option<Self>5350     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
5351         Some(FromValue::from_value(value))
5352     }
5353 }
5354 
5355 impl<'a> FromValue<'a> for ScrollStep {
from_value(value: &Value) -> Self5356     unsafe fn from_value(value: &Value) -> Self {
5357         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
5358     }
5359 }
5360 
5361 impl SetValue for ScrollStep {
set_value(value: &mut Value, this: &Self)5362     unsafe fn set_value(value: &mut Value, this: &Self) {
5363         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
5364     }
5365 }
5366 
5367 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5368 pub enum ScrollType {
5369     None,
5370     Jump,
5371     StepBackward,
5372     StepForward,
5373     PageBackward,
5374     PageForward,
5375     StepUp,
5376     StepDown,
5377     PageUp,
5378     PageDown,
5379     StepLeft,
5380     StepRight,
5381     PageLeft,
5382     PageRight,
5383     Start,
5384     End,
5385     #[doc(hidden)]
5386     __Unknown(i32),
5387 }
5388 
5389 impl fmt::Display for ScrollType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result5390     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5391         write!(
5392             f,
5393             "ScrollType::{}",
5394             match *self {
5395                 ScrollType::None => "None",
5396                 ScrollType::Jump => "Jump",
5397                 ScrollType::StepBackward => "StepBackward",
5398                 ScrollType::StepForward => "StepForward",
5399                 ScrollType::PageBackward => "PageBackward",
5400                 ScrollType::PageForward => "PageForward",
5401                 ScrollType::StepUp => "StepUp",
5402                 ScrollType::StepDown => "StepDown",
5403                 ScrollType::PageUp => "PageUp",
5404                 ScrollType::PageDown => "PageDown",
5405                 ScrollType::StepLeft => "StepLeft",
5406                 ScrollType::StepRight => "StepRight",
5407                 ScrollType::PageLeft => "PageLeft",
5408                 ScrollType::PageRight => "PageRight",
5409                 ScrollType::Start => "Start",
5410                 ScrollType::End => "End",
5411                 _ => "Unknown",
5412             }
5413         )
5414     }
5415 }
5416 
5417 #[doc(hidden)]
5418 impl ToGlib for ScrollType {
5419     type GlibType = gtk_sys::GtkScrollType;
5420 
to_glib(&self) -> gtk_sys::GtkScrollType5421     fn to_glib(&self) -> gtk_sys::GtkScrollType {
5422         match *self {
5423             ScrollType::None => gtk_sys::GTK_SCROLL_NONE,
5424             ScrollType::Jump => gtk_sys::GTK_SCROLL_JUMP,
5425             ScrollType::StepBackward => gtk_sys::GTK_SCROLL_STEP_BACKWARD,
5426             ScrollType::StepForward => gtk_sys::GTK_SCROLL_STEP_FORWARD,
5427             ScrollType::PageBackward => gtk_sys::GTK_SCROLL_PAGE_BACKWARD,
5428             ScrollType::PageForward => gtk_sys::GTK_SCROLL_PAGE_FORWARD,
5429             ScrollType::StepUp => gtk_sys::GTK_SCROLL_STEP_UP,
5430             ScrollType::StepDown => gtk_sys::GTK_SCROLL_STEP_DOWN,
5431             ScrollType::PageUp => gtk_sys::GTK_SCROLL_PAGE_UP,
5432             ScrollType::PageDown => gtk_sys::GTK_SCROLL_PAGE_DOWN,
5433             ScrollType::StepLeft => gtk_sys::GTK_SCROLL_STEP_LEFT,
5434             ScrollType::StepRight => gtk_sys::GTK_SCROLL_STEP_RIGHT,
5435             ScrollType::PageLeft => gtk_sys::GTK_SCROLL_PAGE_LEFT,
5436             ScrollType::PageRight => gtk_sys::GTK_SCROLL_PAGE_RIGHT,
5437             ScrollType::Start => gtk_sys::GTK_SCROLL_START,
5438             ScrollType::End => gtk_sys::GTK_SCROLL_END,
5439             ScrollType::__Unknown(value) => value,
5440         }
5441     }
5442 }
5443 
5444 #[doc(hidden)]
5445 impl FromGlib<gtk_sys::GtkScrollType> for ScrollType {
from_glib(value: gtk_sys::GtkScrollType) -> Self5446     fn from_glib(value: gtk_sys::GtkScrollType) -> Self {
5447         skip_assert_initialized!();
5448         match value {
5449             0 => ScrollType::None,
5450             1 => ScrollType::Jump,
5451             2 => ScrollType::StepBackward,
5452             3 => ScrollType::StepForward,
5453             4 => ScrollType::PageBackward,
5454             5 => ScrollType::PageForward,
5455             6 => ScrollType::StepUp,
5456             7 => ScrollType::StepDown,
5457             8 => ScrollType::PageUp,
5458             9 => ScrollType::PageDown,
5459             10 => ScrollType::StepLeft,
5460             11 => ScrollType::StepRight,
5461             12 => ScrollType::PageLeft,
5462             13 => ScrollType::PageRight,
5463             14 => ScrollType::Start,
5464             15 => ScrollType::End,
5465             value => ScrollType::__Unknown(value),
5466         }
5467     }
5468 }
5469 
5470 impl StaticType for ScrollType {
static_type() -> Type5471     fn static_type() -> Type {
5472         unsafe { from_glib(gtk_sys::gtk_scroll_type_get_type()) }
5473     }
5474 }
5475 
5476 impl<'a> FromValueOptional<'a> for ScrollType {
from_value_optional(value: &Value) -> Option<Self>5477     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
5478         Some(FromValue::from_value(value))
5479     }
5480 }
5481 
5482 impl<'a> FromValue<'a> for ScrollType {
from_value(value: &Value) -> Self5483     unsafe fn from_value(value: &Value) -> Self {
5484         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
5485     }
5486 }
5487 
5488 impl SetValue for ScrollType {
set_value(value: &mut Value, this: &Self)5489     unsafe fn set_value(value: &mut Value, this: &Self) {
5490         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
5491     }
5492 }
5493 
5494 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5495 pub enum ScrollablePolicy {
5496     Minimum,
5497     Natural,
5498     #[doc(hidden)]
5499     __Unknown(i32),
5500 }
5501 
5502 impl fmt::Display for ScrollablePolicy {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result5503     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5504         write!(
5505             f,
5506             "ScrollablePolicy::{}",
5507             match *self {
5508                 ScrollablePolicy::Minimum => "Minimum",
5509                 ScrollablePolicy::Natural => "Natural",
5510                 _ => "Unknown",
5511             }
5512         )
5513     }
5514 }
5515 
5516 #[doc(hidden)]
5517 impl ToGlib for ScrollablePolicy {
5518     type GlibType = gtk_sys::GtkScrollablePolicy;
5519 
to_glib(&self) -> gtk_sys::GtkScrollablePolicy5520     fn to_glib(&self) -> gtk_sys::GtkScrollablePolicy {
5521         match *self {
5522             ScrollablePolicy::Minimum => gtk_sys::GTK_SCROLL_MINIMUM,
5523             ScrollablePolicy::Natural => gtk_sys::GTK_SCROLL_NATURAL,
5524             ScrollablePolicy::__Unknown(value) => value,
5525         }
5526     }
5527 }
5528 
5529 #[doc(hidden)]
5530 impl FromGlib<gtk_sys::GtkScrollablePolicy> for ScrollablePolicy {
from_glib(value: gtk_sys::GtkScrollablePolicy) -> Self5531     fn from_glib(value: gtk_sys::GtkScrollablePolicy) -> Self {
5532         skip_assert_initialized!();
5533         match value {
5534             0 => ScrollablePolicy::Minimum,
5535             1 => ScrollablePolicy::Natural,
5536             value => ScrollablePolicy::__Unknown(value),
5537         }
5538     }
5539 }
5540 
5541 impl StaticType for ScrollablePolicy {
static_type() -> Type5542     fn static_type() -> Type {
5543         unsafe { from_glib(gtk_sys::gtk_scrollable_policy_get_type()) }
5544     }
5545 }
5546 
5547 impl<'a> FromValueOptional<'a> for ScrollablePolicy {
from_value_optional(value: &Value) -> Option<Self>5548     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
5549         Some(FromValue::from_value(value))
5550     }
5551 }
5552 
5553 impl<'a> FromValue<'a> for ScrollablePolicy {
from_value(value: &Value) -> Self5554     unsafe fn from_value(value: &Value) -> Self {
5555         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
5556     }
5557 }
5558 
5559 impl SetValue for ScrollablePolicy {
set_value(value: &mut Value, this: &Self)5560     unsafe fn set_value(value: &mut Value, this: &Self) {
5561         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
5562     }
5563 }
5564 
5565 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5566 pub enum SelectionMode {
5567     None,
5568     Single,
5569     Browse,
5570     Multiple,
5571     #[doc(hidden)]
5572     __Unknown(i32),
5573 }
5574 
5575 impl fmt::Display for SelectionMode {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result5576     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5577         write!(
5578             f,
5579             "SelectionMode::{}",
5580             match *self {
5581                 SelectionMode::None => "None",
5582                 SelectionMode::Single => "Single",
5583                 SelectionMode::Browse => "Browse",
5584                 SelectionMode::Multiple => "Multiple",
5585                 _ => "Unknown",
5586             }
5587         )
5588     }
5589 }
5590 
5591 #[doc(hidden)]
5592 impl ToGlib for SelectionMode {
5593     type GlibType = gtk_sys::GtkSelectionMode;
5594 
to_glib(&self) -> gtk_sys::GtkSelectionMode5595     fn to_glib(&self) -> gtk_sys::GtkSelectionMode {
5596         match *self {
5597             SelectionMode::None => gtk_sys::GTK_SELECTION_NONE,
5598             SelectionMode::Single => gtk_sys::GTK_SELECTION_SINGLE,
5599             SelectionMode::Browse => gtk_sys::GTK_SELECTION_BROWSE,
5600             SelectionMode::Multiple => gtk_sys::GTK_SELECTION_MULTIPLE,
5601             SelectionMode::__Unknown(value) => value,
5602         }
5603     }
5604 }
5605 
5606 #[doc(hidden)]
5607 impl FromGlib<gtk_sys::GtkSelectionMode> for SelectionMode {
from_glib(value: gtk_sys::GtkSelectionMode) -> Self5608     fn from_glib(value: gtk_sys::GtkSelectionMode) -> Self {
5609         skip_assert_initialized!();
5610         match value {
5611             0 => SelectionMode::None,
5612             1 => SelectionMode::Single,
5613             2 => SelectionMode::Browse,
5614             3 => SelectionMode::Multiple,
5615             value => SelectionMode::__Unknown(value),
5616         }
5617     }
5618 }
5619 
5620 impl StaticType for SelectionMode {
static_type() -> Type5621     fn static_type() -> Type {
5622         unsafe { from_glib(gtk_sys::gtk_selection_mode_get_type()) }
5623     }
5624 }
5625 
5626 impl<'a> FromValueOptional<'a> for SelectionMode {
from_value_optional(value: &Value) -> Option<Self>5627     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
5628         Some(FromValue::from_value(value))
5629     }
5630 }
5631 
5632 impl<'a> FromValue<'a> for SelectionMode {
from_value(value: &Value) -> Self5633     unsafe fn from_value(value: &Value) -> Self {
5634         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
5635     }
5636 }
5637 
5638 impl SetValue for SelectionMode {
set_value(value: &mut Value, this: &Self)5639     unsafe fn set_value(value: &mut Value, this: &Self) {
5640         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
5641     }
5642 }
5643 
5644 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5645 pub enum SensitivityType {
5646     Auto,
5647     On,
5648     Off,
5649     #[doc(hidden)]
5650     __Unknown(i32),
5651 }
5652 
5653 impl fmt::Display for SensitivityType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result5654     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5655         write!(
5656             f,
5657             "SensitivityType::{}",
5658             match *self {
5659                 SensitivityType::Auto => "Auto",
5660                 SensitivityType::On => "On",
5661                 SensitivityType::Off => "Off",
5662                 _ => "Unknown",
5663             }
5664         )
5665     }
5666 }
5667 
5668 #[doc(hidden)]
5669 impl ToGlib for SensitivityType {
5670     type GlibType = gtk_sys::GtkSensitivityType;
5671 
to_glib(&self) -> gtk_sys::GtkSensitivityType5672     fn to_glib(&self) -> gtk_sys::GtkSensitivityType {
5673         match *self {
5674             SensitivityType::Auto => gtk_sys::GTK_SENSITIVITY_AUTO,
5675             SensitivityType::On => gtk_sys::GTK_SENSITIVITY_ON,
5676             SensitivityType::Off => gtk_sys::GTK_SENSITIVITY_OFF,
5677             SensitivityType::__Unknown(value) => value,
5678         }
5679     }
5680 }
5681 
5682 #[doc(hidden)]
5683 impl FromGlib<gtk_sys::GtkSensitivityType> for SensitivityType {
from_glib(value: gtk_sys::GtkSensitivityType) -> Self5684     fn from_glib(value: gtk_sys::GtkSensitivityType) -> Self {
5685         skip_assert_initialized!();
5686         match value {
5687             0 => SensitivityType::Auto,
5688             1 => SensitivityType::On,
5689             2 => SensitivityType::Off,
5690             value => SensitivityType::__Unknown(value),
5691         }
5692     }
5693 }
5694 
5695 impl StaticType for SensitivityType {
static_type() -> Type5696     fn static_type() -> Type {
5697         unsafe { from_glib(gtk_sys::gtk_sensitivity_type_get_type()) }
5698     }
5699 }
5700 
5701 impl<'a> FromValueOptional<'a> for SensitivityType {
from_value_optional(value: &Value) -> Option<Self>5702     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
5703         Some(FromValue::from_value(value))
5704     }
5705 }
5706 
5707 impl<'a> FromValue<'a> for SensitivityType {
from_value(value: &Value) -> Self5708     unsafe fn from_value(value: &Value) -> Self {
5709         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
5710     }
5711 }
5712 
5713 impl SetValue for SensitivityType {
set_value(value: &mut Value, this: &Self)5714     unsafe fn set_value(value: &mut Value, this: &Self) {
5715         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
5716     }
5717 }
5718 
5719 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5720 pub enum ShadowType {
5721     None,
5722     In,
5723     Out,
5724     EtchedIn,
5725     EtchedOut,
5726     #[doc(hidden)]
5727     __Unknown(i32),
5728 }
5729 
5730 impl fmt::Display for ShadowType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result5731     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5732         write!(
5733             f,
5734             "ShadowType::{}",
5735             match *self {
5736                 ShadowType::None => "None",
5737                 ShadowType::In => "In",
5738                 ShadowType::Out => "Out",
5739                 ShadowType::EtchedIn => "EtchedIn",
5740                 ShadowType::EtchedOut => "EtchedOut",
5741                 _ => "Unknown",
5742             }
5743         )
5744     }
5745 }
5746 
5747 #[doc(hidden)]
5748 impl ToGlib for ShadowType {
5749     type GlibType = gtk_sys::GtkShadowType;
5750 
to_glib(&self) -> gtk_sys::GtkShadowType5751     fn to_glib(&self) -> gtk_sys::GtkShadowType {
5752         match *self {
5753             ShadowType::None => gtk_sys::GTK_SHADOW_NONE,
5754             ShadowType::In => gtk_sys::GTK_SHADOW_IN,
5755             ShadowType::Out => gtk_sys::GTK_SHADOW_OUT,
5756             ShadowType::EtchedIn => gtk_sys::GTK_SHADOW_ETCHED_IN,
5757             ShadowType::EtchedOut => gtk_sys::GTK_SHADOW_ETCHED_OUT,
5758             ShadowType::__Unknown(value) => value,
5759         }
5760     }
5761 }
5762 
5763 #[doc(hidden)]
5764 impl FromGlib<gtk_sys::GtkShadowType> for ShadowType {
from_glib(value: gtk_sys::GtkShadowType) -> Self5765     fn from_glib(value: gtk_sys::GtkShadowType) -> Self {
5766         skip_assert_initialized!();
5767         match value {
5768             0 => ShadowType::None,
5769             1 => ShadowType::In,
5770             2 => ShadowType::Out,
5771             3 => ShadowType::EtchedIn,
5772             4 => ShadowType::EtchedOut,
5773             value => ShadowType::__Unknown(value),
5774         }
5775     }
5776 }
5777 
5778 impl StaticType for ShadowType {
static_type() -> Type5779     fn static_type() -> Type {
5780         unsafe { from_glib(gtk_sys::gtk_shadow_type_get_type()) }
5781     }
5782 }
5783 
5784 impl<'a> FromValueOptional<'a> for ShadowType {
from_value_optional(value: &Value) -> Option<Self>5785     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
5786         Some(FromValue::from_value(value))
5787     }
5788 }
5789 
5790 impl<'a> FromValue<'a> for ShadowType {
from_value(value: &Value) -> Self5791     unsafe fn from_value(value: &Value) -> Self {
5792         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
5793     }
5794 }
5795 
5796 impl SetValue for ShadowType {
set_value(value: &mut Value, this: &Self)5797     unsafe fn set_value(value: &mut Value, this: &Self) {
5798         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
5799     }
5800 }
5801 
5802 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5803 pub enum SizeGroupMode {
5804     None,
5805     Horizontal,
5806     Vertical,
5807     Both,
5808     #[doc(hidden)]
5809     __Unknown(i32),
5810 }
5811 
5812 impl fmt::Display for SizeGroupMode {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result5813     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5814         write!(
5815             f,
5816             "SizeGroupMode::{}",
5817             match *self {
5818                 SizeGroupMode::None => "None",
5819                 SizeGroupMode::Horizontal => "Horizontal",
5820                 SizeGroupMode::Vertical => "Vertical",
5821                 SizeGroupMode::Both => "Both",
5822                 _ => "Unknown",
5823             }
5824         )
5825     }
5826 }
5827 
5828 #[doc(hidden)]
5829 impl ToGlib for SizeGroupMode {
5830     type GlibType = gtk_sys::GtkSizeGroupMode;
5831 
to_glib(&self) -> gtk_sys::GtkSizeGroupMode5832     fn to_glib(&self) -> gtk_sys::GtkSizeGroupMode {
5833         match *self {
5834             SizeGroupMode::None => gtk_sys::GTK_SIZE_GROUP_NONE,
5835             SizeGroupMode::Horizontal => gtk_sys::GTK_SIZE_GROUP_HORIZONTAL,
5836             SizeGroupMode::Vertical => gtk_sys::GTK_SIZE_GROUP_VERTICAL,
5837             SizeGroupMode::Both => gtk_sys::GTK_SIZE_GROUP_BOTH,
5838             SizeGroupMode::__Unknown(value) => value,
5839         }
5840     }
5841 }
5842 
5843 #[doc(hidden)]
5844 impl FromGlib<gtk_sys::GtkSizeGroupMode> for SizeGroupMode {
from_glib(value: gtk_sys::GtkSizeGroupMode) -> Self5845     fn from_glib(value: gtk_sys::GtkSizeGroupMode) -> Self {
5846         skip_assert_initialized!();
5847         match value {
5848             0 => SizeGroupMode::None,
5849             1 => SizeGroupMode::Horizontal,
5850             2 => SizeGroupMode::Vertical,
5851             3 => SizeGroupMode::Both,
5852             value => SizeGroupMode::__Unknown(value),
5853         }
5854     }
5855 }
5856 
5857 impl StaticType for SizeGroupMode {
static_type() -> Type5858     fn static_type() -> Type {
5859         unsafe { from_glib(gtk_sys::gtk_size_group_mode_get_type()) }
5860     }
5861 }
5862 
5863 impl<'a> FromValueOptional<'a> for SizeGroupMode {
from_value_optional(value: &Value) -> Option<Self>5864     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
5865         Some(FromValue::from_value(value))
5866     }
5867 }
5868 
5869 impl<'a> FromValue<'a> for SizeGroupMode {
from_value(value: &Value) -> Self5870     unsafe fn from_value(value: &Value) -> Self {
5871         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
5872     }
5873 }
5874 
5875 impl SetValue for SizeGroupMode {
set_value(value: &mut Value, this: &Self)5876     unsafe fn set_value(value: &mut Value, this: &Self) {
5877         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
5878     }
5879 }
5880 
5881 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5882 pub enum SizeRequestMode {
5883     HeightForWidth,
5884     WidthForHeight,
5885     ConstantSize,
5886     #[doc(hidden)]
5887     __Unknown(i32),
5888 }
5889 
5890 impl fmt::Display for SizeRequestMode {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result5891     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5892         write!(
5893             f,
5894             "SizeRequestMode::{}",
5895             match *self {
5896                 SizeRequestMode::HeightForWidth => "HeightForWidth",
5897                 SizeRequestMode::WidthForHeight => "WidthForHeight",
5898                 SizeRequestMode::ConstantSize => "ConstantSize",
5899                 _ => "Unknown",
5900             }
5901         )
5902     }
5903 }
5904 
5905 #[doc(hidden)]
5906 impl ToGlib for SizeRequestMode {
5907     type GlibType = gtk_sys::GtkSizeRequestMode;
5908 
to_glib(&self) -> gtk_sys::GtkSizeRequestMode5909     fn to_glib(&self) -> gtk_sys::GtkSizeRequestMode {
5910         match *self {
5911             SizeRequestMode::HeightForWidth => gtk_sys::GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH,
5912             SizeRequestMode::WidthForHeight => gtk_sys::GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT,
5913             SizeRequestMode::ConstantSize => gtk_sys::GTK_SIZE_REQUEST_CONSTANT_SIZE,
5914             SizeRequestMode::__Unknown(value) => value,
5915         }
5916     }
5917 }
5918 
5919 #[doc(hidden)]
5920 impl FromGlib<gtk_sys::GtkSizeRequestMode> for SizeRequestMode {
from_glib(value: gtk_sys::GtkSizeRequestMode) -> Self5921     fn from_glib(value: gtk_sys::GtkSizeRequestMode) -> Self {
5922         skip_assert_initialized!();
5923         match value {
5924             0 => SizeRequestMode::HeightForWidth,
5925             1 => SizeRequestMode::WidthForHeight,
5926             2 => SizeRequestMode::ConstantSize,
5927             value => SizeRequestMode::__Unknown(value),
5928         }
5929     }
5930 }
5931 
5932 impl StaticType for SizeRequestMode {
static_type() -> Type5933     fn static_type() -> Type {
5934         unsafe { from_glib(gtk_sys::gtk_size_request_mode_get_type()) }
5935     }
5936 }
5937 
5938 impl<'a> FromValueOptional<'a> for SizeRequestMode {
from_value_optional(value: &Value) -> Option<Self>5939     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
5940         Some(FromValue::from_value(value))
5941     }
5942 }
5943 
5944 impl<'a> FromValue<'a> for SizeRequestMode {
from_value(value: &Value) -> Self5945     unsafe fn from_value(value: &Value) -> Self {
5946         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
5947     }
5948 }
5949 
5950 impl SetValue for SizeRequestMode {
set_value(value: &mut Value, this: &Self)5951     unsafe fn set_value(value: &mut Value, this: &Self) {
5952         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
5953     }
5954 }
5955 
5956 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
5957 pub enum SortType {
5958     Ascending,
5959     Descending,
5960     #[doc(hidden)]
5961     __Unknown(i32),
5962 }
5963 
5964 impl fmt::Display for SortType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result5965     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5966         write!(
5967             f,
5968             "SortType::{}",
5969             match *self {
5970                 SortType::Ascending => "Ascending",
5971                 SortType::Descending => "Descending",
5972                 _ => "Unknown",
5973             }
5974         )
5975     }
5976 }
5977 
5978 #[doc(hidden)]
5979 impl ToGlib for SortType {
5980     type GlibType = gtk_sys::GtkSortType;
5981 
to_glib(&self) -> gtk_sys::GtkSortType5982     fn to_glib(&self) -> gtk_sys::GtkSortType {
5983         match *self {
5984             SortType::Ascending => gtk_sys::GTK_SORT_ASCENDING,
5985             SortType::Descending => gtk_sys::GTK_SORT_DESCENDING,
5986             SortType::__Unknown(value) => value,
5987         }
5988     }
5989 }
5990 
5991 #[doc(hidden)]
5992 impl FromGlib<gtk_sys::GtkSortType> for SortType {
from_glib(value: gtk_sys::GtkSortType) -> Self5993     fn from_glib(value: gtk_sys::GtkSortType) -> Self {
5994         skip_assert_initialized!();
5995         match value {
5996             0 => SortType::Ascending,
5997             1 => SortType::Descending,
5998             value => SortType::__Unknown(value),
5999         }
6000     }
6001 }
6002 
6003 impl StaticType for SortType {
static_type() -> Type6004     fn static_type() -> Type {
6005         unsafe { from_glib(gtk_sys::gtk_sort_type_get_type()) }
6006     }
6007 }
6008 
6009 impl<'a> FromValueOptional<'a> for SortType {
from_value_optional(value: &Value) -> Option<Self>6010     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
6011         Some(FromValue::from_value(value))
6012     }
6013 }
6014 
6015 impl<'a> FromValue<'a> for SortType {
from_value(value: &Value) -> Self6016     unsafe fn from_value(value: &Value) -> Self {
6017         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
6018     }
6019 }
6020 
6021 impl SetValue for SortType {
set_value(value: &mut Value, this: &Self)6022     unsafe fn set_value(value: &mut Value, this: &Self) {
6023         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
6024     }
6025 }
6026 
6027 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6028 pub enum SpinButtonUpdatePolicy {
6029     Always,
6030     IfValid,
6031     #[doc(hidden)]
6032     __Unknown(i32),
6033 }
6034 
6035 impl fmt::Display for SpinButtonUpdatePolicy {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result6036     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6037         write!(
6038             f,
6039             "SpinButtonUpdatePolicy::{}",
6040             match *self {
6041                 SpinButtonUpdatePolicy::Always => "Always",
6042                 SpinButtonUpdatePolicy::IfValid => "IfValid",
6043                 _ => "Unknown",
6044             }
6045         )
6046     }
6047 }
6048 
6049 #[doc(hidden)]
6050 impl ToGlib for SpinButtonUpdatePolicy {
6051     type GlibType = gtk_sys::GtkSpinButtonUpdatePolicy;
6052 
to_glib(&self) -> gtk_sys::GtkSpinButtonUpdatePolicy6053     fn to_glib(&self) -> gtk_sys::GtkSpinButtonUpdatePolicy {
6054         match *self {
6055             SpinButtonUpdatePolicy::Always => gtk_sys::GTK_UPDATE_ALWAYS,
6056             SpinButtonUpdatePolicy::IfValid => gtk_sys::GTK_UPDATE_IF_VALID,
6057             SpinButtonUpdatePolicy::__Unknown(value) => value,
6058         }
6059     }
6060 }
6061 
6062 #[doc(hidden)]
6063 impl FromGlib<gtk_sys::GtkSpinButtonUpdatePolicy> for SpinButtonUpdatePolicy {
from_glib(value: gtk_sys::GtkSpinButtonUpdatePolicy) -> Self6064     fn from_glib(value: gtk_sys::GtkSpinButtonUpdatePolicy) -> Self {
6065         skip_assert_initialized!();
6066         match value {
6067             0 => SpinButtonUpdatePolicy::Always,
6068             1 => SpinButtonUpdatePolicy::IfValid,
6069             value => SpinButtonUpdatePolicy::__Unknown(value),
6070         }
6071     }
6072 }
6073 
6074 impl StaticType for SpinButtonUpdatePolicy {
static_type() -> Type6075     fn static_type() -> Type {
6076         unsafe { from_glib(gtk_sys::gtk_spin_button_update_policy_get_type()) }
6077     }
6078 }
6079 
6080 impl<'a> FromValueOptional<'a> for SpinButtonUpdatePolicy {
from_value_optional(value: &Value) -> Option<Self>6081     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
6082         Some(FromValue::from_value(value))
6083     }
6084 }
6085 
6086 impl<'a> FromValue<'a> for SpinButtonUpdatePolicy {
from_value(value: &Value) -> Self6087     unsafe fn from_value(value: &Value) -> Self {
6088         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
6089     }
6090 }
6091 
6092 impl SetValue for SpinButtonUpdatePolicy {
set_value(value: &mut Value, this: &Self)6093     unsafe fn set_value(value: &mut Value, this: &Self) {
6094         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
6095     }
6096 }
6097 
6098 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6099 pub enum SpinType {
6100     StepForward,
6101     StepBackward,
6102     PageForward,
6103     PageBackward,
6104     Home,
6105     End,
6106     UserDefined,
6107     #[doc(hidden)]
6108     __Unknown(i32),
6109 }
6110 
6111 impl fmt::Display for SpinType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result6112     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6113         write!(
6114             f,
6115             "SpinType::{}",
6116             match *self {
6117                 SpinType::StepForward => "StepForward",
6118                 SpinType::StepBackward => "StepBackward",
6119                 SpinType::PageForward => "PageForward",
6120                 SpinType::PageBackward => "PageBackward",
6121                 SpinType::Home => "Home",
6122                 SpinType::End => "End",
6123                 SpinType::UserDefined => "UserDefined",
6124                 _ => "Unknown",
6125             }
6126         )
6127     }
6128 }
6129 
6130 #[doc(hidden)]
6131 impl ToGlib for SpinType {
6132     type GlibType = gtk_sys::GtkSpinType;
6133 
to_glib(&self) -> gtk_sys::GtkSpinType6134     fn to_glib(&self) -> gtk_sys::GtkSpinType {
6135         match *self {
6136             SpinType::StepForward => gtk_sys::GTK_SPIN_STEP_FORWARD,
6137             SpinType::StepBackward => gtk_sys::GTK_SPIN_STEP_BACKWARD,
6138             SpinType::PageForward => gtk_sys::GTK_SPIN_PAGE_FORWARD,
6139             SpinType::PageBackward => gtk_sys::GTK_SPIN_PAGE_BACKWARD,
6140             SpinType::Home => gtk_sys::GTK_SPIN_HOME,
6141             SpinType::End => gtk_sys::GTK_SPIN_END,
6142             SpinType::UserDefined => gtk_sys::GTK_SPIN_USER_DEFINED,
6143             SpinType::__Unknown(value) => value,
6144         }
6145     }
6146 }
6147 
6148 #[doc(hidden)]
6149 impl FromGlib<gtk_sys::GtkSpinType> for SpinType {
from_glib(value: gtk_sys::GtkSpinType) -> Self6150     fn from_glib(value: gtk_sys::GtkSpinType) -> Self {
6151         skip_assert_initialized!();
6152         match value {
6153             0 => SpinType::StepForward,
6154             1 => SpinType::StepBackward,
6155             2 => SpinType::PageForward,
6156             3 => SpinType::PageBackward,
6157             4 => SpinType::Home,
6158             5 => SpinType::End,
6159             6 => SpinType::UserDefined,
6160             value => SpinType::__Unknown(value),
6161         }
6162     }
6163 }
6164 
6165 impl StaticType for SpinType {
static_type() -> Type6166     fn static_type() -> Type {
6167         unsafe { from_glib(gtk_sys::gtk_spin_type_get_type()) }
6168     }
6169 }
6170 
6171 impl<'a> FromValueOptional<'a> for SpinType {
from_value_optional(value: &Value) -> Option<Self>6172     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
6173         Some(FromValue::from_value(value))
6174     }
6175 }
6176 
6177 impl<'a> FromValue<'a> for SpinType {
from_value(value: &Value) -> Self6178     unsafe fn from_value(value: &Value) -> Self {
6179         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
6180     }
6181 }
6182 
6183 impl SetValue for SpinType {
set_value(value: &mut Value, this: &Self)6184     unsafe fn set_value(value: &mut Value, this: &Self) {
6185         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
6186     }
6187 }
6188 
6189 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6190 pub enum StackTransitionType {
6191     None,
6192     Crossfade,
6193     SlideRight,
6194     SlideLeft,
6195     SlideUp,
6196     SlideDown,
6197     SlideLeftRight,
6198     SlideUpDown,
6199     OverUp,
6200     OverDown,
6201     OverLeft,
6202     OverRight,
6203     UnderUp,
6204     UnderDown,
6205     UnderLeft,
6206     UnderRight,
6207     OverUpDown,
6208     OverDownUp,
6209     OverLeftRight,
6210     OverRightLeft,
6211     #[doc(hidden)]
6212     __Unknown(i32),
6213 }
6214 
6215 impl fmt::Display for StackTransitionType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result6216     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6217         write!(
6218             f,
6219             "StackTransitionType::{}",
6220             match *self {
6221                 StackTransitionType::None => "None",
6222                 StackTransitionType::Crossfade => "Crossfade",
6223                 StackTransitionType::SlideRight => "SlideRight",
6224                 StackTransitionType::SlideLeft => "SlideLeft",
6225                 StackTransitionType::SlideUp => "SlideUp",
6226                 StackTransitionType::SlideDown => "SlideDown",
6227                 StackTransitionType::SlideLeftRight => "SlideLeftRight",
6228                 StackTransitionType::SlideUpDown => "SlideUpDown",
6229                 StackTransitionType::OverUp => "OverUp",
6230                 StackTransitionType::OverDown => "OverDown",
6231                 StackTransitionType::OverLeft => "OverLeft",
6232                 StackTransitionType::OverRight => "OverRight",
6233                 StackTransitionType::UnderUp => "UnderUp",
6234                 StackTransitionType::UnderDown => "UnderDown",
6235                 StackTransitionType::UnderLeft => "UnderLeft",
6236                 StackTransitionType::UnderRight => "UnderRight",
6237                 StackTransitionType::OverUpDown => "OverUpDown",
6238                 StackTransitionType::OverDownUp => "OverDownUp",
6239                 StackTransitionType::OverLeftRight => "OverLeftRight",
6240                 StackTransitionType::OverRightLeft => "OverRightLeft",
6241                 _ => "Unknown",
6242             }
6243         )
6244     }
6245 }
6246 
6247 #[doc(hidden)]
6248 impl ToGlib for StackTransitionType {
6249     type GlibType = gtk_sys::GtkStackTransitionType;
6250 
to_glib(&self) -> gtk_sys::GtkStackTransitionType6251     fn to_glib(&self) -> gtk_sys::GtkStackTransitionType {
6252         match *self {
6253             StackTransitionType::None => gtk_sys::GTK_STACK_TRANSITION_TYPE_NONE,
6254             StackTransitionType::Crossfade => gtk_sys::GTK_STACK_TRANSITION_TYPE_CROSSFADE,
6255             StackTransitionType::SlideRight => gtk_sys::GTK_STACK_TRANSITION_TYPE_SLIDE_RIGHT,
6256             StackTransitionType::SlideLeft => gtk_sys::GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT,
6257             StackTransitionType::SlideUp => gtk_sys::GTK_STACK_TRANSITION_TYPE_SLIDE_UP,
6258             StackTransitionType::SlideDown => gtk_sys::GTK_STACK_TRANSITION_TYPE_SLIDE_DOWN,
6259             StackTransitionType::SlideLeftRight => {
6260                 gtk_sys::GTK_STACK_TRANSITION_TYPE_SLIDE_LEFT_RIGHT
6261             }
6262             StackTransitionType::SlideUpDown => gtk_sys::GTK_STACK_TRANSITION_TYPE_SLIDE_UP_DOWN,
6263             StackTransitionType::OverUp => gtk_sys::GTK_STACK_TRANSITION_TYPE_OVER_UP,
6264             StackTransitionType::OverDown => gtk_sys::GTK_STACK_TRANSITION_TYPE_OVER_DOWN,
6265             StackTransitionType::OverLeft => gtk_sys::GTK_STACK_TRANSITION_TYPE_OVER_LEFT,
6266             StackTransitionType::OverRight => gtk_sys::GTK_STACK_TRANSITION_TYPE_OVER_RIGHT,
6267             StackTransitionType::UnderUp => gtk_sys::GTK_STACK_TRANSITION_TYPE_UNDER_UP,
6268             StackTransitionType::UnderDown => gtk_sys::GTK_STACK_TRANSITION_TYPE_UNDER_DOWN,
6269             StackTransitionType::UnderLeft => gtk_sys::GTK_STACK_TRANSITION_TYPE_UNDER_LEFT,
6270             StackTransitionType::UnderRight => gtk_sys::GTK_STACK_TRANSITION_TYPE_UNDER_RIGHT,
6271             StackTransitionType::OverUpDown => gtk_sys::GTK_STACK_TRANSITION_TYPE_OVER_UP_DOWN,
6272             StackTransitionType::OverDownUp => gtk_sys::GTK_STACK_TRANSITION_TYPE_OVER_DOWN_UP,
6273             StackTransitionType::OverLeftRight => {
6274                 gtk_sys::GTK_STACK_TRANSITION_TYPE_OVER_LEFT_RIGHT
6275             }
6276             StackTransitionType::OverRightLeft => {
6277                 gtk_sys::GTK_STACK_TRANSITION_TYPE_OVER_RIGHT_LEFT
6278             }
6279             StackTransitionType::__Unknown(value) => value,
6280         }
6281     }
6282 }
6283 
6284 #[doc(hidden)]
6285 impl FromGlib<gtk_sys::GtkStackTransitionType> for StackTransitionType {
from_glib(value: gtk_sys::GtkStackTransitionType) -> Self6286     fn from_glib(value: gtk_sys::GtkStackTransitionType) -> Self {
6287         skip_assert_initialized!();
6288         match value {
6289             0 => StackTransitionType::None,
6290             1 => StackTransitionType::Crossfade,
6291             2 => StackTransitionType::SlideRight,
6292             3 => StackTransitionType::SlideLeft,
6293             4 => StackTransitionType::SlideUp,
6294             5 => StackTransitionType::SlideDown,
6295             6 => StackTransitionType::SlideLeftRight,
6296             7 => StackTransitionType::SlideUpDown,
6297             8 => StackTransitionType::OverUp,
6298             9 => StackTransitionType::OverDown,
6299             10 => StackTransitionType::OverLeft,
6300             11 => StackTransitionType::OverRight,
6301             12 => StackTransitionType::UnderUp,
6302             13 => StackTransitionType::UnderDown,
6303             14 => StackTransitionType::UnderLeft,
6304             15 => StackTransitionType::UnderRight,
6305             16 => StackTransitionType::OverUpDown,
6306             17 => StackTransitionType::OverDownUp,
6307             18 => StackTransitionType::OverLeftRight,
6308             19 => StackTransitionType::OverRightLeft,
6309             value => StackTransitionType::__Unknown(value),
6310         }
6311     }
6312 }
6313 
6314 impl StaticType for StackTransitionType {
static_type() -> Type6315     fn static_type() -> Type {
6316         unsafe { from_glib(gtk_sys::gtk_stack_transition_type_get_type()) }
6317     }
6318 }
6319 
6320 impl<'a> FromValueOptional<'a> for StackTransitionType {
from_value_optional(value: &Value) -> Option<Self>6321     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
6322         Some(FromValue::from_value(value))
6323     }
6324 }
6325 
6326 impl<'a> FromValue<'a> for StackTransitionType {
from_value(value: &Value) -> Self6327     unsafe fn from_value(value: &Value) -> Self {
6328         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
6329     }
6330 }
6331 
6332 impl SetValue for StackTransitionType {
set_value(value: &mut Value, this: &Self)6333     unsafe fn set_value(value: &mut Value, this: &Self) {
6334         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
6335     }
6336 }
6337 
6338 #[deprecated]
6339 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6340 pub enum StateType {
6341     Normal,
6342     Active,
6343     Prelight,
6344     Selected,
6345     Insensitive,
6346     Inconsistent,
6347     Focused,
6348     #[doc(hidden)]
6349     __Unknown(i32),
6350 }
6351 
6352 #[deprecated]
6353 impl fmt::Display for StateType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result6354     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6355         write!(
6356             f,
6357             "StateType::{}",
6358             match *self {
6359                 StateType::Normal => "Normal",
6360                 StateType::Active => "Active",
6361                 StateType::Prelight => "Prelight",
6362                 StateType::Selected => "Selected",
6363                 StateType::Insensitive => "Insensitive",
6364                 StateType::Inconsistent => "Inconsistent",
6365                 StateType::Focused => "Focused",
6366                 _ => "Unknown",
6367             }
6368         )
6369     }
6370 }
6371 
6372 #[deprecated]
6373 #[doc(hidden)]
6374 impl ToGlib for StateType {
6375     type GlibType = gtk_sys::GtkStateType;
6376 
to_glib(&self) -> gtk_sys::GtkStateType6377     fn to_glib(&self) -> gtk_sys::GtkStateType {
6378         match *self {
6379             StateType::Normal => gtk_sys::GTK_STATE_NORMAL,
6380             StateType::Active => gtk_sys::GTK_STATE_ACTIVE,
6381             StateType::Prelight => gtk_sys::GTK_STATE_PRELIGHT,
6382             StateType::Selected => gtk_sys::GTK_STATE_SELECTED,
6383             StateType::Insensitive => gtk_sys::GTK_STATE_INSENSITIVE,
6384             StateType::Inconsistent => gtk_sys::GTK_STATE_INCONSISTENT,
6385             StateType::Focused => gtk_sys::GTK_STATE_FOCUSED,
6386             StateType::__Unknown(value) => value,
6387         }
6388     }
6389 }
6390 
6391 #[deprecated]
6392 #[doc(hidden)]
6393 impl FromGlib<gtk_sys::GtkStateType> for StateType {
from_glib(value: gtk_sys::GtkStateType) -> Self6394     fn from_glib(value: gtk_sys::GtkStateType) -> Self {
6395         skip_assert_initialized!();
6396         match value {
6397             0 => StateType::Normal,
6398             1 => StateType::Active,
6399             2 => StateType::Prelight,
6400             3 => StateType::Selected,
6401             4 => StateType::Insensitive,
6402             5 => StateType::Inconsistent,
6403             6 => StateType::Focused,
6404             value => StateType::__Unknown(value),
6405         }
6406     }
6407 }
6408 
6409 #[deprecated]
6410 impl StaticType for StateType {
static_type() -> Type6411     fn static_type() -> Type {
6412         unsafe { from_glib(gtk_sys::gtk_state_type_get_type()) }
6413     }
6414 }
6415 
6416 #[deprecated]
6417 impl<'a> FromValueOptional<'a> for StateType {
from_value_optional(value: &Value) -> Option<Self>6418     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
6419         Some(FromValue::from_value(value))
6420     }
6421 }
6422 
6423 #[deprecated]
6424 impl<'a> FromValue<'a> for StateType {
from_value(value: &Value) -> Self6425     unsafe fn from_value(value: &Value) -> Self {
6426         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
6427     }
6428 }
6429 
6430 #[deprecated]
6431 impl SetValue for StateType {
set_value(value: &mut Value, this: &Self)6432     unsafe fn set_value(value: &mut Value, this: &Self) {
6433         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
6434     }
6435 }
6436 
6437 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6438 pub enum TextDirection {
6439     None,
6440     Ltr,
6441     Rtl,
6442     #[doc(hidden)]
6443     __Unknown(i32),
6444 }
6445 
6446 impl fmt::Display for TextDirection {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result6447     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6448         write!(
6449             f,
6450             "TextDirection::{}",
6451             match *self {
6452                 TextDirection::None => "None",
6453                 TextDirection::Ltr => "Ltr",
6454                 TextDirection::Rtl => "Rtl",
6455                 _ => "Unknown",
6456             }
6457         )
6458     }
6459 }
6460 
6461 #[doc(hidden)]
6462 impl ToGlib for TextDirection {
6463     type GlibType = gtk_sys::GtkTextDirection;
6464 
to_glib(&self) -> gtk_sys::GtkTextDirection6465     fn to_glib(&self) -> gtk_sys::GtkTextDirection {
6466         match *self {
6467             TextDirection::None => gtk_sys::GTK_TEXT_DIR_NONE,
6468             TextDirection::Ltr => gtk_sys::GTK_TEXT_DIR_LTR,
6469             TextDirection::Rtl => gtk_sys::GTK_TEXT_DIR_RTL,
6470             TextDirection::__Unknown(value) => value,
6471         }
6472     }
6473 }
6474 
6475 #[doc(hidden)]
6476 impl FromGlib<gtk_sys::GtkTextDirection> for TextDirection {
from_glib(value: gtk_sys::GtkTextDirection) -> Self6477     fn from_glib(value: gtk_sys::GtkTextDirection) -> Self {
6478         skip_assert_initialized!();
6479         match value {
6480             0 => TextDirection::None,
6481             1 => TextDirection::Ltr,
6482             2 => TextDirection::Rtl,
6483             value => TextDirection::__Unknown(value),
6484         }
6485     }
6486 }
6487 
6488 impl StaticType for TextDirection {
static_type() -> Type6489     fn static_type() -> Type {
6490         unsafe { from_glib(gtk_sys::gtk_text_direction_get_type()) }
6491     }
6492 }
6493 
6494 impl<'a> FromValueOptional<'a> for TextDirection {
from_value_optional(value: &Value) -> Option<Self>6495     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
6496         Some(FromValue::from_value(value))
6497     }
6498 }
6499 
6500 impl<'a> FromValue<'a> for TextDirection {
from_value(value: &Value) -> Self6501     unsafe fn from_value(value: &Value) -> Self {
6502         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
6503     }
6504 }
6505 
6506 impl SetValue for TextDirection {
set_value(value: &mut Value, this: &Self)6507     unsafe fn set_value(value: &mut Value, this: &Self) {
6508         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
6509     }
6510 }
6511 
6512 #[cfg(any(feature = "v3_16", feature = "dox"))]
6513 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6514 pub enum TextExtendSelection {
6515     Word,
6516     Line,
6517     #[doc(hidden)]
6518     __Unknown(i32),
6519 }
6520 
6521 #[cfg(any(feature = "v3_16", feature = "dox"))]
6522 impl fmt::Display for TextExtendSelection {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result6523     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6524         write!(
6525             f,
6526             "TextExtendSelection::{}",
6527             match *self {
6528                 TextExtendSelection::Word => "Word",
6529                 TextExtendSelection::Line => "Line",
6530                 _ => "Unknown",
6531             }
6532         )
6533     }
6534 }
6535 
6536 #[cfg(any(feature = "v3_16", feature = "dox"))]
6537 #[doc(hidden)]
6538 impl ToGlib for TextExtendSelection {
6539     type GlibType = gtk_sys::GtkTextExtendSelection;
6540 
to_glib(&self) -> gtk_sys::GtkTextExtendSelection6541     fn to_glib(&self) -> gtk_sys::GtkTextExtendSelection {
6542         match *self {
6543             TextExtendSelection::Word => gtk_sys::GTK_TEXT_EXTEND_SELECTION_WORD,
6544             TextExtendSelection::Line => gtk_sys::GTK_TEXT_EXTEND_SELECTION_LINE,
6545             TextExtendSelection::__Unknown(value) => value,
6546         }
6547     }
6548 }
6549 
6550 #[cfg(any(feature = "v3_16", feature = "dox"))]
6551 #[doc(hidden)]
6552 impl FromGlib<gtk_sys::GtkTextExtendSelection> for TextExtendSelection {
from_glib(value: gtk_sys::GtkTextExtendSelection) -> Self6553     fn from_glib(value: gtk_sys::GtkTextExtendSelection) -> Self {
6554         skip_assert_initialized!();
6555         match value {
6556             0 => TextExtendSelection::Word,
6557             1 => TextExtendSelection::Line,
6558             value => TextExtendSelection::__Unknown(value),
6559         }
6560     }
6561 }
6562 
6563 #[cfg(any(feature = "v3_16", feature = "dox"))]
6564 impl StaticType for TextExtendSelection {
static_type() -> Type6565     fn static_type() -> Type {
6566         unsafe { from_glib(gtk_sys::gtk_text_extend_selection_get_type()) }
6567     }
6568 }
6569 
6570 #[cfg(any(feature = "v3_16", feature = "dox"))]
6571 impl<'a> FromValueOptional<'a> for TextExtendSelection {
from_value_optional(value: &Value) -> Option<Self>6572     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
6573         Some(FromValue::from_value(value))
6574     }
6575 }
6576 
6577 #[cfg(any(feature = "v3_16", feature = "dox"))]
6578 impl<'a> FromValue<'a> for TextExtendSelection {
from_value(value: &Value) -> Self6579     unsafe fn from_value(value: &Value) -> Self {
6580         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
6581     }
6582 }
6583 
6584 #[cfg(any(feature = "v3_16", feature = "dox"))]
6585 impl SetValue for TextExtendSelection {
set_value(value: &mut Value, this: &Self)6586     unsafe fn set_value(value: &mut Value, this: &Self) {
6587         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
6588     }
6589 }
6590 
6591 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6592 pub enum TextViewLayer {
6593     Below,
6594     Above,
6595     BelowText,
6596     AboveText,
6597     #[doc(hidden)]
6598     __Unknown(i32),
6599 }
6600 
6601 impl fmt::Display for TextViewLayer {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result6602     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6603         write!(
6604             f,
6605             "TextViewLayer::{}",
6606             match *self {
6607                 TextViewLayer::Below => "Below",
6608                 TextViewLayer::Above => "Above",
6609                 TextViewLayer::BelowText => "BelowText",
6610                 TextViewLayer::AboveText => "AboveText",
6611                 _ => "Unknown",
6612             }
6613         )
6614     }
6615 }
6616 
6617 #[doc(hidden)]
6618 impl ToGlib for TextViewLayer {
6619     type GlibType = gtk_sys::GtkTextViewLayer;
6620 
to_glib(&self) -> gtk_sys::GtkTextViewLayer6621     fn to_glib(&self) -> gtk_sys::GtkTextViewLayer {
6622         match *self {
6623             TextViewLayer::Below => gtk_sys::GTK_TEXT_VIEW_LAYER_BELOW,
6624             TextViewLayer::Above => gtk_sys::GTK_TEXT_VIEW_LAYER_ABOVE,
6625             TextViewLayer::BelowText => gtk_sys::GTK_TEXT_VIEW_LAYER_BELOW_TEXT,
6626             TextViewLayer::AboveText => gtk_sys::GTK_TEXT_VIEW_LAYER_ABOVE_TEXT,
6627             TextViewLayer::__Unknown(value) => value,
6628         }
6629     }
6630 }
6631 
6632 #[doc(hidden)]
6633 impl FromGlib<gtk_sys::GtkTextViewLayer> for TextViewLayer {
from_glib(value: gtk_sys::GtkTextViewLayer) -> Self6634     fn from_glib(value: gtk_sys::GtkTextViewLayer) -> Self {
6635         skip_assert_initialized!();
6636         match value {
6637             0 => TextViewLayer::Below,
6638             1 => TextViewLayer::Above,
6639             2 => TextViewLayer::BelowText,
6640             3 => TextViewLayer::AboveText,
6641             value => TextViewLayer::__Unknown(value),
6642         }
6643     }
6644 }
6645 
6646 impl StaticType for TextViewLayer {
static_type() -> Type6647     fn static_type() -> Type {
6648         unsafe { from_glib(gtk_sys::gtk_text_view_layer_get_type()) }
6649     }
6650 }
6651 
6652 impl<'a> FromValueOptional<'a> for TextViewLayer {
from_value_optional(value: &Value) -> Option<Self>6653     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
6654         Some(FromValue::from_value(value))
6655     }
6656 }
6657 
6658 impl<'a> FromValue<'a> for TextViewLayer {
from_value(value: &Value) -> Self6659     unsafe fn from_value(value: &Value) -> Self {
6660         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
6661     }
6662 }
6663 
6664 impl SetValue for TextViewLayer {
set_value(value: &mut Value, this: &Self)6665     unsafe fn set_value(value: &mut Value, this: &Self) {
6666         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
6667     }
6668 }
6669 
6670 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6671 pub enum TextWindowType {
6672     Private,
6673     Widget,
6674     Text,
6675     Left,
6676     Right,
6677     Top,
6678     Bottom,
6679     #[doc(hidden)]
6680     __Unknown(i32),
6681 }
6682 
6683 impl fmt::Display for TextWindowType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result6684     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6685         write!(
6686             f,
6687             "TextWindowType::{}",
6688             match *self {
6689                 TextWindowType::Private => "Private",
6690                 TextWindowType::Widget => "Widget",
6691                 TextWindowType::Text => "Text",
6692                 TextWindowType::Left => "Left",
6693                 TextWindowType::Right => "Right",
6694                 TextWindowType::Top => "Top",
6695                 TextWindowType::Bottom => "Bottom",
6696                 _ => "Unknown",
6697             }
6698         )
6699     }
6700 }
6701 
6702 #[doc(hidden)]
6703 impl ToGlib for TextWindowType {
6704     type GlibType = gtk_sys::GtkTextWindowType;
6705 
to_glib(&self) -> gtk_sys::GtkTextWindowType6706     fn to_glib(&self) -> gtk_sys::GtkTextWindowType {
6707         match *self {
6708             TextWindowType::Private => gtk_sys::GTK_TEXT_WINDOW_PRIVATE,
6709             TextWindowType::Widget => gtk_sys::GTK_TEXT_WINDOW_WIDGET,
6710             TextWindowType::Text => gtk_sys::GTK_TEXT_WINDOW_TEXT,
6711             TextWindowType::Left => gtk_sys::GTK_TEXT_WINDOW_LEFT,
6712             TextWindowType::Right => gtk_sys::GTK_TEXT_WINDOW_RIGHT,
6713             TextWindowType::Top => gtk_sys::GTK_TEXT_WINDOW_TOP,
6714             TextWindowType::Bottom => gtk_sys::GTK_TEXT_WINDOW_BOTTOM,
6715             TextWindowType::__Unknown(value) => value,
6716         }
6717     }
6718 }
6719 
6720 #[doc(hidden)]
6721 impl FromGlib<gtk_sys::GtkTextWindowType> for TextWindowType {
from_glib(value: gtk_sys::GtkTextWindowType) -> Self6722     fn from_glib(value: gtk_sys::GtkTextWindowType) -> Self {
6723         skip_assert_initialized!();
6724         match value {
6725             0 => TextWindowType::Private,
6726             1 => TextWindowType::Widget,
6727             2 => TextWindowType::Text,
6728             3 => TextWindowType::Left,
6729             4 => TextWindowType::Right,
6730             5 => TextWindowType::Top,
6731             6 => TextWindowType::Bottom,
6732             value => TextWindowType::__Unknown(value),
6733         }
6734     }
6735 }
6736 
6737 impl StaticType for TextWindowType {
static_type() -> Type6738     fn static_type() -> Type {
6739         unsafe { from_glib(gtk_sys::gtk_text_window_type_get_type()) }
6740     }
6741 }
6742 
6743 impl<'a> FromValueOptional<'a> for TextWindowType {
from_value_optional(value: &Value) -> Option<Self>6744     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
6745         Some(FromValue::from_value(value))
6746     }
6747 }
6748 
6749 impl<'a> FromValue<'a> for TextWindowType {
from_value(value: &Value) -> Self6750     unsafe fn from_value(value: &Value) -> Self {
6751         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
6752     }
6753 }
6754 
6755 impl SetValue for TextWindowType {
set_value(value: &mut Value, this: &Self)6756     unsafe fn set_value(value: &mut Value, this: &Self) {
6757         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
6758     }
6759 }
6760 
6761 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6762 pub enum ToolbarStyle {
6763     Icons,
6764     Text,
6765     Both,
6766     BothHoriz,
6767     #[doc(hidden)]
6768     __Unknown(i32),
6769 }
6770 
6771 impl fmt::Display for ToolbarStyle {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result6772     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6773         write!(
6774             f,
6775             "ToolbarStyle::{}",
6776             match *self {
6777                 ToolbarStyle::Icons => "Icons",
6778                 ToolbarStyle::Text => "Text",
6779                 ToolbarStyle::Both => "Both",
6780                 ToolbarStyle::BothHoriz => "BothHoriz",
6781                 _ => "Unknown",
6782             }
6783         )
6784     }
6785 }
6786 
6787 #[doc(hidden)]
6788 impl ToGlib for ToolbarStyle {
6789     type GlibType = gtk_sys::GtkToolbarStyle;
6790 
to_glib(&self) -> gtk_sys::GtkToolbarStyle6791     fn to_glib(&self) -> gtk_sys::GtkToolbarStyle {
6792         match *self {
6793             ToolbarStyle::Icons => gtk_sys::GTK_TOOLBAR_ICONS,
6794             ToolbarStyle::Text => gtk_sys::GTK_TOOLBAR_TEXT,
6795             ToolbarStyle::Both => gtk_sys::GTK_TOOLBAR_BOTH,
6796             ToolbarStyle::BothHoriz => gtk_sys::GTK_TOOLBAR_BOTH_HORIZ,
6797             ToolbarStyle::__Unknown(value) => value,
6798         }
6799     }
6800 }
6801 
6802 #[doc(hidden)]
6803 impl FromGlib<gtk_sys::GtkToolbarStyle> for ToolbarStyle {
from_glib(value: gtk_sys::GtkToolbarStyle) -> Self6804     fn from_glib(value: gtk_sys::GtkToolbarStyle) -> Self {
6805         skip_assert_initialized!();
6806         match value {
6807             0 => ToolbarStyle::Icons,
6808             1 => ToolbarStyle::Text,
6809             2 => ToolbarStyle::Both,
6810             3 => ToolbarStyle::BothHoriz,
6811             value => ToolbarStyle::__Unknown(value),
6812         }
6813     }
6814 }
6815 
6816 impl StaticType for ToolbarStyle {
static_type() -> Type6817     fn static_type() -> Type {
6818         unsafe { from_glib(gtk_sys::gtk_toolbar_style_get_type()) }
6819     }
6820 }
6821 
6822 impl<'a> FromValueOptional<'a> for ToolbarStyle {
from_value_optional(value: &Value) -> Option<Self>6823     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
6824         Some(FromValue::from_value(value))
6825     }
6826 }
6827 
6828 impl<'a> FromValue<'a> for ToolbarStyle {
from_value(value: &Value) -> Self6829     unsafe fn from_value(value: &Value) -> Self {
6830         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
6831     }
6832 }
6833 
6834 impl SetValue for ToolbarStyle {
set_value(value: &mut Value, this: &Self)6835     unsafe fn set_value(value: &mut Value, this: &Self) {
6836         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
6837     }
6838 }
6839 
6840 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6841 pub enum TreeViewColumnSizing {
6842     GrowOnly,
6843     Autosize,
6844     Fixed,
6845     #[doc(hidden)]
6846     __Unknown(i32),
6847 }
6848 
6849 impl fmt::Display for TreeViewColumnSizing {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result6850     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6851         write!(
6852             f,
6853             "TreeViewColumnSizing::{}",
6854             match *self {
6855                 TreeViewColumnSizing::GrowOnly => "GrowOnly",
6856                 TreeViewColumnSizing::Autosize => "Autosize",
6857                 TreeViewColumnSizing::Fixed => "Fixed",
6858                 _ => "Unknown",
6859             }
6860         )
6861     }
6862 }
6863 
6864 #[doc(hidden)]
6865 impl ToGlib for TreeViewColumnSizing {
6866     type GlibType = gtk_sys::GtkTreeViewColumnSizing;
6867 
to_glib(&self) -> gtk_sys::GtkTreeViewColumnSizing6868     fn to_glib(&self) -> gtk_sys::GtkTreeViewColumnSizing {
6869         match *self {
6870             TreeViewColumnSizing::GrowOnly => gtk_sys::GTK_TREE_VIEW_COLUMN_GROW_ONLY,
6871             TreeViewColumnSizing::Autosize => gtk_sys::GTK_TREE_VIEW_COLUMN_AUTOSIZE,
6872             TreeViewColumnSizing::Fixed => gtk_sys::GTK_TREE_VIEW_COLUMN_FIXED,
6873             TreeViewColumnSizing::__Unknown(value) => value,
6874         }
6875     }
6876 }
6877 
6878 #[doc(hidden)]
6879 impl FromGlib<gtk_sys::GtkTreeViewColumnSizing> for TreeViewColumnSizing {
from_glib(value: gtk_sys::GtkTreeViewColumnSizing) -> Self6880     fn from_glib(value: gtk_sys::GtkTreeViewColumnSizing) -> Self {
6881         skip_assert_initialized!();
6882         match value {
6883             0 => TreeViewColumnSizing::GrowOnly,
6884             1 => TreeViewColumnSizing::Autosize,
6885             2 => TreeViewColumnSizing::Fixed,
6886             value => TreeViewColumnSizing::__Unknown(value),
6887         }
6888     }
6889 }
6890 
6891 impl StaticType for TreeViewColumnSizing {
static_type() -> Type6892     fn static_type() -> Type {
6893         unsafe { from_glib(gtk_sys::gtk_tree_view_column_sizing_get_type()) }
6894     }
6895 }
6896 
6897 impl<'a> FromValueOptional<'a> for TreeViewColumnSizing {
from_value_optional(value: &Value) -> Option<Self>6898     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
6899         Some(FromValue::from_value(value))
6900     }
6901 }
6902 
6903 impl<'a> FromValue<'a> for TreeViewColumnSizing {
from_value(value: &Value) -> Self6904     unsafe fn from_value(value: &Value) -> Self {
6905         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
6906     }
6907 }
6908 
6909 impl SetValue for TreeViewColumnSizing {
set_value(value: &mut Value, this: &Self)6910     unsafe fn set_value(value: &mut Value, this: &Self) {
6911         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
6912     }
6913 }
6914 
6915 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6916 pub enum TreeViewDropPosition {
6917     Before,
6918     After,
6919     IntoOrBefore,
6920     IntoOrAfter,
6921     #[doc(hidden)]
6922     __Unknown(i32),
6923 }
6924 
6925 impl fmt::Display for TreeViewDropPosition {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result6926     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
6927         write!(
6928             f,
6929             "TreeViewDropPosition::{}",
6930             match *self {
6931                 TreeViewDropPosition::Before => "Before",
6932                 TreeViewDropPosition::After => "After",
6933                 TreeViewDropPosition::IntoOrBefore => "IntoOrBefore",
6934                 TreeViewDropPosition::IntoOrAfter => "IntoOrAfter",
6935                 _ => "Unknown",
6936             }
6937         )
6938     }
6939 }
6940 
6941 #[doc(hidden)]
6942 impl ToGlib for TreeViewDropPosition {
6943     type GlibType = gtk_sys::GtkTreeViewDropPosition;
6944 
to_glib(&self) -> gtk_sys::GtkTreeViewDropPosition6945     fn to_glib(&self) -> gtk_sys::GtkTreeViewDropPosition {
6946         match *self {
6947             TreeViewDropPosition::Before => gtk_sys::GTK_TREE_VIEW_DROP_BEFORE,
6948             TreeViewDropPosition::After => gtk_sys::GTK_TREE_VIEW_DROP_AFTER,
6949             TreeViewDropPosition::IntoOrBefore => gtk_sys::GTK_TREE_VIEW_DROP_INTO_OR_BEFORE,
6950             TreeViewDropPosition::IntoOrAfter => gtk_sys::GTK_TREE_VIEW_DROP_INTO_OR_AFTER,
6951             TreeViewDropPosition::__Unknown(value) => value,
6952         }
6953     }
6954 }
6955 
6956 #[doc(hidden)]
6957 impl FromGlib<gtk_sys::GtkTreeViewDropPosition> for TreeViewDropPosition {
from_glib(value: gtk_sys::GtkTreeViewDropPosition) -> Self6958     fn from_glib(value: gtk_sys::GtkTreeViewDropPosition) -> Self {
6959         skip_assert_initialized!();
6960         match value {
6961             0 => TreeViewDropPosition::Before,
6962             1 => TreeViewDropPosition::After,
6963             2 => TreeViewDropPosition::IntoOrBefore,
6964             3 => TreeViewDropPosition::IntoOrAfter,
6965             value => TreeViewDropPosition::__Unknown(value),
6966         }
6967     }
6968 }
6969 
6970 impl StaticType for TreeViewDropPosition {
static_type() -> Type6971     fn static_type() -> Type {
6972         unsafe { from_glib(gtk_sys::gtk_tree_view_drop_position_get_type()) }
6973     }
6974 }
6975 
6976 impl<'a> FromValueOptional<'a> for TreeViewDropPosition {
from_value_optional(value: &Value) -> Option<Self>6977     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
6978         Some(FromValue::from_value(value))
6979     }
6980 }
6981 
6982 impl<'a> FromValue<'a> for TreeViewDropPosition {
from_value(value: &Value) -> Self6983     unsafe fn from_value(value: &Value) -> Self {
6984         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
6985     }
6986 }
6987 
6988 impl SetValue for TreeViewDropPosition {
set_value(value: &mut Value, this: &Self)6989     unsafe fn set_value(value: &mut Value, this: &Self) {
6990         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
6991     }
6992 }
6993 
6994 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
6995 pub enum TreeViewGridLines {
6996     None,
6997     Horizontal,
6998     Vertical,
6999     Both,
7000     #[doc(hidden)]
7001     __Unknown(i32),
7002 }
7003 
7004 impl fmt::Display for TreeViewGridLines {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result7005     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7006         write!(
7007             f,
7008             "TreeViewGridLines::{}",
7009             match *self {
7010                 TreeViewGridLines::None => "None",
7011                 TreeViewGridLines::Horizontal => "Horizontal",
7012                 TreeViewGridLines::Vertical => "Vertical",
7013                 TreeViewGridLines::Both => "Both",
7014                 _ => "Unknown",
7015             }
7016         )
7017     }
7018 }
7019 
7020 #[doc(hidden)]
7021 impl ToGlib for TreeViewGridLines {
7022     type GlibType = gtk_sys::GtkTreeViewGridLines;
7023 
to_glib(&self) -> gtk_sys::GtkTreeViewGridLines7024     fn to_glib(&self) -> gtk_sys::GtkTreeViewGridLines {
7025         match *self {
7026             TreeViewGridLines::None => gtk_sys::GTK_TREE_VIEW_GRID_LINES_NONE,
7027             TreeViewGridLines::Horizontal => gtk_sys::GTK_TREE_VIEW_GRID_LINES_HORIZONTAL,
7028             TreeViewGridLines::Vertical => gtk_sys::GTK_TREE_VIEW_GRID_LINES_VERTICAL,
7029             TreeViewGridLines::Both => gtk_sys::GTK_TREE_VIEW_GRID_LINES_BOTH,
7030             TreeViewGridLines::__Unknown(value) => value,
7031         }
7032     }
7033 }
7034 
7035 #[doc(hidden)]
7036 impl FromGlib<gtk_sys::GtkTreeViewGridLines> for TreeViewGridLines {
from_glib(value: gtk_sys::GtkTreeViewGridLines) -> Self7037     fn from_glib(value: gtk_sys::GtkTreeViewGridLines) -> Self {
7038         skip_assert_initialized!();
7039         match value {
7040             0 => TreeViewGridLines::None,
7041             1 => TreeViewGridLines::Horizontal,
7042             2 => TreeViewGridLines::Vertical,
7043             3 => TreeViewGridLines::Both,
7044             value => TreeViewGridLines::__Unknown(value),
7045         }
7046     }
7047 }
7048 
7049 impl StaticType for TreeViewGridLines {
static_type() -> Type7050     fn static_type() -> Type {
7051         unsafe { from_glib(gtk_sys::gtk_tree_view_grid_lines_get_type()) }
7052     }
7053 }
7054 
7055 impl<'a> FromValueOptional<'a> for TreeViewGridLines {
from_value_optional(value: &Value) -> Option<Self>7056     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
7057         Some(FromValue::from_value(value))
7058     }
7059 }
7060 
7061 impl<'a> FromValue<'a> for TreeViewGridLines {
from_value(value: &Value) -> Self7062     unsafe fn from_value(value: &Value) -> Self {
7063         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
7064     }
7065 }
7066 
7067 impl SetValue for TreeViewGridLines {
set_value(value: &mut Value, this: &Self)7068     unsafe fn set_value(value: &mut Value, this: &Self) {
7069         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
7070     }
7071 }
7072 
7073 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
7074 pub enum Unit {
7075     None,
7076     Points,
7077     Inch,
7078     Mm,
7079     #[doc(hidden)]
7080     __Unknown(i32),
7081 }
7082 
7083 impl fmt::Display for Unit {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result7084     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7085         write!(
7086             f,
7087             "Unit::{}",
7088             match *self {
7089                 Unit::None => "None",
7090                 Unit::Points => "Points",
7091                 Unit::Inch => "Inch",
7092                 Unit::Mm => "Mm",
7093                 _ => "Unknown",
7094             }
7095         )
7096     }
7097 }
7098 
7099 #[doc(hidden)]
7100 impl ToGlib for Unit {
7101     type GlibType = gtk_sys::GtkUnit;
7102 
to_glib(&self) -> gtk_sys::GtkUnit7103     fn to_glib(&self) -> gtk_sys::GtkUnit {
7104         match *self {
7105             Unit::None => gtk_sys::GTK_UNIT_NONE,
7106             Unit::Points => gtk_sys::GTK_UNIT_POINTS,
7107             Unit::Inch => gtk_sys::GTK_UNIT_INCH,
7108             Unit::Mm => gtk_sys::GTK_UNIT_MM,
7109             Unit::__Unknown(value) => value,
7110         }
7111     }
7112 }
7113 
7114 #[doc(hidden)]
7115 impl FromGlib<gtk_sys::GtkUnit> for Unit {
from_glib(value: gtk_sys::GtkUnit) -> Self7116     fn from_glib(value: gtk_sys::GtkUnit) -> Self {
7117         skip_assert_initialized!();
7118         match value {
7119             0 => Unit::None,
7120             1 => Unit::Points,
7121             2 => Unit::Inch,
7122             3 => Unit::Mm,
7123             value => Unit::__Unknown(value),
7124         }
7125     }
7126 }
7127 
7128 impl StaticType for Unit {
static_type() -> Type7129     fn static_type() -> Type {
7130         unsafe { from_glib(gtk_sys::gtk_unit_get_type()) }
7131     }
7132 }
7133 
7134 impl<'a> FromValueOptional<'a> for Unit {
from_value_optional(value: &Value) -> Option<Self>7135     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
7136         Some(FromValue::from_value(value))
7137     }
7138 }
7139 
7140 impl<'a> FromValue<'a> for Unit {
from_value(value: &Value) -> Self7141     unsafe fn from_value(value: &Value) -> Self {
7142         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
7143     }
7144 }
7145 
7146 impl SetValue for Unit {
set_value(value: &mut Value, this: &Self)7147     unsafe fn set_value(value: &mut Value, this: &Self) {
7148         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
7149     }
7150 }
7151 
7152 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
7153 pub enum WidgetHelpType {
7154     Tooltip,
7155     WhatsThis,
7156     #[doc(hidden)]
7157     __Unknown(i32),
7158 }
7159 
7160 impl fmt::Display for WidgetHelpType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result7161     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7162         write!(
7163             f,
7164             "WidgetHelpType::{}",
7165             match *self {
7166                 WidgetHelpType::Tooltip => "Tooltip",
7167                 WidgetHelpType::WhatsThis => "WhatsThis",
7168                 _ => "Unknown",
7169             }
7170         )
7171     }
7172 }
7173 
7174 #[doc(hidden)]
7175 impl ToGlib for WidgetHelpType {
7176     type GlibType = gtk_sys::GtkWidgetHelpType;
7177 
to_glib(&self) -> gtk_sys::GtkWidgetHelpType7178     fn to_glib(&self) -> gtk_sys::GtkWidgetHelpType {
7179         match *self {
7180             WidgetHelpType::Tooltip => gtk_sys::GTK_WIDGET_HELP_TOOLTIP,
7181             WidgetHelpType::WhatsThis => gtk_sys::GTK_WIDGET_HELP_WHATS_THIS,
7182             WidgetHelpType::__Unknown(value) => value,
7183         }
7184     }
7185 }
7186 
7187 #[doc(hidden)]
7188 impl FromGlib<gtk_sys::GtkWidgetHelpType> for WidgetHelpType {
from_glib(value: gtk_sys::GtkWidgetHelpType) -> Self7189     fn from_glib(value: gtk_sys::GtkWidgetHelpType) -> Self {
7190         skip_assert_initialized!();
7191         match value {
7192             0 => WidgetHelpType::Tooltip,
7193             1 => WidgetHelpType::WhatsThis,
7194             value => WidgetHelpType::__Unknown(value),
7195         }
7196     }
7197 }
7198 
7199 impl StaticType for WidgetHelpType {
static_type() -> Type7200     fn static_type() -> Type {
7201         unsafe { from_glib(gtk_sys::gtk_widget_help_type_get_type()) }
7202     }
7203 }
7204 
7205 impl<'a> FromValueOptional<'a> for WidgetHelpType {
from_value_optional(value: &Value) -> Option<Self>7206     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
7207         Some(FromValue::from_value(value))
7208     }
7209 }
7210 
7211 impl<'a> FromValue<'a> for WidgetHelpType {
from_value(value: &Value) -> Self7212     unsafe fn from_value(value: &Value) -> Self {
7213         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
7214     }
7215 }
7216 
7217 impl SetValue for WidgetHelpType {
set_value(value: &mut Value, this: &Self)7218     unsafe fn set_value(value: &mut Value, this: &Self) {
7219         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
7220     }
7221 }
7222 
7223 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
7224 pub enum WindowPosition {
7225     None,
7226     Center,
7227     Mouse,
7228     CenterAlways,
7229     CenterOnParent,
7230     #[doc(hidden)]
7231     __Unknown(i32),
7232 }
7233 
7234 impl fmt::Display for WindowPosition {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result7235     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7236         write!(
7237             f,
7238             "WindowPosition::{}",
7239             match *self {
7240                 WindowPosition::None => "None",
7241                 WindowPosition::Center => "Center",
7242                 WindowPosition::Mouse => "Mouse",
7243                 WindowPosition::CenterAlways => "CenterAlways",
7244                 WindowPosition::CenterOnParent => "CenterOnParent",
7245                 _ => "Unknown",
7246             }
7247         )
7248     }
7249 }
7250 
7251 #[doc(hidden)]
7252 impl ToGlib for WindowPosition {
7253     type GlibType = gtk_sys::GtkWindowPosition;
7254 
to_glib(&self) -> gtk_sys::GtkWindowPosition7255     fn to_glib(&self) -> gtk_sys::GtkWindowPosition {
7256         match *self {
7257             WindowPosition::None => gtk_sys::GTK_WIN_POS_NONE,
7258             WindowPosition::Center => gtk_sys::GTK_WIN_POS_CENTER,
7259             WindowPosition::Mouse => gtk_sys::GTK_WIN_POS_MOUSE,
7260             WindowPosition::CenterAlways => gtk_sys::GTK_WIN_POS_CENTER_ALWAYS,
7261             WindowPosition::CenterOnParent => gtk_sys::GTK_WIN_POS_CENTER_ON_PARENT,
7262             WindowPosition::__Unknown(value) => value,
7263         }
7264     }
7265 }
7266 
7267 #[doc(hidden)]
7268 impl FromGlib<gtk_sys::GtkWindowPosition> for WindowPosition {
from_glib(value: gtk_sys::GtkWindowPosition) -> Self7269     fn from_glib(value: gtk_sys::GtkWindowPosition) -> Self {
7270         skip_assert_initialized!();
7271         match value {
7272             0 => WindowPosition::None,
7273             1 => WindowPosition::Center,
7274             2 => WindowPosition::Mouse,
7275             3 => WindowPosition::CenterAlways,
7276             4 => WindowPosition::CenterOnParent,
7277             value => WindowPosition::__Unknown(value),
7278         }
7279     }
7280 }
7281 
7282 impl StaticType for WindowPosition {
static_type() -> Type7283     fn static_type() -> Type {
7284         unsafe { from_glib(gtk_sys::gtk_window_position_get_type()) }
7285     }
7286 }
7287 
7288 impl<'a> FromValueOptional<'a> for WindowPosition {
from_value_optional(value: &Value) -> Option<Self>7289     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
7290         Some(FromValue::from_value(value))
7291     }
7292 }
7293 
7294 impl<'a> FromValue<'a> for WindowPosition {
from_value(value: &Value) -> Self7295     unsafe fn from_value(value: &Value) -> Self {
7296         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
7297     }
7298 }
7299 
7300 impl SetValue for WindowPosition {
set_value(value: &mut Value, this: &Self)7301     unsafe fn set_value(value: &mut Value, this: &Self) {
7302         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
7303     }
7304 }
7305 
7306 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
7307 pub enum WindowType {
7308     Toplevel,
7309     Popup,
7310     #[doc(hidden)]
7311     __Unknown(i32),
7312 }
7313 
7314 impl fmt::Display for WindowType {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result7315     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7316         write!(
7317             f,
7318             "WindowType::{}",
7319             match *self {
7320                 WindowType::Toplevel => "Toplevel",
7321                 WindowType::Popup => "Popup",
7322                 _ => "Unknown",
7323             }
7324         )
7325     }
7326 }
7327 
7328 #[doc(hidden)]
7329 impl ToGlib for WindowType {
7330     type GlibType = gtk_sys::GtkWindowType;
7331 
to_glib(&self) -> gtk_sys::GtkWindowType7332     fn to_glib(&self) -> gtk_sys::GtkWindowType {
7333         match *self {
7334             WindowType::Toplevel => gtk_sys::GTK_WINDOW_TOPLEVEL,
7335             WindowType::Popup => gtk_sys::GTK_WINDOW_POPUP,
7336             WindowType::__Unknown(value) => value,
7337         }
7338     }
7339 }
7340 
7341 #[doc(hidden)]
7342 impl FromGlib<gtk_sys::GtkWindowType> for WindowType {
from_glib(value: gtk_sys::GtkWindowType) -> Self7343     fn from_glib(value: gtk_sys::GtkWindowType) -> Self {
7344         skip_assert_initialized!();
7345         match value {
7346             0 => WindowType::Toplevel,
7347             1 => WindowType::Popup,
7348             value => WindowType::__Unknown(value),
7349         }
7350     }
7351 }
7352 
7353 impl StaticType for WindowType {
static_type() -> Type7354     fn static_type() -> Type {
7355         unsafe { from_glib(gtk_sys::gtk_window_type_get_type()) }
7356     }
7357 }
7358 
7359 impl<'a> FromValueOptional<'a> for WindowType {
from_value_optional(value: &Value) -> Option<Self>7360     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
7361         Some(FromValue::from_value(value))
7362     }
7363 }
7364 
7365 impl<'a> FromValue<'a> for WindowType {
from_value(value: &Value) -> Self7366     unsafe fn from_value(value: &Value) -> Self {
7367         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
7368     }
7369 }
7370 
7371 impl SetValue for WindowType {
set_value(value: &mut Value, this: &Self)7372     unsafe fn set_value(value: &mut Value, this: &Self) {
7373         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
7374     }
7375 }
7376 
7377 #[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
7378 pub enum WrapMode {
7379     None,
7380     Char,
7381     Word,
7382     WordChar,
7383     #[doc(hidden)]
7384     __Unknown(i32),
7385 }
7386 
7387 impl fmt::Display for WrapMode {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result7388     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
7389         write!(
7390             f,
7391             "WrapMode::{}",
7392             match *self {
7393                 WrapMode::None => "None",
7394                 WrapMode::Char => "Char",
7395                 WrapMode::Word => "Word",
7396                 WrapMode::WordChar => "WordChar",
7397                 _ => "Unknown",
7398             }
7399         )
7400     }
7401 }
7402 
7403 #[doc(hidden)]
7404 impl ToGlib for WrapMode {
7405     type GlibType = gtk_sys::GtkWrapMode;
7406 
to_glib(&self) -> gtk_sys::GtkWrapMode7407     fn to_glib(&self) -> gtk_sys::GtkWrapMode {
7408         match *self {
7409             WrapMode::None => gtk_sys::GTK_WRAP_NONE,
7410             WrapMode::Char => gtk_sys::GTK_WRAP_CHAR,
7411             WrapMode::Word => gtk_sys::GTK_WRAP_WORD,
7412             WrapMode::WordChar => gtk_sys::GTK_WRAP_WORD_CHAR,
7413             WrapMode::__Unknown(value) => value,
7414         }
7415     }
7416 }
7417 
7418 #[doc(hidden)]
7419 impl FromGlib<gtk_sys::GtkWrapMode> for WrapMode {
from_glib(value: gtk_sys::GtkWrapMode) -> Self7420     fn from_glib(value: gtk_sys::GtkWrapMode) -> Self {
7421         skip_assert_initialized!();
7422         match value {
7423             0 => WrapMode::None,
7424             1 => WrapMode::Char,
7425             2 => WrapMode::Word,
7426             3 => WrapMode::WordChar,
7427             value => WrapMode::__Unknown(value),
7428         }
7429     }
7430 }
7431 
7432 impl StaticType for WrapMode {
static_type() -> Type7433     fn static_type() -> Type {
7434         unsafe { from_glib(gtk_sys::gtk_wrap_mode_get_type()) }
7435     }
7436 }
7437 
7438 impl<'a> FromValueOptional<'a> for WrapMode {
from_value_optional(value: &Value) -> Option<Self>7439     unsafe fn from_value_optional(value: &Value) -> Option<Self> {
7440         Some(FromValue::from_value(value))
7441     }
7442 }
7443 
7444 impl<'a> FromValue<'a> for WrapMode {
from_value(value: &Value) -> Self7445     unsafe fn from_value(value: &Value) -> Self {
7446         from_glib(gobject_sys::g_value_get_enum(value.to_glib_none().0))
7447     }
7448 }
7449 
7450 impl SetValue for WrapMode {
set_value(value: &mut Value, this: &Self)7451     unsafe fn set_value(value: &mut Value, this: &Self) {
7452         gobject_sys::g_value_set_enum(value.to_glib_none_mut().0, this.to_glib())
7453     }
7454 }
7455