gdk4_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/// Specifies the result of applying a `GdkWin32MessageFilterFunc` to a Windows message.
9#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
10#[non_exhaustive]
11#[doc(alias = "GdkWin32MessageFilterReturn")]
12pub enum Win32MessageFilterReturn {
13    /// event not handled, continue processing.
14    #[doc(alias = "GDK_WIN32_MESSAGE_FILTER_CONTINUE")]
15    Continue,
16    /// event handled, terminate processing.
17    #[doc(alias = "GDK_WIN32_MESSAGE_FILTER_REMOVE")]
18    Remove,
19    #[doc(hidden)]
20    __Unknown(i32),
21}
22
23#[doc(hidden)]
24impl IntoGlib for Win32MessageFilterReturn {
25    type GlibType = ffi::GdkWin32MessageFilterReturn;
26
27    #[inline]
28    fn into_glib(self) -> ffi::GdkWin32MessageFilterReturn {
29        match self {
30            Self::Continue => ffi::GDK_WIN32_MESSAGE_FILTER_CONTINUE,
31            Self::Remove => ffi::GDK_WIN32_MESSAGE_FILTER_REMOVE,
32            Self::__Unknown(value) => value,
33        }
34    }
35}
36
37#[doc(hidden)]
38impl FromGlib<ffi::GdkWin32MessageFilterReturn> for Win32MessageFilterReturn {
39    #[inline]
40    unsafe fn from_glib(value: ffi::GdkWin32MessageFilterReturn) -> Self {
41        skip_assert_initialized!();
42
43        match value {
44            ffi::GDK_WIN32_MESSAGE_FILTER_CONTINUE => Self::Continue,
45            ffi::GDK_WIN32_MESSAGE_FILTER_REMOVE => Self::Remove,
46            value => Self::__Unknown(value),
47        }
48    }
49}