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