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