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
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github.com/gtk-rs/gir-files)
// DO NOT EDIT

use glib::translate::*;

/// Specifies the result of applying a `GdkWin32MessageFilterFunc` to a Windows message.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "GdkWin32MessageFilterReturn")]
pub enum Win32MessageFilterReturn {
    /// event not handled, continue processing.
    #[doc(alias = "GDK_WIN32_MESSAGE_FILTER_CONTINUE")]
    Continue,
    /// event handled, terminate processing.
    #[doc(alias = "GDK_WIN32_MESSAGE_FILTER_REMOVE")]
    Remove,
    #[doc(hidden)]
    __Unknown(i32),
}

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

    #[inline]
    fn into_glib(self) -> ffi::GdkWin32MessageFilterReturn {
        match self {
            Self::Continue => ffi::GDK_WIN32_MESSAGE_FILTER_CONTINUE,
            Self::Remove => ffi::GDK_WIN32_MESSAGE_FILTER_REMOVE,
            Self::__Unknown(value) => value,
        }
    }
}

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

        match value {
            ffi::GDK_WIN32_MESSAGE_FILTER_CONTINUE => Self::Continue,
            ffi::GDK_WIN32_MESSAGE_FILTER_REMOVE => Self::Remove,
            value => Self::__Unknown(value),
        }
    }
}