1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from
// from gir-files (https://github.com/gtk-rs/gir-files.git)
// DO NOT EDIT

use crate::ffi;
use glib::{bitflags::bitflags, prelude::*, translate::*};

bitflags! {
    /// An enumeration type for features.
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "VteFeatureFlags")]
    pub struct FeatureFlags: u32 {
        /// whether VTE was built with bidirectional text support
        #[doc(alias = "VTE_FEATURE_FLAG_BIDI")]
        const FLAG_BIDI = ffi::VTE_FEATURE_FLAG_BIDI as _;
        /// whether VTE was built with ICU support
        #[doc(alias = "VTE_FEATURE_FLAG_ICU")]
        const FLAG_ICU = ffi::VTE_FEATURE_FLAG_ICU as _;
        /// whether VTE was built with systemd support
        #[doc(alias = "VTE_FEATURE_FLAG_SYSTEMD")]
        const FLAG_SYSTEMD = ffi::VTE_FEATURE_FLAG_SYSTEMD as _;
        /// whether VTE was built with SIXEL support
        #[doc(alias = "VTE_FEATURE_FLAG_SIXEL")]
        const FLAG_SIXEL = ffi::VTE_FEATURE_FLAG_SIXEL as _;
    }
}

#[doc(hidden)]
impl IntoGlib for FeatureFlags {
    type GlibType = ffi::VteFeatureFlags;

    #[inline]
    fn into_glib(self) -> ffi::VteFeatureFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::VteFeatureFlags> for FeatureFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::VteFeatureFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

bitflags! {
    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
    #[doc(alias = "VtePtyFlags")]
    pub struct PtyFlags: u32 {
        /// Unused. Deprecated: 0.38
        #[doc(alias = "VTE_PTY_NO_LASTLOG")]
        const NO_LASTLOG = ffi::VTE_PTY_NO_LASTLOG as _;
        /// Unused. Deprecated: 0.38
        #[doc(alias = "VTE_PTY_NO_UTMP")]
        const NO_UTMP = ffi::VTE_PTY_NO_UTMP as _;
        /// Unused. Deprecated: 0.38
        #[doc(alias = "VTE_PTY_NO_WTMP")]
        const NO_WTMP = ffi::VTE_PTY_NO_WTMP as _;
        /// Unused. Deprecated: 0.38
        #[doc(alias = "VTE_PTY_NO_HELPER")]
        const NO_HELPER = ffi::VTE_PTY_NO_HELPER as _;
        /// Unused. Deprecated: 0.38
        #[doc(alias = "VTE_PTY_NO_FALLBACK")]
        const NO_FALLBACK = ffi::VTE_PTY_NO_FALLBACK as _;
        /// Do not start a new session for the child in
        ///   vte_pty_child_setup(). See man:setsid(2) for more information. Since: 0.58
        #[doc(alias = "VTE_PTY_NO_SESSION")]
        const NO_SESSION = ffi::VTE_PTY_NO_SESSION as _;
        /// Do not set the PTY as the controlling TTY for the child
        ///   in vte_pty_child_setup(). See man:tty_ioctl(4) for more information. Since: 0.58
        #[doc(alias = "VTE_PTY_NO_CTTY")]
        const NO_CTTY = ffi::VTE_PTY_NO_CTTY as _;
        /// the default flags
        #[doc(alias = "VTE_PTY_DEFAULT")]
        const DEFAULT = ffi::VTE_PTY_DEFAULT as _;
    }
}

#[doc(hidden)]
impl IntoGlib for PtyFlags {
    type GlibType = ffi::VtePtyFlags;

    #[inline]
    fn into_glib(self) -> ffi::VtePtyFlags {
        self.bits()
    }
}

#[doc(hidden)]
impl FromGlib<ffi::VtePtyFlags> for PtyFlags {
    #[inline]
    unsafe fn from_glib(value: ffi::VtePtyFlags) -> Self {
        skip_assert_initialized!();
        Self::from_bits_truncate(value)
    }
}

impl StaticType for PtyFlags {
    #[inline]
    #[doc(alias = "vte_pty_flags_get_type")]
    fn static_type() -> glib::Type {
        unsafe { from_glib(ffi::vte_pty_flags_get_type()) }
    }
}

impl glib::HasParamSpec for PtyFlags {
    type ParamSpec = glib::ParamSpecFlags;
    type SetValue = Self;
    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;

    fn param_spec_builder() -> Self::BuilderFn {
        Self::ParamSpec::builder
    }
}

impl glib::value::ValueType for PtyFlags {
    type Type = Self;
}

unsafe impl<'a> glib::value::FromValue<'a> for PtyFlags {
    type Checker = glib::value::GenericValueTypeChecker<Self>;

    #[inline]
    unsafe fn from_value(value: &'a glib::Value) -> Self {
        skip_assert_initialized!();
        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
    }
}

impl ToValue for PtyFlags {
    #[inline]
    fn to_value(&self) -> glib::Value {
        let mut value = glib::Value::for_value_type::<Self>();
        unsafe {
            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
        }
        value
    }

    #[inline]
    fn value_type(&self) -> glib::Type {
        Self::static_type()
    }
}

impl From<PtyFlags> for glib::Value {
    #[inline]
    fn from(v: PtyFlags) -> Self {
        skip_assert_initialized!();
        ToValue::to_value(&v)
    }
}