Skip to main content

gtk/auto/
cell_renderer_pixbuf.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::{CellRenderer, CellRendererMode, ffi};
6use glib::{
7    prelude::*,
8    signal::{SignalHandlerId, connect_raw},
9    translate::*,
10};
11use std::boxed::Box as Box_;
12
13glib::wrapper! {
14    /// A [`CellRendererPixbuf`][crate::CellRendererPixbuf] can be used to render an image in a cell. It allows
15    /// to render either a given [`gdk_pixbuf::Pixbuf`][crate::gdk_pixbuf::Pixbuf] (set via the
16    /// [`pixbuf`][struct@crate::CellRendererPixbuf#pixbuf] property) or a named icon (set via the
17    /// [`icon-name`][struct@crate::CellRendererPixbuf#icon-name] property).
18    ///
19    /// To support the tree view, [`CellRendererPixbuf`][crate::CellRendererPixbuf] also supports rendering two
20    /// alternative pixbufs, when the [`is-expander`][struct@crate::CellRenderer#is-expander] property is [`true`].
21    /// If the [`is-expanded`][struct@crate::CellRenderer#is-expanded] property is [`true`] and the
22    /// [`pixbuf-expander-open`][struct@crate::CellRendererPixbuf#pixbuf-expander-open] property is set to a pixbuf, it
23    /// renders that pixbuf, if the [`is-expanded`][struct@crate::CellRenderer#is-expanded] property is [`false`]
24    /// and the [`pixbuf-expander-closed`][struct@crate::CellRendererPixbuf#pixbuf-expander-closed] property is set to a
25    /// pixbuf, it renders that one.
26    ///
27    /// ## Properties
28    ///
29    ///
30    /// #### `follow-state`
31    ///  Specifies whether the rendered pixbuf should be colorized
32    /// according to the [`CellRendererState`][crate::CellRendererState].
33    ///
34    /// Readable | Writable
35    ///
36    ///
37    /// #### `gicon`
38    ///  The GIcon representing the icon to display.
39    /// If the icon theme is changed, the image will be updated
40    /// automatically.
41    ///
42    /// Readable | Writable
43    ///
44    ///
45    /// #### `icon-name`
46    ///  The name of the themed icon to display.
47    /// This property only has an effect if not overridden by "stock_id"
48    /// or "pixbuf" properties.
49    ///
50    /// Readable | Writable
51    ///
52    ///
53    /// #### `pixbuf`
54    ///  Readable | Writable
55    ///
56    ///
57    /// #### `pixbuf-expander-closed`
58    ///  Readable | Writable
59    ///
60    ///
61    /// #### `pixbuf-expander-open`
62    ///  Readable | Writable
63    ///
64    ///
65    /// #### `stock-detail`
66    ///  Readable | Writable
67    ///
68    ///
69    /// #### `stock-id`
70    ///  Readable | Writable
71    ///
72    ///
73    /// #### `stock-size`
74    ///  The [`IconSize`][crate::IconSize] value that specifies the size of the rendered icon.
75    ///
76    /// Readable | Writable
77    ///
78    ///
79    /// #### `surface`
80    ///  Readable | Writable
81    /// <details><summary><h4>CellRenderer</h4></summary>
82    ///
83    ///
84    /// #### `cell-background`
85    ///  Writable
86    ///
87    ///
88    /// #### `cell-background-gdk`
89    ///  Cell background as a `GdkColor`
90    ///
91    /// Readable | Writable
92    ///
93    ///
94    /// #### `cell-background-rgba`
95    ///  Cell background as a [`gdk::RGBA`][crate::gdk::RGBA]
96    ///
97    /// Readable | Writable
98    ///
99    ///
100    /// #### `cell-background-set`
101    ///  Readable | Writable
102    ///
103    ///
104    /// #### `editing`
105    ///  Readable
106    ///
107    ///
108    /// #### `height`
109    ///  Readable | Writable
110    ///
111    ///
112    /// #### `is-expanded`
113    ///  Readable | Writable
114    ///
115    ///
116    /// #### `is-expander`
117    ///  Readable | Writable
118    ///
119    ///
120    /// #### `mode`
121    ///  Readable | Writable
122    ///
123    ///
124    /// #### `sensitive`
125    ///  Readable | Writable
126    ///
127    ///
128    /// #### `visible`
129    ///  Readable | Writable
130    ///
131    ///
132    /// #### `width`
133    ///  Readable | Writable
134    ///
135    ///
136    /// #### `xalign`
137    ///  Readable | Writable
138    ///
139    ///
140    /// #### `xpad`
141    ///  Readable | Writable
142    ///
143    ///
144    /// #### `yalign`
145    ///  Readable | Writable
146    ///
147    ///
148    /// #### `ypad`
149    ///  Readable | Writable
150    /// </details>
151    ///
152    /// # Implements
153    ///
154    /// [`CellRendererPixbufExt`][trait@crate::prelude::CellRendererPixbufExt], [`CellRendererExt`][trait@crate::prelude::CellRendererExt], [`trait@glib::ObjectExt`], [`CellRendererPixbufExtManual`][trait@crate::prelude::CellRendererPixbufExtManual]
155    #[doc(alias = "GtkCellRendererPixbuf")]
156    pub struct CellRendererPixbuf(Object<ffi::GtkCellRendererPixbuf, ffi::GtkCellRendererPixbufClass>) @extends CellRenderer;
157
158    match fn {
159        type_ => || ffi::gtk_cell_renderer_pixbuf_get_type(),
160    }
161}
162
163impl CellRendererPixbuf {
164    pub const NONE: Option<&'static CellRendererPixbuf> = None;
165
166    /// Creates a new [`CellRendererPixbuf`][crate::CellRendererPixbuf]. Adjust rendering
167    /// parameters using object properties. Object properties can be set
168    /// globally (with [`ObjectExt::set()`][crate::glib::prelude::ObjectExt::set()]). Also, with [`TreeViewColumn`][crate::TreeViewColumn], you
169    /// can bind a property to a value in a [`TreeModel`][crate::TreeModel]. For example, you
170    /// can bind the “pixbuf” property on the cell renderer to a pixbuf value
171    /// in the model, thus rendering a different image in each row of the
172    /// [`TreeView`][crate::TreeView].
173    ///
174    /// # Returns
175    ///
176    /// the new cell renderer
177    #[doc(alias = "gtk_cell_renderer_pixbuf_new")]
178    pub fn new() -> CellRendererPixbuf {
179        assert_initialized_main_thread!();
180        unsafe { CellRenderer::from_glib_none(ffi::gtk_cell_renderer_pixbuf_new()).unsafe_cast() }
181    }
182
183    // rustdoc-stripper-ignore-next
184    /// Creates a new builder-pattern struct instance to construct [`CellRendererPixbuf`] objects.
185    ///
186    /// This method returns an instance of [`CellRendererPixbufBuilder`](crate::builders::CellRendererPixbufBuilder) which can be used to create [`CellRendererPixbuf`] objects.
187    pub fn builder() -> CellRendererPixbufBuilder {
188        CellRendererPixbufBuilder::new()
189    }
190}
191
192impl Default for CellRendererPixbuf {
193    fn default() -> Self {
194        Self::new()
195    }
196}
197
198// rustdoc-stripper-ignore-next
199/// A [builder-pattern] type to construct [`CellRendererPixbuf`] objects.
200///
201/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
202#[must_use = "The builder must be built to be used"]
203pub struct CellRendererPixbufBuilder {
204    builder: glib::object::ObjectBuilder<'static, CellRendererPixbuf>,
205}
206
207impl CellRendererPixbufBuilder {
208    fn new() -> Self {
209        Self {
210            builder: glib::object::Object::builder(),
211        }
212    }
213
214    /// The GIcon representing the icon to display.
215    /// If the icon theme is changed, the image will be updated
216    /// automatically.
217    pub fn gicon(self, gicon: &impl IsA<gio::Icon>) -> Self {
218        Self {
219            builder: self.builder.property("gicon", gicon.clone().upcast()),
220        }
221    }
222
223    /// The name of the themed icon to display.
224    /// This property only has an effect if not overridden by "stock_id"
225    /// or "pixbuf" properties.
226    pub fn icon_name(self, icon_name: impl Into<glib::GString>) -> Self {
227        Self {
228            builder: self.builder.property("icon-name", icon_name.into()),
229        }
230    }
231
232    pub fn pixbuf(self, pixbuf: &gdk_pixbuf::Pixbuf) -> Self {
233        Self {
234            builder: self.builder.property("pixbuf", pixbuf.clone()),
235        }
236    }
237
238    pub fn pixbuf_expander_closed(self, pixbuf_expander_closed: &gdk_pixbuf::Pixbuf) -> Self {
239        Self {
240            builder: self
241                .builder
242                .property("pixbuf-expander-closed", pixbuf_expander_closed.clone()),
243        }
244    }
245
246    pub fn pixbuf_expander_open(self, pixbuf_expander_open: &gdk_pixbuf::Pixbuf) -> Self {
247        Self {
248            builder: self
249                .builder
250                .property("pixbuf-expander-open", pixbuf_expander_open.clone()),
251        }
252    }
253
254    pub fn stock_detail(self, stock_detail: impl Into<glib::GString>) -> Self {
255        Self {
256            builder: self.builder.property("stock-detail", stock_detail.into()),
257        }
258    }
259
260    /// The [`IconSize`][crate::IconSize] value that specifies the size of the rendered icon.
261    pub fn stock_size(self, stock_size: u32) -> Self {
262        Self {
263            builder: self.builder.property("stock-size", stock_size),
264        }
265    }
266
267    pub fn surface(self, surface: &cairo::Surface) -> Self {
268        Self {
269            builder: self.builder.property("surface", surface),
270        }
271    }
272
273    pub fn cell_background(self, cell_background: impl Into<glib::GString>) -> Self {
274        Self {
275            builder: self
276                .builder
277                .property("cell-background", cell_background.into()),
278        }
279    }
280
281    /// Cell background as a [`gdk::RGBA`][crate::gdk::RGBA]
282    pub fn cell_background_rgba(self, cell_background_rgba: &gdk::RGBA) -> Self {
283        Self {
284            builder: self
285                .builder
286                .property("cell-background-rgba", cell_background_rgba),
287        }
288    }
289
290    pub fn cell_background_set(self, cell_background_set: bool) -> Self {
291        Self {
292            builder: self
293                .builder
294                .property("cell-background-set", cell_background_set),
295        }
296    }
297
298    pub fn height(self, height: i32) -> Self {
299        Self {
300            builder: self.builder.property("height", height),
301        }
302    }
303
304    pub fn is_expanded(self, is_expanded: bool) -> Self {
305        Self {
306            builder: self.builder.property("is-expanded", is_expanded),
307        }
308    }
309
310    pub fn is_expander(self, is_expander: bool) -> Self {
311        Self {
312            builder: self.builder.property("is-expander", is_expander),
313        }
314    }
315
316    pub fn mode(self, mode: CellRendererMode) -> Self {
317        Self {
318            builder: self.builder.property("mode", mode),
319        }
320    }
321
322    pub fn sensitive(self, sensitive: bool) -> Self {
323        Self {
324            builder: self.builder.property("sensitive", sensitive),
325        }
326    }
327
328    pub fn visible(self, visible: bool) -> Self {
329        Self {
330            builder: self.builder.property("visible", visible),
331        }
332    }
333
334    pub fn width(self, width: i32) -> Self {
335        Self {
336            builder: self.builder.property("width", width),
337        }
338    }
339
340    pub fn xalign(self, xalign: f32) -> Self {
341        Self {
342            builder: self.builder.property("xalign", xalign),
343        }
344    }
345
346    pub fn xpad(self, xpad: u32) -> Self {
347        Self {
348            builder: self.builder.property("xpad", xpad),
349        }
350    }
351
352    pub fn yalign(self, yalign: f32) -> Self {
353        Self {
354            builder: self.builder.property("yalign", yalign),
355        }
356    }
357
358    pub fn ypad(self, ypad: u32) -> Self {
359        Self {
360            builder: self.builder.property("ypad", ypad),
361        }
362    }
363
364    // rustdoc-stripper-ignore-next
365    /// Build the [`CellRendererPixbuf`].
366    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
367    pub fn build(self) -> CellRendererPixbuf {
368        assert_initialized_main_thread!();
369        self.builder.build()
370    }
371}
372
373/// Trait containing all [`struct@CellRendererPixbuf`] methods.
374///
375/// # Implementors
376///
377/// [`CellRendererPixbuf`][struct@crate::CellRendererPixbuf]
378pub trait CellRendererPixbufExt: IsA<CellRendererPixbuf> + 'static {
379    /// The GIcon representing the icon to display.
380    /// If the icon theme is changed, the image will be updated
381    /// automatically.
382    fn gicon(&self) -> Option<gio::Icon> {
383        ObjectExt::property(self.as_ref(), "gicon")
384    }
385
386    /// The GIcon representing the icon to display.
387    /// If the icon theme is changed, the image will be updated
388    /// automatically.
389    fn set_gicon<P: IsA<gio::Icon>>(&self, gicon: Option<&P>) {
390        ObjectExt::set_property(self.as_ref(), "gicon", gicon)
391    }
392
393    /// The name of the themed icon to display.
394    /// This property only has an effect if not overridden by "stock_id"
395    /// or "pixbuf" properties.
396    #[doc(alias = "icon-name")]
397    fn icon_name(&self) -> Option<glib::GString> {
398        ObjectExt::property(self.as_ref(), "icon-name")
399    }
400
401    /// The name of the themed icon to display.
402    /// This property only has an effect if not overridden by "stock_id"
403    /// or "pixbuf" properties.
404    #[doc(alias = "icon-name")]
405    fn set_icon_name(&self, icon_name: Option<&str>) {
406        ObjectExt::set_property(self.as_ref(), "icon-name", icon_name)
407    }
408
409    fn pixbuf(&self) -> Option<gdk_pixbuf::Pixbuf> {
410        ObjectExt::property(self.as_ref(), "pixbuf")
411    }
412
413    fn set_pixbuf(&self, pixbuf: Option<&gdk_pixbuf::Pixbuf>) {
414        ObjectExt::set_property(self.as_ref(), "pixbuf", pixbuf)
415    }
416
417    #[doc(alias = "pixbuf-expander-closed")]
418    fn pixbuf_expander_closed(&self) -> Option<gdk_pixbuf::Pixbuf> {
419        ObjectExt::property(self.as_ref(), "pixbuf-expander-closed")
420    }
421
422    #[doc(alias = "pixbuf-expander-closed")]
423    fn set_pixbuf_expander_closed(&self, pixbuf_expander_closed: Option<&gdk_pixbuf::Pixbuf>) {
424        ObjectExt::set_property(
425            self.as_ref(),
426            "pixbuf-expander-closed",
427            pixbuf_expander_closed,
428        )
429    }
430
431    #[doc(alias = "pixbuf-expander-open")]
432    fn pixbuf_expander_open(&self) -> Option<gdk_pixbuf::Pixbuf> {
433        ObjectExt::property(self.as_ref(), "pixbuf-expander-open")
434    }
435
436    #[doc(alias = "pixbuf-expander-open")]
437    fn set_pixbuf_expander_open(&self, pixbuf_expander_open: Option<&gdk_pixbuf::Pixbuf>) {
438        ObjectExt::set_property(self.as_ref(), "pixbuf-expander-open", pixbuf_expander_open)
439    }
440
441    #[doc(alias = "stock-detail")]
442    fn stock_detail(&self) -> Option<glib::GString> {
443        ObjectExt::property(self.as_ref(), "stock-detail")
444    }
445
446    #[doc(alias = "stock-detail")]
447    fn set_stock_detail(&self, stock_detail: Option<&str>) {
448        ObjectExt::set_property(self.as_ref(), "stock-detail", stock_detail)
449    }
450
451    fn surface(&self) -> Option<cairo::Surface> {
452        ObjectExt::property(self.as_ref(), "surface")
453    }
454
455    fn set_surface(&self, surface: Option<&cairo::Surface>) {
456        ObjectExt::set_property(self.as_ref(), "surface", surface)
457    }
458
459    #[doc(alias = "gicon")]
460    fn connect_gicon_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
461        unsafe extern "C" fn notify_gicon_trampoline<
462            P: IsA<CellRendererPixbuf>,
463            F: Fn(&P) + 'static,
464        >(
465            this: *mut ffi::GtkCellRendererPixbuf,
466            _param_spec: glib::ffi::gpointer,
467            f: glib::ffi::gpointer,
468        ) {
469            unsafe {
470                let f: &F = &*(f as *const F);
471                f(CellRendererPixbuf::from_glib_borrow(this).unsafe_cast_ref())
472            }
473        }
474        unsafe {
475            let f: Box_<F> = Box_::new(f);
476            connect_raw(
477                self.as_ptr() as *mut _,
478                c"notify::gicon".as_ptr(),
479                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
480                    notify_gicon_trampoline::<Self, F> as *const (),
481                )),
482                Box_::into_raw(f),
483            )
484        }
485    }
486
487    #[doc(alias = "icon-name")]
488    fn connect_icon_name_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
489        unsafe extern "C" fn notify_icon_name_trampoline<
490            P: IsA<CellRendererPixbuf>,
491            F: Fn(&P) + 'static,
492        >(
493            this: *mut ffi::GtkCellRendererPixbuf,
494            _param_spec: glib::ffi::gpointer,
495            f: glib::ffi::gpointer,
496        ) {
497            unsafe {
498                let f: &F = &*(f as *const F);
499                f(CellRendererPixbuf::from_glib_borrow(this).unsafe_cast_ref())
500            }
501        }
502        unsafe {
503            let f: Box_<F> = Box_::new(f);
504            connect_raw(
505                self.as_ptr() as *mut _,
506                c"notify::icon-name".as_ptr(),
507                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
508                    notify_icon_name_trampoline::<Self, F> as *const (),
509                )),
510                Box_::into_raw(f),
511            )
512        }
513    }
514
515    #[doc(alias = "pixbuf")]
516    fn connect_pixbuf_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
517        unsafe extern "C" fn notify_pixbuf_trampoline<
518            P: IsA<CellRendererPixbuf>,
519            F: Fn(&P) + 'static,
520        >(
521            this: *mut ffi::GtkCellRendererPixbuf,
522            _param_spec: glib::ffi::gpointer,
523            f: glib::ffi::gpointer,
524        ) {
525            unsafe {
526                let f: &F = &*(f as *const F);
527                f(CellRendererPixbuf::from_glib_borrow(this).unsafe_cast_ref())
528            }
529        }
530        unsafe {
531            let f: Box_<F> = Box_::new(f);
532            connect_raw(
533                self.as_ptr() as *mut _,
534                c"notify::pixbuf".as_ptr(),
535                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
536                    notify_pixbuf_trampoline::<Self, F> as *const (),
537                )),
538                Box_::into_raw(f),
539            )
540        }
541    }
542
543    #[doc(alias = "pixbuf-expander-closed")]
544    fn connect_pixbuf_expander_closed_notify<F: Fn(&Self) + 'static>(
545        &self,
546        f: F,
547    ) -> SignalHandlerId {
548        unsafe extern "C" fn notify_pixbuf_expander_closed_trampoline<
549            P: IsA<CellRendererPixbuf>,
550            F: Fn(&P) + 'static,
551        >(
552            this: *mut ffi::GtkCellRendererPixbuf,
553            _param_spec: glib::ffi::gpointer,
554            f: glib::ffi::gpointer,
555        ) {
556            unsafe {
557                let f: &F = &*(f as *const F);
558                f(CellRendererPixbuf::from_glib_borrow(this).unsafe_cast_ref())
559            }
560        }
561        unsafe {
562            let f: Box_<F> = Box_::new(f);
563            connect_raw(
564                self.as_ptr() as *mut _,
565                c"notify::pixbuf-expander-closed".as_ptr(),
566                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
567                    notify_pixbuf_expander_closed_trampoline::<Self, F> as *const (),
568                )),
569                Box_::into_raw(f),
570            )
571        }
572    }
573
574    #[doc(alias = "pixbuf-expander-open")]
575    fn connect_pixbuf_expander_open_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
576        unsafe extern "C" fn notify_pixbuf_expander_open_trampoline<
577            P: IsA<CellRendererPixbuf>,
578            F: Fn(&P) + 'static,
579        >(
580            this: *mut ffi::GtkCellRendererPixbuf,
581            _param_spec: glib::ffi::gpointer,
582            f: glib::ffi::gpointer,
583        ) {
584            unsafe {
585                let f: &F = &*(f as *const F);
586                f(CellRendererPixbuf::from_glib_borrow(this).unsafe_cast_ref())
587            }
588        }
589        unsafe {
590            let f: Box_<F> = Box_::new(f);
591            connect_raw(
592                self.as_ptr() as *mut _,
593                c"notify::pixbuf-expander-open".as_ptr(),
594                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
595                    notify_pixbuf_expander_open_trampoline::<Self, F> as *const (),
596                )),
597                Box_::into_raw(f),
598            )
599        }
600    }
601
602    #[doc(alias = "stock-detail")]
603    fn connect_stock_detail_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
604        unsafe extern "C" fn notify_stock_detail_trampoline<
605            P: IsA<CellRendererPixbuf>,
606            F: Fn(&P) + 'static,
607        >(
608            this: *mut ffi::GtkCellRendererPixbuf,
609            _param_spec: glib::ffi::gpointer,
610            f: glib::ffi::gpointer,
611        ) {
612            unsafe {
613                let f: &F = &*(f as *const F);
614                f(CellRendererPixbuf::from_glib_borrow(this).unsafe_cast_ref())
615            }
616        }
617        unsafe {
618            let f: Box_<F> = Box_::new(f);
619            connect_raw(
620                self.as_ptr() as *mut _,
621                c"notify::stock-detail".as_ptr(),
622                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
623                    notify_stock_detail_trampoline::<Self, F> as *const (),
624                )),
625                Box_::into_raw(f),
626            )
627        }
628    }
629
630    #[doc(alias = "stock-size")]
631    fn connect_stock_size_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
632        unsafe extern "C" fn notify_stock_size_trampoline<
633            P: IsA<CellRendererPixbuf>,
634            F: Fn(&P) + 'static,
635        >(
636            this: *mut ffi::GtkCellRendererPixbuf,
637            _param_spec: glib::ffi::gpointer,
638            f: glib::ffi::gpointer,
639        ) {
640            unsafe {
641                let f: &F = &*(f as *const F);
642                f(CellRendererPixbuf::from_glib_borrow(this).unsafe_cast_ref())
643            }
644        }
645        unsafe {
646            let f: Box_<F> = Box_::new(f);
647            connect_raw(
648                self.as_ptr() as *mut _,
649                c"notify::stock-size".as_ptr(),
650                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
651                    notify_stock_size_trampoline::<Self, F> as *const (),
652                )),
653                Box_::into_raw(f),
654            )
655        }
656    }
657
658    #[doc(alias = "surface")]
659    fn connect_surface_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
660        unsafe extern "C" fn notify_surface_trampoline<
661            P: IsA<CellRendererPixbuf>,
662            F: Fn(&P) + 'static,
663        >(
664            this: *mut ffi::GtkCellRendererPixbuf,
665            _param_spec: glib::ffi::gpointer,
666            f: glib::ffi::gpointer,
667        ) {
668            unsafe {
669                let f: &F = &*(f as *const F);
670                f(CellRendererPixbuf::from_glib_borrow(this).unsafe_cast_ref())
671            }
672        }
673        unsafe {
674            let f: Box_<F> = Box_::new(f);
675            connect_raw(
676                self.as_ptr() as *mut _,
677                c"notify::surface".as_ptr(),
678                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
679                    notify_surface_trampoline::<Self, F> as *const (),
680                )),
681                Box_::into_raw(f),
682            )
683        }
684    }
685}
686
687impl<O: IsA<CellRendererPixbuf>> CellRendererPixbufExt for O {}