Skip to main content

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