glib_win32/auto/
enums.rs

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
5use crate::ffi;
6use glib::translate::*;
7
8/// Type of Windows edition to check for at run-time.
9#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
10#[non_exhaustive]
11#[doc(alias = "GWin32OSType")]
12pub enum OSType {
13    /// The running system can be a workstation or a server edition of
14    ///  Windows.  The type of the running system is therefore not checked.
15    #[doc(alias = "G_WIN32_OS_ANY")]
16    Any,
17    /// The running system is a workstation edition of Windows,
18    ///  such as Windows 7 Professional.
19    #[doc(alias = "G_WIN32_OS_WORKSTATION")]
20    Workstation,
21    /// The running system is a server edition of Windows, such as
22    ///  Windows Server 2008 R2.
23    #[doc(alias = "G_WIN32_OS_SERVER")]
24    Server,
25    #[doc(hidden)]
26    __Unknown(i32),
27}
28
29#[doc(hidden)]
30impl IntoGlib for OSType {
31    type GlibType = ffi::GWin32OSType;
32
33    #[inline]
34    fn into_glib(self) -> ffi::GWin32OSType {
35        match self {
36            Self::Any => ffi::G_WIN32_OS_ANY,
37            Self::Workstation => ffi::G_WIN32_OS_WORKSTATION,
38            Self::Server => ffi::G_WIN32_OS_SERVER,
39            Self::__Unknown(value) => value,
40        }
41    }
42}
43
44#[doc(hidden)]
45impl FromGlib<ffi::GWin32OSType> for OSType {
46    #[inline]
47    unsafe fn from_glib(value: ffi::GWin32OSType) -> Self {
48        match value {
49            ffi::G_WIN32_OS_ANY => Self::Any,
50            ffi::G_WIN32_OS_WORKSTATION => Self::Workstation,
51            ffi::G_WIN32_OS_SERVER => Self::Server,
52            value => Self::__Unknown(value),
53        }
54    }
55}