gtk4/auto/settings.rs
1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5#[cfg(feature = "v4_16")]
6#[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
7use crate::FontRendering;
8use crate::{ffi, StyleProvider};
9use glib::{
10 prelude::*,
11 signal::{connect_raw, SignalHandlerId},
12 translate::*,
13};
14use std::boxed::Box as Box_;
15
16glib::wrapper! {
17 /// [`Settings`][crate::Settings] provides a mechanism to share global settings between
18 /// applications.
19 ///
20 /// On the X window system, this sharing is realized by an
21 /// [XSettings](http://www.freedesktop.org/wiki/Specifications/xsettings-spec)
22 /// manager that is usually part of the desktop environment, along with
23 /// utilities that let the user change these settings.
24 ///
25 /// On Wayland, the settings are obtained either via a settings portal,
26 /// or by reading desktop settings from `Gio::Settings`.
27 ///
28 /// On macOS, the settings are obtained from `NSUserDefaults`.
29 ///
30 /// In the absence of these sharing mechanisms, GTK reads default values for
31 /// settings from `settings.ini` files in `/etc/gtk-4.0`, `$XDG_CONFIG_DIRS/gtk-4.0`
32 /// and `$XDG_CONFIG_HOME/gtk-4.0`. These files must be valid key files (see
33 /// `GKeyFile`), and have a section called Settings. Themes can also provide
34 /// default values for settings by installing a `settings.ini` file
35 /// next to their `gtk.css` file.
36 ///
37 /// Applications can override system-wide settings by setting the property
38 /// of the [`Settings`][crate::Settings] object with g_object_set(). This should be restricted
39 /// to special cases though; [`Settings`][crate::Settings] are not meant as an application
40 /// configuration facility.
41 ///
42 /// There is one [`Settings`][crate::Settings] instance per display. It can be obtained with
43 /// [`for_display()`][Self::for_display()], but in many cases, it is more
44 /// convenient to use [`WidgetExt::settings()`][crate::prelude::WidgetExt::settings()].
45 ///
46 /// ## Properties
47 ///
48 ///
49 /// #### `gtk-alternative-button-order`
50 /// Whether buttons in dialogs should use the alternative button order.
51 ///
52 /// Readable | Writeable
53 ///
54 ///
55 /// #### `gtk-alternative-sort-arrows`
56 /// Controls the direction of the sort indicators in sorted list and tree
57 /// views.
58 ///
59 /// By default an arrow pointing down means the column is sorted
60 /// in ascending order. When set to [`true`], this order will be inverted.
61 ///
62 /// Readable | Writeable
63 ///
64 ///
65 /// #### `gtk-application-prefer-dark-theme`
66 /// Whether the application prefers to use a dark theme.
67 ///
68 /// If a GTK theme includes a dark variant, it will be used
69 /// instead of the configured theme.
70 ///
71 /// Some applications benefit from minimizing the amount of light
72 /// pollution that interferes with the content. Good candidates for
73 /// dark themes are photo and video editors that make the actual
74 /// content get all the attention and minimize the distraction of
75 /// the chrome.
76 ///
77 /// Dark themes should not be used for documents, where large spaces
78 /// are white/light and the dark chrome creates too much contrast
79 /// (web browser, text editor...).
80 ///
81 /// Readable | Writeable
82 ///
83 ///
84 /// #### `gtk-cursor-aspect-ratio`
85 /// The aspect ratio of the text caret.
86 ///
87 /// Readable | Writeable
88 ///
89 ///
90 /// #### `gtk-cursor-blink`
91 /// Whether the cursor should blink.
92 ///
93 /// Also see the [`gtk-cursor-blink-timeout`][struct@crate::Settings#gtk-cursor-blink-timeout] setting,
94 /// which allows more flexible control over cursor blinking.
95 ///
96 /// Readable | Writeable
97 ///
98 ///
99 /// #### `gtk-cursor-blink-time`
100 /// Length of the cursor blink cycle, in milliseconds.
101 ///
102 /// Readable | Writeable
103 ///
104 ///
105 /// #### `gtk-cursor-blink-timeout`
106 /// Time after which the cursor stops blinking, in seconds.
107 ///
108 /// The timer is reset after each user interaction.
109 ///
110 /// Setting this to zero has the same effect as setting
111 /// [`gtk-cursor-blink`][struct@crate::Settings#gtk-cursor-blink] to [`false`].
112 ///
113 /// Readable | Writeable
114 ///
115 ///
116 /// #### `gtk-cursor-theme-name`
117 /// Name of the cursor theme to use.
118 ///
119 /// Use [`None`] to use the default theme.
120 ///
121 /// Readable | Writeable
122 ///
123 ///
124 /// #### `gtk-cursor-theme-size`
125 /// The size to use for cursors.
126 ///
127 /// 0 means to use the default size.
128 ///
129 /// Readable | Writeable
130 ///
131 ///
132 /// #### `gtk-decoration-layout`
133 /// Determines which buttons should be put in the
134 /// titlebar of client-side decorated windows, and whether they
135 /// should be placed on the left or right.
136 ///
137 /// The format of the string is button names, separated by commas.
138 /// A colon separates the buttons that should appear on the left
139 /// from those on the right. Recognized button names are minimize,
140 /// maximize, close, icon (the window icon) and menu (a menu button
141 /// for the fallback app menu).
142 ///
143 /// For example, "menu:minimize,maximize,close" specifies a menu
144 /// on the left, and minimize, maximize and close buttons on the right.
145 ///
146 /// Note that buttons will only be shown when they are meaningful.
147 /// E.g. a menu button only appears when the desktop shell does not
148 /// show the app menu, and a close button only appears on a window
149 /// that can be closed.
150 ///
151 /// Also note that the setting can be overridden with the
152 /// [`decoration-layout`][struct@crate::HeaderBar#decoration-layout] property.
153 ///
154 /// Readable | Writeable
155 ///
156 ///
157 /// #### `gtk-dialogs-use-header`
158 /// Whether builtin GTK dialogs such as the file chooser, the
159 /// color chooser or the font chooser will use a header bar at
160 /// the top to show action widgets, or an action area at the bottom.
161 ///
162 /// This setting does not affect custom dialogs using [`Dialog`][crate::Dialog]
163 /// directly, or message dialogs.
164 ///
165 /// Readable | Writeable
166 ///
167 ///
168 /// #### `gtk-dnd-drag-threshold`
169 /// The number of pixels the cursor can move before dragging.
170 ///
171 /// Readable | Writeable
172 ///
173 ///
174 /// #### `gtk-double-click-distance`
175 /// The maximum distance allowed between two clicks for them to be considered
176 /// a double click, in pixels.
177 ///
178 /// Readable | Writeable
179 ///
180 ///
181 /// #### `gtk-double-click-time`
182 /// The maximum time to allow between two clicks for them to be considered
183 /// a double click, in milliseconds.
184 ///
185 /// Readable | Writeable
186 ///
187 ///
188 /// #### `gtk-enable-accels`
189 /// Whether menu items should have visible accelerators which can be
190 /// activated.
191 ///
192 /// Readable | Writeable
193 ///
194 ///
195 /// #### `gtk-enable-animations`
196 /// Whether to enable toolkit-wide animations.
197 ///
198 /// Readable | Writeable
199 ///
200 ///
201 /// #### `gtk-enable-event-sounds`
202 /// Whether to play any event sounds at all.
203 ///
204 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
205 /// for more information on event sounds and sound themes.
206 ///
207 /// GTK itself does not support event sounds, you have to use a loadable
208 /// module like the one that comes with libcanberra.
209 ///
210 /// Readable | Writeable
211 ///
212 ///
213 /// #### `gtk-enable-input-feedback-sounds`
214 /// Whether to play event sounds as feedback to user input.
215 ///
216 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
217 /// for more information on event sounds and sound themes.
218 ///
219 /// GTK itself does not support event sounds, you have to use a loadable
220 /// module like the one that comes with libcanberra.
221 ///
222 /// Readable | Writeable
223 ///
224 ///
225 /// #### `gtk-enable-primary-paste`
226 /// Whether a middle click on a mouse should paste the
227 /// 'PRIMARY' clipboard content at the cursor location.
228 ///
229 /// Readable | Writeable
230 ///
231 ///
232 /// #### `gtk-entry-password-hint-timeout`
233 /// How long to show the last input character in hidden
234 /// entries.
235 ///
236 /// This value is in milliseconds. 0 disables showing the
237 /// last char. 600 is a good value for enabling it.
238 ///
239 /// Readable | Writeable
240 ///
241 ///
242 /// #### `gtk-entry-select-on-focus`
243 /// Whether to select the contents of an entry when it is focused.
244 ///
245 /// Readable | Writeable
246 ///
247 ///
248 /// #### `gtk-error-bell`
249 /// When [`true`], keyboard navigation and other input-related errors
250 /// will cause a beep.
251 ///
252 /// Since the error bell is implemented using gdk_surface_beep(), the
253 /// windowing system may offer ways to configure the error bell in many
254 /// ways, such as flashing the window or similar visual effects.
255 ///
256 /// Readable | Writeable
257 ///
258 ///
259 /// #### `gtk-font-name`
260 /// The default font to use.
261 ///
262 /// GTK uses the family name and size from this string.
263 ///
264 /// Readable | Writeable
265 ///
266 ///
267 /// #### `gtk-font-rendering`
268 /// How GTK font rendering is set up.
269 ///
270 /// When set to [enum@Gtk.FontRendering.MANUAL], GTK respects the low-level
271 /// font-related settings ([`gtk-hint-font-metrics`][struct@crate::Settings#gtk-hint-font-metrics],
272 /// [`gtk-xft-antialias`][struct@crate::Settings#gtk-xft-antialias], [`gtk-xft-hinting`][struct@crate::Settings#gtk-xft-hinting],
273 /// [`gtk-xft-hintstyle`][struct@crate::Settings#gtk-xft-hintstyle] and [`gtk-xft-rgba`][struct@crate::Settings#gtk-xft-rgba])
274 /// as much as practical.
275 ///
276 /// When set to [enum@Gtk.FontRendering.AUTOMATIC], GTK will consider factors such
277 /// as screen resolution and scale in deciding how to render fonts.
278 ///
279 /// Readable | Writeable
280 ///
281 ///
282 /// #### `gtk-fontconfig-timestamp`
283 /// Timestamp of the current fontconfig configuration.
284 ///
285 /// Readable | Writeable
286 ///
287 ///
288 /// #### `gtk-hint-font-metrics`
289 /// Whether hinting should be applied to font metrics.
290 ///
291 /// Note that this also turns off subpixel positioning of glyphs,
292 /// since it conflicts with metrics hinting.
293 ///
294 /// Readable | Writeable
295 ///
296 ///
297 /// #### `gtk-icon-theme-name`
298 /// Name of the icon theme to use.
299 ///
300 /// See [`IconTheme`][crate::IconTheme] for details about how
301 /// GTK handles icon themes.
302 ///
303 /// Readable | Writeable
304 ///
305 ///
306 /// #### `gtk-im-module`
307 /// Which IM (input method) module should be used by default.
308 ///
309 /// This is the input method that will be used if the user has not
310 /// explicitly chosen another input method from the IM context menu.
311 /// This also can be a colon-separated list of input methods, which GTK
312 /// will try in turn until it finds one available on the system.
313 ///
314 /// See [`IMContext`][crate::IMContext].
315 ///
316 /// Readable | Writeable
317 ///
318 ///
319 /// #### `gtk-keynav-use-caret`
320 /// Whether GTK should make sure that text can be navigated with
321 /// a caret, even if it is not editable.
322 ///
323 /// This is useful when using a screen reader.
324 ///
325 /// Readable | Writeable
326 ///
327 ///
328 /// #### `gtk-label-select-on-focus`
329 /// Whether to select the contents of a selectable
330 /// label when it is focused.
331 ///
332 /// Readable | Writeable
333 ///
334 ///
335 /// #### `gtk-long-press-time`
336 /// The time for a button or touch press to be considered a “long press”.
337 ///
338 /// See [`GestureLongPress`][crate::GestureLongPress].
339 ///
340 /// Readable | Writeable
341 ///
342 ///
343 /// #### `gtk-overlay-scrolling`
344 /// Whether scrolled windows may use overlaid scrolling indicators.
345 ///
346 /// If this is set to [`false`], scrolled windows will have permanent
347 /// scrollbars.
348 ///
349 /// Readable | Writeable
350 ///
351 ///
352 /// #### `gtk-primary-button-warps-slider`
353 /// If the value of this setting is [`true`], clicking the primary button in a
354 /// [`Range`][crate::Range] trough will move the slider, and hence set the range’s value, to
355 /// the point that you clicked.
356 ///
357 /// If it is [`false`], a primary click will cause the slider/value to move
358 /// by the range’s page-size towards the point clicked.
359 ///
360 /// Whichever action you choose for the primary button, the other action will
361 /// be available by holding Shift and primary-clicking, or clicking the middle
362 /// mouse button.
363 ///
364 /// Readable | Writeable
365 ///
366 ///
367 /// #### `gtk-print-backends`
368 /// A comma-separated list of print backends to use in the print
369 /// dialog.
370 ///
371 /// Available print backends depend on the GTK installation,
372 /// and may include "file", "cups", "lpr" or "papi".
373 ///
374 /// Readable | Writeable
375 ///
376 ///
377 /// #### `gtk-print-preview-command`
378 /// A command to run for displaying the print preview.
379 ///
380 /// The command should contain a ``f`` placeholder, which will get
381 /// replaced by the path to the pdf file. The command may also
382 /// contain a ``s`` placeholder, which will get replaced by the
383 /// path to a file containing the print settings in the format
384 /// produced by [`PrintSettings::to_file()`][crate::PrintSettings::to_file()].
385 ///
386 /// The preview application is responsible for removing the pdf
387 /// file and the print settings file when it is done.
388 ///
389 /// Readable | Writeable
390 ///
391 ///
392 /// #### `gtk-recent-files-enabled`
393 /// Whether GTK should keep track of items inside the recently used
394 /// resources list.
395 ///
396 /// If set to [`false`], the list will always be empty.
397 ///
398 /// Readable | Writeable
399 ///
400 ///
401 /// #### `gtk-recent-files-max-age`
402 /// The maximum age, in days, of the items inside the recently used
403 /// resources list.
404 ///
405 /// Items older than this setting will be excised from the list.
406 /// If set to 0, the list will always be empty; if set to -1, no
407 /// item will be removed.
408 ///
409 /// Readable | Writeable
410 ///
411 ///
412 /// #### `gtk-shell-shows-app-menu`
413 /// Set to [`true`] if the desktop environment is displaying
414 /// the app menu, [`false`] if the app should display it itself.
415 ///
416 /// Readable | Writeable
417 ///
418 ///
419 /// #### `gtk-shell-shows-desktop`
420 /// Set to [`true`] if the desktop environment is displaying
421 /// the desktop folder, [`false`] if not.
422 ///
423 /// Readable | Writeable
424 ///
425 ///
426 /// #### `gtk-shell-shows-menubar`
427 /// Set to [`true`] if the desktop environment is displaying
428 /// the menubar, [`false`] if the app should display it itself.
429 ///
430 /// Readable | Writeable
431 ///
432 ///
433 /// #### `gtk-show-status-shapes`
434 /// When [`true`], widgets like switches include shapes to indicate their on/off state.
435 ///
436 /// Readable | Writeable
437 ///
438 ///
439 /// #### `gtk-sound-theme-name`
440 /// The XDG sound theme to use for event sounds.
441 ///
442 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
443 /// for more information on event sounds and sound themes.
444 ///
445 /// GTK itself does not support event sounds, you have to use
446 /// a loadable module like the one that comes with libcanberra.
447 ///
448 /// Readable | Writeable
449 ///
450 ///
451 /// #### `gtk-split-cursor`
452 /// Whether two cursors should be displayed for mixed left-to-right and
453 /// right-to-left text.
454 ///
455 /// Readable | Writeable
456 ///
457 ///
458 /// #### `gtk-theme-name`
459 /// Name of the theme to load.
460 ///
461 /// See [`CssProvider`][crate::CssProvider] for details about how
462 /// GTK finds the CSS stylesheet for a theme.
463 ///
464 /// Readable | Writeable
465 ///
466 ///
467 /// #### `gtk-titlebar-double-click`
468 /// Determines the action to take when a double-click
469 /// occurs on the titlebar of client-side decorated windows.
470 ///
471 /// Recognized actions are minimize, toggle-maximize, menu, lower
472 /// or none.
473 ///
474 /// Readable | Writeable
475 ///
476 ///
477 /// #### `gtk-titlebar-middle-click`
478 /// Determines the action to take when a middle-click
479 /// occurs on the titlebar of client-side decorated windows.
480 ///
481 /// Recognized actions are minimize, toggle-maximize, menu, lower
482 /// or none.
483 ///
484 /// Readable | Writeable
485 ///
486 ///
487 /// #### `gtk-titlebar-right-click`
488 /// Determines the action to take when a right-click
489 /// occurs on the titlebar of client-side decorated windows.
490 ///
491 /// Recognized actions are minimize, toggle-maximize, menu, lower
492 /// or none.
493 ///
494 /// Readable | Writeable
495 ///
496 ///
497 /// #### `gtk-xft-antialias`
498 /// Whether to antialias fonts.
499 ///
500 /// The values are 0 for no, 1 for yes, or -1 for the system default.
501 ///
502 /// Readable | Writeable
503 ///
504 ///
505 /// #### `gtk-xft-dpi`
506 /// The font resolution, in 1024 * dots/inch.
507 ///
508 /// -1 to use the default value.
509 ///
510 /// Readable | Writeable
511 ///
512 ///
513 /// #### `gtk-xft-hinting`
514 /// Whether to enable font hinting.
515 ///
516 /// The values are 0 for no, 1 for yes, or -1 for the system default.
517 ///
518 /// Readable | Writeable
519 ///
520 ///
521 /// #### `gtk-xft-hintstyle`
522 /// What degree of font hinting to use.
523 ///
524 /// The possible vaues are hintnone, hintslight,
525 /// hintmedium, hintfull.
526 ///
527 /// Readable | Writeable
528 ///
529 ///
530 /// #### `gtk-xft-rgba`
531 /// The type of subpixel antialiasing to use.
532 ///
533 /// The possible values are none, rgb, bgr, vrgb, vbgr.
534 ///
535 /// Note that GSK does not support subpixel antialiasing, and this
536 /// setting has no effect on font rendering in GTK.
537 ///
538 /// Readable | Writeable
539 ///
540 /// # Implements
541 ///
542 /// [`trait@glib::ObjectExt`], [`StyleProviderExt`][trait@crate::prelude::StyleProviderExt]
543 #[doc(alias = "GtkSettings")]
544 pub struct Settings(Object<ffi::GtkSettings>) @implements StyleProvider;
545
546 match fn {
547 type_ => || ffi::gtk_settings_get_type(),
548 }
549}
550
551impl Settings {
552 // rustdoc-stripper-ignore-next
553 /// Creates a new builder-pattern struct instance to construct [`Settings`] objects.
554 ///
555 /// This method returns an instance of [`SettingsBuilder`](crate::builders::SettingsBuilder) which can be used to create [`Settings`] objects.
556 pub fn builder() -> SettingsBuilder {
557 SettingsBuilder::new()
558 }
559
560 /// Undoes the effect of calling g_object_set() to install an
561 /// application-specific value for a setting.
562 ///
563 /// After this call, the setting will again follow the session-wide
564 /// value for this setting.
565 /// ## `name`
566 /// the name of the setting to reset
567 #[doc(alias = "gtk_settings_reset_property")]
568 pub fn reset_property(&self, name: &str) {
569 unsafe {
570 ffi::gtk_settings_reset_property(self.to_glib_none().0, name.to_glib_none().0);
571 }
572 }
573
574 /// Whether buttons in dialogs should use the alternative button order.
575 #[doc(alias = "gtk-alternative-button-order")]
576 pub fn is_gtk_alternative_button_order(&self) -> bool {
577 ObjectExt::property(self, "gtk-alternative-button-order")
578 }
579
580 /// Whether buttons in dialogs should use the alternative button order.
581 #[doc(alias = "gtk-alternative-button-order")]
582 pub fn set_gtk_alternative_button_order(&self, gtk_alternative_button_order: bool) {
583 ObjectExt::set_property(
584 self,
585 "gtk-alternative-button-order",
586 gtk_alternative_button_order,
587 )
588 }
589
590 /// Controls the direction of the sort indicators in sorted list and tree
591 /// views.
592 ///
593 /// By default an arrow pointing down means the column is sorted
594 /// in ascending order. When set to [`true`], this order will be inverted.
595 #[doc(alias = "gtk-alternative-sort-arrows")]
596 pub fn is_gtk_alternative_sort_arrows(&self) -> bool {
597 ObjectExt::property(self, "gtk-alternative-sort-arrows")
598 }
599
600 /// Controls the direction of the sort indicators in sorted list and tree
601 /// views.
602 ///
603 /// By default an arrow pointing down means the column is sorted
604 /// in ascending order. When set to [`true`], this order will be inverted.
605 #[doc(alias = "gtk-alternative-sort-arrows")]
606 pub fn set_gtk_alternative_sort_arrows(&self, gtk_alternative_sort_arrows: bool) {
607 ObjectExt::set_property(
608 self,
609 "gtk-alternative-sort-arrows",
610 gtk_alternative_sort_arrows,
611 )
612 }
613
614 /// Whether the application prefers to use a dark theme.
615 ///
616 /// If a GTK theme includes a dark variant, it will be used
617 /// instead of the configured theme.
618 ///
619 /// Some applications benefit from minimizing the amount of light
620 /// pollution that interferes with the content. Good candidates for
621 /// dark themes are photo and video editors that make the actual
622 /// content get all the attention and minimize the distraction of
623 /// the chrome.
624 ///
625 /// Dark themes should not be used for documents, where large spaces
626 /// are white/light and the dark chrome creates too much contrast
627 /// (web browser, text editor...).
628 #[doc(alias = "gtk-application-prefer-dark-theme")]
629 pub fn is_gtk_application_prefer_dark_theme(&self) -> bool {
630 ObjectExt::property(self, "gtk-application-prefer-dark-theme")
631 }
632
633 /// Whether the application prefers to use a dark theme.
634 ///
635 /// If a GTK theme includes a dark variant, it will be used
636 /// instead of the configured theme.
637 ///
638 /// Some applications benefit from minimizing the amount of light
639 /// pollution that interferes with the content. Good candidates for
640 /// dark themes are photo and video editors that make the actual
641 /// content get all the attention and minimize the distraction of
642 /// the chrome.
643 ///
644 /// Dark themes should not be used for documents, where large spaces
645 /// are white/light and the dark chrome creates too much contrast
646 /// (web browser, text editor...).
647 #[doc(alias = "gtk-application-prefer-dark-theme")]
648 pub fn set_gtk_application_prefer_dark_theme(&self, gtk_application_prefer_dark_theme: bool) {
649 ObjectExt::set_property(
650 self,
651 "gtk-application-prefer-dark-theme",
652 gtk_application_prefer_dark_theme,
653 )
654 }
655
656 /// The aspect ratio of the text caret.
657 #[doc(alias = "gtk-cursor-aspect-ratio")]
658 pub fn gtk_cursor_aspect_ratio(&self) -> f64 {
659 ObjectExt::property(self, "gtk-cursor-aspect-ratio")
660 }
661
662 /// The aspect ratio of the text caret.
663 #[doc(alias = "gtk-cursor-aspect-ratio")]
664 pub fn set_gtk_cursor_aspect_ratio(&self, gtk_cursor_aspect_ratio: f64) {
665 ObjectExt::set_property(self, "gtk-cursor-aspect-ratio", gtk_cursor_aspect_ratio)
666 }
667
668 /// Whether the cursor should blink.
669 ///
670 /// Also see the [`gtk-cursor-blink-timeout`][struct@crate::Settings#gtk-cursor-blink-timeout] setting,
671 /// which allows more flexible control over cursor blinking.
672 #[doc(alias = "gtk-cursor-blink")]
673 pub fn is_gtk_cursor_blink(&self) -> bool {
674 ObjectExt::property(self, "gtk-cursor-blink")
675 }
676
677 /// Whether the cursor should blink.
678 ///
679 /// Also see the [`gtk-cursor-blink-timeout`][struct@crate::Settings#gtk-cursor-blink-timeout] setting,
680 /// which allows more flexible control over cursor blinking.
681 #[doc(alias = "gtk-cursor-blink")]
682 pub fn set_gtk_cursor_blink(&self, gtk_cursor_blink: bool) {
683 ObjectExt::set_property(self, "gtk-cursor-blink", gtk_cursor_blink)
684 }
685
686 /// Length of the cursor blink cycle, in milliseconds.
687 #[doc(alias = "gtk-cursor-blink-time")]
688 pub fn gtk_cursor_blink_time(&self) -> i32 {
689 ObjectExt::property(self, "gtk-cursor-blink-time")
690 }
691
692 /// Length of the cursor blink cycle, in milliseconds.
693 #[doc(alias = "gtk-cursor-blink-time")]
694 pub fn set_gtk_cursor_blink_time(&self, gtk_cursor_blink_time: i32) {
695 ObjectExt::set_property(self, "gtk-cursor-blink-time", gtk_cursor_blink_time)
696 }
697
698 /// Time after which the cursor stops blinking, in seconds.
699 ///
700 /// The timer is reset after each user interaction.
701 ///
702 /// Setting this to zero has the same effect as setting
703 /// [`gtk-cursor-blink`][struct@crate::Settings#gtk-cursor-blink] to [`false`].
704 #[doc(alias = "gtk-cursor-blink-timeout")]
705 pub fn gtk_cursor_blink_timeout(&self) -> i32 {
706 ObjectExt::property(self, "gtk-cursor-blink-timeout")
707 }
708
709 /// Time after which the cursor stops blinking, in seconds.
710 ///
711 /// The timer is reset after each user interaction.
712 ///
713 /// Setting this to zero has the same effect as setting
714 /// [`gtk-cursor-blink`][struct@crate::Settings#gtk-cursor-blink] to [`false`].
715 #[doc(alias = "gtk-cursor-blink-timeout")]
716 pub fn set_gtk_cursor_blink_timeout(&self, gtk_cursor_blink_timeout: i32) {
717 ObjectExt::set_property(self, "gtk-cursor-blink-timeout", gtk_cursor_blink_timeout)
718 }
719
720 /// Name of the cursor theme to use.
721 ///
722 /// Use [`None`] to use the default theme.
723 #[doc(alias = "gtk-cursor-theme-name")]
724 pub fn gtk_cursor_theme_name(&self) -> Option<glib::GString> {
725 ObjectExt::property(self, "gtk-cursor-theme-name")
726 }
727
728 /// Name of the cursor theme to use.
729 ///
730 /// Use [`None`] to use the default theme.
731 #[doc(alias = "gtk-cursor-theme-name")]
732 pub fn set_gtk_cursor_theme_name(&self, gtk_cursor_theme_name: Option<&str>) {
733 ObjectExt::set_property(self, "gtk-cursor-theme-name", gtk_cursor_theme_name)
734 }
735
736 /// The size to use for cursors.
737 ///
738 /// 0 means to use the default size.
739 #[doc(alias = "gtk-cursor-theme-size")]
740 pub fn gtk_cursor_theme_size(&self) -> i32 {
741 ObjectExt::property(self, "gtk-cursor-theme-size")
742 }
743
744 /// The size to use for cursors.
745 ///
746 /// 0 means to use the default size.
747 #[doc(alias = "gtk-cursor-theme-size")]
748 pub fn set_gtk_cursor_theme_size(&self, gtk_cursor_theme_size: i32) {
749 ObjectExt::set_property(self, "gtk-cursor-theme-size", gtk_cursor_theme_size)
750 }
751
752 /// Determines which buttons should be put in the
753 /// titlebar of client-side decorated windows, and whether they
754 /// should be placed on the left or right.
755 ///
756 /// The format of the string is button names, separated by commas.
757 /// A colon separates the buttons that should appear on the left
758 /// from those on the right. Recognized button names are minimize,
759 /// maximize, close, icon (the window icon) and menu (a menu button
760 /// for the fallback app menu).
761 ///
762 /// For example, "menu:minimize,maximize,close" specifies a menu
763 /// on the left, and minimize, maximize and close buttons on the right.
764 ///
765 /// Note that buttons will only be shown when they are meaningful.
766 /// E.g. a menu button only appears when the desktop shell does not
767 /// show the app menu, and a close button only appears on a window
768 /// that can be closed.
769 ///
770 /// Also note that the setting can be overridden with the
771 /// [`decoration-layout`][struct@crate::HeaderBar#decoration-layout] property.
772 #[doc(alias = "gtk-decoration-layout")]
773 pub fn gtk_decoration_layout(&self) -> Option<glib::GString> {
774 ObjectExt::property(self, "gtk-decoration-layout")
775 }
776
777 /// Determines which buttons should be put in the
778 /// titlebar of client-side decorated windows, and whether they
779 /// should be placed on the left or right.
780 ///
781 /// The format of the string is button names, separated by commas.
782 /// A colon separates the buttons that should appear on the left
783 /// from those on the right. Recognized button names are minimize,
784 /// maximize, close, icon (the window icon) and menu (a menu button
785 /// for the fallback app menu).
786 ///
787 /// For example, "menu:minimize,maximize,close" specifies a menu
788 /// on the left, and minimize, maximize and close buttons on the right.
789 ///
790 /// Note that buttons will only be shown when they are meaningful.
791 /// E.g. a menu button only appears when the desktop shell does not
792 /// show the app menu, and a close button only appears on a window
793 /// that can be closed.
794 ///
795 /// Also note that the setting can be overridden with the
796 /// [`decoration-layout`][struct@crate::HeaderBar#decoration-layout] property.
797 #[doc(alias = "gtk-decoration-layout")]
798 pub fn set_gtk_decoration_layout(&self, gtk_decoration_layout: Option<&str>) {
799 ObjectExt::set_property(self, "gtk-decoration-layout", gtk_decoration_layout)
800 }
801
802 /// Whether builtin GTK dialogs such as the file chooser, the
803 /// color chooser or the font chooser will use a header bar at
804 /// the top to show action widgets, or an action area at the bottom.
805 ///
806 /// This setting does not affect custom dialogs using [`Dialog`][crate::Dialog]
807 /// directly, or message dialogs.
808 #[doc(alias = "gtk-dialogs-use-header")]
809 pub fn is_gtk_dialogs_use_header(&self) -> bool {
810 ObjectExt::property(self, "gtk-dialogs-use-header")
811 }
812
813 /// Whether builtin GTK dialogs such as the file chooser, the
814 /// color chooser or the font chooser will use a header bar at
815 /// the top to show action widgets, or an action area at the bottom.
816 ///
817 /// This setting does not affect custom dialogs using [`Dialog`][crate::Dialog]
818 /// directly, or message dialogs.
819 #[doc(alias = "gtk-dialogs-use-header")]
820 pub fn set_gtk_dialogs_use_header(&self, gtk_dialogs_use_header: bool) {
821 ObjectExt::set_property(self, "gtk-dialogs-use-header", gtk_dialogs_use_header)
822 }
823
824 /// The number of pixels the cursor can move before dragging.
825 #[doc(alias = "gtk-dnd-drag-threshold")]
826 pub fn gtk_dnd_drag_threshold(&self) -> i32 {
827 ObjectExt::property(self, "gtk-dnd-drag-threshold")
828 }
829
830 /// The number of pixels the cursor can move before dragging.
831 #[doc(alias = "gtk-dnd-drag-threshold")]
832 pub fn set_gtk_dnd_drag_threshold(&self, gtk_dnd_drag_threshold: i32) {
833 ObjectExt::set_property(self, "gtk-dnd-drag-threshold", gtk_dnd_drag_threshold)
834 }
835
836 /// The maximum distance allowed between two clicks for them to be considered
837 /// a double click, in pixels.
838 #[doc(alias = "gtk-double-click-distance")]
839 pub fn gtk_double_click_distance(&self) -> i32 {
840 ObjectExt::property(self, "gtk-double-click-distance")
841 }
842
843 /// The maximum distance allowed between two clicks for them to be considered
844 /// a double click, in pixels.
845 #[doc(alias = "gtk-double-click-distance")]
846 pub fn set_gtk_double_click_distance(&self, gtk_double_click_distance: i32) {
847 ObjectExt::set_property(self, "gtk-double-click-distance", gtk_double_click_distance)
848 }
849
850 /// The maximum time to allow between two clicks for them to be considered
851 /// a double click, in milliseconds.
852 #[doc(alias = "gtk-double-click-time")]
853 pub fn gtk_double_click_time(&self) -> i32 {
854 ObjectExt::property(self, "gtk-double-click-time")
855 }
856
857 /// The maximum time to allow between two clicks for them to be considered
858 /// a double click, in milliseconds.
859 #[doc(alias = "gtk-double-click-time")]
860 pub fn set_gtk_double_click_time(&self, gtk_double_click_time: i32) {
861 ObjectExt::set_property(self, "gtk-double-click-time", gtk_double_click_time)
862 }
863
864 /// Whether menu items should have visible accelerators which can be
865 /// activated.
866 #[doc(alias = "gtk-enable-accels")]
867 pub fn is_gtk_enable_accels(&self) -> bool {
868 ObjectExt::property(self, "gtk-enable-accels")
869 }
870
871 /// Whether menu items should have visible accelerators which can be
872 /// activated.
873 #[doc(alias = "gtk-enable-accels")]
874 pub fn set_gtk_enable_accels(&self, gtk_enable_accels: bool) {
875 ObjectExt::set_property(self, "gtk-enable-accels", gtk_enable_accels)
876 }
877
878 /// Whether to enable toolkit-wide animations.
879 #[doc(alias = "gtk-enable-animations")]
880 pub fn is_gtk_enable_animations(&self) -> bool {
881 ObjectExt::property(self, "gtk-enable-animations")
882 }
883
884 /// Whether to enable toolkit-wide animations.
885 #[doc(alias = "gtk-enable-animations")]
886 pub fn set_gtk_enable_animations(&self, gtk_enable_animations: bool) {
887 ObjectExt::set_property(self, "gtk-enable-animations", gtk_enable_animations)
888 }
889
890 /// Whether to play any event sounds at all.
891 ///
892 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
893 /// for more information on event sounds and sound themes.
894 ///
895 /// GTK itself does not support event sounds, you have to use a loadable
896 /// module like the one that comes with libcanberra.
897 #[doc(alias = "gtk-enable-event-sounds")]
898 pub fn is_gtk_enable_event_sounds(&self) -> bool {
899 ObjectExt::property(self, "gtk-enable-event-sounds")
900 }
901
902 /// Whether to play any event sounds at all.
903 ///
904 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
905 /// for more information on event sounds and sound themes.
906 ///
907 /// GTK itself does not support event sounds, you have to use a loadable
908 /// module like the one that comes with libcanberra.
909 #[doc(alias = "gtk-enable-event-sounds")]
910 pub fn set_gtk_enable_event_sounds(&self, gtk_enable_event_sounds: bool) {
911 ObjectExt::set_property(self, "gtk-enable-event-sounds", gtk_enable_event_sounds)
912 }
913
914 /// Whether to play event sounds as feedback to user input.
915 ///
916 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
917 /// for more information on event sounds and sound themes.
918 ///
919 /// GTK itself does not support event sounds, you have to use a loadable
920 /// module like the one that comes with libcanberra.
921 #[doc(alias = "gtk-enable-input-feedback-sounds")]
922 pub fn is_gtk_enable_input_feedback_sounds(&self) -> bool {
923 ObjectExt::property(self, "gtk-enable-input-feedback-sounds")
924 }
925
926 /// Whether to play event sounds as feedback to user input.
927 ///
928 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
929 /// for more information on event sounds and sound themes.
930 ///
931 /// GTK itself does not support event sounds, you have to use a loadable
932 /// module like the one that comes with libcanberra.
933 #[doc(alias = "gtk-enable-input-feedback-sounds")]
934 pub fn set_gtk_enable_input_feedback_sounds(&self, gtk_enable_input_feedback_sounds: bool) {
935 ObjectExt::set_property(
936 self,
937 "gtk-enable-input-feedback-sounds",
938 gtk_enable_input_feedback_sounds,
939 )
940 }
941
942 /// Whether a middle click on a mouse should paste the
943 /// 'PRIMARY' clipboard content at the cursor location.
944 #[doc(alias = "gtk-enable-primary-paste")]
945 pub fn is_gtk_enable_primary_paste(&self) -> bool {
946 ObjectExt::property(self, "gtk-enable-primary-paste")
947 }
948
949 /// Whether a middle click on a mouse should paste the
950 /// 'PRIMARY' clipboard content at the cursor location.
951 #[doc(alias = "gtk-enable-primary-paste")]
952 pub fn set_gtk_enable_primary_paste(&self, gtk_enable_primary_paste: bool) {
953 ObjectExt::set_property(self, "gtk-enable-primary-paste", gtk_enable_primary_paste)
954 }
955
956 /// How long to show the last input character in hidden
957 /// entries.
958 ///
959 /// This value is in milliseconds. 0 disables showing the
960 /// last char. 600 is a good value for enabling it.
961 #[doc(alias = "gtk-entry-password-hint-timeout")]
962 pub fn gtk_entry_password_hint_timeout(&self) -> u32 {
963 ObjectExt::property(self, "gtk-entry-password-hint-timeout")
964 }
965
966 /// How long to show the last input character in hidden
967 /// entries.
968 ///
969 /// This value is in milliseconds. 0 disables showing the
970 /// last char. 600 is a good value for enabling it.
971 #[doc(alias = "gtk-entry-password-hint-timeout")]
972 pub fn set_gtk_entry_password_hint_timeout(&self, gtk_entry_password_hint_timeout: u32) {
973 ObjectExt::set_property(
974 self,
975 "gtk-entry-password-hint-timeout",
976 gtk_entry_password_hint_timeout,
977 )
978 }
979
980 /// Whether to select the contents of an entry when it is focused.
981 #[doc(alias = "gtk-entry-select-on-focus")]
982 pub fn is_gtk_entry_select_on_focus(&self) -> bool {
983 ObjectExt::property(self, "gtk-entry-select-on-focus")
984 }
985
986 /// Whether to select the contents of an entry when it is focused.
987 #[doc(alias = "gtk-entry-select-on-focus")]
988 pub fn set_gtk_entry_select_on_focus(&self, gtk_entry_select_on_focus: bool) {
989 ObjectExt::set_property(self, "gtk-entry-select-on-focus", gtk_entry_select_on_focus)
990 }
991
992 /// When [`true`], keyboard navigation and other input-related errors
993 /// will cause a beep.
994 ///
995 /// Since the error bell is implemented using gdk_surface_beep(), the
996 /// windowing system may offer ways to configure the error bell in many
997 /// ways, such as flashing the window or similar visual effects.
998 #[doc(alias = "gtk-error-bell")]
999 pub fn is_gtk_error_bell(&self) -> bool {
1000 ObjectExt::property(self, "gtk-error-bell")
1001 }
1002
1003 /// When [`true`], keyboard navigation and other input-related errors
1004 /// will cause a beep.
1005 ///
1006 /// Since the error bell is implemented using gdk_surface_beep(), the
1007 /// windowing system may offer ways to configure the error bell in many
1008 /// ways, such as flashing the window or similar visual effects.
1009 #[doc(alias = "gtk-error-bell")]
1010 pub fn set_gtk_error_bell(&self, gtk_error_bell: bool) {
1011 ObjectExt::set_property(self, "gtk-error-bell", gtk_error_bell)
1012 }
1013
1014 /// The default font to use.
1015 ///
1016 /// GTK uses the family name and size from this string.
1017 #[doc(alias = "gtk-font-name")]
1018 pub fn gtk_font_name(&self) -> Option<glib::GString> {
1019 ObjectExt::property(self, "gtk-font-name")
1020 }
1021
1022 /// The default font to use.
1023 ///
1024 /// GTK uses the family name and size from this string.
1025 #[doc(alias = "gtk-font-name")]
1026 pub fn set_gtk_font_name(&self, gtk_font_name: Option<&str>) {
1027 ObjectExt::set_property(self, "gtk-font-name", gtk_font_name)
1028 }
1029
1030 /// How GTK font rendering is set up.
1031 ///
1032 /// When set to [enum@Gtk.FontRendering.MANUAL], GTK respects the low-level
1033 /// font-related settings ([`gtk-hint-font-metrics`][struct@crate::Settings#gtk-hint-font-metrics],
1034 /// [`gtk-xft-antialias`][struct@crate::Settings#gtk-xft-antialias], [`gtk-xft-hinting`][struct@crate::Settings#gtk-xft-hinting],
1035 /// [`gtk-xft-hintstyle`][struct@crate::Settings#gtk-xft-hintstyle] and [`gtk-xft-rgba`][struct@crate::Settings#gtk-xft-rgba])
1036 /// as much as practical.
1037 ///
1038 /// When set to [enum@Gtk.FontRendering.AUTOMATIC], GTK will consider factors such
1039 /// as screen resolution and scale in deciding how to render fonts.
1040 #[cfg(feature = "v4_16")]
1041 #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
1042 #[doc(alias = "gtk-font-rendering")]
1043 pub fn gtk_font_rendering(&self) -> FontRendering {
1044 ObjectExt::property(self, "gtk-font-rendering")
1045 }
1046
1047 /// How GTK font rendering is set up.
1048 ///
1049 /// When set to [enum@Gtk.FontRendering.MANUAL], GTK respects the low-level
1050 /// font-related settings ([`gtk-hint-font-metrics`][struct@crate::Settings#gtk-hint-font-metrics],
1051 /// [`gtk-xft-antialias`][struct@crate::Settings#gtk-xft-antialias], [`gtk-xft-hinting`][struct@crate::Settings#gtk-xft-hinting],
1052 /// [`gtk-xft-hintstyle`][struct@crate::Settings#gtk-xft-hintstyle] and [`gtk-xft-rgba`][struct@crate::Settings#gtk-xft-rgba])
1053 /// as much as practical.
1054 ///
1055 /// When set to [enum@Gtk.FontRendering.AUTOMATIC], GTK will consider factors such
1056 /// as screen resolution and scale in deciding how to render fonts.
1057 #[cfg(feature = "v4_16")]
1058 #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
1059 #[doc(alias = "gtk-font-rendering")]
1060 pub fn set_gtk_font_rendering(&self, gtk_font_rendering: FontRendering) {
1061 ObjectExt::set_property(self, "gtk-font-rendering", gtk_font_rendering)
1062 }
1063
1064 /// Timestamp of the current fontconfig configuration.
1065 #[doc(alias = "gtk-fontconfig-timestamp")]
1066 pub fn gtk_fontconfig_timestamp(&self) -> u32 {
1067 ObjectExt::property(self, "gtk-fontconfig-timestamp")
1068 }
1069
1070 /// Timestamp of the current fontconfig configuration.
1071 #[doc(alias = "gtk-fontconfig-timestamp")]
1072 pub fn set_gtk_fontconfig_timestamp(&self, gtk_fontconfig_timestamp: u32) {
1073 ObjectExt::set_property(self, "gtk-fontconfig-timestamp", gtk_fontconfig_timestamp)
1074 }
1075
1076 /// Whether hinting should be applied to font metrics.
1077 ///
1078 /// Note that this also turns off subpixel positioning of glyphs,
1079 /// since it conflicts with metrics hinting.
1080 #[cfg(feature = "v4_6")]
1081 #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
1082 #[doc(alias = "gtk-hint-font-metrics")]
1083 pub fn is_gtk_hint_font_metrics(&self) -> bool {
1084 ObjectExt::property(self, "gtk-hint-font-metrics")
1085 }
1086
1087 /// Whether hinting should be applied to font metrics.
1088 ///
1089 /// Note that this also turns off subpixel positioning of glyphs,
1090 /// since it conflicts with metrics hinting.
1091 #[cfg(feature = "v4_6")]
1092 #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
1093 #[doc(alias = "gtk-hint-font-metrics")]
1094 pub fn set_gtk_hint_font_metrics(&self, gtk_hint_font_metrics: bool) {
1095 ObjectExt::set_property(self, "gtk-hint-font-metrics", gtk_hint_font_metrics)
1096 }
1097
1098 /// Name of the icon theme to use.
1099 ///
1100 /// See [`IconTheme`][crate::IconTheme] for details about how
1101 /// GTK handles icon themes.
1102 #[doc(alias = "gtk-icon-theme-name")]
1103 pub fn gtk_icon_theme_name(&self) -> Option<glib::GString> {
1104 ObjectExt::property(self, "gtk-icon-theme-name")
1105 }
1106
1107 /// Name of the icon theme to use.
1108 ///
1109 /// See [`IconTheme`][crate::IconTheme] for details about how
1110 /// GTK handles icon themes.
1111 #[doc(alias = "gtk-icon-theme-name")]
1112 pub fn set_gtk_icon_theme_name(&self, gtk_icon_theme_name: Option<&str>) {
1113 ObjectExt::set_property(self, "gtk-icon-theme-name", gtk_icon_theme_name)
1114 }
1115
1116 /// Which IM (input method) module should be used by default.
1117 ///
1118 /// This is the input method that will be used if the user has not
1119 /// explicitly chosen another input method from the IM context menu.
1120 /// This also can be a colon-separated list of input methods, which GTK
1121 /// will try in turn until it finds one available on the system.
1122 ///
1123 /// See [`IMContext`][crate::IMContext].
1124 #[doc(alias = "gtk-im-module")]
1125 pub fn gtk_im_module(&self) -> Option<glib::GString> {
1126 ObjectExt::property(self, "gtk-im-module")
1127 }
1128
1129 /// Which IM (input method) module should be used by default.
1130 ///
1131 /// This is the input method that will be used if the user has not
1132 /// explicitly chosen another input method from the IM context menu.
1133 /// This also can be a colon-separated list of input methods, which GTK
1134 /// will try in turn until it finds one available on the system.
1135 ///
1136 /// See [`IMContext`][crate::IMContext].
1137 #[doc(alias = "gtk-im-module")]
1138 pub fn set_gtk_im_module(&self, gtk_im_module: Option<&str>) {
1139 ObjectExt::set_property(self, "gtk-im-module", gtk_im_module)
1140 }
1141
1142 /// Whether GTK should make sure that text can be navigated with
1143 /// a caret, even if it is not editable.
1144 ///
1145 /// This is useful when using a screen reader.
1146 #[doc(alias = "gtk-keynav-use-caret")]
1147 pub fn is_gtk_keynav_use_caret(&self) -> bool {
1148 ObjectExt::property(self, "gtk-keynav-use-caret")
1149 }
1150
1151 /// Whether GTK should make sure that text can be navigated with
1152 /// a caret, even if it is not editable.
1153 ///
1154 /// This is useful when using a screen reader.
1155 #[doc(alias = "gtk-keynav-use-caret")]
1156 pub fn set_gtk_keynav_use_caret(&self, gtk_keynav_use_caret: bool) {
1157 ObjectExt::set_property(self, "gtk-keynav-use-caret", gtk_keynav_use_caret)
1158 }
1159
1160 /// Whether to select the contents of a selectable
1161 /// label when it is focused.
1162 #[doc(alias = "gtk-label-select-on-focus")]
1163 pub fn is_gtk_label_select_on_focus(&self) -> bool {
1164 ObjectExt::property(self, "gtk-label-select-on-focus")
1165 }
1166
1167 /// Whether to select the contents of a selectable
1168 /// label when it is focused.
1169 #[doc(alias = "gtk-label-select-on-focus")]
1170 pub fn set_gtk_label_select_on_focus(&self, gtk_label_select_on_focus: bool) {
1171 ObjectExt::set_property(self, "gtk-label-select-on-focus", gtk_label_select_on_focus)
1172 }
1173
1174 /// The time for a button or touch press to be considered a “long press”.
1175 ///
1176 /// See [`GestureLongPress`][crate::GestureLongPress].
1177 #[doc(alias = "gtk-long-press-time")]
1178 pub fn gtk_long_press_time(&self) -> u32 {
1179 ObjectExt::property(self, "gtk-long-press-time")
1180 }
1181
1182 /// The time for a button or touch press to be considered a “long press”.
1183 ///
1184 /// See [`GestureLongPress`][crate::GestureLongPress].
1185 #[doc(alias = "gtk-long-press-time")]
1186 pub fn set_gtk_long_press_time(&self, gtk_long_press_time: u32) {
1187 ObjectExt::set_property(self, "gtk-long-press-time", gtk_long_press_time)
1188 }
1189
1190 /// Whether scrolled windows may use overlaid scrolling indicators.
1191 ///
1192 /// If this is set to [`false`], scrolled windows will have permanent
1193 /// scrollbars.
1194 #[doc(alias = "gtk-overlay-scrolling")]
1195 pub fn is_gtk_overlay_scrolling(&self) -> bool {
1196 ObjectExt::property(self, "gtk-overlay-scrolling")
1197 }
1198
1199 /// Whether scrolled windows may use overlaid scrolling indicators.
1200 ///
1201 /// If this is set to [`false`], scrolled windows will have permanent
1202 /// scrollbars.
1203 #[doc(alias = "gtk-overlay-scrolling")]
1204 pub fn set_gtk_overlay_scrolling(&self, gtk_overlay_scrolling: bool) {
1205 ObjectExt::set_property(self, "gtk-overlay-scrolling", gtk_overlay_scrolling)
1206 }
1207
1208 /// If the value of this setting is [`true`], clicking the primary button in a
1209 /// [`Range`][crate::Range] trough will move the slider, and hence set the range’s value, to
1210 /// the point that you clicked.
1211 ///
1212 /// If it is [`false`], a primary click will cause the slider/value to move
1213 /// by the range’s page-size towards the point clicked.
1214 ///
1215 /// Whichever action you choose for the primary button, the other action will
1216 /// be available by holding Shift and primary-clicking, or clicking the middle
1217 /// mouse button.
1218 #[doc(alias = "gtk-primary-button-warps-slider")]
1219 pub fn is_gtk_primary_button_warps_slider(&self) -> bool {
1220 ObjectExt::property(self, "gtk-primary-button-warps-slider")
1221 }
1222
1223 /// If the value of this setting is [`true`], clicking the primary button in a
1224 /// [`Range`][crate::Range] trough will move the slider, and hence set the range’s value, to
1225 /// the point that you clicked.
1226 ///
1227 /// If it is [`false`], a primary click will cause the slider/value to move
1228 /// by the range’s page-size towards the point clicked.
1229 ///
1230 /// Whichever action you choose for the primary button, the other action will
1231 /// be available by holding Shift and primary-clicking, or clicking the middle
1232 /// mouse button.
1233 #[doc(alias = "gtk-primary-button-warps-slider")]
1234 pub fn set_gtk_primary_button_warps_slider(&self, gtk_primary_button_warps_slider: bool) {
1235 ObjectExt::set_property(
1236 self,
1237 "gtk-primary-button-warps-slider",
1238 gtk_primary_button_warps_slider,
1239 )
1240 }
1241
1242 /// A comma-separated list of print backends to use in the print
1243 /// dialog.
1244 ///
1245 /// Available print backends depend on the GTK installation,
1246 /// and may include "file", "cups", "lpr" or "papi".
1247 #[doc(alias = "gtk-print-backends")]
1248 pub fn gtk_print_backends(&self) -> Option<glib::GString> {
1249 ObjectExt::property(self, "gtk-print-backends")
1250 }
1251
1252 /// A comma-separated list of print backends to use in the print
1253 /// dialog.
1254 ///
1255 /// Available print backends depend on the GTK installation,
1256 /// and may include "file", "cups", "lpr" or "papi".
1257 #[doc(alias = "gtk-print-backends")]
1258 pub fn set_gtk_print_backends(&self, gtk_print_backends: Option<&str>) {
1259 ObjectExt::set_property(self, "gtk-print-backends", gtk_print_backends)
1260 }
1261
1262 /// A command to run for displaying the print preview.
1263 ///
1264 /// The command should contain a ``f`` placeholder, which will get
1265 /// replaced by the path to the pdf file. The command may also
1266 /// contain a ``s`` placeholder, which will get replaced by the
1267 /// path to a file containing the print settings in the format
1268 /// produced by [`PrintSettings::to_file()`][crate::PrintSettings::to_file()].
1269 ///
1270 /// The preview application is responsible for removing the pdf
1271 /// file and the print settings file when it is done.
1272 #[doc(alias = "gtk-print-preview-command")]
1273 pub fn gtk_print_preview_command(&self) -> Option<glib::GString> {
1274 ObjectExt::property(self, "gtk-print-preview-command")
1275 }
1276
1277 /// A command to run for displaying the print preview.
1278 ///
1279 /// The command should contain a ``f`` placeholder, which will get
1280 /// replaced by the path to the pdf file. The command may also
1281 /// contain a ``s`` placeholder, which will get replaced by the
1282 /// path to a file containing the print settings in the format
1283 /// produced by [`PrintSettings::to_file()`][crate::PrintSettings::to_file()].
1284 ///
1285 /// The preview application is responsible for removing the pdf
1286 /// file and the print settings file when it is done.
1287 #[doc(alias = "gtk-print-preview-command")]
1288 pub fn set_gtk_print_preview_command(&self, gtk_print_preview_command: Option<&str>) {
1289 ObjectExt::set_property(self, "gtk-print-preview-command", gtk_print_preview_command)
1290 }
1291
1292 /// Whether GTK should keep track of items inside the recently used
1293 /// resources list.
1294 ///
1295 /// If set to [`false`], the list will always be empty.
1296 #[doc(alias = "gtk-recent-files-enabled")]
1297 pub fn is_gtk_recent_files_enabled(&self) -> bool {
1298 ObjectExt::property(self, "gtk-recent-files-enabled")
1299 }
1300
1301 /// Whether GTK should keep track of items inside the recently used
1302 /// resources list.
1303 ///
1304 /// If set to [`false`], the list will always be empty.
1305 #[doc(alias = "gtk-recent-files-enabled")]
1306 pub fn set_gtk_recent_files_enabled(&self, gtk_recent_files_enabled: bool) {
1307 ObjectExt::set_property(self, "gtk-recent-files-enabled", gtk_recent_files_enabled)
1308 }
1309
1310 /// The maximum age, in days, of the items inside the recently used
1311 /// resources list.
1312 ///
1313 /// Items older than this setting will be excised from the list.
1314 /// If set to 0, the list will always be empty; if set to -1, no
1315 /// item will be removed.
1316 #[doc(alias = "gtk-recent-files-max-age")]
1317 pub fn gtk_recent_files_max_age(&self) -> i32 {
1318 ObjectExt::property(self, "gtk-recent-files-max-age")
1319 }
1320
1321 /// The maximum age, in days, of the items inside the recently used
1322 /// resources list.
1323 ///
1324 /// Items older than this setting will be excised from the list.
1325 /// If set to 0, the list will always be empty; if set to -1, no
1326 /// item will be removed.
1327 #[doc(alias = "gtk-recent-files-max-age")]
1328 pub fn set_gtk_recent_files_max_age(&self, gtk_recent_files_max_age: i32) {
1329 ObjectExt::set_property(self, "gtk-recent-files-max-age", gtk_recent_files_max_age)
1330 }
1331
1332 /// Set to [`true`] if the desktop environment is displaying
1333 /// the app menu, [`false`] if the app should display it itself.
1334 #[doc(alias = "gtk-shell-shows-app-menu")]
1335 pub fn is_gtk_shell_shows_app_menu(&self) -> bool {
1336 ObjectExt::property(self, "gtk-shell-shows-app-menu")
1337 }
1338
1339 /// Set to [`true`] if the desktop environment is displaying
1340 /// the app menu, [`false`] if the app should display it itself.
1341 #[doc(alias = "gtk-shell-shows-app-menu")]
1342 pub fn set_gtk_shell_shows_app_menu(&self, gtk_shell_shows_app_menu: bool) {
1343 ObjectExt::set_property(self, "gtk-shell-shows-app-menu", gtk_shell_shows_app_menu)
1344 }
1345
1346 /// Set to [`true`] if the desktop environment is displaying
1347 /// the desktop folder, [`false`] if not.
1348 #[doc(alias = "gtk-shell-shows-desktop")]
1349 pub fn is_gtk_shell_shows_desktop(&self) -> bool {
1350 ObjectExt::property(self, "gtk-shell-shows-desktop")
1351 }
1352
1353 /// Set to [`true`] if the desktop environment is displaying
1354 /// the desktop folder, [`false`] if not.
1355 #[doc(alias = "gtk-shell-shows-desktop")]
1356 pub fn set_gtk_shell_shows_desktop(&self, gtk_shell_shows_desktop: bool) {
1357 ObjectExt::set_property(self, "gtk-shell-shows-desktop", gtk_shell_shows_desktop)
1358 }
1359
1360 /// Set to [`true`] if the desktop environment is displaying
1361 /// the menubar, [`false`] if the app should display it itself.
1362 #[doc(alias = "gtk-shell-shows-menubar")]
1363 pub fn is_gtk_shell_shows_menubar(&self) -> bool {
1364 ObjectExt::property(self, "gtk-shell-shows-menubar")
1365 }
1366
1367 /// Set to [`true`] if the desktop environment is displaying
1368 /// the menubar, [`false`] if the app should display it itself.
1369 #[doc(alias = "gtk-shell-shows-menubar")]
1370 pub fn set_gtk_shell_shows_menubar(&self, gtk_shell_shows_menubar: bool) {
1371 ObjectExt::set_property(self, "gtk-shell-shows-menubar", gtk_shell_shows_menubar)
1372 }
1373
1374 /// When [`true`], widgets like switches include shapes to indicate their on/off state.
1375 #[cfg(feature = "v4_14")]
1376 #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1377 #[doc(alias = "gtk-show-status-shapes")]
1378 pub fn is_gtk_show_status_shapes(&self) -> bool {
1379 ObjectExt::property(self, "gtk-show-status-shapes")
1380 }
1381
1382 /// When [`true`], widgets like switches include shapes to indicate their on/off state.
1383 #[cfg(feature = "v4_14")]
1384 #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
1385 #[doc(alias = "gtk-show-status-shapes")]
1386 pub fn set_gtk_show_status_shapes(&self, gtk_show_status_shapes: bool) {
1387 ObjectExt::set_property(self, "gtk-show-status-shapes", gtk_show_status_shapes)
1388 }
1389
1390 /// The XDG sound theme to use for event sounds.
1391 ///
1392 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
1393 /// for more information on event sounds and sound themes.
1394 ///
1395 /// GTK itself does not support event sounds, you have to use
1396 /// a loadable module like the one that comes with libcanberra.
1397 #[doc(alias = "gtk-sound-theme-name")]
1398 pub fn gtk_sound_theme_name(&self) -> Option<glib::GString> {
1399 ObjectExt::property(self, "gtk-sound-theme-name")
1400 }
1401
1402 /// The XDG sound theme to use for event sounds.
1403 ///
1404 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
1405 /// for more information on event sounds and sound themes.
1406 ///
1407 /// GTK itself does not support event sounds, you have to use
1408 /// a loadable module like the one that comes with libcanberra.
1409 #[doc(alias = "gtk-sound-theme-name")]
1410 pub fn set_gtk_sound_theme_name(&self, gtk_sound_theme_name: Option<&str>) {
1411 ObjectExt::set_property(self, "gtk-sound-theme-name", gtk_sound_theme_name)
1412 }
1413
1414 /// Whether two cursors should be displayed for mixed left-to-right and
1415 /// right-to-left text.
1416 #[doc(alias = "gtk-split-cursor")]
1417 pub fn is_gtk_split_cursor(&self) -> bool {
1418 ObjectExt::property(self, "gtk-split-cursor")
1419 }
1420
1421 /// Whether two cursors should be displayed for mixed left-to-right and
1422 /// right-to-left text.
1423 #[doc(alias = "gtk-split-cursor")]
1424 pub fn set_gtk_split_cursor(&self, gtk_split_cursor: bool) {
1425 ObjectExt::set_property(self, "gtk-split-cursor", gtk_split_cursor)
1426 }
1427
1428 /// Name of the theme to load.
1429 ///
1430 /// See [`CssProvider`][crate::CssProvider] for details about how
1431 /// GTK finds the CSS stylesheet for a theme.
1432 #[doc(alias = "gtk-theme-name")]
1433 pub fn gtk_theme_name(&self) -> Option<glib::GString> {
1434 ObjectExt::property(self, "gtk-theme-name")
1435 }
1436
1437 /// Name of the theme to load.
1438 ///
1439 /// See [`CssProvider`][crate::CssProvider] for details about how
1440 /// GTK finds the CSS stylesheet for a theme.
1441 #[doc(alias = "gtk-theme-name")]
1442 pub fn set_gtk_theme_name(&self, gtk_theme_name: Option<&str>) {
1443 ObjectExt::set_property(self, "gtk-theme-name", gtk_theme_name)
1444 }
1445
1446 /// Determines the action to take when a double-click
1447 /// occurs on the titlebar of client-side decorated windows.
1448 ///
1449 /// Recognized actions are minimize, toggle-maximize, menu, lower
1450 /// or none.
1451 #[doc(alias = "gtk-titlebar-double-click")]
1452 pub fn gtk_titlebar_double_click(&self) -> Option<glib::GString> {
1453 ObjectExt::property(self, "gtk-titlebar-double-click")
1454 }
1455
1456 /// Determines the action to take when a double-click
1457 /// occurs on the titlebar of client-side decorated windows.
1458 ///
1459 /// Recognized actions are minimize, toggle-maximize, menu, lower
1460 /// or none.
1461 #[doc(alias = "gtk-titlebar-double-click")]
1462 pub fn set_gtk_titlebar_double_click(&self, gtk_titlebar_double_click: Option<&str>) {
1463 ObjectExt::set_property(self, "gtk-titlebar-double-click", gtk_titlebar_double_click)
1464 }
1465
1466 /// Determines the action to take when a middle-click
1467 /// occurs on the titlebar of client-side decorated windows.
1468 ///
1469 /// Recognized actions are minimize, toggle-maximize, menu, lower
1470 /// or none.
1471 #[doc(alias = "gtk-titlebar-middle-click")]
1472 pub fn gtk_titlebar_middle_click(&self) -> Option<glib::GString> {
1473 ObjectExt::property(self, "gtk-titlebar-middle-click")
1474 }
1475
1476 /// Determines the action to take when a middle-click
1477 /// occurs on the titlebar of client-side decorated windows.
1478 ///
1479 /// Recognized actions are minimize, toggle-maximize, menu, lower
1480 /// or none.
1481 #[doc(alias = "gtk-titlebar-middle-click")]
1482 pub fn set_gtk_titlebar_middle_click(&self, gtk_titlebar_middle_click: Option<&str>) {
1483 ObjectExt::set_property(self, "gtk-titlebar-middle-click", gtk_titlebar_middle_click)
1484 }
1485
1486 /// Determines the action to take when a right-click
1487 /// occurs on the titlebar of client-side decorated windows.
1488 ///
1489 /// Recognized actions are minimize, toggle-maximize, menu, lower
1490 /// or none.
1491 #[doc(alias = "gtk-titlebar-right-click")]
1492 pub fn gtk_titlebar_right_click(&self) -> Option<glib::GString> {
1493 ObjectExt::property(self, "gtk-titlebar-right-click")
1494 }
1495
1496 /// Determines the action to take when a right-click
1497 /// occurs on the titlebar of client-side decorated windows.
1498 ///
1499 /// Recognized actions are minimize, toggle-maximize, menu, lower
1500 /// or none.
1501 #[doc(alias = "gtk-titlebar-right-click")]
1502 pub fn set_gtk_titlebar_right_click(&self, gtk_titlebar_right_click: Option<&str>) {
1503 ObjectExt::set_property(self, "gtk-titlebar-right-click", gtk_titlebar_right_click)
1504 }
1505
1506 /// Whether to antialias fonts.
1507 ///
1508 /// The values are 0 for no, 1 for yes, or -1 for the system default.
1509 #[doc(alias = "gtk-xft-antialias")]
1510 pub fn gtk_xft_antialias(&self) -> i32 {
1511 ObjectExt::property(self, "gtk-xft-antialias")
1512 }
1513
1514 /// Whether to antialias fonts.
1515 ///
1516 /// The values are 0 for no, 1 for yes, or -1 for the system default.
1517 #[doc(alias = "gtk-xft-antialias")]
1518 pub fn set_gtk_xft_antialias(&self, gtk_xft_antialias: i32) {
1519 ObjectExt::set_property(self, "gtk-xft-antialias", gtk_xft_antialias)
1520 }
1521
1522 /// The font resolution, in 1024 * dots/inch.
1523 ///
1524 /// -1 to use the default value.
1525 #[doc(alias = "gtk-xft-dpi")]
1526 pub fn gtk_xft_dpi(&self) -> i32 {
1527 ObjectExt::property(self, "gtk-xft-dpi")
1528 }
1529
1530 /// The font resolution, in 1024 * dots/inch.
1531 ///
1532 /// -1 to use the default value.
1533 #[doc(alias = "gtk-xft-dpi")]
1534 pub fn set_gtk_xft_dpi(&self, gtk_xft_dpi: i32) {
1535 ObjectExt::set_property(self, "gtk-xft-dpi", gtk_xft_dpi)
1536 }
1537
1538 /// Whether to enable font hinting.
1539 ///
1540 /// The values are 0 for no, 1 for yes, or -1 for the system default.
1541 #[doc(alias = "gtk-xft-hinting")]
1542 pub fn gtk_xft_hinting(&self) -> i32 {
1543 ObjectExt::property(self, "gtk-xft-hinting")
1544 }
1545
1546 /// Whether to enable font hinting.
1547 ///
1548 /// The values are 0 for no, 1 for yes, or -1 for the system default.
1549 #[doc(alias = "gtk-xft-hinting")]
1550 pub fn set_gtk_xft_hinting(&self, gtk_xft_hinting: i32) {
1551 ObjectExt::set_property(self, "gtk-xft-hinting", gtk_xft_hinting)
1552 }
1553
1554 /// What degree of font hinting to use.
1555 ///
1556 /// The possible vaues are hintnone, hintslight,
1557 /// hintmedium, hintfull.
1558 #[doc(alias = "gtk-xft-hintstyle")]
1559 pub fn gtk_xft_hintstyle(&self) -> Option<glib::GString> {
1560 ObjectExt::property(self, "gtk-xft-hintstyle")
1561 }
1562
1563 /// What degree of font hinting to use.
1564 ///
1565 /// The possible vaues are hintnone, hintslight,
1566 /// hintmedium, hintfull.
1567 #[doc(alias = "gtk-xft-hintstyle")]
1568 pub fn set_gtk_xft_hintstyle(&self, gtk_xft_hintstyle: Option<&str>) {
1569 ObjectExt::set_property(self, "gtk-xft-hintstyle", gtk_xft_hintstyle)
1570 }
1571
1572 /// The type of subpixel antialiasing to use.
1573 ///
1574 /// The possible values are none, rgb, bgr, vrgb, vbgr.
1575 ///
1576 /// Note that GSK does not support subpixel antialiasing, and this
1577 /// setting has no effect on font rendering in GTK.
1578 #[doc(alias = "gtk-xft-rgba")]
1579 pub fn gtk_xft_rgba(&self) -> Option<glib::GString> {
1580 ObjectExt::property(self, "gtk-xft-rgba")
1581 }
1582
1583 /// The type of subpixel antialiasing to use.
1584 ///
1585 /// The possible values are none, rgb, bgr, vrgb, vbgr.
1586 ///
1587 /// Note that GSK does not support subpixel antialiasing, and this
1588 /// setting has no effect on font rendering in GTK.
1589 #[doc(alias = "gtk-xft-rgba")]
1590 pub fn set_gtk_xft_rgba(&self, gtk_xft_rgba: Option<&str>) {
1591 ObjectExt::set_property(self, "gtk-xft-rgba", gtk_xft_rgba)
1592 }
1593
1594 /// Gets the [`Settings`][crate::Settings] object for the default display, creating
1595 /// it if necessary.
1596 ///
1597 /// See [`for_display()`][Self::for_display()].
1598 ///
1599 /// # Returns
1600 ///
1601 /// a [`Settings`][crate::Settings] object. If there is
1602 /// no default display, then returns [`None`].
1603 #[doc(alias = "gtk_settings_get_default")]
1604 #[doc(alias = "get_default")]
1605 #[allow(clippy::should_implement_trait)]
1606 pub fn default() -> Option<Settings> {
1607 assert_initialized_main_thread!();
1608 unsafe { from_glib_none(ffi::gtk_settings_get_default()) }
1609 }
1610
1611 /// Gets the [`Settings`][crate::Settings] object for @display, creating it if necessary.
1612 /// ## `display`
1613 /// a [`gdk::Display`][crate::gdk::Display]
1614 ///
1615 /// # Returns
1616 ///
1617 /// a [`Settings`][crate::Settings] object
1618 #[doc(alias = "gtk_settings_get_for_display")]
1619 #[doc(alias = "get_for_display")]
1620 pub fn for_display(display: &impl IsA<gdk::Display>) -> Settings {
1621 assert_initialized_main_thread!();
1622 unsafe {
1623 from_glib_none(ffi::gtk_settings_get_for_display(
1624 display.as_ref().to_glib_none().0,
1625 ))
1626 }
1627 }
1628
1629 #[doc(alias = "gtk-alternative-button-order")]
1630 pub fn connect_gtk_alternative_button_order_notify<F: Fn(&Self) + 'static>(
1631 &self,
1632 f: F,
1633 ) -> SignalHandlerId {
1634 unsafe extern "C" fn notify_gtk_alternative_button_order_trampoline<
1635 F: Fn(&Settings) + 'static,
1636 >(
1637 this: *mut ffi::GtkSettings,
1638 _param_spec: glib::ffi::gpointer,
1639 f: glib::ffi::gpointer,
1640 ) {
1641 let f: &F = &*(f as *const F);
1642 f(&from_glib_borrow(this))
1643 }
1644 unsafe {
1645 let f: Box_<F> = Box_::new(f);
1646 connect_raw(
1647 self.as_ptr() as *mut _,
1648 b"notify::gtk-alternative-button-order\0".as_ptr() as *const _,
1649 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1650 notify_gtk_alternative_button_order_trampoline::<F> as *const (),
1651 )),
1652 Box_::into_raw(f),
1653 )
1654 }
1655 }
1656
1657 #[doc(alias = "gtk-alternative-sort-arrows")]
1658 pub fn connect_gtk_alternative_sort_arrows_notify<F: Fn(&Self) + 'static>(
1659 &self,
1660 f: F,
1661 ) -> SignalHandlerId {
1662 unsafe extern "C" fn notify_gtk_alternative_sort_arrows_trampoline<
1663 F: Fn(&Settings) + 'static,
1664 >(
1665 this: *mut ffi::GtkSettings,
1666 _param_spec: glib::ffi::gpointer,
1667 f: glib::ffi::gpointer,
1668 ) {
1669 let f: &F = &*(f as *const F);
1670 f(&from_glib_borrow(this))
1671 }
1672 unsafe {
1673 let f: Box_<F> = Box_::new(f);
1674 connect_raw(
1675 self.as_ptr() as *mut _,
1676 b"notify::gtk-alternative-sort-arrows\0".as_ptr() as *const _,
1677 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1678 notify_gtk_alternative_sort_arrows_trampoline::<F> as *const (),
1679 )),
1680 Box_::into_raw(f),
1681 )
1682 }
1683 }
1684
1685 #[doc(alias = "gtk-application-prefer-dark-theme")]
1686 pub fn connect_gtk_application_prefer_dark_theme_notify<F: Fn(&Self) + 'static>(
1687 &self,
1688 f: F,
1689 ) -> SignalHandlerId {
1690 unsafe extern "C" fn notify_gtk_application_prefer_dark_theme_trampoline<
1691 F: Fn(&Settings) + 'static,
1692 >(
1693 this: *mut ffi::GtkSettings,
1694 _param_spec: glib::ffi::gpointer,
1695 f: glib::ffi::gpointer,
1696 ) {
1697 let f: &F = &*(f as *const F);
1698 f(&from_glib_borrow(this))
1699 }
1700 unsafe {
1701 let f: Box_<F> = Box_::new(f);
1702 connect_raw(
1703 self.as_ptr() as *mut _,
1704 b"notify::gtk-application-prefer-dark-theme\0".as_ptr() as *const _,
1705 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1706 notify_gtk_application_prefer_dark_theme_trampoline::<F> as *const (),
1707 )),
1708 Box_::into_raw(f),
1709 )
1710 }
1711 }
1712
1713 #[doc(alias = "gtk-cursor-aspect-ratio")]
1714 pub fn connect_gtk_cursor_aspect_ratio_notify<F: Fn(&Self) + 'static>(
1715 &self,
1716 f: F,
1717 ) -> SignalHandlerId {
1718 unsafe extern "C" fn notify_gtk_cursor_aspect_ratio_trampoline<
1719 F: Fn(&Settings) + 'static,
1720 >(
1721 this: *mut ffi::GtkSettings,
1722 _param_spec: glib::ffi::gpointer,
1723 f: glib::ffi::gpointer,
1724 ) {
1725 let f: &F = &*(f as *const F);
1726 f(&from_glib_borrow(this))
1727 }
1728 unsafe {
1729 let f: Box_<F> = Box_::new(f);
1730 connect_raw(
1731 self.as_ptr() as *mut _,
1732 b"notify::gtk-cursor-aspect-ratio\0".as_ptr() as *const _,
1733 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1734 notify_gtk_cursor_aspect_ratio_trampoline::<F> as *const (),
1735 )),
1736 Box_::into_raw(f),
1737 )
1738 }
1739 }
1740
1741 #[doc(alias = "gtk-cursor-blink")]
1742 pub fn connect_gtk_cursor_blink_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1743 unsafe extern "C" fn notify_gtk_cursor_blink_trampoline<F: Fn(&Settings) + 'static>(
1744 this: *mut ffi::GtkSettings,
1745 _param_spec: glib::ffi::gpointer,
1746 f: glib::ffi::gpointer,
1747 ) {
1748 let f: &F = &*(f as *const F);
1749 f(&from_glib_borrow(this))
1750 }
1751 unsafe {
1752 let f: Box_<F> = Box_::new(f);
1753 connect_raw(
1754 self.as_ptr() as *mut _,
1755 b"notify::gtk-cursor-blink\0".as_ptr() as *const _,
1756 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1757 notify_gtk_cursor_blink_trampoline::<F> as *const (),
1758 )),
1759 Box_::into_raw(f),
1760 )
1761 }
1762 }
1763
1764 #[doc(alias = "gtk-cursor-blink-time")]
1765 pub fn connect_gtk_cursor_blink_time_notify<F: Fn(&Self) + 'static>(
1766 &self,
1767 f: F,
1768 ) -> SignalHandlerId {
1769 unsafe extern "C" fn notify_gtk_cursor_blink_time_trampoline<F: Fn(&Settings) + 'static>(
1770 this: *mut ffi::GtkSettings,
1771 _param_spec: glib::ffi::gpointer,
1772 f: glib::ffi::gpointer,
1773 ) {
1774 let f: &F = &*(f as *const F);
1775 f(&from_glib_borrow(this))
1776 }
1777 unsafe {
1778 let f: Box_<F> = Box_::new(f);
1779 connect_raw(
1780 self.as_ptr() as *mut _,
1781 b"notify::gtk-cursor-blink-time\0".as_ptr() as *const _,
1782 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1783 notify_gtk_cursor_blink_time_trampoline::<F> as *const (),
1784 )),
1785 Box_::into_raw(f),
1786 )
1787 }
1788 }
1789
1790 #[doc(alias = "gtk-cursor-blink-timeout")]
1791 pub fn connect_gtk_cursor_blink_timeout_notify<F: Fn(&Self) + 'static>(
1792 &self,
1793 f: F,
1794 ) -> SignalHandlerId {
1795 unsafe extern "C" fn notify_gtk_cursor_blink_timeout_trampoline<
1796 F: Fn(&Settings) + 'static,
1797 >(
1798 this: *mut ffi::GtkSettings,
1799 _param_spec: glib::ffi::gpointer,
1800 f: glib::ffi::gpointer,
1801 ) {
1802 let f: &F = &*(f as *const F);
1803 f(&from_glib_borrow(this))
1804 }
1805 unsafe {
1806 let f: Box_<F> = Box_::new(f);
1807 connect_raw(
1808 self.as_ptr() as *mut _,
1809 b"notify::gtk-cursor-blink-timeout\0".as_ptr() as *const _,
1810 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1811 notify_gtk_cursor_blink_timeout_trampoline::<F> as *const (),
1812 )),
1813 Box_::into_raw(f),
1814 )
1815 }
1816 }
1817
1818 #[doc(alias = "gtk-cursor-theme-name")]
1819 pub fn connect_gtk_cursor_theme_name_notify<F: Fn(&Self) + 'static>(
1820 &self,
1821 f: F,
1822 ) -> SignalHandlerId {
1823 unsafe extern "C" fn notify_gtk_cursor_theme_name_trampoline<F: Fn(&Settings) + 'static>(
1824 this: *mut ffi::GtkSettings,
1825 _param_spec: glib::ffi::gpointer,
1826 f: glib::ffi::gpointer,
1827 ) {
1828 let f: &F = &*(f as *const F);
1829 f(&from_glib_borrow(this))
1830 }
1831 unsafe {
1832 let f: Box_<F> = Box_::new(f);
1833 connect_raw(
1834 self.as_ptr() as *mut _,
1835 b"notify::gtk-cursor-theme-name\0".as_ptr() as *const _,
1836 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1837 notify_gtk_cursor_theme_name_trampoline::<F> as *const (),
1838 )),
1839 Box_::into_raw(f),
1840 )
1841 }
1842 }
1843
1844 #[doc(alias = "gtk-cursor-theme-size")]
1845 pub fn connect_gtk_cursor_theme_size_notify<F: Fn(&Self) + 'static>(
1846 &self,
1847 f: F,
1848 ) -> SignalHandlerId {
1849 unsafe extern "C" fn notify_gtk_cursor_theme_size_trampoline<F: Fn(&Settings) + 'static>(
1850 this: *mut ffi::GtkSettings,
1851 _param_spec: glib::ffi::gpointer,
1852 f: glib::ffi::gpointer,
1853 ) {
1854 let f: &F = &*(f as *const F);
1855 f(&from_glib_borrow(this))
1856 }
1857 unsafe {
1858 let f: Box_<F> = Box_::new(f);
1859 connect_raw(
1860 self.as_ptr() as *mut _,
1861 b"notify::gtk-cursor-theme-size\0".as_ptr() as *const _,
1862 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1863 notify_gtk_cursor_theme_size_trampoline::<F> as *const (),
1864 )),
1865 Box_::into_raw(f),
1866 )
1867 }
1868 }
1869
1870 #[doc(alias = "gtk-decoration-layout")]
1871 pub fn connect_gtk_decoration_layout_notify<F: Fn(&Self) + 'static>(
1872 &self,
1873 f: F,
1874 ) -> SignalHandlerId {
1875 unsafe extern "C" fn notify_gtk_decoration_layout_trampoline<F: Fn(&Settings) + 'static>(
1876 this: *mut ffi::GtkSettings,
1877 _param_spec: glib::ffi::gpointer,
1878 f: glib::ffi::gpointer,
1879 ) {
1880 let f: &F = &*(f as *const F);
1881 f(&from_glib_borrow(this))
1882 }
1883 unsafe {
1884 let f: Box_<F> = Box_::new(f);
1885 connect_raw(
1886 self.as_ptr() as *mut _,
1887 b"notify::gtk-decoration-layout\0".as_ptr() as *const _,
1888 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1889 notify_gtk_decoration_layout_trampoline::<F> as *const (),
1890 )),
1891 Box_::into_raw(f),
1892 )
1893 }
1894 }
1895
1896 #[doc(alias = "gtk-dialogs-use-header")]
1897 pub fn connect_gtk_dialogs_use_header_notify<F: Fn(&Self) + 'static>(
1898 &self,
1899 f: F,
1900 ) -> SignalHandlerId {
1901 unsafe extern "C" fn notify_gtk_dialogs_use_header_trampoline<
1902 F: Fn(&Settings) + 'static,
1903 >(
1904 this: *mut ffi::GtkSettings,
1905 _param_spec: glib::ffi::gpointer,
1906 f: glib::ffi::gpointer,
1907 ) {
1908 let f: &F = &*(f as *const F);
1909 f(&from_glib_borrow(this))
1910 }
1911 unsafe {
1912 let f: Box_<F> = Box_::new(f);
1913 connect_raw(
1914 self.as_ptr() as *mut _,
1915 b"notify::gtk-dialogs-use-header\0".as_ptr() as *const _,
1916 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1917 notify_gtk_dialogs_use_header_trampoline::<F> as *const (),
1918 )),
1919 Box_::into_raw(f),
1920 )
1921 }
1922 }
1923
1924 #[doc(alias = "gtk-dnd-drag-threshold")]
1925 pub fn connect_gtk_dnd_drag_threshold_notify<F: Fn(&Self) + 'static>(
1926 &self,
1927 f: F,
1928 ) -> SignalHandlerId {
1929 unsafe extern "C" fn notify_gtk_dnd_drag_threshold_trampoline<
1930 F: Fn(&Settings) + 'static,
1931 >(
1932 this: *mut ffi::GtkSettings,
1933 _param_spec: glib::ffi::gpointer,
1934 f: glib::ffi::gpointer,
1935 ) {
1936 let f: &F = &*(f as *const F);
1937 f(&from_glib_borrow(this))
1938 }
1939 unsafe {
1940 let f: Box_<F> = Box_::new(f);
1941 connect_raw(
1942 self.as_ptr() as *mut _,
1943 b"notify::gtk-dnd-drag-threshold\0".as_ptr() as *const _,
1944 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1945 notify_gtk_dnd_drag_threshold_trampoline::<F> as *const (),
1946 )),
1947 Box_::into_raw(f),
1948 )
1949 }
1950 }
1951
1952 #[doc(alias = "gtk-double-click-distance")]
1953 pub fn connect_gtk_double_click_distance_notify<F: Fn(&Self) + 'static>(
1954 &self,
1955 f: F,
1956 ) -> SignalHandlerId {
1957 unsafe extern "C" fn notify_gtk_double_click_distance_trampoline<
1958 F: Fn(&Settings) + 'static,
1959 >(
1960 this: *mut ffi::GtkSettings,
1961 _param_spec: glib::ffi::gpointer,
1962 f: glib::ffi::gpointer,
1963 ) {
1964 let f: &F = &*(f as *const F);
1965 f(&from_glib_borrow(this))
1966 }
1967 unsafe {
1968 let f: Box_<F> = Box_::new(f);
1969 connect_raw(
1970 self.as_ptr() as *mut _,
1971 b"notify::gtk-double-click-distance\0".as_ptr() as *const _,
1972 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1973 notify_gtk_double_click_distance_trampoline::<F> as *const (),
1974 )),
1975 Box_::into_raw(f),
1976 )
1977 }
1978 }
1979
1980 #[doc(alias = "gtk-double-click-time")]
1981 pub fn connect_gtk_double_click_time_notify<F: Fn(&Self) + 'static>(
1982 &self,
1983 f: F,
1984 ) -> SignalHandlerId {
1985 unsafe extern "C" fn notify_gtk_double_click_time_trampoline<F: Fn(&Settings) + 'static>(
1986 this: *mut ffi::GtkSettings,
1987 _param_spec: glib::ffi::gpointer,
1988 f: glib::ffi::gpointer,
1989 ) {
1990 let f: &F = &*(f as *const F);
1991 f(&from_glib_borrow(this))
1992 }
1993 unsafe {
1994 let f: Box_<F> = Box_::new(f);
1995 connect_raw(
1996 self.as_ptr() as *mut _,
1997 b"notify::gtk-double-click-time\0".as_ptr() as *const _,
1998 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1999 notify_gtk_double_click_time_trampoline::<F> as *const (),
2000 )),
2001 Box_::into_raw(f),
2002 )
2003 }
2004 }
2005
2006 #[doc(alias = "gtk-enable-accels")]
2007 pub fn connect_gtk_enable_accels_notify<F: Fn(&Self) + 'static>(
2008 &self,
2009 f: F,
2010 ) -> SignalHandlerId {
2011 unsafe extern "C" fn notify_gtk_enable_accels_trampoline<F: Fn(&Settings) + 'static>(
2012 this: *mut ffi::GtkSettings,
2013 _param_spec: glib::ffi::gpointer,
2014 f: glib::ffi::gpointer,
2015 ) {
2016 let f: &F = &*(f as *const F);
2017 f(&from_glib_borrow(this))
2018 }
2019 unsafe {
2020 let f: Box_<F> = Box_::new(f);
2021 connect_raw(
2022 self.as_ptr() as *mut _,
2023 b"notify::gtk-enable-accels\0".as_ptr() as *const _,
2024 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2025 notify_gtk_enable_accels_trampoline::<F> as *const (),
2026 )),
2027 Box_::into_raw(f),
2028 )
2029 }
2030 }
2031
2032 #[doc(alias = "gtk-enable-animations")]
2033 pub fn connect_gtk_enable_animations_notify<F: Fn(&Self) + 'static>(
2034 &self,
2035 f: F,
2036 ) -> SignalHandlerId {
2037 unsafe extern "C" fn notify_gtk_enable_animations_trampoline<F: Fn(&Settings) + 'static>(
2038 this: *mut ffi::GtkSettings,
2039 _param_spec: glib::ffi::gpointer,
2040 f: glib::ffi::gpointer,
2041 ) {
2042 let f: &F = &*(f as *const F);
2043 f(&from_glib_borrow(this))
2044 }
2045 unsafe {
2046 let f: Box_<F> = Box_::new(f);
2047 connect_raw(
2048 self.as_ptr() as *mut _,
2049 b"notify::gtk-enable-animations\0".as_ptr() as *const _,
2050 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2051 notify_gtk_enable_animations_trampoline::<F> as *const (),
2052 )),
2053 Box_::into_raw(f),
2054 )
2055 }
2056 }
2057
2058 #[doc(alias = "gtk-enable-event-sounds")]
2059 pub fn connect_gtk_enable_event_sounds_notify<F: Fn(&Self) + 'static>(
2060 &self,
2061 f: F,
2062 ) -> SignalHandlerId {
2063 unsafe extern "C" fn notify_gtk_enable_event_sounds_trampoline<
2064 F: Fn(&Settings) + 'static,
2065 >(
2066 this: *mut ffi::GtkSettings,
2067 _param_spec: glib::ffi::gpointer,
2068 f: glib::ffi::gpointer,
2069 ) {
2070 let f: &F = &*(f as *const F);
2071 f(&from_glib_borrow(this))
2072 }
2073 unsafe {
2074 let f: Box_<F> = Box_::new(f);
2075 connect_raw(
2076 self.as_ptr() as *mut _,
2077 b"notify::gtk-enable-event-sounds\0".as_ptr() as *const _,
2078 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2079 notify_gtk_enable_event_sounds_trampoline::<F> as *const (),
2080 )),
2081 Box_::into_raw(f),
2082 )
2083 }
2084 }
2085
2086 #[doc(alias = "gtk-enable-input-feedback-sounds")]
2087 pub fn connect_gtk_enable_input_feedback_sounds_notify<F: Fn(&Self) + 'static>(
2088 &self,
2089 f: F,
2090 ) -> SignalHandlerId {
2091 unsafe extern "C" fn notify_gtk_enable_input_feedback_sounds_trampoline<
2092 F: Fn(&Settings) + 'static,
2093 >(
2094 this: *mut ffi::GtkSettings,
2095 _param_spec: glib::ffi::gpointer,
2096 f: glib::ffi::gpointer,
2097 ) {
2098 let f: &F = &*(f as *const F);
2099 f(&from_glib_borrow(this))
2100 }
2101 unsafe {
2102 let f: Box_<F> = Box_::new(f);
2103 connect_raw(
2104 self.as_ptr() as *mut _,
2105 b"notify::gtk-enable-input-feedback-sounds\0".as_ptr() as *const _,
2106 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2107 notify_gtk_enable_input_feedback_sounds_trampoline::<F> as *const (),
2108 )),
2109 Box_::into_raw(f),
2110 )
2111 }
2112 }
2113
2114 #[doc(alias = "gtk-enable-primary-paste")]
2115 pub fn connect_gtk_enable_primary_paste_notify<F: Fn(&Self) + 'static>(
2116 &self,
2117 f: F,
2118 ) -> SignalHandlerId {
2119 unsafe extern "C" fn notify_gtk_enable_primary_paste_trampoline<
2120 F: Fn(&Settings) + 'static,
2121 >(
2122 this: *mut ffi::GtkSettings,
2123 _param_spec: glib::ffi::gpointer,
2124 f: glib::ffi::gpointer,
2125 ) {
2126 let f: &F = &*(f as *const F);
2127 f(&from_glib_borrow(this))
2128 }
2129 unsafe {
2130 let f: Box_<F> = Box_::new(f);
2131 connect_raw(
2132 self.as_ptr() as *mut _,
2133 b"notify::gtk-enable-primary-paste\0".as_ptr() as *const _,
2134 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2135 notify_gtk_enable_primary_paste_trampoline::<F> as *const (),
2136 )),
2137 Box_::into_raw(f),
2138 )
2139 }
2140 }
2141
2142 #[doc(alias = "gtk-entry-password-hint-timeout")]
2143 pub fn connect_gtk_entry_password_hint_timeout_notify<F: Fn(&Self) + 'static>(
2144 &self,
2145 f: F,
2146 ) -> SignalHandlerId {
2147 unsafe extern "C" fn notify_gtk_entry_password_hint_timeout_trampoline<
2148 F: Fn(&Settings) + 'static,
2149 >(
2150 this: *mut ffi::GtkSettings,
2151 _param_spec: glib::ffi::gpointer,
2152 f: glib::ffi::gpointer,
2153 ) {
2154 let f: &F = &*(f as *const F);
2155 f(&from_glib_borrow(this))
2156 }
2157 unsafe {
2158 let f: Box_<F> = Box_::new(f);
2159 connect_raw(
2160 self.as_ptr() as *mut _,
2161 b"notify::gtk-entry-password-hint-timeout\0".as_ptr() as *const _,
2162 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2163 notify_gtk_entry_password_hint_timeout_trampoline::<F> as *const (),
2164 )),
2165 Box_::into_raw(f),
2166 )
2167 }
2168 }
2169
2170 #[doc(alias = "gtk-entry-select-on-focus")]
2171 pub fn connect_gtk_entry_select_on_focus_notify<F: Fn(&Self) + 'static>(
2172 &self,
2173 f: F,
2174 ) -> SignalHandlerId {
2175 unsafe extern "C" fn notify_gtk_entry_select_on_focus_trampoline<
2176 F: Fn(&Settings) + 'static,
2177 >(
2178 this: *mut ffi::GtkSettings,
2179 _param_spec: glib::ffi::gpointer,
2180 f: glib::ffi::gpointer,
2181 ) {
2182 let f: &F = &*(f as *const F);
2183 f(&from_glib_borrow(this))
2184 }
2185 unsafe {
2186 let f: Box_<F> = Box_::new(f);
2187 connect_raw(
2188 self.as_ptr() as *mut _,
2189 b"notify::gtk-entry-select-on-focus\0".as_ptr() as *const _,
2190 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2191 notify_gtk_entry_select_on_focus_trampoline::<F> as *const (),
2192 )),
2193 Box_::into_raw(f),
2194 )
2195 }
2196 }
2197
2198 #[doc(alias = "gtk-error-bell")]
2199 pub fn connect_gtk_error_bell_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2200 unsafe extern "C" fn notify_gtk_error_bell_trampoline<F: Fn(&Settings) + 'static>(
2201 this: *mut ffi::GtkSettings,
2202 _param_spec: glib::ffi::gpointer,
2203 f: glib::ffi::gpointer,
2204 ) {
2205 let f: &F = &*(f as *const F);
2206 f(&from_glib_borrow(this))
2207 }
2208 unsafe {
2209 let f: Box_<F> = Box_::new(f);
2210 connect_raw(
2211 self.as_ptr() as *mut _,
2212 b"notify::gtk-error-bell\0".as_ptr() as *const _,
2213 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2214 notify_gtk_error_bell_trampoline::<F> as *const (),
2215 )),
2216 Box_::into_raw(f),
2217 )
2218 }
2219 }
2220
2221 #[doc(alias = "gtk-font-name")]
2222 pub fn connect_gtk_font_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2223 unsafe extern "C" fn notify_gtk_font_name_trampoline<F: Fn(&Settings) + 'static>(
2224 this: *mut ffi::GtkSettings,
2225 _param_spec: glib::ffi::gpointer,
2226 f: glib::ffi::gpointer,
2227 ) {
2228 let f: &F = &*(f as *const F);
2229 f(&from_glib_borrow(this))
2230 }
2231 unsafe {
2232 let f: Box_<F> = Box_::new(f);
2233 connect_raw(
2234 self.as_ptr() as *mut _,
2235 b"notify::gtk-font-name\0".as_ptr() as *const _,
2236 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2237 notify_gtk_font_name_trampoline::<F> as *const (),
2238 )),
2239 Box_::into_raw(f),
2240 )
2241 }
2242 }
2243
2244 #[cfg(feature = "v4_16")]
2245 #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
2246 #[doc(alias = "gtk-font-rendering")]
2247 pub fn connect_gtk_font_rendering_notify<F: Fn(&Self) + 'static>(
2248 &self,
2249 f: F,
2250 ) -> SignalHandlerId {
2251 unsafe extern "C" fn notify_gtk_font_rendering_trampoline<F: Fn(&Settings) + 'static>(
2252 this: *mut ffi::GtkSettings,
2253 _param_spec: glib::ffi::gpointer,
2254 f: glib::ffi::gpointer,
2255 ) {
2256 let f: &F = &*(f as *const F);
2257 f(&from_glib_borrow(this))
2258 }
2259 unsafe {
2260 let f: Box_<F> = Box_::new(f);
2261 connect_raw(
2262 self.as_ptr() as *mut _,
2263 b"notify::gtk-font-rendering\0".as_ptr() as *const _,
2264 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2265 notify_gtk_font_rendering_trampoline::<F> as *const (),
2266 )),
2267 Box_::into_raw(f),
2268 )
2269 }
2270 }
2271
2272 #[doc(alias = "gtk-fontconfig-timestamp")]
2273 pub fn connect_gtk_fontconfig_timestamp_notify<F: Fn(&Self) + 'static>(
2274 &self,
2275 f: F,
2276 ) -> SignalHandlerId {
2277 unsafe extern "C" fn notify_gtk_fontconfig_timestamp_trampoline<
2278 F: Fn(&Settings) + 'static,
2279 >(
2280 this: *mut ffi::GtkSettings,
2281 _param_spec: glib::ffi::gpointer,
2282 f: glib::ffi::gpointer,
2283 ) {
2284 let f: &F = &*(f as *const F);
2285 f(&from_glib_borrow(this))
2286 }
2287 unsafe {
2288 let f: Box_<F> = Box_::new(f);
2289 connect_raw(
2290 self.as_ptr() as *mut _,
2291 b"notify::gtk-fontconfig-timestamp\0".as_ptr() as *const _,
2292 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2293 notify_gtk_fontconfig_timestamp_trampoline::<F> as *const (),
2294 )),
2295 Box_::into_raw(f),
2296 )
2297 }
2298 }
2299
2300 #[cfg(feature = "v4_6")]
2301 #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
2302 #[doc(alias = "gtk-hint-font-metrics")]
2303 pub fn connect_gtk_hint_font_metrics_notify<F: Fn(&Self) + 'static>(
2304 &self,
2305 f: F,
2306 ) -> SignalHandlerId {
2307 unsafe extern "C" fn notify_gtk_hint_font_metrics_trampoline<F: Fn(&Settings) + 'static>(
2308 this: *mut ffi::GtkSettings,
2309 _param_spec: glib::ffi::gpointer,
2310 f: glib::ffi::gpointer,
2311 ) {
2312 let f: &F = &*(f as *const F);
2313 f(&from_glib_borrow(this))
2314 }
2315 unsafe {
2316 let f: Box_<F> = Box_::new(f);
2317 connect_raw(
2318 self.as_ptr() as *mut _,
2319 b"notify::gtk-hint-font-metrics\0".as_ptr() as *const _,
2320 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2321 notify_gtk_hint_font_metrics_trampoline::<F> as *const (),
2322 )),
2323 Box_::into_raw(f),
2324 )
2325 }
2326 }
2327
2328 #[doc(alias = "gtk-icon-theme-name")]
2329 pub fn connect_gtk_icon_theme_name_notify<F: Fn(&Self) + 'static>(
2330 &self,
2331 f: F,
2332 ) -> SignalHandlerId {
2333 unsafe extern "C" fn notify_gtk_icon_theme_name_trampoline<F: Fn(&Settings) + 'static>(
2334 this: *mut ffi::GtkSettings,
2335 _param_spec: glib::ffi::gpointer,
2336 f: glib::ffi::gpointer,
2337 ) {
2338 let f: &F = &*(f as *const F);
2339 f(&from_glib_borrow(this))
2340 }
2341 unsafe {
2342 let f: Box_<F> = Box_::new(f);
2343 connect_raw(
2344 self.as_ptr() as *mut _,
2345 b"notify::gtk-icon-theme-name\0".as_ptr() as *const _,
2346 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2347 notify_gtk_icon_theme_name_trampoline::<F> as *const (),
2348 )),
2349 Box_::into_raw(f),
2350 )
2351 }
2352 }
2353
2354 #[doc(alias = "gtk-im-module")]
2355 pub fn connect_gtk_im_module_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2356 unsafe extern "C" fn notify_gtk_im_module_trampoline<F: Fn(&Settings) + 'static>(
2357 this: *mut ffi::GtkSettings,
2358 _param_spec: glib::ffi::gpointer,
2359 f: glib::ffi::gpointer,
2360 ) {
2361 let f: &F = &*(f as *const F);
2362 f(&from_glib_borrow(this))
2363 }
2364 unsafe {
2365 let f: Box_<F> = Box_::new(f);
2366 connect_raw(
2367 self.as_ptr() as *mut _,
2368 b"notify::gtk-im-module\0".as_ptr() as *const _,
2369 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2370 notify_gtk_im_module_trampoline::<F> as *const (),
2371 )),
2372 Box_::into_raw(f),
2373 )
2374 }
2375 }
2376
2377 #[doc(alias = "gtk-keynav-use-caret")]
2378 pub fn connect_gtk_keynav_use_caret_notify<F: Fn(&Self) + 'static>(
2379 &self,
2380 f: F,
2381 ) -> SignalHandlerId {
2382 unsafe extern "C" fn notify_gtk_keynav_use_caret_trampoline<F: Fn(&Settings) + 'static>(
2383 this: *mut ffi::GtkSettings,
2384 _param_spec: glib::ffi::gpointer,
2385 f: glib::ffi::gpointer,
2386 ) {
2387 let f: &F = &*(f as *const F);
2388 f(&from_glib_borrow(this))
2389 }
2390 unsafe {
2391 let f: Box_<F> = Box_::new(f);
2392 connect_raw(
2393 self.as_ptr() as *mut _,
2394 b"notify::gtk-keynav-use-caret\0".as_ptr() as *const _,
2395 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2396 notify_gtk_keynav_use_caret_trampoline::<F> as *const (),
2397 )),
2398 Box_::into_raw(f),
2399 )
2400 }
2401 }
2402
2403 #[doc(alias = "gtk-label-select-on-focus")]
2404 pub fn connect_gtk_label_select_on_focus_notify<F: Fn(&Self) + 'static>(
2405 &self,
2406 f: F,
2407 ) -> SignalHandlerId {
2408 unsafe extern "C" fn notify_gtk_label_select_on_focus_trampoline<
2409 F: Fn(&Settings) + 'static,
2410 >(
2411 this: *mut ffi::GtkSettings,
2412 _param_spec: glib::ffi::gpointer,
2413 f: glib::ffi::gpointer,
2414 ) {
2415 let f: &F = &*(f as *const F);
2416 f(&from_glib_borrow(this))
2417 }
2418 unsafe {
2419 let f: Box_<F> = Box_::new(f);
2420 connect_raw(
2421 self.as_ptr() as *mut _,
2422 b"notify::gtk-label-select-on-focus\0".as_ptr() as *const _,
2423 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2424 notify_gtk_label_select_on_focus_trampoline::<F> as *const (),
2425 )),
2426 Box_::into_raw(f),
2427 )
2428 }
2429 }
2430
2431 #[doc(alias = "gtk-long-press-time")]
2432 pub fn connect_gtk_long_press_time_notify<F: Fn(&Self) + 'static>(
2433 &self,
2434 f: F,
2435 ) -> SignalHandlerId {
2436 unsafe extern "C" fn notify_gtk_long_press_time_trampoline<F: Fn(&Settings) + 'static>(
2437 this: *mut ffi::GtkSettings,
2438 _param_spec: glib::ffi::gpointer,
2439 f: glib::ffi::gpointer,
2440 ) {
2441 let f: &F = &*(f as *const F);
2442 f(&from_glib_borrow(this))
2443 }
2444 unsafe {
2445 let f: Box_<F> = Box_::new(f);
2446 connect_raw(
2447 self.as_ptr() as *mut _,
2448 b"notify::gtk-long-press-time\0".as_ptr() as *const _,
2449 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2450 notify_gtk_long_press_time_trampoline::<F> as *const (),
2451 )),
2452 Box_::into_raw(f),
2453 )
2454 }
2455 }
2456
2457 #[doc(alias = "gtk-overlay-scrolling")]
2458 pub fn connect_gtk_overlay_scrolling_notify<F: Fn(&Self) + 'static>(
2459 &self,
2460 f: F,
2461 ) -> SignalHandlerId {
2462 unsafe extern "C" fn notify_gtk_overlay_scrolling_trampoline<F: Fn(&Settings) + 'static>(
2463 this: *mut ffi::GtkSettings,
2464 _param_spec: glib::ffi::gpointer,
2465 f: glib::ffi::gpointer,
2466 ) {
2467 let f: &F = &*(f as *const F);
2468 f(&from_glib_borrow(this))
2469 }
2470 unsafe {
2471 let f: Box_<F> = Box_::new(f);
2472 connect_raw(
2473 self.as_ptr() as *mut _,
2474 b"notify::gtk-overlay-scrolling\0".as_ptr() as *const _,
2475 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2476 notify_gtk_overlay_scrolling_trampoline::<F> as *const (),
2477 )),
2478 Box_::into_raw(f),
2479 )
2480 }
2481 }
2482
2483 #[doc(alias = "gtk-primary-button-warps-slider")]
2484 pub fn connect_gtk_primary_button_warps_slider_notify<F: Fn(&Self) + 'static>(
2485 &self,
2486 f: F,
2487 ) -> SignalHandlerId {
2488 unsafe extern "C" fn notify_gtk_primary_button_warps_slider_trampoline<
2489 F: Fn(&Settings) + 'static,
2490 >(
2491 this: *mut ffi::GtkSettings,
2492 _param_spec: glib::ffi::gpointer,
2493 f: glib::ffi::gpointer,
2494 ) {
2495 let f: &F = &*(f as *const F);
2496 f(&from_glib_borrow(this))
2497 }
2498 unsafe {
2499 let f: Box_<F> = Box_::new(f);
2500 connect_raw(
2501 self.as_ptr() as *mut _,
2502 b"notify::gtk-primary-button-warps-slider\0".as_ptr() as *const _,
2503 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2504 notify_gtk_primary_button_warps_slider_trampoline::<F> as *const (),
2505 )),
2506 Box_::into_raw(f),
2507 )
2508 }
2509 }
2510
2511 #[doc(alias = "gtk-print-backends")]
2512 pub fn connect_gtk_print_backends_notify<F: Fn(&Self) + 'static>(
2513 &self,
2514 f: F,
2515 ) -> SignalHandlerId {
2516 unsafe extern "C" fn notify_gtk_print_backends_trampoline<F: Fn(&Settings) + 'static>(
2517 this: *mut ffi::GtkSettings,
2518 _param_spec: glib::ffi::gpointer,
2519 f: glib::ffi::gpointer,
2520 ) {
2521 let f: &F = &*(f as *const F);
2522 f(&from_glib_borrow(this))
2523 }
2524 unsafe {
2525 let f: Box_<F> = Box_::new(f);
2526 connect_raw(
2527 self.as_ptr() as *mut _,
2528 b"notify::gtk-print-backends\0".as_ptr() as *const _,
2529 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2530 notify_gtk_print_backends_trampoline::<F> as *const (),
2531 )),
2532 Box_::into_raw(f),
2533 )
2534 }
2535 }
2536
2537 #[doc(alias = "gtk-print-preview-command")]
2538 pub fn connect_gtk_print_preview_command_notify<F: Fn(&Self) + 'static>(
2539 &self,
2540 f: F,
2541 ) -> SignalHandlerId {
2542 unsafe extern "C" fn notify_gtk_print_preview_command_trampoline<
2543 F: Fn(&Settings) + 'static,
2544 >(
2545 this: *mut ffi::GtkSettings,
2546 _param_spec: glib::ffi::gpointer,
2547 f: glib::ffi::gpointer,
2548 ) {
2549 let f: &F = &*(f as *const F);
2550 f(&from_glib_borrow(this))
2551 }
2552 unsafe {
2553 let f: Box_<F> = Box_::new(f);
2554 connect_raw(
2555 self.as_ptr() as *mut _,
2556 b"notify::gtk-print-preview-command\0".as_ptr() as *const _,
2557 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2558 notify_gtk_print_preview_command_trampoline::<F> as *const (),
2559 )),
2560 Box_::into_raw(f),
2561 )
2562 }
2563 }
2564
2565 #[doc(alias = "gtk-recent-files-enabled")]
2566 pub fn connect_gtk_recent_files_enabled_notify<F: Fn(&Self) + 'static>(
2567 &self,
2568 f: F,
2569 ) -> SignalHandlerId {
2570 unsafe extern "C" fn notify_gtk_recent_files_enabled_trampoline<
2571 F: Fn(&Settings) + 'static,
2572 >(
2573 this: *mut ffi::GtkSettings,
2574 _param_spec: glib::ffi::gpointer,
2575 f: glib::ffi::gpointer,
2576 ) {
2577 let f: &F = &*(f as *const F);
2578 f(&from_glib_borrow(this))
2579 }
2580 unsafe {
2581 let f: Box_<F> = Box_::new(f);
2582 connect_raw(
2583 self.as_ptr() as *mut _,
2584 b"notify::gtk-recent-files-enabled\0".as_ptr() as *const _,
2585 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2586 notify_gtk_recent_files_enabled_trampoline::<F> as *const (),
2587 )),
2588 Box_::into_raw(f),
2589 )
2590 }
2591 }
2592
2593 #[doc(alias = "gtk-recent-files-max-age")]
2594 pub fn connect_gtk_recent_files_max_age_notify<F: Fn(&Self) + 'static>(
2595 &self,
2596 f: F,
2597 ) -> SignalHandlerId {
2598 unsafe extern "C" fn notify_gtk_recent_files_max_age_trampoline<
2599 F: Fn(&Settings) + 'static,
2600 >(
2601 this: *mut ffi::GtkSettings,
2602 _param_spec: glib::ffi::gpointer,
2603 f: glib::ffi::gpointer,
2604 ) {
2605 let f: &F = &*(f as *const F);
2606 f(&from_glib_borrow(this))
2607 }
2608 unsafe {
2609 let f: Box_<F> = Box_::new(f);
2610 connect_raw(
2611 self.as_ptr() as *mut _,
2612 b"notify::gtk-recent-files-max-age\0".as_ptr() as *const _,
2613 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2614 notify_gtk_recent_files_max_age_trampoline::<F> as *const (),
2615 )),
2616 Box_::into_raw(f),
2617 )
2618 }
2619 }
2620
2621 #[doc(alias = "gtk-shell-shows-app-menu")]
2622 pub fn connect_gtk_shell_shows_app_menu_notify<F: Fn(&Self) + 'static>(
2623 &self,
2624 f: F,
2625 ) -> SignalHandlerId {
2626 unsafe extern "C" fn notify_gtk_shell_shows_app_menu_trampoline<
2627 F: Fn(&Settings) + 'static,
2628 >(
2629 this: *mut ffi::GtkSettings,
2630 _param_spec: glib::ffi::gpointer,
2631 f: glib::ffi::gpointer,
2632 ) {
2633 let f: &F = &*(f as *const F);
2634 f(&from_glib_borrow(this))
2635 }
2636 unsafe {
2637 let f: Box_<F> = Box_::new(f);
2638 connect_raw(
2639 self.as_ptr() as *mut _,
2640 b"notify::gtk-shell-shows-app-menu\0".as_ptr() as *const _,
2641 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2642 notify_gtk_shell_shows_app_menu_trampoline::<F> as *const (),
2643 )),
2644 Box_::into_raw(f),
2645 )
2646 }
2647 }
2648
2649 #[doc(alias = "gtk-shell-shows-desktop")]
2650 pub fn connect_gtk_shell_shows_desktop_notify<F: Fn(&Self) + 'static>(
2651 &self,
2652 f: F,
2653 ) -> SignalHandlerId {
2654 unsafe extern "C" fn notify_gtk_shell_shows_desktop_trampoline<
2655 F: Fn(&Settings) + 'static,
2656 >(
2657 this: *mut ffi::GtkSettings,
2658 _param_spec: glib::ffi::gpointer,
2659 f: glib::ffi::gpointer,
2660 ) {
2661 let f: &F = &*(f as *const F);
2662 f(&from_glib_borrow(this))
2663 }
2664 unsafe {
2665 let f: Box_<F> = Box_::new(f);
2666 connect_raw(
2667 self.as_ptr() as *mut _,
2668 b"notify::gtk-shell-shows-desktop\0".as_ptr() as *const _,
2669 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2670 notify_gtk_shell_shows_desktop_trampoline::<F> as *const (),
2671 )),
2672 Box_::into_raw(f),
2673 )
2674 }
2675 }
2676
2677 #[doc(alias = "gtk-shell-shows-menubar")]
2678 pub fn connect_gtk_shell_shows_menubar_notify<F: Fn(&Self) + 'static>(
2679 &self,
2680 f: F,
2681 ) -> SignalHandlerId {
2682 unsafe extern "C" fn notify_gtk_shell_shows_menubar_trampoline<
2683 F: Fn(&Settings) + 'static,
2684 >(
2685 this: *mut ffi::GtkSettings,
2686 _param_spec: glib::ffi::gpointer,
2687 f: glib::ffi::gpointer,
2688 ) {
2689 let f: &F = &*(f as *const F);
2690 f(&from_glib_borrow(this))
2691 }
2692 unsafe {
2693 let f: Box_<F> = Box_::new(f);
2694 connect_raw(
2695 self.as_ptr() as *mut _,
2696 b"notify::gtk-shell-shows-menubar\0".as_ptr() as *const _,
2697 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2698 notify_gtk_shell_shows_menubar_trampoline::<F> as *const (),
2699 )),
2700 Box_::into_raw(f),
2701 )
2702 }
2703 }
2704
2705 #[cfg(feature = "v4_14")]
2706 #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
2707 #[doc(alias = "gtk-show-status-shapes")]
2708 pub fn connect_gtk_show_status_shapes_notify<F: Fn(&Self) + 'static>(
2709 &self,
2710 f: F,
2711 ) -> SignalHandlerId {
2712 unsafe extern "C" fn notify_gtk_show_status_shapes_trampoline<
2713 F: Fn(&Settings) + 'static,
2714 >(
2715 this: *mut ffi::GtkSettings,
2716 _param_spec: glib::ffi::gpointer,
2717 f: glib::ffi::gpointer,
2718 ) {
2719 let f: &F = &*(f as *const F);
2720 f(&from_glib_borrow(this))
2721 }
2722 unsafe {
2723 let f: Box_<F> = Box_::new(f);
2724 connect_raw(
2725 self.as_ptr() as *mut _,
2726 b"notify::gtk-show-status-shapes\0".as_ptr() as *const _,
2727 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2728 notify_gtk_show_status_shapes_trampoline::<F> as *const (),
2729 )),
2730 Box_::into_raw(f),
2731 )
2732 }
2733 }
2734
2735 #[doc(alias = "gtk-sound-theme-name")]
2736 pub fn connect_gtk_sound_theme_name_notify<F: Fn(&Self) + 'static>(
2737 &self,
2738 f: F,
2739 ) -> SignalHandlerId {
2740 unsafe extern "C" fn notify_gtk_sound_theme_name_trampoline<F: Fn(&Settings) + 'static>(
2741 this: *mut ffi::GtkSettings,
2742 _param_spec: glib::ffi::gpointer,
2743 f: glib::ffi::gpointer,
2744 ) {
2745 let f: &F = &*(f as *const F);
2746 f(&from_glib_borrow(this))
2747 }
2748 unsafe {
2749 let f: Box_<F> = Box_::new(f);
2750 connect_raw(
2751 self.as_ptr() as *mut _,
2752 b"notify::gtk-sound-theme-name\0".as_ptr() as *const _,
2753 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2754 notify_gtk_sound_theme_name_trampoline::<F> as *const (),
2755 )),
2756 Box_::into_raw(f),
2757 )
2758 }
2759 }
2760
2761 #[doc(alias = "gtk-split-cursor")]
2762 pub fn connect_gtk_split_cursor_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2763 unsafe extern "C" fn notify_gtk_split_cursor_trampoline<F: Fn(&Settings) + 'static>(
2764 this: *mut ffi::GtkSettings,
2765 _param_spec: glib::ffi::gpointer,
2766 f: glib::ffi::gpointer,
2767 ) {
2768 let f: &F = &*(f as *const F);
2769 f(&from_glib_borrow(this))
2770 }
2771 unsafe {
2772 let f: Box_<F> = Box_::new(f);
2773 connect_raw(
2774 self.as_ptr() as *mut _,
2775 b"notify::gtk-split-cursor\0".as_ptr() as *const _,
2776 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2777 notify_gtk_split_cursor_trampoline::<F> as *const (),
2778 )),
2779 Box_::into_raw(f),
2780 )
2781 }
2782 }
2783
2784 #[doc(alias = "gtk-theme-name")]
2785 pub fn connect_gtk_theme_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2786 unsafe extern "C" fn notify_gtk_theme_name_trampoline<F: Fn(&Settings) + 'static>(
2787 this: *mut ffi::GtkSettings,
2788 _param_spec: glib::ffi::gpointer,
2789 f: glib::ffi::gpointer,
2790 ) {
2791 let f: &F = &*(f as *const F);
2792 f(&from_glib_borrow(this))
2793 }
2794 unsafe {
2795 let f: Box_<F> = Box_::new(f);
2796 connect_raw(
2797 self.as_ptr() as *mut _,
2798 b"notify::gtk-theme-name\0".as_ptr() as *const _,
2799 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2800 notify_gtk_theme_name_trampoline::<F> as *const (),
2801 )),
2802 Box_::into_raw(f),
2803 )
2804 }
2805 }
2806
2807 #[doc(alias = "gtk-titlebar-double-click")]
2808 pub fn connect_gtk_titlebar_double_click_notify<F: Fn(&Self) + 'static>(
2809 &self,
2810 f: F,
2811 ) -> SignalHandlerId {
2812 unsafe extern "C" fn notify_gtk_titlebar_double_click_trampoline<
2813 F: Fn(&Settings) + 'static,
2814 >(
2815 this: *mut ffi::GtkSettings,
2816 _param_spec: glib::ffi::gpointer,
2817 f: glib::ffi::gpointer,
2818 ) {
2819 let f: &F = &*(f as *const F);
2820 f(&from_glib_borrow(this))
2821 }
2822 unsafe {
2823 let f: Box_<F> = Box_::new(f);
2824 connect_raw(
2825 self.as_ptr() as *mut _,
2826 b"notify::gtk-titlebar-double-click\0".as_ptr() as *const _,
2827 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2828 notify_gtk_titlebar_double_click_trampoline::<F> as *const (),
2829 )),
2830 Box_::into_raw(f),
2831 )
2832 }
2833 }
2834
2835 #[doc(alias = "gtk-titlebar-middle-click")]
2836 pub fn connect_gtk_titlebar_middle_click_notify<F: Fn(&Self) + 'static>(
2837 &self,
2838 f: F,
2839 ) -> SignalHandlerId {
2840 unsafe extern "C" fn notify_gtk_titlebar_middle_click_trampoline<
2841 F: Fn(&Settings) + 'static,
2842 >(
2843 this: *mut ffi::GtkSettings,
2844 _param_spec: glib::ffi::gpointer,
2845 f: glib::ffi::gpointer,
2846 ) {
2847 let f: &F = &*(f as *const F);
2848 f(&from_glib_borrow(this))
2849 }
2850 unsafe {
2851 let f: Box_<F> = Box_::new(f);
2852 connect_raw(
2853 self.as_ptr() as *mut _,
2854 b"notify::gtk-titlebar-middle-click\0".as_ptr() as *const _,
2855 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2856 notify_gtk_titlebar_middle_click_trampoline::<F> as *const (),
2857 )),
2858 Box_::into_raw(f),
2859 )
2860 }
2861 }
2862
2863 #[doc(alias = "gtk-titlebar-right-click")]
2864 pub fn connect_gtk_titlebar_right_click_notify<F: Fn(&Self) + 'static>(
2865 &self,
2866 f: F,
2867 ) -> SignalHandlerId {
2868 unsafe extern "C" fn notify_gtk_titlebar_right_click_trampoline<
2869 F: Fn(&Settings) + 'static,
2870 >(
2871 this: *mut ffi::GtkSettings,
2872 _param_spec: glib::ffi::gpointer,
2873 f: glib::ffi::gpointer,
2874 ) {
2875 let f: &F = &*(f as *const F);
2876 f(&from_glib_borrow(this))
2877 }
2878 unsafe {
2879 let f: Box_<F> = Box_::new(f);
2880 connect_raw(
2881 self.as_ptr() as *mut _,
2882 b"notify::gtk-titlebar-right-click\0".as_ptr() as *const _,
2883 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2884 notify_gtk_titlebar_right_click_trampoline::<F> as *const (),
2885 )),
2886 Box_::into_raw(f),
2887 )
2888 }
2889 }
2890
2891 #[doc(alias = "gtk-xft-antialias")]
2892 pub fn connect_gtk_xft_antialias_notify<F: Fn(&Self) + 'static>(
2893 &self,
2894 f: F,
2895 ) -> SignalHandlerId {
2896 unsafe extern "C" fn notify_gtk_xft_antialias_trampoline<F: Fn(&Settings) + 'static>(
2897 this: *mut ffi::GtkSettings,
2898 _param_spec: glib::ffi::gpointer,
2899 f: glib::ffi::gpointer,
2900 ) {
2901 let f: &F = &*(f as *const F);
2902 f(&from_glib_borrow(this))
2903 }
2904 unsafe {
2905 let f: Box_<F> = Box_::new(f);
2906 connect_raw(
2907 self.as_ptr() as *mut _,
2908 b"notify::gtk-xft-antialias\0".as_ptr() as *const _,
2909 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2910 notify_gtk_xft_antialias_trampoline::<F> as *const (),
2911 )),
2912 Box_::into_raw(f),
2913 )
2914 }
2915 }
2916
2917 #[doc(alias = "gtk-xft-dpi")]
2918 pub fn connect_gtk_xft_dpi_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2919 unsafe extern "C" fn notify_gtk_xft_dpi_trampoline<F: Fn(&Settings) + 'static>(
2920 this: *mut ffi::GtkSettings,
2921 _param_spec: glib::ffi::gpointer,
2922 f: glib::ffi::gpointer,
2923 ) {
2924 let f: &F = &*(f as *const F);
2925 f(&from_glib_borrow(this))
2926 }
2927 unsafe {
2928 let f: Box_<F> = Box_::new(f);
2929 connect_raw(
2930 self.as_ptr() as *mut _,
2931 b"notify::gtk-xft-dpi\0".as_ptr() as *const _,
2932 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2933 notify_gtk_xft_dpi_trampoline::<F> as *const (),
2934 )),
2935 Box_::into_raw(f),
2936 )
2937 }
2938 }
2939
2940 #[doc(alias = "gtk-xft-hinting")]
2941 pub fn connect_gtk_xft_hinting_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2942 unsafe extern "C" fn notify_gtk_xft_hinting_trampoline<F: Fn(&Settings) + 'static>(
2943 this: *mut ffi::GtkSettings,
2944 _param_spec: glib::ffi::gpointer,
2945 f: glib::ffi::gpointer,
2946 ) {
2947 let f: &F = &*(f as *const F);
2948 f(&from_glib_borrow(this))
2949 }
2950 unsafe {
2951 let f: Box_<F> = Box_::new(f);
2952 connect_raw(
2953 self.as_ptr() as *mut _,
2954 b"notify::gtk-xft-hinting\0".as_ptr() as *const _,
2955 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2956 notify_gtk_xft_hinting_trampoline::<F> as *const (),
2957 )),
2958 Box_::into_raw(f),
2959 )
2960 }
2961 }
2962
2963 #[doc(alias = "gtk-xft-hintstyle")]
2964 pub fn connect_gtk_xft_hintstyle_notify<F: Fn(&Self) + 'static>(
2965 &self,
2966 f: F,
2967 ) -> SignalHandlerId {
2968 unsafe extern "C" fn notify_gtk_xft_hintstyle_trampoline<F: Fn(&Settings) + 'static>(
2969 this: *mut ffi::GtkSettings,
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 b"notify::gtk-xft-hintstyle\0".as_ptr() as *const _,
2981 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2982 notify_gtk_xft_hintstyle_trampoline::<F> as *const (),
2983 )),
2984 Box_::into_raw(f),
2985 )
2986 }
2987 }
2988
2989 #[doc(alias = "gtk-xft-rgba")]
2990 pub fn connect_gtk_xft_rgba_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2991 unsafe extern "C" fn notify_gtk_xft_rgba_trampoline<F: Fn(&Settings) + 'static>(
2992 this: *mut ffi::GtkSettings,
2993 _param_spec: glib::ffi::gpointer,
2994 f: glib::ffi::gpointer,
2995 ) {
2996 let f: &F = &*(f as *const F);
2997 f(&from_glib_borrow(this))
2998 }
2999 unsafe {
3000 let f: Box_<F> = Box_::new(f);
3001 connect_raw(
3002 self.as_ptr() as *mut _,
3003 b"notify::gtk-xft-rgba\0".as_ptr() as *const _,
3004 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3005 notify_gtk_xft_rgba_trampoline::<F> as *const (),
3006 )),
3007 Box_::into_raw(f),
3008 )
3009 }
3010 }
3011}
3012
3013// rustdoc-stripper-ignore-next
3014/// A [builder-pattern] type to construct [`Settings`] objects.
3015///
3016/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
3017#[must_use = "The builder must be built to be used"]
3018pub struct SettingsBuilder {
3019 builder: glib::object::ObjectBuilder<'static, Settings>,
3020}
3021
3022impl SettingsBuilder {
3023 fn new() -> Self {
3024 Self {
3025 builder: glib::object::Object::builder(),
3026 }
3027 }
3028
3029 /// Whether buttons in dialogs should use the alternative button order.
3030 pub fn gtk_alternative_button_order(self, gtk_alternative_button_order: bool) -> Self {
3031 Self {
3032 builder: self
3033 .builder
3034 .property("gtk-alternative-button-order", gtk_alternative_button_order),
3035 }
3036 }
3037
3038 /// Controls the direction of the sort indicators in sorted list and tree
3039 /// views.
3040 ///
3041 /// By default an arrow pointing down means the column is sorted
3042 /// in ascending order. When set to [`true`], this order will be inverted.
3043 pub fn gtk_alternative_sort_arrows(self, gtk_alternative_sort_arrows: bool) -> Self {
3044 Self {
3045 builder: self
3046 .builder
3047 .property("gtk-alternative-sort-arrows", gtk_alternative_sort_arrows),
3048 }
3049 }
3050
3051 /// Whether the application prefers to use a dark theme.
3052 ///
3053 /// If a GTK theme includes a dark variant, it will be used
3054 /// instead of the configured theme.
3055 ///
3056 /// Some applications benefit from minimizing the amount of light
3057 /// pollution that interferes with the content. Good candidates for
3058 /// dark themes are photo and video editors that make the actual
3059 /// content get all the attention and minimize the distraction of
3060 /// the chrome.
3061 ///
3062 /// Dark themes should not be used for documents, where large spaces
3063 /// are white/light and the dark chrome creates too much contrast
3064 /// (web browser, text editor...).
3065 pub fn gtk_application_prefer_dark_theme(
3066 self,
3067 gtk_application_prefer_dark_theme: bool,
3068 ) -> Self {
3069 Self {
3070 builder: self.builder.property(
3071 "gtk-application-prefer-dark-theme",
3072 gtk_application_prefer_dark_theme,
3073 ),
3074 }
3075 }
3076
3077 /// The aspect ratio of the text caret.
3078 pub fn gtk_cursor_aspect_ratio(self, gtk_cursor_aspect_ratio: f64) -> Self {
3079 Self {
3080 builder: self
3081 .builder
3082 .property("gtk-cursor-aspect-ratio", gtk_cursor_aspect_ratio),
3083 }
3084 }
3085
3086 /// Whether the cursor should blink.
3087 ///
3088 /// Also see the [`gtk-cursor-blink-timeout`][struct@crate::Settings#gtk-cursor-blink-timeout] setting,
3089 /// which allows more flexible control over cursor blinking.
3090 pub fn gtk_cursor_blink(self, gtk_cursor_blink: bool) -> Self {
3091 Self {
3092 builder: self.builder.property("gtk-cursor-blink", gtk_cursor_blink),
3093 }
3094 }
3095
3096 /// Length of the cursor blink cycle, in milliseconds.
3097 pub fn gtk_cursor_blink_time(self, gtk_cursor_blink_time: i32) -> Self {
3098 Self {
3099 builder: self
3100 .builder
3101 .property("gtk-cursor-blink-time", gtk_cursor_blink_time),
3102 }
3103 }
3104
3105 /// Time after which the cursor stops blinking, in seconds.
3106 ///
3107 /// The timer is reset after each user interaction.
3108 ///
3109 /// Setting this to zero has the same effect as setting
3110 /// [`gtk-cursor-blink`][struct@crate::Settings#gtk-cursor-blink] to [`false`].
3111 pub fn gtk_cursor_blink_timeout(self, gtk_cursor_blink_timeout: i32) -> Self {
3112 Self {
3113 builder: self
3114 .builder
3115 .property("gtk-cursor-blink-timeout", gtk_cursor_blink_timeout),
3116 }
3117 }
3118
3119 /// Name of the cursor theme to use.
3120 ///
3121 /// Use [`None`] to use the default theme.
3122 pub fn gtk_cursor_theme_name(self, gtk_cursor_theme_name: impl Into<glib::GString>) -> Self {
3123 Self {
3124 builder: self
3125 .builder
3126 .property("gtk-cursor-theme-name", gtk_cursor_theme_name.into()),
3127 }
3128 }
3129
3130 /// The size to use for cursors.
3131 ///
3132 /// 0 means to use the default size.
3133 pub fn gtk_cursor_theme_size(self, gtk_cursor_theme_size: i32) -> Self {
3134 Self {
3135 builder: self
3136 .builder
3137 .property("gtk-cursor-theme-size", gtk_cursor_theme_size),
3138 }
3139 }
3140
3141 /// Determines which buttons should be put in the
3142 /// titlebar of client-side decorated windows, and whether they
3143 /// should be placed on the left or right.
3144 ///
3145 /// The format of the string is button names, separated by commas.
3146 /// A colon separates the buttons that should appear on the left
3147 /// from those on the right. Recognized button names are minimize,
3148 /// maximize, close, icon (the window icon) and menu (a menu button
3149 /// for the fallback app menu).
3150 ///
3151 /// For example, "menu:minimize,maximize,close" specifies a menu
3152 /// on the left, and minimize, maximize and close buttons on the right.
3153 ///
3154 /// Note that buttons will only be shown when they are meaningful.
3155 /// E.g. a menu button only appears when the desktop shell does not
3156 /// show the app menu, and a close button only appears on a window
3157 /// that can be closed.
3158 ///
3159 /// Also note that the setting can be overridden with the
3160 /// [`decoration-layout`][struct@crate::HeaderBar#decoration-layout] property.
3161 pub fn gtk_decoration_layout(self, gtk_decoration_layout: impl Into<glib::GString>) -> Self {
3162 Self {
3163 builder: self
3164 .builder
3165 .property("gtk-decoration-layout", gtk_decoration_layout.into()),
3166 }
3167 }
3168
3169 /// Whether builtin GTK dialogs such as the file chooser, the
3170 /// color chooser or the font chooser will use a header bar at
3171 /// the top to show action widgets, or an action area at the bottom.
3172 ///
3173 /// This setting does not affect custom dialogs using [`Dialog`][crate::Dialog]
3174 /// directly, or message dialogs.
3175 pub fn gtk_dialogs_use_header(self, gtk_dialogs_use_header: bool) -> Self {
3176 Self {
3177 builder: self
3178 .builder
3179 .property("gtk-dialogs-use-header", gtk_dialogs_use_header),
3180 }
3181 }
3182
3183 /// The number of pixels the cursor can move before dragging.
3184 pub fn gtk_dnd_drag_threshold(self, gtk_dnd_drag_threshold: i32) -> Self {
3185 Self {
3186 builder: self
3187 .builder
3188 .property("gtk-dnd-drag-threshold", gtk_dnd_drag_threshold),
3189 }
3190 }
3191
3192 /// The maximum distance allowed between two clicks for them to be considered
3193 /// a double click, in pixels.
3194 pub fn gtk_double_click_distance(self, gtk_double_click_distance: i32) -> Self {
3195 Self {
3196 builder: self
3197 .builder
3198 .property("gtk-double-click-distance", gtk_double_click_distance),
3199 }
3200 }
3201
3202 /// The maximum time to allow between two clicks for them to be considered
3203 /// a double click, in milliseconds.
3204 pub fn gtk_double_click_time(self, gtk_double_click_time: i32) -> Self {
3205 Self {
3206 builder: self
3207 .builder
3208 .property("gtk-double-click-time", gtk_double_click_time),
3209 }
3210 }
3211
3212 /// Whether menu items should have visible accelerators which can be
3213 /// activated.
3214 pub fn gtk_enable_accels(self, gtk_enable_accels: bool) -> Self {
3215 Self {
3216 builder: self
3217 .builder
3218 .property("gtk-enable-accels", gtk_enable_accels),
3219 }
3220 }
3221
3222 /// Whether to enable toolkit-wide animations.
3223 pub fn gtk_enable_animations(self, gtk_enable_animations: bool) -> Self {
3224 Self {
3225 builder: self
3226 .builder
3227 .property("gtk-enable-animations", gtk_enable_animations),
3228 }
3229 }
3230
3231 /// Whether to play any event sounds at all.
3232 ///
3233 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
3234 /// for more information on event sounds and sound themes.
3235 ///
3236 /// GTK itself does not support event sounds, you have to use a loadable
3237 /// module like the one that comes with libcanberra.
3238 pub fn gtk_enable_event_sounds(self, gtk_enable_event_sounds: bool) -> Self {
3239 Self {
3240 builder: self
3241 .builder
3242 .property("gtk-enable-event-sounds", gtk_enable_event_sounds),
3243 }
3244 }
3245
3246 /// Whether to play event sounds as feedback to user input.
3247 ///
3248 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
3249 /// for more information on event sounds and sound themes.
3250 ///
3251 /// GTK itself does not support event sounds, you have to use a loadable
3252 /// module like the one that comes with libcanberra.
3253 pub fn gtk_enable_input_feedback_sounds(self, gtk_enable_input_feedback_sounds: bool) -> Self {
3254 Self {
3255 builder: self.builder.property(
3256 "gtk-enable-input-feedback-sounds",
3257 gtk_enable_input_feedback_sounds,
3258 ),
3259 }
3260 }
3261
3262 /// Whether a middle click on a mouse should paste the
3263 /// 'PRIMARY' clipboard content at the cursor location.
3264 pub fn gtk_enable_primary_paste(self, gtk_enable_primary_paste: bool) -> Self {
3265 Self {
3266 builder: self
3267 .builder
3268 .property("gtk-enable-primary-paste", gtk_enable_primary_paste),
3269 }
3270 }
3271
3272 /// How long to show the last input character in hidden
3273 /// entries.
3274 ///
3275 /// This value is in milliseconds. 0 disables showing the
3276 /// last char. 600 is a good value for enabling it.
3277 pub fn gtk_entry_password_hint_timeout(self, gtk_entry_password_hint_timeout: u32) -> Self {
3278 Self {
3279 builder: self.builder.property(
3280 "gtk-entry-password-hint-timeout",
3281 gtk_entry_password_hint_timeout,
3282 ),
3283 }
3284 }
3285
3286 /// Whether to select the contents of an entry when it is focused.
3287 pub fn gtk_entry_select_on_focus(self, gtk_entry_select_on_focus: bool) -> Self {
3288 Self {
3289 builder: self
3290 .builder
3291 .property("gtk-entry-select-on-focus", gtk_entry_select_on_focus),
3292 }
3293 }
3294
3295 /// When [`true`], keyboard navigation and other input-related errors
3296 /// will cause a beep.
3297 ///
3298 /// Since the error bell is implemented using gdk_surface_beep(), the
3299 /// windowing system may offer ways to configure the error bell in many
3300 /// ways, such as flashing the window or similar visual effects.
3301 pub fn gtk_error_bell(self, gtk_error_bell: bool) -> Self {
3302 Self {
3303 builder: self.builder.property("gtk-error-bell", gtk_error_bell),
3304 }
3305 }
3306
3307 /// The default font to use.
3308 ///
3309 /// GTK uses the family name and size from this string.
3310 pub fn gtk_font_name(self, gtk_font_name: impl Into<glib::GString>) -> Self {
3311 Self {
3312 builder: self.builder.property("gtk-font-name", gtk_font_name.into()),
3313 }
3314 }
3315
3316 /// How GTK font rendering is set up.
3317 ///
3318 /// When set to [enum@Gtk.FontRendering.MANUAL], GTK respects the low-level
3319 /// font-related settings ([`gtk-hint-font-metrics`][struct@crate::Settings#gtk-hint-font-metrics],
3320 /// [`gtk-xft-antialias`][struct@crate::Settings#gtk-xft-antialias], [`gtk-xft-hinting`][struct@crate::Settings#gtk-xft-hinting],
3321 /// [`gtk-xft-hintstyle`][struct@crate::Settings#gtk-xft-hintstyle] and [`gtk-xft-rgba`][struct@crate::Settings#gtk-xft-rgba])
3322 /// as much as practical.
3323 ///
3324 /// When set to [enum@Gtk.FontRendering.AUTOMATIC], GTK will consider factors such
3325 /// as screen resolution and scale in deciding how to render fonts.
3326 #[cfg(feature = "v4_16")]
3327 #[cfg_attr(docsrs, doc(cfg(feature = "v4_16")))]
3328 pub fn gtk_font_rendering(self, gtk_font_rendering: FontRendering) -> Self {
3329 Self {
3330 builder: self
3331 .builder
3332 .property("gtk-font-rendering", gtk_font_rendering),
3333 }
3334 }
3335
3336 /// Timestamp of the current fontconfig configuration.
3337 pub fn gtk_fontconfig_timestamp(self, gtk_fontconfig_timestamp: u32) -> Self {
3338 Self {
3339 builder: self
3340 .builder
3341 .property("gtk-fontconfig-timestamp", gtk_fontconfig_timestamp),
3342 }
3343 }
3344
3345 /// Whether hinting should be applied to font metrics.
3346 ///
3347 /// Note that this also turns off subpixel positioning of glyphs,
3348 /// since it conflicts with metrics hinting.
3349 #[cfg(feature = "v4_6")]
3350 #[cfg_attr(docsrs, doc(cfg(feature = "v4_6")))]
3351 pub fn gtk_hint_font_metrics(self, gtk_hint_font_metrics: bool) -> Self {
3352 Self {
3353 builder: self
3354 .builder
3355 .property("gtk-hint-font-metrics", gtk_hint_font_metrics),
3356 }
3357 }
3358
3359 /// Name of the icon theme to use.
3360 ///
3361 /// See [`IconTheme`][crate::IconTheme] for details about how
3362 /// GTK handles icon themes.
3363 pub fn gtk_icon_theme_name(self, gtk_icon_theme_name: impl Into<glib::GString>) -> Self {
3364 Self {
3365 builder: self
3366 .builder
3367 .property("gtk-icon-theme-name", gtk_icon_theme_name.into()),
3368 }
3369 }
3370
3371 /// Which IM (input method) module should be used by default.
3372 ///
3373 /// This is the input method that will be used if the user has not
3374 /// explicitly chosen another input method from the IM context menu.
3375 /// This also can be a colon-separated list of input methods, which GTK
3376 /// will try in turn until it finds one available on the system.
3377 ///
3378 /// See [`IMContext`][crate::IMContext].
3379 pub fn gtk_im_module(self, gtk_im_module: impl Into<glib::GString>) -> Self {
3380 Self {
3381 builder: self.builder.property("gtk-im-module", gtk_im_module.into()),
3382 }
3383 }
3384
3385 /// Whether GTK should make sure that text can be navigated with
3386 /// a caret, even if it is not editable.
3387 ///
3388 /// This is useful when using a screen reader.
3389 pub fn gtk_keynav_use_caret(self, gtk_keynav_use_caret: bool) -> Self {
3390 Self {
3391 builder: self
3392 .builder
3393 .property("gtk-keynav-use-caret", gtk_keynav_use_caret),
3394 }
3395 }
3396
3397 /// Whether to select the contents of a selectable
3398 /// label when it is focused.
3399 pub fn gtk_label_select_on_focus(self, gtk_label_select_on_focus: bool) -> Self {
3400 Self {
3401 builder: self
3402 .builder
3403 .property("gtk-label-select-on-focus", gtk_label_select_on_focus),
3404 }
3405 }
3406
3407 /// The time for a button or touch press to be considered a “long press”.
3408 ///
3409 /// See [`GestureLongPress`][crate::GestureLongPress].
3410 pub fn gtk_long_press_time(self, gtk_long_press_time: u32) -> Self {
3411 Self {
3412 builder: self
3413 .builder
3414 .property("gtk-long-press-time", gtk_long_press_time),
3415 }
3416 }
3417
3418 /// Whether scrolled windows may use overlaid scrolling indicators.
3419 ///
3420 /// If this is set to [`false`], scrolled windows will have permanent
3421 /// scrollbars.
3422 pub fn gtk_overlay_scrolling(self, gtk_overlay_scrolling: bool) -> Self {
3423 Self {
3424 builder: self
3425 .builder
3426 .property("gtk-overlay-scrolling", gtk_overlay_scrolling),
3427 }
3428 }
3429
3430 /// If the value of this setting is [`true`], clicking the primary button in a
3431 /// [`Range`][crate::Range] trough will move the slider, and hence set the range’s value, to
3432 /// the point that you clicked.
3433 ///
3434 /// If it is [`false`], a primary click will cause the slider/value to move
3435 /// by the range’s page-size towards the point clicked.
3436 ///
3437 /// Whichever action you choose for the primary button, the other action will
3438 /// be available by holding Shift and primary-clicking, or clicking the middle
3439 /// mouse button.
3440 pub fn gtk_primary_button_warps_slider(self, gtk_primary_button_warps_slider: bool) -> Self {
3441 Self {
3442 builder: self.builder.property(
3443 "gtk-primary-button-warps-slider",
3444 gtk_primary_button_warps_slider,
3445 ),
3446 }
3447 }
3448
3449 /// A comma-separated list of print backends to use in the print
3450 /// dialog.
3451 ///
3452 /// Available print backends depend on the GTK installation,
3453 /// and may include "file", "cups", "lpr" or "papi".
3454 pub fn gtk_print_backends(self, gtk_print_backends: impl Into<glib::GString>) -> Self {
3455 Self {
3456 builder: self
3457 .builder
3458 .property("gtk-print-backends", gtk_print_backends.into()),
3459 }
3460 }
3461
3462 /// A command to run for displaying the print preview.
3463 ///
3464 /// The command should contain a ``f`` placeholder, which will get
3465 /// replaced by the path to the pdf file. The command may also
3466 /// contain a ``s`` placeholder, which will get replaced by the
3467 /// path to a file containing the print settings in the format
3468 /// produced by [`PrintSettings::to_file()`][crate::PrintSettings::to_file()].
3469 ///
3470 /// The preview application is responsible for removing the pdf
3471 /// file and the print settings file when it is done.
3472 pub fn gtk_print_preview_command(
3473 self,
3474 gtk_print_preview_command: impl Into<glib::GString>,
3475 ) -> Self {
3476 Self {
3477 builder: self.builder.property(
3478 "gtk-print-preview-command",
3479 gtk_print_preview_command.into(),
3480 ),
3481 }
3482 }
3483
3484 /// Whether GTK should keep track of items inside the recently used
3485 /// resources list.
3486 ///
3487 /// If set to [`false`], the list will always be empty.
3488 pub fn gtk_recent_files_enabled(self, gtk_recent_files_enabled: bool) -> Self {
3489 Self {
3490 builder: self
3491 .builder
3492 .property("gtk-recent-files-enabled", gtk_recent_files_enabled),
3493 }
3494 }
3495
3496 /// The maximum age, in days, of the items inside the recently used
3497 /// resources list.
3498 ///
3499 /// Items older than this setting will be excised from the list.
3500 /// If set to 0, the list will always be empty; if set to -1, no
3501 /// item will be removed.
3502 pub fn gtk_recent_files_max_age(self, gtk_recent_files_max_age: i32) -> Self {
3503 Self {
3504 builder: self
3505 .builder
3506 .property("gtk-recent-files-max-age", gtk_recent_files_max_age),
3507 }
3508 }
3509
3510 /// Set to [`true`] if the desktop environment is displaying
3511 /// the app menu, [`false`] if the app should display it itself.
3512 pub fn gtk_shell_shows_app_menu(self, gtk_shell_shows_app_menu: bool) -> Self {
3513 Self {
3514 builder: self
3515 .builder
3516 .property("gtk-shell-shows-app-menu", gtk_shell_shows_app_menu),
3517 }
3518 }
3519
3520 /// Set to [`true`] if the desktop environment is displaying
3521 /// the desktop folder, [`false`] if not.
3522 pub fn gtk_shell_shows_desktop(self, gtk_shell_shows_desktop: bool) -> Self {
3523 Self {
3524 builder: self
3525 .builder
3526 .property("gtk-shell-shows-desktop", gtk_shell_shows_desktop),
3527 }
3528 }
3529
3530 /// Set to [`true`] if the desktop environment is displaying
3531 /// the menubar, [`false`] if the app should display it itself.
3532 pub fn gtk_shell_shows_menubar(self, gtk_shell_shows_menubar: bool) -> Self {
3533 Self {
3534 builder: self
3535 .builder
3536 .property("gtk-shell-shows-menubar", gtk_shell_shows_menubar),
3537 }
3538 }
3539
3540 /// When [`true`], widgets like switches include shapes to indicate their on/off state.
3541 #[cfg(feature = "v4_14")]
3542 #[cfg_attr(docsrs, doc(cfg(feature = "v4_14")))]
3543 pub fn gtk_show_status_shapes(self, gtk_show_status_shapes: bool) -> Self {
3544 Self {
3545 builder: self
3546 .builder
3547 .property("gtk-show-status-shapes", gtk_show_status_shapes),
3548 }
3549 }
3550
3551 /// The XDG sound theme to use for event sounds.
3552 ///
3553 /// See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
3554 /// for more information on event sounds and sound themes.
3555 ///
3556 /// GTK itself does not support event sounds, you have to use
3557 /// a loadable module like the one that comes with libcanberra.
3558 pub fn gtk_sound_theme_name(self, gtk_sound_theme_name: impl Into<glib::GString>) -> Self {
3559 Self {
3560 builder: self
3561 .builder
3562 .property("gtk-sound-theme-name", gtk_sound_theme_name.into()),
3563 }
3564 }
3565
3566 /// Whether two cursors should be displayed for mixed left-to-right and
3567 /// right-to-left text.
3568 pub fn gtk_split_cursor(self, gtk_split_cursor: bool) -> Self {
3569 Self {
3570 builder: self.builder.property("gtk-split-cursor", gtk_split_cursor),
3571 }
3572 }
3573
3574 /// Name of the theme to load.
3575 ///
3576 /// See [`CssProvider`][crate::CssProvider] for details about how
3577 /// GTK finds the CSS stylesheet for a theme.
3578 pub fn gtk_theme_name(self, gtk_theme_name: impl Into<glib::GString>) -> Self {
3579 Self {
3580 builder: self
3581 .builder
3582 .property("gtk-theme-name", gtk_theme_name.into()),
3583 }
3584 }
3585
3586 /// Determines the action to take when a double-click
3587 /// occurs on the titlebar of client-side decorated windows.
3588 ///
3589 /// Recognized actions are minimize, toggle-maximize, menu, lower
3590 /// or none.
3591 pub fn gtk_titlebar_double_click(
3592 self,
3593 gtk_titlebar_double_click: impl Into<glib::GString>,
3594 ) -> Self {
3595 Self {
3596 builder: self.builder.property(
3597 "gtk-titlebar-double-click",
3598 gtk_titlebar_double_click.into(),
3599 ),
3600 }
3601 }
3602
3603 /// Determines the action to take when a middle-click
3604 /// occurs on the titlebar of client-side decorated windows.
3605 ///
3606 /// Recognized actions are minimize, toggle-maximize, menu, lower
3607 /// or none.
3608 pub fn gtk_titlebar_middle_click(
3609 self,
3610 gtk_titlebar_middle_click: impl Into<glib::GString>,
3611 ) -> Self {
3612 Self {
3613 builder: self.builder.property(
3614 "gtk-titlebar-middle-click",
3615 gtk_titlebar_middle_click.into(),
3616 ),
3617 }
3618 }
3619
3620 /// Determines the action to take when a right-click
3621 /// occurs on the titlebar of client-side decorated windows.
3622 ///
3623 /// Recognized actions are minimize, toggle-maximize, menu, lower
3624 /// or none.
3625 pub fn gtk_titlebar_right_click(
3626 self,
3627 gtk_titlebar_right_click: impl Into<glib::GString>,
3628 ) -> Self {
3629 Self {
3630 builder: self
3631 .builder
3632 .property("gtk-titlebar-right-click", gtk_titlebar_right_click.into()),
3633 }
3634 }
3635
3636 /// Whether to antialias fonts.
3637 ///
3638 /// The values are 0 for no, 1 for yes, or -1 for the system default.
3639 pub fn gtk_xft_antialias(self, gtk_xft_antialias: i32) -> Self {
3640 Self {
3641 builder: self
3642 .builder
3643 .property("gtk-xft-antialias", gtk_xft_antialias),
3644 }
3645 }
3646
3647 /// The font resolution, in 1024 * dots/inch.
3648 ///
3649 /// -1 to use the default value.
3650 pub fn gtk_xft_dpi(self, gtk_xft_dpi: i32) -> Self {
3651 Self {
3652 builder: self.builder.property("gtk-xft-dpi", gtk_xft_dpi),
3653 }
3654 }
3655
3656 /// Whether to enable font hinting.
3657 ///
3658 /// The values are 0 for no, 1 for yes, or -1 for the system default.
3659 pub fn gtk_xft_hinting(self, gtk_xft_hinting: i32) -> Self {
3660 Self {
3661 builder: self.builder.property("gtk-xft-hinting", gtk_xft_hinting),
3662 }
3663 }
3664
3665 /// What degree of font hinting to use.
3666 ///
3667 /// The possible vaues are hintnone, hintslight,
3668 /// hintmedium, hintfull.
3669 pub fn gtk_xft_hintstyle(self, gtk_xft_hintstyle: impl Into<glib::GString>) -> Self {
3670 Self {
3671 builder: self
3672 .builder
3673 .property("gtk-xft-hintstyle", gtk_xft_hintstyle.into()),
3674 }
3675 }
3676
3677 /// The type of subpixel antialiasing to use.
3678 ///
3679 /// The possible values are none, rgb, bgr, vrgb, vbgr.
3680 ///
3681 /// Note that GSK does not support subpixel antialiasing, and this
3682 /// setting has no effect on font rendering in GTK.
3683 pub fn gtk_xft_rgba(self, gtk_xft_rgba: impl Into<glib::GString>) -> Self {
3684 Self {
3685 builder: self.builder.property("gtk-xft-rgba", gtk_xft_rgba.into()),
3686 }
3687 }
3688
3689 // rustdoc-stripper-ignore-next
3690 /// Build the [`Settings`].
3691 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
3692 pub fn build(self) -> Settings {
3693 assert_initialized_main_thread!();
3694 self.builder.build()
3695 }
3696}