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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
use glib::object::Cast;
use glib::object::IsA;
use glib::translate::*;
use glib::StaticType;
use glib::ToValue;
use std::fmt;
glib::wrapper! {
#[doc(alias = "GtkSocketAccessible")]
pub struct SocketAccessible(Object<ffi::GtkSocketAccessible, ffi::GtkSocketAccessibleClass>) @extends atk::Object;
match fn {
type_ => || ffi::gtk_socket_accessible_get_type(),
}
}
impl SocketAccessible {
pub const NONE: Option<&'static SocketAccessible> = None;
pub fn builder() -> SocketAccessibleBuilder {
SocketAccessibleBuilder::default()
}
}
#[derive(Clone, Default)]
#[must_use = "The builder must be built to be used"]
pub struct SocketAccessibleBuilder {
accessible_description: Option<String>,
accessible_name: Option<String>,
accessible_parent: Option<atk::Object>,
accessible_role: Option<atk::Role>,
accessible_table_caption: Option<String>,
accessible_table_caption_object: Option<atk::Object>,
accessible_table_column_description: Option<String>,
accessible_table_column_header: Option<atk::Object>,
accessible_table_row_description: Option<String>,
accessible_table_row_header: Option<atk::Object>,
accessible_table_summary: Option<atk::Object>,
accessible_value: Option<f64>,
}
impl SocketAccessibleBuilder {
pub fn new() -> Self {
Self::default()
}
#[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
pub fn build(self) -> SocketAccessible {
let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
if let Some(ref accessible_description) = self.accessible_description {
properties.push(("accessible-description", accessible_description));
}
if let Some(ref accessible_name) = self.accessible_name {
properties.push(("accessible-name", accessible_name));
}
if let Some(ref accessible_parent) = self.accessible_parent {
properties.push(("accessible-parent", accessible_parent));
}
if let Some(ref accessible_role) = self.accessible_role {
properties.push(("accessible-role", accessible_role));
}
if let Some(ref accessible_table_caption) = self.accessible_table_caption {
properties.push(("accessible-table-caption", accessible_table_caption));
}
if let Some(ref accessible_table_caption_object) = self.accessible_table_caption_object {
properties.push((
"accessible-table-caption-object",
accessible_table_caption_object,
));
}
if let Some(ref accessible_table_column_description) =
self.accessible_table_column_description
{
properties.push((
"accessible-table-column-description",
accessible_table_column_description,
));
}
if let Some(ref accessible_table_column_header) = self.accessible_table_column_header {
properties.push((
"accessible-table-column-header",
accessible_table_column_header,
));
}
if let Some(ref accessible_table_row_description) = self.accessible_table_row_description {
properties.push((
"accessible-table-row-description",
accessible_table_row_description,
));
}
if let Some(ref accessible_table_row_header) = self.accessible_table_row_header {
properties.push(("accessible-table-row-header", accessible_table_row_header));
}
if let Some(ref accessible_table_summary) = self.accessible_table_summary {
properties.push(("accessible-table-summary", accessible_table_summary));
}
if let Some(ref accessible_value) = self.accessible_value {
properties.push(("accessible-value", accessible_value));
}
glib::Object::new::<SocketAccessible>(&properties)
}
pub fn accessible_description(mut self, accessible_description: &str) -> Self {
self.accessible_description = Some(accessible_description.to_string());
self
}
pub fn accessible_name(mut self, accessible_name: &str) -> Self {
self.accessible_name = Some(accessible_name.to_string());
self
}
pub fn accessible_parent(mut self, accessible_parent: &impl IsA<atk::Object>) -> Self {
self.accessible_parent = Some(accessible_parent.clone().upcast());
self
}
pub fn accessible_role(mut self, accessible_role: atk::Role) -> Self {
self.accessible_role = Some(accessible_role);
self
}
pub fn accessible_table_caption(mut self, accessible_table_caption: &str) -> Self {
self.accessible_table_caption = Some(accessible_table_caption.to_string());
self
}
pub fn accessible_table_caption_object(
mut self,
accessible_table_caption_object: &impl IsA<atk::Object>,
) -> Self {
self.accessible_table_caption_object =
Some(accessible_table_caption_object.clone().upcast());
self
}
pub fn accessible_table_column_description(
mut self,
accessible_table_column_description: &str,
) -> Self {
self.accessible_table_column_description =
Some(accessible_table_column_description.to_string());
self
}
pub fn accessible_table_column_header(
mut self,
accessible_table_column_header: &impl IsA<atk::Object>,
) -> Self {
self.accessible_table_column_header = Some(accessible_table_column_header.clone().upcast());
self
}
pub fn accessible_table_row_description(
mut self,
accessible_table_row_description: &str,
) -> Self {
self.accessible_table_row_description = Some(accessible_table_row_description.to_string());
self
}
pub fn accessible_table_row_header(
mut self,
accessible_table_row_header: &impl IsA<atk::Object>,
) -> Self {
self.accessible_table_row_header = Some(accessible_table_row_header.clone().upcast());
self
}
pub fn accessible_table_summary(
mut self,
accessible_table_summary: &impl IsA<atk::Object>,
) -> Self {
self.accessible_table_summary = Some(accessible_table_summary.clone().upcast());
self
}
pub fn accessible_value(mut self, accessible_value: f64) -> Self {
self.accessible_value = Some(accessible_value);
self
}
}
pub trait SocketAccessibleExt: 'static {
#[doc(alias = "gtk_socket_accessible_embed")]
fn embed(&self, path: &str);
}
impl<O: IsA<SocketAccessible>> SocketAccessibleExt for O {
fn embed(&self, path: &str) {
unsafe {
ffi::gtk_socket_accessible_embed(self.as_ref().to_glib_none().0, path.to_glib_none().0);
}
}
}
impl fmt::Display for SocketAccessible {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str("SocketAccessible")
}
}