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