1 // This file was generated by gir (https://github.com/gtk-rs/gir)
2 // from gir-files (https://github.com/gtk-rs/gir-files)
3 // DO NOT EDIT
4 
5 use crate::Align;
6 use crate::BaselinePosition;
7 use crate::Box;
8 use crate::Buildable;
9 use crate::Container;
10 use crate::Orientable;
11 use crate::Orientation;
12 use crate::ResizeMode;
13 use crate::ShortcutType;
14 use crate::SizeGroup;
15 use crate::TextDirection;
16 use crate::Widget;
17 use glib::object::Cast;
18 use glib::object::IsA;
19 use glib::object::ObjectType as ObjectType_;
20 use glib::signal::connect_raw;
21 use glib::signal::SignalHandlerId;
22 use glib::translate::*;
23 use glib::StaticType;
24 use glib::ToValue;
25 use std::boxed::Box as Box_;
26 use std::fmt;
27 use std::mem::transmute;
28 
29 glib::wrapper! {
30     #[doc(alias = "GtkShortcutsShortcut")]
31     pub struct ShortcutsShortcut(Object<ffi::GtkShortcutsShortcut, ffi::GtkShortcutsShortcutClass>) @extends Box, Container, Widget, @implements Buildable, Orientable;
32 
33     match fn {
34         type_ => || ffi::gtk_shortcuts_shortcut_get_type(),
35     }
36 }
37 
38 impl ShortcutsShortcut {
39     // rustdoc-stripper-ignore-next
40     /// Creates a new builder-pattern struct instance to construct [`ShortcutsShortcut`] objects.
41     ///
42     /// This method returns an instance of [`ShortcutsShortcutBuilder`] which can be used to create [`ShortcutsShortcut`] objects.
builder() -> ShortcutsShortcutBuilder43     pub fn builder() -> ShortcutsShortcutBuilder {
44         ShortcutsShortcutBuilder::default()
45     }
46 
47     #[doc(alias = "accel-size-group")]
set_accel_size_group<P: IsA<SizeGroup>>(&self, accel_size_group: Option<&P>)48     pub fn set_accel_size_group<P: IsA<SizeGroup>>(&self, accel_size_group: Option<&P>) {
49         unsafe {
50             glib::gobject_ffi::g_object_set_property(
51                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
52                 b"accel-size-group\0".as_ptr() as *const _,
53                 accel_size_group.to_value().to_glib_none().0,
54             );
55         }
56     }
57 
accelerator(&self) -> Option<glib::GString>58     pub fn accelerator(&self) -> Option<glib::GString> {
59         unsafe {
60             let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
61             glib::gobject_ffi::g_object_get_property(
62                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
63                 b"accelerator\0".as_ptr() as *const _,
64                 value.to_glib_none_mut().0,
65             );
66             value
67                 .get()
68                 .expect("Return Value for property `accelerator` getter")
69         }
70     }
71 
set_accelerator(&self, accelerator: Option<&str>)72     pub fn set_accelerator(&self, accelerator: Option<&str>) {
73         unsafe {
74             glib::gobject_ffi::g_object_set_property(
75                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
76                 b"accelerator\0".as_ptr() as *const _,
77                 accelerator.to_value().to_glib_none().0,
78             );
79         }
80     }
81 
82     #[cfg(any(feature = "v3_22", feature = "dox"))]
83     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
84     #[doc(alias = "action-name")]
action_name(&self) -> Option<glib::GString>85     pub fn action_name(&self) -> Option<glib::GString> {
86         unsafe {
87             let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
88             glib::gobject_ffi::g_object_get_property(
89                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
90                 b"action-name\0".as_ptr() as *const _,
91                 value.to_glib_none_mut().0,
92             );
93             value
94                 .get()
95                 .expect("Return Value for property `action-name` getter")
96         }
97     }
98 
99     #[cfg(any(feature = "v3_22", feature = "dox"))]
100     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
101     #[doc(alias = "action-name")]
set_action_name(&self, action_name: Option<&str>)102     pub fn set_action_name(&self, action_name: Option<&str>) {
103         unsafe {
104             glib::gobject_ffi::g_object_set_property(
105                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
106                 b"action-name\0".as_ptr() as *const _,
107                 action_name.to_value().to_glib_none().0,
108             );
109         }
110     }
111 
icon(&self) -> Option<gio::Icon>112     pub fn icon(&self) -> Option<gio::Icon> {
113         unsafe {
114             let mut value = glib::Value::from_type(<gio::Icon as StaticType>::static_type());
115             glib::gobject_ffi::g_object_get_property(
116                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
117                 b"icon\0".as_ptr() as *const _,
118                 value.to_glib_none_mut().0,
119             );
120             value
121                 .get()
122                 .expect("Return Value for property `icon` getter")
123         }
124     }
125 
set_icon<P: IsA<gio::Icon>>(&self, icon: Option<&P>)126     pub fn set_icon<P: IsA<gio::Icon>>(&self, icon: Option<&P>) {
127         unsafe {
128             glib::gobject_ffi::g_object_set_property(
129                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
130                 b"icon\0".as_ptr() as *const _,
131                 icon.to_value().to_glib_none().0,
132             );
133         }
134     }
135 
136     #[doc(alias = "icon-set")]
is_icon_set(&self) -> bool137     pub fn is_icon_set(&self) -> bool {
138         unsafe {
139             let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
140             glib::gobject_ffi::g_object_get_property(
141                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
142                 b"icon-set\0".as_ptr() as *const _,
143                 value.to_glib_none_mut().0,
144             );
145             value
146                 .get()
147                 .expect("Return Value for property `icon-set` getter")
148         }
149     }
150 
151     #[doc(alias = "icon-set")]
set_icon_set(&self, icon_set: bool)152     pub fn set_icon_set(&self, icon_set: bool) {
153         unsafe {
154             glib::gobject_ffi::g_object_set_property(
155                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
156                 b"icon-set\0".as_ptr() as *const _,
157                 icon_set.to_value().to_glib_none().0,
158             );
159         }
160     }
161 
162     #[doc(alias = "shortcut-type")]
shortcut_type(&self) -> ShortcutType163     pub fn shortcut_type(&self) -> ShortcutType {
164         unsafe {
165             let mut value = glib::Value::from_type(<ShortcutType as StaticType>::static_type());
166             glib::gobject_ffi::g_object_get_property(
167                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
168                 b"shortcut-type\0".as_ptr() as *const _,
169                 value.to_glib_none_mut().0,
170             );
171             value
172                 .get()
173                 .expect("Return Value for property `shortcut-type` getter")
174         }
175     }
176 
177     #[doc(alias = "shortcut-type")]
set_shortcut_type(&self, shortcut_type: ShortcutType)178     pub fn set_shortcut_type(&self, shortcut_type: ShortcutType) {
179         unsafe {
180             glib::gobject_ffi::g_object_set_property(
181                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
182                 b"shortcut-type\0".as_ptr() as *const _,
183                 shortcut_type.to_value().to_glib_none().0,
184             );
185         }
186     }
187 
subtitle(&self) -> Option<glib::GString>188     pub fn subtitle(&self) -> Option<glib::GString> {
189         unsafe {
190             let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
191             glib::gobject_ffi::g_object_get_property(
192                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
193                 b"subtitle\0".as_ptr() as *const _,
194                 value.to_glib_none_mut().0,
195             );
196             value
197                 .get()
198                 .expect("Return Value for property `subtitle` getter")
199         }
200     }
201 
set_subtitle(&self, subtitle: Option<&str>)202     pub fn set_subtitle(&self, subtitle: Option<&str>) {
203         unsafe {
204             glib::gobject_ffi::g_object_set_property(
205                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
206                 b"subtitle\0".as_ptr() as *const _,
207                 subtitle.to_value().to_glib_none().0,
208             );
209         }
210     }
211 
212     #[doc(alias = "subtitle-set")]
is_subtitle_set(&self) -> bool213     pub fn is_subtitle_set(&self) -> bool {
214         unsafe {
215             let mut value = glib::Value::from_type(<bool as StaticType>::static_type());
216             glib::gobject_ffi::g_object_get_property(
217                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
218                 b"subtitle-set\0".as_ptr() as *const _,
219                 value.to_glib_none_mut().0,
220             );
221             value
222                 .get()
223                 .expect("Return Value for property `subtitle-set` getter")
224         }
225     }
226 
227     #[doc(alias = "subtitle-set")]
set_subtitle_set(&self, subtitle_set: bool)228     pub fn set_subtitle_set(&self, subtitle_set: bool) {
229         unsafe {
230             glib::gobject_ffi::g_object_set_property(
231                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
232                 b"subtitle-set\0".as_ptr() as *const _,
233                 subtitle_set.to_value().to_glib_none().0,
234             );
235         }
236     }
237 
title(&self) -> Option<glib::GString>238     pub fn title(&self) -> Option<glib::GString> {
239         unsafe {
240             let mut value = glib::Value::from_type(<glib::GString as StaticType>::static_type());
241             glib::gobject_ffi::g_object_get_property(
242                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
243                 b"title\0".as_ptr() as *const _,
244                 value.to_glib_none_mut().0,
245             );
246             value
247                 .get()
248                 .expect("Return Value for property `title` getter")
249         }
250     }
251 
set_title(&self, title: Option<&str>)252     pub fn set_title(&self, title: Option<&str>) {
253         unsafe {
254             glib::gobject_ffi::g_object_set_property(
255                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
256                 b"title\0".as_ptr() as *const _,
257                 title.to_value().to_glib_none().0,
258             );
259         }
260     }
261 
262     #[doc(alias = "title-size-group")]
set_title_size_group<P: IsA<SizeGroup>>(&self, title_size_group: Option<&P>)263     pub fn set_title_size_group<P: IsA<SizeGroup>>(&self, title_size_group: Option<&P>) {
264         unsafe {
265             glib::gobject_ffi::g_object_set_property(
266                 self.as_ptr() as *mut glib::gobject_ffi::GObject,
267                 b"title-size-group\0".as_ptr() as *const _,
268                 title_size_group.to_value().to_glib_none().0,
269             );
270         }
271     }
272 
273     #[doc(alias = "accel-size-group")]
connect_accel_size_group_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId274     pub fn connect_accel_size_group_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
275         unsafe extern "C" fn notify_accel_size_group_trampoline<
276             F: Fn(&ShortcutsShortcut) + 'static,
277         >(
278             this: *mut ffi::GtkShortcutsShortcut,
279             _param_spec: glib::ffi::gpointer,
280             f: glib::ffi::gpointer,
281         ) {
282             let f: &F = &*(f as *const F);
283             f(&from_glib_borrow(this))
284         }
285         unsafe {
286             let f: Box_<F> = Box_::new(f);
287             connect_raw(
288                 self.as_ptr() as *mut _,
289                 b"notify::accel-size-group\0".as_ptr() as *const _,
290                 Some(transmute::<_, unsafe extern "C" fn()>(
291                     notify_accel_size_group_trampoline::<F> as *const (),
292                 )),
293                 Box_::into_raw(f),
294             )
295         }
296     }
297 
298     #[doc(alias = "accelerator")]
connect_accelerator_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId299     pub fn connect_accelerator_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
300         unsafe extern "C" fn notify_accelerator_trampoline<F: Fn(&ShortcutsShortcut) + 'static>(
301             this: *mut ffi::GtkShortcutsShortcut,
302             _param_spec: glib::ffi::gpointer,
303             f: glib::ffi::gpointer,
304         ) {
305             let f: &F = &*(f as *const F);
306             f(&from_glib_borrow(this))
307         }
308         unsafe {
309             let f: Box_<F> = Box_::new(f);
310             connect_raw(
311                 self.as_ptr() as *mut _,
312                 b"notify::accelerator\0".as_ptr() as *const _,
313                 Some(transmute::<_, unsafe extern "C" fn()>(
314                     notify_accelerator_trampoline::<F> as *const (),
315                 )),
316                 Box_::into_raw(f),
317             )
318         }
319     }
320 
321     #[cfg(any(feature = "v3_22", feature = "dox"))]
322     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
323     #[doc(alias = "action-name")]
connect_action_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId324     pub fn connect_action_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
325         unsafe extern "C" fn notify_action_name_trampoline<F: Fn(&ShortcutsShortcut) + 'static>(
326             this: *mut ffi::GtkShortcutsShortcut,
327             _param_spec: glib::ffi::gpointer,
328             f: glib::ffi::gpointer,
329         ) {
330             let f: &F = &*(f as *const F);
331             f(&from_glib_borrow(this))
332         }
333         unsafe {
334             let f: Box_<F> = Box_::new(f);
335             connect_raw(
336                 self.as_ptr() as *mut _,
337                 b"notify::action-name\0".as_ptr() as *const _,
338                 Some(transmute::<_, unsafe extern "C" fn()>(
339                     notify_action_name_trampoline::<F> as *const (),
340                 )),
341                 Box_::into_raw(f),
342             )
343         }
344     }
345 
346     #[doc(alias = "direction")]
connect_direction_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId347     pub fn connect_direction_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
348         unsafe extern "C" fn notify_direction_trampoline<F: Fn(&ShortcutsShortcut) + 'static>(
349             this: *mut ffi::GtkShortcutsShortcut,
350             _param_spec: glib::ffi::gpointer,
351             f: glib::ffi::gpointer,
352         ) {
353             let f: &F = &*(f as *const F);
354             f(&from_glib_borrow(this))
355         }
356         unsafe {
357             let f: Box_<F> = Box_::new(f);
358             connect_raw(
359                 self.as_ptr() as *mut _,
360                 b"notify::direction\0".as_ptr() as *const _,
361                 Some(transmute::<_, unsafe extern "C" fn()>(
362                     notify_direction_trampoline::<F> as *const (),
363                 )),
364                 Box_::into_raw(f),
365             )
366         }
367     }
368 
369     #[doc(alias = "icon")]
connect_icon_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId370     pub fn connect_icon_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
371         unsafe extern "C" fn notify_icon_trampoline<F: Fn(&ShortcutsShortcut) + 'static>(
372             this: *mut ffi::GtkShortcutsShortcut,
373             _param_spec: glib::ffi::gpointer,
374             f: glib::ffi::gpointer,
375         ) {
376             let f: &F = &*(f as *const F);
377             f(&from_glib_borrow(this))
378         }
379         unsafe {
380             let f: Box_<F> = Box_::new(f);
381             connect_raw(
382                 self.as_ptr() as *mut _,
383                 b"notify::icon\0".as_ptr() as *const _,
384                 Some(transmute::<_, unsafe extern "C" fn()>(
385                     notify_icon_trampoline::<F> as *const (),
386                 )),
387                 Box_::into_raw(f),
388             )
389         }
390     }
391 
392     #[doc(alias = "icon-set")]
connect_icon_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId393     pub fn connect_icon_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
394         unsafe extern "C" fn notify_icon_set_trampoline<F: Fn(&ShortcutsShortcut) + 'static>(
395             this: *mut ffi::GtkShortcutsShortcut,
396             _param_spec: glib::ffi::gpointer,
397             f: glib::ffi::gpointer,
398         ) {
399             let f: &F = &*(f as *const F);
400             f(&from_glib_borrow(this))
401         }
402         unsafe {
403             let f: Box_<F> = Box_::new(f);
404             connect_raw(
405                 self.as_ptr() as *mut _,
406                 b"notify::icon-set\0".as_ptr() as *const _,
407                 Some(transmute::<_, unsafe extern "C" fn()>(
408                     notify_icon_set_trampoline::<F> as *const (),
409                 )),
410                 Box_::into_raw(f),
411             )
412         }
413     }
414 
415     #[doc(alias = "shortcut-type")]
connect_shortcut_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId416     pub fn connect_shortcut_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
417         unsafe extern "C" fn notify_shortcut_type_trampoline<
418             F: Fn(&ShortcutsShortcut) + 'static,
419         >(
420             this: *mut ffi::GtkShortcutsShortcut,
421             _param_spec: glib::ffi::gpointer,
422             f: glib::ffi::gpointer,
423         ) {
424             let f: &F = &*(f as *const F);
425             f(&from_glib_borrow(this))
426         }
427         unsafe {
428             let f: Box_<F> = Box_::new(f);
429             connect_raw(
430                 self.as_ptr() as *mut _,
431                 b"notify::shortcut-type\0".as_ptr() as *const _,
432                 Some(transmute::<_, unsafe extern "C" fn()>(
433                     notify_shortcut_type_trampoline::<F> as *const (),
434                 )),
435                 Box_::into_raw(f),
436             )
437         }
438     }
439 
440     #[doc(alias = "subtitle")]
connect_subtitle_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId441     pub fn connect_subtitle_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
442         unsafe extern "C" fn notify_subtitle_trampoline<F: Fn(&ShortcutsShortcut) + 'static>(
443             this: *mut ffi::GtkShortcutsShortcut,
444             _param_spec: glib::ffi::gpointer,
445             f: glib::ffi::gpointer,
446         ) {
447             let f: &F = &*(f as *const F);
448             f(&from_glib_borrow(this))
449         }
450         unsafe {
451             let f: Box_<F> = Box_::new(f);
452             connect_raw(
453                 self.as_ptr() as *mut _,
454                 b"notify::subtitle\0".as_ptr() as *const _,
455                 Some(transmute::<_, unsafe extern "C" fn()>(
456                     notify_subtitle_trampoline::<F> as *const (),
457                 )),
458                 Box_::into_raw(f),
459             )
460         }
461     }
462 
463     #[doc(alias = "subtitle-set")]
connect_subtitle_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId464     pub fn connect_subtitle_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
465         unsafe extern "C" fn notify_subtitle_set_trampoline<F: Fn(&ShortcutsShortcut) + 'static>(
466             this: *mut ffi::GtkShortcutsShortcut,
467             _param_spec: glib::ffi::gpointer,
468             f: glib::ffi::gpointer,
469         ) {
470             let f: &F = &*(f as *const F);
471             f(&from_glib_borrow(this))
472         }
473         unsafe {
474             let f: Box_<F> = Box_::new(f);
475             connect_raw(
476                 self.as_ptr() as *mut _,
477                 b"notify::subtitle-set\0".as_ptr() as *const _,
478                 Some(transmute::<_, unsafe extern "C" fn()>(
479                     notify_subtitle_set_trampoline::<F> as *const (),
480                 )),
481                 Box_::into_raw(f),
482             )
483         }
484     }
485 
486     #[doc(alias = "title")]
connect_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId487     pub fn connect_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
488         unsafe extern "C" fn notify_title_trampoline<F: Fn(&ShortcutsShortcut) + 'static>(
489             this: *mut ffi::GtkShortcutsShortcut,
490             _param_spec: glib::ffi::gpointer,
491             f: glib::ffi::gpointer,
492         ) {
493             let f: &F = &*(f as *const F);
494             f(&from_glib_borrow(this))
495         }
496         unsafe {
497             let f: Box_<F> = Box_::new(f);
498             connect_raw(
499                 self.as_ptr() as *mut _,
500                 b"notify::title\0".as_ptr() as *const _,
501                 Some(transmute::<_, unsafe extern "C" fn()>(
502                     notify_title_trampoline::<F> as *const (),
503                 )),
504                 Box_::into_raw(f),
505             )
506         }
507     }
508 
509     #[doc(alias = "title-size-group")]
connect_title_size_group_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId510     pub fn connect_title_size_group_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
511         unsafe extern "C" fn notify_title_size_group_trampoline<
512             F: Fn(&ShortcutsShortcut) + 'static,
513         >(
514             this: *mut ffi::GtkShortcutsShortcut,
515             _param_spec: glib::ffi::gpointer,
516             f: glib::ffi::gpointer,
517         ) {
518             let f: &F = &*(f as *const F);
519             f(&from_glib_borrow(this))
520         }
521         unsafe {
522             let f: Box_<F> = Box_::new(f);
523             connect_raw(
524                 self.as_ptr() as *mut _,
525                 b"notify::title-size-group\0".as_ptr() as *const _,
526                 Some(transmute::<_, unsafe extern "C" fn()>(
527                     notify_title_size_group_trampoline::<F> as *const (),
528                 )),
529                 Box_::into_raw(f),
530             )
531         }
532     }
533 }
534 
535 #[derive(Clone, Default)]
536 // rustdoc-stripper-ignore-next
537 /// A [builder-pattern] type to construct [`ShortcutsShortcut`] objects.
538 ///
539 /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
540 pub struct ShortcutsShortcutBuilder {
541     accel_size_group: Option<SizeGroup>,
542     accelerator: Option<String>,
543     #[cfg(any(feature = "v3_22", feature = "dox"))]
544     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
545     action_name: Option<String>,
546     direction: Option<TextDirection>,
547     icon: Option<gio::Icon>,
548     icon_set: Option<bool>,
549     shortcut_type: Option<ShortcutType>,
550     subtitle: Option<String>,
551     subtitle_set: Option<bool>,
552     title: Option<String>,
553     title_size_group: Option<SizeGroup>,
554     baseline_position: Option<BaselinePosition>,
555     homogeneous: Option<bool>,
556     spacing: Option<i32>,
557     border_width: Option<u32>,
558     child: Option<Widget>,
559     resize_mode: Option<ResizeMode>,
560     app_paintable: Option<bool>,
561     can_default: Option<bool>,
562     can_focus: Option<bool>,
563     events: Option<gdk::EventMask>,
564     expand: Option<bool>,
565     #[cfg(any(feature = "v3_20", feature = "dox"))]
566     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
567     focus_on_click: Option<bool>,
568     halign: Option<Align>,
569     has_default: Option<bool>,
570     has_focus: Option<bool>,
571     has_tooltip: Option<bool>,
572     height_request: Option<i32>,
573     hexpand: Option<bool>,
574     hexpand_set: Option<bool>,
575     is_focus: Option<bool>,
576     margin: Option<i32>,
577     margin_bottom: Option<i32>,
578     margin_end: Option<i32>,
579     margin_start: Option<i32>,
580     margin_top: Option<i32>,
581     name: Option<String>,
582     no_show_all: Option<bool>,
583     opacity: Option<f64>,
584     parent: Option<Container>,
585     receives_default: Option<bool>,
586     sensitive: Option<bool>,
587     tooltip_markup: Option<String>,
588     tooltip_text: Option<String>,
589     valign: Option<Align>,
590     vexpand: Option<bool>,
591     vexpand_set: Option<bool>,
592     visible: Option<bool>,
593     width_request: Option<i32>,
594     orientation: Option<Orientation>,
595 }
596 
597 impl ShortcutsShortcutBuilder {
598     // rustdoc-stripper-ignore-next
599     /// Create a new [`ShortcutsShortcutBuilder`].
new() -> Self600     pub fn new() -> Self {
601         Self::default()
602     }
603 
604     // rustdoc-stripper-ignore-next
605     /// Build the [`ShortcutsShortcut`].
build(self) -> ShortcutsShortcut606     pub fn build(self) -> ShortcutsShortcut {
607         let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
608         if let Some(ref accel_size_group) = self.accel_size_group {
609             properties.push(("accel-size-group", accel_size_group));
610         }
611         if let Some(ref accelerator) = self.accelerator {
612             properties.push(("accelerator", accelerator));
613         }
614         #[cfg(any(feature = "v3_22", feature = "dox"))]
615         if let Some(ref action_name) = self.action_name {
616             properties.push(("action-name", action_name));
617         }
618         if let Some(ref direction) = self.direction {
619             properties.push(("direction", direction));
620         }
621         if let Some(ref icon) = self.icon {
622             properties.push(("icon", icon));
623         }
624         if let Some(ref icon_set) = self.icon_set {
625             properties.push(("icon-set", icon_set));
626         }
627         if let Some(ref shortcut_type) = self.shortcut_type {
628             properties.push(("shortcut-type", shortcut_type));
629         }
630         if let Some(ref subtitle) = self.subtitle {
631             properties.push(("subtitle", subtitle));
632         }
633         if let Some(ref subtitle_set) = self.subtitle_set {
634             properties.push(("subtitle-set", subtitle_set));
635         }
636         if let Some(ref title) = self.title {
637             properties.push(("title", title));
638         }
639         if let Some(ref title_size_group) = self.title_size_group {
640             properties.push(("title-size-group", title_size_group));
641         }
642         if let Some(ref baseline_position) = self.baseline_position {
643             properties.push(("baseline-position", baseline_position));
644         }
645         if let Some(ref homogeneous) = self.homogeneous {
646             properties.push(("homogeneous", homogeneous));
647         }
648         if let Some(ref spacing) = self.spacing {
649             properties.push(("spacing", spacing));
650         }
651         if let Some(ref border_width) = self.border_width {
652             properties.push(("border-width", border_width));
653         }
654         if let Some(ref child) = self.child {
655             properties.push(("child", child));
656         }
657         if let Some(ref resize_mode) = self.resize_mode {
658             properties.push(("resize-mode", resize_mode));
659         }
660         if let Some(ref app_paintable) = self.app_paintable {
661             properties.push(("app-paintable", app_paintable));
662         }
663         if let Some(ref can_default) = self.can_default {
664             properties.push(("can-default", can_default));
665         }
666         if let Some(ref can_focus) = self.can_focus {
667             properties.push(("can-focus", can_focus));
668         }
669         if let Some(ref events) = self.events {
670             properties.push(("events", events));
671         }
672         if let Some(ref expand) = self.expand {
673             properties.push(("expand", expand));
674         }
675         #[cfg(any(feature = "v3_20", feature = "dox"))]
676         if let Some(ref focus_on_click) = self.focus_on_click {
677             properties.push(("focus-on-click", focus_on_click));
678         }
679         if let Some(ref halign) = self.halign {
680             properties.push(("halign", halign));
681         }
682         if let Some(ref has_default) = self.has_default {
683             properties.push(("has-default", has_default));
684         }
685         if let Some(ref has_focus) = self.has_focus {
686             properties.push(("has-focus", has_focus));
687         }
688         if let Some(ref has_tooltip) = self.has_tooltip {
689             properties.push(("has-tooltip", has_tooltip));
690         }
691         if let Some(ref height_request) = self.height_request {
692             properties.push(("height-request", height_request));
693         }
694         if let Some(ref hexpand) = self.hexpand {
695             properties.push(("hexpand", hexpand));
696         }
697         if let Some(ref hexpand_set) = self.hexpand_set {
698             properties.push(("hexpand-set", hexpand_set));
699         }
700         if let Some(ref is_focus) = self.is_focus {
701             properties.push(("is-focus", is_focus));
702         }
703         if let Some(ref margin) = self.margin {
704             properties.push(("margin", margin));
705         }
706         if let Some(ref margin_bottom) = self.margin_bottom {
707             properties.push(("margin-bottom", margin_bottom));
708         }
709         if let Some(ref margin_end) = self.margin_end {
710             properties.push(("margin-end", margin_end));
711         }
712         if let Some(ref margin_start) = self.margin_start {
713             properties.push(("margin-start", margin_start));
714         }
715         if let Some(ref margin_top) = self.margin_top {
716             properties.push(("margin-top", margin_top));
717         }
718         if let Some(ref name) = self.name {
719             properties.push(("name", name));
720         }
721         if let Some(ref no_show_all) = self.no_show_all {
722             properties.push(("no-show-all", no_show_all));
723         }
724         if let Some(ref opacity) = self.opacity {
725             properties.push(("opacity", opacity));
726         }
727         if let Some(ref parent) = self.parent {
728             properties.push(("parent", parent));
729         }
730         if let Some(ref receives_default) = self.receives_default {
731             properties.push(("receives-default", receives_default));
732         }
733         if let Some(ref sensitive) = self.sensitive {
734             properties.push(("sensitive", sensitive));
735         }
736         if let Some(ref tooltip_markup) = self.tooltip_markup {
737             properties.push(("tooltip-markup", tooltip_markup));
738         }
739         if let Some(ref tooltip_text) = self.tooltip_text {
740             properties.push(("tooltip-text", tooltip_text));
741         }
742         if let Some(ref valign) = self.valign {
743             properties.push(("valign", valign));
744         }
745         if let Some(ref vexpand) = self.vexpand {
746             properties.push(("vexpand", vexpand));
747         }
748         if let Some(ref vexpand_set) = self.vexpand_set {
749             properties.push(("vexpand-set", vexpand_set));
750         }
751         if let Some(ref visible) = self.visible {
752             properties.push(("visible", visible));
753         }
754         if let Some(ref width_request) = self.width_request {
755             properties.push(("width-request", width_request));
756         }
757         if let Some(ref orientation) = self.orientation {
758             properties.push(("orientation", orientation));
759         }
760         glib::Object::new::<ShortcutsShortcut>(&properties)
761             .expect("Failed to create an instance of ShortcutsShortcut")
762     }
763 
accel_size_group<P: IsA<SizeGroup>>(mut self, accel_size_group: &P) -> Self764     pub fn accel_size_group<P: IsA<SizeGroup>>(mut self, accel_size_group: &P) -> Self {
765         self.accel_size_group = Some(accel_size_group.clone().upcast());
766         self
767     }
768 
accelerator(mut self, accelerator: &str) -> Self769     pub fn accelerator(mut self, accelerator: &str) -> Self {
770         self.accelerator = Some(accelerator.to_string());
771         self
772     }
773 
774     #[cfg(any(feature = "v3_22", feature = "dox"))]
775     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_22")))]
action_name(mut self, action_name: &str) -> Self776     pub fn action_name(mut self, action_name: &str) -> Self {
777         self.action_name = Some(action_name.to_string());
778         self
779     }
780 
direction(mut self, direction: TextDirection) -> Self781     pub fn direction(mut self, direction: TextDirection) -> Self {
782         self.direction = Some(direction);
783         self
784     }
785 
icon<P: IsA<gio::Icon>>(mut self, icon: &P) -> Self786     pub fn icon<P: IsA<gio::Icon>>(mut self, icon: &P) -> Self {
787         self.icon = Some(icon.clone().upcast());
788         self
789     }
790 
icon_set(mut self, icon_set: bool) -> Self791     pub fn icon_set(mut self, icon_set: bool) -> Self {
792         self.icon_set = Some(icon_set);
793         self
794     }
795 
shortcut_type(mut self, shortcut_type: ShortcutType) -> Self796     pub fn shortcut_type(mut self, shortcut_type: ShortcutType) -> Self {
797         self.shortcut_type = Some(shortcut_type);
798         self
799     }
800 
subtitle(mut self, subtitle: &str) -> Self801     pub fn subtitle(mut self, subtitle: &str) -> Self {
802         self.subtitle = Some(subtitle.to_string());
803         self
804     }
805 
subtitle_set(mut self, subtitle_set: bool) -> Self806     pub fn subtitle_set(mut self, subtitle_set: bool) -> Self {
807         self.subtitle_set = Some(subtitle_set);
808         self
809     }
810 
title(mut self, title: &str) -> Self811     pub fn title(mut self, title: &str) -> Self {
812         self.title = Some(title.to_string());
813         self
814     }
815 
title_size_group<P: IsA<SizeGroup>>(mut self, title_size_group: &P) -> Self816     pub fn title_size_group<P: IsA<SizeGroup>>(mut self, title_size_group: &P) -> Self {
817         self.title_size_group = Some(title_size_group.clone().upcast());
818         self
819     }
820 
baseline_position(mut self, baseline_position: BaselinePosition) -> Self821     pub fn baseline_position(mut self, baseline_position: BaselinePosition) -> Self {
822         self.baseline_position = Some(baseline_position);
823         self
824     }
825 
homogeneous(mut self, homogeneous: bool) -> Self826     pub fn homogeneous(mut self, homogeneous: bool) -> Self {
827         self.homogeneous = Some(homogeneous);
828         self
829     }
830 
spacing(mut self, spacing: i32) -> Self831     pub fn spacing(mut self, spacing: i32) -> Self {
832         self.spacing = Some(spacing);
833         self
834     }
835 
border_width(mut self, border_width: u32) -> Self836     pub fn border_width(mut self, border_width: u32) -> Self {
837         self.border_width = Some(border_width);
838         self
839     }
840 
child<P: IsA<Widget>>(mut self, child: &P) -> Self841     pub fn child<P: IsA<Widget>>(mut self, child: &P) -> Self {
842         self.child = Some(child.clone().upcast());
843         self
844     }
845 
resize_mode(mut self, resize_mode: ResizeMode) -> Self846     pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self {
847         self.resize_mode = Some(resize_mode);
848         self
849     }
850 
app_paintable(mut self, app_paintable: bool) -> Self851     pub fn app_paintable(mut self, app_paintable: bool) -> Self {
852         self.app_paintable = Some(app_paintable);
853         self
854     }
855 
can_default(mut self, can_default: bool) -> Self856     pub fn can_default(mut self, can_default: bool) -> Self {
857         self.can_default = Some(can_default);
858         self
859     }
860 
can_focus(mut self, can_focus: bool) -> Self861     pub fn can_focus(mut self, can_focus: bool) -> Self {
862         self.can_focus = Some(can_focus);
863         self
864     }
865 
events(mut self, events: gdk::EventMask) -> Self866     pub fn events(mut self, events: gdk::EventMask) -> Self {
867         self.events = Some(events);
868         self
869     }
870 
expand(mut self, expand: bool) -> Self871     pub fn expand(mut self, expand: bool) -> Self {
872         self.expand = Some(expand);
873         self
874     }
875 
876     #[cfg(any(feature = "v3_20", feature = "dox"))]
877     #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))]
focus_on_click(mut self, focus_on_click: bool) -> Self878     pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
879         self.focus_on_click = Some(focus_on_click);
880         self
881     }
882 
halign(mut self, halign: Align) -> Self883     pub fn halign(mut self, halign: Align) -> Self {
884         self.halign = Some(halign);
885         self
886     }
887 
has_default(mut self, has_default: bool) -> Self888     pub fn has_default(mut self, has_default: bool) -> Self {
889         self.has_default = Some(has_default);
890         self
891     }
892 
has_focus(mut self, has_focus: bool) -> Self893     pub fn has_focus(mut self, has_focus: bool) -> Self {
894         self.has_focus = Some(has_focus);
895         self
896     }
897 
has_tooltip(mut self, has_tooltip: bool) -> Self898     pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
899         self.has_tooltip = Some(has_tooltip);
900         self
901     }
902 
height_request(mut self, height_request: i32) -> Self903     pub fn height_request(mut self, height_request: i32) -> Self {
904         self.height_request = Some(height_request);
905         self
906     }
907 
hexpand(mut self, hexpand: bool) -> Self908     pub fn hexpand(mut self, hexpand: bool) -> Self {
909         self.hexpand = Some(hexpand);
910         self
911     }
912 
hexpand_set(mut self, hexpand_set: bool) -> Self913     pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
914         self.hexpand_set = Some(hexpand_set);
915         self
916     }
917 
is_focus(mut self, is_focus: bool) -> Self918     pub fn is_focus(mut self, is_focus: bool) -> Self {
919         self.is_focus = Some(is_focus);
920         self
921     }
922 
margin(mut self, margin: i32) -> Self923     pub fn margin(mut self, margin: i32) -> Self {
924         self.margin = Some(margin);
925         self
926     }
927 
margin_bottom(mut self, margin_bottom: i32) -> Self928     pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
929         self.margin_bottom = Some(margin_bottom);
930         self
931     }
932 
margin_end(mut self, margin_end: i32) -> Self933     pub fn margin_end(mut self, margin_end: i32) -> Self {
934         self.margin_end = Some(margin_end);
935         self
936     }
937 
margin_start(mut self, margin_start: i32) -> Self938     pub fn margin_start(mut self, margin_start: i32) -> Self {
939         self.margin_start = Some(margin_start);
940         self
941     }
942 
margin_top(mut self, margin_top: i32) -> Self943     pub fn margin_top(mut self, margin_top: i32) -> Self {
944         self.margin_top = Some(margin_top);
945         self
946     }
947 
name(mut self, name: &str) -> Self948     pub fn name(mut self, name: &str) -> Self {
949         self.name = Some(name.to_string());
950         self
951     }
952 
no_show_all(mut self, no_show_all: bool) -> Self953     pub fn no_show_all(mut self, no_show_all: bool) -> Self {
954         self.no_show_all = Some(no_show_all);
955         self
956     }
957 
opacity(mut self, opacity: f64) -> Self958     pub fn opacity(mut self, opacity: f64) -> Self {
959         self.opacity = Some(opacity);
960         self
961     }
962 
parent<P: IsA<Container>>(mut self, parent: &P) -> Self963     pub fn parent<P: IsA<Container>>(mut self, parent: &P) -> Self {
964         self.parent = Some(parent.clone().upcast());
965         self
966     }
967 
receives_default(mut self, receives_default: bool) -> Self968     pub fn receives_default(mut self, receives_default: bool) -> Self {
969         self.receives_default = Some(receives_default);
970         self
971     }
972 
sensitive(mut self, sensitive: bool) -> Self973     pub fn sensitive(mut self, sensitive: bool) -> Self {
974         self.sensitive = Some(sensitive);
975         self
976     }
977 
tooltip_markup(mut self, tooltip_markup: &str) -> Self978     pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
979         self.tooltip_markup = Some(tooltip_markup.to_string());
980         self
981     }
982 
tooltip_text(mut self, tooltip_text: &str) -> Self983     pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
984         self.tooltip_text = Some(tooltip_text.to_string());
985         self
986     }
987 
valign(mut self, valign: Align) -> Self988     pub fn valign(mut self, valign: Align) -> Self {
989         self.valign = Some(valign);
990         self
991     }
992 
vexpand(mut self, vexpand: bool) -> Self993     pub fn vexpand(mut self, vexpand: bool) -> Self {
994         self.vexpand = Some(vexpand);
995         self
996     }
997 
vexpand_set(mut self, vexpand_set: bool) -> Self998     pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
999         self.vexpand_set = Some(vexpand_set);
1000         self
1001     }
1002 
visible(mut self, visible: bool) -> Self1003     pub fn visible(mut self, visible: bool) -> Self {
1004         self.visible = Some(visible);
1005         self
1006     }
1007 
width_request(mut self, width_request: i32) -> Self1008     pub fn width_request(mut self, width_request: i32) -> Self {
1009         self.width_request = Some(width_request);
1010         self
1011     }
1012 
orientation(mut self, orientation: Orientation) -> Self1013     pub fn orientation(mut self, orientation: Orientation) -> Self {
1014         self.orientation = Some(orientation);
1015         self
1016     }
1017 }
1018 
1019 impl fmt::Display for ShortcutsShortcut {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1020     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1021         f.write_str("ShortcutsShortcut")
1022     }
1023 }
1024