1use crate::{
6 ffi, Accessible, AccessibleRole, Align, Application, Buildable, ConstraintTarget,
7 LayoutManager, License, Native, Overflow, Root, ShortcutManager, Widget, Window,
8};
9use glib::{
10 object::ObjectType as _,
11 prelude::*,
12 signal::{connect_raw, SignalHandlerId},
13 translate::*,
14};
15use std::boxed::Box as Box_;
16
17glib::wrapper! {
18 #[doc(alias = "GtkAboutDialog")]
19 pub struct AboutDialog(Object<ffi::GtkAboutDialog>) @extends Window, Widget, @implements Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager;
20
21 match fn {
22 type_ => || ffi::gtk_about_dialog_get_type(),
23 }
24}
25
26impl AboutDialog {
27 #[doc(alias = "gtk_about_dialog_new")]
28 pub fn new() -> AboutDialog {
29 assert_initialized_main_thread!();
30 unsafe { Widget::from_glib_none(ffi::gtk_about_dialog_new()).unsafe_cast() }
31 }
32
33 pub fn builder() -> AboutDialogBuilder {
38 AboutDialogBuilder::new()
39 }
40
41 #[doc(alias = "gtk_about_dialog_add_credit_section")]
42 pub fn add_credit_section(&self, section_name: &str, people: &[&str]) {
43 unsafe {
44 ffi::gtk_about_dialog_add_credit_section(
45 self.to_glib_none().0,
46 section_name.to_glib_none().0,
47 people.to_glib_none().0,
48 );
49 }
50 }
51
52 #[doc(alias = "gtk_about_dialog_get_artists")]
53 #[doc(alias = "get_artists")]
54 pub fn artists(&self) -> Vec<glib::GString> {
55 unsafe {
56 FromGlibPtrContainer::from_glib_none(ffi::gtk_about_dialog_get_artists(
57 self.to_glib_none().0,
58 ))
59 }
60 }
61
62 #[doc(alias = "gtk_about_dialog_get_authors")]
63 #[doc(alias = "get_authors")]
64 pub fn authors(&self) -> Vec<glib::GString> {
65 unsafe {
66 FromGlibPtrContainer::from_glib_none(ffi::gtk_about_dialog_get_authors(
67 self.to_glib_none().0,
68 ))
69 }
70 }
71
72 #[doc(alias = "gtk_about_dialog_get_comments")]
73 #[doc(alias = "get_comments")]
74 pub fn comments(&self) -> Option<glib::GString> {
75 unsafe { from_glib_none(ffi::gtk_about_dialog_get_comments(self.to_glib_none().0)) }
76 }
77
78 #[doc(alias = "gtk_about_dialog_get_copyright")]
79 #[doc(alias = "get_copyright")]
80 pub fn copyright(&self) -> Option<glib::GString> {
81 unsafe { from_glib_none(ffi::gtk_about_dialog_get_copyright(self.to_glib_none().0)) }
82 }
83
84 #[doc(alias = "gtk_about_dialog_get_documenters")]
85 #[doc(alias = "get_documenters")]
86 pub fn documenters(&self) -> Vec<glib::GString> {
87 unsafe {
88 FromGlibPtrContainer::from_glib_none(ffi::gtk_about_dialog_get_documenters(
89 self.to_glib_none().0,
90 ))
91 }
92 }
93
94 #[doc(alias = "gtk_about_dialog_get_license")]
95 #[doc(alias = "get_license")]
96 pub fn license(&self) -> Option<glib::GString> {
97 unsafe { from_glib_none(ffi::gtk_about_dialog_get_license(self.to_glib_none().0)) }
98 }
99
100 #[doc(alias = "gtk_about_dialog_get_license_type")]
101 #[doc(alias = "get_license_type")]
102 #[doc(alias = "license-type")]
103 pub fn license_type(&self) -> License {
104 unsafe {
105 from_glib(ffi::gtk_about_dialog_get_license_type(
106 self.to_glib_none().0,
107 ))
108 }
109 }
110
111 #[doc(alias = "gtk_about_dialog_get_logo")]
112 #[doc(alias = "get_logo")]
113 pub fn logo(&self) -> Option<gdk::Paintable> {
114 unsafe { from_glib_none(ffi::gtk_about_dialog_get_logo(self.to_glib_none().0)) }
115 }
116
117 #[doc(alias = "gtk_about_dialog_get_logo_icon_name")]
118 #[doc(alias = "get_logo_icon_name")]
119 #[doc(alias = "logo-icon-name")]
120 pub fn logo_icon_name(&self) -> Option<glib::GString> {
121 unsafe {
122 from_glib_none(ffi::gtk_about_dialog_get_logo_icon_name(
123 self.to_glib_none().0,
124 ))
125 }
126 }
127
128 #[doc(alias = "gtk_about_dialog_get_program_name")]
129 #[doc(alias = "get_program_name")]
130 #[doc(alias = "program-name")]
131 pub fn program_name(&self) -> Option<glib::GString> {
132 unsafe {
133 from_glib_none(ffi::gtk_about_dialog_get_program_name(
134 self.to_glib_none().0,
135 ))
136 }
137 }
138
139 #[doc(alias = "gtk_about_dialog_get_system_information")]
140 #[doc(alias = "get_system_information")]
141 #[doc(alias = "system-information")]
142 pub fn system_information(&self) -> Option<glib::GString> {
143 unsafe {
144 from_glib_none(ffi::gtk_about_dialog_get_system_information(
145 self.to_glib_none().0,
146 ))
147 }
148 }
149
150 #[doc(alias = "gtk_about_dialog_get_translator_credits")]
151 #[doc(alias = "get_translator_credits")]
152 #[doc(alias = "translator-credits")]
153 pub fn translator_credits(&self) -> Option<glib::GString> {
154 unsafe {
155 from_glib_none(ffi::gtk_about_dialog_get_translator_credits(
156 self.to_glib_none().0,
157 ))
158 }
159 }
160
161 #[doc(alias = "gtk_about_dialog_get_version")]
162 #[doc(alias = "get_version")]
163 pub fn version(&self) -> Option<glib::GString> {
164 unsafe { from_glib_none(ffi::gtk_about_dialog_get_version(self.to_glib_none().0)) }
165 }
166
167 #[doc(alias = "gtk_about_dialog_get_website")]
168 #[doc(alias = "get_website")]
169 pub fn website(&self) -> Option<glib::GString> {
170 unsafe { from_glib_none(ffi::gtk_about_dialog_get_website(self.to_glib_none().0)) }
171 }
172
173 #[doc(alias = "gtk_about_dialog_get_website_label")]
174 #[doc(alias = "get_website_label")]
175 #[doc(alias = "website-label")]
176 pub fn website_label(&self) -> Option<glib::GString> {
177 unsafe {
178 from_glib_none(ffi::gtk_about_dialog_get_website_label(
179 self.to_glib_none().0,
180 ))
181 }
182 }
183
184 #[doc(alias = "gtk_about_dialog_get_wrap_license")]
185 #[doc(alias = "get_wrap_license")]
186 #[doc(alias = "wrap-license")]
187 pub fn wraps_license(&self) -> bool {
188 unsafe {
189 from_glib(ffi::gtk_about_dialog_get_wrap_license(
190 self.to_glib_none().0,
191 ))
192 }
193 }
194
195 #[doc(alias = "gtk_about_dialog_set_artists")]
196 #[doc(alias = "artists")]
197 pub fn set_artists(&self, artists: &[&str]) {
198 unsafe {
199 ffi::gtk_about_dialog_set_artists(self.to_glib_none().0, artists.to_glib_none().0);
200 }
201 }
202
203 #[doc(alias = "gtk_about_dialog_set_authors")]
204 #[doc(alias = "authors")]
205 pub fn set_authors(&self, authors: &[&str]) {
206 unsafe {
207 ffi::gtk_about_dialog_set_authors(self.to_glib_none().0, authors.to_glib_none().0);
208 }
209 }
210
211 #[doc(alias = "gtk_about_dialog_set_comments")]
212 #[doc(alias = "comments")]
213 pub fn set_comments(&self, comments: Option<&str>) {
214 unsafe {
215 ffi::gtk_about_dialog_set_comments(self.to_glib_none().0, comments.to_glib_none().0);
216 }
217 }
218
219 #[doc(alias = "gtk_about_dialog_set_copyright")]
220 #[doc(alias = "copyright")]
221 pub fn set_copyright(&self, copyright: Option<&str>) {
222 unsafe {
223 ffi::gtk_about_dialog_set_copyright(self.to_glib_none().0, copyright.to_glib_none().0);
224 }
225 }
226
227 #[doc(alias = "gtk_about_dialog_set_documenters")]
228 #[doc(alias = "documenters")]
229 pub fn set_documenters(&self, documenters: &[&str]) {
230 unsafe {
231 ffi::gtk_about_dialog_set_documenters(
232 self.to_glib_none().0,
233 documenters.to_glib_none().0,
234 );
235 }
236 }
237
238 #[doc(alias = "gtk_about_dialog_set_license")]
239 #[doc(alias = "license")]
240 pub fn set_license(&self, license: Option<&str>) {
241 unsafe {
242 ffi::gtk_about_dialog_set_license(self.to_glib_none().0, license.to_glib_none().0);
243 }
244 }
245
246 #[doc(alias = "gtk_about_dialog_set_license_type")]
247 #[doc(alias = "license-type")]
248 pub fn set_license_type(&self, license_type: License) {
249 unsafe {
250 ffi::gtk_about_dialog_set_license_type(self.to_glib_none().0, license_type.into_glib());
251 }
252 }
253
254 #[doc(alias = "gtk_about_dialog_set_logo")]
255 #[doc(alias = "logo")]
256 pub fn set_logo(&self, logo: Option<&impl IsA<gdk::Paintable>>) {
257 unsafe {
258 ffi::gtk_about_dialog_set_logo(
259 self.to_glib_none().0,
260 logo.map(|p| p.as_ref()).to_glib_none().0,
261 );
262 }
263 }
264
265 #[doc(alias = "gtk_about_dialog_set_logo_icon_name")]
266 #[doc(alias = "logo-icon-name")]
267 pub fn set_logo_icon_name(&self, icon_name: Option<&str>) {
268 unsafe {
269 ffi::gtk_about_dialog_set_logo_icon_name(
270 self.to_glib_none().0,
271 icon_name.to_glib_none().0,
272 );
273 }
274 }
275
276 #[doc(alias = "gtk_about_dialog_set_program_name")]
277 #[doc(alias = "program-name")]
278 pub fn set_program_name(&self, name: Option<&str>) {
279 unsafe {
280 ffi::gtk_about_dialog_set_program_name(self.to_glib_none().0, name.to_glib_none().0);
281 }
282 }
283
284 #[doc(alias = "gtk_about_dialog_set_system_information")]
285 #[doc(alias = "system-information")]
286 pub fn set_system_information(&self, system_information: Option<&str>) {
287 unsafe {
288 ffi::gtk_about_dialog_set_system_information(
289 self.to_glib_none().0,
290 system_information.to_glib_none().0,
291 );
292 }
293 }
294
295 #[doc(alias = "gtk_about_dialog_set_translator_credits")]
296 #[doc(alias = "translator-credits")]
297 pub fn set_translator_credits(&self, translator_credits: Option<&str>) {
298 unsafe {
299 ffi::gtk_about_dialog_set_translator_credits(
300 self.to_glib_none().0,
301 translator_credits.to_glib_none().0,
302 );
303 }
304 }
305
306 #[doc(alias = "gtk_about_dialog_set_version")]
307 #[doc(alias = "version")]
308 pub fn set_version(&self, version: Option<&str>) {
309 unsafe {
310 ffi::gtk_about_dialog_set_version(self.to_glib_none().0, version.to_glib_none().0);
311 }
312 }
313
314 #[doc(alias = "gtk_about_dialog_set_website")]
315 #[doc(alias = "website")]
316 pub fn set_website(&self, website: Option<&str>) {
317 unsafe {
318 ffi::gtk_about_dialog_set_website(self.to_glib_none().0, website.to_glib_none().0);
319 }
320 }
321
322 #[doc(alias = "gtk_about_dialog_set_website_label")]
323 #[doc(alias = "website-label")]
324 pub fn set_website_label(&self, website_label: &str) {
325 unsafe {
326 ffi::gtk_about_dialog_set_website_label(
327 self.to_glib_none().0,
328 website_label.to_glib_none().0,
329 );
330 }
331 }
332
333 #[doc(alias = "gtk_about_dialog_set_wrap_license")]
334 #[doc(alias = "wrap-license")]
335 pub fn set_wrap_license(&self, wrap_license: bool) {
336 unsafe {
337 ffi::gtk_about_dialog_set_wrap_license(self.to_glib_none().0, wrap_license.into_glib());
338 }
339 }
340
341 #[doc(alias = "activate-link")]
342 pub fn connect_activate_link<F: Fn(&Self, &str) -> glib::Propagation + 'static>(
343 &self,
344 f: F,
345 ) -> SignalHandlerId {
346 unsafe extern "C" fn activate_link_trampoline<
347 F: Fn(&AboutDialog, &str) -> glib::Propagation + 'static,
348 >(
349 this: *mut ffi::GtkAboutDialog,
350 uri: *mut std::ffi::c_char,
351 f: glib::ffi::gpointer,
352 ) -> glib::ffi::gboolean {
353 let f: &F = &*(f as *const F);
354 f(
355 &from_glib_borrow(this),
356 &glib::GString::from_glib_borrow(uri),
357 )
358 .into_glib()
359 }
360 unsafe {
361 let f: Box_<F> = Box_::new(f);
362 connect_raw(
363 self.as_ptr() as *mut _,
364 b"activate-link\0".as_ptr() as *const _,
365 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
366 activate_link_trampoline::<F> as *const (),
367 )),
368 Box_::into_raw(f),
369 )
370 }
371 }
372
373 #[doc(alias = "artists")]
374 pub fn connect_artists_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
375 unsafe extern "C" fn notify_artists_trampoline<F: Fn(&AboutDialog) + 'static>(
376 this: *mut ffi::GtkAboutDialog,
377 _param_spec: glib::ffi::gpointer,
378 f: glib::ffi::gpointer,
379 ) {
380 let f: &F = &*(f as *const F);
381 f(&from_glib_borrow(this))
382 }
383 unsafe {
384 let f: Box_<F> = Box_::new(f);
385 connect_raw(
386 self.as_ptr() as *mut _,
387 b"notify::artists\0".as_ptr() as *const _,
388 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
389 notify_artists_trampoline::<F> as *const (),
390 )),
391 Box_::into_raw(f),
392 )
393 }
394 }
395
396 #[doc(alias = "authors")]
397 pub fn connect_authors_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
398 unsafe extern "C" fn notify_authors_trampoline<F: Fn(&AboutDialog) + 'static>(
399 this: *mut ffi::GtkAboutDialog,
400 _param_spec: glib::ffi::gpointer,
401 f: glib::ffi::gpointer,
402 ) {
403 let f: &F = &*(f as *const F);
404 f(&from_glib_borrow(this))
405 }
406 unsafe {
407 let f: Box_<F> = Box_::new(f);
408 connect_raw(
409 self.as_ptr() as *mut _,
410 b"notify::authors\0".as_ptr() as *const _,
411 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
412 notify_authors_trampoline::<F> as *const (),
413 )),
414 Box_::into_raw(f),
415 )
416 }
417 }
418
419 #[doc(alias = "comments")]
420 pub fn connect_comments_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
421 unsafe extern "C" fn notify_comments_trampoline<F: Fn(&AboutDialog) + 'static>(
422 this: *mut ffi::GtkAboutDialog,
423 _param_spec: glib::ffi::gpointer,
424 f: glib::ffi::gpointer,
425 ) {
426 let f: &F = &*(f as *const F);
427 f(&from_glib_borrow(this))
428 }
429 unsafe {
430 let f: Box_<F> = Box_::new(f);
431 connect_raw(
432 self.as_ptr() as *mut _,
433 b"notify::comments\0".as_ptr() as *const _,
434 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
435 notify_comments_trampoline::<F> as *const (),
436 )),
437 Box_::into_raw(f),
438 )
439 }
440 }
441
442 #[doc(alias = "copyright")]
443 pub fn connect_copyright_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
444 unsafe extern "C" fn notify_copyright_trampoline<F: Fn(&AboutDialog) + 'static>(
445 this: *mut ffi::GtkAboutDialog,
446 _param_spec: glib::ffi::gpointer,
447 f: glib::ffi::gpointer,
448 ) {
449 let f: &F = &*(f as *const F);
450 f(&from_glib_borrow(this))
451 }
452 unsafe {
453 let f: Box_<F> = Box_::new(f);
454 connect_raw(
455 self.as_ptr() as *mut _,
456 b"notify::copyright\0".as_ptr() as *const _,
457 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
458 notify_copyright_trampoline::<F> as *const (),
459 )),
460 Box_::into_raw(f),
461 )
462 }
463 }
464
465 #[doc(alias = "documenters")]
466 pub fn connect_documenters_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
467 unsafe extern "C" fn notify_documenters_trampoline<F: Fn(&AboutDialog) + 'static>(
468 this: *mut ffi::GtkAboutDialog,
469 _param_spec: glib::ffi::gpointer,
470 f: glib::ffi::gpointer,
471 ) {
472 let f: &F = &*(f as *const F);
473 f(&from_glib_borrow(this))
474 }
475 unsafe {
476 let f: Box_<F> = Box_::new(f);
477 connect_raw(
478 self.as_ptr() as *mut _,
479 b"notify::documenters\0".as_ptr() as *const _,
480 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
481 notify_documenters_trampoline::<F> as *const (),
482 )),
483 Box_::into_raw(f),
484 )
485 }
486 }
487
488 #[doc(alias = "license")]
489 pub fn connect_license_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
490 unsafe extern "C" fn notify_license_trampoline<F: Fn(&AboutDialog) + 'static>(
491 this: *mut ffi::GtkAboutDialog,
492 _param_spec: glib::ffi::gpointer,
493 f: glib::ffi::gpointer,
494 ) {
495 let f: &F = &*(f as *const F);
496 f(&from_glib_borrow(this))
497 }
498 unsafe {
499 let f: Box_<F> = Box_::new(f);
500 connect_raw(
501 self.as_ptr() as *mut _,
502 b"notify::license\0".as_ptr() as *const _,
503 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
504 notify_license_trampoline::<F> as *const (),
505 )),
506 Box_::into_raw(f),
507 )
508 }
509 }
510
511 #[doc(alias = "license-type")]
512 pub fn connect_license_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
513 unsafe extern "C" fn notify_license_type_trampoline<F: Fn(&AboutDialog) + 'static>(
514 this: *mut ffi::GtkAboutDialog,
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::license-type\0".as_ptr() as *const _,
526 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
527 notify_license_type_trampoline::<F> as *const (),
528 )),
529 Box_::into_raw(f),
530 )
531 }
532 }
533
534 #[doc(alias = "logo")]
535 pub fn connect_logo_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
536 unsafe extern "C" fn notify_logo_trampoline<F: Fn(&AboutDialog) + 'static>(
537 this: *mut ffi::GtkAboutDialog,
538 _param_spec: glib::ffi::gpointer,
539 f: glib::ffi::gpointer,
540 ) {
541 let f: &F = &*(f as *const F);
542 f(&from_glib_borrow(this))
543 }
544 unsafe {
545 let f: Box_<F> = Box_::new(f);
546 connect_raw(
547 self.as_ptr() as *mut _,
548 b"notify::logo\0".as_ptr() as *const _,
549 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
550 notify_logo_trampoline::<F> as *const (),
551 )),
552 Box_::into_raw(f),
553 )
554 }
555 }
556
557 #[doc(alias = "logo-icon-name")]
558 pub fn connect_logo_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
559 unsafe extern "C" fn notify_logo_icon_name_trampoline<F: Fn(&AboutDialog) + 'static>(
560 this: *mut ffi::GtkAboutDialog,
561 _param_spec: glib::ffi::gpointer,
562 f: glib::ffi::gpointer,
563 ) {
564 let f: &F = &*(f as *const F);
565 f(&from_glib_borrow(this))
566 }
567 unsafe {
568 let f: Box_<F> = Box_::new(f);
569 connect_raw(
570 self.as_ptr() as *mut _,
571 b"notify::logo-icon-name\0".as_ptr() as *const _,
572 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
573 notify_logo_icon_name_trampoline::<F> as *const (),
574 )),
575 Box_::into_raw(f),
576 )
577 }
578 }
579
580 #[doc(alias = "program-name")]
581 pub fn connect_program_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
582 unsafe extern "C" fn notify_program_name_trampoline<F: Fn(&AboutDialog) + 'static>(
583 this: *mut ffi::GtkAboutDialog,
584 _param_spec: glib::ffi::gpointer,
585 f: glib::ffi::gpointer,
586 ) {
587 let f: &F = &*(f as *const F);
588 f(&from_glib_borrow(this))
589 }
590 unsafe {
591 let f: Box_<F> = Box_::new(f);
592 connect_raw(
593 self.as_ptr() as *mut _,
594 b"notify::program-name\0".as_ptr() as *const _,
595 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
596 notify_program_name_trampoline::<F> as *const (),
597 )),
598 Box_::into_raw(f),
599 )
600 }
601 }
602
603 #[doc(alias = "system-information")]
604 pub fn connect_system_information_notify<F: Fn(&Self) + 'static>(
605 &self,
606 f: F,
607 ) -> SignalHandlerId {
608 unsafe extern "C" fn notify_system_information_trampoline<F: Fn(&AboutDialog) + 'static>(
609 this: *mut ffi::GtkAboutDialog,
610 _param_spec: glib::ffi::gpointer,
611 f: glib::ffi::gpointer,
612 ) {
613 let f: &F = &*(f as *const F);
614 f(&from_glib_borrow(this))
615 }
616 unsafe {
617 let f: Box_<F> = Box_::new(f);
618 connect_raw(
619 self.as_ptr() as *mut _,
620 b"notify::system-information\0".as_ptr() as *const _,
621 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
622 notify_system_information_trampoline::<F> as *const (),
623 )),
624 Box_::into_raw(f),
625 )
626 }
627 }
628
629 #[doc(alias = "translator-credits")]
630 pub fn connect_translator_credits_notify<F: Fn(&Self) + 'static>(
631 &self,
632 f: F,
633 ) -> SignalHandlerId {
634 unsafe extern "C" fn notify_translator_credits_trampoline<F: Fn(&AboutDialog) + 'static>(
635 this: *mut ffi::GtkAboutDialog,
636 _param_spec: glib::ffi::gpointer,
637 f: glib::ffi::gpointer,
638 ) {
639 let f: &F = &*(f as *const F);
640 f(&from_glib_borrow(this))
641 }
642 unsafe {
643 let f: Box_<F> = Box_::new(f);
644 connect_raw(
645 self.as_ptr() as *mut _,
646 b"notify::translator-credits\0".as_ptr() as *const _,
647 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
648 notify_translator_credits_trampoline::<F> as *const (),
649 )),
650 Box_::into_raw(f),
651 )
652 }
653 }
654
655 #[doc(alias = "version")]
656 pub fn connect_version_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
657 unsafe extern "C" fn notify_version_trampoline<F: Fn(&AboutDialog) + 'static>(
658 this: *mut ffi::GtkAboutDialog,
659 _param_spec: glib::ffi::gpointer,
660 f: glib::ffi::gpointer,
661 ) {
662 let f: &F = &*(f as *const F);
663 f(&from_glib_borrow(this))
664 }
665 unsafe {
666 let f: Box_<F> = Box_::new(f);
667 connect_raw(
668 self.as_ptr() as *mut _,
669 b"notify::version\0".as_ptr() as *const _,
670 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
671 notify_version_trampoline::<F> as *const (),
672 )),
673 Box_::into_raw(f),
674 )
675 }
676 }
677
678 #[doc(alias = "website")]
679 pub fn connect_website_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
680 unsafe extern "C" fn notify_website_trampoline<F: Fn(&AboutDialog) + 'static>(
681 this: *mut ffi::GtkAboutDialog,
682 _param_spec: glib::ffi::gpointer,
683 f: glib::ffi::gpointer,
684 ) {
685 let f: &F = &*(f as *const F);
686 f(&from_glib_borrow(this))
687 }
688 unsafe {
689 let f: Box_<F> = Box_::new(f);
690 connect_raw(
691 self.as_ptr() as *mut _,
692 b"notify::website\0".as_ptr() as *const _,
693 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
694 notify_website_trampoline::<F> as *const (),
695 )),
696 Box_::into_raw(f),
697 )
698 }
699 }
700
701 #[doc(alias = "website-label")]
702 pub fn connect_website_label_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
703 unsafe extern "C" fn notify_website_label_trampoline<F: Fn(&AboutDialog) + 'static>(
704 this: *mut ffi::GtkAboutDialog,
705 _param_spec: glib::ffi::gpointer,
706 f: glib::ffi::gpointer,
707 ) {
708 let f: &F = &*(f as *const F);
709 f(&from_glib_borrow(this))
710 }
711 unsafe {
712 let f: Box_<F> = Box_::new(f);
713 connect_raw(
714 self.as_ptr() as *mut _,
715 b"notify::website-label\0".as_ptr() as *const _,
716 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
717 notify_website_label_trampoline::<F> as *const (),
718 )),
719 Box_::into_raw(f),
720 )
721 }
722 }
723
724 #[doc(alias = "wrap-license")]
725 pub fn connect_wrap_license_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
726 unsafe extern "C" fn notify_wrap_license_trampoline<F: Fn(&AboutDialog) + 'static>(
727 this: *mut ffi::GtkAboutDialog,
728 _param_spec: glib::ffi::gpointer,
729 f: glib::ffi::gpointer,
730 ) {
731 let f: &F = &*(f as *const F);
732 f(&from_glib_borrow(this))
733 }
734 unsafe {
735 let f: Box_<F> = Box_::new(f);
736 connect_raw(
737 self.as_ptr() as *mut _,
738 b"notify::wrap-license\0".as_ptr() as *const _,
739 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
740 notify_wrap_license_trampoline::<F> as *const (),
741 )),
742 Box_::into_raw(f),
743 )
744 }
745 }
746}
747
748impl Default for AboutDialog {
749 fn default() -> Self {
750 Self::new()
751 }
752}
753
754#[must_use = "The builder must be built to be used"]
759pub struct AboutDialogBuilder {
760 builder: glib::object::ObjectBuilder<'static, AboutDialog>,
761}
762
763impl AboutDialogBuilder {
764 fn new() -> Self {
765 Self {
766 builder: glib::object::Object::builder(),
767 }
768 }
769
770 pub fn artists(self, artists: impl Into<glib::StrV>) -> Self {
771 Self {
772 builder: self.builder.property("artists", artists.into()),
773 }
774 }
775
776 pub fn authors(self, authors: impl Into<glib::StrV>) -> Self {
777 Self {
778 builder: self.builder.property("authors", authors.into()),
779 }
780 }
781
782 pub fn comments(self, comments: impl Into<glib::GString>) -> Self {
783 Self {
784 builder: self.builder.property("comments", comments.into()),
785 }
786 }
787
788 pub fn copyright(self, copyright: impl Into<glib::GString>) -> Self {
789 Self {
790 builder: self.builder.property("copyright", copyright.into()),
791 }
792 }
793
794 pub fn documenters(self, documenters: impl Into<glib::StrV>) -> Self {
795 Self {
796 builder: self.builder.property("documenters", documenters.into()),
797 }
798 }
799
800 pub fn license(self, license: impl Into<glib::GString>) -> Self {
801 Self {
802 builder: self.builder.property("license", license.into()),
803 }
804 }
805
806 pub fn license_type(self, license_type: License) -> Self {
807 Self {
808 builder: self.builder.property("license-type", license_type),
809 }
810 }
811
812 pub fn logo(self, logo: &impl IsA<gdk::Paintable>) -> Self {
813 Self {
814 builder: self.builder.property("logo", logo.clone().upcast()),
815 }
816 }
817
818 pub fn logo_icon_name(self, logo_icon_name: impl Into<glib::GString>) -> Self {
819 Self {
820 builder: self
821 .builder
822 .property("logo-icon-name", logo_icon_name.into()),
823 }
824 }
825
826 pub fn program_name(self, program_name: impl Into<glib::GString>) -> Self {
827 Self {
828 builder: self.builder.property("program-name", program_name.into()),
829 }
830 }
831
832 pub fn system_information(self, system_information: impl Into<glib::GString>) -> Self {
833 Self {
834 builder: self
835 .builder
836 .property("system-information", system_information.into()),
837 }
838 }
839
840 pub fn translator_credits(self, translator_credits: impl Into<glib::GString>) -> Self {
841 Self {
842 builder: self
843 .builder
844 .property("translator-credits", translator_credits.into()),
845 }
846 }
847
848 pub fn version(self, version: impl Into<glib::GString>) -> Self {
849 Self {
850 builder: self.builder.property("version", version.into()),
851 }
852 }
853
854 pub fn website(self, website: impl Into<glib::GString>) -> Self {
855 Self {
856 builder: self.builder.property("website", website.into()),
857 }
858 }
859
860 pub fn website_label(self, website_label: impl Into<glib::GString>) -> Self {
861 Self {
862 builder: self.builder.property("website-label", website_label.into()),
863 }
864 }
865
866 pub fn wrap_license(self, wrap_license: bool) -> Self {
867 Self {
868 builder: self.builder.property("wrap-license", wrap_license),
869 }
870 }
871
872 pub fn application(self, application: &impl IsA<Application>) -> Self {
873 Self {
874 builder: self
875 .builder
876 .property("application", application.clone().upcast()),
877 }
878 }
879
880 pub fn child(self, child: &impl IsA<Widget>) -> Self {
881 Self {
882 builder: self.builder.property("child", child.clone().upcast()),
883 }
884 }
885
886 pub fn decorated(self, decorated: bool) -> Self {
887 Self {
888 builder: self.builder.property("decorated", decorated),
889 }
890 }
891
892 pub fn default_height(self, default_height: i32) -> Self {
893 Self {
894 builder: self.builder.property("default-height", default_height),
895 }
896 }
897
898 pub fn default_widget(self, default_widget: &impl IsA<Widget>) -> Self {
899 Self {
900 builder: self
901 .builder
902 .property("default-widget", default_widget.clone().upcast()),
903 }
904 }
905
906 pub fn default_width(self, default_width: i32) -> Self {
907 Self {
908 builder: self.builder.property("default-width", default_width),
909 }
910 }
911
912 pub fn deletable(self, deletable: bool) -> Self {
913 Self {
914 builder: self.builder.property("deletable", deletable),
915 }
916 }
917
918 pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self {
919 Self {
920 builder: self
921 .builder
922 .property("destroy-with-parent", destroy_with_parent),
923 }
924 }
925
926 pub fn display(self, display: &impl IsA<gdk::Display>) -> Self {
927 Self {
928 builder: self.builder.property("display", display.clone().upcast()),
929 }
930 }
931
932 pub fn focus_visible(self, focus_visible: bool) -> Self {
933 Self {
934 builder: self.builder.property("focus-visible", focus_visible),
935 }
936 }
937
938 pub fn focus_widget(self, focus_widget: &impl IsA<Widget>) -> Self {
939 Self {
940 builder: self
941 .builder
942 .property("focus-widget", focus_widget.clone().upcast()),
943 }
944 }
945
946 pub fn fullscreened(self, fullscreened: bool) -> Self {
947 Self {
948 builder: self.builder.property("fullscreened", fullscreened),
949 }
950 }
951
952 #[cfg(feature = "v4_2")]
953 #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))]
954 pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self {
955 Self {
956 builder: self
957 .builder
958 .property("handle-menubar-accel", handle_menubar_accel),
959 }
960 }
961
962 pub fn hide_on_close(self, hide_on_close: bool) -> Self {
963 Self {
964 builder: self.builder.property("hide-on-close", hide_on_close),
965 }
966 }
967
968 pub fn icon_name(self, icon_name: impl Into<glib::GString>) -> Self {
969 Self {
970 builder: self.builder.property("icon-name", icon_name.into()),
971 }
972 }
973
974 pub fn maximized(self, maximized: bool) -> Self {
975 Self {
976 builder: self.builder.property("maximized", maximized),
977 }
978 }
979
980 pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self {
981 Self {
982 builder: self
983 .builder
984 .property("mnemonics-visible", mnemonics_visible),
985 }
986 }
987
988 pub fn modal(self, modal: bool) -> Self {
989 Self {
990 builder: self.builder.property("modal", modal),
991 }
992 }
993
994 pub fn resizable(self, resizable: bool) -> Self {
995 Self {
996 builder: self.builder.property("resizable", resizable),
997 }
998 }
999
1000 pub fn startup_id(self, startup_id: impl Into<glib::GString>) -> Self {
1001 Self {
1002 builder: self.builder.property("startup-id", startup_id.into()),
1003 }
1004 }
1005
1006 pub fn title(self, title: impl Into<glib::GString>) -> Self {
1007 Self {
1008 builder: self.builder.property("title", title.into()),
1009 }
1010 }
1011
1012 #[cfg(feature = "v4_6")]
1013 #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
1014 pub fn titlebar(self, titlebar: &impl IsA<Widget>) -> Self {
1015 Self {
1016 builder: self.builder.property("titlebar", titlebar.clone().upcast()),
1017 }
1018 }
1019
1020 pub fn transient_for(self, transient_for: &impl IsA<Window>) -> Self {
1021 Self {
1022 builder: self
1023 .builder
1024 .property("transient-for", transient_for.clone().upcast()),
1025 }
1026 }
1027
1028 pub fn can_focus(self, can_focus: bool) -> Self {
1029 Self {
1030 builder: self.builder.property("can-focus", can_focus),
1031 }
1032 }
1033
1034 pub fn can_target(self, can_target: bool) -> Self {
1035 Self {
1036 builder: self.builder.property("can-target", can_target),
1037 }
1038 }
1039
1040 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
1041 Self {
1042 builder: self.builder.property("css-classes", css_classes.into()),
1043 }
1044 }
1045
1046 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
1047 Self {
1048 builder: self.builder.property("css-name", css_name.into()),
1049 }
1050 }
1051
1052 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
1053 Self {
1054 builder: self.builder.property("cursor", cursor.clone()),
1055 }
1056 }
1057
1058 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
1059 Self {
1060 builder: self.builder.property("focus-on-click", focus_on_click),
1061 }
1062 }
1063
1064 pub fn focusable(self, focusable: bool) -> Self {
1065 Self {
1066 builder: self.builder.property("focusable", focusable),
1067 }
1068 }
1069
1070 pub fn halign(self, halign: Align) -> Self {
1071 Self {
1072 builder: self.builder.property("halign", halign),
1073 }
1074 }
1075
1076 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
1077 Self {
1078 builder: self.builder.property("has-tooltip", has_tooltip),
1079 }
1080 }
1081
1082 pub fn height_request(self, height_request: i32) -> Self {
1083 Self {
1084 builder: self.builder.property("height-request", height_request),
1085 }
1086 }
1087
1088 pub fn hexpand(self, hexpand: bool) -> Self {
1089 Self {
1090 builder: self.builder.property("hexpand", hexpand),
1091 }
1092 }
1093
1094 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
1095 Self {
1096 builder: self.builder.property("hexpand-set", hexpand_set),
1097 }
1098 }
1099
1100 pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
1101 Self {
1102 builder: self
1103 .builder
1104 .property("layout-manager", layout_manager.clone().upcast()),
1105 }
1106 }
1107
1108 #[cfg(feature = "v4_18")]
1109 #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
1110 pub fn limit_events(self, limit_events: bool) -> Self {
1111 Self {
1112 builder: self.builder.property("limit-events", limit_events),
1113 }
1114 }
1115
1116 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
1117 Self {
1118 builder: self.builder.property("margin-bottom", margin_bottom),
1119 }
1120 }
1121
1122 pub fn margin_end(self, margin_end: i32) -> Self {
1123 Self {
1124 builder: self.builder.property("margin-end", margin_end),
1125 }
1126 }
1127
1128 pub fn margin_start(self, margin_start: i32) -> Self {
1129 Self {
1130 builder: self.builder.property("margin-start", margin_start),
1131 }
1132 }
1133
1134 pub fn margin_top(self, margin_top: i32) -> Self {
1135 Self {
1136 builder: self.builder.property("margin-top", margin_top),
1137 }
1138 }
1139
1140 pub fn name(self, name: impl Into<glib::GString>) -> Self {
1141 Self {
1142 builder: self.builder.property("name", name.into()),
1143 }
1144 }
1145
1146 pub fn opacity(self, opacity: f64) -> Self {
1147 Self {
1148 builder: self.builder.property("opacity", opacity),
1149 }
1150 }
1151
1152 pub fn overflow(self, overflow: Overflow) -> Self {
1153 Self {
1154 builder: self.builder.property("overflow", overflow),
1155 }
1156 }
1157
1158 pub fn receives_default(self, receives_default: bool) -> Self {
1159 Self {
1160 builder: self.builder.property("receives-default", receives_default),
1161 }
1162 }
1163
1164 pub fn sensitive(self, sensitive: bool) -> Self {
1165 Self {
1166 builder: self.builder.property("sensitive", sensitive),
1167 }
1168 }
1169
1170 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
1171 Self {
1172 builder: self
1173 .builder
1174 .property("tooltip-markup", tooltip_markup.into()),
1175 }
1176 }
1177
1178 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
1179 Self {
1180 builder: self.builder.property("tooltip-text", tooltip_text.into()),
1181 }
1182 }
1183
1184 pub fn valign(self, valign: Align) -> Self {
1185 Self {
1186 builder: self.builder.property("valign", valign),
1187 }
1188 }
1189
1190 pub fn vexpand(self, vexpand: bool) -> Self {
1191 Self {
1192 builder: self.builder.property("vexpand", vexpand),
1193 }
1194 }
1195
1196 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
1197 Self {
1198 builder: self.builder.property("vexpand-set", vexpand_set),
1199 }
1200 }
1201
1202 pub fn visible(self, visible: bool) -> Self {
1203 Self {
1204 builder: self.builder.property("visible", visible),
1205 }
1206 }
1207
1208 pub fn width_request(self, width_request: i32) -> Self {
1209 Self {
1210 builder: self.builder.property("width-request", width_request),
1211 }
1212 }
1213
1214 pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
1215 Self {
1216 builder: self.builder.property("accessible-role", accessible_role),
1217 }
1218 }
1219
1220 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
1223 pub fn build(self) -> AboutDialog {
1224 assert_initialized_main_thread!();
1225 self.builder.build()
1226 }
1227}