1use gdk;
6use gdk_pixbuf;
7use glib::object::Cast;
8use glib::object::IsA;
9use glib::signal::connect_raw;
10use glib::signal::SignalHandlerId;
11use glib::translate::*;
12use glib::GString;
13use glib::StaticType;
14use glib::ToValue;
15use glib_sys;
16use gtk_sys;
17use libc;
18use signal::Inhibit;
19use std::boxed::Box as Box_;
20use std::fmt;
21use std::mem::transmute;
22use Align;
23use Application;
24use Bin;
25use Buildable;
26use Container;
27use Dialog;
28use License;
29use ResizeMode;
30use Widget;
31use Window;
32use WindowPosition;
33use WindowType;
34
35glib_wrapper! {
36 pub struct AboutDialog(Object<gtk_sys::GtkAboutDialog, gtk_sys::GtkAboutDialogClass, AboutDialogClass>) @extends Dialog, Window, Bin, Container, Widget, @implements Buildable;
37
38 match fn {
39 get_type => || gtk_sys::gtk_about_dialog_get_type(),
40 }
41}
42
43impl AboutDialog {
44 pub fn new() -> AboutDialog {
45 assert_initialized_main_thread!();
46 unsafe { Widget::from_glib_none(gtk_sys::gtk_about_dialog_new()).unsafe_cast() }
47 }
48}
49
50impl Default for AboutDialog {
51 fn default() -> Self {
52 Self::new()
53 }
54}
55
56pub struct AboutDialogBuilder {
57 artists: Option<Vec<String>>,
58 authors: Option<Vec<String>>,
59 comments: Option<String>,
60 copyright: Option<String>,
61 documenters: Option<Vec<String>>,
62 license: Option<String>,
63 license_type: Option<License>,
64 logo: Option<gdk_pixbuf::Pixbuf>,
65 logo_icon_name: Option<String>,
66 program_name: Option<String>,
67 translator_credits: Option<String>,
68 version: Option<String>,
69 website: Option<String>,
70 website_label: Option<String>,
71 wrap_license: Option<bool>,
72 use_header_bar: Option<i32>,
73 accept_focus: Option<bool>,
74 application: Option<Application>,
75 attached_to: Option<Widget>,
76 decorated: Option<bool>,
77 default_height: Option<i32>,
78 default_width: Option<i32>,
79 deletable: Option<bool>,
80 destroy_with_parent: Option<bool>,
81 focus_on_map: Option<bool>,
82 focus_visible: Option<bool>,
83 gravity: Option<gdk::Gravity>,
84 hide_titlebar_when_maximized: Option<bool>,
85 icon: Option<gdk_pixbuf::Pixbuf>,
86 icon_name: Option<String>,
87 mnemonics_visible: Option<bool>,
88 modal: Option<bool>,
89 resizable: Option<bool>,
90 role: Option<String>,
91 screen: Option<gdk::Screen>,
92 skip_pager_hint: Option<bool>,
93 skip_taskbar_hint: Option<bool>,
94 startup_id: Option<String>,
95 title: Option<String>,
96 transient_for: Option<Window>,
97 type_: Option<WindowType>,
98 type_hint: Option<gdk::WindowTypeHint>,
99 urgency_hint: Option<bool>,
100 window_position: Option<WindowPosition>,
101 border_width: Option<u32>,
102 child: Option<Widget>,
103 resize_mode: Option<ResizeMode>,
104 app_paintable: Option<bool>,
105 can_default: Option<bool>,
106 can_focus: Option<bool>,
107 events: Option<gdk::EventMask>,
108 expand: Option<bool>,
109 #[cfg(any(feature = "v3_20", feature = "dox"))]
110 focus_on_click: Option<bool>,
111 halign: Option<Align>,
112 has_default: Option<bool>,
113 has_focus: Option<bool>,
114 has_tooltip: Option<bool>,
115 height_request: Option<i32>,
116 hexpand: Option<bool>,
117 hexpand_set: Option<bool>,
118 is_focus: Option<bool>,
119 margin: Option<i32>,
120 margin_bottom: Option<i32>,
121 margin_end: Option<i32>,
122 margin_start: Option<i32>,
123 margin_top: Option<i32>,
124 name: Option<String>,
125 no_show_all: Option<bool>,
126 opacity: Option<f64>,
127 parent: Option<Container>,
128 receives_default: Option<bool>,
129 sensitive: Option<bool>,
130 tooltip_markup: Option<String>,
132 tooltip_text: Option<String>,
133 valign: Option<Align>,
134 vexpand: Option<bool>,
135 vexpand_set: Option<bool>,
136 visible: Option<bool>,
137 width_request: Option<i32>,
138}
139
140impl AboutDialogBuilder {
141 pub fn new() -> Self {
142 Self {
143 artists: None,
144 authors: None,
145 comments: None,
146 copyright: None,
147 documenters: None,
148 license: None,
149 license_type: None,
150 logo: None,
151 logo_icon_name: None,
152 program_name: None,
153 translator_credits: None,
154 version: None,
155 website: None,
156 website_label: None,
157 wrap_license: None,
158 use_header_bar: None,
159 accept_focus: None,
160 application: None,
161 attached_to: None,
162 decorated: None,
163 default_height: None,
164 default_width: None,
165 deletable: None,
166 destroy_with_parent: None,
167 focus_on_map: None,
168 focus_visible: None,
169 gravity: None,
170 hide_titlebar_when_maximized: None,
171 icon: None,
172 icon_name: None,
173 mnemonics_visible: None,
174 modal: None,
175 resizable: None,
176 role: None,
177 screen: None,
178 skip_pager_hint: None,
179 skip_taskbar_hint: None,
180 startup_id: None,
181 title: None,
182 transient_for: None,
183 type_: None,
184 type_hint: None,
185 urgency_hint: None,
186 window_position: None,
187 border_width: None,
188 child: None,
189 resize_mode: None,
190 app_paintable: None,
191 can_default: None,
192 can_focus: None,
193 events: None,
194 expand: None,
195 #[cfg(any(feature = "v3_20", feature = "dox"))]
196 focus_on_click: None,
197 halign: None,
198 has_default: None,
199 has_focus: None,
200 has_tooltip: None,
201 height_request: None,
202 hexpand: None,
203 hexpand_set: None,
204 is_focus: None,
205 margin: None,
206 margin_bottom: None,
207 margin_end: None,
208 margin_start: None,
209 margin_top: None,
210 name: None,
211 no_show_all: None,
212 opacity: None,
213 parent: None,
214 receives_default: None,
215 sensitive: None,
216 tooltip_markup: None,
217 tooltip_text: None,
218 valign: None,
219 vexpand: None,
220 vexpand_set: None,
221 visible: None,
222 width_request: None,
223 }
224 }
225
226 pub fn build(self) -> AboutDialog {
227 let mut properties: Vec<(&str, &dyn ToValue)> = vec![];
228 if let Some(ref artists) = self.artists {
229 properties.push(("artists", artists));
230 }
231 if let Some(ref authors) = self.authors {
232 properties.push(("authors", authors));
233 }
234 if let Some(ref comments) = self.comments {
235 properties.push(("comments", comments));
236 }
237 if let Some(ref copyright) = self.copyright {
238 properties.push(("copyright", copyright));
239 }
240 if let Some(ref documenters) = self.documenters {
241 properties.push(("documenters", documenters));
242 }
243 if let Some(ref license) = self.license {
244 properties.push(("license", license));
245 }
246 if let Some(ref license_type) = self.license_type {
247 properties.push(("license-type", license_type));
248 }
249 if let Some(ref logo) = self.logo {
250 properties.push(("logo", logo));
251 }
252 if let Some(ref logo_icon_name) = self.logo_icon_name {
253 properties.push(("logo-icon-name", logo_icon_name));
254 }
255 if let Some(ref program_name) = self.program_name {
256 properties.push(("program-name", program_name));
257 }
258 if let Some(ref translator_credits) = self.translator_credits {
259 properties.push(("translator-credits", translator_credits));
260 }
261 if let Some(ref version) = self.version {
262 properties.push(("version", version));
263 }
264 if let Some(ref website) = self.website {
265 properties.push(("website", website));
266 }
267 if let Some(ref website_label) = self.website_label {
268 properties.push(("website-label", website_label));
269 }
270 if let Some(ref wrap_license) = self.wrap_license {
271 properties.push(("wrap-license", wrap_license));
272 }
273 if let Some(ref use_header_bar) = self.use_header_bar {
274 properties.push(("use-header-bar", use_header_bar));
275 }
276 if let Some(ref accept_focus) = self.accept_focus {
277 properties.push(("accept-focus", accept_focus));
278 }
279 if let Some(ref application) = self.application {
280 properties.push(("application", application));
281 }
282 if let Some(ref attached_to) = self.attached_to {
283 properties.push(("attached-to", attached_to));
284 }
285 if let Some(ref decorated) = self.decorated {
286 properties.push(("decorated", decorated));
287 }
288 if let Some(ref default_height) = self.default_height {
289 properties.push(("default-height", default_height));
290 }
291 if let Some(ref default_width) = self.default_width {
292 properties.push(("default-width", default_width));
293 }
294 if let Some(ref deletable) = self.deletable {
295 properties.push(("deletable", deletable));
296 }
297 if let Some(ref destroy_with_parent) = self.destroy_with_parent {
298 properties.push(("destroy-with-parent", destroy_with_parent));
299 }
300 if let Some(ref focus_on_map) = self.focus_on_map {
301 properties.push(("focus-on-map", focus_on_map));
302 }
303 if let Some(ref focus_visible) = self.focus_visible {
304 properties.push(("focus-visible", focus_visible));
305 }
306 if let Some(ref gravity) = self.gravity {
307 properties.push(("gravity", gravity));
308 }
309 if let Some(ref hide_titlebar_when_maximized) = self.hide_titlebar_when_maximized {
310 properties.push(("hide-titlebar-when-maximized", hide_titlebar_when_maximized));
311 }
312 if let Some(ref icon) = self.icon {
313 properties.push(("icon", icon));
314 }
315 if let Some(ref icon_name) = self.icon_name {
316 properties.push(("icon-name", icon_name));
317 }
318 if let Some(ref mnemonics_visible) = self.mnemonics_visible {
319 properties.push(("mnemonics-visible", mnemonics_visible));
320 }
321 if let Some(ref modal) = self.modal {
322 properties.push(("modal", modal));
323 }
324 if let Some(ref resizable) = self.resizable {
325 properties.push(("resizable", resizable));
326 }
327 if let Some(ref role) = self.role {
328 properties.push(("role", role));
329 }
330 if let Some(ref screen) = self.screen {
331 properties.push(("screen", screen));
332 }
333 if let Some(ref skip_pager_hint) = self.skip_pager_hint {
334 properties.push(("skip-pager-hint", skip_pager_hint));
335 }
336 if let Some(ref skip_taskbar_hint) = self.skip_taskbar_hint {
337 properties.push(("skip-taskbar-hint", skip_taskbar_hint));
338 }
339 if let Some(ref startup_id) = self.startup_id {
340 properties.push(("startup-id", startup_id));
341 }
342 if let Some(ref title) = self.title {
343 properties.push(("title", title));
344 }
345 if let Some(ref transient_for) = self.transient_for {
346 properties.push(("transient-for", transient_for));
347 }
348 if let Some(ref type_) = self.type_ {
349 properties.push(("type", type_));
350 }
351 if let Some(ref type_hint) = self.type_hint {
352 properties.push(("type-hint", type_hint));
353 }
354 if let Some(ref urgency_hint) = self.urgency_hint {
355 properties.push(("urgency-hint", urgency_hint));
356 }
357 if let Some(ref window_position) = self.window_position {
358 properties.push(("window-position", window_position));
359 }
360 if let Some(ref border_width) = self.border_width {
361 properties.push(("border-width", border_width));
362 }
363 if let Some(ref child) = self.child {
364 properties.push(("child", child));
365 }
366 if let Some(ref resize_mode) = self.resize_mode {
367 properties.push(("resize-mode", resize_mode));
368 }
369 if let Some(ref app_paintable) = self.app_paintable {
370 properties.push(("app-paintable", app_paintable));
371 }
372 if let Some(ref can_default) = self.can_default {
373 properties.push(("can-default", can_default));
374 }
375 if let Some(ref can_focus) = self.can_focus {
376 properties.push(("can-focus", can_focus));
377 }
378 if let Some(ref events) = self.events {
379 properties.push(("events", events));
380 }
381 if let Some(ref expand) = self.expand {
382 properties.push(("expand", expand));
383 }
384 #[cfg(any(feature = "v3_20", feature = "dox"))]
385 {
386 if let Some(ref focus_on_click) = self.focus_on_click {
387 properties.push(("focus-on-click", focus_on_click));
388 }
389 }
390 if let Some(ref halign) = self.halign {
391 properties.push(("halign", halign));
392 }
393 if let Some(ref has_default) = self.has_default {
394 properties.push(("has-default", has_default));
395 }
396 if let Some(ref has_focus) = self.has_focus {
397 properties.push(("has-focus", has_focus));
398 }
399 if let Some(ref has_tooltip) = self.has_tooltip {
400 properties.push(("has-tooltip", has_tooltip));
401 }
402 if let Some(ref height_request) = self.height_request {
403 properties.push(("height-request", height_request));
404 }
405 if let Some(ref hexpand) = self.hexpand {
406 properties.push(("hexpand", hexpand));
407 }
408 if let Some(ref hexpand_set) = self.hexpand_set {
409 properties.push(("hexpand-set", hexpand_set));
410 }
411 if let Some(ref is_focus) = self.is_focus {
412 properties.push(("is-focus", is_focus));
413 }
414 if let Some(ref margin) = self.margin {
415 properties.push(("margin", margin));
416 }
417 if let Some(ref margin_bottom) = self.margin_bottom {
418 properties.push(("margin-bottom", margin_bottom));
419 }
420 if let Some(ref margin_end) = self.margin_end {
421 properties.push(("margin-end", margin_end));
422 }
423 if let Some(ref margin_start) = self.margin_start {
424 properties.push(("margin-start", margin_start));
425 }
426 if let Some(ref margin_top) = self.margin_top {
427 properties.push(("margin-top", margin_top));
428 }
429 if let Some(ref name) = self.name {
430 properties.push(("name", name));
431 }
432 if let Some(ref no_show_all) = self.no_show_all {
433 properties.push(("no-show-all", no_show_all));
434 }
435 if let Some(ref opacity) = self.opacity {
436 properties.push(("opacity", opacity));
437 }
438 if let Some(ref parent) = self.parent {
439 properties.push(("parent", parent));
440 }
441 if let Some(ref receives_default) = self.receives_default {
442 properties.push(("receives-default", receives_default));
443 }
444 if let Some(ref sensitive) = self.sensitive {
445 properties.push(("sensitive", sensitive));
446 }
447 if let Some(ref tooltip_markup) = self.tooltip_markup {
448 properties.push(("tooltip-markup", tooltip_markup));
449 }
450 if let Some(ref tooltip_text) = self.tooltip_text {
451 properties.push(("tooltip-text", tooltip_text));
452 }
453 if let Some(ref valign) = self.valign {
454 properties.push(("valign", valign));
455 }
456 if let Some(ref vexpand) = self.vexpand {
457 properties.push(("vexpand", vexpand));
458 }
459 if let Some(ref vexpand_set) = self.vexpand_set {
460 properties.push(("vexpand-set", vexpand_set));
461 }
462 if let Some(ref visible) = self.visible {
463 properties.push(("visible", visible));
464 }
465 if let Some(ref width_request) = self.width_request {
466 properties.push(("width-request", width_request));
467 }
468 glib::Object::new(AboutDialog::static_type(), &properties)
469 .expect("object new")
470 .downcast()
471 .expect("downcast")
472 }
473
474 pub fn artists(mut self, artists: Vec<String>) -> Self {
475 self.artists = Some(artists);
476 self
477 }
478
479 pub fn authors(mut self, authors: Vec<String>) -> Self {
480 self.authors = Some(authors);
481 self
482 }
483
484 pub fn comments(mut self, comments: &str) -> Self {
485 self.comments = Some(comments.to_string());
486 self
487 }
488
489 pub fn copyright(mut self, copyright: &str) -> Self {
490 self.copyright = Some(copyright.to_string());
491 self
492 }
493
494 pub fn documenters(mut self, documenters: Vec<String>) -> Self {
495 self.documenters = Some(documenters);
496 self
497 }
498
499 pub fn license(mut self, license: &str) -> Self {
500 self.license = Some(license.to_string());
501 self
502 }
503
504 pub fn license_type(mut self, license_type: License) -> Self {
505 self.license_type = Some(license_type);
506 self
507 }
508
509 pub fn logo(mut self, logo: &gdk_pixbuf::Pixbuf) -> Self {
510 self.logo = Some(logo.clone());
511 self
512 }
513
514 pub fn logo_icon_name(mut self, logo_icon_name: &str) -> Self {
515 self.logo_icon_name = Some(logo_icon_name.to_string());
516 self
517 }
518
519 pub fn program_name(mut self, program_name: &str) -> Self {
520 self.program_name = Some(program_name.to_string());
521 self
522 }
523
524 pub fn translator_credits(mut self, translator_credits: &str) -> Self {
525 self.translator_credits = Some(translator_credits.to_string());
526 self
527 }
528
529 pub fn version(mut self, version: &str) -> Self {
530 self.version = Some(version.to_string());
531 self
532 }
533
534 pub fn website(mut self, website: &str) -> Self {
535 self.website = Some(website.to_string());
536 self
537 }
538
539 pub fn website_label(mut self, website_label: &str) -> Self {
540 self.website_label = Some(website_label.to_string());
541 self
542 }
543
544 pub fn wrap_license(mut self, wrap_license: bool) -> Self {
545 self.wrap_license = Some(wrap_license);
546 self
547 }
548
549 pub fn use_header_bar(mut self, use_header_bar: i32) -> Self {
550 self.use_header_bar = Some(use_header_bar);
551 self
552 }
553
554 pub fn accept_focus(mut self, accept_focus: bool) -> Self {
555 self.accept_focus = Some(accept_focus);
556 self
557 }
558
559 pub fn application(mut self, application: &Application) -> Self {
560 self.application = Some(application.clone());
561 self
562 }
563
564 pub fn attached_to(mut self, attached_to: &Widget) -> Self {
565 self.attached_to = Some(attached_to.clone());
566 self
567 }
568
569 pub fn decorated(mut self, decorated: bool) -> Self {
570 self.decorated = Some(decorated);
571 self
572 }
573
574 pub fn default_height(mut self, default_height: i32) -> Self {
575 self.default_height = Some(default_height);
576 self
577 }
578
579 pub fn default_width(mut self, default_width: i32) -> Self {
580 self.default_width = Some(default_width);
581 self
582 }
583
584 pub fn deletable(mut self, deletable: bool) -> Self {
585 self.deletable = Some(deletable);
586 self
587 }
588
589 pub fn destroy_with_parent(mut self, destroy_with_parent: bool) -> Self {
590 self.destroy_with_parent = Some(destroy_with_parent);
591 self
592 }
593
594 pub fn focus_on_map(mut self, focus_on_map: bool) -> Self {
595 self.focus_on_map = Some(focus_on_map);
596 self
597 }
598
599 pub fn focus_visible(mut self, focus_visible: bool) -> Self {
600 self.focus_visible = Some(focus_visible);
601 self
602 }
603
604 pub fn gravity(mut self, gravity: gdk::Gravity) -> Self {
605 self.gravity = Some(gravity);
606 self
607 }
608
609 pub fn hide_titlebar_when_maximized(mut self, hide_titlebar_when_maximized: bool) -> Self {
610 self.hide_titlebar_when_maximized = Some(hide_titlebar_when_maximized);
611 self
612 }
613
614 pub fn icon(mut self, icon: &gdk_pixbuf::Pixbuf) -> Self {
615 self.icon = Some(icon.clone());
616 self
617 }
618
619 pub fn icon_name(mut self, icon_name: &str) -> Self {
620 self.icon_name = Some(icon_name.to_string());
621 self
622 }
623
624 pub fn mnemonics_visible(mut self, mnemonics_visible: bool) -> Self {
625 self.mnemonics_visible = Some(mnemonics_visible);
626 self
627 }
628
629 pub fn modal(mut self, modal: bool) -> Self {
630 self.modal = Some(modal);
631 self
632 }
633
634 pub fn resizable(mut self, resizable: bool) -> Self {
635 self.resizable = Some(resizable);
636 self
637 }
638
639 pub fn role(mut self, role: &str) -> Self {
640 self.role = Some(role.to_string());
641 self
642 }
643
644 pub fn screen(mut self, screen: &gdk::Screen) -> Self {
645 self.screen = Some(screen.clone());
646 self
647 }
648
649 pub fn skip_pager_hint(mut self, skip_pager_hint: bool) -> Self {
650 self.skip_pager_hint = Some(skip_pager_hint);
651 self
652 }
653
654 pub fn skip_taskbar_hint(mut self, skip_taskbar_hint: bool) -> Self {
655 self.skip_taskbar_hint = Some(skip_taskbar_hint);
656 self
657 }
658
659 pub fn startup_id(mut self, startup_id: &str) -> Self {
660 self.startup_id = Some(startup_id.to_string());
661 self
662 }
663
664 pub fn title(mut self, title: &str) -> Self {
665 self.title = Some(title.to_string());
666 self
667 }
668
669 pub fn transient_for(mut self, transient_for: &Window) -> Self {
670 self.transient_for = Some(transient_for.clone());
671 self
672 }
673
674 pub fn type_(mut self, type_: WindowType) -> Self {
675 self.type_ = Some(type_);
676 self
677 }
678
679 pub fn type_hint(mut self, type_hint: gdk::WindowTypeHint) -> Self {
680 self.type_hint = Some(type_hint);
681 self
682 }
683
684 pub fn urgency_hint(mut self, urgency_hint: bool) -> Self {
685 self.urgency_hint = Some(urgency_hint);
686 self
687 }
688
689 pub fn window_position(mut self, window_position: WindowPosition) -> Self {
690 self.window_position = Some(window_position);
691 self
692 }
693
694 pub fn border_width(mut self, border_width: u32) -> Self {
695 self.border_width = Some(border_width);
696 self
697 }
698
699 pub fn child(mut self, child: &Widget) -> Self {
700 self.child = Some(child.clone());
701 self
702 }
703
704 pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self {
705 self.resize_mode = Some(resize_mode);
706 self
707 }
708
709 pub fn app_paintable(mut self, app_paintable: bool) -> Self {
710 self.app_paintable = Some(app_paintable);
711 self
712 }
713
714 pub fn can_default(mut self, can_default: bool) -> Self {
715 self.can_default = Some(can_default);
716 self
717 }
718
719 pub fn can_focus(mut self, can_focus: bool) -> Self {
720 self.can_focus = Some(can_focus);
721 self
722 }
723
724 pub fn events(mut self, events: gdk::EventMask) -> Self {
725 self.events = Some(events);
726 self
727 }
728
729 pub fn expand(mut self, expand: bool) -> Self {
730 self.expand = Some(expand);
731 self
732 }
733
734 #[cfg(any(feature = "v3_20", feature = "dox"))]
735 pub fn focus_on_click(mut self, focus_on_click: bool) -> Self {
736 self.focus_on_click = Some(focus_on_click);
737 self
738 }
739
740 pub fn halign(mut self, halign: Align) -> Self {
741 self.halign = Some(halign);
742 self
743 }
744
745 pub fn has_default(mut self, has_default: bool) -> Self {
746 self.has_default = Some(has_default);
747 self
748 }
749
750 pub fn has_focus(mut self, has_focus: bool) -> Self {
751 self.has_focus = Some(has_focus);
752 self
753 }
754
755 pub fn has_tooltip(mut self, has_tooltip: bool) -> Self {
756 self.has_tooltip = Some(has_tooltip);
757 self
758 }
759
760 pub fn height_request(mut self, height_request: i32) -> Self {
761 self.height_request = Some(height_request);
762 self
763 }
764
765 pub fn hexpand(mut self, hexpand: bool) -> Self {
766 self.hexpand = Some(hexpand);
767 self
768 }
769
770 pub fn hexpand_set(mut self, hexpand_set: bool) -> Self {
771 self.hexpand_set = Some(hexpand_set);
772 self
773 }
774
775 pub fn is_focus(mut self, is_focus: bool) -> Self {
776 self.is_focus = Some(is_focus);
777 self
778 }
779
780 pub fn margin(mut self, margin: i32) -> Self {
781 self.margin = Some(margin);
782 self
783 }
784
785 pub fn margin_bottom(mut self, margin_bottom: i32) -> Self {
786 self.margin_bottom = Some(margin_bottom);
787 self
788 }
789
790 pub fn margin_end(mut self, margin_end: i32) -> Self {
791 self.margin_end = Some(margin_end);
792 self
793 }
794
795 pub fn margin_start(mut self, margin_start: i32) -> Self {
796 self.margin_start = Some(margin_start);
797 self
798 }
799
800 pub fn margin_top(mut self, margin_top: i32) -> Self {
801 self.margin_top = Some(margin_top);
802 self
803 }
804
805 pub fn name(mut self, name: &str) -> Self {
806 self.name = Some(name.to_string());
807 self
808 }
809
810 pub fn no_show_all(mut self, no_show_all: bool) -> Self {
811 self.no_show_all = Some(no_show_all);
812 self
813 }
814
815 pub fn opacity(mut self, opacity: f64) -> Self {
816 self.opacity = Some(opacity);
817 self
818 }
819
820 pub fn parent(mut self, parent: &Container) -> Self {
821 self.parent = Some(parent.clone());
822 self
823 }
824
825 pub fn receives_default(mut self, receives_default: bool) -> Self {
826 self.receives_default = Some(receives_default);
827 self
828 }
829
830 pub fn sensitive(mut self, sensitive: bool) -> Self {
831 self.sensitive = Some(sensitive);
832 self
833 }
834
835 pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self {
836 self.tooltip_markup = Some(tooltip_markup.to_string());
837 self
838 }
839
840 pub fn tooltip_text(mut self, tooltip_text: &str) -> Self {
841 self.tooltip_text = Some(tooltip_text.to_string());
842 self
843 }
844
845 pub fn valign(mut self, valign: Align) -> Self {
846 self.valign = Some(valign);
847 self
848 }
849
850 pub fn vexpand(mut self, vexpand: bool) -> Self {
851 self.vexpand = Some(vexpand);
852 self
853 }
854
855 pub fn vexpand_set(mut self, vexpand_set: bool) -> Self {
856 self.vexpand_set = Some(vexpand_set);
857 self
858 }
859
860 pub fn visible(mut self, visible: bool) -> Self {
861 self.visible = Some(visible);
862 self
863 }
864
865 pub fn width_request(mut self, width_request: i32) -> Self {
866 self.width_request = Some(width_request);
867 self
868 }
869}
870
871pub const NONE_ABOUT_DIALOG: Option<&AboutDialog> = None;
872
873pub trait AboutDialogExt: 'static {
874 fn add_credit_section(&self, section_name: &str, people: &[&str]);
875
876 fn get_artists(&self) -> Vec<GString>;
877
878 fn get_authors(&self) -> Vec<GString>;
879
880 fn get_comments(&self) -> Option<GString>;
881
882 fn get_copyright(&self) -> Option<GString>;
883
884 fn get_documenters(&self) -> Vec<GString>;
885
886 fn get_license(&self) -> Option<GString>;
887
888 fn get_license_type(&self) -> License;
889
890 fn get_logo(&self) -> Option<gdk_pixbuf::Pixbuf>;
891
892 fn get_logo_icon_name(&self) -> Option<GString>;
893
894 fn get_program_name(&self) -> Option<GString>;
895
896 fn get_translator_credits(&self) -> Option<GString>;
897
898 fn get_version(&self) -> Option<GString>;
899
900 fn get_website(&self) -> Option<GString>;
901
902 fn get_website_label(&self) -> Option<GString>;
903
904 fn get_wrap_license(&self) -> bool;
905
906 fn set_artists(&self, artists: &[&str]);
907
908 fn set_authors(&self, authors: &[&str]);
909
910 fn set_comments(&self, comments: Option<&str>);
911
912 fn set_copyright(&self, copyright: Option<&str>);
913
914 fn set_documenters(&self, documenters: &[&str]);
915
916 fn set_license(&self, license: Option<&str>);
917
918 fn set_license_type(&self, license_type: License);
919
920 fn set_logo(&self, logo: Option<&gdk_pixbuf::Pixbuf>);
921
922 fn set_logo_icon_name(&self, icon_name: Option<&str>);
923
924 fn set_program_name(&self, name: &str);
925
926 fn set_translator_credits(&self, translator_credits: Option<&str>);
927
928 fn set_version(&self, version: Option<&str>);
929
930 fn set_website(&self, website: Option<&str>);
931
932 fn set_website_label(&self, website_label: Option<&str>);
933
934 fn set_wrap_license(&self, wrap_license: bool);
935
936 fn connect_activate_link<F: Fn(&Self, &str) -> Inhibit + 'static>(
937 &self,
938 f: F,
939 ) -> SignalHandlerId;
940
941 fn connect_property_artists_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
942
943 fn connect_property_authors_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
944
945 fn connect_property_comments_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
946
947 fn connect_property_copyright_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
948
949 fn connect_property_documenters_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
950
951 fn connect_property_license_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
952
953 fn connect_property_license_type_notify<F: Fn(&Self) + 'static>(&self, f: F)
954 -> SignalHandlerId;
955
956 fn connect_property_logo_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
957
958 fn connect_property_logo_icon_name_notify<F: Fn(&Self) + 'static>(
959 &self,
960 f: F,
961 ) -> SignalHandlerId;
962
963 fn connect_property_program_name_notify<F: Fn(&Self) + 'static>(&self, f: F)
964 -> SignalHandlerId;
965
966 fn connect_property_translator_credits_notify<F: Fn(&Self) + 'static>(
967 &self,
968 f: F,
969 ) -> SignalHandlerId;
970
971 fn connect_property_version_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
972
973 fn connect_property_website_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
974
975 fn connect_property_website_label_notify<F: Fn(&Self) + 'static>(
976 &self,
977 f: F,
978 ) -> SignalHandlerId;
979
980 fn connect_property_wrap_license_notify<F: Fn(&Self) + 'static>(&self, f: F)
981 -> SignalHandlerId;
982}
983
984impl<O: IsA<AboutDialog>> AboutDialogExt for O {
985 fn add_credit_section(&self, section_name: &str, people: &[&str]) {
986 unsafe {
987 gtk_sys::gtk_about_dialog_add_credit_section(
988 self.as_ref().to_glib_none().0,
989 section_name.to_glib_none().0,
990 people.to_glib_none().0,
991 );
992 }
993 }
994
995 fn get_artists(&self) -> Vec<GString> {
996 unsafe {
997 FromGlibPtrContainer::from_glib_none(gtk_sys::gtk_about_dialog_get_artists(
998 self.as_ref().to_glib_none().0,
999 ))
1000 }
1001 }
1002
1003 fn get_authors(&self) -> Vec<GString> {
1004 unsafe {
1005 FromGlibPtrContainer::from_glib_none(gtk_sys::gtk_about_dialog_get_authors(
1006 self.as_ref().to_glib_none().0,
1007 ))
1008 }
1009 }
1010
1011 fn get_comments(&self) -> Option<GString> {
1012 unsafe {
1013 from_glib_none(gtk_sys::gtk_about_dialog_get_comments(
1014 self.as_ref().to_glib_none().0,
1015 ))
1016 }
1017 }
1018
1019 fn get_copyright(&self) -> Option<GString> {
1020 unsafe {
1021 from_glib_none(gtk_sys::gtk_about_dialog_get_copyright(
1022 self.as_ref().to_glib_none().0,
1023 ))
1024 }
1025 }
1026
1027 fn get_documenters(&self) -> Vec<GString> {
1028 unsafe {
1029 FromGlibPtrContainer::from_glib_none(gtk_sys::gtk_about_dialog_get_documenters(
1030 self.as_ref().to_glib_none().0,
1031 ))
1032 }
1033 }
1034
1035 fn get_license(&self) -> Option<GString> {
1036 unsafe {
1037 from_glib_none(gtk_sys::gtk_about_dialog_get_license(
1038 self.as_ref().to_glib_none().0,
1039 ))
1040 }
1041 }
1042
1043 fn get_license_type(&self) -> License {
1044 unsafe {
1045 from_glib(gtk_sys::gtk_about_dialog_get_license_type(
1046 self.as_ref().to_glib_none().0,
1047 ))
1048 }
1049 }
1050
1051 fn get_logo(&self) -> Option<gdk_pixbuf::Pixbuf> {
1052 unsafe {
1053 from_glib_none(gtk_sys::gtk_about_dialog_get_logo(
1054 self.as_ref().to_glib_none().0,
1055 ))
1056 }
1057 }
1058
1059 fn get_logo_icon_name(&self) -> Option<GString> {
1060 unsafe {
1061 from_glib_none(gtk_sys::gtk_about_dialog_get_logo_icon_name(
1062 self.as_ref().to_glib_none().0,
1063 ))
1064 }
1065 }
1066
1067 fn get_program_name(&self) -> Option<GString> {
1068 unsafe {
1069 from_glib_none(gtk_sys::gtk_about_dialog_get_program_name(
1070 self.as_ref().to_glib_none().0,
1071 ))
1072 }
1073 }
1074
1075 fn get_translator_credits(&self) -> Option<GString> {
1076 unsafe {
1077 from_glib_none(gtk_sys::gtk_about_dialog_get_translator_credits(
1078 self.as_ref().to_glib_none().0,
1079 ))
1080 }
1081 }
1082
1083 fn get_version(&self) -> Option<GString> {
1084 unsafe {
1085 from_glib_none(gtk_sys::gtk_about_dialog_get_version(
1086 self.as_ref().to_glib_none().0,
1087 ))
1088 }
1089 }
1090
1091 fn get_website(&self) -> Option<GString> {
1092 unsafe {
1093 from_glib_none(gtk_sys::gtk_about_dialog_get_website(
1094 self.as_ref().to_glib_none().0,
1095 ))
1096 }
1097 }
1098
1099 fn get_website_label(&self) -> Option<GString> {
1100 unsafe {
1101 from_glib_none(gtk_sys::gtk_about_dialog_get_website_label(
1102 self.as_ref().to_glib_none().0,
1103 ))
1104 }
1105 }
1106
1107 fn get_wrap_license(&self) -> bool {
1108 unsafe {
1109 from_glib(gtk_sys::gtk_about_dialog_get_wrap_license(
1110 self.as_ref().to_glib_none().0,
1111 ))
1112 }
1113 }
1114
1115 fn set_artists(&self, artists: &[&str]) {
1116 unsafe {
1117 gtk_sys::gtk_about_dialog_set_artists(
1118 self.as_ref().to_glib_none().0,
1119 artists.to_glib_none().0,
1120 );
1121 }
1122 }
1123
1124 fn set_authors(&self, authors: &[&str]) {
1125 unsafe {
1126 gtk_sys::gtk_about_dialog_set_authors(
1127 self.as_ref().to_glib_none().0,
1128 authors.to_glib_none().0,
1129 );
1130 }
1131 }
1132
1133 fn set_comments(&self, comments: Option<&str>) {
1134 unsafe {
1135 gtk_sys::gtk_about_dialog_set_comments(
1136 self.as_ref().to_glib_none().0,
1137 comments.to_glib_none().0,
1138 );
1139 }
1140 }
1141
1142 fn set_copyright(&self, copyright: Option<&str>) {
1143 unsafe {
1144 gtk_sys::gtk_about_dialog_set_copyright(
1145 self.as_ref().to_glib_none().0,
1146 copyright.to_glib_none().0,
1147 );
1148 }
1149 }
1150
1151 fn set_documenters(&self, documenters: &[&str]) {
1152 unsafe {
1153 gtk_sys::gtk_about_dialog_set_documenters(
1154 self.as_ref().to_glib_none().0,
1155 documenters.to_glib_none().0,
1156 );
1157 }
1158 }
1159
1160 fn set_license(&self, license: Option<&str>) {
1161 unsafe {
1162 gtk_sys::gtk_about_dialog_set_license(
1163 self.as_ref().to_glib_none().0,
1164 license.to_glib_none().0,
1165 );
1166 }
1167 }
1168
1169 fn set_license_type(&self, license_type: License) {
1170 unsafe {
1171 gtk_sys::gtk_about_dialog_set_license_type(
1172 self.as_ref().to_glib_none().0,
1173 license_type.to_glib(),
1174 );
1175 }
1176 }
1177
1178 fn set_logo(&self, logo: Option<&gdk_pixbuf::Pixbuf>) {
1179 unsafe {
1180 gtk_sys::gtk_about_dialog_set_logo(
1181 self.as_ref().to_glib_none().0,
1182 logo.to_glib_none().0,
1183 );
1184 }
1185 }
1186
1187 fn set_logo_icon_name(&self, icon_name: Option<&str>) {
1188 unsafe {
1189 gtk_sys::gtk_about_dialog_set_logo_icon_name(
1190 self.as_ref().to_glib_none().0,
1191 icon_name.to_glib_none().0,
1192 );
1193 }
1194 }
1195
1196 fn set_program_name(&self, name: &str) {
1197 unsafe {
1198 gtk_sys::gtk_about_dialog_set_program_name(
1199 self.as_ref().to_glib_none().0,
1200 name.to_glib_none().0,
1201 );
1202 }
1203 }
1204
1205 fn set_translator_credits(&self, translator_credits: Option<&str>) {
1206 unsafe {
1207 gtk_sys::gtk_about_dialog_set_translator_credits(
1208 self.as_ref().to_glib_none().0,
1209 translator_credits.to_glib_none().0,
1210 );
1211 }
1212 }
1213
1214 fn set_version(&self, version: Option<&str>) {
1215 unsafe {
1216 gtk_sys::gtk_about_dialog_set_version(
1217 self.as_ref().to_glib_none().0,
1218 version.to_glib_none().0,
1219 );
1220 }
1221 }
1222
1223 fn set_website(&self, website: Option<&str>) {
1224 unsafe {
1225 gtk_sys::gtk_about_dialog_set_website(
1226 self.as_ref().to_glib_none().0,
1227 website.to_glib_none().0,
1228 );
1229 }
1230 }
1231
1232 fn set_website_label(&self, website_label: Option<&str>) {
1233 unsafe {
1234 gtk_sys::gtk_about_dialog_set_website_label(
1235 self.as_ref().to_glib_none().0,
1236 website_label.to_glib_none().0,
1237 );
1238 }
1239 }
1240
1241 fn set_wrap_license(&self, wrap_license: bool) {
1242 unsafe {
1243 gtk_sys::gtk_about_dialog_set_wrap_license(
1244 self.as_ref().to_glib_none().0,
1245 wrap_license.to_glib(),
1246 );
1247 }
1248 }
1249
1250 fn connect_activate_link<F: Fn(&Self, &str) -> Inhibit + 'static>(
1251 &self,
1252 f: F,
1253 ) -> SignalHandlerId {
1254 unsafe extern "C" fn activate_link_trampoline<P, F: Fn(&P, &str) -> Inhibit + 'static>(
1255 this: *mut gtk_sys::GtkAboutDialog,
1256 uri: *mut libc::c_char,
1257 f: glib_sys::gpointer,
1258 ) -> glib_sys::gboolean
1259 where
1260 P: IsA<AboutDialog>,
1261 {
1262 let f: &F = &*(f as *const F);
1263 f(
1264 &AboutDialog::from_glib_borrow(this).unsafe_cast(),
1265 &GString::from_glib_borrow(uri),
1266 )
1267 .to_glib()
1268 }
1269 unsafe {
1270 let f: Box_<F> = Box_::new(f);
1271 connect_raw(
1272 self.as_ptr() as *mut _,
1273 b"activate-link\0".as_ptr() as *const _,
1274 Some(transmute(activate_link_trampoline::<Self, F> as usize)),
1275 Box_::into_raw(f),
1276 )
1277 }
1278 }
1279
1280 fn connect_property_artists_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1281 unsafe extern "C" fn notify_artists_trampoline<P, F: Fn(&P) + 'static>(
1282 this: *mut gtk_sys::GtkAboutDialog,
1283 _param_spec: glib_sys::gpointer,
1284 f: glib_sys::gpointer,
1285 ) where
1286 P: IsA<AboutDialog>,
1287 {
1288 let f: &F = &*(f as *const F);
1289 f(&AboutDialog::from_glib_borrow(this).unsafe_cast())
1290 }
1291 unsafe {
1292 let f: Box_<F> = Box_::new(f);
1293 connect_raw(
1294 self.as_ptr() as *mut _,
1295 b"notify::artists\0".as_ptr() as *const _,
1296 Some(transmute(notify_artists_trampoline::<Self, F> as usize)),
1297 Box_::into_raw(f),
1298 )
1299 }
1300 }
1301
1302 fn connect_property_authors_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1303 unsafe extern "C" fn notify_authors_trampoline<P, F: Fn(&P) + 'static>(
1304 this: *mut gtk_sys::GtkAboutDialog,
1305 _param_spec: glib_sys::gpointer,
1306 f: glib_sys::gpointer,
1307 ) where
1308 P: IsA<AboutDialog>,
1309 {
1310 let f: &F = &*(f as *const F);
1311 f(&AboutDialog::from_glib_borrow(this).unsafe_cast())
1312 }
1313 unsafe {
1314 let f: Box_<F> = Box_::new(f);
1315 connect_raw(
1316 self.as_ptr() as *mut _,
1317 b"notify::authors\0".as_ptr() as *const _,
1318 Some(transmute(notify_authors_trampoline::<Self, F> as usize)),
1319 Box_::into_raw(f),
1320 )
1321 }
1322 }
1323
1324 fn connect_property_comments_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1325 unsafe extern "C" fn notify_comments_trampoline<P, F: Fn(&P) + 'static>(
1326 this: *mut gtk_sys::GtkAboutDialog,
1327 _param_spec: glib_sys::gpointer,
1328 f: glib_sys::gpointer,
1329 ) where
1330 P: IsA<AboutDialog>,
1331 {
1332 let f: &F = &*(f as *const F);
1333 f(&AboutDialog::from_glib_borrow(this).unsafe_cast())
1334 }
1335 unsafe {
1336 let f: Box_<F> = Box_::new(f);
1337 connect_raw(
1338 self.as_ptr() as *mut _,
1339 b"notify::comments\0".as_ptr() as *const _,
1340 Some(transmute(notify_comments_trampoline::<Self, F> as usize)),
1341 Box_::into_raw(f),
1342 )
1343 }
1344 }
1345
1346 fn connect_property_copyright_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1347 unsafe extern "C" fn notify_copyright_trampoline<P, F: Fn(&P) + 'static>(
1348 this: *mut gtk_sys::GtkAboutDialog,
1349 _param_spec: glib_sys::gpointer,
1350 f: glib_sys::gpointer,
1351 ) where
1352 P: IsA<AboutDialog>,
1353 {
1354 let f: &F = &*(f as *const F);
1355 f(&AboutDialog::from_glib_borrow(this).unsafe_cast())
1356 }
1357 unsafe {
1358 let f: Box_<F> = Box_::new(f);
1359 connect_raw(
1360 self.as_ptr() as *mut _,
1361 b"notify::copyright\0".as_ptr() as *const _,
1362 Some(transmute(notify_copyright_trampoline::<Self, F> as usize)),
1363 Box_::into_raw(f),
1364 )
1365 }
1366 }
1367
1368 fn connect_property_documenters_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1369 unsafe extern "C" fn notify_documenters_trampoline<P, F: Fn(&P) + 'static>(
1370 this: *mut gtk_sys::GtkAboutDialog,
1371 _param_spec: glib_sys::gpointer,
1372 f: glib_sys::gpointer,
1373 ) where
1374 P: IsA<AboutDialog>,
1375 {
1376 let f: &F = &*(f as *const F);
1377 f(&AboutDialog::from_glib_borrow(this).unsafe_cast())
1378 }
1379 unsafe {
1380 let f: Box_<F> = Box_::new(f);
1381 connect_raw(
1382 self.as_ptr() as *mut _,
1383 b"notify::documenters\0".as_ptr() as *const _,
1384 Some(transmute(notify_documenters_trampoline::<Self, F> as usize)),
1385 Box_::into_raw(f),
1386 )
1387 }
1388 }
1389
1390 fn connect_property_license_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1391 unsafe extern "C" fn notify_license_trampoline<P, F: Fn(&P) + 'static>(
1392 this: *mut gtk_sys::GtkAboutDialog,
1393 _param_spec: glib_sys::gpointer,
1394 f: glib_sys::gpointer,
1395 ) where
1396 P: IsA<AboutDialog>,
1397 {
1398 let f: &F = &*(f as *const F);
1399 f(&AboutDialog::from_glib_borrow(this).unsafe_cast())
1400 }
1401 unsafe {
1402 let f: Box_<F> = Box_::new(f);
1403 connect_raw(
1404 self.as_ptr() as *mut _,
1405 b"notify::license\0".as_ptr() as *const _,
1406 Some(transmute(notify_license_trampoline::<Self, F> as usize)),
1407 Box_::into_raw(f),
1408 )
1409 }
1410 }
1411
1412 fn connect_property_license_type_notify<F: Fn(&Self) + 'static>(
1413 &self,
1414 f: F,
1415 ) -> SignalHandlerId {
1416 unsafe extern "C" fn notify_license_type_trampoline<P, F: Fn(&P) + 'static>(
1417 this: *mut gtk_sys::GtkAboutDialog,
1418 _param_spec: glib_sys::gpointer,
1419 f: glib_sys::gpointer,
1420 ) where
1421 P: IsA<AboutDialog>,
1422 {
1423 let f: &F = &*(f as *const F);
1424 f(&AboutDialog::from_glib_borrow(this).unsafe_cast())
1425 }
1426 unsafe {
1427 let f: Box_<F> = Box_::new(f);
1428 connect_raw(
1429 self.as_ptr() as *mut _,
1430 b"notify::license-type\0".as_ptr() as *const _,
1431 Some(transmute(
1432 notify_license_type_trampoline::<Self, F> as usize,
1433 )),
1434 Box_::into_raw(f),
1435 )
1436 }
1437 }
1438
1439 fn connect_property_logo_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1440 unsafe extern "C" fn notify_logo_trampoline<P, F: Fn(&P) + 'static>(
1441 this: *mut gtk_sys::GtkAboutDialog,
1442 _param_spec: glib_sys::gpointer,
1443 f: glib_sys::gpointer,
1444 ) where
1445 P: IsA<AboutDialog>,
1446 {
1447 let f: &F = &*(f as *const F);
1448 f(&AboutDialog::from_glib_borrow(this).unsafe_cast())
1449 }
1450 unsafe {
1451 let f: Box_<F> = Box_::new(f);
1452 connect_raw(
1453 self.as_ptr() as *mut _,
1454 b"notify::logo\0".as_ptr() as *const _,
1455 Some(transmute(notify_logo_trampoline::<Self, F> as usize)),
1456 Box_::into_raw(f),
1457 )
1458 }
1459 }
1460
1461 fn connect_property_logo_icon_name_notify<F: Fn(&Self) + 'static>(
1462 &self,
1463 f: F,
1464 ) -> SignalHandlerId {
1465 unsafe extern "C" fn notify_logo_icon_name_trampoline<P, F: Fn(&P) + 'static>(
1466 this: *mut gtk_sys::GtkAboutDialog,
1467 _param_spec: glib_sys::gpointer,
1468 f: glib_sys::gpointer,
1469 ) where
1470 P: IsA<AboutDialog>,
1471 {
1472 let f: &F = &*(f as *const F);
1473 f(&AboutDialog::from_glib_borrow(this).unsafe_cast())
1474 }
1475 unsafe {
1476 let f: Box_<F> = Box_::new(f);
1477 connect_raw(
1478 self.as_ptr() as *mut _,
1479 b"notify::logo-icon-name\0".as_ptr() as *const _,
1480 Some(transmute(
1481 notify_logo_icon_name_trampoline::<Self, F> as usize,
1482 )),
1483 Box_::into_raw(f),
1484 )
1485 }
1486 }
1487
1488 fn connect_property_program_name_notify<F: Fn(&Self) + 'static>(
1489 &self,
1490 f: F,
1491 ) -> SignalHandlerId {
1492 unsafe extern "C" fn notify_program_name_trampoline<P, F: Fn(&P) + 'static>(
1493 this: *mut gtk_sys::GtkAboutDialog,
1494 _param_spec: glib_sys::gpointer,
1495 f: glib_sys::gpointer,
1496 ) where
1497 P: IsA<AboutDialog>,
1498 {
1499 let f: &F = &*(f as *const F);
1500 f(&AboutDialog::from_glib_borrow(this).unsafe_cast())
1501 }
1502 unsafe {
1503 let f: Box_<F> = Box_::new(f);
1504 connect_raw(
1505 self.as_ptr() as *mut _,
1506 b"notify::program-name\0".as_ptr() as *const _,
1507 Some(transmute(
1508 notify_program_name_trampoline::<Self, F> as usize,
1509 )),
1510 Box_::into_raw(f),
1511 )
1512 }
1513 }
1514
1515 fn connect_property_translator_credits_notify<F: Fn(&Self) + 'static>(
1516 &self,
1517 f: F,
1518 ) -> SignalHandlerId {
1519 unsafe extern "C" fn notify_translator_credits_trampoline<P, F: Fn(&P) + 'static>(
1520 this: *mut gtk_sys::GtkAboutDialog,
1521 _param_spec: glib_sys::gpointer,
1522 f: glib_sys::gpointer,
1523 ) where
1524 P: IsA<AboutDialog>,
1525 {
1526 let f: &F = &*(f as *const F);
1527 f(&AboutDialog::from_glib_borrow(this).unsafe_cast())
1528 }
1529 unsafe {
1530 let f: Box_<F> = Box_::new(f);
1531 connect_raw(
1532 self.as_ptr() as *mut _,
1533 b"notify::translator-credits\0".as_ptr() as *const _,
1534 Some(transmute(
1535 notify_translator_credits_trampoline::<Self, F> as usize,
1536 )),
1537 Box_::into_raw(f),
1538 )
1539 }
1540 }
1541
1542 fn connect_property_version_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1543 unsafe extern "C" fn notify_version_trampoline<P, F: Fn(&P) + 'static>(
1544 this: *mut gtk_sys::GtkAboutDialog,
1545 _param_spec: glib_sys::gpointer,
1546 f: glib_sys::gpointer,
1547 ) where
1548 P: IsA<AboutDialog>,
1549 {
1550 let f: &F = &*(f as *const F);
1551 f(&AboutDialog::from_glib_borrow(this).unsafe_cast())
1552 }
1553 unsafe {
1554 let f: Box_<F> = Box_::new(f);
1555 connect_raw(
1556 self.as_ptr() as *mut _,
1557 b"notify::version\0".as_ptr() as *const _,
1558 Some(transmute(notify_version_trampoline::<Self, F> as usize)),
1559 Box_::into_raw(f),
1560 )
1561 }
1562 }
1563
1564 fn connect_property_website_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1565 unsafe extern "C" fn notify_website_trampoline<P, F: Fn(&P) + 'static>(
1566 this: *mut gtk_sys::GtkAboutDialog,
1567 _param_spec: glib_sys::gpointer,
1568 f: glib_sys::gpointer,
1569 ) where
1570 P: IsA<AboutDialog>,
1571 {
1572 let f: &F = &*(f as *const F);
1573 f(&AboutDialog::from_glib_borrow(this).unsafe_cast())
1574 }
1575 unsafe {
1576 let f: Box_<F> = Box_::new(f);
1577 connect_raw(
1578 self.as_ptr() as *mut _,
1579 b"notify::website\0".as_ptr() as *const _,
1580 Some(transmute(notify_website_trampoline::<Self, F> as usize)),
1581 Box_::into_raw(f),
1582 )
1583 }
1584 }
1585
1586 fn connect_property_website_label_notify<F: Fn(&Self) + 'static>(
1587 &self,
1588 f: F,
1589 ) -> SignalHandlerId {
1590 unsafe extern "C" fn notify_website_label_trampoline<P, F: Fn(&P) + 'static>(
1591 this: *mut gtk_sys::GtkAboutDialog,
1592 _param_spec: glib_sys::gpointer,
1593 f: glib_sys::gpointer,
1594 ) where
1595 P: IsA<AboutDialog>,
1596 {
1597 let f: &F = &*(f as *const F);
1598 f(&AboutDialog::from_glib_borrow(this).unsafe_cast())
1599 }
1600 unsafe {
1601 let f: Box_<F> = Box_::new(f);
1602 connect_raw(
1603 self.as_ptr() as *mut _,
1604 b"notify::website-label\0".as_ptr() as *const _,
1605 Some(transmute(
1606 notify_website_label_trampoline::<Self, F> as usize,
1607 )),
1608 Box_::into_raw(f),
1609 )
1610 }
1611 }
1612
1613 fn connect_property_wrap_license_notify<F: Fn(&Self) + 'static>(
1614 &self,
1615 f: F,
1616 ) -> SignalHandlerId {
1617 unsafe extern "C" fn notify_wrap_license_trampoline<P, F: Fn(&P) + 'static>(
1618 this: *mut gtk_sys::GtkAboutDialog,
1619 _param_spec: glib_sys::gpointer,
1620 f: glib_sys::gpointer,
1621 ) where
1622 P: IsA<AboutDialog>,
1623 {
1624 let f: &F = &*(f as *const F);
1625 f(&AboutDialog::from_glib_borrow(this).unsafe_cast())
1626 }
1627 unsafe {
1628 let f: Box_<F> = Box_::new(f);
1629 connect_raw(
1630 self.as_ptr() as *mut _,
1631 b"notify::wrap-license\0".as_ptr() as *const _,
1632 Some(transmute(
1633 notify_wrap_license_trampoline::<Self, F> as usize,
1634 )),
1635 Box_::into_raw(f),
1636 )
1637 }
1638 }
1639}
1640
1641impl fmt::Display for AboutDialog {
1642 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1643 write!(f, "AboutDialog")
1644 }
1645}