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
use glib::translate::*;
use glib::GString;
use std::fmt;
#[doc(alias = "AtkAttribute")]
pub struct Attribute {
pub name: GString,
pub value: GString,
}
impl fmt::Display for Attribute {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("Attribute")
.field("name", &self.name)
.field("value", &self.value)
.finish()
}
}
#[doc(hidden)]
impl FromGlib<ffi::AtkAttribute> for Attribute {
unsafe fn from_glib(value: ffi::AtkAttribute) -> Self {
skip_assert_initialized!();
Self {
name: from_glib_full(value.name),
value: from_glib_full(value.value),
}
}
}
#[doc(hidden)]
impl IntoGlib for Attribute {
type GlibType = ffi::AtkAttribute;
fn into_glib(self) -> ffi::AtkAttribute {
ffi::AtkAttribute {
name: self.name.to_glib_none().0,
value: self.value.to_glib_none().0,
}
}
}