1// Take a look at the license at the top of the repository in the LICENSE file.
23use crate::{gobject_ffi, translate::*};
45bitflags::bitflags! {
6/// Through the [`ParamFlags`][crate::ParamFlags] flag values, certain aspects of parameters
7 /// can be configured.
8 ///
9 /// See also: `G_PARAM_STATIC_STRINGS`
10#[doc(alias = "GParamFlags")]
11 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
12pub struct ParamFlags: u32 {
13/// the parameter is readable
14#[doc(alias = "G_PARAM_READABLE")]
15const READABLE = gobject_ffi::G_PARAM_READABLE as _;
16/// the parameter is writable
17#[doc(alias = "G_PARAM_WRITABLE")]
18const WRITABLE = gobject_ffi::G_PARAM_WRITABLE as _;
19/// alias for [`READABLE`][Self::READABLE] | [`WRITABLE`][Self::WRITABLE]
20#[doc(alias = "G_PARAM_READWRITE")]
21const READWRITE = gobject_ffi::G_PARAM_READWRITE as _;
22/// the parameter will be set upon object construction.
23 /// See [vfunc`Object`] for more details
24#[doc(alias = "G_PARAM_CONSTRUCT")]
25const CONSTRUCT = gobject_ffi::G_PARAM_CONSTRUCT as _;
26/// the parameter can only be set upon object construction.
27 /// See [vfunc`Object`] for more details
28#[doc(alias = "G_PARAM_CONSTRUCT_ONLY")]
29const CONSTRUCT_ONLY = gobject_ffi::G_PARAM_CONSTRUCT_ONLY as _;
30/// upon parameter conversion (see `g_param_value_convert()`)
31 /// strict validation is not required
32#[doc(alias = "G_PARAM_LAX_VALIDATION")]
33const LAX_VALIDATION = gobject_ffi::G_PARAM_LAX_VALIDATION as _;
34const USER_0 = 256;
35const USER_1 = 512;
36const USER_2 = 1024;
37const USER_3 = 2048;
38const USER_4 = 4096;
39const USER_5 = 8192;
40const USER_6 = 16384;
41const USER_7 = 32768;
42const USER_8 = 65536;
43/// calls to [`ObjectExt::set_property()`][crate::prelude::ObjectExt::set_property()] for this
44 /// property will not automatically result in a "notify" signal being
45 /// emitted: the implementation must call [`ObjectExt::notify()`][crate::prelude::ObjectExt::notify()] themselves
46 /// in case the property actually changes. Since: 2.42.
47#[doc(alias = "G_PARAM_EXPLICIT_NOTIFY")]
48const EXPLICIT_NOTIFY = gobject_ffi::G_PARAM_EXPLICIT_NOTIFY as _;
49/// the parameter is deprecated and will be removed
50 /// in a future version. A warning will be generated if it is used
51 /// while running with G_ENABLE_DIAGNOSTIC=1.
52 /// Since 2.26
53#[doc(alias = "G_PARAM_DEPRECATED")]
54const DEPRECATED = gobject_ffi::G_PARAM_DEPRECATED as _;
55 }
56}
5758impl Defaultfor ParamFlags {
59fn default() -> Self {
60 ParamFlags::READWRITE
61 }
62}
6364#[doc(hidden)]
65impl IntoGlibfor ParamFlags {
66type GlibType = gobject_ffi::GParamFlags;
6768#[inline]
69fn into_glib(self) -> gobject_ffi::GParamFlags {
70self.bits()
71 }
72}
7374#[doc(hidden)]
75impl FromGlib<gobject_ffi::GParamFlags> for ParamFlags {
76#[inline]
77unsafe fn from_glib(value: gobject_ffi::GParamFlags) -> Self {
78Self::from_bits_truncate(value)
79 }
80}