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