gtk/
enums.rs

1// Take a look at the license at the top of the repository in the LICENSE file.
2
3use crate::IconSize;
4use crate::ResponseType;
5use glib::translate::{from_glib, IntoGlib};
6
7impl IconSize {
8    pub fn unscaled() -> IconSize {
9        skip_assert_initialized!();
10        IconSize::__Unknown(-1)
11    }
12}
13
14impl From<IconSize> for i32 {
15    fn from(val: IconSize) -> i32 {
16        skip_assert_initialized!();
17        val.into_glib() as _
18    }
19}
20
21impl From<i32> for IconSize {
22    fn from(val: i32) -> Self {
23        skip_assert_initialized!();
24        unsafe { from_glib(val as ffi::GtkIconSize) }
25    }
26}
27
28impl From<ResponseType> for i32 {
29    fn from(val: ResponseType) -> i32 {
30        skip_assert_initialized!();
31        val.into_glib() as _
32    }
33}
34
35impl From<i32> for ResponseType {
36    fn from(val: i32) -> Self {
37        skip_assert_initialized!();
38        unsafe { from_glib(val as ffi::GtkResponseType) }
39    }
40}