libadwaita/auto/about_window.rs
1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from
3// from gir-files (https://github.com/gtk-rs/gir-files.git)
4// DO NOT EDIT
5#![allow(deprecated)]
6
7use crate::{ffi, Window};
8use glib::{
9 object::ObjectType as _,
10 prelude::*,
11 signal::{connect_raw, SignalHandlerId},
12 translate::*,
13};
14use std::boxed::Box as Box_;
15
16glib::wrapper! {
17 /// Use [`AboutDialog`][crate::AboutDialog].
18 /// A window showing information about the application.
19 ///
20 /// <picture>
21 /// <source srcset="about-window-dark.png" media="(prefers-color-scheme: dark)">
22 /// <img src="about-window.png" alt="about-window">
23 /// </picture>
24 ///
25 /// An about window is typically opened when the user activates the `About …`
26 /// item in the application's primary menu. All parts of the window are optional.
27 ///
28 /// ## Main page
29 ///
30 /// [`AboutWindow`][crate::AboutWindow] prominently displays the application's icon, name, developer
31 /// name and version. They can be set with the [`application-icon`][struct@crate::AboutWindow#application-icon],
32 /// [`application-name`][struct@crate::AboutWindow#application-name],
33 /// [`developer-name`][struct@crate::AboutWindow#developer-name] and [`version`][struct@crate::AboutWindow#version]
34 /// respectively.
35 ///
36 /// ## What's New
37 ///
38 /// [`AboutWindow`][crate::AboutWindow] provides a way for applications to display their release
39 /// notes, set with the [`release-notes`][struct@crate::AboutWindow#release-notes] property.
40 ///
41 /// Release notes are formatted the same way as
42 /// [AppStream descriptions](https://freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-description).
43 ///
44 /// The supported formatting options are:
45 ///
46 /// * Paragraph (`<p>`)
47 /// * Ordered list (`<ol>`), with list items (`<li>`)
48 /// * Unordered list (`<ul>`), with list items (`<li>`)
49 ///
50 /// Within paragraphs and list items, emphasis (`<em>`) and inline code
51 /// (`<code>`) text styles are supported. The emphasis is rendered in italic,
52 /// while inline code is shown in a monospaced font.
53 ///
54 /// Any text outside paragraphs or list items is ignored.
55 ///
56 /// Nested lists are not supported.
57 ///
58 /// Only one version can be shown at a time. By default, the displayed version
59 /// number matches [`version`][struct@crate::AboutWindow#version]. Use
60 /// [`release-notes-version`][struct@crate::AboutWindow#release-notes-version] to override it.
61 ///
62 /// ## Details
63 ///
64 /// The Details page displays the application comments and links.
65 ///
66 /// The comments can be set with the [`comments`][struct@crate::AboutWindow#comments] property.
67 /// Unlike [`comments`][struct@crate::Gtk::AboutDialog#comments], this string can be long and
68 /// detailed. It can also contain links and Pango markup.
69 ///
70 /// To set the application website, use [`website`][struct@crate::AboutWindow#website].
71 /// To add extra links below the website, use [`add_link()`][Self::add_link()].
72 ///
73 /// If the Details page doesn't have any other content besides website, the
74 /// website will be displayed on the main page instead.
75 ///
76 /// ## Troubleshooting
77 ///
78 /// [`AboutWindow`][crate::AboutWindow] displays the following two links on the main page:
79 ///
80 /// * Support Questions, set with the [`support-url`][struct@crate::AboutWindow#support-url] property,
81 /// * Report an Issue, set with the [`issue-url`][struct@crate::AboutWindow#issue-url] property.
82 ///
83 /// Additionally, applications can provide debugging information. It will be
84 /// shown separately on the Troubleshooting page. Use the
85 /// [`debug-info`][struct@crate::AboutWindow#debug-info] property to specify it.
86 ///
87 /// It's intended to be attached to issue reports when reporting issues against
88 /// the application. As such, it cannot contain markup or links.
89 ///
90 /// [`AboutWindow`][crate::AboutWindow] provides a quick way to save debug information to a file.
91 /// When saving, [`debug-info-filename`][struct@crate::AboutWindow#debug-info-filename] would be used as
92 /// the suggested filename.
93 ///
94 /// ## Credits and Acknowledgements
95 ///
96 /// The Credits page has the following default sections:
97 ///
98 /// * Developers, set with the [`developers`][struct@crate::AboutWindow#developers] property,
99 /// * Designers, set with the [`designers`][struct@crate::AboutWindow#designers] property,
100 /// * Artists, set with the [`artists`][struct@crate::AboutWindow#artists] property,
101 /// * Documenters, set with the [`documenters`][struct@crate::AboutWindow#documenters] property,
102 /// * Translators, set with the [`translator-credits`][struct@crate::AboutWindow#translator-credits] property.
103 ///
104 /// When setting translator credits, use the strings `"translator-credits"` or
105 /// `"translator_credits"` and mark them as translatable.
106 ///
107 /// The default sections that don't contain any names won't be displayed.
108 ///
109 /// The Credits page can also contain an arbitrary number of extra sections below
110 /// the default ones. Use [`add_credit_section()`][Self::add_credit_section()] to add them.
111 ///
112 /// The Acknowledgements page can be used to acknowledge additional people and
113 /// organizations for their non-development contributions. Use
114 /// [`add_acknowledgement_section()`][Self::add_acknowledgement_section()] to add sections to it. For
115 /// example, it can be used to list backers in a crowdfunded project or to give
116 /// special thanks.
117 ///
118 /// Each of the people or organizations can have an email address or a website
119 /// specified. To add a email address, use a string like
120 /// `Edgar Allan Poe <edgar@poe.com>`. To specify a website with a title, use a
121 /// string like `The GNOME Project https://www.gnome.org`:
122 ///
123 /// <picture>
124 /// <source srcset="about-window-credits-dark.png" media="(prefers-color-scheme: dark)">
125 /// <img src="about-window-credits.png" alt="about-window-credits">
126 /// </picture>
127 ///
128 /// ## Legal
129 ///
130 /// The Legal page displays the copyright and licensing information for the
131 /// application and other modules.
132 ///
133 /// The copyright string is set with the [`copyright`][struct@crate::AboutWindow#copyright]
134 /// property and should be a short string of one or two lines, for example:
135 /// `© 2022 Example`.
136 ///
137 /// Licensing information can be quickly set from a list of known licenses with
138 /// the [`license-type`][struct@crate::AboutWindow#license-type] property. If the application's
139 /// license is not in the list, [`license`][struct@crate::AboutWindow#license] can be used
140 /// instead.
141 ///
142 /// To add information about other modules, such as application dependencies or
143 /// data, use [`add_legal_section()`][Self::add_legal_section()].
144 ///
145 /// ## Constructing
146 ///
147 /// To make constructing an [`AboutWindow`][crate::AboutWindow] as convenient as possible, you can
148 /// use the function `show_about_window()` which constructs and shows a
149 /// window.
150 ///
151 /// **⚠️ The following code is in c ⚠️**
152 ///
153 /// ```c
154 /// static void
155 /// show_about (GtkApplication *app)
156 /// {
157 /// const char *developers[] = {
158 /// "Angela Avery",
159 /// NULL
160 /// };
161 ///
162 /// const char *designers[] = {
163 /// "GNOME Design Team",
164 /// NULL
165 /// };
166 ///
167 /// adw_show_about_window (gtk_application_get_active_window (app),
168 /// "application-name", _("Example"),
169 /// "application-icon", "org.example.App",
170 /// "version", "1.2.3",
171 /// "copyright", "© 2022 Angela Avery",
172 /// "issue-url", "https://gitlab.gnome.org/example/example/-/issues/",
173 /// "license-type", GTK_LICENSE_GPL_3_0,
174 /// "developers", developers,
175 /// "designers", designers,
176 /// "translator-credits", _("translator-credits"),
177 /// NULL);
178 /// }
179 /// ```
180 ///
181 /// ## CSS nodes
182 ///
183 /// [`AboutWindow`][crate::AboutWindow] has a main CSS node with the name `window` and the
184 /// style class `.about`.
185 ///
186 /// ## Properties
187 ///
188 ///
189 /// #### `application-icon`
190 /// The name of the application icon.
191 ///
192 /// The icon is displayed at the top of the main page.
193 ///
194 /// Readable | Writeable
195 ///
196 ///
197 /// #### `application-name`
198 /// The name of the application.
199 ///
200 /// The name is displayed at the top of the main page.
201 ///
202 /// Readable | Writeable
203 ///
204 ///
205 /// #### `artists`
206 /// The list of artists of the application.
207 ///
208 /// It will be displayed on the Credits page.
209 ///
210 /// Each name may contain email addresses and URLs, see the introduction for
211 /// more details.
212 ///
213 /// See also:
214 ///
215 /// * [`developers`][struct@crate::AboutWindow#developers]
216 /// * [`designers`][struct@crate::AboutWindow#designers]
217 /// * [`documenters`][struct@crate::AboutWindow#documenters]
218 /// * [`translator-credits`][struct@crate::AboutWindow#translator-credits]
219 /// * [`AboutWindow::add_credit_section()`][crate::AboutWindow::add_credit_section()]
220 /// * [`AboutWindow::add_acknowledgement_section()`][crate::AboutWindow::add_acknowledgement_section()]
221 ///
222 /// Readable | Writeable
223 ///
224 ///
225 /// #### `comments`
226 /// The comments about the application.
227 ///
228 /// Comments will be shown on the Details page, above links.
229 ///
230 /// Unlike [`comments`][struct@crate::Gtk::AboutDialog#comments], this string can be long and
231 /// detailed. It can also contain links and Pango markup.
232 ///
233 /// Readable | Writeable
234 ///
235 ///
236 /// #### `copyright`
237 /// The copyright information.
238 ///
239 /// This should be a short string of one or two lines, for example:
240 /// `© 2022 Example`.
241 ///
242 /// The copyright information will be displayed on the Legal page, above the
243 /// application license.
244 ///
245 /// [`AboutWindow::add_legal_section()`][crate::AboutWindow::add_legal_section()] can be used to add copyright
246 /// information for the application dependencies or other components.
247 ///
248 /// Readable | Writeable
249 ///
250 ///
251 /// #### `debug-info`
252 /// The debug information.
253 ///
254 /// Debug information will be shown on the Troubleshooting page. It's intended
255 /// to be attached to issue reports when reporting issues against the
256 /// application.
257 ///
258 /// [`AboutWindow`][crate::AboutWindow] provides a quick way to save debug information to a file.
259 /// When saving, [`debug-info-filename`][struct@crate::AboutWindow#debug-info-filename] would be used as
260 /// the suggested filename.
261 ///
262 /// Debug information cannot contain markup or links.
263 ///
264 /// Readable | Writeable
265 ///
266 ///
267 /// #### `debug-info-filename`
268 /// The debug information filename.
269 ///
270 /// It will be used as the suggested filename when saving debug information to
271 /// a file.
272 ///
273 /// See [`debug-info`][struct@crate::AboutWindow#debug-info].
274 ///
275 /// Readable | Writeable
276 ///
277 ///
278 /// #### `designers`
279 /// The list of designers of the application.
280 ///
281 /// It will be displayed on the Credits page.
282 ///
283 /// Each name may contain email addresses and URLs, see the introduction for
284 /// more details.
285 ///
286 /// See also:
287 ///
288 /// * [`developers`][struct@crate::AboutWindow#developers]
289 /// * [`artists`][struct@crate::AboutWindow#artists]
290 /// * [`documenters`][struct@crate::AboutWindow#documenters]
291 /// * [`translator-credits`][struct@crate::AboutWindow#translator-credits]
292 /// * [`AboutWindow::add_credit_section()`][crate::AboutWindow::add_credit_section()]
293 /// * [`AboutWindow::add_acknowledgement_section()`][crate::AboutWindow::add_acknowledgement_section()]
294 ///
295 /// Readable | Writeable
296 ///
297 ///
298 /// #### `developer-name`
299 /// The developer name.
300 ///
301 /// The developer name is displayed on the main page, under the application
302 /// name.
303 ///
304 /// If the application is developed by multiple people, the developer name can
305 /// be set to values like "AppName team", "AppName developers" or
306 /// "The AppName project", and the individual contributors can be listed on the
307 /// Credits page, with [`developers`][struct@crate::AboutWindow#developers] and related
308 /// properties.
309 ///
310 /// Readable | Writeable
311 ///
312 ///
313 /// #### `developers`
314 /// The list of developers of the application.
315 ///
316 /// It will be displayed on the Credits page.
317 ///
318 /// Each name may contain email addresses and URLs, see the introduction for
319 /// more details.
320 ///
321 /// See also:
322 ///
323 /// * [`designers`][struct@crate::AboutWindow#designers]
324 /// * [`artists`][struct@crate::AboutWindow#artists]
325 /// * [`documenters`][struct@crate::AboutWindow#documenters]
326 /// * [`translator-credits`][struct@crate::AboutWindow#translator-credits]
327 /// * [`AboutWindow::add_credit_section()`][crate::AboutWindow::add_credit_section()]
328 /// * [`AboutWindow::add_acknowledgement_section()`][crate::AboutWindow::add_acknowledgement_section()]
329 ///
330 /// Readable | Writeable
331 ///
332 ///
333 /// #### `documenters`
334 /// The list of documenters of the application.
335 ///
336 /// It will be displayed on the Credits page.
337 ///
338 /// Each name may contain email addresses and URLs, see the introduction for
339 /// more details.
340 ///
341 /// See also:
342 ///
343 /// * [`developers`][struct@crate::AboutWindow#developers]
344 /// * [`designers`][struct@crate::AboutWindow#designers]
345 /// * [`artists`][struct@crate::AboutWindow#artists]
346 /// * [`translator-credits`][struct@crate::AboutWindow#translator-credits]
347 /// * [`AboutWindow::add_credit_section()`][crate::AboutWindow::add_credit_section()]
348 /// * [`AboutWindow::add_acknowledgement_section()`][crate::AboutWindow::add_acknowledgement_section()]
349 ///
350 /// Readable | Writeable
351 ///
352 ///
353 /// #### `issue-url`
354 /// The URL for the application's issue tracker.
355 ///
356 /// The issue tracker link is displayed on the main page.
357 ///
358 /// Readable | Writeable
359 ///
360 ///
361 /// #### `license`
362 /// The license text.
363 ///
364 /// This can be used to set a custom text for the license if it can't be set
365 /// via [`license-type`][struct@crate::AboutWindow#license-type].
366 ///
367 /// When set, [`license-type`][struct@crate::AboutWindow#license-type] will be set to
368 /// `GTK_LICENSE_CUSTOM`.
369 ///
370 /// The license text will be displayed on the Legal page, below the copyright
371 /// information.
372 ///
373 /// License text can contain Pango markup and links.
374 ///
375 /// [`AboutWindow::add_legal_section()`][crate::AboutWindow::add_legal_section()] can be used to add license
376 /// information for the application dependencies or other components.
377 ///
378 /// Readable | Writeable
379 ///
380 ///
381 /// #### `license-type`
382 /// The license type.
383 ///
384 /// Allows to set the application's license froma list of known licenses.
385 ///
386 /// If the application's license is not in the list,
387 /// [`license`][struct@crate::AboutWindow#license] can be used instead. The license type will
388 /// be automatically set to `GTK_LICENSE_CUSTOM` in that case.
389 ///
390 /// If set to `GTK_LICENSE_UNKNOWN`, no information will be displayed.
391 ///
392 /// If the license type is different from `GTK_LICENSE_CUSTOM`.
393 /// [`license`][struct@crate::AboutWindow#license] will be cleared out.
394 ///
395 /// The license description will be displayed on the Legal page, below the
396 /// copyright information.
397 ///
398 /// [`AboutWindow::add_legal_section()`][crate::AboutWindow::add_legal_section()] can be used to add license
399 /// information for the application dependencies or other components.
400 ///
401 /// Readable | Writeable
402 ///
403 ///
404 /// #### `release-notes`
405 /// The release notes of the application.
406 ///
407 /// Release notes are displayed on the the What's New page.
408 ///
409 /// Release notes are formatted the same way as
410 /// [AppStream descriptions](https://freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-description).
411 ///
412 /// The supported formatting options are:
413 ///
414 /// * Paragraph (`<p>`)
415 /// * Ordered list (`<ol>`), with list items (`<li>`)
416 /// * Unordered list (`<ul>`), with list items (`<li>`)
417 ///
418 /// Within paragraphs and list items, emphasis (`<em>`) and inline code
419 /// (`<code>`) text styles are supported. The emphasis is rendered in italic,
420 /// while inline code is shown in a monospaced font.
421 ///
422 /// Any text outside paragraphs or list items is ignored.
423 ///
424 /// Nested lists are not supported.
425 ///
426 /// [`AboutWindow`][crate::AboutWindow] displays the version above the release notes. If set, the
427 /// [`release-notes-version`][struct@crate::AboutWindow#release-notes-version] of the property will be used
428 /// as the version; otherwise, [`version`][struct@crate::AboutWindow#version] is used.
429 ///
430 /// Readable | Writeable
431 ///
432 ///
433 /// #### `release-notes-version`
434 /// The version described by the application's release notes.
435 ///
436 /// The release notes version is displayed on the What's New page, above the
437 /// release notes.
438 ///
439 /// If not set, [`version`][struct@crate::AboutWindow#version] will be used instead.
440 ///
441 /// For example, an application with the current version 2.0.2 might want to
442 /// keep the release notes from 2.0.0, and set the release notes version
443 /// accordingly.
444 ///
445 /// See [`release-notes`][struct@crate::AboutWindow#release-notes].
446 ///
447 /// Readable | Writeable
448 ///
449 ///
450 /// #### `support-url`
451 /// The URL of the application's support page.
452 ///
453 /// The support page link is displayed on the main page.
454 ///
455 /// Readable | Writeable
456 ///
457 ///
458 /// #### `translator-credits`
459 /// The translator credits string.
460 ///
461 /// It will be displayed on the Credits page.
462 ///
463 /// This string should be `"translator-credits"` or `"translator_credits"` and
464 /// should be marked as translatable.
465 ///
466 /// The string may contain email addresses and URLs, see the introduction for
467 /// more details.
468 ///
469 /// See also:
470 ///
471 /// * [`developers`][struct@crate::AboutWindow#developers]
472 /// * [`designers`][struct@crate::AboutWindow#designers]
473 /// * [`artists`][struct@crate::AboutWindow#artists]
474 /// * [`documenters`][struct@crate::AboutWindow#documenters]
475 /// * [`AboutWindow::add_credit_section()`][crate::AboutWindow::add_credit_section()]
476 /// * [`AboutWindow::add_acknowledgement_section()`][crate::AboutWindow::add_acknowledgement_section()]
477 ///
478 /// Readable | Writeable
479 ///
480 ///
481 /// #### `version`
482 /// The version of the application.
483 ///
484 /// The version is displayed on the main page.
485 ///
486 /// If [`release-notes-version`][struct@crate::AboutWindow#release-notes-version] is not set, the version
487 /// will also be displayed above the release notes on the What's New page.
488 ///
489 /// Readable | Writeable
490 ///
491 ///
492 /// #### `website`
493 /// The URL of the application's website.
494 ///
495 /// Website is displayed on the Details page, below comments, or on the main
496 /// page if the Details page doesn't have any other content.
497 ///
498 /// Applications can add other links below, see [`AboutWindow::add_link()`][crate::AboutWindow::add_link()].
499 ///
500 /// Readable | Writeable
501 /// <details><summary><h4>Window</h4></summary>
502 ///
503 ///
504 /// #### `adaptive-preview`
505 /// Whether adaptive preview is currently open.
506 ///
507 /// Adaptive preview is a debugging tool used for testing the window
508 /// contents at specific screen sizes, simulating mobile environment.
509 ///
510 /// Adaptive preview can always be accessed from inspector. This function
511 /// allows applications to open it manually.
512 ///
513 /// Most applications should not use this property.
514 ///
515 /// Readable | Writeable
516 ///
517 ///
518 /// #### `content`
519 /// The content widget.
520 ///
521 /// This property should always be used instead of [`child`][struct@crate::gtk::Window#child].
522 ///
523 /// Readable | Writeable
524 ///
525 ///
526 /// #### `current-breakpoint`
527 /// The current breakpoint.
528 ///
529 /// Readable
530 ///
531 ///
532 /// #### `dialogs`
533 /// The open dialogs.
534 ///
535 /// Readable
536 ///
537 ///
538 /// #### `visible-dialog`
539 /// The currently visible dialog
540 ///
541 /// Readable
542 /// </details>
543 /// <details><summary><h4>Window</h4></summary>
544 ///
545 ///
546 /// #### `application`
547 /// The [`gtk::Application`][crate::gtk::Application] associated with the window.
548 ///
549 /// The application will be kept alive for at least as long as it
550 /// has any windows associated with it (see g_application_hold()
551 /// for a way to keep it alive without windows).
552 ///
553 /// Normally, the connection between the application and the window
554 /// will remain until the window is destroyed, but you can explicitly
555 /// remove it by setting the this property to `NULL`.
556 ///
557 /// Readable | Writeable
558 ///
559 ///
560 /// #### `child`
561 /// The child widget.
562 ///
563 /// Readable | Writeable
564 ///
565 ///
566 /// #### `decorated`
567 /// Whether the window should have a frame (also known as *decorations*).
568 ///
569 /// Readable | Writeable
570 ///
571 ///
572 /// #### `default-height`
573 /// The default height of the window.
574 ///
575 /// Readable | Writeable
576 ///
577 ///
578 /// #### `default-widget`
579 /// The default widget.
580 ///
581 /// Readable | Writeable
582 ///
583 ///
584 /// #### `default-width`
585 /// The default width of the window.
586 ///
587 /// Readable | Writeable
588 ///
589 ///
590 /// #### `deletable`
591 /// Whether the window frame should have a close button.
592 ///
593 /// Readable | Writeable
594 ///
595 ///
596 /// #### `destroy-with-parent`
597 /// If this window should be destroyed when the parent is destroyed.
598 ///
599 /// Readable | Writeable
600 ///
601 ///
602 /// #### `display`
603 /// The display that will display this window.
604 ///
605 /// Readable | Writeable
606 ///
607 ///
608 /// #### `focus-visible`
609 /// Whether 'focus rectangles' are currently visible in this window.
610 ///
611 /// This property is maintained by GTK based on user input
612 /// and should not be set by applications.
613 ///
614 /// Readable | Writeable
615 ///
616 ///
617 /// #### `focus-widget`
618 /// The focus widget.
619 ///
620 /// Readable | Writeable
621 ///
622 ///
623 /// #### `fullscreened`
624 /// Whether the window is fullscreen.
625 ///
626 /// Setting this property is the equivalent of calling
627 /// [`GtkWindowExtManual::fullscreen()`][crate::gtk::prelude::GtkWindowExtManual::fullscreen()] or [`GtkWindowExtManual::unfullscreen()`][crate::gtk::prelude::GtkWindowExtManual::unfullscreen()];
628 /// either operation is asynchronous, which means you will need to
629 /// connect to the ::notify signal in order to know whether the
630 /// operation was successful.
631 ///
632 /// Readable | Writeable
633 ///
634 ///
635 /// #### `gravity`
636 /// The gravity to use when resizing the window programmatically.
637 ///
638 /// Gravity describes which point of the window we want to keep
639 /// fixed (meaning that the window will grow in the opposite direction).
640 /// For example, a gravity of `GTK_WINDOW_GRAVITY_TOP_RIGHT` means that we
641 /// want the to fix top right corner of the window.
642 ///
643 /// Readable | Writeable
644 ///
645 ///
646 /// #### `handle-menubar-accel`
647 /// Whether the window frame should handle <kbd>F10</kbd> for activating
648 /// menubars.
649 ///
650 /// Readable | Writeable
651 ///
652 ///
653 /// #### `hide-on-close`
654 /// If this window should be hidden instead of destroyed when the user clicks
655 /// the close button.
656 ///
657 /// Readable | Writeable
658 ///
659 ///
660 /// #### `icon-name`
661 /// Specifies the name of the themed icon to use as the window icon.
662 ///
663 /// See `Gtk::IconTheme` for more details.
664 ///
665 /// Readable | Writeable
666 ///
667 ///
668 /// #### `is-active`
669 /// Whether the toplevel is the currently active window.
670 ///
671 /// Readable
672 ///
673 ///
674 /// #### `maximized`
675 /// Whether the window is maximized.
676 ///
677 /// Setting this property is the equivalent of calling
678 /// [`GtkWindowExtManual::maximize()`][crate::gtk::prelude::GtkWindowExtManual::maximize()] or [`GtkWindowExtManual::unmaximize()`][crate::gtk::prelude::GtkWindowExtManual::unmaximize()];
679 /// either operation is asynchronous, which means you will need to
680 /// connect to the ::notify signal in order to know whether the
681 /// operation was successful.
682 ///
683 /// Readable | Writeable
684 ///
685 ///
686 /// #### `mnemonics-visible`
687 /// Whether mnemonics are currently visible in this window.
688 ///
689 /// This property is maintained by GTK based on user input,
690 /// and should not be set by applications.
691 ///
692 /// Readable | Writeable
693 ///
694 ///
695 /// #### `modal`
696 /// If true, the window is modal.
697 ///
698 /// Readable | Writeable
699 ///
700 ///
701 /// #### `resizable`
702 /// If true, users can resize the window.
703 ///
704 /// Readable | Writeable
705 ///
706 ///
707 /// #### `startup-id`
708 /// A write-only property for setting window's startup notification identifier.
709 ///
710 /// Writeable
711 ///
712 ///
713 /// #### `suspended`
714 /// Whether the window is suspended.
715 ///
716 /// See [`GtkWindowExtManual::is_suspended()`][crate::gtk::prelude::GtkWindowExtManual::is_suspended()] for details about what suspended means.
717 ///
718 /// Readable
719 ///
720 ///
721 /// #### `title`
722 /// The title of the window.
723 ///
724 /// Readable | Writeable
725 ///
726 ///
727 /// #### `titlebar`
728 /// The titlebar widget.
729 ///
730 /// Readable | Writeable
731 ///
732 ///
733 /// #### `transient-for`
734 /// The transient parent of the window.
735 ///
736 /// Readable | Writeable | Construct
737 /// </details>
738 /// <details><summary><h4>Widget</h4></summary>
739 ///
740 ///
741 /// #### `can-focus`
742 /// Whether the widget or any of its descendents can accept
743 /// the input focus.
744 ///
745 /// This property is meant to be set by widget implementations,
746 /// typically in their instance init function.
747 ///
748 /// Readable | Writeable
749 ///
750 ///
751 /// #### `can-target`
752 /// Whether the widget can receive pointer events.
753 ///
754 /// Readable | Writeable
755 ///
756 ///
757 /// #### `css-classes`
758 /// A list of css classes applied to this widget.
759 ///
760 /// Readable | Writeable
761 ///
762 ///
763 /// #### `css-name`
764 /// The name of this widget in the CSS tree.
765 ///
766 /// This property is meant to be set by widget implementations,
767 /// typically in their instance init function.
768 ///
769 /// Readable | Writeable | Construct Only
770 ///
771 ///
772 /// #### `cursor`
773 /// The cursor used by @widget.
774 ///
775 /// Readable | Writeable
776 ///
777 ///
778 /// #### `focus-on-click`
779 /// Whether the widget should grab focus when it is clicked with the mouse.
780 ///
781 /// This property is only relevant for widgets that can take focus.
782 ///
783 /// Readable | Writeable
784 ///
785 ///
786 /// #### `focusable`
787 /// Whether this widget itself will accept the input focus.
788 ///
789 /// Readable | Writeable
790 ///
791 ///
792 /// #### `halign`
793 /// How to distribute horizontal space if widget gets extra space.
794 ///
795 /// Readable | Writeable
796 ///
797 ///
798 /// #### `has-default`
799 /// Whether the widget is the default widget.
800 ///
801 /// Readable
802 ///
803 ///
804 /// #### `has-focus`
805 /// Whether the widget has the input focus.
806 ///
807 /// Readable
808 ///
809 ///
810 /// #### `has-tooltip`
811 /// Enables or disables the emission of the [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip]
812 /// signal on @widget.
813 ///
814 /// A true value indicates that @widget can have a tooltip, in this case
815 /// the widget will be queried using [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] to
816 /// determine whether it will provide a tooltip or not.
817 ///
818 /// Readable | Writeable
819 ///
820 ///
821 /// #### `height-request`
822 /// Overrides for height request of the widget.
823 ///
824 /// If this is -1, the natural request will be used.
825 ///
826 /// Readable | Writeable
827 ///
828 ///
829 /// #### `hexpand`
830 /// Whether to expand horizontally.
831 ///
832 /// Readable | Writeable
833 ///
834 ///
835 /// #### `hexpand-set`
836 /// Whether to use the `hexpand` property.
837 ///
838 /// Readable | Writeable
839 ///
840 ///
841 /// #### `layout-manager`
842 /// The [`gtk::LayoutManager`][crate::gtk::LayoutManager] instance to use to compute
843 /// the preferred size of the widget, and allocate its children.
844 ///
845 /// This property is meant to be set by widget implementations,
846 /// typically in their instance init function.
847 ///
848 /// Readable | Writeable
849 ///
850 ///
851 /// #### `limit-events`
852 /// Makes this widget act like a modal dialog, with respect to
853 /// event delivery.
854 ///
855 /// Global event controllers will not handle events with targets
856 /// inside the widget, unless they are set up to ignore propagation
857 /// limits. See `Gtk::EventController::set_propagation_limit()`.
858 ///
859 /// Readable | Writeable
860 ///
861 ///
862 /// #### `margin-bottom`
863 /// Margin on bottom side of widget.
864 ///
865 /// This property adds margin outside of the widget's normal size
866 /// request, the margin will be added in addition to the size from
867 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
868 ///
869 /// Readable | Writeable
870 ///
871 ///
872 /// #### `margin-end`
873 /// Margin on end of widget, horizontally.
874 ///
875 /// This property supports left-to-right and right-to-left text
876 /// directions.
877 ///
878 /// This property adds margin outside of the widget's normal size
879 /// request, the margin will be added in addition to the size from
880 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
881 ///
882 /// Readable | Writeable
883 ///
884 ///
885 /// #### `margin-start`
886 /// Margin on start of widget, horizontally.
887 ///
888 /// This property supports left-to-right and right-to-left text
889 /// directions.
890 ///
891 /// This property adds margin outside of the widget's normal size
892 /// request, the margin will be added in addition to the size from
893 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
894 ///
895 /// Readable | Writeable
896 ///
897 ///
898 /// #### `margin-top`
899 /// Margin on top side of widget.
900 ///
901 /// This property adds margin outside of the widget's normal size
902 /// request, the margin will be added in addition to the size from
903 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
904 ///
905 /// Readable | Writeable
906 ///
907 ///
908 /// #### `name`
909 /// The name of the widget.
910 ///
911 /// Readable | Writeable
912 ///
913 ///
914 /// #### `opacity`
915 /// The requested opacity of the widget.
916 ///
917 /// Readable | Writeable
918 ///
919 ///
920 /// #### `overflow`
921 /// How content outside the widget's content area is treated.
922 ///
923 /// This property is meant to be set by widget implementations,
924 /// typically in their instance init function.
925 ///
926 /// Readable | Writeable
927 ///
928 ///
929 /// #### `parent`
930 /// The parent widget of this widget.
931 ///
932 /// Readable
933 ///
934 ///
935 /// #### `receives-default`
936 /// Whether the widget will receive the default action when it is focused.
937 ///
938 /// Readable | Writeable
939 ///
940 ///
941 /// #### `root`
942 /// The [`gtk::Root`][crate::gtk::Root] widget of the widget tree containing this widget.
943 ///
944 /// This will be `NULL` if the widget is not contained in a root widget.
945 ///
946 /// Readable
947 ///
948 ///
949 /// #### `scale-factor`
950 /// The scale factor of the widget.
951 ///
952 /// Readable
953 ///
954 ///
955 /// #### `sensitive`
956 /// Whether the widget responds to input.
957 ///
958 /// Readable | Writeable
959 ///
960 ///
961 /// #### `tooltip-markup`
962 /// Sets the text of tooltip to be the given string, which is marked up
963 /// with Pango markup.
964 ///
965 /// Also see `Gtk::Tooltip::set_markup()`.
966 ///
967 /// This is a convenience property which will take care of getting the
968 /// tooltip shown if the given string is not `NULL`:
969 /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to true
970 /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
971 /// the default signal handler.
972 ///
973 /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
974 /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
975 ///
976 /// Readable | Writeable
977 ///
978 ///
979 /// #### `tooltip-text`
980 /// Sets the text of tooltip to be the given string.
981 ///
982 /// Also see `Gtk::Tooltip::set_text()`.
983 ///
984 /// This is a convenience property which will take care of getting the
985 /// tooltip shown if the given string is not `NULL`:
986 /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to true
987 /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
988 /// the default signal handler.
989 ///
990 /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
991 /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
992 ///
993 /// Readable | Writeable
994 ///
995 ///
996 /// #### `valign`
997 /// How to distribute vertical space if widget gets extra space.
998 ///
999 /// Readable | Writeable
1000 ///
1001 ///
1002 /// #### `vexpand`
1003 /// Whether to expand vertically.
1004 ///
1005 /// Readable | Writeable
1006 ///
1007 ///
1008 /// #### `vexpand-set`
1009 /// Whether to use the `vexpand` property.
1010 ///
1011 /// Readable | Writeable
1012 ///
1013 ///
1014 /// #### `visible`
1015 /// Whether the widget is visible.
1016 ///
1017 /// Readable | Writeable
1018 ///
1019 ///
1020 /// #### `width-request`
1021 /// Overrides for width request of the widget.
1022 ///
1023 /// If this is -1, the natural request will be used.
1024 ///
1025 /// Readable | Writeable
1026 /// </details>
1027 /// <details><summary><h4>Accessible</h4></summary>
1028 ///
1029 ///
1030 /// #### `accessible-role`
1031 /// The accessible role of the given [`gtk::Accessible`][crate::gtk::Accessible] implementation.
1032 ///
1033 /// The accessible role cannot be changed once set.
1034 ///
1035 /// Readable | Writeable
1036 /// </details>
1037 ///
1038 /// ## Signals
1039 ///
1040 ///
1041 /// #### `activate-link`
1042 /// Emitted when a URL is activated.
1043 ///
1044 /// Applications may connect to it to override the default behavior, which is
1045 /// to call `show_uri()`.
1046 ///
1047 ///
1048 /// <details><summary><h4>Window</h4></summary>
1049 ///
1050 ///
1051 /// #### `activate-default`
1052 /// Emitted when the user activates the default widget.
1053 ///
1054 /// This is a [keybinding signal](class.SignalAction.html).
1055 ///
1056 /// The keybindings for this signal are all forms of the <kbd>Enter</kbd> key.
1057 ///
1058 /// Action
1059 ///
1060 ///
1061 /// #### `activate-focus`
1062 /// Emitted when the user activates the currently focused
1063 /// widget of @window.
1064 ///
1065 /// This is a [keybinding signal](class.SignalAction.html).
1066 ///
1067 /// The default binding for this signal is <kbd>␣</kbd>.
1068 ///
1069 /// Action
1070 ///
1071 ///
1072 /// #### `close-request`
1073 /// Emitted when the user clicks on the close button of the window.
1074 ///
1075 ///
1076 ///
1077 ///
1078 /// #### `enable-debugging`
1079 /// Emitted when the user enables or disables interactive debugging.
1080 ///
1081 /// When @toggle is true, interactive debugging is toggled on or off,
1082 /// when it is false, the debugger will be pointed at the widget
1083 /// under the pointer.
1084 ///
1085 /// This is a [keybinding signal](class.SignalAction.html).
1086 ///
1087 /// The default bindings for this signal are
1088 /// <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>I</kbd> and
1089 /// <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>D</kbd>.
1090 ///
1091 /// Action
1092 ///
1093 ///
1094 /// #### `keys-changed`
1095 /// Emitted when the set of accelerators or mnemonics that
1096 /// are associated with the window changes.
1097 ///
1098 ///
1099 /// </details>
1100 /// <details><summary><h4>Widget</h4></summary>
1101 ///
1102 ///
1103 /// #### `destroy`
1104 /// Signals that all holders of a reference to the widget should release
1105 /// the reference that they hold.
1106 ///
1107 /// May result in finalization of the widget if all references are released.
1108 ///
1109 /// This signal is not suitable for saving widget state.
1110 ///
1111 ///
1112 ///
1113 ///
1114 /// #### `direction-changed`
1115 /// Emitted when the text direction of a widget changes.
1116 ///
1117 ///
1118 ///
1119 ///
1120 /// #### `hide`
1121 /// Emitted when @widget is hidden.
1122 ///
1123 ///
1124 ///
1125 ///
1126 /// #### `keynav-failed`
1127 /// Emitted if keyboard navigation fails.
1128 ///
1129 /// See [`WidgetExtManual::keynav_failed()`][crate::gtk::prelude::WidgetExtManual::keynav_failed()] for details.
1130 ///
1131 ///
1132 ///
1133 ///
1134 /// #### `map`
1135 /// Emitted when @widget is going to be mapped.
1136 ///
1137 /// A widget is mapped when the widget is visible (which is controlled with
1138 /// [`visible`][struct@crate::gtk::Widget#visible]) and all its parents up to the toplevel widget
1139 /// are also visible.
1140 ///
1141 /// The `::map` signal can be used to determine whether a widget will be drawn,
1142 /// for instance it can resume an animation that was stopped during the
1143 /// emission of [`unmap`][struct@crate::gtk::Widget#unmap].
1144 ///
1145 ///
1146 ///
1147 ///
1148 /// #### `mnemonic-activate`
1149 /// Emitted when a widget is activated via a mnemonic.
1150 ///
1151 /// The default handler for this signal activates @widget if @group_cycling
1152 /// is false, or just makes @widget grab focus if @group_cycling is true.
1153 ///
1154 ///
1155 ///
1156 ///
1157 /// #### `move-focus`
1158 /// Emitted when the focus is moved.
1159 ///
1160 /// The `::move-focus` signal is a [keybinding signal](class.SignalAction.html).
1161 ///
1162 /// The default bindings for this signal are <kbd>Tab</kbd> to move forward,
1163 /// and <kbd>Shift</kbd>+<kbd>Tab</kbd> to move backward.
1164 ///
1165 /// Action
1166 ///
1167 ///
1168 /// #### `query-tooltip`
1169 /// Emitted when the widget’s tooltip is about to be shown.
1170 ///
1171 /// This happens when the [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] property
1172 /// is true and the hover timeout has expired with the cursor hovering
1173 /// above @widget; or emitted when @widget got focus in keyboard mode.
1174 ///
1175 /// Using the given coordinates, the signal handler should determine
1176 /// whether a tooltip should be shown for @widget. If this is the case
1177 /// true should be returned, false otherwise. Note that if @keyboard_mode
1178 /// is true, the values of @x and @y are undefined and should not be used.
1179 ///
1180 /// The signal handler is free to manipulate @tooltip with the therefore
1181 /// destined function calls.
1182 ///
1183 ///
1184 ///
1185 ///
1186 /// #### `realize`
1187 /// Emitted when @widget is associated with a `GdkSurface`.
1188 ///
1189 /// This means that [`WidgetExtManual::realize()`][crate::gtk::prelude::WidgetExtManual::realize()] has been called
1190 /// or the widget has been mapped (that is, it is going to be drawn).
1191 ///
1192 ///
1193 ///
1194 ///
1195 /// #### `show`
1196 /// Emitted when @widget is shown.
1197 ///
1198 ///
1199 ///
1200 ///
1201 /// #### `state-flags-changed`
1202 /// Emitted when the widget state changes.
1203 ///
1204 /// See [`WidgetExtManual::state_flags()`][crate::gtk::prelude::WidgetExtManual::state_flags()].
1205 ///
1206 ///
1207 ///
1208 ///
1209 /// #### `unmap`
1210 /// Emitted when @widget is going to be unmapped.
1211 ///
1212 /// A widget is unmapped when either it or any of its parents up to the
1213 /// toplevel widget have been set as hidden.
1214 ///
1215 /// As `::unmap` indicates that a widget will not be shown any longer,
1216 /// it can be used to, for example, stop an animation on the widget.
1217 ///
1218 ///
1219 ///
1220 ///
1221 /// #### `unrealize`
1222 /// Emitted when the `GdkSurface` associated with @widget is destroyed.
1223 ///
1224 /// This means that [`WidgetExtManual::unrealize()`][crate::gtk::prelude::WidgetExtManual::unrealize()] has been called
1225 /// or the widget has been unmapped (that is, it is going to be hidden).
1226 ///
1227 ///
1228 /// </details>
1229 ///
1230 /// # Implements
1231 ///
1232 /// [`AdwWindowExt`][trait@crate::prelude::AdwWindowExt], [`trait@gtk::prelude::GtkWindowExt`], [`trait@gtk::prelude::WidgetExt`], [`trait@glib::ObjectExt`], [`trait@gtk::prelude::AccessibleExt`], [`trait@gtk::prelude::BuildableExt`], [`trait@gtk::prelude::ConstraintTargetExt`], [`trait@gtk::prelude::NativeExt`], [`trait@gtk::prelude::RootExt`], [`trait@gtk::prelude::ShortcutManagerExt`]
1233 #[doc(alias = "AdwAboutWindow")]
1234 pub struct AboutWindow(Object<ffi::AdwAboutWindow, ffi::AdwAboutWindowClass>) @extends Window, gtk::Window, gtk::Widget, @implements gtk::Accessible, gtk::Buildable, gtk::ConstraintTarget, gtk::Native, gtk::Root, gtk::ShortcutManager;
1235
1236 match fn {
1237 type_ => || ffi::adw_about_window_get_type(),
1238 }
1239}
1240
1241impl AboutWindow {
1242 /// Creates a new [`AboutWindow`][crate::AboutWindow].
1243 ///
1244 /// # Deprecated since 1.6
1245 ///
1246 /// Use [`AboutDialog`][crate::AboutDialog].
1247 ///
1248 /// # Returns
1249 ///
1250 /// the newly created [`AboutWindow`][crate::AboutWindow]
1251 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1252 #[allow(deprecated)]
1253 #[doc(alias = "adw_about_window_new")]
1254 pub fn new() -> AboutWindow {
1255 assert_initialized_main_thread!();
1256 unsafe { gtk::Widget::from_glib_none(ffi::adw_about_window_new()).unsafe_cast() }
1257 }
1258
1259 /// Creates a new [`AboutWindow`][crate::AboutWindow] using AppStream metadata.
1260 ///
1261 /// This automatically sets the following properties with the following AppStream
1262 /// values:
1263 ///
1264 /// * [`application-icon`][struct@crate::AboutWindow#application-icon] is set from the `<id>`
1265 /// * [`application-name`][struct@crate::AboutWindow#application-name] is set from the `<name>`
1266 /// * [`developer-name`][struct@crate::AboutWindow#developer-name] is set from the `<name>` within
1267 /// `<developer>`
1268 /// * [`version`][struct@crate::AboutWindow#version] is set from the version of the latest release
1269 /// * [`website`][struct@crate::AboutWindow#website] is set from the `<url type="homepage">`
1270 /// * [`support-url`][struct@crate::AboutWindow#support-url] is set from the `<url type="help">`
1271 /// * [`issue-url`][struct@crate::AboutWindow#issue-url] is set from the `<url type="bugtracker">`
1272 /// * [`license-type`][struct@crate::AboutWindow#license-type] is set from the `<project_license>`.
1273 /// If the license type retrieved from AppStream is not listed in
1274 /// [`gtk::License`][crate::gtk::License], it will be set to `GTK_LICENCE_CUSTOM`.
1275 ///
1276 /// If @release_notes_version is not `NULL`,
1277 /// [`release-notes-version`][struct@crate::AboutWindow#release-notes-version] is set to match it, while
1278 /// [`release-notes`][struct@crate::AboutWindow#release-notes] is set from the AppStream release
1279 /// description for that version.
1280 ///
1281 /// # Deprecated since 1.6
1282 ///
1283 /// Use [`AboutDialog`][crate::AboutDialog].
1284 /// ## `resource_path`
1285 /// The resource to use
1286 /// ## `release_notes_version`
1287 /// The version to retrieve release notes for
1288 ///
1289 /// # Returns
1290 ///
1291 /// the newly created [`AboutWindow`][crate::AboutWindow]
1292 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1293 #[cfg(not(target_env = "msvc"))]
1294 #[cfg_attr(docsrs, doc(cfg(not(target_env = "msvc"))))]
1295 #[cfg(feature = "v1_4")]
1296 #[cfg_attr(docsrs, doc(cfg(feature = "v1_4")))]
1297 #[allow(deprecated)]
1298 #[doc(alias = "adw_about_window_new_from_appdata")]
1299 #[doc(alias = "new_from_appdata")]
1300 pub fn from_appdata(resource_path: &str, release_notes_version: Option<&str>) -> AboutWindow {
1301 assert_initialized_main_thread!();
1302 unsafe {
1303 gtk::Widget::from_glib_none(ffi::adw_about_window_new_from_appdata(
1304 resource_path.to_glib_none().0,
1305 release_notes_version.to_glib_none().0,
1306 ))
1307 .unsafe_cast()
1308 }
1309 }
1310
1311 // rustdoc-stripper-ignore-next
1312 /// Creates a new builder-pattern struct instance to construct [`AboutWindow`] objects.
1313 ///
1314 /// This method returns an instance of [`AboutWindowBuilder`](crate::builders::AboutWindowBuilder) which can be used to create [`AboutWindow`] objects.
1315 pub fn builder() -> AboutWindowBuilder {
1316 AboutWindowBuilder::new()
1317 }
1318
1319 /// Adds a section to the Acknowledgements page.
1320 ///
1321 /// This can be used to acknowledge additional people and organizations for their
1322 /// non-development contributions - for example, backers in a crowdfunded
1323 /// project.
1324 ///
1325 /// Each name may contain email addresses and URLs, see the introduction for more
1326 /// details.
1327 ///
1328 /// See also:
1329 ///
1330 /// * [`developers`][struct@crate::AboutWindow#developers]
1331 /// * [`designers`][struct@crate::AboutWindow#designers]
1332 /// * [`artists`][struct@crate::AboutWindow#artists]
1333 /// * [`documenters`][struct@crate::AboutWindow#documenters]
1334 /// * [`translator-credits`][struct@crate::AboutWindow#translator-credits]
1335 /// * [`add_credit_section()`][Self::add_credit_section()]
1336 ///
1337 /// # Deprecated since 1.6
1338 ///
1339 /// Use [`AboutDialog`][crate::AboutDialog].
1340 /// ## `name`
1341 /// the section name
1342 /// ## `people`
1343 /// the list of names
1344 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1345 #[allow(deprecated)]
1346 #[doc(alias = "adw_about_window_add_acknowledgement_section")]
1347 pub fn add_acknowledgement_section(&self, name: Option<&str>, people: &[&str]) {
1348 unsafe {
1349 ffi::adw_about_window_add_acknowledgement_section(
1350 self.to_glib_none().0,
1351 name.to_glib_none().0,
1352 people.to_glib_none().0,
1353 );
1354 }
1355 }
1356
1357 /// Adds an extra section to the Credits page.
1358 ///
1359 /// Extra sections are displayed below the standard categories.
1360 ///
1361 /// Each name may contain email addresses and URLs, see the introduction for more
1362 /// details.
1363 ///
1364 /// See also:
1365 ///
1366 /// * [`developers`][struct@crate::AboutWindow#developers]
1367 /// * [`designers`][struct@crate::AboutWindow#designers]
1368 /// * [`artists`][struct@crate::AboutWindow#artists]
1369 /// * [`documenters`][struct@crate::AboutWindow#documenters]
1370 /// * [`translator-credits`][struct@crate::AboutWindow#translator-credits]
1371 /// * [`add_acknowledgement_section()`][Self::add_acknowledgement_section()]
1372 ///
1373 /// # Deprecated since 1.6
1374 ///
1375 /// Use [`AboutDialog`][crate::AboutDialog].
1376 /// ## `name`
1377 /// the section name
1378 /// ## `people`
1379 /// the list of names
1380 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1381 #[allow(deprecated)]
1382 #[doc(alias = "adw_about_window_add_credit_section")]
1383 pub fn add_credit_section(&self, name: Option<&str>, people: &[&str]) {
1384 unsafe {
1385 ffi::adw_about_window_add_credit_section(
1386 self.to_glib_none().0,
1387 name.to_glib_none().0,
1388 people.to_glib_none().0,
1389 );
1390 }
1391 }
1392
1393 /// Adds an extra section to the Legal page.
1394 ///
1395 /// Extra sections will be displayed below the application's own information.
1396 ///
1397 /// The parameters @copyright, @license_type and @license will be used to present
1398 /// the it the same way as [`copyright`][struct@crate::AboutWindow#copyright],
1399 /// [`license-type`][struct@crate::AboutWindow#license-type] and [`license`][struct@crate::AboutWindow#license] are
1400 /// for the application's own information.
1401 ///
1402 /// See those properties for more details.
1403 ///
1404 /// This can be useful to attribute the application dependencies or data.
1405 ///
1406 /// Examples:
1407 ///
1408 /// **⚠️ The following code is in c ⚠️**
1409 ///
1410 /// ```c
1411 /// adw_about_window_add_legal_section (ADW_ABOUT_WINDOW (about),
1412 /// _("Copyright and a known license"),
1413 /// "© 2022 Example",
1414 /// GTK_LICENSE_LGPL_2_1,
1415 /// NULL);
1416 ///
1417 /// adw_about_window_add_legal_section (ADW_ABOUT_WINDOW (about),
1418 /// _("Copyright and custom license"),
1419 /// "© 2022 Example",
1420 /// GTK_LICENSE_CUSTOM,
1421 /// "Custom license text");
1422 ///
1423 /// adw_about_window_add_legal_section (ADW_ABOUT_WINDOW (about),
1424 /// _("Copyright only"),
1425 /// "© 2022 Example",
1426 /// GTK_LICENSE_UNKNOWN,
1427 /// NULL);
1428 ///
1429 /// adw_about_window_add_legal_section (ADW_ABOUT_WINDOW (about),
1430 /// _("Custom license only"),
1431 /// NULL,
1432 /// GTK_LICENSE_CUSTOM,
1433 /// "Something completely custom here.");
1434 /// ```
1435 ///
1436 /// # Deprecated since 1.6
1437 ///
1438 /// Use [`AboutDialog`][crate::AboutDialog].
1439 /// ## `title`
1440 /// the name of the section
1441 /// ## `copyright`
1442 /// a copyright string
1443 /// ## `license_type`
1444 /// the type of license
1445 /// ## `license`
1446 /// custom license information
1447 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1448 #[allow(deprecated)]
1449 #[doc(alias = "adw_about_window_add_legal_section")]
1450 pub fn add_legal_section(
1451 &self,
1452 title: &str,
1453 copyright: Option<&str>,
1454 license_type: gtk::License,
1455 license: Option<&str>,
1456 ) {
1457 unsafe {
1458 ffi::adw_about_window_add_legal_section(
1459 self.to_glib_none().0,
1460 title.to_glib_none().0,
1461 copyright.to_glib_none().0,
1462 license_type.into_glib(),
1463 license.to_glib_none().0,
1464 );
1465 }
1466 }
1467
1468 /// Adds an extra link to the Details page.
1469 ///
1470 /// Extra links are displayed under the comment and website.
1471 ///
1472 /// Underlines in @title will be interpreted as indicating a mnemonic.
1473 ///
1474 /// See [`website`][struct@crate::AboutWindow#website].
1475 ///
1476 /// # Deprecated since 1.6
1477 ///
1478 /// Use [`AboutDialog`][crate::AboutDialog].
1479 /// ## `title`
1480 /// the link title
1481 /// ## `url`
1482 /// the link URL
1483 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1484 #[allow(deprecated)]
1485 #[doc(alias = "adw_about_window_add_link")]
1486 pub fn add_link(&self, title: &str, url: &str) {
1487 unsafe {
1488 ffi::adw_about_window_add_link(
1489 self.to_glib_none().0,
1490 title.to_glib_none().0,
1491 url.to_glib_none().0,
1492 );
1493 }
1494 }
1495
1496 /// Gets the name of the application icon for @self.
1497 ///
1498 /// # Deprecated since 1.6
1499 ///
1500 /// Use [`AboutDialog`][crate::AboutDialog].
1501 ///
1502 /// # Returns
1503 ///
1504 /// the application icon name
1505 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1506 #[allow(deprecated)]
1507 #[doc(alias = "adw_about_window_get_application_icon")]
1508 #[doc(alias = "get_application_icon")]
1509 #[doc(alias = "application-icon")]
1510 pub fn application_icon(&self) -> glib::GString {
1511 unsafe {
1512 from_glib_none(ffi::adw_about_window_get_application_icon(
1513 self.to_glib_none().0,
1514 ))
1515 }
1516 }
1517
1518 /// Gets the application name for @self.
1519 ///
1520 /// # Deprecated since 1.6
1521 ///
1522 /// Use [`AboutDialog`][crate::AboutDialog].
1523 ///
1524 /// # Returns
1525 ///
1526 /// the application name
1527 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1528 #[allow(deprecated)]
1529 #[doc(alias = "adw_about_window_get_application_name")]
1530 #[doc(alias = "get_application_name")]
1531 #[doc(alias = "application-name")]
1532 pub fn application_name(&self) -> glib::GString {
1533 unsafe {
1534 from_glib_none(ffi::adw_about_window_get_application_name(
1535 self.to_glib_none().0,
1536 ))
1537 }
1538 }
1539
1540 /// Gets the list of artists of the application.
1541 ///
1542 /// # Deprecated since 1.6
1543 ///
1544 /// Use [`AboutDialog`][crate::AboutDialog].
1545 ///
1546 /// # Returns
1547 ///
1548 /// The list of artists
1549 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1550 #[allow(deprecated)]
1551 #[doc(alias = "adw_about_window_get_artists")]
1552 #[doc(alias = "get_artists")]
1553 pub fn artists(&self) -> Vec<glib::GString> {
1554 unsafe {
1555 FromGlibPtrContainer::from_glib_none(ffi::adw_about_window_get_artists(
1556 self.to_glib_none().0,
1557 ))
1558 }
1559 }
1560
1561 /// Gets the comments about the application.
1562 ///
1563 /// # Deprecated since 1.6
1564 ///
1565 /// Use [`AboutDialog`][crate::AboutDialog].
1566 ///
1567 /// # Returns
1568 ///
1569 /// the comments
1570 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1571 #[allow(deprecated)]
1572 #[doc(alias = "adw_about_window_get_comments")]
1573 #[doc(alias = "get_comments")]
1574 pub fn comments(&self) -> glib::GString {
1575 unsafe { from_glib_none(ffi::adw_about_window_get_comments(self.to_glib_none().0)) }
1576 }
1577
1578 /// Gets the copyright information for @self.
1579 ///
1580 /// # Deprecated since 1.6
1581 ///
1582 /// Use [`AboutDialog`][crate::AboutDialog].
1583 ///
1584 /// # Returns
1585 ///
1586 /// the copyright information
1587 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1588 #[allow(deprecated)]
1589 #[doc(alias = "adw_about_window_get_copyright")]
1590 #[doc(alias = "get_copyright")]
1591 pub fn copyright(&self) -> glib::GString {
1592 unsafe { from_glib_none(ffi::adw_about_window_get_copyright(self.to_glib_none().0)) }
1593 }
1594
1595 /// Gets the debug information for @self.
1596 ///
1597 /// # Deprecated since 1.6
1598 ///
1599 /// Use [`AboutDialog`][crate::AboutDialog].
1600 ///
1601 /// # Returns
1602 ///
1603 /// the debug information
1604 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1605 #[allow(deprecated)]
1606 #[doc(alias = "adw_about_window_get_debug_info")]
1607 #[doc(alias = "get_debug_info")]
1608 #[doc(alias = "debug-info")]
1609 pub fn debug_info(&self) -> glib::GString {
1610 unsafe { from_glib_none(ffi::adw_about_window_get_debug_info(self.to_glib_none().0)) }
1611 }
1612
1613 /// Gets the debug information filename for @self.
1614 ///
1615 /// # Deprecated since 1.6
1616 ///
1617 /// Use [`AboutDialog`][crate::AboutDialog].
1618 ///
1619 /// # Returns
1620 ///
1621 /// the debug information filename
1622 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1623 #[allow(deprecated)]
1624 #[doc(alias = "adw_about_window_get_debug_info_filename")]
1625 #[doc(alias = "get_debug_info_filename")]
1626 #[doc(alias = "debug-info-filename")]
1627 pub fn debug_info_filename(&self) -> glib::GString {
1628 unsafe {
1629 from_glib_none(ffi::adw_about_window_get_debug_info_filename(
1630 self.to_glib_none().0,
1631 ))
1632 }
1633 }
1634
1635 /// Gets the list of designers of the application.
1636 ///
1637 /// # Deprecated since 1.6
1638 ///
1639 /// Use [`AboutDialog`][crate::AboutDialog].
1640 ///
1641 /// # Returns
1642 ///
1643 /// The list of designers
1644 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1645 #[allow(deprecated)]
1646 #[doc(alias = "adw_about_window_get_designers")]
1647 #[doc(alias = "get_designers")]
1648 pub fn designers(&self) -> Vec<glib::GString> {
1649 unsafe {
1650 FromGlibPtrContainer::from_glib_none(ffi::adw_about_window_get_designers(
1651 self.to_glib_none().0,
1652 ))
1653 }
1654 }
1655
1656 /// Gets the developer name for @self.
1657 ///
1658 /// # Deprecated since 1.6
1659 ///
1660 /// Use [`AboutDialog`][crate::AboutDialog].
1661 ///
1662 /// # Returns
1663 ///
1664 /// the developer_name
1665 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1666 #[allow(deprecated)]
1667 #[doc(alias = "adw_about_window_get_developer_name")]
1668 #[doc(alias = "get_developer_name")]
1669 #[doc(alias = "developer-name")]
1670 pub fn developer_name(&self) -> glib::GString {
1671 unsafe {
1672 from_glib_none(ffi::adw_about_window_get_developer_name(
1673 self.to_glib_none().0,
1674 ))
1675 }
1676 }
1677
1678 /// Gets the list of developers of the application.
1679 ///
1680 /// # Deprecated since 1.6
1681 ///
1682 /// Use [`AboutDialog`][crate::AboutDialog].
1683 ///
1684 /// # Returns
1685 ///
1686 /// The list of developers
1687 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1688 #[allow(deprecated)]
1689 #[doc(alias = "adw_about_window_get_developers")]
1690 #[doc(alias = "get_developers")]
1691 pub fn developers(&self) -> Vec<glib::GString> {
1692 unsafe {
1693 FromGlibPtrContainer::from_glib_none(ffi::adw_about_window_get_developers(
1694 self.to_glib_none().0,
1695 ))
1696 }
1697 }
1698
1699 /// Gets the list of documenters of the application.
1700 ///
1701 /// # Deprecated since 1.6
1702 ///
1703 /// Use [`AboutDialog`][crate::AboutDialog].
1704 ///
1705 /// # Returns
1706 ///
1707 /// The list of documenters
1708 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1709 #[allow(deprecated)]
1710 #[doc(alias = "adw_about_window_get_documenters")]
1711 #[doc(alias = "get_documenters")]
1712 pub fn documenters(&self) -> Vec<glib::GString> {
1713 unsafe {
1714 FromGlibPtrContainer::from_glib_none(ffi::adw_about_window_get_documenters(
1715 self.to_glib_none().0,
1716 ))
1717 }
1718 }
1719
1720 /// Gets the issue tracker URL for @self.
1721 ///
1722 /// # Deprecated since 1.6
1723 ///
1724 /// Use [`AboutDialog`][crate::AboutDialog].
1725 ///
1726 /// # Returns
1727 ///
1728 /// the issue tracker URL
1729 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1730 #[allow(deprecated)]
1731 #[doc(alias = "adw_about_window_get_issue_url")]
1732 #[doc(alias = "get_issue_url")]
1733 #[doc(alias = "issue-url")]
1734 pub fn issue_url(&self) -> glib::GString {
1735 unsafe { from_glib_none(ffi::adw_about_window_get_issue_url(self.to_glib_none().0)) }
1736 }
1737
1738 /// Gets the license for @self.
1739 ///
1740 /// # Deprecated since 1.6
1741 ///
1742 /// Use [`AboutDialog`][crate::AboutDialog].
1743 ///
1744 /// # Returns
1745 ///
1746 /// the license
1747 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1748 #[allow(deprecated)]
1749 #[doc(alias = "adw_about_window_get_license")]
1750 #[doc(alias = "get_license")]
1751 pub fn license(&self) -> glib::GString {
1752 unsafe { from_glib_none(ffi::adw_about_window_get_license(self.to_glib_none().0)) }
1753 }
1754
1755 /// Gets the license type for @self.
1756 ///
1757 /// # Deprecated since 1.6
1758 ///
1759 /// Use [`AboutDialog`][crate::AboutDialog].
1760 ///
1761 /// # Returns
1762 ///
1763 /// the license type
1764 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1765 #[allow(deprecated)]
1766 #[doc(alias = "adw_about_window_get_license_type")]
1767 #[doc(alias = "get_license_type")]
1768 #[doc(alias = "license-type")]
1769 pub fn license_type(&self) -> gtk::License {
1770 unsafe {
1771 from_glib(ffi::adw_about_window_get_license_type(
1772 self.to_glib_none().0,
1773 ))
1774 }
1775 }
1776
1777 /// Gets the release notes for @self.
1778 ///
1779 /// # Deprecated since 1.6
1780 ///
1781 /// Use [`AboutDialog`][crate::AboutDialog].
1782 ///
1783 /// # Returns
1784 ///
1785 /// the release notes
1786 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1787 #[allow(deprecated)]
1788 #[doc(alias = "adw_about_window_get_release_notes")]
1789 #[doc(alias = "get_release_notes")]
1790 #[doc(alias = "release-notes")]
1791 pub fn release_notes(&self) -> glib::GString {
1792 unsafe {
1793 from_glib_none(ffi::adw_about_window_get_release_notes(
1794 self.to_glib_none().0,
1795 ))
1796 }
1797 }
1798
1799 /// Gets the version described by the application's release notes.
1800 ///
1801 /// # Deprecated since 1.6
1802 ///
1803 /// Use [`AboutDialog`][crate::AboutDialog].
1804 ///
1805 /// # Returns
1806 ///
1807 /// the release notes version
1808 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1809 #[allow(deprecated)]
1810 #[doc(alias = "adw_about_window_get_release_notes_version")]
1811 #[doc(alias = "get_release_notes_version")]
1812 #[doc(alias = "release-notes-version")]
1813 pub fn release_notes_version(&self) -> glib::GString {
1814 unsafe {
1815 from_glib_none(ffi::adw_about_window_get_release_notes_version(
1816 self.to_glib_none().0,
1817 ))
1818 }
1819 }
1820
1821 /// Gets the URL of the support page for @self.
1822 ///
1823 /// # Deprecated since 1.6
1824 ///
1825 /// Use [`AboutDialog`][crate::AboutDialog].
1826 ///
1827 /// # Returns
1828 ///
1829 /// the support page URL
1830 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1831 #[allow(deprecated)]
1832 #[doc(alias = "adw_about_window_get_support_url")]
1833 #[doc(alias = "get_support_url")]
1834 #[doc(alias = "support-url")]
1835 pub fn support_url(&self) -> glib::GString {
1836 unsafe { from_glib_none(ffi::adw_about_window_get_support_url(self.to_glib_none().0)) }
1837 }
1838
1839 /// Gets the translator credits string.
1840 ///
1841 /// # Deprecated since 1.6
1842 ///
1843 /// Use [`AboutDialog`][crate::AboutDialog].
1844 ///
1845 /// # Returns
1846 ///
1847 /// The translator credits string
1848 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1849 #[allow(deprecated)]
1850 #[doc(alias = "adw_about_window_get_translator_credits")]
1851 #[doc(alias = "get_translator_credits")]
1852 #[doc(alias = "translator-credits")]
1853 pub fn translator_credits(&self) -> glib::GString {
1854 unsafe {
1855 from_glib_none(ffi::adw_about_window_get_translator_credits(
1856 self.to_glib_none().0,
1857 ))
1858 }
1859 }
1860
1861 /// Gets the version for @self.
1862 ///
1863 /// # Deprecated since 1.6
1864 ///
1865 /// Use [`AboutDialog`][crate::AboutDialog].
1866 ///
1867 /// # Returns
1868 ///
1869 /// the version
1870 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1871 #[allow(deprecated)]
1872 #[doc(alias = "adw_about_window_get_version")]
1873 #[doc(alias = "get_version")]
1874 pub fn version(&self) -> glib::GString {
1875 unsafe { from_glib_none(ffi::adw_about_window_get_version(self.to_glib_none().0)) }
1876 }
1877
1878 /// Gets the application website URL for @self.
1879 ///
1880 /// # Deprecated since 1.6
1881 ///
1882 /// Use [`AboutDialog`][crate::AboutDialog].
1883 ///
1884 /// # Returns
1885 ///
1886 /// the website URL
1887 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1888 #[allow(deprecated)]
1889 #[doc(alias = "adw_about_window_get_website")]
1890 #[doc(alias = "get_website")]
1891 pub fn website(&self) -> glib::GString {
1892 unsafe { from_glib_none(ffi::adw_about_window_get_website(self.to_glib_none().0)) }
1893 }
1894
1895 /// Sets the name of the application icon for @self.
1896 ///
1897 /// The icon is displayed at the top of the main page.
1898 ///
1899 /// # Deprecated since 1.6
1900 ///
1901 /// Use [`AboutDialog`][crate::AboutDialog].
1902 /// ## `application_icon`
1903 /// the application icon name
1904 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1905 #[allow(deprecated)]
1906 #[doc(alias = "adw_about_window_set_application_icon")]
1907 #[doc(alias = "application-icon")]
1908 pub fn set_application_icon(&self, application_icon: &str) {
1909 unsafe {
1910 ffi::adw_about_window_set_application_icon(
1911 self.to_glib_none().0,
1912 application_icon.to_glib_none().0,
1913 );
1914 }
1915 }
1916
1917 /// Sets the application name for @self.
1918 ///
1919 /// The name is displayed at the top of the main page.
1920 ///
1921 /// # Deprecated since 1.6
1922 ///
1923 /// Use [`AboutDialog`][crate::AboutDialog].
1924 /// ## `application_name`
1925 /// the application name
1926 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1927 #[allow(deprecated)]
1928 #[doc(alias = "adw_about_window_set_application_name")]
1929 #[doc(alias = "application-name")]
1930 pub fn set_application_name(&self, application_name: &str) {
1931 unsafe {
1932 ffi::adw_about_window_set_application_name(
1933 self.to_glib_none().0,
1934 application_name.to_glib_none().0,
1935 );
1936 }
1937 }
1938
1939 /// Sets the list of artists of the application.
1940 ///
1941 /// It will be displayed on the Credits page.
1942 ///
1943 /// Each name may contain email addresses and URLs, see the introduction for more
1944 /// details.
1945 ///
1946 /// See also:
1947 ///
1948 /// * [`developers`][struct@crate::AboutWindow#developers]
1949 /// * [`designers`][struct@crate::AboutWindow#designers]
1950 /// * [`documenters`][struct@crate::AboutWindow#documenters]
1951 /// * [`translator-credits`][struct@crate::AboutWindow#translator-credits]
1952 /// * [`add_credit_section()`][Self::add_credit_section()]
1953 /// * [`add_acknowledgement_section()`][Self::add_acknowledgement_section()]
1954 ///
1955 /// # Deprecated since 1.6
1956 ///
1957 /// Use [`AboutDialog`][crate::AboutDialog].
1958 /// ## `artists`
1959 /// the list of artists
1960 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1961 #[allow(deprecated)]
1962 #[doc(alias = "adw_about_window_set_artists")]
1963 #[doc(alias = "artists")]
1964 pub fn set_artists(&self, artists: &[&str]) {
1965 unsafe {
1966 ffi::adw_about_window_set_artists(self.to_glib_none().0, artists.to_glib_none().0);
1967 }
1968 }
1969
1970 /// Sets the comments about the application.
1971 ///
1972 /// Comments will be shown on the Details page, above links.
1973 ///
1974 /// Unlike [`comments`][struct@crate::Gtk::AboutDialog#comments], this string can be long and
1975 /// detailed. It can also contain links and Pango markup.
1976 ///
1977 /// # Deprecated since 1.6
1978 ///
1979 /// Use [`AboutDialog`][crate::AboutDialog].
1980 /// ## `comments`
1981 /// the comments
1982 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
1983 #[allow(deprecated)]
1984 #[doc(alias = "adw_about_window_set_comments")]
1985 #[doc(alias = "comments")]
1986 pub fn set_comments(&self, comments: &str) {
1987 unsafe {
1988 ffi::adw_about_window_set_comments(self.to_glib_none().0, comments.to_glib_none().0);
1989 }
1990 }
1991
1992 /// Sets the copyright information for @self.
1993 ///
1994 /// This should be a short string of one or two lines, for example:
1995 /// `© 2022 Example`.
1996 ///
1997 /// The copyright information will be displayed on the Legal page, before the
1998 /// application license.
1999 ///
2000 /// [`add_legal_section()`][Self::add_legal_section()] can be used to add copyright
2001 /// information for the application dependencies or other components.
2002 ///
2003 /// # Deprecated since 1.6
2004 ///
2005 /// Use [`AboutDialog`][crate::AboutDialog].
2006 /// ## `copyright`
2007 /// the copyright information
2008 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2009 #[allow(deprecated)]
2010 #[doc(alias = "adw_about_window_set_copyright")]
2011 #[doc(alias = "copyright")]
2012 pub fn set_copyright(&self, copyright: &str) {
2013 unsafe {
2014 ffi::adw_about_window_set_copyright(self.to_glib_none().0, copyright.to_glib_none().0);
2015 }
2016 }
2017
2018 /// Sets the debug information for @self.
2019 ///
2020 /// Debug information will be shown on the Troubleshooting page. It's intended
2021 /// to be attached to issue reports when reporting issues against the
2022 /// application.
2023 ///
2024 /// [`AboutWindow`][crate::AboutWindow] provides a quick way to save debug information to a file.
2025 /// When saving, [`debug-info-filename`][struct@crate::AboutWindow#debug-info-filename] would be used as
2026 /// the suggested filename.
2027 ///
2028 /// Debug information cannot contain markup or links.
2029 ///
2030 /// # Deprecated since 1.6
2031 ///
2032 /// Use [`AboutDialog`][crate::AboutDialog].
2033 /// ## `debug_info`
2034 /// the debug information
2035 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2036 #[allow(deprecated)]
2037 #[doc(alias = "adw_about_window_set_debug_info")]
2038 #[doc(alias = "debug-info")]
2039 pub fn set_debug_info(&self, debug_info: &str) {
2040 unsafe {
2041 ffi::adw_about_window_set_debug_info(
2042 self.to_glib_none().0,
2043 debug_info.to_glib_none().0,
2044 );
2045 }
2046 }
2047
2048 /// Sets the debug information filename for @self.
2049 ///
2050 /// It will be used as the suggested filename when saving debug information to a
2051 /// file.
2052 ///
2053 /// See [`debug-info`][struct@crate::AboutWindow#debug-info].
2054 ///
2055 /// # Deprecated since 1.6
2056 ///
2057 /// Use [`AboutDialog`][crate::AboutDialog].
2058 /// ## `filename`
2059 /// the debug info filename
2060 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2061 #[allow(deprecated)]
2062 #[doc(alias = "adw_about_window_set_debug_info_filename")]
2063 #[doc(alias = "debug-info-filename")]
2064 pub fn set_debug_info_filename(&self, filename: &str) {
2065 unsafe {
2066 ffi::adw_about_window_set_debug_info_filename(
2067 self.to_glib_none().0,
2068 filename.to_glib_none().0,
2069 );
2070 }
2071 }
2072
2073 /// Sets the list of designers of the application.
2074 ///
2075 /// It will be displayed on the Credits page.
2076 ///
2077 /// Each name may contain email addresses and URLs, see the introduction for more
2078 /// details.
2079 ///
2080 /// See also:
2081 ///
2082 /// * [`developers`][struct@crate::AboutWindow#developers]
2083 /// * [`artists`][struct@crate::AboutWindow#artists]
2084 /// * [`documenters`][struct@crate::AboutWindow#documenters]
2085 /// * [`translator-credits`][struct@crate::AboutWindow#translator-credits]
2086 /// * [`add_credit_section()`][Self::add_credit_section()]
2087 /// * [`add_acknowledgement_section()`][Self::add_acknowledgement_section()]
2088 ///
2089 /// # Deprecated since 1.6
2090 ///
2091 /// Use [`AboutDialog`][crate::AboutDialog].
2092 /// ## `designers`
2093 /// the list of designers
2094 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2095 #[allow(deprecated)]
2096 #[doc(alias = "adw_about_window_set_designers")]
2097 #[doc(alias = "designers")]
2098 pub fn set_designers(&self, designers: &[&str]) {
2099 unsafe {
2100 ffi::adw_about_window_set_designers(self.to_glib_none().0, designers.to_glib_none().0);
2101 }
2102 }
2103
2104 /// Sets the developer name for @self.
2105 ///
2106 /// The developer name is displayed on the main page, under the application name.
2107 ///
2108 /// If the application is developed by multiple people, the developer name can be
2109 /// set to values like "AppName team", "AppName developers" or
2110 /// "The AppName project", and the individual contributors can be listed on the
2111 /// Credits page, with [`developers`][struct@crate::AboutWindow#developers] and related properties.
2112 ///
2113 /// # Deprecated since 1.6
2114 ///
2115 /// Use [`AboutDialog`][crate::AboutDialog].
2116 /// ## `developer_name`
2117 /// the developer name
2118 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2119 #[allow(deprecated)]
2120 #[doc(alias = "adw_about_window_set_developer_name")]
2121 #[doc(alias = "developer-name")]
2122 pub fn set_developer_name(&self, developer_name: &str) {
2123 unsafe {
2124 ffi::adw_about_window_set_developer_name(
2125 self.to_glib_none().0,
2126 developer_name.to_glib_none().0,
2127 );
2128 }
2129 }
2130
2131 /// Sets the list of developers of the application.
2132 ///
2133 /// It will be displayed on the Credits page.
2134 ///
2135 /// Each name may contain email addresses and URLs, see the introduction for more
2136 /// details.
2137 ///
2138 /// See also:
2139 ///
2140 /// * [`designers`][struct@crate::AboutWindow#designers]
2141 /// * [`artists`][struct@crate::AboutWindow#artists]
2142 /// * [`documenters`][struct@crate::AboutWindow#documenters]
2143 /// * [`translator-credits`][struct@crate::AboutWindow#translator-credits]
2144 /// * [`add_credit_section()`][Self::add_credit_section()]
2145 /// * [`add_acknowledgement_section()`][Self::add_acknowledgement_section()]
2146 ///
2147 /// # Deprecated since 1.6
2148 ///
2149 /// Use [`AboutDialog`][crate::AboutDialog].
2150 /// ## `developers`
2151 /// the list of developers
2152 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2153 #[allow(deprecated)]
2154 #[doc(alias = "adw_about_window_set_developers")]
2155 #[doc(alias = "developers")]
2156 pub fn set_developers(&self, developers: &[&str]) {
2157 unsafe {
2158 ffi::adw_about_window_set_developers(
2159 self.to_glib_none().0,
2160 developers.to_glib_none().0,
2161 );
2162 }
2163 }
2164
2165 /// Sets the list of documenters of the application.
2166 ///
2167 /// It will be displayed on the Credits page.
2168 ///
2169 /// Each name may contain email addresses and URLs, see the introduction for more
2170 /// details.
2171 ///
2172 /// See also:
2173 ///
2174 /// * [`developers`][struct@crate::AboutWindow#developers]
2175 /// * [`designers`][struct@crate::AboutWindow#designers]
2176 /// * [`artists`][struct@crate::AboutWindow#artists]
2177 /// * [`translator-credits`][struct@crate::AboutWindow#translator-credits]
2178 /// * [`add_credit_section()`][Self::add_credit_section()]
2179 /// * [`add_acknowledgement_section()`][Self::add_acknowledgement_section()]
2180 ///
2181 /// # Deprecated since 1.6
2182 ///
2183 /// Use [`AboutDialog`][crate::AboutDialog].
2184 /// ## `documenters`
2185 /// the list of documenters
2186 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2187 #[allow(deprecated)]
2188 #[doc(alias = "adw_about_window_set_documenters")]
2189 #[doc(alias = "documenters")]
2190 pub fn set_documenters(&self, documenters: &[&str]) {
2191 unsafe {
2192 ffi::adw_about_window_set_documenters(
2193 self.to_glib_none().0,
2194 documenters.to_glib_none().0,
2195 );
2196 }
2197 }
2198
2199 /// Sets the issue tracker URL for @self.
2200 ///
2201 /// The issue tracker link is displayed on the main page.
2202 ///
2203 /// # Deprecated since 1.6
2204 ///
2205 /// Use [`AboutDialog`][crate::AboutDialog].
2206 /// ## `issue_url`
2207 /// the issue tracker URL
2208 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2209 #[allow(deprecated)]
2210 #[doc(alias = "adw_about_window_set_issue_url")]
2211 #[doc(alias = "issue-url")]
2212 pub fn set_issue_url(&self, issue_url: &str) {
2213 unsafe {
2214 ffi::adw_about_window_set_issue_url(self.to_glib_none().0, issue_url.to_glib_none().0);
2215 }
2216 }
2217
2218 /// Sets the license for @self.
2219 ///
2220 /// This can be used to set a custom text for the license if it can't be set via
2221 /// [`license-type`][struct@crate::AboutWindow#license-type].
2222 ///
2223 /// When set, [`license-type`][struct@crate::AboutWindow#license-type] will be set to
2224 /// `GTK_LICENSE_CUSTOM`.
2225 ///
2226 /// The license text will be displayed on the Legal page, below the copyright
2227 /// information.
2228 ///
2229 /// License text can contain Pango markup and links.
2230 ///
2231 /// [`add_legal_section()`][Self::add_legal_section()] can be used to add license information
2232 /// for the application dependencies or other components.
2233 ///
2234 /// # Deprecated since 1.6
2235 ///
2236 /// Use [`AboutDialog`][crate::AboutDialog].
2237 /// ## `license`
2238 /// the license
2239 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2240 #[allow(deprecated)]
2241 #[doc(alias = "adw_about_window_set_license")]
2242 #[doc(alias = "license")]
2243 pub fn set_license(&self, license: &str) {
2244 unsafe {
2245 ffi::adw_about_window_set_license(self.to_glib_none().0, license.to_glib_none().0);
2246 }
2247 }
2248
2249 /// Sets the license for @self from a list of known licenses.
2250 ///
2251 /// If the application's license is not in the list,
2252 /// [`license`][struct@crate::AboutWindow#license] can be used instead. The license type will be
2253 /// automatically set to `GTK_LICENSE_CUSTOM` in that case.
2254 ///
2255 /// If @license_type is `GTK_LICENSE_UNKNOWN`, no information will be displayed.
2256 ///
2257 /// If @license_type is different from `GTK_LICENSE_CUSTOM`.
2258 /// [`license`][struct@crate::AboutWindow#license] will be cleared out.
2259 ///
2260 /// The license description will be displayed on the Legal page, below the
2261 /// copyright information.
2262 ///
2263 /// [`add_legal_section()`][Self::add_legal_section()] can be used to add license information
2264 /// for the application dependencies or other components.
2265 ///
2266 /// # Deprecated since 1.6
2267 ///
2268 /// Use [`AboutDialog`][crate::AboutDialog].
2269 /// ## `license_type`
2270 /// the license type
2271 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2272 #[allow(deprecated)]
2273 #[doc(alias = "adw_about_window_set_license_type")]
2274 #[doc(alias = "license-type")]
2275 pub fn set_license_type(&self, license_type: gtk::License) {
2276 unsafe {
2277 ffi::adw_about_window_set_license_type(self.to_glib_none().0, license_type.into_glib());
2278 }
2279 }
2280
2281 /// Sets the release notes for @self.
2282 ///
2283 /// Release notes are displayed on the the What's New page.
2284 ///
2285 /// Release notes are formatted the same way as
2286 /// [AppStream descriptions](https://freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-description).
2287 ///
2288 /// The supported formatting options are:
2289 ///
2290 /// * Paragraph (`<p>`)
2291 /// * Ordered list (`<ol>`), with list items (`<li>`)
2292 /// * Unordered list (`<ul>`), with list items (`<li>`)
2293 ///
2294 /// Within paragraphs and list items, emphasis (`<em>`) and inline code
2295 /// (`<code>`) text styles are supported. The emphasis is rendered in italic,
2296 /// while inline code is shown in a monospaced font.
2297 ///
2298 /// Any text outside paragraphs or list items is ignored.
2299 ///
2300 /// Nested lists are not supported.
2301 ///
2302 /// [`AboutWindow`][crate::AboutWindow] displays the version above the release notes. If set, the
2303 /// [`release-notes-version`][struct@crate::AboutWindow#release-notes-version] of the property will be used
2304 /// as the version; otherwise, [`version`][struct@crate::AboutWindow#version] is used.
2305 ///
2306 /// # Deprecated since 1.6
2307 ///
2308 /// Use [`AboutDialog`][crate::AboutDialog].
2309 /// ## `release_notes`
2310 /// the release notes
2311 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2312 #[allow(deprecated)]
2313 #[doc(alias = "adw_about_window_set_release_notes")]
2314 #[doc(alias = "release-notes")]
2315 pub fn set_release_notes(&self, release_notes: &str) {
2316 unsafe {
2317 ffi::adw_about_window_set_release_notes(
2318 self.to_glib_none().0,
2319 release_notes.to_glib_none().0,
2320 );
2321 }
2322 }
2323
2324 /// Sets the version described by the application's release notes.
2325 ///
2326 /// The release notes version is displayed on the What's New page, above the
2327 /// release notes.
2328 ///
2329 /// If not set, [`version`][struct@crate::AboutWindow#version] will be used instead.
2330 ///
2331 /// For example, an application with the current version 2.0.2 might want to
2332 /// keep the release notes from 2.0.0, and set the release notes version
2333 /// accordingly.
2334 ///
2335 /// See [`release-notes`][struct@crate::AboutWindow#release-notes].
2336 ///
2337 /// # Deprecated since 1.6
2338 ///
2339 /// Use [`AboutDialog`][crate::AboutDialog].
2340 /// ## `version`
2341 /// the release notes version
2342 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2343 #[allow(deprecated)]
2344 #[doc(alias = "adw_about_window_set_release_notes_version")]
2345 #[doc(alias = "release-notes-version")]
2346 pub fn set_release_notes_version(&self, version: &str) {
2347 unsafe {
2348 ffi::adw_about_window_set_release_notes_version(
2349 self.to_glib_none().0,
2350 version.to_glib_none().0,
2351 );
2352 }
2353 }
2354
2355 /// Sets the URL of the support page for @self.
2356 ///
2357 /// The support page link is displayed on the main page.
2358 ///
2359 /// # Deprecated since 1.6
2360 ///
2361 /// Use [`AboutDialog`][crate::AboutDialog].
2362 /// ## `support_url`
2363 /// the support page URL
2364 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2365 #[allow(deprecated)]
2366 #[doc(alias = "adw_about_window_set_support_url")]
2367 #[doc(alias = "support-url")]
2368 pub fn set_support_url(&self, support_url: &str) {
2369 unsafe {
2370 ffi::adw_about_window_set_support_url(
2371 self.to_glib_none().0,
2372 support_url.to_glib_none().0,
2373 );
2374 }
2375 }
2376
2377 /// Sets the translator credits string.
2378 ///
2379 /// It will be displayed on the Credits page.
2380 ///
2381 /// This string should be `"translator-credits"` or `"translator_credits"` and
2382 /// should be marked as translatable.
2383 ///
2384 /// The string may contain email addresses and URLs, see the introduction for
2385 /// more details. When there is more than one translator, they must be
2386 /// separated by a newline in the same string.
2387 ///
2388 /// See also:
2389 ///
2390 /// * [`developers`][struct@crate::AboutWindow#developers]
2391 /// * [`designers`][struct@crate::AboutWindow#designers]
2392 /// * [`artists`][struct@crate::AboutWindow#artists]
2393 /// * [`documenters`][struct@crate::AboutWindow#documenters]
2394 /// * [`add_credit_section()`][Self::add_credit_section()]
2395 /// * [`add_acknowledgement_section()`][Self::add_acknowledgement_section()]
2396 ///
2397 /// # Deprecated since 1.6
2398 ///
2399 /// Use [`AboutDialog`][crate::AboutDialog].
2400 /// ## `translator_credits`
2401 /// the translator credits
2402 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2403 #[allow(deprecated)]
2404 #[doc(alias = "adw_about_window_set_translator_credits")]
2405 #[doc(alias = "translator-credits")]
2406 pub fn set_translator_credits(&self, translator_credits: &str) {
2407 unsafe {
2408 ffi::adw_about_window_set_translator_credits(
2409 self.to_glib_none().0,
2410 translator_credits.to_glib_none().0,
2411 );
2412 }
2413 }
2414
2415 /// Sets the version for @self.
2416 ///
2417 /// The version is displayed on the main page.
2418 ///
2419 /// If [`release-notes-version`][struct@crate::AboutWindow#release-notes-version] is not set, the version will
2420 /// also be displayed above the release notes on the What's New page.
2421 ///
2422 /// # Deprecated since 1.6
2423 ///
2424 /// Use [`AboutDialog`][crate::AboutDialog].
2425 /// ## `version`
2426 /// the version
2427 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2428 #[allow(deprecated)]
2429 #[doc(alias = "adw_about_window_set_version")]
2430 #[doc(alias = "version")]
2431 pub fn set_version(&self, version: &str) {
2432 unsafe {
2433 ffi::adw_about_window_set_version(self.to_glib_none().0, version.to_glib_none().0);
2434 }
2435 }
2436
2437 /// Sets the application website URL for @self.
2438 ///
2439 /// Website is displayed on the Details page, below comments, or on the main page
2440 /// if the Details page doesn't have any other content.
2441 ///
2442 /// Applications can add other links below, see [`add_link()`][Self::add_link()].
2443 ///
2444 /// # Deprecated since 1.6
2445 ///
2446 /// Use [`AboutDialog`][crate::AboutDialog].
2447 /// ## `website`
2448 /// the website URL
2449 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2450 #[allow(deprecated)]
2451 #[doc(alias = "adw_about_window_set_website")]
2452 #[doc(alias = "website")]
2453 pub fn set_website(&self, website: &str) {
2454 unsafe {
2455 ffi::adw_about_window_set_website(self.to_glib_none().0, website.to_glib_none().0);
2456 }
2457 }
2458
2459 /// Emitted when a URL is activated.
2460 ///
2461 /// Applications may connect to it to override the default behavior, which is
2462 /// to call `show_uri()`.
2463 ///
2464 /// # Deprecated since 1.6
2465 ///
2466 /// Use [`AboutDialog`][crate::AboutDialog].
2467 /// ## `uri`
2468 /// the URI to activate
2469 ///
2470 /// # Returns
2471 ///
2472 /// `TRUE` if the link has been activated
2473 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2474 #[cfg(feature = "v1_2")]
2475 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2476 #[doc(alias = "activate-link")]
2477 pub fn connect_activate_link<F: Fn(&Self, &str) -> bool + 'static>(
2478 &self,
2479 f: F,
2480 ) -> SignalHandlerId {
2481 unsafe extern "C" fn activate_link_trampoline<
2482 F: Fn(&AboutWindow, &str) -> bool + 'static,
2483 >(
2484 this: *mut ffi::AdwAboutWindow,
2485 uri: *mut std::ffi::c_char,
2486 f: glib::ffi::gpointer,
2487 ) -> glib::ffi::gboolean {
2488 let f: &F = &*(f as *const F);
2489 f(
2490 &from_glib_borrow(this),
2491 &glib::GString::from_glib_borrow(uri),
2492 )
2493 .into_glib()
2494 }
2495 unsafe {
2496 let f: Box_<F> = Box_::new(f);
2497 connect_raw(
2498 self.as_ptr() as *mut _,
2499 c"activate-link".as_ptr() as *const _,
2500 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2501 activate_link_trampoline::<F> as *const (),
2502 )),
2503 Box_::into_raw(f),
2504 )
2505 }
2506 }
2507
2508 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2509 #[cfg(feature = "v1_2")]
2510 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2511 #[doc(alias = "application-icon")]
2512 pub fn connect_application_icon_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2513 unsafe extern "C" fn notify_application_icon_trampoline<F: Fn(&AboutWindow) + 'static>(
2514 this: *mut ffi::AdwAboutWindow,
2515 _param_spec: glib::ffi::gpointer,
2516 f: glib::ffi::gpointer,
2517 ) {
2518 let f: &F = &*(f as *const F);
2519 f(&from_glib_borrow(this))
2520 }
2521 unsafe {
2522 let f: Box_<F> = Box_::new(f);
2523 connect_raw(
2524 self.as_ptr() as *mut _,
2525 c"notify::application-icon".as_ptr() as *const _,
2526 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2527 notify_application_icon_trampoline::<F> as *const (),
2528 )),
2529 Box_::into_raw(f),
2530 )
2531 }
2532 }
2533
2534 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2535 #[cfg(feature = "v1_2")]
2536 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2537 #[doc(alias = "application-name")]
2538 pub fn connect_application_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2539 unsafe extern "C" fn notify_application_name_trampoline<F: Fn(&AboutWindow) + 'static>(
2540 this: *mut ffi::AdwAboutWindow,
2541 _param_spec: glib::ffi::gpointer,
2542 f: glib::ffi::gpointer,
2543 ) {
2544 let f: &F = &*(f as *const F);
2545 f(&from_glib_borrow(this))
2546 }
2547 unsafe {
2548 let f: Box_<F> = Box_::new(f);
2549 connect_raw(
2550 self.as_ptr() as *mut _,
2551 c"notify::application-name".as_ptr() as *const _,
2552 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2553 notify_application_name_trampoline::<F> as *const (),
2554 )),
2555 Box_::into_raw(f),
2556 )
2557 }
2558 }
2559
2560 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2561 #[cfg(feature = "v1_2")]
2562 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2563 #[doc(alias = "artists")]
2564 pub fn connect_artists_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2565 unsafe extern "C" fn notify_artists_trampoline<F: Fn(&AboutWindow) + 'static>(
2566 this: *mut ffi::AdwAboutWindow,
2567 _param_spec: glib::ffi::gpointer,
2568 f: glib::ffi::gpointer,
2569 ) {
2570 let f: &F = &*(f as *const F);
2571 f(&from_glib_borrow(this))
2572 }
2573 unsafe {
2574 let f: Box_<F> = Box_::new(f);
2575 connect_raw(
2576 self.as_ptr() as *mut _,
2577 c"notify::artists".as_ptr() as *const _,
2578 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2579 notify_artists_trampoline::<F> as *const (),
2580 )),
2581 Box_::into_raw(f),
2582 )
2583 }
2584 }
2585
2586 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2587 #[cfg(feature = "v1_2")]
2588 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2589 #[doc(alias = "comments")]
2590 pub fn connect_comments_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2591 unsafe extern "C" fn notify_comments_trampoline<F: Fn(&AboutWindow) + 'static>(
2592 this: *mut ffi::AdwAboutWindow,
2593 _param_spec: glib::ffi::gpointer,
2594 f: glib::ffi::gpointer,
2595 ) {
2596 let f: &F = &*(f as *const F);
2597 f(&from_glib_borrow(this))
2598 }
2599 unsafe {
2600 let f: Box_<F> = Box_::new(f);
2601 connect_raw(
2602 self.as_ptr() as *mut _,
2603 c"notify::comments".as_ptr() as *const _,
2604 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2605 notify_comments_trampoline::<F> as *const (),
2606 )),
2607 Box_::into_raw(f),
2608 )
2609 }
2610 }
2611
2612 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2613 #[cfg(feature = "v1_2")]
2614 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2615 #[doc(alias = "copyright")]
2616 pub fn connect_copyright_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2617 unsafe extern "C" fn notify_copyright_trampoline<F: Fn(&AboutWindow) + 'static>(
2618 this: *mut ffi::AdwAboutWindow,
2619 _param_spec: glib::ffi::gpointer,
2620 f: glib::ffi::gpointer,
2621 ) {
2622 let f: &F = &*(f as *const F);
2623 f(&from_glib_borrow(this))
2624 }
2625 unsafe {
2626 let f: Box_<F> = Box_::new(f);
2627 connect_raw(
2628 self.as_ptr() as *mut _,
2629 c"notify::copyright".as_ptr() as *const _,
2630 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2631 notify_copyright_trampoline::<F> as *const (),
2632 )),
2633 Box_::into_raw(f),
2634 )
2635 }
2636 }
2637
2638 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2639 #[cfg(feature = "v1_2")]
2640 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2641 #[doc(alias = "debug-info")]
2642 pub fn connect_debug_info_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2643 unsafe extern "C" fn notify_debug_info_trampoline<F: Fn(&AboutWindow) + 'static>(
2644 this: *mut ffi::AdwAboutWindow,
2645 _param_spec: glib::ffi::gpointer,
2646 f: glib::ffi::gpointer,
2647 ) {
2648 let f: &F = &*(f as *const F);
2649 f(&from_glib_borrow(this))
2650 }
2651 unsafe {
2652 let f: Box_<F> = Box_::new(f);
2653 connect_raw(
2654 self.as_ptr() as *mut _,
2655 c"notify::debug-info".as_ptr() as *const _,
2656 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2657 notify_debug_info_trampoline::<F> as *const (),
2658 )),
2659 Box_::into_raw(f),
2660 )
2661 }
2662 }
2663
2664 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2665 #[cfg(feature = "v1_2")]
2666 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2667 #[doc(alias = "debug-info-filename")]
2668 pub fn connect_debug_info_filename_notify<F: Fn(&Self) + 'static>(
2669 &self,
2670 f: F,
2671 ) -> SignalHandlerId {
2672 unsafe extern "C" fn notify_debug_info_filename_trampoline<
2673 F: Fn(&AboutWindow) + 'static,
2674 >(
2675 this: *mut ffi::AdwAboutWindow,
2676 _param_spec: glib::ffi::gpointer,
2677 f: glib::ffi::gpointer,
2678 ) {
2679 let f: &F = &*(f as *const F);
2680 f(&from_glib_borrow(this))
2681 }
2682 unsafe {
2683 let f: Box_<F> = Box_::new(f);
2684 connect_raw(
2685 self.as_ptr() as *mut _,
2686 c"notify::debug-info-filename".as_ptr() as *const _,
2687 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2688 notify_debug_info_filename_trampoline::<F> as *const (),
2689 )),
2690 Box_::into_raw(f),
2691 )
2692 }
2693 }
2694
2695 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2696 #[cfg(feature = "v1_2")]
2697 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2698 #[doc(alias = "designers")]
2699 pub fn connect_designers_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2700 unsafe extern "C" fn notify_designers_trampoline<F: Fn(&AboutWindow) + 'static>(
2701 this: *mut ffi::AdwAboutWindow,
2702 _param_spec: glib::ffi::gpointer,
2703 f: glib::ffi::gpointer,
2704 ) {
2705 let f: &F = &*(f as *const F);
2706 f(&from_glib_borrow(this))
2707 }
2708 unsafe {
2709 let f: Box_<F> = Box_::new(f);
2710 connect_raw(
2711 self.as_ptr() as *mut _,
2712 c"notify::designers".as_ptr() as *const _,
2713 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2714 notify_designers_trampoline::<F> as *const (),
2715 )),
2716 Box_::into_raw(f),
2717 )
2718 }
2719 }
2720
2721 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2722 #[cfg(feature = "v1_2")]
2723 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2724 #[doc(alias = "developer-name")]
2725 pub fn connect_developer_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2726 unsafe extern "C" fn notify_developer_name_trampoline<F: Fn(&AboutWindow) + 'static>(
2727 this: *mut ffi::AdwAboutWindow,
2728 _param_spec: glib::ffi::gpointer,
2729 f: glib::ffi::gpointer,
2730 ) {
2731 let f: &F = &*(f as *const F);
2732 f(&from_glib_borrow(this))
2733 }
2734 unsafe {
2735 let f: Box_<F> = Box_::new(f);
2736 connect_raw(
2737 self.as_ptr() as *mut _,
2738 c"notify::developer-name".as_ptr() as *const _,
2739 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2740 notify_developer_name_trampoline::<F> as *const (),
2741 )),
2742 Box_::into_raw(f),
2743 )
2744 }
2745 }
2746
2747 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2748 #[cfg(feature = "v1_2")]
2749 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2750 #[doc(alias = "developers")]
2751 pub fn connect_developers_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2752 unsafe extern "C" fn notify_developers_trampoline<F: Fn(&AboutWindow) + 'static>(
2753 this: *mut ffi::AdwAboutWindow,
2754 _param_spec: glib::ffi::gpointer,
2755 f: glib::ffi::gpointer,
2756 ) {
2757 let f: &F = &*(f as *const F);
2758 f(&from_glib_borrow(this))
2759 }
2760 unsafe {
2761 let f: Box_<F> = Box_::new(f);
2762 connect_raw(
2763 self.as_ptr() as *mut _,
2764 c"notify::developers".as_ptr() as *const _,
2765 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2766 notify_developers_trampoline::<F> as *const (),
2767 )),
2768 Box_::into_raw(f),
2769 )
2770 }
2771 }
2772
2773 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2774 #[cfg(feature = "v1_2")]
2775 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2776 #[doc(alias = "documenters")]
2777 pub fn connect_documenters_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2778 unsafe extern "C" fn notify_documenters_trampoline<F: Fn(&AboutWindow) + 'static>(
2779 this: *mut ffi::AdwAboutWindow,
2780 _param_spec: glib::ffi::gpointer,
2781 f: glib::ffi::gpointer,
2782 ) {
2783 let f: &F = &*(f as *const F);
2784 f(&from_glib_borrow(this))
2785 }
2786 unsafe {
2787 let f: Box_<F> = Box_::new(f);
2788 connect_raw(
2789 self.as_ptr() as *mut _,
2790 c"notify::documenters".as_ptr() as *const _,
2791 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2792 notify_documenters_trampoline::<F> as *const (),
2793 )),
2794 Box_::into_raw(f),
2795 )
2796 }
2797 }
2798
2799 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2800 #[cfg(feature = "v1_2")]
2801 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2802 #[doc(alias = "issue-url")]
2803 pub fn connect_issue_url_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2804 unsafe extern "C" fn notify_issue_url_trampoline<F: Fn(&AboutWindow) + 'static>(
2805 this: *mut ffi::AdwAboutWindow,
2806 _param_spec: glib::ffi::gpointer,
2807 f: glib::ffi::gpointer,
2808 ) {
2809 let f: &F = &*(f as *const F);
2810 f(&from_glib_borrow(this))
2811 }
2812 unsafe {
2813 let f: Box_<F> = Box_::new(f);
2814 connect_raw(
2815 self.as_ptr() as *mut _,
2816 c"notify::issue-url".as_ptr() as *const _,
2817 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2818 notify_issue_url_trampoline::<F> as *const (),
2819 )),
2820 Box_::into_raw(f),
2821 )
2822 }
2823 }
2824
2825 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2826 #[cfg(feature = "v1_2")]
2827 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2828 #[doc(alias = "license")]
2829 pub fn connect_license_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2830 unsafe extern "C" fn notify_license_trampoline<F: Fn(&AboutWindow) + 'static>(
2831 this: *mut ffi::AdwAboutWindow,
2832 _param_spec: glib::ffi::gpointer,
2833 f: glib::ffi::gpointer,
2834 ) {
2835 let f: &F = &*(f as *const F);
2836 f(&from_glib_borrow(this))
2837 }
2838 unsafe {
2839 let f: Box_<F> = Box_::new(f);
2840 connect_raw(
2841 self.as_ptr() as *mut _,
2842 c"notify::license".as_ptr() as *const _,
2843 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2844 notify_license_trampoline::<F> as *const (),
2845 )),
2846 Box_::into_raw(f),
2847 )
2848 }
2849 }
2850
2851 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2852 #[cfg(feature = "v1_2")]
2853 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2854 #[doc(alias = "license-type")]
2855 pub fn connect_license_type_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2856 unsafe extern "C" fn notify_license_type_trampoline<F: Fn(&AboutWindow) + 'static>(
2857 this: *mut ffi::AdwAboutWindow,
2858 _param_spec: glib::ffi::gpointer,
2859 f: glib::ffi::gpointer,
2860 ) {
2861 let f: &F = &*(f as *const F);
2862 f(&from_glib_borrow(this))
2863 }
2864 unsafe {
2865 let f: Box_<F> = Box_::new(f);
2866 connect_raw(
2867 self.as_ptr() as *mut _,
2868 c"notify::license-type".as_ptr() as *const _,
2869 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2870 notify_license_type_trampoline::<F> as *const (),
2871 )),
2872 Box_::into_raw(f),
2873 )
2874 }
2875 }
2876
2877 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2878 #[cfg(feature = "v1_2")]
2879 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2880 #[doc(alias = "release-notes")]
2881 pub fn connect_release_notes_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2882 unsafe extern "C" fn notify_release_notes_trampoline<F: Fn(&AboutWindow) + 'static>(
2883 this: *mut ffi::AdwAboutWindow,
2884 _param_spec: glib::ffi::gpointer,
2885 f: glib::ffi::gpointer,
2886 ) {
2887 let f: &F = &*(f as *const F);
2888 f(&from_glib_borrow(this))
2889 }
2890 unsafe {
2891 let f: Box_<F> = Box_::new(f);
2892 connect_raw(
2893 self.as_ptr() as *mut _,
2894 c"notify::release-notes".as_ptr() as *const _,
2895 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2896 notify_release_notes_trampoline::<F> as *const (),
2897 )),
2898 Box_::into_raw(f),
2899 )
2900 }
2901 }
2902
2903 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2904 #[cfg(feature = "v1_2")]
2905 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2906 #[doc(alias = "release-notes-version")]
2907 pub fn connect_release_notes_version_notify<F: Fn(&Self) + 'static>(
2908 &self,
2909 f: F,
2910 ) -> SignalHandlerId {
2911 unsafe extern "C" fn notify_release_notes_version_trampoline<
2912 F: Fn(&AboutWindow) + 'static,
2913 >(
2914 this: *mut ffi::AdwAboutWindow,
2915 _param_spec: glib::ffi::gpointer,
2916 f: glib::ffi::gpointer,
2917 ) {
2918 let f: &F = &*(f as *const F);
2919 f(&from_glib_borrow(this))
2920 }
2921 unsafe {
2922 let f: Box_<F> = Box_::new(f);
2923 connect_raw(
2924 self.as_ptr() as *mut _,
2925 c"notify::release-notes-version".as_ptr() as *const _,
2926 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2927 notify_release_notes_version_trampoline::<F> as *const (),
2928 )),
2929 Box_::into_raw(f),
2930 )
2931 }
2932 }
2933
2934 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2935 #[cfg(feature = "v1_2")]
2936 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2937 #[doc(alias = "support-url")]
2938 pub fn connect_support_url_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2939 unsafe extern "C" fn notify_support_url_trampoline<F: Fn(&AboutWindow) + 'static>(
2940 this: *mut ffi::AdwAboutWindow,
2941 _param_spec: glib::ffi::gpointer,
2942 f: glib::ffi::gpointer,
2943 ) {
2944 let f: &F = &*(f as *const F);
2945 f(&from_glib_borrow(this))
2946 }
2947 unsafe {
2948 let f: Box_<F> = Box_::new(f);
2949 connect_raw(
2950 self.as_ptr() as *mut _,
2951 c"notify::support-url".as_ptr() as *const _,
2952 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2953 notify_support_url_trampoline::<F> as *const (),
2954 )),
2955 Box_::into_raw(f),
2956 )
2957 }
2958 }
2959
2960 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2961 #[cfg(feature = "v1_2")]
2962 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2963 #[doc(alias = "translator-credits")]
2964 pub fn connect_translator_credits_notify<F: Fn(&Self) + 'static>(
2965 &self,
2966 f: F,
2967 ) -> SignalHandlerId {
2968 unsafe extern "C" fn notify_translator_credits_trampoline<F: Fn(&AboutWindow) + 'static>(
2969 this: *mut ffi::AdwAboutWindow,
2970 _param_spec: glib::ffi::gpointer,
2971 f: glib::ffi::gpointer,
2972 ) {
2973 let f: &F = &*(f as *const F);
2974 f(&from_glib_borrow(this))
2975 }
2976 unsafe {
2977 let f: Box_<F> = Box_::new(f);
2978 connect_raw(
2979 self.as_ptr() as *mut _,
2980 c"notify::translator-credits".as_ptr() as *const _,
2981 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2982 notify_translator_credits_trampoline::<F> as *const (),
2983 )),
2984 Box_::into_raw(f),
2985 )
2986 }
2987 }
2988
2989 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
2990 #[cfg(feature = "v1_2")]
2991 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
2992 #[doc(alias = "version")]
2993 pub fn connect_version_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2994 unsafe extern "C" fn notify_version_trampoline<F: Fn(&AboutWindow) + 'static>(
2995 this: *mut ffi::AdwAboutWindow,
2996 _param_spec: glib::ffi::gpointer,
2997 f: glib::ffi::gpointer,
2998 ) {
2999 let f: &F = &*(f as *const F);
3000 f(&from_glib_borrow(this))
3001 }
3002 unsafe {
3003 let f: Box_<F> = Box_::new(f);
3004 connect_raw(
3005 self.as_ptr() as *mut _,
3006 c"notify::version".as_ptr() as *const _,
3007 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3008 notify_version_trampoline::<F> as *const (),
3009 )),
3010 Box_::into_raw(f),
3011 )
3012 }
3013 }
3014
3015 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3016 #[cfg(feature = "v1_2")]
3017 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3018 #[doc(alias = "website")]
3019 pub fn connect_website_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3020 unsafe extern "C" fn notify_website_trampoline<F: Fn(&AboutWindow) + 'static>(
3021 this: *mut ffi::AdwAboutWindow,
3022 _param_spec: glib::ffi::gpointer,
3023 f: glib::ffi::gpointer,
3024 ) {
3025 let f: &F = &*(f as *const F);
3026 f(&from_glib_borrow(this))
3027 }
3028 unsafe {
3029 let f: Box_<F> = Box_::new(f);
3030 connect_raw(
3031 self.as_ptr() as *mut _,
3032 c"notify::website".as_ptr() as *const _,
3033 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3034 notify_website_trampoline::<F> as *const (),
3035 )),
3036 Box_::into_raw(f),
3037 )
3038 }
3039 }
3040}
3041
3042#[cfg(feature = "v1_2")]
3043#[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3044impl Default for AboutWindow {
3045 fn default() -> Self {
3046 Self::new()
3047 }
3048}
3049
3050// rustdoc-stripper-ignore-next
3051/// A [builder-pattern] type to construct [`AboutWindow`] objects.
3052///
3053/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
3054#[must_use = "The builder must be built to be used"]
3055pub struct AboutWindowBuilder {
3056 builder: glib::object::ObjectBuilder<'static, AboutWindow>,
3057}
3058
3059impl AboutWindowBuilder {
3060 fn new() -> Self {
3061 Self {
3062 builder: glib::object::Object::builder(),
3063 }
3064 }
3065
3066 /// The name of the application icon.
3067 ///
3068 /// The icon is displayed at the top of the main page.
3069 /// Use [`AboutDialog`][crate::AboutDialog].
3070 #[cfg(feature = "v1_2")]
3071 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3072 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3073 pub fn application_icon(self, application_icon: impl Into<glib::GString>) -> Self {
3074 Self {
3075 builder: self
3076 .builder
3077 .property("application-icon", application_icon.into()),
3078 }
3079 }
3080
3081 /// The name of the application.
3082 ///
3083 /// The name is displayed at the top of the main page.
3084 /// Use [`AboutDialog`][crate::AboutDialog].
3085 #[cfg(feature = "v1_2")]
3086 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3087 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3088 pub fn application_name(self, application_name: impl Into<glib::GString>) -> Self {
3089 Self {
3090 builder: self
3091 .builder
3092 .property("application-name", application_name.into()),
3093 }
3094 }
3095
3096 /// The list of artists of the application.
3097 ///
3098 /// It will be displayed on the Credits page.
3099 ///
3100 /// Each name may contain email addresses and URLs, see the introduction for
3101 /// more details.
3102 ///
3103 /// See also:
3104 ///
3105 /// * [`developers`][struct@crate::AboutWindow#developers]
3106 /// * [`designers`][struct@crate::AboutWindow#designers]
3107 /// * [`documenters`][struct@crate::AboutWindow#documenters]
3108 /// * [`translator-credits`][struct@crate::AboutWindow#translator-credits]
3109 /// * [`AboutWindow::add_credit_section()`][crate::AboutWindow::add_credit_section()]
3110 /// * [`AboutWindow::add_acknowledgement_section()`][crate::AboutWindow::add_acknowledgement_section()]
3111 /// Use [`AboutDialog`][crate::AboutDialog].
3112 #[cfg(feature = "v1_2")]
3113 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3114 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3115 pub fn artists(self, artists: impl Into<glib::StrV>) -> Self {
3116 Self {
3117 builder: self.builder.property("artists", artists.into()),
3118 }
3119 }
3120
3121 /// The comments about the application.
3122 ///
3123 /// Comments will be shown on the Details page, above links.
3124 ///
3125 /// Unlike [`comments`][struct@crate::Gtk::AboutDialog#comments], this string can be long and
3126 /// detailed. It can also contain links and Pango markup.
3127 /// Use [`AboutDialog`][crate::AboutDialog].
3128 #[cfg(feature = "v1_2")]
3129 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3130 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3131 pub fn comments(self, comments: impl Into<glib::GString>) -> Self {
3132 Self {
3133 builder: self.builder.property("comments", comments.into()),
3134 }
3135 }
3136
3137 /// The copyright information.
3138 ///
3139 /// This should be a short string of one or two lines, for example:
3140 /// `© 2022 Example`.
3141 ///
3142 /// The copyright information will be displayed on the Legal page, above the
3143 /// application license.
3144 ///
3145 /// [`AboutWindow::add_legal_section()`][crate::AboutWindow::add_legal_section()] can be used to add copyright
3146 /// information for the application dependencies or other components.
3147 /// Use [`AboutDialog`][crate::AboutDialog].
3148 #[cfg(feature = "v1_2")]
3149 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3150 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3151 pub fn copyright(self, copyright: impl Into<glib::GString>) -> Self {
3152 Self {
3153 builder: self.builder.property("copyright", copyright.into()),
3154 }
3155 }
3156
3157 /// The debug information.
3158 ///
3159 /// Debug information will be shown on the Troubleshooting page. It's intended
3160 /// to be attached to issue reports when reporting issues against the
3161 /// application.
3162 ///
3163 /// [`AboutWindow`][crate::AboutWindow] provides a quick way to save debug information to a file.
3164 /// When saving, [`debug-info-filename`][struct@crate::AboutWindow#debug-info-filename] would be used as
3165 /// the suggested filename.
3166 ///
3167 /// Debug information cannot contain markup or links.
3168 /// Use [`AboutDialog`][crate::AboutDialog].
3169 #[cfg(feature = "v1_2")]
3170 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3171 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3172 pub fn debug_info(self, debug_info: impl Into<glib::GString>) -> Self {
3173 Self {
3174 builder: self.builder.property("debug-info", debug_info.into()),
3175 }
3176 }
3177
3178 /// The debug information filename.
3179 ///
3180 /// It will be used as the suggested filename when saving debug information to
3181 /// a file.
3182 ///
3183 /// See [`debug-info`][struct@crate::AboutWindow#debug-info].
3184 /// Use [`AboutDialog`][crate::AboutDialog].
3185 #[cfg(feature = "v1_2")]
3186 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3187 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3188 pub fn debug_info_filename(self, debug_info_filename: impl Into<glib::GString>) -> Self {
3189 Self {
3190 builder: self
3191 .builder
3192 .property("debug-info-filename", debug_info_filename.into()),
3193 }
3194 }
3195
3196 /// The list of designers of the application.
3197 ///
3198 /// It will be displayed on the Credits page.
3199 ///
3200 /// Each name may contain email addresses and URLs, see the introduction for
3201 /// more details.
3202 ///
3203 /// See also:
3204 ///
3205 /// * [`developers`][struct@crate::AboutWindow#developers]
3206 /// * [`artists`][struct@crate::AboutWindow#artists]
3207 /// * [`documenters`][struct@crate::AboutWindow#documenters]
3208 /// * [`translator-credits`][struct@crate::AboutWindow#translator-credits]
3209 /// * [`AboutWindow::add_credit_section()`][crate::AboutWindow::add_credit_section()]
3210 /// * [`AboutWindow::add_acknowledgement_section()`][crate::AboutWindow::add_acknowledgement_section()]
3211 /// Use [`AboutDialog`][crate::AboutDialog].
3212 #[cfg(feature = "v1_2")]
3213 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3214 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3215 pub fn designers(self, designers: impl Into<glib::StrV>) -> Self {
3216 Self {
3217 builder: self.builder.property("designers", designers.into()),
3218 }
3219 }
3220
3221 /// The developer name.
3222 ///
3223 /// The developer name is displayed on the main page, under the application
3224 /// name.
3225 ///
3226 /// If the application is developed by multiple people, the developer name can
3227 /// be set to values like "AppName team", "AppName developers" or
3228 /// "The AppName project", and the individual contributors can be listed on the
3229 /// Credits page, with [`developers`][struct@crate::AboutWindow#developers] and related
3230 /// properties.
3231 /// Use [`AboutDialog`][crate::AboutDialog].
3232 #[cfg(feature = "v1_2")]
3233 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3234 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3235 pub fn developer_name(self, developer_name: impl Into<glib::GString>) -> Self {
3236 Self {
3237 builder: self
3238 .builder
3239 .property("developer-name", developer_name.into()),
3240 }
3241 }
3242
3243 /// The list of developers of the application.
3244 ///
3245 /// It will be displayed on the Credits page.
3246 ///
3247 /// Each name may contain email addresses and URLs, see the introduction for
3248 /// more details.
3249 ///
3250 /// See also:
3251 ///
3252 /// * [`designers`][struct@crate::AboutWindow#designers]
3253 /// * [`artists`][struct@crate::AboutWindow#artists]
3254 /// * [`documenters`][struct@crate::AboutWindow#documenters]
3255 /// * [`translator-credits`][struct@crate::AboutWindow#translator-credits]
3256 /// * [`AboutWindow::add_credit_section()`][crate::AboutWindow::add_credit_section()]
3257 /// * [`AboutWindow::add_acknowledgement_section()`][crate::AboutWindow::add_acknowledgement_section()]
3258 /// Use [`AboutDialog`][crate::AboutDialog].
3259 #[cfg(feature = "v1_2")]
3260 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3261 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3262 pub fn developers(self, developers: impl Into<glib::StrV>) -> Self {
3263 Self {
3264 builder: self.builder.property("developers", developers.into()),
3265 }
3266 }
3267
3268 /// The list of documenters of the application.
3269 ///
3270 /// It will be displayed on the Credits page.
3271 ///
3272 /// Each name may contain email addresses and URLs, see the introduction for
3273 /// more details.
3274 ///
3275 /// See also:
3276 ///
3277 /// * [`developers`][struct@crate::AboutWindow#developers]
3278 /// * [`designers`][struct@crate::AboutWindow#designers]
3279 /// * [`artists`][struct@crate::AboutWindow#artists]
3280 /// * [`translator-credits`][struct@crate::AboutWindow#translator-credits]
3281 /// * [`AboutWindow::add_credit_section()`][crate::AboutWindow::add_credit_section()]
3282 /// * [`AboutWindow::add_acknowledgement_section()`][crate::AboutWindow::add_acknowledgement_section()]
3283 /// Use [`AboutDialog`][crate::AboutDialog].
3284 #[cfg(feature = "v1_2")]
3285 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3286 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3287 pub fn documenters(self, documenters: impl Into<glib::StrV>) -> Self {
3288 Self {
3289 builder: self.builder.property("documenters", documenters.into()),
3290 }
3291 }
3292
3293 /// The URL for the application's issue tracker.
3294 ///
3295 /// The issue tracker link is displayed on the main page.
3296 /// Use [`AboutDialog`][crate::AboutDialog].
3297 #[cfg(feature = "v1_2")]
3298 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3299 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3300 pub fn issue_url(self, issue_url: impl Into<glib::GString>) -> Self {
3301 Self {
3302 builder: self.builder.property("issue-url", issue_url.into()),
3303 }
3304 }
3305
3306 /// The license text.
3307 ///
3308 /// This can be used to set a custom text for the license if it can't be set
3309 /// via [`license-type`][struct@crate::AboutWindow#license-type].
3310 ///
3311 /// When set, [`license-type`][struct@crate::AboutWindow#license-type] will be set to
3312 /// `GTK_LICENSE_CUSTOM`.
3313 ///
3314 /// The license text will be displayed on the Legal page, below the copyright
3315 /// information.
3316 ///
3317 /// License text can contain Pango markup and links.
3318 ///
3319 /// [`AboutWindow::add_legal_section()`][crate::AboutWindow::add_legal_section()] can be used to add license
3320 /// information for the application dependencies or other components.
3321 /// Use [`AboutDialog`][crate::AboutDialog].
3322 #[cfg(feature = "v1_2")]
3323 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3324 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3325 pub fn license(self, license: impl Into<glib::GString>) -> Self {
3326 Self {
3327 builder: self.builder.property("license", license.into()),
3328 }
3329 }
3330
3331 /// The license type.
3332 ///
3333 /// Allows to set the application's license froma list of known licenses.
3334 ///
3335 /// If the application's license is not in the list,
3336 /// [`license`][struct@crate::AboutWindow#license] can be used instead. The license type will
3337 /// be automatically set to `GTK_LICENSE_CUSTOM` in that case.
3338 ///
3339 /// If set to `GTK_LICENSE_UNKNOWN`, no information will be displayed.
3340 ///
3341 /// If the license type is different from `GTK_LICENSE_CUSTOM`.
3342 /// [`license`][struct@crate::AboutWindow#license] will be cleared out.
3343 ///
3344 /// The license description will be displayed on the Legal page, below the
3345 /// copyright information.
3346 ///
3347 /// [`AboutWindow::add_legal_section()`][crate::AboutWindow::add_legal_section()] can be used to add license
3348 /// information for the application dependencies or other components.
3349 /// Use [`AboutDialog`][crate::AboutDialog].
3350 #[cfg(feature = "v1_2")]
3351 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3352 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3353 pub fn license_type(self, license_type: gtk::License) -> Self {
3354 Self {
3355 builder: self.builder.property("license-type", license_type),
3356 }
3357 }
3358
3359 /// The release notes of the application.
3360 ///
3361 /// Release notes are displayed on the the What's New page.
3362 ///
3363 /// Release notes are formatted the same way as
3364 /// [AppStream descriptions](https://freedesktop.org/software/appstream/docs/chap-Metadata.html#tag-description).
3365 ///
3366 /// The supported formatting options are:
3367 ///
3368 /// * Paragraph (`<p>`)
3369 /// * Ordered list (`<ol>`), with list items (`<li>`)
3370 /// * Unordered list (`<ul>`), with list items (`<li>`)
3371 ///
3372 /// Within paragraphs and list items, emphasis (`<em>`) and inline code
3373 /// (`<code>`) text styles are supported. The emphasis is rendered in italic,
3374 /// while inline code is shown in a monospaced font.
3375 ///
3376 /// Any text outside paragraphs or list items is ignored.
3377 ///
3378 /// Nested lists are not supported.
3379 ///
3380 /// [`AboutWindow`][crate::AboutWindow] displays the version above the release notes. If set, the
3381 /// [`release-notes-version`][struct@crate::AboutWindow#release-notes-version] of the property will be used
3382 /// as the version; otherwise, [`version`][struct@crate::AboutWindow#version] is used.
3383 /// Use [`AboutDialog`][crate::AboutDialog].
3384 #[cfg(feature = "v1_2")]
3385 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3386 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3387 pub fn release_notes(self, release_notes: impl Into<glib::GString>) -> Self {
3388 Self {
3389 builder: self.builder.property("release-notes", release_notes.into()),
3390 }
3391 }
3392
3393 /// The version described by the application's release notes.
3394 ///
3395 /// The release notes version is displayed on the What's New page, above the
3396 /// release notes.
3397 ///
3398 /// If not set, [`version`][struct@crate::AboutWindow#version] will be used instead.
3399 ///
3400 /// For example, an application with the current version 2.0.2 might want to
3401 /// keep the release notes from 2.0.0, and set the release notes version
3402 /// accordingly.
3403 ///
3404 /// See [`release-notes`][struct@crate::AboutWindow#release-notes].
3405 /// Use [`AboutDialog`][crate::AboutDialog].
3406 #[cfg(feature = "v1_2")]
3407 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3408 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3409 pub fn release_notes_version(self, release_notes_version: impl Into<glib::GString>) -> Self {
3410 Self {
3411 builder: self
3412 .builder
3413 .property("release-notes-version", release_notes_version.into()),
3414 }
3415 }
3416
3417 /// The URL of the application's support page.
3418 ///
3419 /// The support page link is displayed on the main page.
3420 /// Use [`AboutDialog`][crate::AboutDialog].
3421 #[cfg(feature = "v1_2")]
3422 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3423 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3424 pub fn support_url(self, support_url: impl Into<glib::GString>) -> Self {
3425 Self {
3426 builder: self.builder.property("support-url", support_url.into()),
3427 }
3428 }
3429
3430 /// The translator credits string.
3431 ///
3432 /// It will be displayed on the Credits page.
3433 ///
3434 /// This string should be `"translator-credits"` or `"translator_credits"` and
3435 /// should be marked as translatable.
3436 ///
3437 /// The string may contain email addresses and URLs, see the introduction for
3438 /// more details.
3439 ///
3440 /// See also:
3441 ///
3442 /// * [`developers`][struct@crate::AboutWindow#developers]
3443 /// * [`designers`][struct@crate::AboutWindow#designers]
3444 /// * [`artists`][struct@crate::AboutWindow#artists]
3445 /// * [`documenters`][struct@crate::AboutWindow#documenters]
3446 /// * [`AboutWindow::add_credit_section()`][crate::AboutWindow::add_credit_section()]
3447 /// * [`AboutWindow::add_acknowledgement_section()`][crate::AboutWindow::add_acknowledgement_section()]
3448 /// Use [`AboutDialog`][crate::AboutDialog].
3449 #[cfg(feature = "v1_2")]
3450 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3451 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3452 pub fn translator_credits(self, translator_credits: impl Into<glib::GString>) -> Self {
3453 Self {
3454 builder: self
3455 .builder
3456 .property("translator-credits", translator_credits.into()),
3457 }
3458 }
3459
3460 /// The version of the application.
3461 ///
3462 /// The version is displayed on the main page.
3463 ///
3464 /// If [`release-notes-version`][struct@crate::AboutWindow#release-notes-version] is not set, the version
3465 /// will also be displayed above the release notes on the What's New page.
3466 /// Use [`AboutDialog`][crate::AboutDialog].
3467 #[cfg(feature = "v1_2")]
3468 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3469 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3470 pub fn version(self, version: impl Into<glib::GString>) -> Self {
3471 Self {
3472 builder: self.builder.property("version", version.into()),
3473 }
3474 }
3475
3476 /// The URL of the application's website.
3477 ///
3478 /// Website is displayed on the Details page, below comments, or on the main
3479 /// page if the Details page doesn't have any other content.
3480 ///
3481 /// Applications can add other links below, see [`AboutWindow::add_link()`][crate::AboutWindow::add_link()].
3482 /// Use [`AboutDialog`][crate::AboutDialog].
3483 #[cfg(feature = "v1_2")]
3484 #[cfg_attr(docsrs, doc(cfg(feature = "v1_2")))]
3485 #[cfg_attr(feature = "v1_6", deprecated = "Since 1.6")]
3486 pub fn website(self, website: impl Into<glib::GString>) -> Self {
3487 Self {
3488 builder: self.builder.property("website", website.into()),
3489 }
3490 }
3491
3492 /// Whether adaptive preview is currently open.
3493 ///
3494 /// Adaptive preview is a debugging tool used for testing the window
3495 /// contents at specific screen sizes, simulating mobile environment.
3496 ///
3497 /// Adaptive preview can always be accessed from inspector. This function
3498 /// allows applications to open it manually.
3499 ///
3500 /// Most applications should not use this property.
3501 #[cfg(feature = "v1_7")]
3502 #[cfg_attr(docsrs, doc(cfg(feature = "v1_7")))]
3503 pub fn adaptive_preview(self, adaptive_preview: bool) -> Self {
3504 Self {
3505 builder: self.builder.property("adaptive-preview", adaptive_preview),
3506 }
3507 }
3508
3509 /// The content widget.
3510 ///
3511 /// This property should always be used instead of [`child`][struct@crate::gtk::Window#child].
3512 pub fn content(self, content: &impl IsA<gtk::Widget>) -> Self {
3513 Self {
3514 builder: self.builder.property("content", content.clone().upcast()),
3515 }
3516 }
3517
3518 /// The [`gtk::Application`][crate::gtk::Application] associated with the window.
3519 ///
3520 /// The application will be kept alive for at least as long as it
3521 /// has any windows associated with it (see g_application_hold()
3522 /// for a way to keep it alive without windows).
3523 ///
3524 /// Normally, the connection between the application and the window
3525 /// will remain until the window is destroyed, but you can explicitly
3526 /// remove it by setting the this property to `NULL`.
3527 pub fn application(self, application: &impl IsA<gtk::Application>) -> Self {
3528 Self {
3529 builder: self
3530 .builder
3531 .property("application", application.clone().upcast()),
3532 }
3533 }
3534
3535 /// Whether the window should have a frame (also known as *decorations*).
3536 pub fn decorated(self, decorated: bool) -> Self {
3537 Self {
3538 builder: self.builder.property("decorated", decorated),
3539 }
3540 }
3541
3542 /// The default height of the window.
3543 pub fn default_height(self, default_height: i32) -> Self {
3544 Self {
3545 builder: self.builder.property("default-height", default_height),
3546 }
3547 }
3548
3549 /// The default widget.
3550 pub fn default_widget(self, default_widget: &impl IsA<gtk::Widget>) -> Self {
3551 Self {
3552 builder: self
3553 .builder
3554 .property("default-widget", default_widget.clone().upcast()),
3555 }
3556 }
3557
3558 /// The default width of the window.
3559 pub fn default_width(self, default_width: i32) -> Self {
3560 Self {
3561 builder: self.builder.property("default-width", default_width),
3562 }
3563 }
3564
3565 /// Whether the window frame should have a close button.
3566 pub fn deletable(self, deletable: bool) -> Self {
3567 Self {
3568 builder: self.builder.property("deletable", deletable),
3569 }
3570 }
3571
3572 /// If this window should be destroyed when the parent is destroyed.
3573 pub fn destroy_with_parent(self, destroy_with_parent: bool) -> Self {
3574 Self {
3575 builder: self
3576 .builder
3577 .property("destroy-with-parent", destroy_with_parent),
3578 }
3579 }
3580
3581 /// The display that will display this window.
3582 pub fn display(self, display: &gdk::Display) -> Self {
3583 Self {
3584 builder: self.builder.property("display", display.clone()),
3585 }
3586 }
3587
3588 /// Whether 'focus rectangles' are currently visible in this window.
3589 ///
3590 /// This property is maintained by GTK based on user input
3591 /// and should not be set by applications.
3592 pub fn focus_visible(self, focus_visible: bool) -> Self {
3593 Self {
3594 builder: self.builder.property("focus-visible", focus_visible),
3595 }
3596 }
3597
3598 /// The focus widget.
3599 pub fn focus_widget(self, focus_widget: &impl IsA<gtk::Widget>) -> Self {
3600 Self {
3601 builder: self
3602 .builder
3603 .property("focus-widget", focus_widget.clone().upcast()),
3604 }
3605 }
3606
3607 /// Whether the window is fullscreen.
3608 ///
3609 /// Setting this property is the equivalent of calling
3610 /// [`GtkWindowExtManual::fullscreen()`][crate::gtk::prelude::GtkWindowExtManual::fullscreen()] or [`GtkWindowExtManual::unfullscreen()`][crate::gtk::prelude::GtkWindowExtManual::unfullscreen()];
3611 /// either operation is asynchronous, which means you will need to
3612 /// connect to the ::notify signal in order to know whether the
3613 /// operation was successful.
3614 pub fn fullscreened(self, fullscreened: bool) -> Self {
3615 Self {
3616 builder: self.builder.property("fullscreened", fullscreened),
3617 }
3618 }
3619
3620 /// The gravity to use when resizing the window programmatically.
3621 ///
3622 /// Gravity describes which point of the window we want to keep
3623 /// fixed (meaning that the window will grow in the opposite direction).
3624 /// For example, a gravity of `GTK_WINDOW_GRAVITY_TOP_RIGHT` means that we
3625 /// want the to fix top right corner of the window.
3626 #[cfg(feature = "gtk_v4_20")]
3627 #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_20")))]
3628 pub fn gravity(self, gravity: gtk::WindowGravity) -> Self {
3629 Self {
3630 builder: self.builder.property("gravity", gravity),
3631 }
3632 }
3633
3634 /// Whether the window frame should handle <kbd>F10</kbd> for activating
3635 /// menubars.
3636 #[cfg(feature = "gtk_v4_2")]
3637 #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_2")))]
3638 pub fn handle_menubar_accel(self, handle_menubar_accel: bool) -> Self {
3639 Self {
3640 builder: self
3641 .builder
3642 .property("handle-menubar-accel", handle_menubar_accel),
3643 }
3644 }
3645
3646 /// If this window should be hidden instead of destroyed when the user clicks
3647 /// the close button.
3648 pub fn hide_on_close(self, hide_on_close: bool) -> Self {
3649 Self {
3650 builder: self.builder.property("hide-on-close", hide_on_close),
3651 }
3652 }
3653
3654 /// Specifies the name of the themed icon to use as the window icon.
3655 ///
3656 /// See `Gtk::IconTheme` for more details.
3657 pub fn icon_name(self, icon_name: impl Into<glib::GString>) -> Self {
3658 Self {
3659 builder: self.builder.property("icon-name", icon_name.into()),
3660 }
3661 }
3662
3663 /// Whether the window is maximized.
3664 ///
3665 /// Setting this property is the equivalent of calling
3666 /// [`GtkWindowExtManual::maximize()`][crate::gtk::prelude::GtkWindowExtManual::maximize()] or [`GtkWindowExtManual::unmaximize()`][crate::gtk::prelude::GtkWindowExtManual::unmaximize()];
3667 /// either operation is asynchronous, which means you will need to
3668 /// connect to the ::notify signal in order to know whether the
3669 /// operation was successful.
3670 pub fn maximized(self, maximized: bool) -> Self {
3671 Self {
3672 builder: self.builder.property("maximized", maximized),
3673 }
3674 }
3675
3676 /// Whether mnemonics are currently visible in this window.
3677 ///
3678 /// This property is maintained by GTK based on user input,
3679 /// and should not be set by applications.
3680 pub fn mnemonics_visible(self, mnemonics_visible: bool) -> Self {
3681 Self {
3682 builder: self
3683 .builder
3684 .property("mnemonics-visible", mnemonics_visible),
3685 }
3686 }
3687
3688 /// If true, the window is modal.
3689 pub fn modal(self, modal: bool) -> Self {
3690 Self {
3691 builder: self.builder.property("modal", modal),
3692 }
3693 }
3694
3695 /// If true, users can resize the window.
3696 pub fn resizable(self, resizable: bool) -> Self {
3697 Self {
3698 builder: self.builder.property("resizable", resizable),
3699 }
3700 }
3701
3702 /// A write-only property for setting window's startup notification identifier.
3703 pub fn startup_id(self, startup_id: impl Into<glib::GString>) -> Self {
3704 Self {
3705 builder: self.builder.property("startup-id", startup_id.into()),
3706 }
3707 }
3708
3709 /// The title of the window.
3710 pub fn title(self, title: impl Into<glib::GString>) -> Self {
3711 Self {
3712 builder: self.builder.property("title", title.into()),
3713 }
3714 }
3715
3716 /// The titlebar widget.
3717 #[cfg(feature = "gtk_v4_6")]
3718 #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_6")))]
3719 pub fn titlebar(self, titlebar: &impl IsA<gtk::Widget>) -> Self {
3720 Self {
3721 builder: self.builder.property("titlebar", titlebar.clone().upcast()),
3722 }
3723 }
3724
3725 /// The transient parent of the window.
3726 pub fn transient_for(self, transient_for: &impl IsA<gtk::Window>) -> Self {
3727 Self {
3728 builder: self
3729 .builder
3730 .property("transient-for", transient_for.clone().upcast()),
3731 }
3732 }
3733
3734 /// Whether the widget or any of its descendents can accept
3735 /// the input focus.
3736 ///
3737 /// This property is meant to be set by widget implementations,
3738 /// typically in their instance init function.
3739 pub fn can_focus(self, can_focus: bool) -> Self {
3740 Self {
3741 builder: self.builder.property("can-focus", can_focus),
3742 }
3743 }
3744
3745 /// Whether the widget can receive pointer events.
3746 pub fn can_target(self, can_target: bool) -> Self {
3747 Self {
3748 builder: self.builder.property("can-target", can_target),
3749 }
3750 }
3751
3752 /// A list of css classes applied to this widget.
3753 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
3754 Self {
3755 builder: self.builder.property("css-classes", css_classes.into()),
3756 }
3757 }
3758
3759 /// The name of this widget in the CSS tree.
3760 ///
3761 /// This property is meant to be set by widget implementations,
3762 /// typically in their instance init function.
3763 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
3764 Self {
3765 builder: self.builder.property("css-name", css_name.into()),
3766 }
3767 }
3768
3769 /// The cursor used by @widget.
3770 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
3771 Self {
3772 builder: self.builder.property("cursor", cursor.clone()),
3773 }
3774 }
3775
3776 /// Whether the widget should grab focus when it is clicked with the mouse.
3777 ///
3778 /// This property is only relevant for widgets that can take focus.
3779 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
3780 Self {
3781 builder: self.builder.property("focus-on-click", focus_on_click),
3782 }
3783 }
3784
3785 /// Whether this widget itself will accept the input focus.
3786 pub fn focusable(self, focusable: bool) -> Self {
3787 Self {
3788 builder: self.builder.property("focusable", focusable),
3789 }
3790 }
3791
3792 /// How to distribute horizontal space if widget gets extra space.
3793 pub fn halign(self, halign: gtk::Align) -> Self {
3794 Self {
3795 builder: self.builder.property("halign", halign),
3796 }
3797 }
3798
3799 /// Enables or disables the emission of the [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip]
3800 /// signal on @widget.
3801 ///
3802 /// A true value indicates that @widget can have a tooltip, in this case
3803 /// the widget will be queried using [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] to
3804 /// determine whether it will provide a tooltip or not.
3805 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
3806 Self {
3807 builder: self.builder.property("has-tooltip", has_tooltip),
3808 }
3809 }
3810
3811 /// Overrides for height request of the widget.
3812 ///
3813 /// If this is -1, the natural request will be used.
3814 pub fn height_request(self, height_request: i32) -> Self {
3815 Self {
3816 builder: self.builder.property("height-request", height_request),
3817 }
3818 }
3819
3820 /// Whether to expand horizontally.
3821 pub fn hexpand(self, hexpand: bool) -> Self {
3822 Self {
3823 builder: self.builder.property("hexpand", hexpand),
3824 }
3825 }
3826
3827 /// Whether to use the `hexpand` property.
3828 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
3829 Self {
3830 builder: self.builder.property("hexpand-set", hexpand_set),
3831 }
3832 }
3833
3834 /// The [`gtk::LayoutManager`][crate::gtk::LayoutManager] instance to use to compute
3835 /// the preferred size of the widget, and allocate its children.
3836 ///
3837 /// This property is meant to be set by widget implementations,
3838 /// typically in their instance init function.
3839 pub fn layout_manager(self, layout_manager: &impl IsA<gtk::LayoutManager>) -> Self {
3840 Self {
3841 builder: self
3842 .builder
3843 .property("layout-manager", layout_manager.clone().upcast()),
3844 }
3845 }
3846
3847 /// Makes this widget act like a modal dialog, with respect to
3848 /// event delivery.
3849 ///
3850 /// Global event controllers will not handle events with targets
3851 /// inside the widget, unless they are set up to ignore propagation
3852 /// limits. See `Gtk::EventController::set_propagation_limit()`.
3853 #[cfg(feature = "gtk_v4_18")]
3854 #[cfg_attr(docsrs, doc(cfg(feature = "gtk_v4_18")))]
3855 pub fn limit_events(self, limit_events: bool) -> Self {
3856 Self {
3857 builder: self.builder.property("limit-events", limit_events),
3858 }
3859 }
3860
3861 /// Margin on bottom side of widget.
3862 ///
3863 /// This property adds margin outside of the widget's normal size
3864 /// request, the margin will be added in addition to the size from
3865 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
3866 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
3867 Self {
3868 builder: self.builder.property("margin-bottom", margin_bottom),
3869 }
3870 }
3871
3872 /// Margin on end of widget, horizontally.
3873 ///
3874 /// This property supports left-to-right and right-to-left text
3875 /// directions.
3876 ///
3877 /// This property adds margin outside of the widget's normal size
3878 /// request, the margin will be added in addition to the size from
3879 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
3880 pub fn margin_end(self, margin_end: i32) -> Self {
3881 Self {
3882 builder: self.builder.property("margin-end", margin_end),
3883 }
3884 }
3885
3886 /// Margin on start of widget, horizontally.
3887 ///
3888 /// This property supports left-to-right and right-to-left text
3889 /// directions.
3890 ///
3891 /// This property adds margin outside of the widget's normal size
3892 /// request, the margin will be added in addition to the size from
3893 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
3894 pub fn margin_start(self, margin_start: i32) -> Self {
3895 Self {
3896 builder: self.builder.property("margin-start", margin_start),
3897 }
3898 }
3899
3900 /// Margin on top side of widget.
3901 ///
3902 /// This property adds margin outside of the widget's normal size
3903 /// request, the margin will be added in addition to the size from
3904 /// [`WidgetExtManual::set_size_request()`][crate::gtk::prelude::WidgetExtManual::set_size_request()] for example.
3905 pub fn margin_top(self, margin_top: i32) -> Self {
3906 Self {
3907 builder: self.builder.property("margin-top", margin_top),
3908 }
3909 }
3910
3911 /// The name of the widget.
3912 pub fn name(self, name: impl Into<glib::GString>) -> Self {
3913 Self {
3914 builder: self.builder.property("name", name.into()),
3915 }
3916 }
3917
3918 /// The requested opacity of the widget.
3919 pub fn opacity(self, opacity: f64) -> Self {
3920 Self {
3921 builder: self.builder.property("opacity", opacity),
3922 }
3923 }
3924
3925 /// How content outside the widget's content area is treated.
3926 ///
3927 /// This property is meant to be set by widget implementations,
3928 /// typically in their instance init function.
3929 pub fn overflow(self, overflow: gtk::Overflow) -> Self {
3930 Self {
3931 builder: self.builder.property("overflow", overflow),
3932 }
3933 }
3934
3935 /// Whether the widget will receive the default action when it is focused.
3936 pub fn receives_default(self, receives_default: bool) -> Self {
3937 Self {
3938 builder: self.builder.property("receives-default", receives_default),
3939 }
3940 }
3941
3942 /// Whether the widget responds to input.
3943 pub fn sensitive(self, sensitive: bool) -> Self {
3944 Self {
3945 builder: self.builder.property("sensitive", sensitive),
3946 }
3947 }
3948
3949 /// Sets the text of tooltip to be the given string, which is marked up
3950 /// with Pango markup.
3951 ///
3952 /// Also see `Gtk::Tooltip::set_markup()`.
3953 ///
3954 /// This is a convenience property which will take care of getting the
3955 /// tooltip shown if the given string is not `NULL`:
3956 /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to true
3957 /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
3958 /// the default signal handler.
3959 ///
3960 /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
3961 /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
3962 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
3963 Self {
3964 builder: self
3965 .builder
3966 .property("tooltip-markup", tooltip_markup.into()),
3967 }
3968 }
3969
3970 /// Sets the text of tooltip to be the given string.
3971 ///
3972 /// Also see `Gtk::Tooltip::set_text()`.
3973 ///
3974 /// This is a convenience property which will take care of getting the
3975 /// tooltip shown if the given string is not `NULL`:
3976 /// [`has-tooltip`][struct@crate::gtk::Widget#has-tooltip] will automatically be set to true
3977 /// and there will be taken care of [`query-tooltip`][struct@crate::gtk::Widget#query-tooltip] in
3978 /// the default signal handler.
3979 ///
3980 /// Note that if both [`tooltip-text`][struct@crate::gtk::Widget#tooltip-text] and
3981 /// [`tooltip-markup`][struct@crate::gtk::Widget#tooltip-markup] are set, the last one wins.
3982 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
3983 Self {
3984 builder: self.builder.property("tooltip-text", tooltip_text.into()),
3985 }
3986 }
3987
3988 /// How to distribute vertical space if widget gets extra space.
3989 pub fn valign(self, valign: gtk::Align) -> Self {
3990 Self {
3991 builder: self.builder.property("valign", valign),
3992 }
3993 }
3994
3995 /// Whether to expand vertically.
3996 pub fn vexpand(self, vexpand: bool) -> Self {
3997 Self {
3998 builder: self.builder.property("vexpand", vexpand),
3999 }
4000 }
4001
4002 /// Whether to use the `vexpand` property.
4003 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
4004 Self {
4005 builder: self.builder.property("vexpand-set", vexpand_set),
4006 }
4007 }
4008
4009 /// Whether the widget is visible.
4010 pub fn visible(self, visible: bool) -> Self {
4011 Self {
4012 builder: self.builder.property("visible", visible),
4013 }
4014 }
4015
4016 /// Overrides for width request of the widget.
4017 ///
4018 /// If this is -1, the natural request will be used.
4019 pub fn width_request(self, width_request: i32) -> Self {
4020 Self {
4021 builder: self.builder.property("width-request", width_request),
4022 }
4023 }
4024
4025 /// The accessible role of the given [`gtk::Accessible`][crate::gtk::Accessible] implementation.
4026 ///
4027 /// The accessible role cannot be changed once set.
4028 pub fn accessible_role(self, accessible_role: gtk::AccessibleRole) -> Self {
4029 Self {
4030 builder: self.builder.property("accessible-role", accessible_role),
4031 }
4032 }
4033
4034 // rustdoc-stripper-ignore-next
4035 /// Build the [`AboutWindow`].
4036 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
4037 pub fn build(self) -> AboutWindow {
4038 assert_initialized_main_thread!();
4039 self.builder.build()
4040 }
4041}