1 | // Take a look at the license at the top of the repository in the LICENSE file. |
2 | |
3 | use crate::translate::*; |
4 | |
5 | bitflags::bitflags! { |
6 | #[doc (alias = "GParamFlags" )] |
7 | #[derive (Clone, Copy, Debug, PartialEq, Eq, Hash)] |
8 | pub struct ParamFlags: u32 { |
9 | #[doc(alias = "G_PARAM_READABLE" )] |
10 | const READABLE = gobject_ffi::G_PARAM_READABLE as _; |
11 | #[doc(alias = "G_PARAM_WRITABLE" )] |
12 | const WRITABLE = gobject_ffi::G_PARAM_WRITABLE as _; |
13 | #[doc(alias = "G_PARAM_READWRITE" )] |
14 | const READWRITE = gobject_ffi::G_PARAM_READWRITE as _; |
15 | #[doc(alias = "G_PARAM_CONSTRUCT" )] |
16 | const CONSTRUCT = gobject_ffi::G_PARAM_CONSTRUCT as _; |
17 | #[doc(alias = "G_PARAM_CONSTRUCT_ONLY" )] |
18 | const CONSTRUCT_ONLY = gobject_ffi::G_PARAM_CONSTRUCT_ONLY as _; |
19 | #[doc(alias = "G_PARAM_LAX_VALIDATION" )] |
20 | const LAX_VALIDATION = gobject_ffi::G_PARAM_LAX_VALIDATION as _; |
21 | const USER_0 = 256; |
22 | const USER_1 = 512; |
23 | const USER_2 = 1024; |
24 | const USER_3 = 2048; |
25 | const USER_4 = 4096; |
26 | const USER_5 = 8192; |
27 | const USER_6 = 16384; |
28 | const USER_7 = 32768; |
29 | const USER_8 = 65536; |
30 | #[doc(alias = "G_PARAM_EXPLICIT_NOTIFY" )] |
31 | const EXPLICIT_NOTIFY = gobject_ffi::G_PARAM_EXPLICIT_NOTIFY as _; |
32 | #[doc(alias = "G_PARAM_DEPRECATED" )] |
33 | const DEPRECATED = gobject_ffi::G_PARAM_DEPRECATED as _; |
34 | } |
35 | } |
36 | |
37 | impl Default for ParamFlags { |
38 | fn default() -> Self { |
39 | ParamFlags::READWRITE |
40 | } |
41 | } |
42 | |
43 | #[doc (hidden)] |
44 | impl IntoGlib for ParamFlags { |
45 | type GlibType = gobject_ffi::GParamFlags; |
46 | |
47 | #[inline ] |
48 | fn into_glib(self) -> gobject_ffi::GParamFlags { |
49 | self.bits() |
50 | } |
51 | } |
52 | |
53 | #[doc (hidden)] |
54 | impl FromGlib<gobject_ffi::GParamFlags> for ParamFlags { |
55 | #[inline ] |
56 | unsafe fn from_glib(value: gobject_ffi::GParamFlags) -> Self { |
57 | Self::from_bits_truncate(bits:value) |
58 | } |
59 | } |
60 | |