gtk4/auto/
adjustment.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
5use crate::ffi;
6use glib::{
7    object::ObjectType as _,
8    prelude::*,
9    signal::{connect_raw, SignalHandlerId},
10    translate::*,
11};
12use std::boxed::Box as Box_;
13
14glib::wrapper! {
15    /// A model for a numeric value.
16    ///
17    /// The [`Adjustment`][crate::Adjustment] has an associated lower and upper bound.
18    /// It also contains step and page increments, and a page size.
19    ///
20    /// Adjustments are used within several GTK widgets, including
21    /// [`SpinButton`][crate::SpinButton], [`Viewport`][crate::Viewport], [`Scrollbar`][crate::Scrollbar]
22    /// and [`Scale`][crate::Scale].
23    ///
24    /// The [`Adjustment`][crate::Adjustment] object does not update the value itself. Instead
25    /// it is left up to the owner of the [`Adjustment`][crate::Adjustment] to control the value.
26    ///
27    /// ## Properties
28    ///
29    ///
30    /// #### `lower`
31    ///  The minimum value of the adjustment.
32    ///
33    /// Readable | Writeable
34    ///
35    ///
36    /// #### `page-increment`
37    ///  The page increment of the adjustment.
38    ///
39    /// Readable | Writeable
40    ///
41    ///
42    /// #### `page-size`
43    ///  The page size of the adjustment.
44    ///
45    /// Note that the page-size is irrelevant and should be set to zero
46    /// if the adjustment is used for a simple scalar value, e.g. in a
47    /// [`SpinButton`][crate::SpinButton].
48    ///
49    /// Readable | Writeable
50    ///
51    ///
52    /// #### `step-increment`
53    ///  The step increment of the adjustment.
54    ///
55    /// Readable | Writeable
56    ///
57    ///
58    /// #### `upper`
59    ///  The maximum value of the adjustment.
60    ///
61    /// Note that values will be restricted by `upper - page-size` if the page-size
62    /// property is nonzero.
63    ///
64    /// Readable | Writeable
65    ///
66    ///
67    /// #### `value`
68    ///  The value of the adjustment.
69    ///
70    /// Readable | Writeable
71    ///
72    /// ## Signals
73    ///
74    ///
75    /// #### `changed`
76    ///  Emitted when one or more of the [`Adjustment`][crate::Adjustment] properties have been
77    /// changed.
78    ///
79    /// Note that the [`value`][struct@crate::Adjustment#value] property is
80    /// covered by the [`value-changed`][struct@crate::Adjustment#value-changed] signal.
81    ///
82    ///
83    ///
84    ///
85    /// #### `value-changed`
86    ///  Emitted when the value has been changed.
87    ///
88    ///
89    ///
90    /// # Implements
91    ///
92    /// [`AdjustmentExt`][trait@crate::prelude::AdjustmentExt], [`trait@glib::ObjectExt`]
93    #[doc(alias = "GtkAdjustment")]
94    pub struct Adjustment(Object<ffi::GtkAdjustment, ffi::GtkAdjustmentClass>);
95
96    match fn {
97        type_ => || ffi::gtk_adjustment_get_type(),
98    }
99}
100
101impl Adjustment {
102    pub const NONE: Option<&'static Adjustment> = None;
103
104    /// Creates a new [`Adjustment`][crate::Adjustment].
105    /// ## `value`
106    /// the initial value
107    /// ## `lower`
108    /// the minimum value
109    /// ## `upper`
110    /// the maximum value
111    /// ## `step_increment`
112    /// the step increment
113    /// ## `page_increment`
114    /// the page increment
115    /// ## `page_size`
116    /// the page size
117    ///
118    /// # Returns
119    ///
120    /// a new [`Adjustment`][crate::Adjustment]
121    #[doc(alias = "gtk_adjustment_new")]
122    pub fn new(
123        value: f64,
124        lower: f64,
125        upper: f64,
126        step_increment: f64,
127        page_increment: f64,
128        page_size: f64,
129    ) -> Adjustment {
130        assert_initialized_main_thread!();
131        unsafe {
132            from_glib_none(ffi::gtk_adjustment_new(
133                value,
134                lower,
135                upper,
136                step_increment,
137                page_increment,
138                page_size,
139            ))
140        }
141    }
142
143    // rustdoc-stripper-ignore-next
144    /// Creates a new builder-pattern struct instance to construct [`Adjustment`] objects.
145    ///
146    /// This method returns an instance of [`AdjustmentBuilder`](crate::builders::AdjustmentBuilder) which can be used to create [`Adjustment`] objects.
147    pub fn builder() -> AdjustmentBuilder {
148        AdjustmentBuilder::new()
149    }
150}
151
152impl Default for Adjustment {
153    fn default() -> Self {
154        glib::object::Object::new::<Self>()
155    }
156}
157
158// rustdoc-stripper-ignore-next
159/// A [builder-pattern] type to construct [`Adjustment`] objects.
160///
161/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
162#[must_use = "The builder must be built to be used"]
163pub struct AdjustmentBuilder {
164    builder: glib::object::ObjectBuilder<'static, Adjustment>,
165}
166
167impl AdjustmentBuilder {
168    fn new() -> Self {
169        Self {
170            builder: glib::object::Object::builder(),
171        }
172    }
173
174    /// The minimum value of the adjustment.
175    pub fn lower(self, lower: f64) -> Self {
176        Self {
177            builder: self.builder.property("lower", lower),
178        }
179    }
180
181    /// The page increment of the adjustment.
182    pub fn page_increment(self, page_increment: f64) -> Self {
183        Self {
184            builder: self.builder.property("page-increment", page_increment),
185        }
186    }
187
188    /// The page size of the adjustment.
189    ///
190    /// Note that the page-size is irrelevant and should be set to zero
191    /// if the adjustment is used for a simple scalar value, e.g. in a
192    /// [`SpinButton`][crate::SpinButton].
193    pub fn page_size(self, page_size: f64) -> Self {
194        Self {
195            builder: self.builder.property("page-size", page_size),
196        }
197    }
198
199    /// The step increment of the adjustment.
200    pub fn step_increment(self, step_increment: f64) -> Self {
201        Self {
202            builder: self.builder.property("step-increment", step_increment),
203        }
204    }
205
206    /// The maximum value of the adjustment.
207    ///
208    /// Note that values will be restricted by `upper - page-size` if the page-size
209    /// property is nonzero.
210    pub fn upper(self, upper: f64) -> Self {
211        Self {
212            builder: self.builder.property("upper", upper),
213        }
214    }
215
216    /// The value of the adjustment.
217    pub fn value(self, value: f64) -> Self {
218        Self {
219            builder: self.builder.property("value", value),
220        }
221    }
222
223    // rustdoc-stripper-ignore-next
224    /// Build the [`Adjustment`].
225    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
226    pub fn build(self) -> Adjustment {
227        assert_initialized_main_thread!();
228        self.builder.build()
229    }
230}
231
232mod sealed {
233    pub trait Sealed {}
234    impl<T: super::IsA<super::Adjustment>> Sealed for T {}
235}
236
237/// Trait containing all [`struct@Adjustment`] methods.
238///
239/// # Implementors
240///
241/// [`Adjustment`][struct@crate::Adjustment]
242pub trait AdjustmentExt: IsA<Adjustment> + sealed::Sealed + 'static {
243    /// Updates the value of the adjustment to ensure that the
244    /// given range is contained in the current page.
245    ///
246    /// The current page goes from `value` to `value` + `page-size`.
247    /// If the range is larger than the page size, then only the
248    /// start of it will be in the current page.
249    ///
250    /// A [`value-changed`][struct@crate::Adjustment#value-changed] signal will be emitted
251    /// if the value is changed.
252    /// ## `lower`
253    /// the lower value
254    /// ## `upper`
255    /// the upper value
256    #[doc(alias = "gtk_adjustment_clamp_page")]
257    fn clamp_page(&self, lower: f64, upper: f64) {
258        unsafe {
259            ffi::gtk_adjustment_clamp_page(self.as_ref().to_glib_none().0, lower, upper);
260        }
261    }
262
263    /// Sets all properties of the adjustment at once.
264    ///
265    /// Use this function to avoid multiple emissions of the
266    /// [`changed`][struct@crate::Adjustment#changed] signal. See
267    /// [`set_lower()`][Self::set_lower()] for an alternative
268    /// way of compressing multiple emissions of
269    /// [`changed`][struct@crate::Adjustment#changed] into one.
270    /// ## `value`
271    /// the new value
272    /// ## `lower`
273    /// the new minimum value
274    /// ## `upper`
275    /// the new maximum value
276    /// ## `step_increment`
277    /// the new step increment
278    /// ## `page_increment`
279    /// the new page increment
280    /// ## `page_size`
281    /// the new page size
282    #[doc(alias = "gtk_adjustment_configure")]
283    fn configure(
284        &self,
285        value: f64,
286        lower: f64,
287        upper: f64,
288        step_increment: f64,
289        page_increment: f64,
290        page_size: f64,
291    ) {
292        unsafe {
293            ffi::gtk_adjustment_configure(
294                self.as_ref().to_glib_none().0,
295                value,
296                lower,
297                upper,
298                step_increment,
299                page_increment,
300                page_size,
301            );
302        }
303    }
304
305    /// Retrieves the minimum value of the adjustment.
306    ///
307    /// # Returns
308    ///
309    /// the minimum value
310    #[doc(alias = "gtk_adjustment_get_lower")]
311    #[doc(alias = "get_lower")]
312    fn lower(&self) -> f64 {
313        unsafe { ffi::gtk_adjustment_get_lower(self.as_ref().to_glib_none().0) }
314    }
315
316    /// Gets the smaller of step increment and page increment.
317    ///
318    /// # Returns
319    ///
320    /// the minimum increment
321    #[doc(alias = "gtk_adjustment_get_minimum_increment")]
322    #[doc(alias = "get_minimum_increment")]
323    fn minimum_increment(&self) -> f64 {
324        unsafe { ffi::gtk_adjustment_get_minimum_increment(self.as_ref().to_glib_none().0) }
325    }
326
327    /// Retrieves the page increment of the adjustment.
328    ///
329    /// # Returns
330    ///
331    /// the page increment
332    #[doc(alias = "gtk_adjustment_get_page_increment")]
333    #[doc(alias = "get_page_increment")]
334    #[doc(alias = "page-increment")]
335    fn page_increment(&self) -> f64 {
336        unsafe { ffi::gtk_adjustment_get_page_increment(self.as_ref().to_glib_none().0) }
337    }
338
339    /// Retrieves the page size of the adjustment.
340    ///
341    /// # Returns
342    ///
343    /// the page size
344    #[doc(alias = "gtk_adjustment_get_page_size")]
345    #[doc(alias = "get_page_size")]
346    #[doc(alias = "page-size")]
347    fn page_size(&self) -> f64 {
348        unsafe { ffi::gtk_adjustment_get_page_size(self.as_ref().to_glib_none().0) }
349    }
350
351    /// Retrieves the step increment of the adjustment.
352    ///
353    /// # Returns
354    ///
355    /// the step increment
356    #[doc(alias = "gtk_adjustment_get_step_increment")]
357    #[doc(alias = "get_step_increment")]
358    #[doc(alias = "step-increment")]
359    fn step_increment(&self) -> f64 {
360        unsafe { ffi::gtk_adjustment_get_step_increment(self.as_ref().to_glib_none().0) }
361    }
362
363    /// Retrieves the maximum value of the adjustment.
364    ///
365    /// # Returns
366    ///
367    /// the maximum value
368    #[doc(alias = "gtk_adjustment_get_upper")]
369    #[doc(alias = "get_upper")]
370    fn upper(&self) -> f64 {
371        unsafe { ffi::gtk_adjustment_get_upper(self.as_ref().to_glib_none().0) }
372    }
373
374    /// Gets the current value of the adjustment.
375    ///
376    /// # Returns
377    ///
378    /// the current value
379    #[doc(alias = "gtk_adjustment_get_value")]
380    #[doc(alias = "get_value")]
381    fn value(&self) -> f64 {
382        unsafe { ffi::gtk_adjustment_get_value(self.as_ref().to_glib_none().0) }
383    }
384
385    /// Sets the minimum value of the adjustment.
386    ///
387    /// When setting multiple adjustment properties via their individual
388    /// setters, multiple [`changed`][struct@crate::Adjustment#changed] signals will
389    /// be emitted. However, since the emission of the
390    /// [`changed`][struct@crate::Adjustment#changed] signal is tied to the emission
391    /// of the ::notify signals of the changed properties, it’s possible
392    /// to compress the [`changed`][struct@crate::Adjustment#changed] signals into one
393    /// by calling g_object_freeze_notify() and g_object_thaw_notify()
394    /// around the calls to the individual setters.
395    ///
396    /// Alternatively, using a single g_object_set() for all the properties
397    /// to change, or using [`configure()`][Self::configure()] has the same effect.
398    /// ## `lower`
399    /// the new minimum value
400    #[doc(alias = "gtk_adjustment_set_lower")]
401    #[doc(alias = "lower")]
402    fn set_lower(&self, lower: f64) {
403        unsafe {
404            ffi::gtk_adjustment_set_lower(self.as_ref().to_glib_none().0, lower);
405        }
406    }
407
408    /// Sets the page increment of the adjustment.
409    ///
410    /// See [`set_lower()`][Self::set_lower()] about how to compress
411    /// multiple emissions of the [`changed`][struct@crate::Adjustment#changed]
412    /// signal when setting multiple adjustment properties.
413    /// ## `page_increment`
414    /// the new page increment
415    #[doc(alias = "gtk_adjustment_set_page_increment")]
416    #[doc(alias = "page-increment")]
417    fn set_page_increment(&self, page_increment: f64) {
418        unsafe {
419            ffi::gtk_adjustment_set_page_increment(self.as_ref().to_glib_none().0, page_increment);
420        }
421    }
422
423    /// Sets the page size of the adjustment.
424    ///
425    /// See [`set_lower()`][Self::set_lower()] about how to compress
426    /// multiple emissions of the [`changed`][struct@crate::Adjustment#changed]
427    /// signal when setting multiple adjustment properties.
428    /// ## `page_size`
429    /// the new page size
430    #[doc(alias = "gtk_adjustment_set_page_size")]
431    #[doc(alias = "page-size")]
432    fn set_page_size(&self, page_size: f64) {
433        unsafe {
434            ffi::gtk_adjustment_set_page_size(self.as_ref().to_glib_none().0, page_size);
435        }
436    }
437
438    /// Sets the step increment of the adjustment.
439    ///
440    /// See [`set_lower()`][Self::set_lower()] about how to compress
441    /// multiple emissions of the [`changed`][struct@crate::Adjustment#changed]
442    /// signal when setting multiple adjustment properties.
443    /// ## `step_increment`
444    /// the new step increment
445    #[doc(alias = "gtk_adjustment_set_step_increment")]
446    #[doc(alias = "step-increment")]
447    fn set_step_increment(&self, step_increment: f64) {
448        unsafe {
449            ffi::gtk_adjustment_set_step_increment(self.as_ref().to_glib_none().0, step_increment);
450        }
451    }
452
453    /// Sets the maximum value of the adjustment.
454    ///
455    /// Note that values will be restricted by `upper - page-size`
456    /// if the page-size property is nonzero.
457    ///
458    /// See [`set_lower()`][Self::set_lower()] about how to compress
459    /// multiple emissions of the [`changed`][struct@crate::Adjustment#changed]
460    /// signal when setting multiple adjustment properties.
461    /// ## `upper`
462    /// the new maximum value
463    #[doc(alias = "gtk_adjustment_set_upper")]
464    #[doc(alias = "upper")]
465    fn set_upper(&self, upper: f64) {
466        unsafe {
467            ffi::gtk_adjustment_set_upper(self.as_ref().to_glib_none().0, upper);
468        }
469    }
470
471    /// Sets the [`Adjustment`][crate::Adjustment] value.
472    ///
473    /// The value is clamped to lie between [`lower`][struct@crate::Adjustment#lower]
474    /// and [`upper`][struct@crate::Adjustment#upper].
475    ///
476    /// Note that for adjustments which are used in a [`Scrollbar`][crate::Scrollbar],
477    /// the effective range of allowed values goes from
478    /// [`lower`][struct@crate::Adjustment#lower] to
479    /// [`upper`][struct@crate::Adjustment#upper] - [`page-size`][struct@crate::Adjustment#page-size].
480    /// ## `value`
481    /// the new value
482    #[doc(alias = "gtk_adjustment_set_value")]
483    #[doc(alias = "value")]
484    fn set_value(&self, value: f64) {
485        unsafe {
486            ffi::gtk_adjustment_set_value(self.as_ref().to_glib_none().0, value);
487        }
488    }
489
490    /// Emitted when one or more of the [`Adjustment`][crate::Adjustment] properties have been
491    /// changed.
492    ///
493    /// Note that the [`value`][struct@crate::Adjustment#value] property is
494    /// covered by the [`value-changed`][struct@crate::Adjustment#value-changed] signal.
495    #[doc(alias = "changed")]
496    fn connect_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
497        unsafe extern "C" fn changed_trampoline<P: IsA<Adjustment>, F: Fn(&P) + 'static>(
498            this: *mut ffi::GtkAdjustment,
499            f: glib::ffi::gpointer,
500        ) {
501            let f: &F = &*(f as *const F);
502            f(Adjustment::from_glib_borrow(this).unsafe_cast_ref())
503        }
504        unsafe {
505            let f: Box_<F> = Box_::new(f);
506            connect_raw(
507                self.as_ptr() as *mut _,
508                b"changed\0".as_ptr() as *const _,
509                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
510                    changed_trampoline::<Self, F> as *const (),
511                )),
512                Box_::into_raw(f),
513            )
514        }
515    }
516
517    /// Emitted when the value has been changed.
518    #[doc(alias = "value-changed")]
519    fn connect_value_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
520        unsafe extern "C" fn value_changed_trampoline<P: IsA<Adjustment>, F: Fn(&P) + 'static>(
521            this: *mut ffi::GtkAdjustment,
522            f: glib::ffi::gpointer,
523        ) {
524            let f: &F = &*(f as *const F);
525            f(Adjustment::from_glib_borrow(this).unsafe_cast_ref())
526        }
527        unsafe {
528            let f: Box_<F> = Box_::new(f);
529            connect_raw(
530                self.as_ptr() as *mut _,
531                b"value-changed\0".as_ptr() as *const _,
532                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
533                    value_changed_trampoline::<Self, F> as *const (),
534                )),
535                Box_::into_raw(f),
536            )
537        }
538    }
539
540    #[doc(alias = "lower")]
541    fn connect_lower_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
542        unsafe extern "C" fn notify_lower_trampoline<P: IsA<Adjustment>, F: Fn(&P) + 'static>(
543            this: *mut ffi::GtkAdjustment,
544            _param_spec: glib::ffi::gpointer,
545            f: glib::ffi::gpointer,
546        ) {
547            let f: &F = &*(f as *const F);
548            f(Adjustment::from_glib_borrow(this).unsafe_cast_ref())
549        }
550        unsafe {
551            let f: Box_<F> = Box_::new(f);
552            connect_raw(
553                self.as_ptr() as *mut _,
554                b"notify::lower\0".as_ptr() as *const _,
555                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
556                    notify_lower_trampoline::<Self, F> as *const (),
557                )),
558                Box_::into_raw(f),
559            )
560        }
561    }
562
563    #[doc(alias = "page-increment")]
564    fn connect_page_increment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
565        unsafe extern "C" fn notify_page_increment_trampoline<
566            P: IsA<Adjustment>,
567            F: Fn(&P) + 'static,
568        >(
569            this: *mut ffi::GtkAdjustment,
570            _param_spec: glib::ffi::gpointer,
571            f: glib::ffi::gpointer,
572        ) {
573            let f: &F = &*(f as *const F);
574            f(Adjustment::from_glib_borrow(this).unsafe_cast_ref())
575        }
576        unsafe {
577            let f: Box_<F> = Box_::new(f);
578            connect_raw(
579                self.as_ptr() as *mut _,
580                b"notify::page-increment\0".as_ptr() as *const _,
581                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
582                    notify_page_increment_trampoline::<Self, F> as *const (),
583                )),
584                Box_::into_raw(f),
585            )
586        }
587    }
588
589    #[doc(alias = "page-size")]
590    fn connect_page_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
591        unsafe extern "C" fn notify_page_size_trampoline<
592            P: IsA<Adjustment>,
593            F: Fn(&P) + 'static,
594        >(
595            this: *mut ffi::GtkAdjustment,
596            _param_spec: glib::ffi::gpointer,
597            f: glib::ffi::gpointer,
598        ) {
599            let f: &F = &*(f as *const F);
600            f(Adjustment::from_glib_borrow(this).unsafe_cast_ref())
601        }
602        unsafe {
603            let f: Box_<F> = Box_::new(f);
604            connect_raw(
605                self.as_ptr() as *mut _,
606                b"notify::page-size\0".as_ptr() as *const _,
607                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
608                    notify_page_size_trampoline::<Self, F> as *const (),
609                )),
610                Box_::into_raw(f),
611            )
612        }
613    }
614
615    #[doc(alias = "step-increment")]
616    fn connect_step_increment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
617        unsafe extern "C" fn notify_step_increment_trampoline<
618            P: IsA<Adjustment>,
619            F: Fn(&P) + 'static,
620        >(
621            this: *mut ffi::GtkAdjustment,
622            _param_spec: glib::ffi::gpointer,
623            f: glib::ffi::gpointer,
624        ) {
625            let f: &F = &*(f as *const F);
626            f(Adjustment::from_glib_borrow(this).unsafe_cast_ref())
627        }
628        unsafe {
629            let f: Box_<F> = Box_::new(f);
630            connect_raw(
631                self.as_ptr() as *mut _,
632                b"notify::step-increment\0".as_ptr() as *const _,
633                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
634                    notify_step_increment_trampoline::<Self, F> as *const (),
635                )),
636                Box_::into_raw(f),
637            )
638        }
639    }
640
641    #[doc(alias = "upper")]
642    fn connect_upper_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
643        unsafe extern "C" fn notify_upper_trampoline<P: IsA<Adjustment>, F: Fn(&P) + 'static>(
644            this: *mut ffi::GtkAdjustment,
645            _param_spec: glib::ffi::gpointer,
646            f: glib::ffi::gpointer,
647        ) {
648            let f: &F = &*(f as *const F);
649            f(Adjustment::from_glib_borrow(this).unsafe_cast_ref())
650        }
651        unsafe {
652            let f: Box_<F> = Box_::new(f);
653            connect_raw(
654                self.as_ptr() as *mut _,
655                b"notify::upper\0".as_ptr() as *const _,
656                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
657                    notify_upper_trampoline::<Self, F> as *const (),
658                )),
659                Box_::into_raw(f),
660            )
661        }
662    }
663
664    #[doc(alias = "value")]
665    fn connect_value_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
666        unsafe extern "C" fn notify_value_trampoline<P: IsA<Adjustment>, F: Fn(&P) + 'static>(
667            this: *mut ffi::GtkAdjustment,
668            _param_spec: glib::ffi::gpointer,
669            f: glib::ffi::gpointer,
670        ) {
671            let f: &F = &*(f as *const F);
672            f(Adjustment::from_glib_borrow(this).unsafe_cast_ref())
673        }
674        unsafe {
675            let f: Box_<F> = Box_::new(f);
676            connect_raw(
677                self.as_ptr() as *mut _,
678                b"notify::value\0".as_ptr() as *const _,
679                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
680                    notify_value_trampoline::<Self, F> as *const (),
681                )),
682                Box_::into_raw(f),
683            )
684        }
685    }
686}
687
688impl<O: IsA<Adjustment>> AdjustmentExt for O {}