Skip to main content

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