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 /// 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 ///
1295 /// is untranslated and omit translator credits.
1296 /// ## `translator_credits`
1297 /// the translator credits
1298 #[doc(alias = "gtk_about_dialog_set_translator_credits")]
1299 #[doc(alias = "translator-credits")]
1300 pub fn set_translator_credits(&self, translator_credits: Option<&str>) {
1301 unsafe {
1302 ffi::gtk_about_dialog_set_translator_credits(
1303 self.to_glib_none().0,
1304 translator_credits.to_glib_none().0,
1305 );
1306 }
1307 }
1308
1309 /// Sets the version string to display in the about dialog.
1310 /// ## `version`
1311 /// the version string
1312 #[doc(alias = "gtk_about_dialog_set_version")]
1313 #[doc(alias = "version")]
1314 pub fn set_version(&self, version: Option<&str>) {
1315 unsafe {
1316 ffi::gtk_about_dialog_set_version(self.to_glib_none().0, version.to_glib_none().0);
1317 }
1318 }
1319
1320 /// Sets the URL to use for the website link.
1321 /// ## `website`
1322 /// a URL string starting with `http://`
1323 #[doc(alias = "gtk_about_dialog_set_website")]
1324 #[doc(alias = "website")]
1325 pub fn set_website(&self, website: Option<&str>) {
1326 unsafe {
1327 ffi::gtk_about_dialog_set_website(self.to_glib_none().0, website.to_glib_none().0);
1328 }
1329 }
1330
1331 /// Sets the label to be used for the website link.
1332 /// ## `website_label`
1333 /// the label used for the website link
1334 #[doc(alias = "gtk_about_dialog_set_website_label")]
1335 #[doc(alias = "website-label")]
1336 pub fn set_website_label(&self, website_label: &str) {
1337 unsafe {
1338 ffi::gtk_about_dialog_set_website_label(
1339 self.to_glib_none().0,
1340 website_label.to_glib_none().0,
1341 );
1342 }
1343 }
1344
1345 /// Sets whether the license text in the about dialog should be
1346 /// automatically wrapped.
1347 /// ## `wrap_license`
1348 /// whether to wrap the license
1349 #[doc(alias = "gtk_about_dialog_set_wrap_license")]
1350 #[doc(alias = "wrap-license")]
1351 pub fn set_wrap_license(&self, wrap_license: bool) {
1352 unsafe {
1353 ffi::gtk_about_dialog_set_wrap_license(self.to_glib_none().0, wrap_license.into_glib());
1354 }
1355 }
1356
1357 /// Emitted every time a URL is activated.
1358 ///
1359 /// Applications may connect to it to override the default behaviour,
1360 /// which is to call [`FileLauncher::launch()`][crate::FileLauncher::launch()].
1361 /// ## `uri`
1362 /// the URI that is activated
1363 ///
1364 /// # Returns
1365 ///
1366 /// `TRUE` if the link has been activated
1367 #[doc(alias = "activate-link")]
1368 pub fn connect_activate_link<F: Fn(&Self, &str) -> glib::Propagation + 'static>(
1369 &self,
1370 f: F,
1371 ) -> SignalHandlerId {
1372 unsafe extern "C" fn activate_link_trampoline<
1373 F: Fn(&AboutDialog, &str) -> glib::Propagation + 'static,
1374 >(
1375 this: *mut ffi::GtkAboutDialog,
1376 uri: *mut std::ffi::c_char,
1377 f: glib::ffi::gpointer,
1378 ) -> glib::ffi::gboolean {
1379 unsafe {
1380 let f: &F = &*(f as *const F);
1381 f(
1382 &from_glib_borrow(this),
1383 &glib::GString::from_glib_borrow(uri),
1384 )
1385 .into_glib()
1386 }
1387 }
1388 unsafe {
1389 let f: Box_<F> = Box_::new(f);
1390 connect_raw(
1391 self.as_ptr() as *mut _,
1392 c"activate-link".as_ptr(),
1393 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1394 activate_link_trampoline::<F> as *const (),
1395 )),
1396 Box_::into_raw(f),
1397 )
1398 }
1399 }
1400
1401 #[doc(alias = "artists")]
1402 pub fn connect_artists_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1403 unsafe extern "C" fn notify_artists_trampoline<F: Fn(&AboutDialog) + 'static>(
1404 this: *mut ffi::GtkAboutDialog,
1405 _param_spec: glib::ffi::gpointer,
1406 f: glib::ffi::gpointer,
1407 ) {
1408 unsafe {
1409 let f: &F = &*(f as *const F);
1410 f(&from_glib_borrow(this))
1411 }
1412 }
1413 unsafe {
1414 let f: Box_<F> = Box_::new(f);
1415 connect_raw(
1416 self.as_ptr() as *mut _,
1417 c"notify::artists".as_ptr(),
1418 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1419 notify_artists_trampoline::<F> as *const (),
1420 )),
1421 Box_::into_raw(f),
1422 )
1423 }
1424 }
1425
1426 #[doc(alias = "authors")]
1427 pub fn connect_authors_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1428 unsafe extern "C" fn notify_authors_trampoline<F: Fn(&AboutDialog) + 'static>(
1429 this: *mut ffi::GtkAboutDialog,
1430 _param_spec: glib::ffi::gpointer,
1431 f: glib::ffi::gpointer,
1432 ) {
1433 unsafe {
1434 let f: &F = &*(f as *const F);
1435 f(&from_glib_borrow(this))
1436 }
1437 }
1438 unsafe {
1439 let f: Box_<F> = Box_::new(f);
1440 connect_raw(
1441 self.as_ptr() as *mut _,
1442 c"notify::authors".as_ptr(),
1443 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1444 notify_authors_trampoline::<F> as *const (),
1445 )),
1446 Box_::into_raw(f),
1447 )
1448 }
1449 }
1450
1451 #[doc(alias = "comments")]
1452 pub fn connect_comments_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1453 unsafe extern "C" fn notify_comments_trampoline<F: Fn(&AboutDialog) + 'static>(
1454 this: *mut ffi::GtkAboutDialog,
1455 _param_spec: glib::ffi::gpointer,
1456 f: glib::ffi::gpointer,
1457 ) {
1458 unsafe {
1459 let f: &F = &*(f as *const F);
1460 f(&from_glib_borrow(this))
1461 }
1462 }
1463 unsafe {
1464 let f: Box_<F> = Box_::new(f);
1465 connect_raw(
1466 self.as_ptr() as *mut _,
1467 c"notify::comments".as_ptr(),
1468 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1469 notify_comments_trampoline::<F> as *const (),
1470 )),
1471 Box_::into_raw(f),
1472 )
1473 }
1474 }
1475
1476 #[doc(alias = "copyright")]
1477 pub fn connect_copyright_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1478 unsafe extern "C" fn notify_copyright_trampoline<F: Fn(&AboutDialog) + 'static>(
1479 this: *mut ffi::GtkAboutDialog,
1480 _param_spec: glib::ffi::gpointer,
1481 f: glib::ffi::gpointer,
1482 ) {
1483 unsafe {
1484 let f: &F = &*(f as *const F);
1485 f(&from_glib_borrow(this))
1486 }
1487 }
1488 unsafe {
1489 let f: Box_<F> = Box_::new(f);
1490 connect_raw(
1491 self.as_ptr() as *mut _,
1492 c"notify::copyright".as_ptr(),
1493 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1494 notify_copyright_trampoline::<F> as *const (),
1495 )),
1496 Box_::into_raw(f),
1497 )
1498 }
1499 }
1500
1501 #[doc(alias = "documenters")]
1502 pub fn connect_documenters_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1503 unsafe extern "C" fn notify_documenters_trampoline<F: Fn(&AboutDialog) + 'static>(
1504 this: *mut ffi::GtkAboutDialog,
1505 _param_spec: glib::ffi::gpointer,
1506 f: glib::ffi::gpointer,
1507 ) {
1508 unsafe {
1509 let f: &F = &*(f as *const F);
1510 f(&from_glib_borrow(this))
1511 }
1512 }
1513 unsafe {
1514 let f: Box_<F> = Box_::new(f);
1515 connect_raw(
1516 self.as_ptr() as *mut _,
1517 c"notify::documenters".as_ptr(),
1518 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1519 notify_documenters_trampoline::<F> as *const (),
1520 )),
1521 Box_::into_raw(f),
1522 )
1523 }
1524 }
1525
1526 #[doc(alias = "license")]
1527 pub fn connect_license_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1528 unsafe extern "C" fn notify_license_trampoline<F: Fn(&AboutDialog) + 'static>(
1529 this: *mut ffi::GtkAboutDialog,
1530 _param_spec: glib::ffi::gpointer,
1531 f: glib::ffi::gpointer,
1532 ) {
1533 unsafe {
1534 let f: &F = &*(f as *const F);
1535 f(&from_glib_borrow(this))
1536 }
1537 }
1538 unsafe {
1539 let f: Box_<F> = Box_::new(f);
1540 connect_raw(
1541 self.as_ptr() as *mut _,
1542 c"notify::license".as_ptr(),
1543 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1544 notify_license_trampoline::<F> as *const (),
1545 )),
1546 Box_::into_raw(f),
1547 )
1548 }
1549 }
1550
1551 #[doc(alias = "license-type")]
1552 pub fn connect_license_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1553 unsafe extern "C" fn notify_license_type_trampoline<F: Fn(&AboutDialog) + 'static>(
1554 this: *mut ffi::GtkAboutDialog,
1555 _param_spec: glib::ffi::gpointer,
1556 f: glib::ffi::gpointer,
1557 ) {
1558 unsafe {
1559 let f: &F = &*(f as *const F);
1560 f(&from_glib_borrow(this))
1561 }
1562 }
1563 unsafe {
1564 let f: Box_<F> = Box_::new(f);
1565 connect_raw(
1566 self.as_ptr() as *mut _,
1567 c"notify::license-type".as_ptr(),
1568 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1569 notify_license_type_trampoline::<F> as *const (),
1570 )),
1571 Box_::into_raw(f),
1572 )
1573 }
1574 }
1575
1576 #[doc(alias = "logo")]
1577 pub fn connect_logo_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1578 unsafe extern "C" fn notify_logo_trampoline<F: Fn(&AboutDialog) + 'static>(
1579 this: *mut ffi::GtkAboutDialog,
1580 _param_spec: glib::ffi::gpointer,
1581 f: glib::ffi::gpointer,
1582 ) {
1583 unsafe {
1584 let f: &F = &*(f as *const F);
1585 f(&from_glib_borrow(this))
1586 }
1587 }
1588 unsafe {
1589 let f: Box_<F> = Box_::new(f);
1590 connect_raw(
1591 self.as_ptr() as *mut _,
1592 c"notify::logo".as_ptr(),
1593 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1594 notify_logo_trampoline::<F> as *const (),
1595 )),
1596 Box_::into_raw(f),
1597 )
1598 }
1599 }
1600
1601 #[doc(alias = "logo-icon-name")]
1602 pub fn connect_logo_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1603 unsafe extern "C" fn notify_logo_icon_name_trampoline<F: Fn(&AboutDialog) + 'static>(
1604 this: *mut ffi::GtkAboutDialog,
1605 _param_spec: glib::ffi::gpointer,
1606 f: glib::ffi::gpointer,
1607 ) {
1608 unsafe {
1609 let f: &F = &*(f as *const F);
1610 f(&from_glib_borrow(this))
1611 }
1612 }
1613 unsafe {
1614 let f: Box_<F> = Box_::new(f);
1615 connect_raw(
1616 self.as_ptr() as *mut _,
1617 c"notify::logo-icon-name".as_ptr(),
1618 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1619 notify_logo_icon_name_trampoline::<F> as *const (),
1620 )),
1621 Box_::into_raw(f),
1622 )
1623 }
1624 }
1625
1626 #[doc(alias = "program-name")]
1627 pub fn connect_program_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1628 unsafe extern "C" fn notify_program_name_trampoline<F: Fn(&AboutDialog) + 'static>(
1629 this: *mut ffi::GtkAboutDialog,
1630 _param_spec: glib::ffi::gpointer,
1631 f: glib::ffi::gpointer,
1632 ) {
1633 unsafe {
1634 let f: &F = &*(f as *const F);
1635 f(&from_glib_borrow(this))
1636 }
1637 }
1638 unsafe {
1639 let f: Box_<F> = Box_::new(f);
1640 connect_raw(
1641 self.as_ptr() as *mut _,
1642 c"notify::program-name".as_ptr(),
1643 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1644 notify_program_name_trampoline::<F> as *const (),
1645 )),
1646 Box_::into_raw(f),
1647 )
1648 }
1649 }
1650
1651 #[doc(alias = "system-information")]
1652 pub fn connect_system_information_notify<F: Fn(&Self) + 'static>(
1653 &self,
1654 f: F,
1655 ) -> SignalHandlerId {
1656 unsafe extern "C" fn notify_system_information_trampoline<F: Fn(&AboutDialog) + 'static>(
1657 this: *mut ffi::GtkAboutDialog,
1658 _param_spec: glib::ffi::gpointer,
1659 f: glib::ffi::gpointer,
1660 ) {
1661 unsafe {
1662 let f: &F = &*(f as *const F);
1663 f(&from_glib_borrow(this))
1664 }
1665 }
1666 unsafe {
1667 let f: Box_<F> = Box_::new(f);
1668 connect_raw(
1669 self.as_ptr() as *mut _,
1670 c"notify::system-information".as_ptr(),
1671 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1672 notify_system_information_trampoline::<F> as *const (),
1673 )),
1674 Box_::into_raw(f),
1675 )
1676 }
1677 }
1678
1679 #[doc(alias = "translator-credits")]
1680 pub fn connect_translator_credits_notify<F: Fn(&Self) + 'static>(
1681 &self,
1682 f: F,
1683 ) -> SignalHandlerId {
1684 unsafe extern "C" fn notify_translator_credits_trampoline<F: Fn(&AboutDialog) + 'static>(
1685 this: *mut ffi::GtkAboutDialog,
1686 _param_spec: glib::ffi::gpointer,
1687 f: glib::ffi::gpointer,
1688 ) {
1689 unsafe {
1690 let f: &F = &*(f as *const F);
1691 f(&from_glib_borrow(this))
1692 }
1693 }
1694 unsafe {
1695 let f: Box_<F> = Box_::new(f);
1696 connect_raw(
1697 self.as_ptr() as *mut _,
1698 c"notify::translator-credits".as_ptr(),
1699 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1700 notify_translator_credits_trampoline::<F> as *const (),
1701 )),
1702 Box_::into_raw(f),
1703 )
1704 }
1705 }
1706
1707 #[doc(alias = "version")]
1708 pub fn connect_version_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1709 unsafe extern "C" fn notify_version_trampoline<F: Fn(&AboutDialog) + 'static>(
1710 this: *mut ffi::GtkAboutDialog,
1711 _param_spec: glib::ffi::gpointer,
1712 f: glib::ffi::gpointer,
1713 ) {
1714 unsafe {
1715 let f: &F = &*(f as *const F);
1716 f(&from_glib_borrow(this))
1717 }
1718 }
1719 unsafe {
1720 let f: Box_<F> = Box_::new(f);
1721 connect_raw(
1722 self.as_ptr() as *mut _,
1723 c"notify::version".as_ptr(),
1724 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1725 notify_version_trampoline::<F> as *const (),
1726 )),
1727 Box_::into_raw(f),
1728 )
1729 }
1730 }
1731
1732 #[doc(alias = "website")]
1733 pub fn connect_website_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1734 unsafe extern "C" fn notify_website_trampoline<F: Fn(&AboutDialog) + 'static>(
1735 this: *mut ffi::GtkAboutDialog,
1736 _param_spec: glib::ffi::gpointer,
1737 f: glib::ffi::gpointer,
1738 ) {
1739 unsafe {
1740 let f: &F = &*(f as *const F);
1741 f(&from_glib_borrow(this))
1742 }
1743 }
1744 unsafe {
1745 let f: Box_<F> = Box_::new(f);
1746 connect_raw(
1747 self.as_ptr() as *mut _,
1748 c"notify::website".as_ptr(),
1749 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1750 notify_website_trampoline::<F> as *const (),
1751 )),
1752 Box_::into_raw(f),
1753 )
1754 }
1755 }
1756
1757 #[doc(alias = "website-label")]
1758 pub fn connect_website_label_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1759 unsafe extern "C" fn notify_website_label_trampoline<F: Fn(&AboutDialog) + 'static>(
1760 this: *mut ffi::GtkAboutDialog,
1761 _param_spec: glib::ffi::gpointer,
1762 f: glib::ffi::gpointer,
1763 ) {
1764 unsafe {
1765 let f: &F = &*(f as *const F);
1766 f(&from_glib_borrow(this))
1767 }
1768 }
1769 unsafe {
1770 let f: Box_<F> = Box_::new(f);
1771 connect_raw(
1772 self.as_ptr() as *mut _,
1773 c"notify::website-label".as_ptr(),
1774 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1775 notify_website_label_trampoline::<F> as *const (),
1776 )),
1777 Box_::into_raw(f),
1778 )
1779 }
1780 }
1781
1782 #[doc(alias = "wrap-license")]
1783 pub fn connect_wrap_license_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1784 unsafe extern "C" fn notify_wrap_license_trampoline<F: Fn(&AboutDialog) + 'static>(
1785 this: *mut ffi::GtkAboutDialog,
1786 _param_spec: glib::ffi::gpointer,
1787 f: glib::ffi::gpointer,
1788 ) {
1789 unsafe {
1790 let f: &F = &*(f as *const F);
1791 f(&from_glib_borrow(this))
1792 }
1793 }
1794 unsafe {
1795 let f: Box_<F> = Box_::new(f);
1796 connect_raw(
1797 self.as_ptr() as *mut _,
1798 c"notify::wrap-license".as_ptr(),
1799 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1800 notify_wrap_license_trampoline::<F> as *const (),
1801 )),
1802 Box_::into_raw(f),
1803 )
1804 }
1805 }
1806}
1807
1808impl Default for AboutDialog {
1809 fn default() -> Self {
1810 Self::new()
1811 }
1812}
1813
1814// rustdoc-stripper-ignore-next
1815/// A [builder-pattern] type to construct [`AboutDialog`] objects.
1816///
1817/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
1818#[must_use = "The builder must be built to be used"]
1819pub struct AboutDialogBuilder {
1820 builder: glib::object::ObjectBuilder<'static, AboutDialog>,
1821}
1822
1823impl AboutDialogBuilder {
1824 fn new() -> Self {
1825 Self {
1826 builder: glib::object::Object::builder(),
1827 }
1828 }
1829
1830 /// The people who contributed artwork to the program.
1831 ///
1832 /// Each string may contain email addresses and URLs, which will be displayed
1833 /// as links.
1834 pub fn artists(self, artists: impl Into<glib::StrV>) -> Self {
1835 Self {
1836 builder: self.builder.property("artists", artists.into()),
1837 }
1838 }
1839
1840 /// The authors of the program.
1841 ///
1842 /// Each string may contain email addresses and URLs, which will be displayed
1843 /// as links, see the introduction for more details.
1844 pub fn authors(self, authors: impl Into<glib::StrV>) -> Self {
1845 Self {
1846 builder: self.builder.property("authors", authors.into()),
1847 }
1848 }
1849
1850 /// Comments about the program.
1851 ///
1852 /// This string is displayed in a label in the main dialog, thus it
1853 /// should be a short explanation of the main purpose of the program,
1854 /// not a detailed list of features.
1855 pub fn comments(self, comments: impl Into<glib::GString>) -> Self {
1856 Self {
1857 builder: self.builder.property("comments", comments.into()),
1858 }
1859 }
1860
1861 /// Copyright information for the program.
1862 pub fn copyright(self, copyright: impl Into<glib::GString>) -> Self {
1863 Self {
1864 builder: self.builder.property("copyright", copyright.into()),
1865 }
1866 }
1867
1868 /// The people documenting the program.
1869 ///
1870 /// Each string may contain email addresses and URLs, which will be displayed
1871 /// as links, see the introduction for more details.
1872 pub fn documenters(self, documenters: impl Into<glib::StrV>) -> Self {
1873 Self {
1874 builder: self.builder.property("documenters", documenters.into()),
1875 }
1876 }
1877
1878 /// `, and these will
1879 /// be converted into clickable links.
1880 pub fn license(self, license: impl Into<glib::GString>) -> Self {
1881 Self {
1882 builder: self.builder.property("license", license.into()),
1883 }
1884 }
1885
1886 /// The license of the program.
1887 ///
1888 /// The [`AboutDialog`][crate::AboutDialog] will automatically fill out a standard disclaimer
1889 /// and link the user to the appropriate online resource for the license
1890 /// text.
1891 ///
1892 /// If [enum@Gtk.License.unknown] is used, the link used will be the same
1893 /// specified in the [`website`][struct@crate::AboutDialog#website] property.
1894 ///
1895 /// If [enum@Gtk.License.custom] is used, the current contents of the
1896 /// [`license`][struct@crate::AboutDialog#license] property are used.
1897 ///
1898 /// For any other [`License`][crate::License] value, the contents of the
1899 /// [`license`][struct@crate::AboutDialog#license] property are also set by
1900 /// this property as a side effect.
1901 pub fn license_type(self, license_type: License) -> Self {
1902 Self {
1903 builder: self.builder.property("license-type", license_type),
1904 }
1905 }
1906
1907 /// A logo for the about box.
1908 ///
1909 /// If it is `NULL`, the default window icon set with
1910 /// [`Window::set_default_icon_name()`][crate::Window::set_default_icon_name()] will be used.
1911 pub fn logo(self, logo: &impl IsA<gdk::Paintable>) -> Self {
1912 Self {
1913 builder: self.builder.property("logo", logo.clone().upcast()),
1914 }
1915 }
1916
1917 /// A named icon to use as the logo for the about box.
1918 ///
1919 /// This property overrides the [`logo`][struct@crate::AboutDialog#logo] property.
1920 pub fn logo_icon_name(self, logo_icon_name: impl Into<glib::GString>) -> Self {
1921 Self {
1922 builder: self
1923 .builder
1924 .property("logo-icon-name", logo_icon_name.into()),
1925 }
1926 }
1927
1928 /// The name of the program.
1929 ///
1930 /// If this is not set, it defaults to the value returned by
1931 /// `get_application_name()`.
1932 pub fn program_name(self, program_name: impl Into<glib::GString>) -> Self {
1933 Self {
1934 builder: self.builder.property("program-name", program_name.into()),
1935 }
1936 }
1937
1938 /// `, and these will
1939 /// be converted into clickable links.
1940 pub fn system_information(self, system_information: impl Into<glib::GString>) -> Self {
1941 Self {
1942 builder: self
1943 .builder
1944 .property("system-information", system_information.into()),
1945 }
1946 }
1947
1948 /// Credits to the translators.
1949 ///
1950 /// This string should be marked as translatable.
1951 ///
1952 /// The string may contain email addresses and URLs, which will be displayed
1953 /// as links, see the introduction for more details.
1954 pub fn translator_credits(self, translator_credits: impl Into<glib::GString>) -> Self {
1955 Self {
1956 builder: self
1957 .builder
1958 .property("translator-credits", translator_credits.into()),
1959 }
1960 }
1961
1962 /// The version of the program.
1963 pub fn version(self, version: impl Into<glib::GString>) -> Self {
1964 Self {
1965 builder: self.builder.property("version", version.into()),
1966 }
1967 }
1968
1969 /// The URL for the link to the website of the program.
1970 ///
1971 /// This should be a string starting with `http://` or `https://`.
1972 pub fn website(self, website: impl Into<glib::GString>) -> Self {
1973 Self {
1974 builder: self.builder.property("website", website.into()),
1975 }
1976 }
1977
1978 /// The label for the link to the website of the program.
1979 pub fn website_label(self, website_label: impl Into<glib::GString>) -> Self {
1980 Self {
1981 builder: self.builder.property("website-label", website_label.into()),
1982 }
1983 }
1984
1985 /// Whether to wrap the text in the license dialog.
1986 pub fn wrap_license(self, wrap_license: bool) -> Self {
1987 Self {
1988 builder: self.builder.property("wrap-license", wrap_license),
1989 }
1990 }
1991
1992 /// The [`Application`][crate::Application] associated with the window.
1993 ///
1994 /// The application will be kept alive for at least as long as it
1995 /// has any windows associated with it (see g_application_hold()
1996 /// for a way to keep it alive without windows).
1997 ///
1998 /// Normally, the connection between the application and the window
1999 /// will remain until the window is destroyed, but you can explicitly
2000 /// remove it by setting the this property to `NULL`.
2001 pub fn application(self, application: &impl IsA<Application>) -> Self {
2002 Self {
2003 builder: self
2004 .builder
2005 .property("application", application.clone().upcast()),
2006 }
2007 }
2008
2009 /// The child widget.
2010 pub fn child(self, child: &impl IsA<Widget>) -> Self {
2011 Self {
2012 builder: self.builder.property("child", child.clone().upcast()),
2013 }
2014 }
2015
2016 /// Whether the window should have a frame (also known as *decorations*).
2017 pub fn decorated(self, decorated: bool) -> Self {
2018 Self {
2019 builder: self.builder.property("decorated", decorated),
2020 }
2021 }
2022
2023 /// The default height of the window.
2024 pub fn default_height(self, default_height: i32) -> Self {
2025 Self {
2026 builder: self.builder.property("default-height", default_height),
2027 }
2028 }
2029
2030 /// The default widget.
2031 pub fn default_widget(self, default_widget: &impl IsA<Widget>) -> Self {
2032 Self {
2033 builder: self
2034 .builder
2035 .property("default-widget", default_widget.clone().upcast()),
2036 }
2037 }
2038
2039 /// The default width of the window.
2040 pub fn default_width(self, default_width: i32) -> Self {
2041 Self {
2042 builder: self.builder.property("default-width", default_width),
2043 }
2044 }
2045
2046 /// Whether the window frame should have a close button.
2047 pub fn deletable(self, deletable: bool) -> Self {
2048 Self {
2049 builder: self.builder.property("deletable", deletable),
2050 }
2051 }
2052
2053 /// If this window should be destroyed when the parent is destroyed.
2054 pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self {
2055 Self {
2056 builder: self
2057 .builder
2058 .property("destroy-with-parent", destroy_with_parent),
2059 }
2060 }
2061
2062 /// The display that will display this window.
2063 pub fn display(self, display: &impl IsA<gdk::Display>) -> Self {
2064 Self {
2065 builder: self.builder.property("display", display.clone().upcast()),
2066 }
2067 }
2068
2069 /// Whether 'focus rectangles' are currently visible in this window.
2070 ///
2071 /// This property is maintained by GTK based on user input
2072 /// and should not be set by applications.
2073 pub fn focus_visible(self, focus_visible: bool) -> Self {
2074 Self {
2075 builder: self.builder.property("focus-visible", focus_visible),
2076 }
2077 }
2078
2079 /// The focus widget.
2080 pub fn focus_widget(self, focus_widget: &impl IsA<Widget>) -> Self {
2081 Self {
2082 builder: self
2083 .builder
2084 .property("focus-widget", focus_widget.clone().upcast()),
2085 }
2086 }
2087
2088 /// Whether the window is fullscreen.
2089 ///
2090 /// Setting this property is the equivalent of calling
2091 /// [`GtkWindowExt::fullscreen()`][crate::prelude::GtkWindowExt::fullscreen()] or [`GtkWindowExt::unfullscreen()`][crate::prelude::GtkWindowExt::unfullscreen()];
2092 /// either operation is asynchronous, which means you will need to
2093 /// connect to the ::notify signal in order to know whether the
2094 /// operation was successful.
2095 pub fn fullscreened(self, fullscreened: bool) -> Self {
2096 Self {
2097 builder: self.builder.property("fullscreened", fullscreened),
2098 }
2099 }
2100
2101 /// The gravity to use when resizing the window programmatically.
2102 ///
2103 /// Gravity describes which point of the window we want to keep
2104 /// fixed (meaning that the window will grow in the opposite direction).
2105 /// For example, a gravity of `GTK_WINDOW_GRAVITY_TOP_RIGHT` means that we
2106 /// want the to fix top right corner of the window.
2107 #[cfg(feature = "v4_20")]
2108 #[cfg_attr(docsrs, doc(cfg(feature = "v4_20")))]
2109 pub fn gravity(self, gravity: WindowGravity) -> Self {
2110 Self {
2111 builder: self.builder.property("gravity", gravity),
2112 }
2113 }
2114
2115 /// for activating
2116 /// menubars.
2117 #[cfg(feature = "v4_2")]
2118 #[cfg_attr(docsrs, doc(cfg(feature = "v4_2")))]
2119 pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self {
2120 Self {
2121 builder: self
2122 .builder
2123 .property("handle-menubar-accel", handle_menubar_accel),
2124 }
2125 }
2126
2127 /// If this window should be hidden instead of destroyed when the user clicks
2128 /// the close button.
2129 pub fn hide_on_close(self, hide_on_close: bool) -> Self {
2130 Self {
2131 builder: self.builder.property("hide-on-close", hide_on_close),
2132 }
2133 }
2134
2135 /// Specifies the name of the themed icon to use as the window icon.
2136 ///
2137 /// See [`IconTheme`][crate::IconTheme] for more details.
2138 pub fn icon_name(self, icon_name: impl Into<glib::GString>) -> Self {
2139 Self {
2140 builder: self.builder.property("icon-name", icon_name.into()),
2141 }
2142 }
2143
2144 /// Whether the window is maximized.
2145 ///
2146 /// Setting this property is the equivalent of calling
2147 /// [`GtkWindowExt::maximize()`][crate::prelude::GtkWindowExt::maximize()] or [`GtkWindowExt::unmaximize()`][crate::prelude::GtkWindowExt::unmaximize()];
2148 /// either operation is asynchronous, which means you will need to
2149 /// connect to the ::notify signal in order to know whether the
2150 /// operation was successful.
2151 pub fn maximized(self, maximized: bool) -> Self {
2152 Self {
2153 builder: self.builder.property("maximized", maximized),
2154 }
2155 }
2156
2157 /// Whether mnemonics are currently visible in this window.
2158 ///
2159 /// This property is maintained by GTK based on user input,
2160 /// and should not be set by applications.
2161 pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self {
2162 Self {
2163 builder: self
2164 .builder
2165 .property("mnemonics-visible", mnemonics_visible),
2166 }
2167 }
2168
2169 /// If true, the window is modal.
2170 pub fn modal(self, modal: bool) -> Self {
2171 Self {
2172 builder: self.builder.property("modal", modal),
2173 }
2174 }
2175
2176 /// If true, users can resize the window.
2177 pub fn resizable(self, resizable: bool) -> Self {
2178 Self {
2179 builder: self.builder.property("resizable", resizable),
2180 }
2181 }
2182
2183 /// A write-only property for setting window's startup notification identifier.
2184 pub fn startup_id(self, startup_id: impl Into<glib::GString>) -> Self {
2185 Self {
2186 builder: self.builder.property("startup-id", startup_id.into()),
2187 }
2188 }
2189
2190 /// The title of the window.
2191 pub fn title(self, title: impl Into<glib::GString>) -> Self {
2192 Self {
2193 builder: self.builder.property("title", title.into()),
2194 }
2195 }
2196
2197 /// The titlebar widget.
2198 #[cfg(feature = "v4_6")]
2199 #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
2200 pub fn titlebar(self, titlebar: &impl IsA<Widget>) -> Self {
2201 Self {
2202 builder: self.builder.property("titlebar", titlebar.clone().upcast()),
2203 }
2204 }
2205
2206 /// The transient parent of the window.
2207 pub fn transient_for(self, transient_for: &impl IsA<Window>) -> Self {
2208 Self {
2209 builder: self
2210 .builder
2211 .property("transient-for", transient_for.clone().upcast()),
2212 }
2213 }
2214
2215 /// Whether the widget or any of its descendents can accept
2216 /// the input focus.
2217 ///
2218 /// This property is meant to be set by widget implementations,
2219 /// typically in their instance init function.
2220 pub fn can_focus(self, can_focus: bool) -> Self {
2221 Self {
2222 builder: self.builder.property("can-focus", can_focus),
2223 }
2224 }
2225
2226 /// Whether the widget can receive pointer events.
2227 pub fn can_target(self, can_target: bool) -> Self {
2228 Self {
2229 builder: self.builder.property("can-target", can_target),
2230 }
2231 }
2232
2233 /// A list of css classes applied to this widget.
2234 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
2235 Self {
2236 builder: self.builder.property("css-classes", css_classes.into()),
2237 }
2238 }
2239
2240 /// The name of this widget in the CSS tree.
2241 ///
2242 /// This property is meant to be set by widget implementations,
2243 /// typically in their instance init function.
2244 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
2245 Self {
2246 builder: self.builder.property("css-name", css_name.into()),
2247 }
2248 }
2249
2250 /// The cursor used by @widget.
2251 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
2252 Self {
2253 builder: self.builder.property("cursor", cursor.clone()),
2254 }
2255 }
2256
2257 /// Whether the widget should grab focus when it is clicked with the mouse.
2258 ///
2259 /// This property is only relevant for widgets that can take focus.
2260 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
2261 Self {
2262 builder: self.builder.property("focus-on-click", focus_on_click),
2263 }
2264 }
2265
2266 /// Whether this widget itself will accept the input focus.
2267 pub fn focusable(self, focusable: bool) -> Self {
2268 Self {
2269 builder: self.builder.property("focusable", focusable),
2270 }
2271 }
2272
2273 /// How to distribute horizontal space if widget gets extra space.
2274 pub fn halign(self, halign: Align) -> Self {
2275 Self {
2276 builder: self.builder.property("halign", halign),
2277 }
2278 }
2279
2280 /// Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
2281 /// signal on @widget.
2282 ///
2283 /// A true value indicates that @widget can have a tooltip, in this case
2284 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
2285 /// determine whether it will provide a tooltip or not.
2286 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
2287 Self {
2288 builder: self.builder.property("has-tooltip", has_tooltip),
2289 }
2290 }
2291
2292 /// Overrides for height request of the widget.
2293 ///
2294 /// If this is -1, the natural request will be used.
2295 pub fn height_request(self, height_request: i32) -> Self {
2296 Self {
2297 builder: self.builder.property("height-request", height_request),
2298 }
2299 }
2300
2301 /// Whether to expand horizontally.
2302 pub fn hexpand(self, hexpand: bool) -> Self {
2303 Self {
2304 builder: self.builder.property("hexpand", hexpand),
2305 }
2306 }
2307
2308 /// Whether to use the `hexpand` property.
2309 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
2310 Self {
2311 builder: self.builder.property("hexpand-set", hexpand_set),
2312 }
2313 }
2314
2315 /// The [`LayoutManager`][crate::LayoutManager] instance to use to compute
2316 /// the preferred size of the widget, and allocate its children.
2317 ///
2318 /// This property is meant to be set by widget implementations,
2319 /// typically in their instance init function.
2320 pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
2321 Self {
2322 builder: self
2323 .builder
2324 .property("layout-manager", layout_manager.clone().upcast()),
2325 }
2326 }
2327
2328 /// Makes this widget act like a modal dialog, with respect to
2329 /// event delivery.
2330 ///
2331 /// Global event controllers will not handle events with targets
2332 /// inside the widget, unless they are set up to ignore propagation
2333 /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
2334 #[cfg(feature = "v4_18")]
2335 #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
2336 pub fn limit_events(self, limit_events: bool) -> Self {
2337 Self {
2338 builder: self.builder.property("limit-events", limit_events),
2339 }
2340 }
2341
2342 /// Margin on bottom side of widget.
2343 ///
2344 /// This property adds margin outside of the widget's normal size
2345 /// request, the margin will be added in addition to the size from
2346 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
2347 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
2348 Self {
2349 builder: self.builder.property("margin-bottom", margin_bottom),
2350 }
2351 }
2352
2353 /// Margin on end of widget, horizontally.
2354 ///
2355 /// This property supports left-to-right and right-to-left text
2356 /// directions.
2357 ///
2358 /// This property adds margin outside of the widget's normal size
2359 /// request, the margin will be added in addition to the size from
2360 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
2361 pub fn margin_end(self, margin_end: i32) -> Self {
2362 Self {
2363 builder: self.builder.property("margin-end", margin_end),
2364 }
2365 }
2366
2367 /// Margin on start of widget, horizontally.
2368 ///
2369 /// This property supports left-to-right and right-to-left text
2370 /// directions.
2371 ///
2372 /// This property adds margin outside of the widget's normal size
2373 /// request, the margin will be added in addition to the size from
2374 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
2375 pub fn margin_start(self, margin_start: i32) -> Self {
2376 Self {
2377 builder: self.builder.property("margin-start", margin_start),
2378 }
2379 }
2380
2381 /// Margin on top side of widget.
2382 ///
2383 /// This property adds margin outside of the widget's normal size
2384 /// request, the margin will be added in addition to the size from
2385 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
2386 pub fn margin_top(self, margin_top: i32) -> Self {
2387 Self {
2388 builder: self.builder.property("margin-top", margin_top),
2389 }
2390 }
2391
2392 /// The name of the widget.
2393 pub fn name(self, name: impl Into<glib::GString>) -> Self {
2394 Self {
2395 builder: self.builder.property("name", name.into()),
2396 }
2397 }
2398
2399 /// The requested opacity of the widget.
2400 pub fn opacity(self, opacity: f64) -> Self {
2401 Self {
2402 builder: self.builder.property("opacity", opacity),
2403 }
2404 }
2405
2406 /// How content outside the widget's content area is treated.
2407 ///
2408 /// This property is meant to be set by widget implementations,
2409 /// typically in their instance init function.
2410 pub fn overflow(self, overflow: Overflow) -> Self {
2411 Self {
2412 builder: self.builder.property("overflow", overflow),
2413 }
2414 }
2415
2416 /// Whether the widget will receive the default action when it is focused.
2417 pub fn receives_default(self, receives_default: bool) -> Self {
2418 Self {
2419 builder: self.builder.property("receives-default", receives_default),
2420 }
2421 }
2422
2423 /// Whether the widget responds to input.
2424 pub fn sensitive(self, sensitive: bool) -> Self {
2425 Self {
2426 builder: self.builder.property("sensitive", sensitive),
2427 }
2428 }
2429
2430 /// Sets the text of tooltip to be the given string, which is marked up
2431 /// with Pango markup.
2432 ///
2433 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
2434 ///
2435 /// This is a convenience property which will take care of getting the
2436 /// tooltip shown if the given string is not `NULL`:
2437 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
2438 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
2439 /// the default signal handler.
2440 ///
2441 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
2442 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
2443 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
2444 Self {
2445 builder: self
2446 .builder
2447 .property("tooltip-markup", tooltip_markup.into()),
2448 }
2449 }
2450
2451 /// Sets the text of tooltip to be the given string.
2452 ///
2453 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
2454 ///
2455 /// This is a convenience property which will take care of getting the
2456 /// tooltip shown if the given string is not `NULL`:
2457 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
2458 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
2459 /// the default signal handler.
2460 ///
2461 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
2462 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
2463 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
2464 Self {
2465 builder: self.builder.property("tooltip-text", tooltip_text.into()),
2466 }
2467 }
2468
2469 /// How to distribute vertical space if widget gets extra space.
2470 pub fn valign(self, valign: Align) -> Self {
2471 Self {
2472 builder: self.builder.property("valign", valign),
2473 }
2474 }
2475
2476 /// Whether to expand vertically.
2477 pub fn vexpand(self, vexpand: bool) -> Self {
2478 Self {
2479 builder: self.builder.property("vexpand", vexpand),
2480 }
2481 }
2482
2483 /// Whether to use the `vexpand` property.
2484 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
2485 Self {
2486 builder: self.builder.property("vexpand-set", vexpand_set),
2487 }
2488 }
2489
2490 /// Whether the widget is visible.
2491 pub fn visible(self, visible: bool) -> Self {
2492 Self {
2493 builder: self.builder.property("visible", visible),
2494 }
2495 }
2496
2497 /// Overrides for width request of the widget.
2498 ///
2499 /// If this is -1, the natural request will be used.
2500 pub fn width_request(self, width_request: i32) -> Self {
2501 Self {
2502 builder: self.builder.property("width-request", width_request),
2503 }
2504 }
2505
2506 /// The accessible role of the given [`Accessible`][crate::Accessible] implementation.
2507 ///
2508 /// The accessible role cannot be changed once set.
2509 pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
2510 Self {
2511 builder: self.builder.property("accessible-role", accessible_role),
2512 }
2513 }
2514
2515 // rustdoc-stripper-ignore-next
2516 /// Build the [`AboutDialog`].
2517 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
2518 pub fn build(self) -> AboutDialog {
2519 assert_initialized_main_thread!();
2520 self.builder.build()
2521 }
2522}