gtk4/auto/about_dialog.rs
1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5#[cfg(feature = "v4_10")]
6#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
7use crate::Accessible;
8#[cfg(feature = "v4_20")]
9#[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
10use crate::WindowGravity;
11use crate::{
12 AccessibleRole, Align, Application, Buildable, ConstraintTarget, LayoutManager, License,
13 Native, Overflow, Root, ShortcutManager, Widget, Window, ffi,
14};
15use glib::{
16 object::ObjectType as _,
17 prelude::*,
18 signal::{SignalHandlerId, connect_raw},
19 translate::*,
20};
21use std::boxed::Box as Box_;
22
23#[cfg(feature = "v4_10")]
24#[cfg_attr(docsrs, doc(cfg(feature = "v4_10")))]
25glib::wrapper! {
26 /// Displays information about a program.
27 ///
28 /// The shown information includes the programs' logo, name, copyright,
29 /// website and license. It is also possible to give credits to the authors,
30 /// documenters, translators and artists who have worked on the program.
31 ///
32 /// An about dialog is typically opened when the user selects the `About`
33 /// option from the `Help` menu. All parts of the dialog are optional.
34 ///
35 /// <picture>
36 /// <source srcset="aboutdialot-dark.png" media="(prefers-color-scheme: dark)">
37 /// <img alt="An example GtkAboutDialog" src="aboutdialog.png">
38 /// </picture>
39 ///
40 /// About dialogs often contain links and email addresses. [`AboutDialog`][crate::AboutDialog]
41 /// displays these as clickable links. By default, it calls [`FileLauncher::launch()`][crate::FileLauncher::launch()]
42 /// when a user clicks one. The behaviour can be overridden with the
43 /// [`activate-link`][struct@crate::AboutDialog#activate-link] signal.
44 ///
45 /// To specify a person with an email address, use a string like
46 /// `Edgar Allan Poe <edgar@poe.com>`. To specify a website with a title,
47 /// use a string like `GTK team https://www.gtk.org`.
48 ///
49 /// To make constructing an about dialog as convenient as possible, you can
50 /// use the function [`show_about_dialog()`][crate::show_about_dialog()] which constructs and shows
51 /// a dialog and keeps it around so that it can be shown again.
52 ///
53 /// Note that GTK sets a default title of `_("About `s`")` on the dialog
54 /// window (where ``s`` is replaced by the name of the application, but in
55 /// order to ensure proper translation of the title, applications should
56 /// set the title property explicitly when constructing an about dialog,
57 /// as shown in the following example:
58 ///
59 /// **⚠️ The following code is in c ⚠️**
60 ///
61 /// ```c
62 /// GFile *logo_file = g_file_new_for_path ("./logo.png");
63 /// GdkTexture *example_logo = gdk_texture_new_from_file (logo_file, NULL);
64 /// g_object_unref (logo_file);
65 ///
66 /// gtk_show_about_dialog (NULL,
67 /// "program-name", "ExampleCode",
68 /// "logo", example_logo,
69 /// "title", _("About ExampleCode"),
70 /// NULL);
71 /// ```
72 ///
73 /// ## Shortcuts and Gestures
74 ///
75 /// [`AboutDialog`][crate::AboutDialog] supports the following keyboard shortcuts:
76 ///
77 /// - <kbd>Escape</kbd> closes the window.
78 ///
79 /// ## CSS nodes
80 ///
81 /// [`AboutDialog`][crate::AboutDialog] has a single CSS node with the name `window` and style
82 /// class `.aboutdialog`.
83 ///
84 /// ## Properties
85 ///
86 ///
87 /// #### `artists`
88 /// The people who contributed artwork to the program.
89 ///
90 /// Each string may contain email addresses and URLs, which will be displayed
91 /// as links.
92 ///
93 /// Readable | Writable
94 ///
95 ///
96 /// #### `authors`
97 /// The authors of the program.
98 ///
99 /// Each string may contain email addresses and URLs, which will be displayed
100 /// as links, see the introduction for more details.
101 ///
102 /// Readable | Writable
103 ///
104 ///
105 /// #### `comments`
106 /// Comments about the program.
107 ///
108 /// This string is displayed in a label in the main dialog, thus it
109 /// should be a short explanation of the main purpose of the program,
110 /// not a detailed list of features.
111 ///
112 /// Readable | Writable
113 ///
114 ///
115 /// #### `copyright`
116 /// Copyright information for the program.
117 ///
118 /// Readable | Writable
119 ///
120 ///
121 /// #### `documenters`
122 /// The people documenting the program.
123 ///
124 /// Each string may contain email addresses and URLs, which will be displayed
125 /// as links, see the introduction for more details.
126 ///
127 /// Readable | Writable
128 ///
129 ///
130 /// #### `license`
131 /// The license of the program, as free-form text.
132 ///
133 /// This string is displayed in a text view in a secondary dialog, therefore
134 /// it is fine to use a long multi-paragraph text. Note that the text is only
135 /// wrapped in the text view if the "wrap-license" property is set to `TRUE`;
136 /// otherwise the text itself must contain the intended linebreaks.
137 ///
138 /// When setting this property to a non-`NULL` value, the
139 /// [`license-type`][struct@crate::AboutDialog#license-type] property is set to
140 /// [enum@Gtk.License.custom] as a side effect.
141 ///
142 /// The text may contain links in this format `<http://www.some.place/>`
143 /// and email references in the form `<mail-to@some.body>`, and these will
144 /// be converted into clickable links.
145 ///
146 /// Readable | Writable
147 ///
148 ///
149 /// #### `license-type`
150 /// The license of the program.
151 ///
152 /// The [`AboutDialog`][crate::AboutDialog] will automatically fill out a standard disclaimer
153 /// and link the user to the appropriate online resource for the license
154 /// text.
155 ///
156 /// If [enum@Gtk.License.unknown] is used, the link used will be the same
157 /// specified in the [`website`][struct@crate::AboutDialog#website] property.
158 ///
159 /// If [enum@Gtk.License.custom] is used, the current contents of the
160 /// [`license`][struct@crate::AboutDialog#license] property are used.
161 ///
162 /// For any other [`License`][crate::License] value, the contents of the
163 /// [`license`][struct@crate::AboutDialog#license] property are also set by
164 /// this property as a side effect.
165 ///
166 /// Readable | Writable
167 ///
168 ///
169 /// #### `logo`
170 /// A logo for the about box.
171 ///
172 /// If it is `NULL`, the default window icon set with
173 /// [`Window::set_default_icon_name()`][crate::Window::set_default_icon_name()] will be used.
174 ///
175 /// Readable | Writable
176 ///
177 ///
178 /// #### `logo-icon-name`
179 /// A named icon to use as the logo for the about box.
180 ///
181 /// This property overrides the [`logo`][struct@crate::AboutDialog#logo] property.
182 ///
183 /// Readable | Writable
184 ///
185 ///
186 /// #### `program-name`
187 /// The name of the program.
188 ///
189 /// If this is not set, it defaults to the value returned by
190 /// `get_application_name()`.
191 ///
192 /// Readable | Writable
193 ///
194 ///
195 /// #### `system-information`
196 /// Information about the system on which the program is running.
197 ///
198 /// This information is displayed in a separate page, therefore it is fine
199 /// to use a long multi-paragraph text. Note that the text should contain
200 /// the intended linebreaks.
201 ///
202 /// The text may contain links in this format `<http://www.some.place/>`
203 /// and email references in the form `<mail-to@some.body>`, and these will
204 /// be converted into clickable links.
205 ///
206 /// Readable | Writable
207 ///
208 ///
209 /// #### `translator-credits`
210 /// Credits to the translators.
211 ///
212 /// This string should be marked as translatable.
213 ///
214 /// The string may contain email addresses and URLs, which will be displayed
215 /// as links, see the introduction for more details.
216 ///
217 /// Readable | Writable
218 ///
219 ///
220 /// #### `version`
221 /// The version of the program.
222 ///
223 /// Readable | Writable
224 ///
225 ///
226 /// #### `website`
227 /// The URL for the link to the website of the program.
228 ///
229 /// This should be a string starting with `http://` or `https://`.
230 ///
231 /// Readable | Writable
232 ///
233 ///
234 /// #### `website-label`
235 /// The label for the link to the website of the program.
236 ///
237 /// Readable | Writable
238 ///
239 ///
240 /// #### `wrap-license`
241 /// Whether to wrap the text in the license dialog.
242 ///
243 /// Readable | Writable
244 /// <details><summary><h4>Window</h4></summary>
245 ///
246 ///
247 /// #### `application`
248 /// The [`Application`][crate::Application] associated with the window.
249 ///
250 /// The application will be kept alive for at least as long as it
251 /// has any windows associated with it (see g_application_hold()
252 /// for a way to keep it alive without windows).
253 ///
254 /// Normally, the connection between the application and the window
255 /// will remain until the window is destroyed, but you can explicitly
256 /// remove it by setting the this property to `NULL`.
257 ///
258 /// Readable | Writable
259 ///
260 ///
261 /// #### `child`
262 /// The child widget.
263 ///
264 /// Readable | Writable
265 ///
266 ///
267 /// #### `decorated`
268 /// Whether the window should have a frame (also known as *decorations*).
269 ///
270 /// Readable | Writable
271 ///
272 ///
273 /// #### `default-height`
274 /// The default height of the window.
275 ///
276 /// Readable | Writable
277 ///
278 ///
279 /// #### `default-widget`
280 /// The default widget.
281 ///
282 /// Readable | Writable
283 ///
284 ///
285 /// #### `default-width`
286 /// The default width of the window.
287 ///
288 /// Readable | Writable
289 ///
290 ///
291 /// #### `deletable`
292 /// Whether the window frame should have a close button.
293 ///
294 /// Readable | Writable
295 ///
296 ///
297 /// #### `destroy-with-parent`
298 /// If this window should be destroyed when the parent is destroyed.
299 ///
300 /// Readable | Writable
301 ///
302 ///
303 /// #### `display`
304 /// The display that will display this window.
305 ///
306 /// Readable | Writable
307 ///
308 ///
309 /// #### `focus-visible`
310 /// Whether 'focus rectangles' are currently visible in this window.
311 ///
312 /// This property is maintained by GTK based on user input
313 /// and should not be set by applications.
314 ///
315 /// Readable | Writable
316 ///
317 ///
318 /// #### `focus-widget`
319 /// The focus widget.
320 ///
321 /// Readable | Writable
322 ///
323 ///
324 /// #### `fullscreened`
325 /// Whether the window is fullscreen.
326 ///
327 /// Setting this property is the equivalent of calling
328 /// [`GtkWindowExt::fullscreen()`][crate::prelude::GtkWindowExt::fullscreen()] or [`GtkWindowExt::unfullscreen()`][crate::prelude::GtkWindowExt::unfullscreen()];
329 /// either operation is asynchronous, which means you will need to
330 /// connect to the ::notify signal in order to know whether the
331 /// operation was successful.
332 ///
333 /// Readable | Writable
334 ///
335 ///
336 /// #### `gravity`
337 /// The gravity to use when resizing the window programmatically.
338 ///
339 /// Gravity describes which point of the window we want to keep
340 /// fixed (meaning that the window will grow in the opposite direction).
341 /// For example, a gravity of `GTK_WINDOW_GRAVITY_TOP_RIGHT` means that we
342 /// want the to fix top right corner of the window.
343 ///
344 /// Readable | Writable
345 ///
346 ///
347 /// #### `handle-menubar-accel`
348 /// Whether the window frame should handle <kbd>F10</kbd> for activating
349 /// menubars.
350 ///
351 /// Readable | Writable
352 ///
353 ///
354 /// #### `hide-on-close`
355 /// If this window should be hidden instead of destroyed when the user clicks
356 /// the close button.
357 ///
358 /// Readable | Writable
359 ///
360 ///
361 /// #### `icon-name`
362 /// Specifies the name of the themed icon to use as the window icon.
363 ///
364 /// See [`IconTheme`][crate::IconTheme] for more details.
365 ///
366 /// Readable | Writable
367 ///
368 ///
369 /// #### `is-active`
370 /// Whether the toplevel is the currently active window.
371 ///
372 /// Readable
373 ///
374 ///
375 /// #### `maximized`
376 /// Whether the window is maximized.
377 ///
378 /// Setting this property is the equivalent of calling
379 /// [`GtkWindowExt::maximize()`][crate::prelude::GtkWindowExt::maximize()] or [`GtkWindowExt::unmaximize()`][crate::prelude::GtkWindowExt::unmaximize()];
380 /// either operation is asynchronous, which means you will need to
381 /// connect to the ::notify signal in order to know whether the
382 /// operation was successful.
383 ///
384 /// Readable | Writable
385 ///
386 ///
387 /// #### `mnemonics-visible`
388 /// Whether mnemonics are currently visible in this window.
389 ///
390 /// This property is maintained by GTK based on user input,
391 /// and should not be set by applications.
392 ///
393 /// Readable | Writable
394 ///
395 ///
396 /// #### `modal`
397 /// If true, the window is modal.
398 ///
399 /// Readable | Writable
400 ///
401 ///
402 /// #### `resizable`
403 /// If true, users can resize the window.
404 ///
405 /// Readable | Writable
406 ///
407 ///
408 /// #### `startup-id`
409 /// A write-only property for setting window's startup notification identifier.
410 ///
411 /// Writable
412 ///
413 ///
414 /// #### `suspended`
415 /// Whether the window is suspended.
416 ///
417 /// See [`GtkWindowExt::is_suspended()`][crate::prelude::GtkWindowExt::is_suspended()] for details about what suspended means.
418 ///
419 /// Readable
420 ///
421 ///
422 /// #### `title`
423 /// The title of the window.
424 ///
425 /// Readable | Writable
426 ///
427 ///
428 /// #### `titlebar`
429 /// The titlebar widget.
430 ///
431 /// Readable | Writable
432 ///
433 ///
434 /// #### `transient-for`
435 /// The transient parent of the window.
436 ///
437 /// Readable | Writable | Construct
438 /// </details>
439 /// <details><summary><h4>Widget</h4></summary>
440 ///
441 ///
442 /// #### `can-focus`
443 /// Whether the widget or any of its descendents can accept
444 /// the input focus.
445 ///
446 /// This property is meant to be set by widget implementations,
447 /// typically in their instance init function.
448 ///
449 /// Readable | Writable
450 ///
451 ///
452 /// #### `can-target`
453 /// Whether the widget can receive pointer events.
454 ///
455 /// Readable | Writable
456 ///
457 ///
458 /// #### `css-classes`
459 /// A list of css classes applied to this widget.
460 ///
461 /// Readable | Writable
462 ///
463 ///
464 /// #### `css-name`
465 /// The name of this widget in the CSS tree.
466 ///
467 /// This property is meant to be set by widget implementations,
468 /// typically in their instance init function.
469 ///
470 /// Readable | Writable | Construct Only
471 ///
472 ///
473 /// #### `cursor`
474 /// The cursor used by @widget.
475 ///
476 /// Readable | Writable
477 ///
478 ///
479 /// #### `focus-on-click`
480 /// Whether the widget should grab focus when it is clicked with the mouse.
481 ///
482 /// This property is only relevant for widgets that can take focus.
483 ///
484 /// Readable | Writable
485 ///
486 ///
487 /// #### `focusable`
488 /// Whether this widget itself will accept the input focus.
489 ///
490 /// Readable | Writable
491 ///
492 ///
493 /// #### `halign`
494 /// How to distribute horizontal space if widget gets extra space.
495 ///
496 /// Readable | Writable
497 ///
498 ///
499 /// #### `has-default`
500 /// Whether the widget is the default widget.
501 ///
502 /// Readable
503 ///
504 ///
505 /// #### `has-focus`
506 /// Whether the widget has the input focus.
507 ///
508 /// Readable
509 ///
510 ///
511 /// #### `has-tooltip`
512 /// Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
513 /// signal on @widget.
514 ///
515 /// A true value indicates that @widget can have a tooltip, in this case
516 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
517 /// determine whether it will provide a tooltip or not.
518 ///
519 /// Readable | Writable
520 ///
521 ///
522 /// #### `height-request`
523 /// Overrides for height request of the widget.
524 ///
525 /// If this is -1, the natural request will be used.
526 ///
527 /// Readable | Writable
528 ///
529 ///
530 /// #### `hexpand`
531 /// Whether to expand horizontally.
532 ///
533 /// Readable | Writable
534 ///
535 ///
536 /// #### `hexpand-set`
537 /// Whether to use the `hexpand` property.
538 ///
539 /// Readable | Writable
540 ///
541 ///
542 /// #### `layout-manager`
543 /// The [`LayoutManager`][crate::LayoutManager] instance to use to compute
544 /// the preferred size of the widget, and allocate its children.
545 ///
546 /// This property is meant to be set by widget implementations,
547 /// typically in their instance init function.
548 ///
549 /// Readable | Writable
550 ///
551 ///
552 /// #### `limit-events`
553 /// Makes this widget act like a modal dialog, with respect to
554 /// event delivery.
555 ///
556 /// Global event controllers will not handle events with targets
557 /// inside the widget, unless they are set up to ignore propagation
558 /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
559 ///
560 /// Readable | Writable
561 ///
562 ///
563 /// #### `margin-bottom`
564 /// Margin on bottom side of widget.
565 ///
566 /// This property adds margin outside of the widget's normal size
567 /// request, the margin will be added in addition to the size from
568 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
569 ///
570 /// Readable | Writable
571 ///
572 ///
573 /// #### `margin-end`
574 /// Margin on end of widget, horizontally.
575 ///
576 /// This property supports left-to-right and right-to-left text
577 /// directions.
578 ///
579 /// This property adds margin outside of the widget's normal size
580 /// request, the margin will be added in addition to the size from
581 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
582 ///
583 /// Readable | Writable
584 ///
585 ///
586 /// #### `margin-start`
587 /// Margin on start of widget, horizontally.
588 ///
589 /// This property supports left-to-right and right-to-left text
590 /// directions.
591 ///
592 /// This property adds margin outside of the widget's normal size
593 /// request, the margin will be added in addition to the size from
594 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
595 ///
596 /// Readable | Writable
597 ///
598 ///
599 /// #### `margin-top`
600 /// Margin on top side of widget.
601 ///
602 /// This property adds margin outside of the widget's normal size
603 /// request, the margin will be added in addition to the size from
604 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
605 ///
606 /// Readable | Writable
607 ///
608 ///
609 /// #### `name`
610 /// The name of the widget.
611 ///
612 /// Readable | Writable
613 ///
614 ///
615 /// #### `opacity`
616 /// The requested opacity of the widget.
617 ///
618 /// Readable | Writable
619 ///
620 ///
621 /// #### `overflow`
622 /// How content outside the widget's content area is treated.
623 ///
624 /// This property is meant to be set by widget implementations,
625 /// typically in their instance init function.
626 ///
627 /// Readable | Writable
628 ///
629 ///
630 /// #### `parent`
631 /// The parent widget of this widget.
632 ///
633 /// Readable
634 ///
635 ///
636 /// #### `receives-default`
637 /// Whether the widget will receive the default action when it is focused.
638 ///
639 /// Readable | Writable
640 ///
641 ///
642 /// #### `root`
643 /// The [`Root`][crate::Root] widget of the widget tree containing this widget.
644 ///
645 /// This will be `NULL` if the widget is not contained in a root widget.
646 ///
647 /// Readable
648 ///
649 ///
650 /// #### `scale-factor`
651 /// The scale factor of the widget.
652 ///
653 /// Readable
654 ///
655 ///
656 /// #### `sensitive`
657 /// Whether the widget responds to input.
658 ///
659 /// Readable | Writable
660 ///
661 ///
662 /// #### `tooltip-markup`
663 /// Sets the text of tooltip to be the given string, which is marked up
664 /// with Pango markup.
665 ///
666 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
667 ///
668 /// This is a convenience property which will take care of getting the
669 /// tooltip shown if the given string is not `NULL`:
670 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
671 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
672 /// the default signal handler.
673 ///
674 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
675 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
676 ///
677 /// Readable | Writable
678 ///
679 ///
680 /// #### `tooltip-text`
681 /// Sets the text of tooltip to be the given string.
682 ///
683 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
684 ///
685 /// This is a convenience property which will take care of getting the
686 /// tooltip shown if the given string is not `NULL`:
687 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
688 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
689 /// the default signal handler.
690 ///
691 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
692 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
693 ///
694 /// Readable | Writable
695 ///
696 ///
697 /// #### `valign`
698 /// How to distribute vertical space if widget gets extra space.
699 ///
700 /// Readable | Writable
701 ///
702 ///
703 /// #### `vexpand`
704 /// Whether to expand vertically.
705 ///
706 /// Readable | Writable
707 ///
708 ///
709 /// #### `vexpand-set`
710 /// Whether to use the `vexpand` property.
711 ///
712 /// Readable | Writable
713 ///
714 ///
715 /// #### `visible`
716 /// Whether the widget is visible.
717 ///
718 /// Readable | Writable
719 ///
720 ///
721 /// #### `width-request`
722 /// Overrides for width request of the widget.
723 ///
724 /// If this is -1, the natural request will be used.
725 ///
726 /// Readable | Writable
727 /// </details>
728 /// <details><summary><h4>Accessible</h4></summary>
729 ///
730 ///
731 /// #### `accessible-role`
732 /// The accessible role of the given [`Accessible`][crate::Accessible] implementation.
733 ///
734 /// The accessible role cannot be changed once set.
735 ///
736 /// Readable | Writable
737 /// </details>
738 ///
739 /// ## Signals
740 ///
741 ///
742 /// #### `activate-link`
743 /// Emitted every time a URL is activated.
744 ///
745 /// Applications may connect to it to override the default behaviour,
746 /// which is to call [`FileLauncher::launch()`][crate::FileLauncher::launch()].
747 ///
748 ///
749 /// <details><summary><h4>Window</h4></summary>
750 ///
751 ///
752 /// #### `activate-default`
753 /// Emitted when the user activates the default widget.
754 ///
755 /// This is a [keybinding signal](class.SignalAction.html).
756 ///
757 /// The keybindings for this signal are all forms of the <kbd>Enter</kbd> key.
758 ///
759 /// Action
760 ///
761 ///
762 /// #### `activate-focus`
763 /// Emitted when the user activates the currently focused
764 /// widget of @window.
765 ///
766 /// This is a [keybinding signal](class.SignalAction.html).
767 ///
768 /// The default binding for this signal is <kbd>␣</kbd>.
769 ///
770 /// Action
771 ///
772 ///
773 /// #### `close-request`
774 /// Emitted when the user clicks on the close button of the window.
775 ///
776 ///
777 ///
778 ///
779 /// #### `enable-debugging`
780 /// Emitted when the user enables or disables interactive debugging.
781 ///
782 /// When @toggle is true, interactive debugging is toggled on or off,
783 /// when it is false, the debugger will be pointed at the widget
784 /// under the pointer.
785 ///
786 /// This is a [keybinding signal](class.SignalAction.html).
787 ///
788 /// The default bindings for this signal are
789 /// <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>I</kbd> and
790 /// <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>D</kbd>.
791 ///
792 /// Action
793 ///
794 ///
795 /// #### `force-close`
796 /// Emitted when the compositor has decided to eliminate a window.
797 ///
798 /// @window *has* to be in a hidden state after this signal was handled.
799 ///
800 ///
801 ///
802 ///
803 /// #### `keys-changed`
804 /// Emitted when the set of accelerators or mnemonics that
805 /// are associated with the window changes.
806 ///
807 ///
808 /// </details>
809 /// <details><summary><h4>Widget</h4></summary>
810 ///
811 ///
812 /// #### `destroy`
813 /// Signals that all holders of a reference to the widget should release
814 /// the reference that they hold.
815 ///
816 /// May result in finalization of the widget if all references are released.
817 ///
818 /// This signal is not suitable for saving widget state.
819 ///
820 ///
821 ///
822 ///
823 /// #### `direction-changed`
824 /// Emitted when the text direction of a widget changes.
825 ///
826 ///
827 ///
828 ///
829 /// #### `hide`
830 /// Emitted when @widget is hidden.
831 ///
832 ///
833 ///
834 ///
835 /// #### `keynav-failed`
836 /// Emitted if keyboard navigation fails.
837 ///
838 /// See [`WidgetExt::keynav_failed()`][crate::prelude::WidgetExt::keynav_failed()] for details.
839 ///
840 ///
841 ///
842 ///
843 /// #### `map`
844 /// Emitted when @widget is going to be mapped.
845 ///
846 /// A widget is mapped when the widget is visible (which is controlled with
847 /// [`visible`][struct@crate::Widget#visible]) and all its parents up to the toplevel widget
848 /// are also visible.
849 ///
850 /// The `::map` signal can be used to determine whether a widget will be drawn,
851 /// for instance it can resume an animation that was stopped during the
852 /// emission of [`unmap`][struct@crate::Widget#unmap].
853 ///
854 ///
855 ///
856 ///
857 /// #### `mnemonic-activate`
858 /// Emitted when a widget is activated via a mnemonic.
859 ///
860 /// The default handler for this signal activates @widget if @group_cycling
861 /// is false, or just makes @widget grab focus if @group_cycling is true.
862 ///
863 ///
864 ///
865 ///
866 /// #### `move-focus`
867 /// Emitted when the focus is moved.
868 ///
869 /// The `::move-focus` signal is a [keybinding signal](class.SignalAction.html).
870 ///
871 /// The default bindings for this signal are <kbd>Tab</kbd> to move forward,
872 /// and <kbd>Shift</kbd>+<kbd>Tab</kbd> to move backward.
873 ///
874 /// Action
875 ///
876 ///
877 /// #### `query-tooltip`
878 /// Emitted when the widget’s tooltip is about to be shown.
879 ///
880 /// This happens when the [`has-tooltip`][struct@crate::Widget#has-tooltip] property
881 /// is true and the hover timeout has expired with the cursor hovering
882 /// above @widget; or emitted when @widget got focus in keyboard mode.
883 ///
884 /// Using the given coordinates, the signal handler should determine
885 /// whether a tooltip should be shown for @widget. If this is the case
886 /// true should be returned, false otherwise. Note that if @keyboard_mode
887 /// is true, the values of @x and @y are undefined and should not be used.
888 ///
889 /// The signal handler is free to manipulate @tooltip with the therefore
890 /// destined function calls.
891 ///
892 ///
893 ///
894 ///
895 /// #### `realize`
896 /// Emitted when @widget is associated with a [`gdk::Surface`][crate::gdk::Surface].
897 ///
898 /// This means that [`WidgetExt::realize()`][crate::prelude::WidgetExt::realize()] has been called
899 /// or the widget has been mapped (that is, it is going to be drawn).
900 ///
901 ///
902 ///
903 ///
904 /// #### `show`
905 /// Emitted when @widget is shown.
906 ///
907 ///
908 ///
909 ///
910 /// #### `state-flags-changed`
911 /// Emitted when the widget state changes.
912 ///
913 /// See [`WidgetExt::state_flags()`][crate::prelude::WidgetExt::state_flags()].
914 ///
915 ///
916 ///
917 ///
918 /// #### `unmap`
919 /// Emitted when @widget is going to be unmapped.
920 ///
921 /// A widget is unmapped when either it or any of its parents up to the
922 /// toplevel widget have been set as hidden.
923 ///
924 /// As `::unmap` indicates that a widget will not be shown any longer,
925 /// it can be used to, for example, stop an animation on the widget.
926 ///
927 ///
928 ///
929 ///
930 /// #### `unrealize`
931 /// Emitted when the [`gdk::Surface`][crate::gdk::Surface] associated with @widget is destroyed.
932 ///
933 /// This means that [`WidgetExt::unrealize()`][crate::prelude::WidgetExt::unrealize()] has been called
934 /// or the widget has been unmapped (that is, it is going to be hidden).
935 ///
936 ///
937 /// </details>
938 ///
939 /// # Implements
940 ///
941 /// [`GtkWindowExt`][trait@crate::prelude::GtkWindowExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`AccessibleExt`][trait@crate::prelude::AccessibleExt], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`ConstraintTargetExt`][trait@crate::prelude::ConstraintTargetExt], [`NativeExt`][trait@crate::prelude::NativeExt], [`RootExt`][trait@crate::prelude::RootExt], [`ShortcutManagerExt`][trait@crate::prelude::ShortcutManagerExt], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`AccessibleExtManual`][trait@crate::prelude::AccessibleExtManual]
942 #[doc(alias = "GtkAboutDialog")]
943 pub struct AboutDialog(Object<ffi::GtkAboutDialog>) @extends Window, Widget, @implements Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager;
944
945 match fn {
946 type_ => || ffi::gtk_about_dialog_get_type(),
947 }
948}
949
950#[cfg(not(feature = "v4_10"))]
951glib::wrapper! {
952 #[doc(alias = "GtkAboutDialog")]
953 pub struct AboutDialog(Object<ffi::GtkAboutDialog>) @extends Window, Widget, @implements Buildable, ConstraintTarget, Native, Root, ShortcutManager;
954
955 match fn {
956 type_ => || ffi::gtk_about_dialog_get_type(),
957 }
958}
959
960impl AboutDialog {
961 /// Creates a new [`AboutDialog`][crate::AboutDialog].
962 ///
963 /// # Returns
964 ///
965 /// a newly created [`AboutDialog`][crate::AboutDialog]
966 #[doc(alias = "gtk_about_dialog_new")]
967 pub fn new() -> AboutDialog {
968 assert_initialized_main_thread!();
969 unsafe { Widget::from_glib_none(ffi::gtk_about_dialog_new()).unsafe_cast() }
970 }
971
972 // rustdoc-stripper-ignore-next
973 /// Creates a new builder-pattern struct instance to construct [`AboutDialog`] objects.
974 ///
975 /// This method returns an instance of [`AboutDialogBuilder`](crate::builders::AboutDialogBuilder) which can be used to create [`AboutDialog`] objects.
976 pub fn builder() -> AboutDialogBuilder {
977 AboutDialogBuilder::new()
978 }
979
980 /// Creates a new section in the "Credits" page.
981 /// ## `section_name`
982 /// The name of the section
983 /// ## `people`
984 /// the people who belong to that section
985 #[doc(alias = "gtk_about_dialog_add_credit_section")]
986 pub fn add_credit_section(&self, section_name: &str, people: &[&str]) {
987 unsafe {
988 ffi::gtk_about_dialog_add_credit_section(
989 self.to_glib_none().0,
990 section_name.to_glib_none().0,
991 people.to_glib_none().0,
992 );
993 }
994 }
995
996 /// Returns the names of the artists which are displayed
997 /// in the credits page.
998 ///
999 /// # Returns
1000 ///
1001 /// A
1002 /// `NULL`-terminated string array containing the artists
1003 #[doc(alias = "gtk_about_dialog_get_artists")]
1004 #[doc(alias = "get_artists")]
1005 pub fn artists(&self) -> Vec<glib::GString> {
1006 unsafe {
1007 FromGlibPtrContainer::from_glib_none(ffi::gtk_about_dialog_get_artists(
1008 self.to_glib_none().0,
1009 ))
1010 }
1011 }
1012
1013 /// Returns the names of the authors which are displayed
1014 /// in the credits page.
1015 ///
1016 /// # Returns
1017 ///
1018 /// A
1019 /// `NULL`-terminated string array containing the authors
1020 #[doc(alias = "gtk_about_dialog_get_authors")]
1021 #[doc(alias = "get_authors")]
1022 pub fn authors(&self) -> Vec<glib::GString> {
1023 unsafe {
1024 FromGlibPtrContainer::from_glib_none(ffi::gtk_about_dialog_get_authors(
1025 self.to_glib_none().0,
1026 ))
1027 }
1028 }
1029
1030 /// Returns the comments string.
1031 ///
1032 /// # Returns
1033 ///
1034 /// The comments
1035 #[doc(alias = "gtk_about_dialog_get_comments")]
1036 #[doc(alias = "get_comments")]
1037 pub fn comments(&self) -> Option<glib::GString> {
1038 unsafe { from_glib_none(ffi::gtk_about_dialog_get_comments(self.to_glib_none().0)) }
1039 }
1040
1041 /// Returns the copyright string.
1042 ///
1043 /// # Returns
1044 ///
1045 /// The copyright string
1046 #[doc(alias = "gtk_about_dialog_get_copyright")]
1047 #[doc(alias = "get_copyright")]
1048 pub fn copyright(&self) -> Option<glib::GString> {
1049 unsafe { from_glib_none(ffi::gtk_about_dialog_get_copyright(self.to_glib_none().0)) }
1050 }
1051
1052 /// Returns the name of the documenters which are displayed
1053 /// in the credits page.
1054 ///
1055 /// # Returns
1056 ///
1057 /// A
1058 /// `NULL`-terminated string array containing the documenters
1059 #[doc(alias = "gtk_about_dialog_get_documenters")]
1060 #[doc(alias = "get_documenters")]
1061 pub fn documenters(&self) -> Vec<glib::GString> {
1062 unsafe {
1063 FromGlibPtrContainer::from_glib_none(ffi::gtk_about_dialog_get_documenters(
1064 self.to_glib_none().0,
1065 ))
1066 }
1067 }
1068
1069 /// Returns the license information.
1070 ///
1071 /// # Returns
1072 ///
1073 /// The license information
1074 #[doc(alias = "gtk_about_dialog_get_license")]
1075 #[doc(alias = "get_license")]
1076 pub fn license(&self) -> Option<glib::GString> {
1077 unsafe { from_glib_none(ffi::gtk_about_dialog_get_license(self.to_glib_none().0)) }
1078 }
1079
1080 /// Retrieves the license type.
1081 ///
1082 /// # Returns
1083 ///
1084 /// a [`License`][crate::License] value
1085 #[doc(alias = "gtk_about_dialog_get_license_type")]
1086 #[doc(alias = "get_license_type")]
1087 #[doc(alias = "license-type")]
1088 pub fn license_type(&self) -> License {
1089 unsafe {
1090 from_glib(ffi::gtk_about_dialog_get_license_type(
1091 self.to_glib_none().0,
1092 ))
1093 }
1094 }
1095
1096 /// Returns the paintable displayed as logo in the about dialog.
1097 ///
1098 /// # Returns
1099 ///
1100 /// the paintable displayed as
1101 /// logo or `NULL` if the logo is unset or has been set via
1102 /// [`set_logo_icon_name()`][Self::set_logo_icon_name()]
1103 #[doc(alias = "gtk_about_dialog_get_logo")]
1104 #[doc(alias = "get_logo")]
1105 pub fn logo(&self) -> Option<gdk::Paintable> {
1106 unsafe { from_glib_none(ffi::gtk_about_dialog_get_logo(self.to_glib_none().0)) }
1107 }
1108
1109 /// Returns the icon name displayed as logo in the about dialog.
1110 ///
1111 /// # Returns
1112 ///
1113 /// the icon name displayed as logo,
1114 /// or `NULL` if the logo has been set via [`set_logo()`][Self::set_logo()]
1115 #[doc(alias = "gtk_about_dialog_get_logo_icon_name")]
1116 #[doc(alias = "get_logo_icon_name")]
1117 #[doc(alias = "logo-icon-name")]
1118 pub fn logo_icon_name(&self) -> Option<glib::GString> {
1119 unsafe {
1120 from_glib_none(ffi::gtk_about_dialog_get_logo_icon_name(
1121 self.to_glib_none().0,
1122 ))
1123 }
1124 }
1125
1126 /// Returns the program name displayed in the about dialog.
1127 ///
1128 /// # Returns
1129 ///
1130 /// the program name
1131 #[doc(alias = "gtk_about_dialog_get_program_name")]
1132 #[doc(alias = "get_program_name")]
1133 #[doc(alias = "program-name")]
1134 pub fn program_name(&self) -> Option<glib::GString> {
1135 unsafe {
1136 from_glib_none(ffi::gtk_about_dialog_get_program_name(
1137 self.to_glib_none().0,
1138 ))
1139 }
1140 }
1141
1142 /// Returns the system information that is shown in the about dialog.
1143 ///
1144 /// # Returns
1145 ///
1146 /// the system information
1147 #[doc(alias = "gtk_about_dialog_get_system_information")]
1148 #[doc(alias = "get_system_information")]
1149 #[doc(alias = "system-information")]
1150 pub fn system_information(&self) -> Option<glib::GString> {
1151 unsafe {
1152 from_glib_none(ffi::gtk_about_dialog_get_system_information(
1153 self.to_glib_none().0,
1154 ))
1155 }
1156 }
1157
1158 /// Returns the translator credits string which is displayed
1159 /// in the credits page.
1160 ///
1161 /// # Returns
1162 ///
1163 /// The translator credits string
1164 #[doc(alias = "gtk_about_dialog_get_translator_credits")]
1165 #[doc(alias = "get_translator_credits")]
1166 #[doc(alias = "translator-credits")]
1167 pub fn translator_credits(&self) -> Option<glib::GString> {
1168 unsafe {
1169 from_glib_none(ffi::gtk_about_dialog_get_translator_credits(
1170 self.to_glib_none().0,
1171 ))
1172 }
1173 }
1174
1175 /// Returns the version string.
1176 ///
1177 /// # Returns
1178 ///
1179 /// The version string
1180 #[doc(alias = "gtk_about_dialog_get_version")]
1181 #[doc(alias = "get_version")]
1182 pub fn version(&self) -> Option<glib::GString> {
1183 unsafe { from_glib_none(ffi::gtk_about_dialog_get_version(self.to_glib_none().0)) }
1184 }
1185
1186 /// Returns the website URL.
1187 ///
1188 /// # Returns
1189 ///
1190 /// The website URL
1191 #[doc(alias = "gtk_about_dialog_get_website")]
1192 #[doc(alias = "get_website")]
1193 pub fn website(&self) -> Option<glib::GString> {
1194 unsafe { from_glib_none(ffi::gtk_about_dialog_get_website(self.to_glib_none().0)) }
1195 }
1196
1197 /// Returns the label used for the website link.
1198 ///
1199 /// # Returns
1200 ///
1201 /// The label used for the website link
1202 #[doc(alias = "gtk_about_dialog_get_website_label")]
1203 #[doc(alias = "get_website_label")]
1204 #[doc(alias = "website-label")]
1205 pub fn website_label(&self) -> Option<glib::GString> {
1206 unsafe {
1207 from_glib_none(ffi::gtk_about_dialog_get_website_label(
1208 self.to_glib_none().0,
1209 ))
1210 }
1211 }
1212
1213 /// Returns whether the license text in the about dialog is
1214 /// automatically wrapped.
1215 ///
1216 /// # Returns
1217 ///
1218 /// `TRUE` if the license text is wrapped
1219 #[doc(alias = "gtk_about_dialog_get_wrap_license")]
1220 #[doc(alias = "get_wrap_license")]
1221 #[doc(alias = "wrap-license")]
1222 pub fn wraps_license(&self) -> bool {
1223 unsafe {
1224 from_glib(ffi::gtk_about_dialog_get_wrap_license(
1225 self.to_glib_none().0,
1226 ))
1227 }
1228 }
1229
1230 /// Sets the names of the artists to be displayed
1231 /// in the "Credits" page.
1232 /// ## `artists`
1233 /// the authors of the artwork
1234 /// of the application
1235 #[doc(alias = "gtk_about_dialog_set_artists")]
1236 #[doc(alias = "artists")]
1237 pub fn set_artists(&self, artists: &[&str]) {
1238 unsafe {
1239 ffi::gtk_about_dialog_set_artists(self.to_glib_none().0, artists.to_glib_none().0);
1240 }
1241 }
1242
1243 /// Sets the names of the authors which are displayed
1244 /// in the "Credits" page of the about dialog.
1245 /// ## `authors`
1246 /// the authors of the application
1247 #[doc(alias = "gtk_about_dialog_set_authors")]
1248 #[doc(alias = "authors")]
1249 pub fn set_authors(&self, authors: &[&str]) {
1250 unsafe {
1251 ffi::gtk_about_dialog_set_authors(self.to_glib_none().0, authors.to_glib_none().0);
1252 }
1253 }
1254
1255 /// Sets the comments string to display in the about dialog.
1256 ///
1257 /// This should be a short string of one or two lines.
1258 /// ## `comments`
1259 /// a comments string
1260 #[doc(alias = "gtk_about_dialog_set_comments")]
1261 #[doc(alias = "comments")]
1262 pub fn set_comments(&self, comments: Option<&str>) {
1263 unsafe {
1264 ffi::gtk_about_dialog_set_comments(self.to_glib_none().0, comments.to_glib_none().0);
1265 }
1266 }
1267
1268 /// Sets the copyright string to display in the about dialog.
1269 ///
1270 /// This should be a short string of one or two lines.
1271 /// ## `copyright`
1272 /// the copyright string
1273 #[doc(alias = "gtk_about_dialog_set_copyright")]
1274 #[doc(alias = "copyright")]
1275 pub fn set_copyright(&self, copyright: Option<&str>) {
1276 unsafe {
1277 ffi::gtk_about_dialog_set_copyright(self.to_glib_none().0, copyright.to_glib_none().0);
1278 }
1279 }
1280
1281 /// Sets the names of the documenters which are displayed
1282 /// in the "Credits" page.
1283 /// ## `documenters`
1284 /// the authors of the documentation
1285 /// of the application
1286 #[doc(alias = "gtk_about_dialog_set_documenters")]
1287 #[doc(alias = "documenters")]
1288 pub fn set_documenters(&self, documenters: &[&str]) {
1289 unsafe {
1290 ffi::gtk_about_dialog_set_documenters(
1291 self.to_glib_none().0,
1292 documenters.to_glib_none().0,
1293 );
1294 }
1295 }
1296
1297 /// Sets the license information to be displayed in the
1298 /// about dialog.
1299 ///
1300 /// If `license` is `NULL`, the license page is hidden.
1301 /// ## `license`
1302 /// the license information
1303 #[doc(alias = "gtk_about_dialog_set_license")]
1304 #[doc(alias = "license")]
1305 pub fn set_license(&self, license: Option<&str>) {
1306 unsafe {
1307 ffi::gtk_about_dialog_set_license(self.to_glib_none().0, license.to_glib_none().0);
1308 }
1309 }
1310
1311 /// Sets the license of the application showing the about dialog
1312 /// from a list of known licenses.
1313 ///
1314 /// This function overrides the license set using
1315 /// [`set_license()`][Self::set_license()].
1316 /// ## `license_type`
1317 /// the type of license
1318 #[doc(alias = "gtk_about_dialog_set_license_type")]
1319 #[doc(alias = "license-type")]
1320 pub fn set_license_type(&self, license_type: License) {
1321 unsafe {
1322 ffi::gtk_about_dialog_set_license_type(self.to_glib_none().0, license_type.into_glib());
1323 }
1324 }
1325
1326 /// Sets the logo in the about dialog.
1327 /// ## `logo`
1328 /// a [`gdk::Paintable`][crate::gdk::Paintable]
1329 #[doc(alias = "gtk_about_dialog_set_logo")]
1330 #[doc(alias = "logo")]
1331 pub fn set_logo(&self, logo: Option<&impl IsA<gdk::Paintable>>) {
1332 unsafe {
1333 ffi::gtk_about_dialog_set_logo(
1334 self.to_glib_none().0,
1335 logo.map(|p| p.as_ref()).to_glib_none().0,
1336 );
1337 }
1338 }
1339
1340 /// Sets the icon name to be displayed as logo in the about dialog.
1341 /// ## `icon_name`
1342 /// an icon name
1343 #[doc(alias = "gtk_about_dialog_set_logo_icon_name")]
1344 #[doc(alias = "logo-icon-name")]
1345 pub fn set_logo_icon_name(&self, icon_name: Option<&str>) {
1346 unsafe {
1347 ffi::gtk_about_dialog_set_logo_icon_name(
1348 self.to_glib_none().0,
1349 icon_name.to_glib_none().0,
1350 );
1351 }
1352 }
1353
1354 /// Sets the name to display in the about dialog.
1355 ///
1356 /// If `name` is not set, the string returned
1357 /// by `g_get_application_name()` is used.
1358 /// ## `name`
1359 /// the program name
1360 #[doc(alias = "gtk_about_dialog_set_program_name")]
1361 #[doc(alias = "program-name")]
1362 pub fn set_program_name(&self, name: Option<&str>) {
1363 unsafe {
1364 ffi::gtk_about_dialog_set_program_name(self.to_glib_none().0, name.to_glib_none().0);
1365 }
1366 }
1367
1368 /// Sets the system information to be displayed in the about
1369 /// dialog.
1370 ///
1371 /// If `system_information` is `NULL`, the system information
1372 /// page is hidden.
1373 ///
1374 /// See [`system-information`][struct@crate::AboutDialog#system-information].
1375 /// ## `system_information`
1376 /// system information
1377 #[doc(alias = "gtk_about_dialog_set_system_information")]
1378 #[doc(alias = "system-information")]
1379 pub fn set_system_information(&self, system_information: Option<&str>) {
1380 unsafe {
1381 ffi::gtk_about_dialog_set_system_information(
1382 self.to_glib_none().0,
1383 system_information.to_glib_none().0,
1384 );
1385 }
1386 }
1387
1388 /// Sets the translator credits string which is displayed in
1389 /// the credits page.
1390 ///
1391 /// The intended use for this string is to display the translator
1392 /// of the language which is currently used in the user interface.
1393 /// Using `gettext()`, a simple way to achieve that is to mark the
1394 /// string for translation:
1395 ///
1396 /// **⚠️ The following code is in c ⚠️**
1397 ///
1398 /// ```c
1399 /// GtkWidget *about = gtk_about_dialog_new ();
1400 /// gtk_about_dialog_set_translator_credits (GTK_ABOUT_DIALOG (about),
1401 /// _("translator-credits"));
1402 /// ```
1403 ///
1404 /// It is a good idea to use the customary `msgid` “translator-credits”
1405 /// for this purpose, since translators will already know the purpose of
1406 /// that `msgid`, and since [`AboutDialog`][crate::AboutDialog] will detect if “translator-credits”
1407 /// is untranslated and omit translator credits.
1408 /// ## `translator_credits`
1409 /// the translator credits
1410 #[doc(alias = "gtk_about_dialog_set_translator_credits")]
1411 #[doc(alias = "translator-credits")]
1412 pub fn set_translator_credits(&self, translator_credits: Option<&str>) {
1413 unsafe {
1414 ffi::gtk_about_dialog_set_translator_credits(
1415 self.to_glib_none().0,
1416 translator_credits.to_glib_none().0,
1417 );
1418 }
1419 }
1420
1421 /// Sets the version string to display in the about dialog.
1422 /// ## `version`
1423 /// the version string
1424 #[doc(alias = "gtk_about_dialog_set_version")]
1425 #[doc(alias = "version")]
1426 pub fn set_version(&self, version: Option<&str>) {
1427 unsafe {
1428 ffi::gtk_about_dialog_set_version(self.to_glib_none().0, version.to_glib_none().0);
1429 }
1430 }
1431
1432 /// Sets the URL to use for the website link.
1433 /// ## `website`
1434 /// a URL string starting with `http://`
1435 #[doc(alias = "gtk_about_dialog_set_website")]
1436 #[doc(alias = "website")]
1437 pub fn set_website(&self, website: Option<&str>) {
1438 unsafe {
1439 ffi::gtk_about_dialog_set_website(self.to_glib_none().0, website.to_glib_none().0);
1440 }
1441 }
1442
1443 /// Sets the label to be used for the website link.
1444 /// ## `website_label`
1445 /// the label used for the website link
1446 #[doc(alias = "gtk_about_dialog_set_website_label")]
1447 #[doc(alias = "website-label")]
1448 pub fn set_website_label(&self, website_label: &str) {
1449 unsafe {
1450 ffi::gtk_about_dialog_set_website_label(
1451 self.to_glib_none().0,
1452 website_label.to_glib_none().0,
1453 );
1454 }
1455 }
1456
1457 /// Sets whether the license text in the about dialog should be
1458 /// automatically wrapped.
1459 /// ## `wrap_license`
1460 /// whether to wrap the license
1461 #[doc(alias = "gtk_about_dialog_set_wrap_license")]
1462 #[doc(alias = "wrap-license")]
1463 pub fn set_wrap_license(&self, wrap_license: bool) {
1464 unsafe {
1465 ffi::gtk_about_dialog_set_wrap_license(self.to_glib_none().0, wrap_license.into_glib());
1466 }
1467 }
1468
1469 /// Emitted every time a URL is activated.
1470 ///
1471 /// Applications may connect to it to override the default behaviour,
1472 /// which is to call [`FileLauncher::launch()`][crate::FileLauncher::launch()].
1473 /// ## `uri`
1474 /// the URI that is activated
1475 ///
1476 /// # Returns
1477 ///
1478 /// `TRUE` if the link has been activated
1479 #[doc(alias = "activate-link")]
1480 pub fn connect_activate_link<F: Fn(&Self, &str) -> glib::Propagation + 'static>(
1481 &self,
1482 f: F,
1483 ) -> SignalHandlerId {
1484 unsafe extern "C" fn activate_link_trampoline<
1485 F: Fn(&AboutDialog, &str) -> glib::Propagation + 'static,
1486 >(
1487 this: *mut ffi::GtkAboutDialog,
1488 uri: *mut std::ffi::c_char,
1489 f: glib::ffi::gpointer,
1490 ) -> glib::ffi::gboolean {
1491 unsafe {
1492 let f: &F = &*(f as *const F);
1493 f(
1494 &from_glib_borrow(this),
1495 &glib::GString::from_glib_borrow(uri),
1496 )
1497 .into_glib()
1498 }
1499 }
1500 unsafe {
1501 let f: Box_<F> = Box_::new(f);
1502 connect_raw(
1503 self.as_ptr() as *mut _,
1504 c"activate-link".as_ptr(),
1505 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1506 activate_link_trampoline::<F> as *const (),
1507 )),
1508 Box_::into_raw(f),
1509 )
1510 }
1511 }
1512
1513 #[doc(alias = "artists")]
1514 pub fn connect_artists_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1515 unsafe extern "C" fn notify_artists_trampoline<F: Fn(&AboutDialog) + 'static>(
1516 this: *mut ffi::GtkAboutDialog,
1517 _param_spec: glib::ffi::gpointer,
1518 f: glib::ffi::gpointer,
1519 ) {
1520 unsafe {
1521 let f: &F = &*(f as *const F);
1522 f(&from_glib_borrow(this))
1523 }
1524 }
1525 unsafe {
1526 let f: Box_<F> = Box_::new(f);
1527 connect_raw(
1528 self.as_ptr() as *mut _,
1529 c"notify::artists".as_ptr(),
1530 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1531 notify_artists_trampoline::<F> as *const (),
1532 )),
1533 Box_::into_raw(f),
1534 )
1535 }
1536 }
1537
1538 #[doc(alias = "authors")]
1539 pub fn connect_authors_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1540 unsafe extern "C" fn notify_authors_trampoline<F: Fn(&AboutDialog) + 'static>(
1541 this: *mut ffi::GtkAboutDialog,
1542 _param_spec: glib::ffi::gpointer,
1543 f: glib::ffi::gpointer,
1544 ) {
1545 unsafe {
1546 let f: &F = &*(f as *const F);
1547 f(&from_glib_borrow(this))
1548 }
1549 }
1550 unsafe {
1551 let f: Box_<F> = Box_::new(f);
1552 connect_raw(
1553 self.as_ptr() as *mut _,
1554 c"notify::authors".as_ptr(),
1555 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1556 notify_authors_trampoline::<F> as *const (),
1557 )),
1558 Box_::into_raw(f),
1559 )
1560 }
1561 }
1562
1563 #[doc(alias = "comments")]
1564 pub fn connect_comments_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1565 unsafe extern "C" fn notify_comments_trampoline<F: Fn(&AboutDialog) + 'static>(
1566 this: *mut ffi::GtkAboutDialog,
1567 _param_spec: glib::ffi::gpointer,
1568 f: glib::ffi::gpointer,
1569 ) {
1570 unsafe {
1571 let f: &F = &*(f as *const F);
1572 f(&from_glib_borrow(this))
1573 }
1574 }
1575 unsafe {
1576 let f: Box_<F> = Box_::new(f);
1577 connect_raw(
1578 self.as_ptr() as *mut _,
1579 c"notify::comments".as_ptr(),
1580 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1581 notify_comments_trampoline::<F> as *const (),
1582 )),
1583 Box_::into_raw(f),
1584 )
1585 }
1586 }
1587
1588 #[doc(alias = "copyright")]
1589 pub fn connect_copyright_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1590 unsafe extern "C" fn notify_copyright_trampoline<F: Fn(&AboutDialog) + 'static>(
1591 this: *mut ffi::GtkAboutDialog,
1592 _param_spec: glib::ffi::gpointer,
1593 f: glib::ffi::gpointer,
1594 ) {
1595 unsafe {
1596 let f: &F = &*(f as *const F);
1597 f(&from_glib_borrow(this))
1598 }
1599 }
1600 unsafe {
1601 let f: Box_<F> = Box_::new(f);
1602 connect_raw(
1603 self.as_ptr() as *mut _,
1604 c"notify::copyright".as_ptr(),
1605 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1606 notify_copyright_trampoline::<F> as *const (),
1607 )),
1608 Box_::into_raw(f),
1609 )
1610 }
1611 }
1612
1613 #[doc(alias = "documenters")]
1614 pub fn connect_documenters_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1615 unsafe extern "C" fn notify_documenters_trampoline<F: Fn(&AboutDialog) + 'static>(
1616 this: *mut ffi::GtkAboutDialog,
1617 _param_spec: glib::ffi::gpointer,
1618 f: glib::ffi::gpointer,
1619 ) {
1620 unsafe {
1621 let f: &F = &*(f as *const F);
1622 f(&from_glib_borrow(this))
1623 }
1624 }
1625 unsafe {
1626 let f: Box_<F> = Box_::new(f);
1627 connect_raw(
1628 self.as_ptr() as *mut _,
1629 c"notify::documenters".as_ptr(),
1630 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1631 notify_documenters_trampoline::<F> as *const (),
1632 )),
1633 Box_::into_raw(f),
1634 )
1635 }
1636 }
1637
1638 #[doc(alias = "license")]
1639 pub fn connect_license_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1640 unsafe extern "C" fn notify_license_trampoline<F: Fn(&AboutDialog) + 'static>(
1641 this: *mut ffi::GtkAboutDialog,
1642 _param_spec: glib::ffi::gpointer,
1643 f: glib::ffi::gpointer,
1644 ) {
1645 unsafe {
1646 let f: &F = &*(f as *const F);
1647 f(&from_glib_borrow(this))
1648 }
1649 }
1650 unsafe {
1651 let f: Box_<F> = Box_::new(f);
1652 connect_raw(
1653 self.as_ptr() as *mut _,
1654 c"notify::license".as_ptr(),
1655 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1656 notify_license_trampoline::<F> as *const (),
1657 )),
1658 Box_::into_raw(f),
1659 )
1660 }
1661 }
1662
1663 #[doc(alias = "license-type")]
1664 pub fn connect_license_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1665 unsafe extern "C" fn notify_license_type_trampoline<F: Fn(&AboutDialog) + 'static>(
1666 this: *mut ffi::GtkAboutDialog,
1667 _param_spec: glib::ffi::gpointer,
1668 f: glib::ffi::gpointer,
1669 ) {
1670 unsafe {
1671 let f: &F = &*(f as *const F);
1672 f(&from_glib_borrow(this))
1673 }
1674 }
1675 unsafe {
1676 let f: Box_<F> = Box_::new(f);
1677 connect_raw(
1678 self.as_ptr() as *mut _,
1679 c"notify::license-type".as_ptr(),
1680 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1681 notify_license_type_trampoline::<F> as *const (),
1682 )),
1683 Box_::into_raw(f),
1684 )
1685 }
1686 }
1687
1688 #[doc(alias = "logo")]
1689 pub fn connect_logo_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1690 unsafe extern "C" fn notify_logo_trampoline<F: Fn(&AboutDialog) + 'static>(
1691 this: *mut ffi::GtkAboutDialog,
1692 _param_spec: glib::ffi::gpointer,
1693 f: glib::ffi::gpointer,
1694 ) {
1695 unsafe {
1696 let f: &F = &*(f as *const F);
1697 f(&from_glib_borrow(this))
1698 }
1699 }
1700 unsafe {
1701 let f: Box_<F> = Box_::new(f);
1702 connect_raw(
1703 self.as_ptr() as *mut _,
1704 c"notify::logo".as_ptr(),
1705 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1706 notify_logo_trampoline::<F> as *const (),
1707 )),
1708 Box_::into_raw(f),
1709 )
1710 }
1711 }
1712
1713 #[doc(alias = "logo-icon-name")]
1714 pub fn connect_logo_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1715 unsafe extern "C" fn notify_logo_icon_name_trampoline<F: Fn(&AboutDialog) + 'static>(
1716 this: *mut ffi::GtkAboutDialog,
1717 _param_spec: glib::ffi::gpointer,
1718 f: glib::ffi::gpointer,
1719 ) {
1720 unsafe {
1721 let f: &F = &*(f as *const F);
1722 f(&from_glib_borrow(this))
1723 }
1724 }
1725 unsafe {
1726 let f: Box_<F> = Box_::new(f);
1727 connect_raw(
1728 self.as_ptr() as *mut _,
1729 c"notify::logo-icon-name".as_ptr(),
1730 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1731 notify_logo_icon_name_trampoline::<F> as *const (),
1732 )),
1733 Box_::into_raw(f),
1734 )
1735 }
1736 }
1737
1738 #[doc(alias = "program-name")]
1739 pub fn connect_program_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1740 unsafe extern "C" fn notify_program_name_trampoline<F: Fn(&AboutDialog) + 'static>(
1741 this: *mut ffi::GtkAboutDialog,
1742 _param_spec: glib::ffi::gpointer,
1743 f: glib::ffi::gpointer,
1744 ) {
1745 unsafe {
1746 let f: &F = &*(f as *const F);
1747 f(&from_glib_borrow(this))
1748 }
1749 }
1750 unsafe {
1751 let f: Box_<F> = Box_::new(f);
1752 connect_raw(
1753 self.as_ptr() as *mut _,
1754 c"notify::program-name".as_ptr(),
1755 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1756 notify_program_name_trampoline::<F> as *const (),
1757 )),
1758 Box_::into_raw(f),
1759 )
1760 }
1761 }
1762
1763 #[doc(alias = "system-information")]
1764 pub fn connect_system_information_notify<F: Fn(&Self) + 'static>(
1765 &self,
1766 f: F,
1767 ) -> SignalHandlerId {
1768 unsafe extern "C" fn notify_system_information_trampoline<F: Fn(&AboutDialog) + 'static>(
1769 this: *mut ffi::GtkAboutDialog,
1770 _param_spec: glib::ffi::gpointer,
1771 f: glib::ffi::gpointer,
1772 ) {
1773 unsafe {
1774 let f: &F = &*(f as *const F);
1775 f(&from_glib_borrow(this))
1776 }
1777 }
1778 unsafe {
1779 let f: Box_<F> = Box_::new(f);
1780 connect_raw(
1781 self.as_ptr() as *mut _,
1782 c"notify::system-information".as_ptr(),
1783 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1784 notify_system_information_trampoline::<F> as *const (),
1785 )),
1786 Box_::into_raw(f),
1787 )
1788 }
1789 }
1790
1791 #[doc(alias = "translator-credits")]
1792 pub fn connect_translator_credits_notify<F: Fn(&Self) + 'static>(
1793 &self,
1794 f: F,
1795 ) -> SignalHandlerId {
1796 unsafe extern "C" fn notify_translator_credits_trampoline<F: Fn(&AboutDialog) + 'static>(
1797 this: *mut ffi::GtkAboutDialog,
1798 _param_spec: glib::ffi::gpointer,
1799 f: glib::ffi::gpointer,
1800 ) {
1801 unsafe {
1802 let f: &F = &*(f as *const F);
1803 f(&from_glib_borrow(this))
1804 }
1805 }
1806 unsafe {
1807 let f: Box_<F> = Box_::new(f);
1808 connect_raw(
1809 self.as_ptr() as *mut _,
1810 c"notify::translator-credits".as_ptr(),
1811 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1812 notify_translator_credits_trampoline::<F> as *const (),
1813 )),
1814 Box_::into_raw(f),
1815 )
1816 }
1817 }
1818
1819 #[doc(alias = "version")]
1820 pub fn connect_version_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1821 unsafe extern "C" fn notify_version_trampoline<F: Fn(&AboutDialog) + 'static>(
1822 this: *mut ffi::GtkAboutDialog,
1823 _param_spec: glib::ffi::gpointer,
1824 f: glib::ffi::gpointer,
1825 ) {
1826 unsafe {
1827 let f: &F = &*(f as *const F);
1828 f(&from_glib_borrow(this))
1829 }
1830 }
1831 unsafe {
1832 let f: Box_<F> = Box_::new(f);
1833 connect_raw(
1834 self.as_ptr() as *mut _,
1835 c"notify::version".as_ptr(),
1836 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1837 notify_version_trampoline::<F> as *const (),
1838 )),
1839 Box_::into_raw(f),
1840 )
1841 }
1842 }
1843
1844 #[doc(alias = "website")]
1845 pub fn connect_website_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1846 unsafe extern "C" fn notify_website_trampoline<F: Fn(&AboutDialog) + 'static>(
1847 this: *mut ffi::GtkAboutDialog,
1848 _param_spec: glib::ffi::gpointer,
1849 f: glib::ffi::gpointer,
1850 ) {
1851 unsafe {
1852 let f: &F = &*(f as *const F);
1853 f(&from_glib_borrow(this))
1854 }
1855 }
1856 unsafe {
1857 let f: Box_<F> = Box_::new(f);
1858 connect_raw(
1859 self.as_ptr() as *mut _,
1860 c"notify::website".as_ptr(),
1861 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1862 notify_website_trampoline::<F> as *const (),
1863 )),
1864 Box_::into_raw(f),
1865 )
1866 }
1867 }
1868
1869 #[doc(alias = "website-label")]
1870 pub fn connect_website_label_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1871 unsafe extern "C" fn notify_website_label_trampoline<F: Fn(&AboutDialog) + 'static>(
1872 this: *mut ffi::GtkAboutDialog,
1873 _param_spec: glib::ffi::gpointer,
1874 f: glib::ffi::gpointer,
1875 ) {
1876 unsafe {
1877 let f: &F = &*(f as *const F);
1878 f(&from_glib_borrow(this))
1879 }
1880 }
1881 unsafe {
1882 let f: Box_<F> = Box_::new(f);
1883 connect_raw(
1884 self.as_ptr() as *mut _,
1885 c"notify::website-label".as_ptr(),
1886 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1887 notify_website_label_trampoline::<F> as *const (),
1888 )),
1889 Box_::into_raw(f),
1890 )
1891 }
1892 }
1893
1894 #[doc(alias = "wrap-license")]
1895 pub fn connect_wrap_license_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1896 unsafe extern "C" fn notify_wrap_license_trampoline<F: Fn(&AboutDialog) + 'static>(
1897 this: *mut ffi::GtkAboutDialog,
1898 _param_spec: glib::ffi::gpointer,
1899 f: glib::ffi::gpointer,
1900 ) {
1901 unsafe {
1902 let f: &F = &*(f as *const F);
1903 f(&from_glib_borrow(this))
1904 }
1905 }
1906 unsafe {
1907 let f: Box_<F> = Box_::new(f);
1908 connect_raw(
1909 self.as_ptr() as *mut _,
1910 c"notify::wrap-license".as_ptr(),
1911 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1912 notify_wrap_license_trampoline::<F> as *const (),
1913 )),
1914 Box_::into_raw(f),
1915 )
1916 }
1917 }
1918}
1919
1920impl Default for AboutDialog {
1921 fn default() -> Self {
1922 Self::new()
1923 }
1924}
1925
1926// rustdoc-stripper-ignore-next
1927/// A [builder-pattern] type to construct [`AboutDialog`] objects.
1928///
1929/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
1930#[must_use = "The builder must be built to be used"]
1931pub struct AboutDialogBuilder {
1932 builder: glib::object::ObjectBuilder<'static, AboutDialog>,
1933}
1934
1935impl AboutDialogBuilder {
1936 fn new() -> Self {
1937 Self {
1938 builder: glib::object::Object::builder(),
1939 }
1940 }
1941
1942 /// The people who contributed artwork to the program.
1943 ///
1944 /// Each string may contain email addresses and URLs, which will be displayed
1945 /// as links.
1946 pub fn artists(self, artists: impl Into<glib::StrV>) -> Self {
1947 Self {
1948 builder: self.builder.property("artists", artists.into()),
1949 }
1950 }
1951
1952 /// The authors of the program.
1953 ///
1954 /// Each string may contain email addresses and URLs, which will be displayed
1955 /// as links, see the introduction for more details.
1956 pub fn authors(self, authors: impl Into<glib::StrV>) -> Self {
1957 Self {
1958 builder: self.builder.property("authors", authors.into()),
1959 }
1960 }
1961
1962 /// Comments about the program.
1963 ///
1964 /// This string is displayed in a label in the main dialog, thus it
1965 /// should be a short explanation of the main purpose of the program,
1966 /// not a detailed list of features.
1967 pub fn comments(self, comments: impl Into<glib::GString>) -> Self {
1968 Self {
1969 builder: self.builder.property("comments", comments.into()),
1970 }
1971 }
1972
1973 /// Copyright information for the program.
1974 pub fn copyright(self, copyright: impl Into<glib::GString>) -> Self {
1975 Self {
1976 builder: self.builder.property("copyright", copyright.into()),
1977 }
1978 }
1979
1980 /// The people documenting the program.
1981 ///
1982 /// Each string may contain email addresses and URLs, which will be displayed
1983 /// as links, see the introduction for more details.
1984 pub fn documenters(self, documenters: impl Into<glib::StrV>) -> Self {
1985 Self {
1986 builder: self.builder.property("documenters", documenters.into()),
1987 }
1988 }
1989
1990 /// The license of the program, as free-form text.
1991 ///
1992 /// This string is displayed in a text view in a secondary dialog, therefore
1993 /// it is fine to use a long multi-paragraph text. Note that the text is only
1994 /// wrapped in the text view if the "wrap-license" property is set to `TRUE`;
1995 /// otherwise the text itself must contain the intended linebreaks.
1996 ///
1997 /// When setting this property to a non-`NULL` value, the
1998 /// [`license-type`][struct@crate::AboutDialog#license-type] property is set to
1999 /// [enum@Gtk.License.custom] as a side effect.
2000 ///
2001 /// The text may contain links in this format `<http://www.some.place/>`
2002 /// and email references in the form `<mail-to@some.body>`, and these will
2003 /// be converted into clickable links.
2004 pub fn license(self, license: impl Into<glib::GString>) -> Self {
2005 Self {
2006 builder: self.builder.property("license", license.into()),
2007 }
2008 }
2009
2010 /// The license of the program.
2011 ///
2012 /// The [`AboutDialog`][crate::AboutDialog] will automatically fill out a standard disclaimer
2013 /// and link the user to the appropriate online resource for the license
2014 /// text.
2015 ///
2016 /// If [enum@Gtk.License.unknown] is used, the link used will be the same
2017 /// specified in the [`website`][struct@crate::AboutDialog#website] property.
2018 ///
2019 /// If [enum@Gtk.License.custom] is used, the current contents of the
2020 /// [`license`][struct@crate::AboutDialog#license] property are used.
2021 ///
2022 /// For any other [`License`][crate::License] value, the contents of the
2023 /// [`license`][struct@crate::AboutDialog#license] property are also set by
2024 /// this property as a side effect.
2025 pub fn license_type(self, license_type: License) -> Self {
2026 Self {
2027 builder: self.builder.property("license-type", license_type),
2028 }
2029 }
2030
2031 /// A logo for the about box.
2032 ///
2033 /// If it is `NULL`, the default window icon set with
2034 /// [`Window::set_default_icon_name()`][crate::Window::set_default_icon_name()] will be used.
2035 pub fn logo(self, logo: &impl IsA<gdk::Paintable>) -> Self {
2036 Self {
2037 builder: self.builder.property("logo", logo.clone().upcast()),
2038 }
2039 }
2040
2041 /// A named icon to use as the logo for the about box.
2042 ///
2043 /// This property overrides the [`logo`][struct@crate::AboutDialog#logo] property.
2044 pub fn logo_icon_name(self, logo_icon_name: impl Into<glib::GString>) -> Self {
2045 Self {
2046 builder: self
2047 .builder
2048 .property("logo-icon-name", logo_icon_name.into()),
2049 }
2050 }
2051
2052 /// The name of the program.
2053 ///
2054 /// If this is not set, it defaults to the value returned by
2055 /// `get_application_name()`.
2056 pub fn program_name(self, program_name: impl Into<glib::GString>) -> Self {
2057 Self {
2058 builder: self.builder.property("program-name", program_name.into()),
2059 }
2060 }
2061
2062 /// Information about the system on which the program is running.
2063 ///
2064 /// This information is displayed in a separate page, therefore it is fine
2065 /// to use a long multi-paragraph text. Note that the text should contain
2066 /// the intended linebreaks.
2067 ///
2068 /// The text may contain links in this format `<http://www.some.place/>`
2069 /// and email references in the form `<mail-to@some.body>`, and these will
2070 /// be converted into clickable links.
2071 pub fn system_information(self, system_information: impl Into<glib::GString>) -> Self {
2072 Self {
2073 builder: self
2074 .builder
2075 .property("system-information", system_information.into()),
2076 }
2077 }
2078
2079 /// Credits to the translators.
2080 ///
2081 /// This string should be marked as translatable.
2082 ///
2083 /// The string may contain email addresses and URLs, which will be displayed
2084 /// as links, see the introduction for more details.
2085 pub fn translator_credits(self, translator_credits: impl Into<glib::GString>) -> Self {
2086 Self {
2087 builder: self
2088 .builder
2089 .property("translator-credits", translator_credits.into()),
2090 }
2091 }
2092
2093 /// The version of the program.
2094 pub fn version(self, version: impl Into<glib::GString>) -> Self {
2095 Self {
2096 builder: self.builder.property("version", version.into()),
2097 }
2098 }
2099
2100 /// The URL for the link to the website of the program.
2101 ///
2102 /// This should be a string starting with `http://` or `https://`.
2103 pub fn website(self, website: impl Into<glib::GString>) -> Self {
2104 Self {
2105 builder: self.builder.property("website", website.into()),
2106 }
2107 }
2108
2109 /// The label for the link to the website of the program.
2110 pub fn website_label(self, website_label: impl Into<glib::GString>) -> Self {
2111 Self {
2112 builder: self.builder.property("website-label", website_label.into()),
2113 }
2114 }
2115
2116 /// Whether to wrap the text in the license dialog.
2117 pub fn wrap_license(self, wrap_license: bool) -> Self {
2118 Self {
2119 builder: self.builder.property("wrap-license", wrap_license),
2120 }
2121 }
2122
2123 /// The [`Application`][crate::Application] associated with the window.
2124 ///
2125 /// The application will be kept alive for at least as long as it
2126 /// has any windows associated with it (see g_application_hold()
2127 /// for a way to keep it alive without windows).
2128 ///
2129 /// Normally, the connection between the application and the window
2130 /// will remain until the window is destroyed, but you can explicitly
2131 /// remove it by setting the this property to `NULL`.
2132 pub fn application(self, application: &impl IsA<Application>) -> Self {
2133 Self {
2134 builder: self
2135 .builder
2136 .property("application", application.clone().upcast()),
2137 }
2138 }
2139
2140 /// The child widget.
2141 pub fn child(self, child: &impl IsA<Widget>) -> Self {
2142 Self {
2143 builder: self.builder.property("child", child.clone().upcast()),
2144 }
2145 }
2146
2147 /// Whether the window should have a frame (also known as *decorations*).
2148 pub fn decorated(self, decorated: bool) -> Self {
2149 Self {
2150 builder: self.builder.property("decorated", decorated),
2151 }
2152 }
2153
2154 /// The default height of the window.
2155 pub fn default_height(self, default_height: i32) -> Self {
2156 Self {
2157 builder: self.builder.property("default-height", default_height),
2158 }
2159 }
2160
2161 /// The default widget.
2162 pub fn default_widget(self, default_widget: &impl IsA<Widget>) -> Self {
2163 Self {
2164 builder: self
2165 .builder
2166 .property("default-widget", default_widget.clone().upcast()),
2167 }
2168 }
2169
2170 /// The default width of the window.
2171 pub fn default_width(self, default_width: i32) -> Self {
2172 Self {
2173 builder: self.builder.property("default-width", default_width),
2174 }
2175 }
2176
2177 /// Whether the window frame should have a close button.
2178 pub fn deletable(self, deletable: bool) -> Self {
2179 Self {
2180 builder: self.builder.property("deletable", deletable),
2181 }
2182 }
2183
2184 /// If this window should be destroyed when the parent is destroyed.
2185 pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self {
2186 Self {
2187 builder: self
2188 .builder
2189 .property("destroy-with-parent", destroy_with_parent),
2190 }
2191 }
2192
2193 /// The display that will display this window.
2194 pub fn display(self, display: &impl IsA<gdk::Display>) -> Self {
2195 Self {
2196 builder: self.builder.property("display", display.clone().upcast()),
2197 }
2198 }
2199
2200 /// Whether 'focus rectangles' are currently visible in this window.
2201 ///
2202 /// This property is maintained by GTK based on user input
2203 /// and should not be set by applications.
2204 pub fn focus_visible(self, focus_visible: bool) -> Self {
2205 Self {
2206 builder: self.builder.property("focus-visible", focus_visible),
2207 }
2208 }
2209
2210 /// The focus widget.
2211 pub fn focus_widget(self, focus_widget: &impl IsA<Widget>) -> Self {
2212 Self {
2213 builder: self
2214 .builder
2215 .property("focus-widget", focus_widget.clone().upcast()),
2216 }
2217 }
2218
2219 /// Whether the window is fullscreen.
2220 ///
2221 /// Setting this property is the equivalent of calling
2222 /// [`GtkWindowExt::fullscreen()`][crate::prelude::GtkWindowExt::fullscreen()] or [`GtkWindowExt::unfullscreen()`][crate::prelude::GtkWindowExt::unfullscreen()];
2223 /// either operation is asynchronous, which means you will need to
2224 /// connect to the ::notify signal in order to know whether the
2225 /// operation was successful.
2226 pub fn fullscreened(self, fullscreened: bool) -> Self {
2227 Self {
2228 builder: self.builder.property("fullscreened", fullscreened),
2229 }
2230 }
2231
2232 /// The gravity to use when resizing the window programmatically.
2233 ///
2234 /// Gravity describes which point of the window we want to keep
2235 /// fixed (meaning that the window will grow in the opposite direction).
2236 /// For example, a gravity of `GTK_WINDOW_GRAVITY_TOP_RIGHT` means that we
2237 /// want the to fix top right corner of the window.
2238 #[cfg(feature = "v4_20")]
2239 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2240 pub fn gravity(self, gravity: WindowGravity) -> Self {
2241 Self {
2242 builder: self.builder.property("gravity", gravity),
2243 }
2244 }
2245
2246 /// Whether the window frame should handle <kbd>F10</kbd> for activating
2247 /// menubars.
2248 #[cfg(feature = "v4_2")]
2249 #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))]
2250 pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self {
2251 Self {
2252 builder: self
2253 .builder
2254 .property("handle-menubar-accel", handle_menubar_accel),
2255 }
2256 }
2257
2258 /// If this window should be hidden instead of destroyed when the user clicks
2259 /// the close button.
2260 pub fn hide_on_close(self, hide_on_close: bool) -> Self {
2261 Self {
2262 builder: self.builder.property("hide-on-close", hide_on_close),
2263 }
2264 }
2265
2266 /// Specifies the name of the themed icon to use as the window icon.
2267 ///
2268 /// See [`IconTheme`][crate::IconTheme] for more details.
2269 pub fn icon_name(self, icon_name: impl Into<glib::GString>) -> Self {
2270 Self {
2271 builder: self.builder.property("icon-name", icon_name.into()),
2272 }
2273 }
2274
2275 /// Whether the window is maximized.
2276 ///
2277 /// Setting this property is the equivalent of calling
2278 /// [`GtkWindowExt::maximize()`][crate::prelude::GtkWindowExt::maximize()] or [`GtkWindowExt::unmaximize()`][crate::prelude::GtkWindowExt::unmaximize()];
2279 /// either operation is asynchronous, which means you will need to
2280 /// connect to the ::notify signal in order to know whether the
2281 /// operation was successful.
2282 pub fn maximized(self, maximized: bool) -> Self {
2283 Self {
2284 builder: self.builder.property("maximized", maximized),
2285 }
2286 }
2287
2288 /// Whether mnemonics are currently visible in this window.
2289 ///
2290 /// This property is maintained by GTK based on user input,
2291 /// and should not be set by applications.
2292 pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self {
2293 Self {
2294 builder: self
2295 .builder
2296 .property("mnemonics-visible", mnemonics_visible),
2297 }
2298 }
2299
2300 /// If true, the window is modal.
2301 pub fn modal(self, modal: bool) -> Self {
2302 Self {
2303 builder: self.builder.property("modal", modal),
2304 }
2305 }
2306
2307 /// If true, users can resize the window.
2308 pub fn resizable(self, resizable: bool) -> Self {
2309 Self {
2310 builder: self.builder.property("resizable", resizable),
2311 }
2312 }
2313
2314 /// A write-only property for setting window's startup notification identifier.
2315 pub fn startup_id(self, startup_id: impl Into<glib::GString>) -> Self {
2316 Self {
2317 builder: self.builder.property("startup-id", startup_id.into()),
2318 }
2319 }
2320
2321 /// The title of the window.
2322 pub fn title(self, title: impl Into<glib::GString>) -> Self {
2323 Self {
2324 builder: self.builder.property("title", title.into()),
2325 }
2326 }
2327
2328 /// The titlebar widget.
2329 #[cfg(feature = "v4_6")]
2330 #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
2331 pub fn titlebar(self, titlebar: &impl IsA<Widget>) -> Self {
2332 Self {
2333 builder: self.builder.property("titlebar", titlebar.clone().upcast()),
2334 }
2335 }
2336
2337 /// The transient parent of the window.
2338 pub fn transient_for(self, transient_for: &impl IsA<Window>) -> Self {
2339 Self {
2340 builder: self
2341 .builder
2342 .property("transient-for", transient_for.clone().upcast()),
2343 }
2344 }
2345
2346 /// Whether the widget or any of its descendents can accept
2347 /// the input focus.
2348 ///
2349 /// This property is meant to be set by widget implementations,
2350 /// typically in their instance init function.
2351 pub fn can_focus(self, can_focus: bool) -> Self {
2352 Self {
2353 builder: self.builder.property("can-focus", can_focus),
2354 }
2355 }
2356
2357 /// Whether the widget can receive pointer events.
2358 pub fn can_target(self, can_target: bool) -> Self {
2359 Self {
2360 builder: self.builder.property("can-target", can_target),
2361 }
2362 }
2363
2364 /// A list of css classes applied to this widget.
2365 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
2366 Self {
2367 builder: self.builder.property("css-classes", css_classes.into()),
2368 }
2369 }
2370
2371 /// The name of this widget in the CSS tree.
2372 ///
2373 /// This property is meant to be set by widget implementations,
2374 /// typically in their instance init function.
2375 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
2376 Self {
2377 builder: self.builder.property("css-name", css_name.into()),
2378 }
2379 }
2380
2381 /// The cursor used by @widget.
2382 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
2383 Self {
2384 builder: self.builder.property("cursor", cursor.clone()),
2385 }
2386 }
2387
2388 /// Whether the widget should grab focus when it is clicked with the mouse.
2389 ///
2390 /// This property is only relevant for widgets that can take focus.
2391 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
2392 Self {
2393 builder: self.builder.property("focus-on-click", focus_on_click),
2394 }
2395 }
2396
2397 /// Whether this widget itself will accept the input focus.
2398 pub fn focusable(self, focusable: bool) -> Self {
2399 Self {
2400 builder: self.builder.property("focusable", focusable),
2401 }
2402 }
2403
2404 /// How to distribute horizontal space if widget gets extra space.
2405 pub fn halign(self, halign: Align) -> Self {
2406 Self {
2407 builder: self.builder.property("halign", halign),
2408 }
2409 }
2410
2411 /// Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
2412 /// signal on @widget.
2413 ///
2414 /// A true value indicates that @widget can have a tooltip, in this case
2415 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
2416 /// determine whether it will provide a tooltip or not.
2417 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
2418 Self {
2419 builder: self.builder.property("has-tooltip", has_tooltip),
2420 }
2421 }
2422
2423 /// Overrides for height request of the widget.
2424 ///
2425 /// If this is -1, the natural request will be used.
2426 pub fn height_request(self, height_request: i32) -> Self {
2427 Self {
2428 builder: self.builder.property("height-request", height_request),
2429 }
2430 }
2431
2432 /// Whether to expand horizontally.
2433 pub fn hexpand(self, hexpand: bool) -> Self {
2434 Self {
2435 builder: self.builder.property("hexpand", hexpand),
2436 }
2437 }
2438
2439 /// Whether to use the `hexpand` property.
2440 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
2441 Self {
2442 builder: self.builder.property("hexpand-set", hexpand_set),
2443 }
2444 }
2445
2446 /// The [`LayoutManager`][crate::LayoutManager] instance to use to compute
2447 /// the preferred size of the widget, and allocate its children.
2448 ///
2449 /// This property is meant to be set by widget implementations,
2450 /// typically in their instance init function.
2451 pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
2452 Self {
2453 builder: self
2454 .builder
2455 .property("layout-manager", layout_manager.clone().upcast()),
2456 }
2457 }
2458
2459 /// Makes this widget act like a modal dialog, with respect to
2460 /// event delivery.
2461 ///
2462 /// Global event controllers will not handle events with targets
2463 /// inside the widget, unless they are set up to ignore propagation
2464 /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
2465 #[cfg(feature = "v4_18")]
2466 #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
2467 pub fn limit_events(self, limit_events: bool) -> Self {
2468 Self {
2469 builder: self.builder.property("limit-events", limit_events),
2470 }
2471 }
2472
2473 /// Margin on bottom side of widget.
2474 ///
2475 /// This property adds margin outside of the widget's normal size
2476 /// request, the margin will be added in addition to the size from
2477 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
2478 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
2479 Self {
2480 builder: self.builder.property("margin-bottom", margin_bottom),
2481 }
2482 }
2483
2484 /// Margin on end of widget, horizontally.
2485 ///
2486 /// This property supports left-to-right and right-to-left text
2487 /// directions.
2488 ///
2489 /// This property adds margin outside of the widget's normal size
2490 /// request, the margin will be added in addition to the size from
2491 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
2492 pub fn margin_end(self, margin_end: i32) -> Self {
2493 Self {
2494 builder: self.builder.property("margin-end", margin_end),
2495 }
2496 }
2497
2498 /// Margin on start of widget, horizontally.
2499 ///
2500 /// This property supports left-to-right and right-to-left text
2501 /// directions.
2502 ///
2503 /// This property adds margin outside of the widget's normal size
2504 /// request, the margin will be added in addition to the size from
2505 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
2506 pub fn margin_start(self, margin_start: i32) -> Self {
2507 Self {
2508 builder: self.builder.property("margin-start", margin_start),
2509 }
2510 }
2511
2512 /// Margin on top side of widget.
2513 ///
2514 /// This property adds margin outside of the widget's normal size
2515 /// request, the margin will be added in addition to the size from
2516 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
2517 pub fn margin_top(self, margin_top: i32) -> Self {
2518 Self {
2519 builder: self.builder.property("margin-top", margin_top),
2520 }
2521 }
2522
2523 /// The name of the widget.
2524 pub fn name(self, name: impl Into<glib::GString>) -> Self {
2525 Self {
2526 builder: self.builder.property("name", name.into()),
2527 }
2528 }
2529
2530 /// The requested opacity of the widget.
2531 pub fn opacity(self, opacity: f64) -> Self {
2532 Self {
2533 builder: self.builder.property("opacity", opacity),
2534 }
2535 }
2536
2537 /// How content outside the widget's content area is treated.
2538 ///
2539 /// This property is meant to be set by widget implementations,
2540 /// typically in their instance init function.
2541 pub fn overflow(self, overflow: Overflow) -> Self {
2542 Self {
2543 builder: self.builder.property("overflow", overflow),
2544 }
2545 }
2546
2547 /// Whether the widget will receive the default action when it is focused.
2548 pub fn receives_default(self, receives_default: bool) -> Self {
2549 Self {
2550 builder: self.builder.property("receives-default", receives_default),
2551 }
2552 }
2553
2554 /// Whether the widget responds to input.
2555 pub fn sensitive(self, sensitive: bool) -> Self {
2556 Self {
2557 builder: self.builder.property("sensitive", sensitive),
2558 }
2559 }
2560
2561 /// Sets the text of tooltip to be the given string, which is marked up
2562 /// with Pango markup.
2563 ///
2564 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
2565 ///
2566 /// This is a convenience property which will take care of getting the
2567 /// tooltip shown if the given string is not `NULL`:
2568 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
2569 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
2570 /// the default signal handler.
2571 ///
2572 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
2573 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
2574 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
2575 Self {
2576 builder: self
2577 .builder
2578 .property("tooltip-markup", tooltip_markup.into()),
2579 }
2580 }
2581
2582 /// Sets the text of tooltip to be the given string.
2583 ///
2584 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
2585 ///
2586 /// This is a convenience property which will take care of getting the
2587 /// tooltip shown if the given string is not `NULL`:
2588 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
2589 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
2590 /// the default signal handler.
2591 ///
2592 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
2593 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
2594 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
2595 Self {
2596 builder: self.builder.property("tooltip-text", tooltip_text.into()),
2597 }
2598 }
2599
2600 /// How to distribute vertical space if widget gets extra space.
2601 pub fn valign(self, valign: Align) -> Self {
2602 Self {
2603 builder: self.builder.property("valign", valign),
2604 }
2605 }
2606
2607 /// Whether to expand vertically.
2608 pub fn vexpand(self, vexpand: bool) -> Self {
2609 Self {
2610 builder: self.builder.property("vexpand", vexpand),
2611 }
2612 }
2613
2614 /// Whether to use the `vexpand` property.
2615 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
2616 Self {
2617 builder: self.builder.property("vexpand-set", vexpand_set),
2618 }
2619 }
2620
2621 /// Whether the widget is visible.
2622 pub fn visible(self, visible: bool) -> Self {
2623 Self {
2624 builder: self.builder.property("visible", visible),
2625 }
2626 }
2627
2628 /// Overrides for width request of the widget.
2629 ///
2630 /// If this is -1, the natural request will be used.
2631 pub fn width_request(self, width_request: i32) -> Self {
2632 Self {
2633 builder: self.builder.property("width-request", width_request),
2634 }
2635 }
2636
2637 /// The accessible role of the given [`Accessible`][crate::Accessible] implementation.
2638 ///
2639 /// The accessible role cannot be changed once set.
2640 pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
2641 Self {
2642 builder: self.builder.property("accessible-role", accessible_role),
2643 }
2644 }
2645
2646 // rustdoc-stripper-ignore-next
2647 /// Build the [`AboutDialog`].
2648 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
2649 pub fn build(self) -> AboutDialog {
2650 assert_initialized_main_thread!();
2651 self.builder.build()
2652 }
2653}