vte4/auto/
flags.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from
3// from gir-files (https://github.com/gtk-rs/gir-files.git)
4// DO NOT EDIT
5
6use crate::ffi;
7use glib::{bitflags::bitflags, prelude::*, translate::*};
8
9bitflags! {
10    /// An enumeration type for features.
11    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
12    #[doc(alias = "VteFeatureFlags")]
13    pub struct FeatureFlags: u32 {
14        /// whether VTE was built with bidirectional text support
15        #[doc(alias = "VTE_FEATURE_FLAG_BIDI")]
16        const FLAG_BIDI = ffi::VTE_FEATURE_FLAG_BIDI as _;
17        /// whether VTE was built with ICU support
18        #[doc(alias = "VTE_FEATURE_FLAG_ICU")]
19        const FLAG_ICU = ffi::VTE_FEATURE_FLAG_ICU as _;
20        /// whether VTE was built with systemd support
21        #[doc(alias = "VTE_FEATURE_FLAG_SYSTEMD")]
22        const FLAG_SYSTEMD = ffi::VTE_FEATURE_FLAG_SYSTEMD as _;
23        /// whether VTE was built with SIXEL support
24        #[doc(alias = "VTE_FEATURE_FLAG_SIXEL")]
25        const FLAG_SIXEL = ffi::VTE_FEATURE_FLAG_SIXEL as _;
26    }
27}
28
29#[doc(hidden)]
30impl IntoGlib for FeatureFlags {
31    type GlibType = ffi::VteFeatureFlags;
32
33    #[inline]
34    fn into_glib(self) -> ffi::VteFeatureFlags {
35        self.bits()
36    }
37}
38
39#[doc(hidden)]
40impl FromGlib<ffi::VteFeatureFlags> for FeatureFlags {
41    #[inline]
42    unsafe fn from_glib(value: ffi::VteFeatureFlags) -> Self {
43        skip_assert_initialized!();
44        Self::from_bits_truncate(value)
45    }
46}
47
48bitflags! {
49    #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
50    #[doc(alias = "VtePtyFlags")]
51    pub struct PtyFlags: u32 {
52        /// Unused. Deprecated: 0.38
53        #[doc(alias = "VTE_PTY_NO_LASTLOG")]
54        const NO_LASTLOG = ffi::VTE_PTY_NO_LASTLOG as _;
55        /// Unused. Deprecated: 0.38
56        #[doc(alias = "VTE_PTY_NO_UTMP")]
57        const NO_UTMP = ffi::VTE_PTY_NO_UTMP as _;
58        /// Unused. Deprecated: 0.38
59        #[doc(alias = "VTE_PTY_NO_WTMP")]
60        const NO_WTMP = ffi::VTE_PTY_NO_WTMP as _;
61        /// Unused. Deprecated: 0.38
62        #[doc(alias = "VTE_PTY_NO_HELPER")]
63        const NO_HELPER = ffi::VTE_PTY_NO_HELPER as _;
64        /// Unused. Deprecated: 0.38
65        #[doc(alias = "VTE_PTY_NO_FALLBACK")]
66        const NO_FALLBACK = ffi::VTE_PTY_NO_FALLBACK as _;
67        /// Do not start a new session for the child in
68        ///   vte_pty_child_setup(). See man:setsid(2) for more information. Since: 0.58
69        #[doc(alias = "VTE_PTY_NO_SESSION")]
70        const NO_SESSION = ffi::VTE_PTY_NO_SESSION as _;
71        /// Do not set the PTY as the controlling TTY for the child
72        ///   in vte_pty_child_setup(). See man:tty_ioctl(4) for more information. Since: 0.58
73        #[doc(alias = "VTE_PTY_NO_CTTY")]
74        const NO_CTTY = ffi::VTE_PTY_NO_CTTY as _;
75        /// the default flags
76        #[doc(alias = "VTE_PTY_DEFAULT")]
77        const DEFAULT = ffi::VTE_PTY_DEFAULT as _;
78    }
79}
80
81#[doc(hidden)]
82impl IntoGlib for PtyFlags {
83    type GlibType = ffi::VtePtyFlags;
84
85    #[inline]
86    fn into_glib(self) -> ffi::VtePtyFlags {
87        self.bits()
88    }
89}
90
91#[doc(hidden)]
92impl FromGlib<ffi::VtePtyFlags> for PtyFlags {
93    #[inline]
94    unsafe fn from_glib(value: ffi::VtePtyFlags) -> Self {
95        skip_assert_initialized!();
96        Self::from_bits_truncate(value)
97    }
98}
99
100impl StaticType for PtyFlags {
101    #[inline]
102    #[doc(alias = "vte_pty_flags_get_type")]
103    fn static_type() -> glib::Type {
104        unsafe { from_glib(ffi::vte_pty_flags_get_type()) }
105    }
106}
107
108impl glib::HasParamSpec for PtyFlags {
109    type ParamSpec = glib::ParamSpecFlags;
110    type SetValue = Self;
111    type BuilderFn = fn(&str) -> glib::ParamSpecFlagsBuilder<Self>;
112
113    fn param_spec_builder() -> Self::BuilderFn {
114        Self::ParamSpec::builder
115    }
116}
117
118impl glib::value::ValueType for PtyFlags {
119    type Type = Self;
120}
121
122unsafe impl<'a> glib::value::FromValue<'a> for PtyFlags {
123    type Checker = glib::value::GenericValueTypeChecker<Self>;
124
125    #[inline]
126    unsafe fn from_value(value: &'a glib::Value) -> Self {
127        skip_assert_initialized!();
128        from_glib(glib::gobject_ffi::g_value_get_flags(value.to_glib_none().0))
129    }
130}
131
132impl ToValue for PtyFlags {
133    #[inline]
134    fn to_value(&self) -> glib::Value {
135        let mut value = glib::Value::for_value_type::<Self>();
136        unsafe {
137            glib::gobject_ffi::g_value_set_flags(value.to_glib_none_mut().0, self.into_glib());
138        }
139        value
140    }
141
142    #[inline]
143    fn value_type(&self) -> glib::Type {
144        Self::static_type()
145    }
146}
147
148impl From<PtyFlags> for glib::Value {
149    #[inline]
150    fn from(v: PtyFlags) -> Self {
151        skip_assert_initialized!();
152        ToValue::to_value(&v)
153    }
154}