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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
use glib::translate::*;
use std::fmt;
glib::wrapper! {
#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct SettingsSchemaKey(Shared<ffi::GSettingsSchemaKey>);
match fn {
ref => |ptr| ffi::g_settings_schema_key_ref(ptr),
unref => |ptr| ffi::g_settings_schema_key_unref(ptr),
type_ => || ffi::g_settings_schema_key_get_type(),
}
}
impl SettingsSchemaKey {
#[doc(alias = "g_settings_schema_key_get_default_value")]
#[doc(alias = "get_default_value")]
pub fn default_value(&self) -> glib::Variant {
unsafe {
from_glib_full(ffi::g_settings_schema_key_get_default_value(
self.to_glib_none().0,
))
}
}
#[doc(alias = "g_settings_schema_key_get_description")]
#[doc(alias = "get_description")]
pub fn description(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::g_settings_schema_key_get_description(
self.to_glib_none().0,
))
}
}
#[doc(alias = "g_settings_schema_key_get_name")]
#[doc(alias = "get_name")]
pub fn name(&self) -> glib::GString {
unsafe { from_glib_none(ffi::g_settings_schema_key_get_name(self.to_glib_none().0)) }
}
#[doc(alias = "g_settings_schema_key_get_range")]
#[doc(alias = "get_range")]
pub fn range(&self) -> glib::Variant {
unsafe { from_glib_full(ffi::g_settings_schema_key_get_range(self.to_glib_none().0)) }
}
#[doc(alias = "g_settings_schema_key_get_summary")]
#[doc(alias = "get_summary")]
pub fn summary(&self) -> Option<glib::GString> {
unsafe {
from_glib_none(ffi::g_settings_schema_key_get_summary(
self.to_glib_none().0,
))
}
}
#[doc(alias = "g_settings_schema_key_get_value_type")]
#[doc(alias = "get_value_type")]
pub fn value_type(&self) -> glib::VariantType {
unsafe {
from_glib_none(ffi::g_settings_schema_key_get_value_type(
self.to_glib_none().0,
))
}
}
#[doc(alias = "g_settings_schema_key_range_check")]
pub fn range_check(&self, value: &glib::Variant) -> bool {
unsafe {
from_glib(ffi::g_settings_schema_key_range_check(
self.to_glib_none().0,
value.to_glib_none().0,
))
}
}
}
impl fmt::Display for SettingsSchemaKey {
#[inline]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(&self.name())
}
}