animate/legacy/
settings.rs

1use glib::{
2    object::ObjectType as ObjectType_,
3    signal::{connect_raw, SignalHandlerId},
4    translate::*,
5    GString, StaticType, Value,
6};
7use std::boxed::Box as Box_;
8use std::{fmt, mem::transmute};
9
10glib_wrapper! {
11    pub struct Settings(Object<ffi::ClutterSettings, ffi::ClutterSettingsClass, SettingsClass>);
12
13    match fn {
14        get_type => || ffi::clutter_settings_get_type(),
15    }
16}
17
18impl Settings {
19    /// The default distance that the cursor of a pointer device
20    /// should travel before a drag operation should start.
21    pub fn get_property_dnd_drag_threshold(&self) -> i32 {
22        unsafe {
23            let mut value = Value::from_type(<i32 as StaticType>::static_type());
24            gobject_sys::g_object_get_property(
25                self.as_ptr() as *mut gobject_sys::GObject,
26                b"dnd-drag-threshold\0".as_ptr() as *const _,
27                value.to_glib_none_mut().0,
28            );
29            value
30                .get()
31                .expect("Return Value for property `dnd-drag-threshold` getter")
32                .unwrap()
33        }
34    }
35
36    /// The default distance that the cursor of a pointer device
37    /// should travel before a drag operation should start.
38    pub fn set_property_dnd_drag_threshold(&self, dnd_drag_threshold: i32) {
39        unsafe {
40            gobject_sys::g_object_set_property(
41                self.as_ptr() as *mut gobject_sys::GObject,
42                b"dnd-drag-threshold\0".as_ptr() as *const _,
43                Value::from(&dnd_drag_threshold).to_glib_none().0,
44            );
45        }
46    }
47
48    /// The maximum distance, in pixels, between button-press events that
49    /// determines whether or not to increase the click count by 1.
50    pub fn get_property_double_click_distance(&self) -> i32 {
51        unsafe {
52            let mut value = Value::from_type(<i32 as StaticType>::static_type());
53            gobject_sys::g_object_get_property(
54                self.as_ptr() as *mut gobject_sys::GObject,
55                b"double-click-distance\0".as_ptr() as *const _,
56                value.to_glib_none_mut().0,
57            );
58            value
59                .get()
60                .expect("Return Value for property `double-click-distance` getter")
61                .unwrap()
62        }
63    }
64
65    /// The maximum distance, in pixels, between button-press events that
66    /// determines whether or not to increase the click count by 1.
67    pub fn set_property_double_click_distance(&self, double_click_distance: i32) {
68        unsafe {
69            gobject_sys::g_object_set_property(
70                self.as_ptr() as *mut gobject_sys::GObject,
71                b"double-click-distance\0".as_ptr() as *const _,
72                Value::from(&double_click_distance).to_glib_none().0,
73            );
74        }
75    }
76
77    /// The time, in milliseconds, that should elapse between button-press
78    /// events in order to increase the click count by 1.
79    pub fn get_property_double_click_time(&self) -> i32 {
80        unsafe {
81            let mut value = Value::from_type(<i32 as StaticType>::static_type());
82            gobject_sys::g_object_get_property(
83                self.as_ptr() as *mut gobject_sys::GObject,
84                b"double-click-time\0".as_ptr() as *const _,
85                value.to_glib_none_mut().0,
86            );
87            value
88                .get()
89                .expect("Return Value for property `double-click-time` getter")
90                .unwrap()
91        }
92    }
93
94    /// The time, in milliseconds, that should elapse between button-press
95    /// events in order to increase the click count by 1.
96    pub fn set_property_double_click_time(&self, double_click_time: i32) {
97        unsafe {
98            gobject_sys::g_object_set_property(
99                self.as_ptr() as *mut gobject_sys::GObject,
100                b"double-click-time\0".as_ptr() as *const _,
101                Value::from(&double_click_time).to_glib_none().0,
102            );
103        }
104    }
105
106    /// Whether or not to use antialiasing when rendering text; a value
107    /// of 1 enables it unconditionally; a value of 0 disables it
108    /// unconditionally; and -1 will use the system's default.
109    pub fn get_property_font_antialias(&self) -> i32 {
110        unsafe {
111            let mut value = Value::from_type(<i32 as StaticType>::static_type());
112            gobject_sys::g_object_get_property(
113                self.as_ptr() as *mut gobject_sys::GObject,
114                b"font-antialias\0".as_ptr() as *const _,
115                value.to_glib_none_mut().0,
116            );
117            value
118                .get()
119                .expect("Return Value for property `font-antialias` getter")
120                .unwrap()
121        }
122    }
123
124    /// Whether or not to use antialiasing when rendering text; a value
125    /// of 1 enables it unconditionally; a value of 0 disables it
126    /// unconditionally; and -1 will use the system's default.
127    pub fn set_property_font_antialias(&self, font_antialias: i32) {
128        unsafe {
129            gobject_sys::g_object_set_property(
130                self.as_ptr() as *mut gobject_sys::GObject,
131                b"font-antialias\0".as_ptr() as *const _,
132                Value::from(&font_antialias).to_glib_none().0,
133            );
134        }
135    }
136
137    /// The DPI used when rendering text, as a value of 1024 * dots/inch.
138    ///
139    /// If set to -1, the system's default will be used instead
140    pub fn get_property_font_dpi(&self) -> i32 {
141        unsafe {
142            let mut value = Value::from_type(<i32 as StaticType>::static_type());
143            gobject_sys::g_object_get_property(
144                self.as_ptr() as *mut gobject_sys::GObject,
145                b"font-dpi\0".as_ptr() as *const _,
146                value.to_glib_none_mut().0,
147            );
148            value
149                .get()
150                .expect("Return Value for property `font-dpi` getter")
151                .unwrap()
152        }
153    }
154
155    /// The DPI used when rendering text, as a value of 1024 * dots/inch.
156    ///
157    /// If set to -1, the system's default will be used instead
158    pub fn set_property_font_dpi(&self, font_dpi: i32) {
159        unsafe {
160            gobject_sys::g_object_set_property(
161                self.as_ptr() as *mut gobject_sys::GObject,
162                b"font-dpi\0".as_ptr() as *const _,
163                Value::from(&font_dpi).to_glib_none().0,
164            );
165        }
166    }
167
168    /// The style of the hinting used when rendering text. Valid values
169    /// are:
170    ///
171    ///  - hintnone
172    ///  - hintslight
173    ///  - hintmedium
174    ///  - hintfull
175    pub fn get_property_font_hint_style(&self) -> Option<GString> {
176        unsafe {
177            let mut value = Value::from_type(<GString as StaticType>::static_type());
178            gobject_sys::g_object_get_property(
179                self.as_ptr() as *mut gobject_sys::GObject,
180                b"font-hint-style\0".as_ptr() as *const _,
181                value.to_glib_none_mut().0,
182            );
183            value
184                .get()
185                .expect("Return Value for property `font-hint-style` getter")
186        }
187    }
188
189    /// The style of the hinting used when rendering text. Valid values
190    /// are:
191    ///
192    ///  - hintnone
193    ///  - hintslight
194    ///  - hintmedium
195    ///  - hintfull
196    pub fn set_property_font_hint_style(&self, font_hint_style: Option<&str>) {
197        unsafe {
198            gobject_sys::g_object_set_property(
199                self.as_ptr() as *mut gobject_sys::GObject,
200                b"font-hint-style\0".as_ptr() as *const _,
201                Value::from(font_hint_style).to_glib_none().0,
202            );
203        }
204    }
205
206    /// Whether or not to use hinting when rendering text; a value of 1
207    /// unconditionally enables it; a value of 0 unconditionally disables
208    /// it; and a value of -1 will use the system's default.
209    pub fn get_property_font_hinting(&self) -> i32 {
210        unsafe {
211            let mut value = Value::from_type(<i32 as StaticType>::static_type());
212            gobject_sys::g_object_get_property(
213                self.as_ptr() as *mut gobject_sys::GObject,
214                b"font-hinting\0".as_ptr() as *const _,
215                value.to_glib_none_mut().0,
216            );
217            value
218                .get()
219                .expect("Return Value for property `font-hinting` getter")
220                .unwrap()
221        }
222    }
223
224    /// Whether or not to use hinting when rendering text; a value of 1
225    /// unconditionally enables it; a value of 0 unconditionally disables
226    /// it; and a value of -1 will use the system's default.
227    pub fn set_property_font_hinting(&self, font_hinting: i32) {
228        unsafe {
229            gobject_sys::g_object_set_property(
230                self.as_ptr() as *mut gobject_sys::GObject,
231                b"font-hinting\0".as_ptr() as *const _,
232                Value::from(&font_hinting).to_glib_none().0,
233            );
234        }
235    }
236
237    /// The default font name that should be used by text actors, as
238    /// a string that can be passed to `pango::FontDescription::from_string`.
239    pub fn get_property_font_name(&self) -> Option<GString> {
240        unsafe {
241            let mut value = Value::from_type(<GString as StaticType>::static_type());
242            gobject_sys::g_object_get_property(
243                self.as_ptr() as *mut gobject_sys::GObject,
244                b"font-name\0".as_ptr() as *const _,
245                value.to_glib_none_mut().0,
246            );
247            value
248                .get()
249                .expect("Return Value for property `font-name` getter")
250        }
251    }
252
253    /// The default font name that should be used by text actors, as
254    /// a string that can be passed to `pango::FontDescription::from_string`.
255    pub fn set_property_font_name(&self, font_name: Option<&str>) {
256        unsafe {
257            gobject_sys::g_object_set_property(
258                self.as_ptr() as *mut gobject_sys::GObject,
259                b"font-name\0".as_ptr() as *const _,
260                Value::from(font_name).to_glib_none().0,
261            );
262        }
263    }
264
265    /// The type of sub-pixel antialiasing used when rendering text. Valid
266    /// values are:
267    ///
268    ///  - none
269    ///  - rgb
270    ///  - bgr
271    ///  - vrgb
272    ///  - vbgr
273    pub fn get_property_font_subpixel_order(&self) -> Option<GString> {
274        unsafe {
275            let mut value = Value::from_type(<GString as StaticType>::static_type());
276            gobject_sys::g_object_get_property(
277                self.as_ptr() as *mut gobject_sys::GObject,
278                b"font-subpixel-order\0".as_ptr() as *const _,
279                value.to_glib_none_mut().0,
280            );
281            value
282                .get()
283                .expect("Return Value for property `font-subpixel-order` getter")
284        }
285    }
286
287    /// The type of sub-pixel antialiasing used when rendering text. Valid
288    /// values are:
289    ///
290    ///  - none
291    ///  - rgb
292    ///  - bgr
293    ///  - vrgb
294    ///  - vbgr
295    pub fn set_property_font_subpixel_order(&self, font_subpixel_order: Option<&str>) {
296        unsafe {
297            gobject_sys::g_object_set_property(
298                self.as_ptr() as *mut gobject_sys::GObject,
299                b"font-subpixel-order\0".as_ptr() as *const _,
300                Value::from(font_subpixel_order).to_glib_none().0,
301            );
302        }
303    }
304
305    pub fn set_property_fontconfig_timestamp(&self, fontconfig_timestamp: u32) {
306        unsafe {
307            gobject_sys::g_object_set_property(
308                self.as_ptr() as *mut gobject_sys::GObject,
309                b"fontconfig-timestamp\0".as_ptr() as *const _,
310                Value::from(&fontconfig_timestamp).to_glib_none().0,
311            );
312        }
313    }
314
315    /// Sets the minimum duration for a press to be recognized as a long press
316    /// gesture. The duration is expressed in milliseconds.
317    ///
318    /// See also `ClickAction:long-press-duration`.
319    pub fn get_property_long_press_duration(&self) -> i32 {
320        unsafe {
321            let mut value = Value::from_type(<i32 as StaticType>::static_type());
322            gobject_sys::g_object_get_property(
323                self.as_ptr() as *mut gobject_sys::GObject,
324                b"long-press-duration\0".as_ptr() as *const _,
325                value.to_glib_none_mut().0,
326            );
327            value
328                .get()
329                .expect("Return Value for property `long-press-duration` getter")
330                .unwrap()
331        }
332    }
333
334    /// Sets the minimum duration for a press to be recognized as a long press
335    /// gesture. The duration is expressed in milliseconds.
336    ///
337    /// See also `ClickAction:long-press-duration`.
338    pub fn set_property_long_press_duration(&self, long_press_duration: i32) {
339        unsafe {
340            gobject_sys::g_object_set_property(
341                self.as_ptr() as *mut gobject_sys::GObject,
342                b"long-press-duration\0".as_ptr() as *const _,
343                Value::from(&long_press_duration).to_glib_none().0,
344            );
345        }
346    }
347
348    pub fn get_property_password_hint_time(&self) -> u32 {
349        unsafe {
350            let mut value = Value::from_type(<u32 as StaticType>::static_type());
351            gobject_sys::g_object_get_property(
352                self.as_ptr() as *mut gobject_sys::GObject,
353                b"password-hint-time\0".as_ptr() as *const _,
354                value.to_glib_none_mut().0,
355            );
356            value
357                .get()
358                .expect("Return Value for property `password-hint-time` getter")
359                .unwrap()
360        }
361    }
362
363    pub fn set_property_password_hint_time(&self, password_hint_time: u32) {
364        unsafe {
365            gobject_sys::g_object_set_property(
366                self.as_ptr() as *mut gobject_sys::GObject,
367                b"password-hint-time\0".as_ptr() as *const _,
368                Value::from(&password_hint_time).to_glib_none().0,
369            );
370        }
371    }
372
373    pub fn set_property_unscaled_font_dpi(&self, unscaled_font_dpi: i32) {
374        unsafe {
375            gobject_sys::g_object_set_property(
376                self.as_ptr() as *mut gobject_sys::GObject,
377                b"unscaled-font-dpi\0".as_ptr() as *const _,
378                Value::from(&unscaled_font_dpi).to_glib_none().0,
379            );
380        }
381    }
382
383    pub fn get_property_window_scaling_factor(&self) -> i32 {
384        unsafe {
385            let mut value = Value::from_type(<i32 as StaticType>::static_type());
386            gobject_sys::g_object_get_property(
387                self.as_ptr() as *mut gobject_sys::GObject,
388                b"window-scaling-factor\0".as_ptr() as *const _,
389                value.to_glib_none_mut().0,
390            );
391            value
392                .get()
393                .expect("Return Value for property `window-scaling-factor` getter")
394                .unwrap()
395        }
396    }
397
398    pub fn set_property_window_scaling_factor(&self, window_scaling_factor: i32) {
399        unsafe {
400            gobject_sys::g_object_set_property(
401                self.as_ptr() as *mut gobject_sys::GObject,
402                b"window-scaling-factor\0".as_ptr() as *const _,
403                Value::from(&window_scaling_factor).to_glib_none().0,
404            );
405        }
406    }
407
408    /// Retrieves the singleton instance of `Settings`
409    ///
410    /// # Returns
411    ///
412    /// the instance of `Settings`. The
413    ///  returned object is owned by internals and it should not be unreferenced
414    ///  directly
415    pub fn get_default() -> Option<Settings> {
416        unsafe { from_glib_none(ffi::clutter_settings_get_default()) }
417    }
418
419    pub fn connect_property_dnd_drag_threshold_notify<F: Fn(&Settings) + 'static>(
420        &self,
421        f: F,
422    ) -> SignalHandlerId {
423        unsafe extern "C" fn notify_dnd_drag_threshold_trampoline<F: Fn(&Settings) + 'static>(
424            this: *mut ffi::ClutterSettings,
425            _param_spec: glib_sys::gpointer,
426            f: glib_sys::gpointer,
427        ) {
428            let f: &F = &*(f as *const F);
429            f(&from_glib_borrow(this))
430        }
431        unsafe {
432            let f: Box_<F> = Box_::new(f);
433            connect_raw(
434                self.as_ptr() as *mut _,
435                b"notify::dnd-drag-threshold\0".as_ptr() as *const _,
436                Some(transmute::<_, unsafe extern "C" fn()>(
437                    notify_dnd_drag_threshold_trampoline::<F> as *const (),
438                )),
439                Box_::into_raw(f),
440            )
441        }
442    }
443
444    pub fn connect_property_double_click_distance_notify<F: Fn(&Settings) + 'static>(
445        &self,
446        f: F,
447    ) -> SignalHandlerId {
448        unsafe extern "C" fn notify_double_click_distance_trampoline<F: Fn(&Settings) + 'static>(
449            this: *mut ffi::ClutterSettings,
450            _param_spec: glib_sys::gpointer,
451            f: glib_sys::gpointer,
452        ) {
453            let f: &F = &*(f as *const F);
454            f(&from_glib_borrow(this))
455        }
456        unsafe {
457            let f: Box_<F> = Box_::new(f);
458            connect_raw(
459                self.as_ptr() as *mut _,
460                b"notify::double-click-distance\0".as_ptr() as *const _,
461                Some(transmute::<_, unsafe extern "C" fn()>(
462                    notify_double_click_distance_trampoline::<F> as *const (),
463                )),
464                Box_::into_raw(f),
465            )
466        }
467    }
468
469    pub fn connect_property_double_click_time_notify<F: Fn(&Settings) + 'static>(
470        &self,
471        f: F,
472    ) -> SignalHandlerId {
473        unsafe extern "C" fn notify_double_click_time_trampoline<F: Fn(&Settings) + 'static>(
474            this: *mut ffi::ClutterSettings,
475            _param_spec: glib_sys::gpointer,
476            f: glib_sys::gpointer,
477        ) {
478            let f: &F = &*(f as *const F);
479            f(&from_glib_borrow(this))
480        }
481        unsafe {
482            let f: Box_<F> = Box_::new(f);
483            connect_raw(
484                self.as_ptr() as *mut _,
485                b"notify::double-click-time\0".as_ptr() as *const _,
486                Some(transmute::<_, unsafe extern "C" fn()>(
487                    notify_double_click_time_trampoline::<F> as *const (),
488                )),
489                Box_::into_raw(f),
490            )
491        }
492    }
493
494    pub fn connect_property_font_antialias_notify<F: Fn(&Settings) + 'static>(
495        &self,
496        f: F,
497    ) -> SignalHandlerId {
498        unsafe extern "C" fn notify_font_antialias_trampoline<F: Fn(&Settings) + 'static>(
499            this: *mut ffi::ClutterSettings,
500            _param_spec: glib_sys::gpointer,
501            f: glib_sys::gpointer,
502        ) {
503            let f: &F = &*(f as *const F);
504            f(&from_glib_borrow(this))
505        }
506        unsafe {
507            let f: Box_<F> = Box_::new(f);
508            connect_raw(
509                self.as_ptr() as *mut _,
510                b"notify::font-antialias\0".as_ptr() as *const _,
511                Some(transmute::<_, unsafe extern "C" fn()>(
512                    notify_font_antialias_trampoline::<F> as *const (),
513                )),
514                Box_::into_raw(f),
515            )
516        }
517    }
518
519    pub fn connect_property_font_dpi_notify<F: Fn(&Settings) + 'static>(
520        &self,
521        f: F,
522    ) -> SignalHandlerId {
523        unsafe extern "C" fn notify_font_dpi_trampoline<F: Fn(&Settings) + 'static>(
524            this: *mut ffi::ClutterSettings,
525            _param_spec: glib_sys::gpointer,
526            f: glib_sys::gpointer,
527        ) {
528            let f: &F = &*(f as *const F);
529            f(&from_glib_borrow(this))
530        }
531        unsafe {
532            let f: Box_<F> = Box_::new(f);
533            connect_raw(
534                self.as_ptr() as *mut _,
535                b"notify::font-dpi\0".as_ptr() as *const _,
536                Some(transmute::<_, unsafe extern "C" fn()>(
537                    notify_font_dpi_trampoline::<F> as *const (),
538                )),
539                Box_::into_raw(f),
540            )
541        }
542    }
543
544    pub fn connect_property_font_hint_style_notify<F: Fn(&Settings) + 'static>(
545        &self,
546        f: F,
547    ) -> SignalHandlerId {
548        unsafe extern "C" fn notify_font_hint_style_trampoline<F: Fn(&Settings) + 'static>(
549            this: *mut ffi::ClutterSettings,
550            _param_spec: glib_sys::gpointer,
551            f: glib_sys::gpointer,
552        ) {
553            let f: &F = &*(f as *const F);
554            f(&from_glib_borrow(this))
555        }
556        unsafe {
557            let f: Box_<F> = Box_::new(f);
558            connect_raw(
559                self.as_ptr() as *mut _,
560                b"notify::font-hint-style\0".as_ptr() as *const _,
561                Some(transmute::<_, unsafe extern "C" fn()>(
562                    notify_font_hint_style_trampoline::<F> as *const (),
563                )),
564                Box_::into_raw(f),
565            )
566        }
567    }
568
569    pub fn connect_property_font_hinting_notify<F: Fn(&Settings) + 'static>(
570        &self,
571        f: F,
572    ) -> SignalHandlerId {
573        unsafe extern "C" fn notify_font_hinting_trampoline<F: Fn(&Settings) + 'static>(
574            this: *mut ffi::ClutterSettings,
575            _param_spec: glib_sys::gpointer,
576            f: glib_sys::gpointer,
577        ) {
578            let f: &F = &*(f as *const F);
579            f(&from_glib_borrow(this))
580        }
581        unsafe {
582            let f: Box_<F> = Box_::new(f);
583            connect_raw(
584                self.as_ptr() as *mut _,
585                b"notify::font-hinting\0".as_ptr() as *const _,
586                Some(transmute::<_, unsafe extern "C" fn()>(
587                    notify_font_hinting_trampoline::<F> as *const (),
588                )),
589                Box_::into_raw(f),
590            )
591        }
592    }
593
594    pub fn connect_property_font_name_notify<F: Fn(&Settings) + 'static>(
595        &self,
596        f: F,
597    ) -> SignalHandlerId {
598        unsafe extern "C" fn notify_font_name_trampoline<F: Fn(&Settings) + 'static>(
599            this: *mut ffi::ClutterSettings,
600            _param_spec: glib_sys::gpointer,
601            f: glib_sys::gpointer,
602        ) {
603            let f: &F = &*(f as *const F);
604            f(&from_glib_borrow(this))
605        }
606        unsafe {
607            let f: Box_<F> = Box_::new(f);
608            connect_raw(
609                self.as_ptr() as *mut _,
610                b"notify::font-name\0".as_ptr() as *const _,
611                Some(transmute::<_, unsafe extern "C" fn()>(
612                    notify_font_name_trampoline::<F> as *const (),
613                )),
614                Box_::into_raw(f),
615            )
616        }
617    }
618
619    pub fn connect_property_font_subpixel_order_notify<F: Fn(&Settings) + 'static>(
620        &self,
621        f: F,
622    ) -> SignalHandlerId {
623        unsafe extern "C" fn notify_font_subpixel_order_trampoline<F: Fn(&Settings) + 'static>(
624            this: *mut ffi::ClutterSettings,
625            _param_spec: glib_sys::gpointer,
626            f: glib_sys::gpointer,
627        ) {
628            let f: &F = &*(f as *const F);
629            f(&from_glib_borrow(this))
630        }
631        unsafe {
632            let f: Box_<F> = Box_::new(f);
633            connect_raw(
634                self.as_ptr() as *mut _,
635                b"notify::font-subpixel-order\0".as_ptr() as *const _,
636                Some(transmute::<_, unsafe extern "C" fn()>(
637                    notify_font_subpixel_order_trampoline::<F> as *const (),
638                )),
639                Box_::into_raw(f),
640            )
641        }
642    }
643
644    pub fn connect_property_fontconfig_timestamp_notify<F: Fn(&Settings) + 'static>(
645        &self,
646        f: F,
647    ) -> SignalHandlerId {
648        unsafe extern "C" fn notify_fontconfig_timestamp_trampoline<F: Fn(&Settings) + 'static>(
649            this: *mut ffi::ClutterSettings,
650            _param_spec: glib_sys::gpointer,
651            f: glib_sys::gpointer,
652        ) {
653            let f: &F = &*(f as *const F);
654            f(&from_glib_borrow(this))
655        }
656        unsafe {
657            let f: Box_<F> = Box_::new(f);
658            connect_raw(
659                self.as_ptr() as *mut _,
660                b"notify::fontconfig-timestamp\0".as_ptr() as *const _,
661                Some(transmute::<_, unsafe extern "C" fn()>(
662                    notify_fontconfig_timestamp_trampoline::<F> as *const (),
663                )),
664                Box_::into_raw(f),
665            )
666        }
667    }
668
669    pub fn connect_property_long_press_duration_notify<F: Fn(&Settings) + 'static>(
670        &self,
671        f: F,
672    ) -> SignalHandlerId {
673        unsafe extern "C" fn notify_long_press_duration_trampoline<F: Fn(&Settings) + 'static>(
674            this: *mut ffi::ClutterSettings,
675            _param_spec: glib_sys::gpointer,
676            f: glib_sys::gpointer,
677        ) {
678            let f: &F = &*(f as *const F);
679            f(&from_glib_borrow(this))
680        }
681        unsafe {
682            let f: Box_<F> = Box_::new(f);
683            connect_raw(
684                self.as_ptr() as *mut _,
685                b"notify::long-press-duration\0".as_ptr() as *const _,
686                Some(transmute::<_, unsafe extern "C" fn()>(
687                    notify_long_press_duration_trampoline::<F> as *const (),
688                )),
689                Box_::into_raw(f),
690            )
691        }
692    }
693
694    pub fn connect_property_password_hint_time_notify<F: Fn(&Settings) + 'static>(
695        &self,
696        f: F,
697    ) -> SignalHandlerId {
698        unsafe extern "C" fn notify_password_hint_time_trampoline<F: Fn(&Settings) + 'static>(
699            this: *mut ffi::ClutterSettings,
700            _param_spec: glib_sys::gpointer,
701            f: glib_sys::gpointer,
702        ) {
703            let f: &F = &*(f as *const F);
704            f(&from_glib_borrow(this))
705        }
706        unsafe {
707            let f: Box_<F> = Box_::new(f);
708            connect_raw(
709                self.as_ptr() as *mut _,
710                b"notify::password-hint-time\0".as_ptr() as *const _,
711                Some(transmute::<_, unsafe extern "C" fn()>(
712                    notify_password_hint_time_trampoline::<F> as *const (),
713                )),
714                Box_::into_raw(f),
715            )
716        }
717    }
718
719    pub fn connect_property_unscaled_font_dpi_notify<F: Fn(&Settings) + 'static>(
720        &self,
721        f: F,
722    ) -> SignalHandlerId {
723        unsafe extern "C" fn notify_unscaled_font_dpi_trampoline<F: Fn(&Settings) + 'static>(
724            this: *mut ffi::ClutterSettings,
725            _param_spec: glib_sys::gpointer,
726            f: glib_sys::gpointer,
727        ) {
728            let f: &F = &*(f as *const F);
729            f(&from_glib_borrow(this))
730        }
731        unsafe {
732            let f: Box_<F> = Box_::new(f);
733            connect_raw(
734                self.as_ptr() as *mut _,
735                b"notify::unscaled-font-dpi\0".as_ptr() as *const _,
736                Some(transmute::<_, unsafe extern "C" fn()>(
737                    notify_unscaled_font_dpi_trampoline::<F> as *const (),
738                )),
739                Box_::into_raw(f),
740            )
741        }
742    }
743
744    pub fn connect_property_window_scaling_factor_notify<F: Fn(&Settings) + 'static>(
745        &self,
746        f: F,
747    ) -> SignalHandlerId {
748        unsafe extern "C" fn notify_window_scaling_factor_trampoline<F: Fn(&Settings) + 'static>(
749            this: *mut ffi::ClutterSettings,
750            _param_spec: glib_sys::gpointer,
751            f: glib_sys::gpointer,
752        ) {
753            let f: &F = &*(f as *const F);
754            f(&from_glib_borrow(this))
755        }
756        unsafe {
757            let f: Box_<F> = Box_::new(f);
758            connect_raw(
759                self.as_ptr() as *mut _,
760                b"notify::window-scaling-factor\0".as_ptr() as *const _,
761                Some(transmute::<_, unsafe extern "C" fn()>(
762                    notify_window_scaling_factor_trampoline::<F> as *const (),
763                )),
764                Box_::into_raw(f),
765            )
766        }
767    }
768}
769
770impl fmt::Display for Settings {
771    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
772        write!(f, "Settings")
773    }
774}