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 /// #### `force-close`
791 /// Emitted when the compositor has decided to eliminate a window.
792 ///
793 /// @window *has* to be in a hidden state after this signal was handled.
794 ///
795 ///
796 ///
797 ///
798 /// #### `keys-changed`
799 /// Emitted when the set of accelerators or mnemonics that
800 /// are associated with the window changes.
801 ///
802 ///
803 /// </details>
804 /// <details><summary><h4>Widget</h4></summary>
805 ///
806 ///
807 /// #### `destroy`
808 /// Signals that all holders of a reference to the widget should release
809 /// the reference that they hold.
810 ///
811 /// May result in finalization of the widget if all references are released.
812 ///
813 /// This signal is not suitable for saving widget state.
814 ///
815 ///
816 ///
817 ///
818 /// #### `direction-changed`
819 /// Emitted when the text direction of a widget changes.
820 ///
821 ///
822 ///
823 ///
824 /// #### `hide`
825 /// Emitted when @widget is hidden.
826 ///
827 ///
828 ///
829 ///
830 /// #### `keynav-failed`
831 /// Emitted if keyboard navigation fails.
832 ///
833 /// See [`WidgetExt::keynav_failed()`][crate::prelude::WidgetExt::keynav_failed()] for details.
834 ///
835 ///
836 ///
837 ///
838 /// #### `map`
839 /// Emitted when @widget is going to be mapped.
840 ///
841 /// A widget is mapped when the widget is visible (which is controlled with
842 /// [`visible`][struct@crate::Widget#visible]) and all its parents up to the toplevel widget
843 /// are also visible.
844 ///
845 /// The `::map` signal can be used to determine whether a widget will be drawn,
846 /// for instance it can resume an animation that was stopped during the
847 /// emission of [`unmap`][struct@crate::Widget#unmap].
848 ///
849 ///
850 ///
851 ///
852 /// #### `mnemonic-activate`
853 /// Emitted when a widget is activated via a mnemonic.
854 ///
855 /// The default handler for this signal activates @widget if @group_cycling
856 /// is false, or just makes @widget grab focus if @group_cycling is true.
857 ///
858 ///
859 ///
860 ///
861 /// #### `move-focus`
862 /// Emitted when the focus is moved.
863 ///
864 /// The `::move-focus` signal is a [keybinding signal](class.SignalAction.html).
865 ///
866 /// The default bindings for this signal are <kbd>Tab</kbd> to move forward,
867 /// and <kbd>Shift</kbd>+<kbd>Tab</kbd> to move backward.
868 ///
869 /// Action
870 ///
871 ///
872 /// #### `query-tooltip`
873 /// Emitted when the widget’s tooltip is about to be shown.
874 ///
875 /// This happens when the [`has-tooltip`][struct@crate::Widget#has-tooltip] property
876 /// is true and the hover timeout has expired with the cursor hovering
877 /// above @widget; or emitted when @widget got focus in keyboard mode.
878 ///
879 /// Using the given coordinates, the signal handler should determine
880 /// whether a tooltip should be shown for @widget. If this is the case
881 /// true should be returned, false otherwise. Note that if @keyboard_mode
882 /// is true, the values of @x and @y are undefined and should not be used.
883 ///
884 /// The signal handler is free to manipulate @tooltip with the therefore
885 /// destined function calls.
886 ///
887 ///
888 ///
889 ///
890 /// #### `realize`
891 /// Emitted when @widget is associated with a [`gdk::Surface`][crate::gdk::Surface].
892 ///
893 /// This means that [`WidgetExt::realize()`][crate::prelude::WidgetExt::realize()] has been called
894 /// or the widget has been mapped (that is, it is going to be drawn).
895 ///
896 ///
897 ///
898 ///
899 /// #### `show`
900 /// Emitted when @widget is shown.
901 ///
902 ///
903 ///
904 ///
905 /// #### `state-flags-changed`
906 /// Emitted when the widget state changes.
907 ///
908 /// See [`WidgetExt::state_flags()`][crate::prelude::WidgetExt::state_flags()].
909 ///
910 ///
911 ///
912 ///
913 /// #### `unmap`
914 /// Emitted when @widget is going to be unmapped.
915 ///
916 /// A widget is unmapped when either it or any of its parents up to the
917 /// toplevel widget have been set as hidden.
918 ///
919 /// As `::unmap` indicates that a widget will not be shown any longer,
920 /// it can be used to, for example, stop an animation on the widget.
921 ///
922 ///
923 ///
924 ///
925 /// #### `unrealize`
926 /// Emitted when the [`gdk::Surface`][crate::gdk::Surface] associated with @widget is destroyed.
927 ///
928 /// This means that [`WidgetExt::unrealize()`][crate::prelude::WidgetExt::unrealize()] has been called
929 /// or the widget has been unmapped (that is, it is going to be hidden).
930 ///
931 ///
932 /// </details>
933 ///
934 /// # Implements
935 ///
936 /// [`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]
937 #[doc(alias = "GtkAboutDialog")]
938 pub struct AboutDialog(Object<ffi::GtkAboutDialog>) @extends Window, Widget, @implements Accessible, Buildable, ConstraintTarget, Native, Root, ShortcutManager;
939
940 match fn {
941 type_ => || ffi::gtk_about_dialog_get_type(),
942 }
943}
944
945impl AboutDialog {
946 /// Creates a new [`AboutDialog`][crate::AboutDialog].
947 ///
948 /// # Returns
949 ///
950 /// a newly created [`AboutDialog`][crate::AboutDialog]
951 #[doc(alias = "gtk_about_dialog_new")]
952 pub fn new() -> AboutDialog {
953 assert_initialized_main_thread!();
954 unsafe { Widget::from_glib_none(ffi::gtk_about_dialog_new()).unsafe_cast() }
955 }
956
957 // rustdoc-stripper-ignore-next
958 /// Creates a new builder-pattern struct instance to construct [`AboutDialog`] objects.
959 ///
960 /// This method returns an instance of [`AboutDialogBuilder`](crate::builders::AboutDialogBuilder) which can be used to create [`AboutDialog`] objects.
961 pub fn builder() -> AboutDialogBuilder {
962 AboutDialogBuilder::new()
963 }
964
965 /// Creates a new section in the "Credits" page.
966 /// ## `section_name`
967 /// The name of the section
968 /// ## `people`
969 /// the people who belong to that section
970 #[doc(alias = "gtk_about_dialog_add_credit_section")]
971 pub fn add_credit_section(&self, section_name: &str, people: &[&str]) {
972 unsafe {
973 ffi::gtk_about_dialog_add_credit_section(
974 self.to_glib_none().0,
975 section_name.to_glib_none().0,
976 people.to_glib_none().0,
977 );
978 }
979 }
980
981 /// Returns the names of the artists which are displayed
982 /// in the credits page.
983 ///
984 /// # Returns
985 ///
986 /// A
987 /// `NULL`-terminated string array containing the artists
988 #[doc(alias = "gtk_about_dialog_get_artists")]
989 #[doc(alias = "get_artists")]
990 pub fn artists(&self) -> Vec<glib::GString> {
991 unsafe {
992 FromGlibPtrContainer::from_glib_none(ffi::gtk_about_dialog_get_artists(
993 self.to_glib_none().0,
994 ))
995 }
996 }
997
998 /// Returns the names of the authors which are displayed
999 /// in the credits page.
1000 ///
1001 /// # Returns
1002 ///
1003 /// A
1004 /// `NULL`-terminated string array containing the authors
1005 #[doc(alias = "gtk_about_dialog_get_authors")]
1006 #[doc(alias = "get_authors")]
1007 pub fn authors(&self) -> Vec<glib::GString> {
1008 unsafe {
1009 FromGlibPtrContainer::from_glib_none(ffi::gtk_about_dialog_get_authors(
1010 self.to_glib_none().0,
1011 ))
1012 }
1013 }
1014
1015 /// Returns the comments string.
1016 ///
1017 /// # Returns
1018 ///
1019 /// The comments
1020 #[doc(alias = "gtk_about_dialog_get_comments")]
1021 #[doc(alias = "get_comments")]
1022 pub fn comments(&self) -> Option<glib::GString> {
1023 unsafe { from_glib_none(ffi::gtk_about_dialog_get_comments(self.to_glib_none().0)) }
1024 }
1025
1026 /// Returns the copyright string.
1027 ///
1028 /// # Returns
1029 ///
1030 /// The copyright string
1031 #[doc(alias = "gtk_about_dialog_get_copyright")]
1032 #[doc(alias = "get_copyright")]
1033 pub fn copyright(&self) -> Option<glib::GString> {
1034 unsafe { from_glib_none(ffi::gtk_about_dialog_get_copyright(self.to_glib_none().0)) }
1035 }
1036
1037 /// Returns the name of the documenters which are displayed
1038 /// in the credits page.
1039 ///
1040 /// # Returns
1041 ///
1042 /// A
1043 /// `NULL`-terminated string array containing the documenters
1044 #[doc(alias = "gtk_about_dialog_get_documenters")]
1045 #[doc(alias = "get_documenters")]
1046 pub fn documenters(&self) -> Vec<glib::GString> {
1047 unsafe {
1048 FromGlibPtrContainer::from_glib_none(ffi::gtk_about_dialog_get_documenters(
1049 self.to_glib_none().0,
1050 ))
1051 }
1052 }
1053
1054 /// Returns the license information.
1055 ///
1056 /// # Returns
1057 ///
1058 /// The license information
1059 #[doc(alias = "gtk_about_dialog_get_license")]
1060 #[doc(alias = "get_license")]
1061 pub fn license(&self) -> Option<glib::GString> {
1062 unsafe { from_glib_none(ffi::gtk_about_dialog_get_license(self.to_glib_none().0)) }
1063 }
1064
1065 /// Retrieves the license type.
1066 ///
1067 /// # Returns
1068 ///
1069 /// a [`License`][crate::License] value
1070 #[doc(alias = "gtk_about_dialog_get_license_type")]
1071 #[doc(alias = "get_license_type")]
1072 #[doc(alias = "license-type")]
1073 pub fn license_type(&self) -> License {
1074 unsafe {
1075 from_glib(ffi::gtk_about_dialog_get_license_type(
1076 self.to_glib_none().0,
1077 ))
1078 }
1079 }
1080
1081 /// Returns the paintable displayed as logo in the about dialog.
1082 ///
1083 /// # Returns
1084 ///
1085 /// the paintable displayed as
1086 /// logo or `NULL` if the logo is unset or has been set via
1087 /// [`set_logo_icon_name()`][Self::set_logo_icon_name()]
1088 #[doc(alias = "gtk_about_dialog_get_logo")]
1089 #[doc(alias = "get_logo")]
1090 pub fn logo(&self) -> Option<gdk::Paintable> {
1091 unsafe { from_glib_none(ffi::gtk_about_dialog_get_logo(self.to_glib_none().0)) }
1092 }
1093
1094 /// Returns the icon name displayed as logo in the about dialog.
1095 ///
1096 /// # Returns
1097 ///
1098 /// the icon name displayed as logo,
1099 /// or `NULL` if the logo has been set via [`set_logo()`][Self::set_logo()]
1100 #[doc(alias = "gtk_about_dialog_get_logo_icon_name")]
1101 #[doc(alias = "get_logo_icon_name")]
1102 #[doc(alias = "logo-icon-name")]
1103 pub fn logo_icon_name(&self) -> Option<glib::GString> {
1104 unsafe {
1105 from_glib_none(ffi::gtk_about_dialog_get_logo_icon_name(
1106 self.to_glib_none().0,
1107 ))
1108 }
1109 }
1110
1111 /// Returns the program name displayed in the about dialog.
1112 ///
1113 /// # Returns
1114 ///
1115 /// the program name
1116 #[doc(alias = "gtk_about_dialog_get_program_name")]
1117 #[doc(alias = "get_program_name")]
1118 #[doc(alias = "program-name")]
1119 pub fn program_name(&self) -> Option<glib::GString> {
1120 unsafe {
1121 from_glib_none(ffi::gtk_about_dialog_get_program_name(
1122 self.to_glib_none().0,
1123 ))
1124 }
1125 }
1126
1127 /// Returns the system information that is shown in the about dialog.
1128 ///
1129 /// # Returns
1130 ///
1131 /// the system information
1132 #[doc(alias = "gtk_about_dialog_get_system_information")]
1133 #[doc(alias = "get_system_information")]
1134 #[doc(alias = "system-information")]
1135 pub fn system_information(&self) -> Option<glib::GString> {
1136 unsafe {
1137 from_glib_none(ffi::gtk_about_dialog_get_system_information(
1138 self.to_glib_none().0,
1139 ))
1140 }
1141 }
1142
1143 /// Returns the translator credits string which is displayed
1144 /// in the credits page.
1145 ///
1146 /// # Returns
1147 ///
1148 /// The translator credits string
1149 #[doc(alias = "gtk_about_dialog_get_translator_credits")]
1150 #[doc(alias = "get_translator_credits")]
1151 #[doc(alias = "translator-credits")]
1152 pub fn translator_credits(&self) -> Option<glib::GString> {
1153 unsafe {
1154 from_glib_none(ffi::gtk_about_dialog_get_translator_credits(
1155 self.to_glib_none().0,
1156 ))
1157 }
1158 }
1159
1160 /// Returns the version string.
1161 ///
1162 /// # Returns
1163 ///
1164 /// The version string
1165 #[doc(alias = "gtk_about_dialog_get_version")]
1166 #[doc(alias = "get_version")]
1167 pub fn version(&self) -> Option<glib::GString> {
1168 unsafe { from_glib_none(ffi::gtk_about_dialog_get_version(self.to_glib_none().0)) }
1169 }
1170
1171 /// Returns the website URL.
1172 ///
1173 /// # Returns
1174 ///
1175 /// The website URL
1176 #[doc(alias = "gtk_about_dialog_get_website")]
1177 #[doc(alias = "get_website")]
1178 pub fn website(&self) -> Option<glib::GString> {
1179 unsafe { from_glib_none(ffi::gtk_about_dialog_get_website(self.to_glib_none().0)) }
1180 }
1181
1182 /// Returns the label used for the website link.
1183 ///
1184 /// # Returns
1185 ///
1186 /// The label used for the website link
1187 #[doc(alias = "gtk_about_dialog_get_website_label")]
1188 #[doc(alias = "get_website_label")]
1189 #[doc(alias = "website-label")]
1190 pub fn website_label(&self) -> Option<glib::GString> {
1191 unsafe {
1192 from_glib_none(ffi::gtk_about_dialog_get_website_label(
1193 self.to_glib_none().0,
1194 ))
1195 }
1196 }
1197
1198 /// Returns whether the license text in the about dialog is
1199 /// automatically wrapped.
1200 ///
1201 /// # Returns
1202 ///
1203 /// `TRUE` if the license text is wrapped
1204 #[doc(alias = "gtk_about_dialog_get_wrap_license")]
1205 #[doc(alias = "get_wrap_license")]
1206 #[doc(alias = "wrap-license")]
1207 pub fn wraps_license(&self) -> bool {
1208 unsafe {
1209 from_glib(ffi::gtk_about_dialog_get_wrap_license(
1210 self.to_glib_none().0,
1211 ))
1212 }
1213 }
1214
1215 /// Sets the names of the artists to be displayed
1216 /// in the "Credits" page.
1217 /// ## `artists`
1218 /// the authors of the artwork
1219 /// of the application
1220 #[doc(alias = "gtk_about_dialog_set_artists")]
1221 #[doc(alias = "artists")]
1222 pub fn set_artists(&self, artists: &[&str]) {
1223 unsafe {
1224 ffi::gtk_about_dialog_set_artists(self.to_glib_none().0, artists.to_glib_none().0);
1225 }
1226 }
1227
1228 /// Sets the names of the authors which are displayed
1229 /// in the "Credits" page of the about dialog.
1230 /// ## `authors`
1231 /// the authors of the application
1232 #[doc(alias = "gtk_about_dialog_set_authors")]
1233 #[doc(alias = "authors")]
1234 pub fn set_authors(&self, authors: &[&str]) {
1235 unsafe {
1236 ffi::gtk_about_dialog_set_authors(self.to_glib_none().0, authors.to_glib_none().0);
1237 }
1238 }
1239
1240 /// Sets the comments string to display in the about dialog.
1241 ///
1242 /// This should be a short string of one or two lines.
1243 /// ## `comments`
1244 /// a comments string
1245 #[doc(alias = "gtk_about_dialog_set_comments")]
1246 #[doc(alias = "comments")]
1247 pub fn set_comments(&self, comments: Option<&str>) {
1248 unsafe {
1249 ffi::gtk_about_dialog_set_comments(self.to_glib_none().0, comments.to_glib_none().0);
1250 }
1251 }
1252
1253 /// Sets the copyright string to display in the about dialog.
1254 ///
1255 /// This should be a short string of one or two lines.
1256 /// ## `copyright`
1257 /// the copyright string
1258 #[doc(alias = "gtk_about_dialog_set_copyright")]
1259 #[doc(alias = "copyright")]
1260 pub fn set_copyright(&self, copyright: Option<&str>) {
1261 unsafe {
1262 ffi::gtk_about_dialog_set_copyright(self.to_glib_none().0, copyright.to_glib_none().0);
1263 }
1264 }
1265
1266 /// Sets the names of the documenters which are displayed
1267 /// in the "Credits" page.
1268 /// ## `documenters`
1269 /// the authors of the documentation
1270 /// of the application
1271 #[doc(alias = "gtk_about_dialog_set_documenters")]
1272 #[doc(alias = "documenters")]
1273 pub fn set_documenters(&self, documenters: &[&str]) {
1274 unsafe {
1275 ffi::gtk_about_dialog_set_documenters(
1276 self.to_glib_none().0,
1277 documenters.to_glib_none().0,
1278 );
1279 }
1280 }
1281
1282 /// Sets the license information to be displayed in the
1283 /// about dialog.
1284 ///
1285 /// If `license` is `NULL`, the license page is hidden.
1286 /// ## `license`
1287 /// the license information
1288 #[doc(alias = "gtk_about_dialog_set_license")]
1289 #[doc(alias = "license")]
1290 pub fn set_license(&self, license: Option<&str>) {
1291 unsafe {
1292 ffi::gtk_about_dialog_set_license(self.to_glib_none().0, license.to_glib_none().0);
1293 }
1294 }
1295
1296 /// Sets the license of the application showing the about dialog
1297 /// from a list of known licenses.
1298 ///
1299 /// This function overrides the license set using
1300 /// [`set_license()`][Self::set_license()].
1301 /// ## `license_type`
1302 /// the type of license
1303 #[doc(alias = "gtk_about_dialog_set_license_type")]
1304 #[doc(alias = "license-type")]
1305 pub fn set_license_type(&self, license_type: License) {
1306 unsafe {
1307 ffi::gtk_about_dialog_set_license_type(self.to_glib_none().0, license_type.into_glib());
1308 }
1309 }
1310
1311 /// Sets the logo in the about dialog.
1312 /// ## `logo`
1313 /// a [`gdk::Paintable`][crate::gdk::Paintable]
1314 #[doc(alias = "gtk_about_dialog_set_logo")]
1315 #[doc(alias = "logo")]
1316 pub fn set_logo(&self, logo: Option<&impl IsA<gdk::Paintable>>) {
1317 unsafe {
1318 ffi::gtk_about_dialog_set_logo(
1319 self.to_glib_none().0,
1320 logo.map(|p| p.as_ref()).to_glib_none().0,
1321 );
1322 }
1323 }
1324
1325 /// Sets the icon name to be displayed as logo in the about dialog.
1326 /// ## `icon_name`
1327 /// an icon name
1328 #[doc(alias = "gtk_about_dialog_set_logo_icon_name")]
1329 #[doc(alias = "logo-icon-name")]
1330 pub fn set_logo_icon_name(&self, icon_name: Option<&str>) {
1331 unsafe {
1332 ffi::gtk_about_dialog_set_logo_icon_name(
1333 self.to_glib_none().0,
1334 icon_name.to_glib_none().0,
1335 );
1336 }
1337 }
1338
1339 /// Sets the name to display in the about dialog.
1340 ///
1341 /// If `name` is not set, the string returned
1342 /// by `g_get_application_name()` is used.
1343 /// ## `name`
1344 /// the program name
1345 #[doc(alias = "gtk_about_dialog_set_program_name")]
1346 #[doc(alias = "program-name")]
1347 pub fn set_program_name(&self, name: Option<&str>) {
1348 unsafe {
1349 ffi::gtk_about_dialog_set_program_name(self.to_glib_none().0, name.to_glib_none().0);
1350 }
1351 }
1352
1353 /// Sets the system information to be displayed in the about
1354 /// dialog.
1355 ///
1356 /// If `system_information` is `NULL`, the system information
1357 /// page is hidden.
1358 ///
1359 /// See [`system-information`][struct@crate::AboutDialog#system-information].
1360 /// ## `system_information`
1361 /// system information
1362 #[doc(alias = "gtk_about_dialog_set_system_information")]
1363 #[doc(alias = "system-information")]
1364 pub fn set_system_information(&self, system_information: Option<&str>) {
1365 unsafe {
1366 ffi::gtk_about_dialog_set_system_information(
1367 self.to_glib_none().0,
1368 system_information.to_glib_none().0,
1369 );
1370 }
1371 }
1372
1373 /// Sets the translator credits string which is displayed in
1374 /// the credits page.
1375 ///
1376 /// The intended use for this string is to display the translator
1377 /// of the language which is currently used in the user interface.
1378 /// Using `gettext()`, a simple way to achieve that is to mark the
1379 /// string for translation:
1380 ///
1381 /// **⚠️ The following code is in c ⚠️**
1382 ///
1383 /// ```c
1384 /// GtkWidget *about = gtk_about_dialog_new ();
1385 /// gtk_about_dialog_set_translator_credits (GTK_ABOUT_DIALOG (about),
1386 /// _("translator-credits"));
1387 /// ```
1388 ///
1389 /// It is a good idea to use the customary `msgid` “translator-credits”
1390 /// for this purpose, since translators will already know the purpose of
1391 /// that `msgid`, and since [`AboutDialog`][crate::AboutDialog] will detect if “translator-credits”
1392 /// is untranslated and omit translator credits.
1393 /// ## `translator_credits`
1394 /// the translator credits
1395 #[doc(alias = "gtk_about_dialog_set_translator_credits")]
1396 #[doc(alias = "translator-credits")]
1397 pub fn set_translator_credits(&self, translator_credits: Option<&str>) {
1398 unsafe {
1399 ffi::gtk_about_dialog_set_translator_credits(
1400 self.to_glib_none().0,
1401 translator_credits.to_glib_none().0,
1402 );
1403 }
1404 }
1405
1406 /// Sets the version string to display in the about dialog.
1407 /// ## `version`
1408 /// the version string
1409 #[doc(alias = "gtk_about_dialog_set_version")]
1410 #[doc(alias = "version")]
1411 pub fn set_version(&self, version: Option<&str>) {
1412 unsafe {
1413 ffi::gtk_about_dialog_set_version(self.to_glib_none().0, version.to_glib_none().0);
1414 }
1415 }
1416
1417 /// Sets the URL to use for the website link.
1418 /// ## `website`
1419 /// a URL string starting with `http://`
1420 #[doc(alias = "gtk_about_dialog_set_website")]
1421 #[doc(alias = "website")]
1422 pub fn set_website(&self, website: Option<&str>) {
1423 unsafe {
1424 ffi::gtk_about_dialog_set_website(self.to_glib_none().0, website.to_glib_none().0);
1425 }
1426 }
1427
1428 /// Sets the label to be used for the website link.
1429 /// ## `website_label`
1430 /// the label used for the website link
1431 #[doc(alias = "gtk_about_dialog_set_website_label")]
1432 #[doc(alias = "website-label")]
1433 pub fn set_website_label(&self, website_label: &str) {
1434 unsafe {
1435 ffi::gtk_about_dialog_set_website_label(
1436 self.to_glib_none().0,
1437 website_label.to_glib_none().0,
1438 );
1439 }
1440 }
1441
1442 /// Sets whether the license text in the about dialog should be
1443 /// automatically wrapped.
1444 /// ## `wrap_license`
1445 /// whether to wrap the license
1446 #[doc(alias = "gtk_about_dialog_set_wrap_license")]
1447 #[doc(alias = "wrap-license")]
1448 pub fn set_wrap_license(&self, wrap_license: bool) {
1449 unsafe {
1450 ffi::gtk_about_dialog_set_wrap_license(self.to_glib_none().0, wrap_license.into_glib());
1451 }
1452 }
1453
1454 /// Emitted every time a URL is activated.
1455 ///
1456 /// Applications may connect to it to override the default behaviour,
1457 /// which is to call [`FileLauncher::launch()`][crate::FileLauncher::launch()].
1458 /// ## `uri`
1459 /// the URI that is activated
1460 ///
1461 /// # Returns
1462 ///
1463 /// `TRUE` if the link has been activated
1464 #[doc(alias = "activate-link")]
1465 pub fn connect_activate_link<F: Fn(&Self, &str) -> glib::Propagation + 'static>(
1466 &self,
1467 f: F,
1468 ) -> SignalHandlerId {
1469 unsafe extern "C" fn activate_link_trampoline<
1470 F: Fn(&AboutDialog, &str) -> glib::Propagation + 'static,
1471 >(
1472 this: *mut ffi::GtkAboutDialog,
1473 uri: *mut std::ffi::c_char,
1474 f: glib::ffi::gpointer,
1475 ) -> glib::ffi::gboolean {
1476 unsafe {
1477 let f: &F = &*(f as *const F);
1478 f(
1479 &from_glib_borrow(this),
1480 &glib::GString::from_glib_borrow(uri),
1481 )
1482 .into_glib()
1483 }
1484 }
1485 unsafe {
1486 let f: Box_<F> = Box_::new(f);
1487 connect_raw(
1488 self.as_ptr() as *mut _,
1489 c"activate-link".as_ptr(),
1490 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1491 activate_link_trampoline::<F> as *const (),
1492 )),
1493 Box_::into_raw(f),
1494 )
1495 }
1496 }
1497
1498 #[doc(alias = "artists")]
1499 pub fn connect_artists_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1500 unsafe extern "C" fn notify_artists_trampoline<F: Fn(&AboutDialog) + 'static>(
1501 this: *mut ffi::GtkAboutDialog,
1502 _param_spec: glib::ffi::gpointer,
1503 f: glib::ffi::gpointer,
1504 ) {
1505 unsafe {
1506 let f: &F = &*(f as *const F);
1507 f(&from_glib_borrow(this))
1508 }
1509 }
1510 unsafe {
1511 let f: Box_<F> = Box_::new(f);
1512 connect_raw(
1513 self.as_ptr() as *mut _,
1514 c"notify::artists".as_ptr(),
1515 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1516 notify_artists_trampoline::<F> as *const (),
1517 )),
1518 Box_::into_raw(f),
1519 )
1520 }
1521 }
1522
1523 #[doc(alias = "authors")]
1524 pub fn connect_authors_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1525 unsafe extern "C" fn notify_authors_trampoline<F: Fn(&AboutDialog) + 'static>(
1526 this: *mut ffi::GtkAboutDialog,
1527 _param_spec: glib::ffi::gpointer,
1528 f: glib::ffi::gpointer,
1529 ) {
1530 unsafe {
1531 let f: &F = &*(f as *const F);
1532 f(&from_glib_borrow(this))
1533 }
1534 }
1535 unsafe {
1536 let f: Box_<F> = Box_::new(f);
1537 connect_raw(
1538 self.as_ptr() as *mut _,
1539 c"notify::authors".as_ptr(),
1540 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1541 notify_authors_trampoline::<F> as *const (),
1542 )),
1543 Box_::into_raw(f),
1544 )
1545 }
1546 }
1547
1548 #[doc(alias = "comments")]
1549 pub fn connect_comments_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1550 unsafe extern "C" fn notify_comments_trampoline<F: Fn(&AboutDialog) + 'static>(
1551 this: *mut ffi::GtkAboutDialog,
1552 _param_spec: glib::ffi::gpointer,
1553 f: glib::ffi::gpointer,
1554 ) {
1555 unsafe {
1556 let f: &F = &*(f as *const F);
1557 f(&from_glib_borrow(this))
1558 }
1559 }
1560 unsafe {
1561 let f: Box_<F> = Box_::new(f);
1562 connect_raw(
1563 self.as_ptr() as *mut _,
1564 c"notify::comments".as_ptr(),
1565 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1566 notify_comments_trampoline::<F> as *const (),
1567 )),
1568 Box_::into_raw(f),
1569 )
1570 }
1571 }
1572
1573 #[doc(alias = "copyright")]
1574 pub fn connect_copyright_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1575 unsafe extern "C" fn notify_copyright_trampoline<F: Fn(&AboutDialog) + 'static>(
1576 this: *mut ffi::GtkAboutDialog,
1577 _param_spec: glib::ffi::gpointer,
1578 f: glib::ffi::gpointer,
1579 ) {
1580 unsafe {
1581 let f: &F = &*(f as *const F);
1582 f(&from_glib_borrow(this))
1583 }
1584 }
1585 unsafe {
1586 let f: Box_<F> = Box_::new(f);
1587 connect_raw(
1588 self.as_ptr() as *mut _,
1589 c"notify::copyright".as_ptr(),
1590 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1591 notify_copyright_trampoline::<F> as *const (),
1592 )),
1593 Box_::into_raw(f),
1594 )
1595 }
1596 }
1597
1598 #[doc(alias = "documenters")]
1599 pub fn connect_documenters_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1600 unsafe extern "C" fn notify_documenters_trampoline<F: Fn(&AboutDialog) + 'static>(
1601 this: *mut ffi::GtkAboutDialog,
1602 _param_spec: glib::ffi::gpointer,
1603 f: glib::ffi::gpointer,
1604 ) {
1605 unsafe {
1606 let f: &F = &*(f as *const F);
1607 f(&from_glib_borrow(this))
1608 }
1609 }
1610 unsafe {
1611 let f: Box_<F> = Box_::new(f);
1612 connect_raw(
1613 self.as_ptr() as *mut _,
1614 c"notify::documenters".as_ptr(),
1615 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1616 notify_documenters_trampoline::<F> as *const (),
1617 )),
1618 Box_::into_raw(f),
1619 )
1620 }
1621 }
1622
1623 #[doc(alias = "license")]
1624 pub fn connect_license_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1625 unsafe extern "C" fn notify_license_trampoline<F: Fn(&AboutDialog) + 'static>(
1626 this: *mut ffi::GtkAboutDialog,
1627 _param_spec: glib::ffi::gpointer,
1628 f: glib::ffi::gpointer,
1629 ) {
1630 unsafe {
1631 let f: &F = &*(f as *const F);
1632 f(&from_glib_borrow(this))
1633 }
1634 }
1635 unsafe {
1636 let f: Box_<F> = Box_::new(f);
1637 connect_raw(
1638 self.as_ptr() as *mut _,
1639 c"notify::license".as_ptr(),
1640 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1641 notify_license_trampoline::<F> as *const (),
1642 )),
1643 Box_::into_raw(f),
1644 )
1645 }
1646 }
1647
1648 #[doc(alias = "license-type")]
1649 pub fn connect_license_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1650 unsafe extern "C" fn notify_license_type_trampoline<F: Fn(&AboutDialog) + 'static>(
1651 this: *mut ffi::GtkAboutDialog,
1652 _param_spec: glib::ffi::gpointer,
1653 f: glib::ffi::gpointer,
1654 ) {
1655 unsafe {
1656 let f: &F = &*(f as *const F);
1657 f(&from_glib_borrow(this))
1658 }
1659 }
1660 unsafe {
1661 let f: Box_<F> = Box_::new(f);
1662 connect_raw(
1663 self.as_ptr() as *mut _,
1664 c"notify::license-type".as_ptr(),
1665 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1666 notify_license_type_trampoline::<F> as *const (),
1667 )),
1668 Box_::into_raw(f),
1669 )
1670 }
1671 }
1672
1673 #[doc(alias = "logo")]
1674 pub fn connect_logo_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1675 unsafe extern "C" fn notify_logo_trampoline<F: Fn(&AboutDialog) + 'static>(
1676 this: *mut ffi::GtkAboutDialog,
1677 _param_spec: glib::ffi::gpointer,
1678 f: glib::ffi::gpointer,
1679 ) {
1680 unsafe {
1681 let f: &F = &*(f as *const F);
1682 f(&from_glib_borrow(this))
1683 }
1684 }
1685 unsafe {
1686 let f: Box_<F> = Box_::new(f);
1687 connect_raw(
1688 self.as_ptr() as *mut _,
1689 c"notify::logo".as_ptr(),
1690 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1691 notify_logo_trampoline::<F> as *const (),
1692 )),
1693 Box_::into_raw(f),
1694 )
1695 }
1696 }
1697
1698 #[doc(alias = "logo-icon-name")]
1699 pub fn connect_logo_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1700 unsafe extern "C" fn notify_logo_icon_name_trampoline<F: Fn(&AboutDialog) + 'static>(
1701 this: *mut ffi::GtkAboutDialog,
1702 _param_spec: glib::ffi::gpointer,
1703 f: glib::ffi::gpointer,
1704 ) {
1705 unsafe {
1706 let f: &F = &*(f as *const F);
1707 f(&from_glib_borrow(this))
1708 }
1709 }
1710 unsafe {
1711 let f: Box_<F> = Box_::new(f);
1712 connect_raw(
1713 self.as_ptr() as *mut _,
1714 c"notify::logo-icon-name".as_ptr(),
1715 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1716 notify_logo_icon_name_trampoline::<F> as *const (),
1717 )),
1718 Box_::into_raw(f),
1719 )
1720 }
1721 }
1722
1723 #[doc(alias = "program-name")]
1724 pub fn connect_program_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1725 unsafe extern "C" fn notify_program_name_trampoline<F: Fn(&AboutDialog) + 'static>(
1726 this: *mut ffi::GtkAboutDialog,
1727 _param_spec: glib::ffi::gpointer,
1728 f: glib::ffi::gpointer,
1729 ) {
1730 unsafe {
1731 let f: &F = &*(f as *const F);
1732 f(&from_glib_borrow(this))
1733 }
1734 }
1735 unsafe {
1736 let f: Box_<F> = Box_::new(f);
1737 connect_raw(
1738 self.as_ptr() as *mut _,
1739 c"notify::program-name".as_ptr(),
1740 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1741 notify_program_name_trampoline::<F> as *const (),
1742 )),
1743 Box_::into_raw(f),
1744 )
1745 }
1746 }
1747
1748 #[doc(alias = "system-information")]
1749 pub fn connect_system_information_notify<F: Fn(&Self) + 'static>(
1750 &self,
1751 f: F,
1752 ) -> SignalHandlerId {
1753 unsafe extern "C" fn notify_system_information_trampoline<F: Fn(&AboutDialog) + 'static>(
1754 this: *mut ffi::GtkAboutDialog,
1755 _param_spec: glib::ffi::gpointer,
1756 f: glib::ffi::gpointer,
1757 ) {
1758 unsafe {
1759 let f: &F = &*(f as *const F);
1760 f(&from_glib_borrow(this))
1761 }
1762 }
1763 unsafe {
1764 let f: Box_<F> = Box_::new(f);
1765 connect_raw(
1766 self.as_ptr() as *mut _,
1767 c"notify::system-information".as_ptr(),
1768 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1769 notify_system_information_trampoline::<F> as *const (),
1770 )),
1771 Box_::into_raw(f),
1772 )
1773 }
1774 }
1775
1776 #[doc(alias = "translator-credits")]
1777 pub fn connect_translator_credits_notify<F: Fn(&Self) + 'static>(
1778 &self,
1779 f: F,
1780 ) -> SignalHandlerId {
1781 unsafe extern "C" fn notify_translator_credits_trampoline<F: Fn(&AboutDialog) + 'static>(
1782 this: *mut ffi::GtkAboutDialog,
1783 _param_spec: glib::ffi::gpointer,
1784 f: glib::ffi::gpointer,
1785 ) {
1786 unsafe {
1787 let f: &F = &*(f as *const F);
1788 f(&from_glib_borrow(this))
1789 }
1790 }
1791 unsafe {
1792 let f: Box_<F> = Box_::new(f);
1793 connect_raw(
1794 self.as_ptr() as *mut _,
1795 c"notify::translator-credits".as_ptr(),
1796 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1797 notify_translator_credits_trampoline::<F> as *const (),
1798 )),
1799 Box_::into_raw(f),
1800 )
1801 }
1802 }
1803
1804 #[doc(alias = "version")]
1805 pub fn connect_version_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1806 unsafe extern "C" fn notify_version_trampoline<F: Fn(&AboutDialog) + 'static>(
1807 this: *mut ffi::GtkAboutDialog,
1808 _param_spec: glib::ffi::gpointer,
1809 f: glib::ffi::gpointer,
1810 ) {
1811 unsafe {
1812 let f: &F = &*(f as *const F);
1813 f(&from_glib_borrow(this))
1814 }
1815 }
1816 unsafe {
1817 let f: Box_<F> = Box_::new(f);
1818 connect_raw(
1819 self.as_ptr() as *mut _,
1820 c"notify::version".as_ptr(),
1821 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1822 notify_version_trampoline::<F> as *const (),
1823 )),
1824 Box_::into_raw(f),
1825 )
1826 }
1827 }
1828
1829 #[doc(alias = "website")]
1830 pub fn connect_website_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1831 unsafe extern "C" fn notify_website_trampoline<F: Fn(&AboutDialog) + 'static>(
1832 this: *mut ffi::GtkAboutDialog,
1833 _param_spec: glib::ffi::gpointer,
1834 f: glib::ffi::gpointer,
1835 ) {
1836 unsafe {
1837 let f: &F = &*(f as *const F);
1838 f(&from_glib_borrow(this))
1839 }
1840 }
1841 unsafe {
1842 let f: Box_<F> = Box_::new(f);
1843 connect_raw(
1844 self.as_ptr() as *mut _,
1845 c"notify::website".as_ptr(),
1846 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1847 notify_website_trampoline::<F> as *const (),
1848 )),
1849 Box_::into_raw(f),
1850 )
1851 }
1852 }
1853
1854 #[doc(alias = "website-label")]
1855 pub fn connect_website_label_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1856 unsafe extern "C" fn notify_website_label_trampoline<F: Fn(&AboutDialog) + 'static>(
1857 this: *mut ffi::GtkAboutDialog,
1858 _param_spec: glib::ffi::gpointer,
1859 f: glib::ffi::gpointer,
1860 ) {
1861 unsafe {
1862 let f: &F = &*(f as *const F);
1863 f(&from_glib_borrow(this))
1864 }
1865 }
1866 unsafe {
1867 let f: Box_<F> = Box_::new(f);
1868 connect_raw(
1869 self.as_ptr() as *mut _,
1870 c"notify::website-label".as_ptr(),
1871 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1872 notify_website_label_trampoline::<F> as *const (),
1873 )),
1874 Box_::into_raw(f),
1875 )
1876 }
1877 }
1878
1879 #[doc(alias = "wrap-license")]
1880 pub fn connect_wrap_license_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1881 unsafe extern "C" fn notify_wrap_license_trampoline<F: Fn(&AboutDialog) + 'static>(
1882 this: *mut ffi::GtkAboutDialog,
1883 _param_spec: glib::ffi::gpointer,
1884 f: glib::ffi::gpointer,
1885 ) {
1886 unsafe {
1887 let f: &F = &*(f as *const F);
1888 f(&from_glib_borrow(this))
1889 }
1890 }
1891 unsafe {
1892 let f: Box_<F> = Box_::new(f);
1893 connect_raw(
1894 self.as_ptr() as *mut _,
1895 c"notify::wrap-license".as_ptr(),
1896 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1897 notify_wrap_license_trampoline::<F> as *const (),
1898 )),
1899 Box_::into_raw(f),
1900 )
1901 }
1902 }
1903}
1904
1905impl Default for AboutDialog {
1906 fn default() -> Self {
1907 Self::new()
1908 }
1909}
1910
1911// rustdoc-stripper-ignore-next
1912/// A [builder-pattern] type to construct [`AboutDialog`] objects.
1913///
1914/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
1915#[must_use = "The builder must be built to be used"]
1916pub struct AboutDialogBuilder {
1917 builder: glib::object::ObjectBuilder<'static, AboutDialog>,
1918}
1919
1920impl AboutDialogBuilder {
1921 fn new() -> Self {
1922 Self {
1923 builder: glib::object::Object::builder(),
1924 }
1925 }
1926
1927 /// The people who contributed artwork to the program.
1928 ///
1929 /// Each string may contain email addresses and URLs, which will be displayed
1930 /// as links.
1931 pub fn artists(self, artists: impl Into<glib::StrV>) -> Self {
1932 Self {
1933 builder: self.builder.property("artists", artists.into()),
1934 }
1935 }
1936
1937 /// The authors of the program.
1938 ///
1939 /// Each string may contain email addresses and URLs, which will be displayed
1940 /// as links, see the introduction for more details.
1941 pub fn authors(self, authors: impl Into<glib::StrV>) -> Self {
1942 Self {
1943 builder: self.builder.property("authors", authors.into()),
1944 }
1945 }
1946
1947 /// Comments about the program.
1948 ///
1949 /// This string is displayed in a label in the main dialog, thus it
1950 /// should be a short explanation of the main purpose of the program,
1951 /// not a detailed list of features.
1952 pub fn comments(self, comments: impl Into<glib::GString>) -> Self {
1953 Self {
1954 builder: self.builder.property("comments", comments.into()),
1955 }
1956 }
1957
1958 /// Copyright information for the program.
1959 pub fn copyright(self, copyright: impl Into<glib::GString>) -> Self {
1960 Self {
1961 builder: self.builder.property("copyright", copyright.into()),
1962 }
1963 }
1964
1965 /// The people documenting the program.
1966 ///
1967 /// Each string may contain email addresses and URLs, which will be displayed
1968 /// as links, see the introduction for more details.
1969 pub fn documenters(self, documenters: impl Into<glib::StrV>) -> Self {
1970 Self {
1971 builder: self.builder.property("documenters", documenters.into()),
1972 }
1973 }
1974
1975 /// The license of the program, as free-form text.
1976 ///
1977 /// This string is displayed in a text view in a secondary dialog, therefore
1978 /// it is fine to use a long multi-paragraph text. Note that the text is only
1979 /// wrapped in the text view if the "wrap-license" property is set to `TRUE`;
1980 /// otherwise the text itself must contain the intended linebreaks.
1981 ///
1982 /// When setting this property to a non-`NULL` value, the
1983 /// [`license-type`][struct@crate::AboutDialog#license-type] property is set to
1984 /// [enum@Gtk.License.custom] as a side effect.
1985 ///
1986 /// The text may contain links in this format `<http://www.some.place/>`
1987 /// and email references in the form `<mail-to@some.body>`, and these will
1988 /// be converted into clickable links.
1989 pub fn license(self, license: impl Into<glib::GString>) -> Self {
1990 Self {
1991 builder: self.builder.property("license", license.into()),
1992 }
1993 }
1994
1995 /// The license of the program.
1996 ///
1997 /// The [`AboutDialog`][crate::AboutDialog] will automatically fill out a standard disclaimer
1998 /// and link the user to the appropriate online resource for the license
1999 /// text.
2000 ///
2001 /// If [enum@Gtk.License.unknown] is used, the link used will be the same
2002 /// specified in the [`website`][struct@crate::AboutDialog#website] property.
2003 ///
2004 /// If [enum@Gtk.License.custom] is used, the current contents of the
2005 /// [`license`][struct@crate::AboutDialog#license] property are used.
2006 ///
2007 /// For any other [`License`][crate::License] value, the contents of the
2008 /// [`license`][struct@crate::AboutDialog#license] property are also set by
2009 /// this property as a side effect.
2010 pub fn license_type(self, license_type: License) -> Self {
2011 Self {
2012 builder: self.builder.property("license-type", license_type),
2013 }
2014 }
2015
2016 /// A logo for the about box.
2017 ///
2018 /// If it is `NULL`, the default window icon set with
2019 /// [`Window::set_default_icon_name()`][crate::Window::set_default_icon_name()] will be used.
2020 pub fn logo(self, logo: &impl IsA<gdk::Paintable>) -> Self {
2021 Self {
2022 builder: self.builder.property("logo", logo.clone().upcast()),
2023 }
2024 }
2025
2026 /// A named icon to use as the logo for the about box.
2027 ///
2028 /// This property overrides the [`logo`][struct@crate::AboutDialog#logo] property.
2029 pub fn logo_icon_name(self, logo_icon_name: impl Into<glib::GString>) -> Self {
2030 Self {
2031 builder: self
2032 .builder
2033 .property("logo-icon-name", logo_icon_name.into()),
2034 }
2035 }
2036
2037 /// The name of the program.
2038 ///
2039 /// If this is not set, it defaults to the value returned by
2040 /// `get_application_name()`.
2041 pub fn program_name(self, program_name: impl Into<glib::GString>) -> Self {
2042 Self {
2043 builder: self.builder.property("program-name", program_name.into()),
2044 }
2045 }
2046
2047 /// Information about the system on which the program is running.
2048 ///
2049 /// This information is displayed in a separate page, therefore it is fine
2050 /// to use a long multi-paragraph text. Note that the text should contain
2051 /// the intended linebreaks.
2052 ///
2053 /// The text may contain links in this format `<http://www.some.place/>`
2054 /// and email references in the form `<mail-to@some.body>`, and these will
2055 /// be converted into clickable links.
2056 pub fn system_information(self, system_information: impl Into<glib::GString>) -> Self {
2057 Self {
2058 builder: self
2059 .builder
2060 .property("system-information", system_information.into()),
2061 }
2062 }
2063
2064 /// Credits to the translators.
2065 ///
2066 /// This string should be marked as translatable.
2067 ///
2068 /// The string may contain email addresses and URLs, which will be displayed
2069 /// as links, see the introduction for more details.
2070 pub fn translator_credits(self, translator_credits: impl Into<glib::GString>) -> Self {
2071 Self {
2072 builder: self
2073 .builder
2074 .property("translator-credits", translator_credits.into()),
2075 }
2076 }
2077
2078 /// The version of the program.
2079 pub fn version(self, version: impl Into<glib::GString>) -> Self {
2080 Self {
2081 builder: self.builder.property("version", version.into()),
2082 }
2083 }
2084
2085 /// The URL for the link to the website of the program.
2086 ///
2087 /// This should be a string starting with `http://` or `https://`.
2088 pub fn website(self, website: impl Into<glib::GString>) -> Self {
2089 Self {
2090 builder: self.builder.property("website", website.into()),
2091 }
2092 }
2093
2094 /// The label for the link to the website of the program.
2095 pub fn website_label(self, website_label: impl Into<glib::GString>) -> Self {
2096 Self {
2097 builder: self.builder.property("website-label", website_label.into()),
2098 }
2099 }
2100
2101 /// Whether to wrap the text in the license dialog.
2102 pub fn wrap_license(self, wrap_license: bool) -> Self {
2103 Self {
2104 builder: self.builder.property("wrap-license", wrap_license),
2105 }
2106 }
2107
2108 /// The [`Application`][crate::Application] associated with the window.
2109 ///
2110 /// The application will be kept alive for at least as long as it
2111 /// has any windows associated with it (see g_application_hold()
2112 /// for a way to keep it alive without windows).
2113 ///
2114 /// Normally, the connection between the application and the window
2115 /// will remain until the window is destroyed, but you can explicitly
2116 /// remove it by setting the this property to `NULL`.
2117 pub fn application(self, application: &impl IsA<Application>) -> Self {
2118 Self {
2119 builder: self
2120 .builder
2121 .property("application", application.clone().upcast()),
2122 }
2123 }
2124
2125 /// The child widget.
2126 pub fn child(self, child: &impl IsA<Widget>) -> Self {
2127 Self {
2128 builder: self.builder.property("child", child.clone().upcast()),
2129 }
2130 }
2131
2132 /// Whether the window should have a frame (also known as *decorations*).
2133 pub fn decorated(self, decorated: bool) -> Self {
2134 Self {
2135 builder: self.builder.property("decorated", decorated),
2136 }
2137 }
2138
2139 /// The default height of the window.
2140 pub fn default_height(self, default_height: i32) -> Self {
2141 Self {
2142 builder: self.builder.property("default-height", default_height),
2143 }
2144 }
2145
2146 /// The default widget.
2147 pub fn default_widget(self, default_widget: &impl IsA<Widget>) -> Self {
2148 Self {
2149 builder: self
2150 .builder
2151 .property("default-widget", default_widget.clone().upcast()),
2152 }
2153 }
2154
2155 /// The default width of the window.
2156 pub fn default_width(self, default_width: i32) -> Self {
2157 Self {
2158 builder: self.builder.property("default-width", default_width),
2159 }
2160 }
2161
2162 /// Whether the window frame should have a close button.
2163 pub fn deletable(self, deletable: bool) -> Self {
2164 Self {
2165 builder: self.builder.property("deletable", deletable),
2166 }
2167 }
2168
2169 /// If this window should be destroyed when the parent is destroyed.
2170 pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self {
2171 Self {
2172 builder: self
2173 .builder
2174 .property("destroy-with-parent", destroy_with_parent),
2175 }
2176 }
2177
2178 /// The display that will display this window.
2179 pub fn display(self, display: &impl IsA<gdk::Display>) -> Self {
2180 Self {
2181 builder: self.builder.property("display", display.clone().upcast()),
2182 }
2183 }
2184
2185 /// Whether 'focus rectangles' are currently visible in this window.
2186 ///
2187 /// This property is maintained by GTK based on user input
2188 /// and should not be set by applications.
2189 pub fn focus_visible(self, focus_visible: bool) -> Self {
2190 Self {
2191 builder: self.builder.property("focus-visible", focus_visible),
2192 }
2193 }
2194
2195 /// The focus widget.
2196 pub fn focus_widget(self, focus_widget: &impl IsA<Widget>) -> Self {
2197 Self {
2198 builder: self
2199 .builder
2200 .property("focus-widget", focus_widget.clone().upcast()),
2201 }
2202 }
2203
2204 /// Whether the window is fullscreen.
2205 ///
2206 /// Setting this property is the equivalent of calling
2207 /// [`GtkWindowExt::fullscreen()`][crate::prelude::GtkWindowExt::fullscreen()] or [`GtkWindowExt::unfullscreen()`][crate::prelude::GtkWindowExt::unfullscreen()];
2208 /// either operation is asynchronous, which means you will need to
2209 /// connect to the ::notify signal in order to know whether the
2210 /// operation was successful.
2211 pub fn fullscreened(self, fullscreened: bool) -> Self {
2212 Self {
2213 builder: self.builder.property("fullscreened", fullscreened),
2214 }
2215 }
2216
2217 /// The gravity to use when resizing the window programmatically.
2218 ///
2219 /// Gravity describes which point of the window we want to keep
2220 /// fixed (meaning that the window will grow in the opposite direction).
2221 /// For example, a gravity of `GTK_WINDOW_GRAVITY_TOP_RIGHT` means that we
2222 /// want the to fix top right corner of the window.
2223 #[cfg(feature = "v4_20")]
2224 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2225 pub fn gravity(self, gravity: WindowGravity) -> Self {
2226 Self {
2227 builder: self.builder.property("gravity", gravity),
2228 }
2229 }
2230
2231 /// Whether the window frame should handle <kbd>F10</kbd> for activating
2232 /// menubars.
2233 #[cfg(feature = "v4_2")]
2234 #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))]
2235 pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self {
2236 Self {
2237 builder: self
2238 .builder
2239 .property("handle-menubar-accel", handle_menubar_accel),
2240 }
2241 }
2242
2243 /// If this window should be hidden instead of destroyed when the user clicks
2244 /// the close button.
2245 pub fn hide_on_close(self, hide_on_close: bool) -> Self {
2246 Self {
2247 builder: self.builder.property("hide-on-close", hide_on_close),
2248 }
2249 }
2250
2251 /// Specifies the name of the themed icon to use as the window icon.
2252 ///
2253 /// See [`IconTheme`][crate::IconTheme] for more details.
2254 pub fn icon_name(self, icon_name: impl Into<glib::GString>) -> Self {
2255 Self {
2256 builder: self.builder.property("icon-name", icon_name.into()),
2257 }
2258 }
2259
2260 /// Whether the window is maximized.
2261 ///
2262 /// Setting this property is the equivalent of calling
2263 /// [`GtkWindowExt::maximize()`][crate::prelude::GtkWindowExt::maximize()] or [`GtkWindowExt::unmaximize()`][crate::prelude::GtkWindowExt::unmaximize()];
2264 /// either operation is asynchronous, which means you will need to
2265 /// connect to the ::notify signal in order to know whether the
2266 /// operation was successful.
2267 pub fn maximized(self, maximized: bool) -> Self {
2268 Self {
2269 builder: self.builder.property("maximized", maximized),
2270 }
2271 }
2272
2273 /// Whether mnemonics are currently visible in this window.
2274 ///
2275 /// This property is maintained by GTK based on user input,
2276 /// and should not be set by applications.
2277 pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self {
2278 Self {
2279 builder: self
2280 .builder
2281 .property("mnemonics-visible", mnemonics_visible),
2282 }
2283 }
2284
2285 /// If true, the window is modal.
2286 pub fn modal(self, modal: bool) -> Self {
2287 Self {
2288 builder: self.builder.property("modal", modal),
2289 }
2290 }
2291
2292 /// If true, users can resize the window.
2293 pub fn resizable(self, resizable: bool) -> Self {
2294 Self {
2295 builder: self.builder.property("resizable", resizable),
2296 }
2297 }
2298
2299 /// A write-only property for setting window's startup notification identifier.
2300 pub fn startup_id(self, startup_id: impl Into<glib::GString>) -> Self {
2301 Self {
2302 builder: self.builder.property("startup-id", startup_id.into()),
2303 }
2304 }
2305
2306 /// The title of the window.
2307 pub fn title(self, title: impl Into<glib::GString>) -> Self {
2308 Self {
2309 builder: self.builder.property("title", title.into()),
2310 }
2311 }
2312
2313 /// The titlebar widget.
2314 #[cfg(feature = "v4_6")]
2315 #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
2316 pub fn titlebar(self, titlebar: &impl IsA<Widget>) -> Self {
2317 Self {
2318 builder: self.builder.property("titlebar", titlebar.clone().upcast()),
2319 }
2320 }
2321
2322 /// The transient parent of the window.
2323 pub fn transient_for(self, transient_for: &impl IsA<Window>) -> Self {
2324 Self {
2325 builder: self
2326 .builder
2327 .property("transient-for", transient_for.clone().upcast()),
2328 }
2329 }
2330
2331 /// Whether the widget or any of its descendents can accept
2332 /// the input focus.
2333 ///
2334 /// This property is meant to be set by widget implementations,
2335 /// typically in their instance init function.
2336 pub fn can_focus(self, can_focus: bool) -> Self {
2337 Self {
2338 builder: self.builder.property("can-focus", can_focus),
2339 }
2340 }
2341
2342 /// Whether the widget can receive pointer events.
2343 pub fn can_target(self, can_target: bool) -> Self {
2344 Self {
2345 builder: self.builder.property("can-target", can_target),
2346 }
2347 }
2348
2349 /// A list of css classes applied to this widget.
2350 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
2351 Self {
2352 builder: self.builder.property("css-classes", css_classes.into()),
2353 }
2354 }
2355
2356 /// The name of this widget in the CSS tree.
2357 ///
2358 /// This property is meant to be set by widget implementations,
2359 /// typically in their instance init function.
2360 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
2361 Self {
2362 builder: self.builder.property("css-name", css_name.into()),
2363 }
2364 }
2365
2366 /// The cursor used by @widget.
2367 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
2368 Self {
2369 builder: self.builder.property("cursor", cursor.clone()),
2370 }
2371 }
2372
2373 /// Whether the widget should grab focus when it is clicked with the mouse.
2374 ///
2375 /// This property is only relevant for widgets that can take focus.
2376 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
2377 Self {
2378 builder: self.builder.property("focus-on-click", focus_on_click),
2379 }
2380 }
2381
2382 /// Whether this widget itself will accept the input focus.
2383 pub fn focusable(self, focusable: bool) -> Self {
2384 Self {
2385 builder: self.builder.property("focusable", focusable),
2386 }
2387 }
2388
2389 /// How to distribute horizontal space if widget gets extra space.
2390 pub fn halign(self, halign: Align) -> Self {
2391 Self {
2392 builder: self.builder.property("halign", halign),
2393 }
2394 }
2395
2396 /// Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
2397 /// signal on @widget.
2398 ///
2399 /// A true value indicates that @widget can have a tooltip, in this case
2400 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
2401 /// determine whether it will provide a tooltip or not.
2402 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
2403 Self {
2404 builder: self.builder.property("has-tooltip", has_tooltip),
2405 }
2406 }
2407
2408 /// Overrides for height request of the widget.
2409 ///
2410 /// If this is -1, the natural request will be used.
2411 pub fn height_request(self, height_request: i32) -> Self {
2412 Self {
2413 builder: self.builder.property("height-request", height_request),
2414 }
2415 }
2416
2417 /// Whether to expand horizontally.
2418 pub fn hexpand(self, hexpand: bool) -> Self {
2419 Self {
2420 builder: self.builder.property("hexpand", hexpand),
2421 }
2422 }
2423
2424 /// Whether to use the `hexpand` property.
2425 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
2426 Self {
2427 builder: self.builder.property("hexpand-set", hexpand_set),
2428 }
2429 }
2430
2431 /// The [`LayoutManager`][crate::LayoutManager] instance to use to compute
2432 /// the preferred size of the widget, and allocate its children.
2433 ///
2434 /// This property is meant to be set by widget implementations,
2435 /// typically in their instance init function.
2436 pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
2437 Self {
2438 builder: self
2439 .builder
2440 .property("layout-manager", layout_manager.clone().upcast()),
2441 }
2442 }
2443
2444 /// Makes this widget act like a modal dialog, with respect to
2445 /// event delivery.
2446 ///
2447 /// Global event controllers will not handle events with targets
2448 /// inside the widget, unless they are set up to ignore propagation
2449 /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
2450 #[cfg(feature = "v4_18")]
2451 #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
2452 pub fn limit_events(self, limit_events: bool) -> Self {
2453 Self {
2454 builder: self.builder.property("limit-events", limit_events),
2455 }
2456 }
2457
2458 /// Margin on bottom side of widget.
2459 ///
2460 /// This property adds margin outside of the widget's normal size
2461 /// request, the margin will be added in addition to the size from
2462 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
2463 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
2464 Self {
2465 builder: self.builder.property("margin-bottom", margin_bottom),
2466 }
2467 }
2468
2469 /// Margin on end of widget, horizontally.
2470 ///
2471 /// This property supports left-to-right and right-to-left text
2472 /// directions.
2473 ///
2474 /// This property adds margin outside of the widget's normal size
2475 /// request, the margin will be added in addition to the size from
2476 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
2477 pub fn margin_end(self, margin_end: i32) -> Self {
2478 Self {
2479 builder: self.builder.property("margin-end", margin_end),
2480 }
2481 }
2482
2483 /// Margin on start of widget, horizontally.
2484 ///
2485 /// This property supports left-to-right and right-to-left text
2486 /// directions.
2487 ///
2488 /// This property adds margin outside of the widget's normal size
2489 /// request, the margin will be added in addition to the size from
2490 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
2491 pub fn margin_start(self, margin_start: i32) -> Self {
2492 Self {
2493 builder: self.builder.property("margin-start", margin_start),
2494 }
2495 }
2496
2497 /// Margin on top side of widget.
2498 ///
2499 /// This property adds margin outside of the widget's normal size
2500 /// request, the margin will be added in addition to the size from
2501 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
2502 pub fn margin_top(self, margin_top: i32) -> Self {
2503 Self {
2504 builder: self.builder.property("margin-top", margin_top),
2505 }
2506 }
2507
2508 /// The name of the widget.
2509 pub fn name(self, name: impl Into<glib::GString>) -> Self {
2510 Self {
2511 builder: self.builder.property("name", name.into()),
2512 }
2513 }
2514
2515 /// The requested opacity of the widget.
2516 pub fn opacity(self, opacity: f64) -> Self {
2517 Self {
2518 builder: self.builder.property("opacity", opacity),
2519 }
2520 }
2521
2522 /// How content outside the widget's content area is treated.
2523 ///
2524 /// This property is meant to be set by widget implementations,
2525 /// typically in their instance init function.
2526 pub fn overflow(self, overflow: Overflow) -> Self {
2527 Self {
2528 builder: self.builder.property("overflow", overflow),
2529 }
2530 }
2531
2532 /// Whether the widget will receive the default action when it is focused.
2533 pub fn receives_default(self, receives_default: bool) -> Self {
2534 Self {
2535 builder: self.builder.property("receives-default", receives_default),
2536 }
2537 }
2538
2539 /// Whether the widget responds to input.
2540 pub fn sensitive(self, sensitive: bool) -> Self {
2541 Self {
2542 builder: self.builder.property("sensitive", sensitive),
2543 }
2544 }
2545
2546 /// Sets the text of tooltip to be the given string, which is marked up
2547 /// with Pango markup.
2548 ///
2549 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
2550 ///
2551 /// This is a convenience property which will take care of getting the
2552 /// tooltip shown if the given string is not `NULL`:
2553 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
2554 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
2555 /// the default signal handler.
2556 ///
2557 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
2558 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
2559 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
2560 Self {
2561 builder: self
2562 .builder
2563 .property("tooltip-markup", tooltip_markup.into()),
2564 }
2565 }
2566
2567 /// Sets the text of tooltip to be the given string.
2568 ///
2569 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
2570 ///
2571 /// This is a convenience property which will take care of getting the
2572 /// tooltip shown if the given string is not `NULL`:
2573 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
2574 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
2575 /// the default signal handler.
2576 ///
2577 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
2578 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
2579 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
2580 Self {
2581 builder: self.builder.property("tooltip-text", tooltip_text.into()),
2582 }
2583 }
2584
2585 /// How to distribute vertical space if widget gets extra space.
2586 pub fn valign(self, valign: Align) -> Self {
2587 Self {
2588 builder: self.builder.property("valign", valign),
2589 }
2590 }
2591
2592 /// Whether to expand vertically.
2593 pub fn vexpand(self, vexpand: bool) -> Self {
2594 Self {
2595 builder: self.builder.property("vexpand", vexpand),
2596 }
2597 }
2598
2599 /// Whether to use the `vexpand` property.
2600 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
2601 Self {
2602 builder: self.builder.property("vexpand-set", vexpand_set),
2603 }
2604 }
2605
2606 /// Whether the widget is visible.
2607 pub fn visible(self, visible: bool) -> Self {
2608 Self {
2609 builder: self.builder.property("visible", visible),
2610 }
2611 }
2612
2613 /// Overrides for width request of the widget.
2614 ///
2615 /// If this is -1, the natural request will be used.
2616 pub fn width_request(self, width_request: i32) -> Self {
2617 Self {
2618 builder: self.builder.property("width-request", width_request),
2619 }
2620 }
2621
2622 /// The accessible role of the given [`Accessible`][crate::Accessible] implementation.
2623 ///
2624 /// The accessible role cannot be changed once set.
2625 pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
2626 Self {
2627 builder: self.builder.property("accessible-role", accessible_role),
2628 }
2629 }
2630
2631 // rustdoc-stripper-ignore-next
2632 /// Build the [`AboutDialog`].
2633 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
2634 pub fn build(self) -> AboutDialog {
2635 assert_initialized_main_thread!();
2636 self.builder.build()
2637 }
2638}