Skip to main content

gtk4/auto/
cell_renderer.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#![allow(deprecated)]
5
6use crate::{
7    CellEditable, CellRendererMode, CellRendererState, Requisition, SizeRequestMode, Snapshot,
8    StateFlags, TreePath, Widget, ffi,
9};
10use glib::{
11    object::ObjectType as _,
12    prelude::*,
13    signal::{SignalHandlerId, connect_raw},
14    translate::*,
15};
16use std::boxed::Box as Box_;
17
18glib::wrapper! {
19    /// List views use widgets for displaying their
20    ///   contents
21    ///  properties reflect whether a property
22    /// has been set or not. You should not set them independently.
23    ///
24    /// This is an Abstract Base Class, you cannot instantiate it.
25    ///
26    /// ## Properties
27    ///
28    ///
29    /// #### `cell-background`
30    ///  Writable
31    ///
32    ///
33    /// #### `cell-background-rgba`
34    ///  Cell background as a [`gdk::RGBA`][crate::gdk::RGBA]
35    ///
36    /// Readable | Writable
37    ///
38    ///
39    /// #### `cell-background-set`
40    ///  Readable | Writable
41    ///
42    ///
43    /// #### `editing`
44    ///  Readable
45    ///
46    ///
47    /// #### `height`
48    ///  Readable | Writable
49    ///
50    ///
51    /// #### `is-expanded`
52    ///  Readable | Writable
53    ///
54    ///
55    /// #### `is-expander`
56    ///  Readable | Writable
57    ///
58    ///
59    /// #### `mode`
60    ///  Readable | Writable
61    ///
62    ///
63    /// #### `sensitive`
64    ///  Readable | Writable
65    ///
66    ///
67    /// #### `visible`
68    ///  Readable | Writable
69    ///
70    ///
71    /// #### `width`
72    ///  Readable | Writable
73    ///
74    ///
75    /// #### `xalign`
76    ///  Readable | Writable
77    ///
78    ///
79    /// #### `xpad`
80    ///  Readable | Writable
81    ///
82    ///
83    /// #### `yalign`
84    ///  Readable | Writable
85    ///
86    ///
87    /// #### `ypad`
88    ///  Readable | Writable
89    ///
90    /// ## Signals
91    ///
92    ///
93    /// #### `editing-canceled`
94    ///  This signal gets emitted when the user cancels the process of editing a
95    /// cell.  For example, an editable cell renderer could be written to cancel
96    /// editing when the user presses Escape.
97    ///
98    /// See also: gtk_cell_renderer_stop_editing().
99    ///
100    ///
101    ///
102    ///
103    /// #### `editing-started`
104    ///  t depend on the @renderer.
105    ///
106    /// Note that GTK doesn't guarantee that cell renderers will
107    /// continue to use the same kind of widget for editing in future
108    /// releases, therefore you should check the type of @editable
109    /// before doing any specific setup, as in the following example:
110    ///
111    /// **⚠️ The following code is in c ⚠️**
112    ///
113    /// ```c
114    /// static void
115    /// text_editing_started (GtkCellRenderer *cell,
116    ///                       GtkCellEditable *editable,
117    ///                       const char      *path,
118    ///                       gpointer         data)
119    /// {
120    ///   if (GTK_IS_ENTRY (editable))
121    ///     {
122    ///       GtkEntry *entry = GTK_ENTRY (editable);
123    ///
124    ///       // ... create a GtkEntryCompletion
125    ///
126    ///       gtk_entry_set_completion (entry, completion);
127    ///     }
128    /// }
129    /// ```
130    ///
131    ///
132    ///
133    /// # Implements
134    ///
135    /// [`CellRendererExt`][trait@crate::prelude::CellRendererExt], [`trait@glib::ObjectExt`], [`CellRendererExtManual`][trait@crate::prelude::CellRendererExtManual]
136    #[doc(alias = "GtkCellRenderer")]
137    pub struct CellRenderer(Object<ffi::GtkCellRenderer, ffi::GtkCellRendererClass>);
138
139    match fn {
140        type_ => || ffi::gtk_cell_renderer_get_type(),
141    }
142}
143
144impl CellRenderer {
145    pub const NONE: Option<&'static CellRenderer> = None;
146}
147
148/// Trait containing all [`struct@CellRenderer`] methods.
149///
150/// # Implementors
151///
152/// [`CellRendererPixbuf`][struct@crate::CellRendererPixbuf], [`CellRendererProgress`][struct@crate::CellRendererProgress], [`CellRendererSpinner`][struct@crate::CellRendererSpinner], [`CellRendererText`][struct@crate::CellRendererText], [`CellRendererToggle`][struct@crate::CellRendererToggle], [`CellRenderer`][struct@crate::CellRenderer]
153pub trait CellRendererExt: IsA<CellRenderer> + 'static {
154    /// Passes an activate event to the cell renderer for possible processing.
155    /// Some cell renderers may use events; for example, [`CellRendererToggle`][crate::CellRendererToggle]
156    /// toggles when it gets a mouse click.
157    ///
158    /// # Deprecated since 4.10
159    ///
160    /// ## `event`
161    /// a [`gdk::Event`][crate::gdk::Event]
162    /// ## `widget`
163    /// widget that received the event
164    /// ## `path`
165    /// widget-dependent string representation of the event location;
166    ///    e.g. for [`TreeView`][crate::TreeView], a string representation of [`TreePath`][crate::TreePath]
167    /// ## `background_area`
168    /// background area as passed to gtk_cell_renderer_render()
169    /// ## `cell_area`
170    /// cell area as passed to gtk_cell_renderer_render()
171    /// ## `flags`
172    /// render flags
173    ///
174    /// # Returns
175    ///
176    /// [`true`] if the event was consumed/handled
177    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
178    #[allow(deprecated)]
179    #[doc(alias = "gtk_cell_renderer_activate")]
180    fn activate(
181        &self,
182        event: impl AsRef<gdk::Event>,
183        widget: &impl IsA<Widget>,
184        path: &str,
185        background_area: &gdk::Rectangle,
186        cell_area: &gdk::Rectangle,
187        flags: CellRendererState,
188    ) -> bool {
189        unsafe {
190            from_glib(ffi::gtk_cell_renderer_activate(
191                self.as_ref().to_glib_none().0,
192                event.as_ref().to_glib_none().0,
193                widget.as_ref().to_glib_none().0,
194                path.to_glib_none().0,
195                background_area.to_glib_none().0,
196                cell_area.to_glib_none().0,
197                flags.into_glib(),
198            ))
199        }
200    }
201
202    /// Gets the aligned area used by @self inside @cell_area. Used for finding
203    /// the appropriate edit and focus rectangle.
204    ///
205    /// # Deprecated since 4.10
206    ///
207    /// ## `widget`
208    /// the [`Widget`][crate::Widget] this cell will be rendering to
209    /// ## `flags`
210    /// render flags
211    /// ## `cell_area`
212    /// cell area which would be passed to gtk_cell_renderer_render()
213    ///
214    /// # Returns
215    ///
216    ///
217    /// ## `aligned_area`
218    /// the return location for the space inside @cell_area
219    ///                that would actually be used to render.
220    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
221    #[allow(deprecated)]
222    #[doc(alias = "gtk_cell_renderer_get_aligned_area")]
223    #[doc(alias = "get_aligned_area")]
224    fn aligned_area(
225        &self,
226        widget: &impl IsA<Widget>,
227        flags: CellRendererState,
228        cell_area: &gdk::Rectangle,
229    ) -> gdk::Rectangle {
230        unsafe {
231            let mut aligned_area = gdk::Rectangle::uninitialized();
232            ffi::gtk_cell_renderer_get_aligned_area(
233                self.as_ref().to_glib_none().0,
234                widget.as_ref().to_glib_none().0,
235                flags.into_glib(),
236                cell_area.to_glib_none().0,
237                aligned_area.to_glib_none_mut().0,
238            );
239            aligned_area
240        }
241    }
242
243    /// Fills in @xalign and @yalign with the appropriate values of @self.
244    ///
245    /// # Deprecated since 4.10
246    ///
247    ///
248    /// # Returns
249    ///
250    ///
251    /// ## `xalign`
252    /// location to fill in with the x alignment of the cell
253    ///
254    /// ## `yalign`
255    /// location to fill in with the y alignment of the cell
256    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
257    #[allow(deprecated)]
258    #[doc(alias = "gtk_cell_renderer_get_alignment")]
259    #[doc(alias = "get_alignment")]
260    fn alignment(&self) -> (f32, f32) {
261        unsafe {
262            let mut xalign = std::mem::MaybeUninit::uninit();
263            let mut yalign = std::mem::MaybeUninit::uninit();
264            ffi::gtk_cell_renderer_get_alignment(
265                self.as_ref().to_glib_none().0,
266                xalign.as_mut_ptr(),
267                yalign.as_mut_ptr(),
268            );
269            (xalign.assume_init(), yalign.assume_init())
270        }
271    }
272
273    /// Fills in @width and @height with the appropriate size of @self.
274    ///
275    /// # Deprecated since 4.10
276    ///
277    ///
278    /// # Returns
279    ///
280    ///
281    /// ## `width`
282    /// location to fill in with the fixed width of the cell
283    ///
284    /// ## `height`
285    /// location to fill in with the fixed height of the cell
286    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
287    #[allow(deprecated)]
288    #[doc(alias = "gtk_cell_renderer_get_fixed_size")]
289    #[doc(alias = "get_fixed_size")]
290    fn fixed_size(&self) -> (i32, i32) {
291        unsafe {
292            let mut width = std::mem::MaybeUninit::uninit();
293            let mut height = std::mem::MaybeUninit::uninit();
294            ffi::gtk_cell_renderer_get_fixed_size(
295                self.as_ref().to_glib_none().0,
296                width.as_mut_ptr(),
297                height.as_mut_ptr(),
298            );
299            (width.assume_init(), height.assume_init())
300        }
301    }
302
303    /// Checks whether the given [`CellRenderer`][crate::CellRenderer] is expanded.
304    ///
305    /// # Deprecated since 4.10
306    ///
307    ///
308    /// # Returns
309    ///
310    /// [`true`] if the cell renderer is expanded
311    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
312    #[allow(deprecated)]
313    #[doc(alias = "gtk_cell_renderer_get_is_expanded")]
314    #[doc(alias = "get_is_expanded")]
315    #[doc(alias = "is-expanded")]
316    fn is_expanded(&self) -> bool {
317        unsafe {
318            from_glib(ffi::gtk_cell_renderer_get_is_expanded(
319                self.as_ref().to_glib_none().0,
320            ))
321        }
322    }
323
324    /// Checks whether the given [`CellRenderer`][crate::CellRenderer] is an expander.
325    ///
326    /// # Deprecated since 4.10
327    ///
328    ///
329    /// # Returns
330    ///
331    /// [`true`] if @self is an expander, and [`false`] otherwise
332    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
333    #[allow(deprecated)]
334    #[doc(alias = "gtk_cell_renderer_get_is_expander")]
335    #[doc(alias = "get_is_expander")]
336    #[doc(alias = "is-expander")]
337    fn is_expander(&self) -> bool {
338        unsafe {
339            from_glib(ffi::gtk_cell_renderer_get_is_expander(
340                self.as_ref().to_glib_none().0,
341            ))
342        }
343    }
344
345    /// Fills in @xpad and @ypad with the appropriate values of @self.
346    ///
347    /// # Deprecated since 4.10
348    ///
349    ///
350    /// # Returns
351    ///
352    ///
353    /// ## `xpad`
354    /// location to fill in with the x padding of the cell
355    ///
356    /// ## `ypad`
357    /// location to fill in with the y padding of the cell
358    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
359    #[allow(deprecated)]
360    #[doc(alias = "gtk_cell_renderer_get_padding")]
361    #[doc(alias = "get_padding")]
362    fn padding(&self) -> (i32, i32) {
363        unsafe {
364            let mut xpad = std::mem::MaybeUninit::uninit();
365            let mut ypad = std::mem::MaybeUninit::uninit();
366            ffi::gtk_cell_renderer_get_padding(
367                self.as_ref().to_glib_none().0,
368                xpad.as_mut_ptr(),
369                ypad.as_mut_ptr(),
370            );
371            (xpad.assume_init(), ypad.assume_init())
372        }
373    }
374
375    /// s natural size when rendered to @widget.
376    ///
377    /// # Deprecated since 4.10
378    ///
379    /// ## `widget`
380    /// the [`Widget`][crate::Widget] this cell will be rendering to
381    ///
382    /// # Returns
383    ///
384    ///
385    /// ## `minimum_size`
386    /// location to store the minimum size
387    ///
388    /// ## `natural_size`
389    /// location to store the natural size
390    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
391    #[allow(deprecated)]
392    #[doc(alias = "gtk_cell_renderer_get_preferred_height")]
393    #[doc(alias = "get_preferred_height")]
394    fn preferred_height(&self, widget: &impl IsA<Widget>) -> (i32, i32) {
395        unsafe {
396            let mut minimum_size = std::mem::MaybeUninit::uninit();
397            let mut natural_size = std::mem::MaybeUninit::uninit();
398            ffi::gtk_cell_renderer_get_preferred_height(
399                self.as_ref().to_glib_none().0,
400                widget.as_ref().to_glib_none().0,
401                minimum_size.as_mut_ptr(),
402                natural_size.as_mut_ptr(),
403            );
404            (minimum_size.assume_init(), natural_size.assume_init())
405        }
406    }
407
408    /// s minimum and natural height if it were rendered to
409    /// @widget with the specified @width.
410    ///
411    /// # Deprecated since 4.10
412    ///
413    /// ## `widget`
414    /// the [`Widget`][crate::Widget] this cell will be rendering to
415    /// ## `width`
416    /// the size which is available for allocation
417    ///
418    /// # Returns
419    ///
420    ///
421    /// ## `minimum_height`
422    /// location for storing the minimum size
423    ///
424    /// ## `natural_height`
425    /// location for storing the preferred size
426    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
427    #[allow(deprecated)]
428    #[doc(alias = "gtk_cell_renderer_get_preferred_height_for_width")]
429    #[doc(alias = "get_preferred_height_for_width")]
430    fn preferred_height_for_width(&self, widget: &impl IsA<Widget>, width: i32) -> (i32, i32) {
431        unsafe {
432            let mut minimum_height = std::mem::MaybeUninit::uninit();
433            let mut natural_height = std::mem::MaybeUninit::uninit();
434            ffi::gtk_cell_renderer_get_preferred_height_for_width(
435                self.as_ref().to_glib_none().0,
436                widget.as_ref().to_glib_none().0,
437                width,
438                minimum_height.as_mut_ptr(),
439                natural_height.as_mut_ptr(),
440            );
441            (minimum_height.assume_init(), natural_height.assume_init())
442        }
443    }
444
445    /// s preference for height-for-width management.
446    ///
447    /// # Deprecated since 4.10
448    ///
449    /// ## `widget`
450    /// the [`Widget`][crate::Widget] this cell will be rendering to
451    ///
452    /// # Returns
453    ///
454    ///
455    /// ## `minimum_size`
456    /// location for storing the minimum size
457    ///
458    /// ## `natural_size`
459    /// location for storing the natural size
460    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
461    #[allow(deprecated)]
462    #[doc(alias = "gtk_cell_renderer_get_preferred_size")]
463    #[doc(alias = "get_preferred_size")]
464    fn preferred_size(&self, widget: &impl IsA<Widget>) -> (Requisition, Requisition) {
465        unsafe {
466            let mut minimum_size = Requisition::uninitialized();
467            let mut natural_size = Requisition::uninitialized();
468            ffi::gtk_cell_renderer_get_preferred_size(
469                self.as_ref().to_glib_none().0,
470                widget.as_ref().to_glib_none().0,
471                minimum_size.to_glib_none_mut().0,
472                natural_size.to_glib_none_mut().0,
473            );
474            (minimum_size, natural_size)
475        }
476    }
477
478    /// s natural size when rendered to @widget.
479    ///
480    /// # Deprecated since 4.10
481    ///
482    /// ## `widget`
483    /// the [`Widget`][crate::Widget] this cell will be rendering to
484    ///
485    /// # Returns
486    ///
487    ///
488    /// ## `minimum_size`
489    /// location to store the minimum size
490    ///
491    /// ## `natural_size`
492    /// location to store the natural size
493    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
494    #[allow(deprecated)]
495    #[doc(alias = "gtk_cell_renderer_get_preferred_width")]
496    #[doc(alias = "get_preferred_width")]
497    fn preferred_width(&self, widget: &impl IsA<Widget>) -> (i32, i32) {
498        unsafe {
499            let mut minimum_size = std::mem::MaybeUninit::uninit();
500            let mut natural_size = std::mem::MaybeUninit::uninit();
501            ffi::gtk_cell_renderer_get_preferred_width(
502                self.as_ref().to_glib_none().0,
503                widget.as_ref().to_glib_none().0,
504                minimum_size.as_mut_ptr(),
505                natural_size.as_mut_ptr(),
506            );
507            (minimum_size.assume_init(), natural_size.assume_init())
508        }
509    }
510
511    /// s minimum and natural width if it were rendered to
512    /// @widget with the specified @height.
513    ///
514    /// # Deprecated since 4.10
515    ///
516    /// ## `widget`
517    /// the [`Widget`][crate::Widget] this cell will be rendering to
518    /// ## `height`
519    /// the size which is available for allocation
520    ///
521    /// # Returns
522    ///
523    ///
524    /// ## `minimum_width`
525    /// location for storing the minimum size
526    ///
527    /// ## `natural_width`
528    /// location for storing the preferred size
529    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
530    #[allow(deprecated)]
531    #[doc(alias = "gtk_cell_renderer_get_preferred_width_for_height")]
532    #[doc(alias = "get_preferred_width_for_height")]
533    fn preferred_width_for_height(&self, widget: &impl IsA<Widget>, height: i32) -> (i32, i32) {
534        unsafe {
535            let mut minimum_width = std::mem::MaybeUninit::uninit();
536            let mut natural_width = std::mem::MaybeUninit::uninit();
537            ffi::gtk_cell_renderer_get_preferred_width_for_height(
538                self.as_ref().to_glib_none().0,
539                widget.as_ref().to_glib_none().0,
540                height,
541                minimum_width.as_mut_ptr(),
542                natural_width.as_mut_ptr(),
543            );
544            (minimum_width.assume_init(), natural_width.assume_init())
545        }
546    }
547
548    /// Gets whether the cell renderer prefers a height-for-width layout
549    /// or a width-for-height layout.
550    ///
551    /// # Deprecated since 4.10
552    ///
553    ///
554    /// # Returns
555    ///
556    /// The [`SizeRequestMode`][crate::SizeRequestMode] preferred by this renderer.
557    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
558    #[allow(deprecated)]
559    #[doc(alias = "gtk_cell_renderer_get_request_mode")]
560    #[doc(alias = "get_request_mode")]
561    fn request_mode(&self) -> SizeRequestMode {
562        unsafe {
563            from_glib(ffi::gtk_cell_renderer_get_request_mode(
564                self.as_ref().to_glib_none().0,
565            ))
566        }
567    }
568
569    /// s sensitivity.
570    ///
571    /// # Deprecated since 4.10
572    ///
573    ///
574    /// # Returns
575    ///
576    /// [`true`] if the cell renderer is sensitive
577    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
578    #[allow(deprecated)]
579    #[doc(alias = "gtk_cell_renderer_get_sensitive")]
580    #[doc(alias = "get_sensitive")]
581    #[doc(alias = "sensitive")]
582    fn is_sensitive(&self) -> bool {
583        unsafe {
584            from_glib(ffi::gtk_cell_renderer_get_sensitive(
585                self.as_ref().to_glib_none().0,
586            ))
587        }
588    }
589
590    /// Translates the cell renderer state to [`StateFlags`][crate::StateFlags],
591    /// based on the cell renderer and widget sensitivity, and
592    /// the given [`CellRenderer`][crate::CellRenderer]State.
593    ///
594    /// # Deprecated since 4.10
595    ///
596    /// ## `widget`
597    /// a [`Widget`][crate::Widget]
598    /// ## `cell_state`
599    /// cell renderer state
600    ///
601    /// # Returns
602    ///
603    /// the widget state flags applying to @self
604    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
605    #[allow(deprecated)]
606    #[doc(alias = "gtk_cell_renderer_get_state")]
607    #[doc(alias = "get_state")]
608    fn state(
609        &self,
610        widget: Option<&impl IsA<Widget>>,
611        cell_state: CellRendererState,
612    ) -> StateFlags {
613        unsafe {
614            from_glib(ffi::gtk_cell_renderer_get_state(
615                self.as_ref().to_glib_none().0,
616                widget.map(|p| p.as_ref()).to_glib_none().0,
617                cell_state.into_glib(),
618            ))
619        }
620    }
621
622    /// s visibility.
623    ///
624    /// # Deprecated since 4.10
625    ///
626    ///
627    /// # Returns
628    ///
629    /// [`true`] if the cell renderer is visible
630    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
631    #[allow(deprecated)]
632    #[doc(alias = "gtk_cell_renderer_get_visible")]
633    #[doc(alias = "get_visible")]
634    #[doc(alias = "visible")]
635    fn is_visible(&self) -> bool {
636        unsafe {
637            from_glib(ffi::gtk_cell_renderer_get_visible(
638                self.as_ref().to_glib_none().0,
639            ))
640        }
641    }
642
643    /// Checks whether the cell renderer can do something when activated.
644    ///
645    /// # Deprecated since 4.10
646    ///
647    ///
648    /// # Returns
649    ///
650    /// [`true`] if the cell renderer can do anything when activated
651    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
652    #[allow(deprecated)]
653    #[doc(alias = "gtk_cell_renderer_is_activatable")]
654    fn is_activatable(&self) -> bool {
655        unsafe {
656            from_glib(ffi::gtk_cell_renderer_is_activatable(
657                self.as_ref().to_glib_none().0,
658            ))
659        }
660    }
661
662    /// s alignment within its available space.
663    ///
664    /// # Deprecated since 4.10
665    ///
666    /// ## `xalign`
667    /// the x alignment of the cell renderer
668    /// ## `yalign`
669    /// the y alignment of the cell renderer
670    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
671    #[allow(deprecated)]
672    #[doc(alias = "gtk_cell_renderer_set_alignment")]
673    fn set_alignment(&self, xalign: f32, yalign: f32) {
674        unsafe {
675            ffi::gtk_cell_renderer_set_alignment(self.as_ref().to_glib_none().0, xalign, yalign);
676        }
677    }
678
679    /// Sets the renderer size to be explicit, independent of the properties set.
680    ///
681    /// # Deprecated since 4.10
682    ///
683    /// ## `width`
684    /// the width of the cell renderer, or -1
685    /// ## `height`
686    /// the height of the cell renderer, or -1
687    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
688    #[allow(deprecated)]
689    #[doc(alias = "gtk_cell_renderer_set_fixed_size")]
690    fn set_fixed_size(&self, width: i32, height: i32) {
691        unsafe {
692            ffi::gtk_cell_renderer_set_fixed_size(self.as_ref().to_glib_none().0, width, height);
693        }
694    }
695
696    /// Sets whether the given [`CellRenderer`][crate::CellRenderer] is expanded.
697    ///
698    /// # Deprecated since 4.10
699    ///
700    /// ## `is_expanded`
701    /// whether @self should be expanded
702    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
703    #[allow(deprecated)]
704    #[doc(alias = "gtk_cell_renderer_set_is_expanded")]
705    #[doc(alias = "is-expanded")]
706    fn set_is_expanded(&self, is_expanded: bool) {
707        unsafe {
708            ffi::gtk_cell_renderer_set_is_expanded(
709                self.as_ref().to_glib_none().0,
710                is_expanded.into_glib(),
711            );
712        }
713    }
714
715    /// Sets whether the given [`CellRenderer`][crate::CellRenderer] is an expander.
716    ///
717    /// # Deprecated since 4.10
718    ///
719    /// ## `is_expander`
720    /// whether @self is an expander
721    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
722    #[allow(deprecated)]
723    #[doc(alias = "gtk_cell_renderer_set_is_expander")]
724    #[doc(alias = "is-expander")]
725    fn set_is_expander(&self, is_expander: bool) {
726        unsafe {
727            ffi::gtk_cell_renderer_set_is_expander(
728                self.as_ref().to_glib_none().0,
729                is_expander.into_glib(),
730            );
731        }
732    }
733
734    /// s padding.
735    ///
736    /// # Deprecated since 4.10
737    ///
738    /// ## `xpad`
739    /// the x padding of the cell renderer
740    /// ## `ypad`
741    /// the y padding of the cell renderer
742    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
743    #[allow(deprecated)]
744    #[doc(alias = "gtk_cell_renderer_set_padding")]
745    fn set_padding(&self, xpad: i32, ypad: i32) {
746        unsafe {
747            ffi::gtk_cell_renderer_set_padding(self.as_ref().to_glib_none().0, xpad, ypad);
748        }
749    }
750
751    /// s sensitivity.
752    ///
753    /// # Deprecated since 4.10
754    ///
755    /// ## `sensitive`
756    /// the sensitivity of the cell
757    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
758    #[allow(deprecated)]
759    #[doc(alias = "gtk_cell_renderer_set_sensitive")]
760    #[doc(alias = "sensitive")]
761    fn set_sensitive(&self, sensitive: bool) {
762        unsafe {
763            ffi::gtk_cell_renderer_set_sensitive(
764                self.as_ref().to_glib_none().0,
765                sensitive.into_glib(),
766            );
767        }
768    }
769
770    /// s visibility.
771    ///
772    /// # Deprecated since 4.10
773    ///
774    /// ## `visible`
775    /// the visibility of the cell
776    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
777    #[allow(deprecated)]
778    #[doc(alias = "gtk_cell_renderer_set_visible")]
779    #[doc(alias = "visible")]
780    fn set_visible(&self, visible: bool) {
781        unsafe {
782            ffi::gtk_cell_renderer_set_visible(self.as_ref().to_glib_none().0, visible.into_glib());
783        }
784    }
785
786    /// Invokes the virtual render function of the [`CellRenderer`][crate::CellRenderer]. The three
787    /// passed-in rectangles are areas in @cr. Most renderers will draw within
788    /// @cell_area; the xalign, yalign, xpad, and ypad fields of the [`CellRenderer`][crate::CellRenderer]
789    /// should be honored with respect to @cell_area. @background_area includes the
790    /// blank space around the cell, and also the area containing the tree expander;
791    /// so the @background_area rectangles for all cells tile to cover the entire
792    /// @window.
793    ///
794    /// # Deprecated since 4.10
795    ///
796    /// ## `snapshot`
797    /// a [`Snapshot`][crate::Snapshot] to draw to
798    /// ## `widget`
799    /// the widget owning @window
800    /// ## `background_area`
801    /// entire cell area (including tree expanders and maybe
802    ///    padding on the sides)
803    /// ## `cell_area`
804    /// area normally rendered by a cell renderer
805    /// ## `flags`
806    /// flags that affect rendering
807    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
808    #[allow(deprecated)]
809    #[doc(alias = "gtk_cell_renderer_snapshot")]
810    fn snapshot(
811        &self,
812        snapshot: &impl IsA<Snapshot>,
813        widget: &impl IsA<Widget>,
814        background_area: &gdk::Rectangle,
815        cell_area: &gdk::Rectangle,
816        flags: CellRendererState,
817    ) {
818        unsafe {
819            ffi::gtk_cell_renderer_snapshot(
820                self.as_ref().to_glib_none().0,
821                snapshot.as_ref().to_glib_none().0,
822                widget.as_ref().to_glib_none().0,
823                background_area.to_glib_none().0,
824                cell_area.to_glib_none().0,
825                flags.into_glib(),
826            );
827        }
828    }
829
830    /// Starts editing the contents of this @self, through a new [`CellEditable`][crate::CellEditable]
831    /// widget created by the [`CellRenderer`][crate::CellRenderer]Class.start_editing virtual function.
832    ///
833    /// # Deprecated since 4.10
834    ///
835    /// ## `event`
836    /// a [`gdk::Event`][crate::gdk::Event]
837    /// ## `widget`
838    /// widget that received the event
839    /// ## `path`
840    /// widget-dependent string representation of the event location;
841    ///    e.g. for [`TreeView`][crate::TreeView], a string representation of [`TreePath`][crate::TreePath]
842    /// ## `background_area`
843    /// background area as passed to gtk_cell_renderer_render()
844    /// ## `cell_area`
845    /// cell area as passed to gtk_cell_renderer_render()
846    /// ## `flags`
847    /// render flags
848    ///
849    /// # Returns
850    ///
851    /// A new [`CellEditable`][crate::CellEditable] for editing this
852    ///   @self, or [`None`] if editing is not possible
853    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
854    #[allow(deprecated)]
855    #[doc(alias = "gtk_cell_renderer_start_editing")]
856    fn start_editing(
857        &self,
858        event: Option<impl AsRef<gdk::Event>>,
859        widget: &impl IsA<Widget>,
860        path: &str,
861        background_area: &gdk::Rectangle,
862        cell_area: &gdk::Rectangle,
863        flags: CellRendererState,
864    ) -> Option<CellEditable> {
865        unsafe {
866            from_glib_none(ffi::gtk_cell_renderer_start_editing(
867                self.as_ref().to_glib_none().0,
868                event.as_ref().map(|p| p.as_ref()).to_glib_none().0,
869                widget.as_ref().to_glib_none().0,
870                path.to_glib_none().0,
871                background_area.to_glib_none().0,
872                cell_area.to_glib_none().0,
873                flags.into_glib(),
874            ))
875        }
876    }
877
878    /// Informs the cell renderer that the editing is stopped.
879    /// If @canceled is [`true`], the cell renderer will emit the
880    /// [`CellRenderer`][crate::CellRenderer]::editing-canceled signal.
881    ///
882    /// This function should be called by cell renderer implementations
883    /// in response to the `GtkCellEditable::editing-done` signal of
884    /// [`CellEditable`][crate::CellEditable].
885    ///
886    /// # Deprecated since 4.10
887    ///
888    /// ## `canceled`
889    /// [`true`] if the editing has been canceled
890    #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
891    #[allow(deprecated)]
892    #[doc(alias = "gtk_cell_renderer_stop_editing")]
893    fn stop_editing(&self, canceled: bool) {
894        unsafe {
895            ffi::gtk_cell_renderer_stop_editing(
896                self.as_ref().to_glib_none().0,
897                canceled.into_glib(),
898            );
899        }
900    }
901
902    #[doc(alias = "cell-background")]
903    fn set_cell_background(&self, cell_background: Option<&str>) {
904        ObjectExt::set_property(self.as_ref(), "cell-background", cell_background)
905    }
906
907    /// Cell background as a [`gdk::RGBA`][crate::gdk::RGBA]
908    #[doc(alias = "cell-background-rgba")]
909    fn cell_background_rgba(&self) -> Option<gdk::RGBA> {
910        ObjectExt::property(self.as_ref(), "cell-background-rgba")
911    }
912
913    /// Cell background as a [`gdk::RGBA`][crate::gdk::RGBA]
914    #[doc(alias = "cell-background-rgba")]
915    fn set_cell_background_rgba(&self, cell_background_rgba: Option<&gdk::RGBA>) {
916        ObjectExt::set_property(self.as_ref(), "cell-background-rgba", cell_background_rgba)
917    }
918
919    #[doc(alias = "cell-background-set")]
920    fn is_cell_background_set(&self) -> bool {
921        ObjectExt::property(self.as_ref(), "cell-background-set")
922    }
923
924    fn is_editing(&self) -> bool {
925        ObjectExt::property(self.as_ref(), "editing")
926    }
927
928    fn height(&self) -> i32 {
929        ObjectExt::property(self.as_ref(), "height")
930    }
931
932    fn set_height(&self, height: i32) {
933        ObjectExt::set_property(self.as_ref(), "height", height)
934    }
935
936    fn mode(&self) -> CellRendererMode {
937        ObjectExt::property(self.as_ref(), "mode")
938    }
939
940    fn set_mode(&self, mode: CellRendererMode) {
941        ObjectExt::set_property(self.as_ref(), "mode", mode)
942    }
943
944    fn width(&self) -> i32 {
945        ObjectExt::property(self.as_ref(), "width")
946    }
947
948    fn set_width(&self, width: i32) {
949        ObjectExt::set_property(self.as_ref(), "width", width)
950    }
951
952    fn xalign(&self) -> f32 {
953        ObjectExt::property(self.as_ref(), "xalign")
954    }
955
956    fn set_xalign(&self, xalign: f32) {
957        ObjectExt::set_property(self.as_ref(), "xalign", xalign)
958    }
959
960    fn xpad(&self) -> u32 {
961        ObjectExt::property(self.as_ref(), "xpad")
962    }
963
964    fn set_xpad(&self, xpad: u32) {
965        ObjectExt::set_property(self.as_ref(), "xpad", xpad)
966    }
967
968    fn yalign(&self) -> f32 {
969        ObjectExt::property(self.as_ref(), "yalign")
970    }
971
972    fn set_yalign(&self, yalign: f32) {
973        ObjectExt::set_property(self.as_ref(), "yalign", yalign)
974    }
975
976    fn ypad(&self) -> u32 {
977        ObjectExt::property(self.as_ref(), "ypad")
978    }
979
980    fn set_ypad(&self, ypad: u32) {
981        ObjectExt::set_property(self.as_ref(), "ypad", ypad)
982    }
983
984    /// This signal gets emitted when the user cancels the process of editing a
985    /// cell.  For example, an editable cell renderer could be written to cancel
986    /// editing when the user presses Escape.
987    ///
988    /// See also: gtk_cell_renderer_stop_editing().
989    #[doc(alias = "editing-canceled")]
990    fn connect_editing_canceled<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
991        unsafe extern "C" fn editing_canceled_trampoline<
992            P: IsA<CellRenderer>,
993            F: Fn(&P) + 'static,
994        >(
995            this: *mut ffi::GtkCellRenderer,
996            f: glib::ffi::gpointer,
997        ) {
998            unsafe {
999                let f: &F = &*(f as *const F);
1000                f(CellRenderer::from_glib_borrow(this).unsafe_cast_ref())
1001            }
1002        }
1003        unsafe {
1004            let f: Box_<F> = Box_::new(f);
1005            connect_raw(
1006                self.as_ptr() as *mut _,
1007                c"editing-canceled".as_ptr(),
1008                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1009                    editing_canceled_trampoline::<Self, F> as *const (),
1010                )),
1011                Box_::into_raw(f),
1012            )
1013        }
1014    }
1015
1016    /// t depend on the @renderer.
1017    ///
1018    /// Note that GTK doesn't guarantee that cell renderers will
1019    /// continue to use the same kind of widget for editing in future
1020    /// releases, therefore you should check the type of @editable
1021    /// before doing any specific setup, as in the following example:
1022    ///
1023    /// **⚠️ The following code is in c ⚠️**
1024    ///
1025    /// ```c
1026    /// static void
1027    /// text_editing_started (GtkCellRenderer *cell,
1028    ///                       GtkCellEditable *editable,
1029    ///                       const char      *path,
1030    ///                       gpointer         data)
1031    /// {
1032    ///   if (GTK_IS_ENTRY (editable))
1033    ///     {
1034    ///       GtkEntry *entry = GTK_ENTRY (editable);
1035    ///
1036    ///       // ... create a GtkEntryCompletion
1037    ///
1038    ///       gtk_entry_set_completion (entry, completion);
1039    ///     }
1040    /// }
1041    /// ```
1042    /// ## `editable`
1043    /// the [`CellEditable`][crate::CellEditable]
1044    /// ## `path`
1045    /// the path identifying the edited cell
1046    #[doc(alias = "editing-started")]
1047    fn connect_editing_started<F: Fn(&Self, &CellEditable, TreePath) + 'static>(
1048        &self,
1049        f: F,
1050    ) -> SignalHandlerId {
1051        unsafe extern "C" fn editing_started_trampoline<
1052            P: IsA<CellRenderer>,
1053            F: Fn(&P, &CellEditable, TreePath) + 'static,
1054        >(
1055            this: *mut ffi::GtkCellRenderer,
1056            editable: *mut ffi::GtkCellEditable,
1057            path: *mut std::ffi::c_char,
1058            f: glib::ffi::gpointer,
1059        ) {
1060            unsafe {
1061                let f: &F = &*(f as *const F);
1062                let path = from_glib_full(crate::ffi::gtk_tree_path_new_from_string(path));
1063                f(
1064                    CellRenderer::from_glib_borrow(this).unsafe_cast_ref(),
1065                    &from_glib_borrow(editable),
1066                    path,
1067                )
1068            }
1069        }
1070        unsafe {
1071            let f: Box_<F> = Box_::new(f);
1072            connect_raw(
1073                self.as_ptr() as *mut _,
1074                c"editing-started".as_ptr(),
1075                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1076                    editing_started_trampoline::<Self, F> as *const (),
1077                )),
1078                Box_::into_raw(f),
1079            )
1080        }
1081    }
1082
1083    #[doc(alias = "cell-background")]
1084    fn connect_cell_background_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1085        unsafe extern "C" fn notify_cell_background_trampoline<
1086            P: IsA<CellRenderer>,
1087            F: Fn(&P) + 'static,
1088        >(
1089            this: *mut ffi::GtkCellRenderer,
1090            _param_spec: glib::ffi::gpointer,
1091            f: glib::ffi::gpointer,
1092        ) {
1093            unsafe {
1094                let f: &F = &*(f as *const F);
1095                f(CellRenderer::from_glib_borrow(this).unsafe_cast_ref())
1096            }
1097        }
1098        unsafe {
1099            let f: Box_<F> = Box_::new(f);
1100            connect_raw(
1101                self.as_ptr() as *mut _,
1102                c"notify::cell-background".as_ptr(),
1103                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1104                    notify_cell_background_trampoline::<Self, F> as *const (),
1105                )),
1106                Box_::into_raw(f),
1107            )
1108        }
1109    }
1110
1111    #[doc(alias = "cell-background-rgba")]
1112    fn connect_cell_background_rgba_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1113        unsafe extern "C" fn notify_cell_background_rgba_trampoline<
1114            P: IsA<CellRenderer>,
1115            F: Fn(&P) + 'static,
1116        >(
1117            this: *mut ffi::GtkCellRenderer,
1118            _param_spec: glib::ffi::gpointer,
1119            f: glib::ffi::gpointer,
1120        ) {
1121            unsafe {
1122                let f: &F = &*(f as *const F);
1123                f(CellRenderer::from_glib_borrow(this).unsafe_cast_ref())
1124            }
1125        }
1126        unsafe {
1127            let f: Box_<F> = Box_::new(f);
1128            connect_raw(
1129                self.as_ptr() as *mut _,
1130                c"notify::cell-background-rgba".as_ptr(),
1131                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1132                    notify_cell_background_rgba_trampoline::<Self, F> as *const (),
1133                )),
1134                Box_::into_raw(f),
1135            )
1136        }
1137    }
1138
1139    #[doc(alias = "cell-background-set")]
1140    fn connect_cell_background_set_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1141        unsafe extern "C" fn notify_cell_background_set_trampoline<
1142            P: IsA<CellRenderer>,
1143            F: Fn(&P) + 'static,
1144        >(
1145            this: *mut ffi::GtkCellRenderer,
1146            _param_spec: glib::ffi::gpointer,
1147            f: glib::ffi::gpointer,
1148        ) {
1149            unsafe {
1150                let f: &F = &*(f as *const F);
1151                f(CellRenderer::from_glib_borrow(this).unsafe_cast_ref())
1152            }
1153        }
1154        unsafe {
1155            let f: Box_<F> = Box_::new(f);
1156            connect_raw(
1157                self.as_ptr() as *mut _,
1158                c"notify::cell-background-set".as_ptr(),
1159                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1160                    notify_cell_background_set_trampoline::<Self, F> as *const (),
1161                )),
1162                Box_::into_raw(f),
1163            )
1164        }
1165    }
1166
1167    #[doc(alias = "editing")]
1168    fn connect_editing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1169        unsafe extern "C" fn notify_editing_trampoline<
1170            P: IsA<CellRenderer>,
1171            F: Fn(&P) + 'static,
1172        >(
1173            this: *mut ffi::GtkCellRenderer,
1174            _param_spec: glib::ffi::gpointer,
1175            f: glib::ffi::gpointer,
1176        ) {
1177            unsafe {
1178                let f: &F = &*(f as *const F);
1179                f(CellRenderer::from_glib_borrow(this).unsafe_cast_ref())
1180            }
1181        }
1182        unsafe {
1183            let f: Box_<F> = Box_::new(f);
1184            connect_raw(
1185                self.as_ptr() as *mut _,
1186                c"notify::editing".as_ptr(),
1187                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1188                    notify_editing_trampoline::<Self, F> as *const (),
1189                )),
1190                Box_::into_raw(f),
1191            )
1192        }
1193    }
1194
1195    #[doc(alias = "height")]
1196    fn connect_height_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1197        unsafe extern "C" fn notify_height_trampoline<P: IsA<CellRenderer>, F: Fn(&P) + 'static>(
1198            this: *mut ffi::GtkCellRenderer,
1199            _param_spec: glib::ffi::gpointer,
1200            f: glib::ffi::gpointer,
1201        ) {
1202            unsafe {
1203                let f: &F = &*(f as *const F);
1204                f(CellRenderer::from_glib_borrow(this).unsafe_cast_ref())
1205            }
1206        }
1207        unsafe {
1208            let f: Box_<F> = Box_::new(f);
1209            connect_raw(
1210                self.as_ptr() as *mut _,
1211                c"notify::height".as_ptr(),
1212                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1213                    notify_height_trampoline::<Self, F> as *const (),
1214                )),
1215                Box_::into_raw(f),
1216            )
1217        }
1218    }
1219
1220    #[doc(alias = "is-expanded")]
1221    fn connect_is_expanded_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1222        unsafe extern "C" fn notify_is_expanded_trampoline<
1223            P: IsA<CellRenderer>,
1224            F: Fn(&P) + 'static,
1225        >(
1226            this: *mut ffi::GtkCellRenderer,
1227            _param_spec: glib::ffi::gpointer,
1228            f: glib::ffi::gpointer,
1229        ) {
1230            unsafe {
1231                let f: &F = &*(f as *const F);
1232                f(CellRenderer::from_glib_borrow(this).unsafe_cast_ref())
1233            }
1234        }
1235        unsafe {
1236            let f: Box_<F> = Box_::new(f);
1237            connect_raw(
1238                self.as_ptr() as *mut _,
1239                c"notify::is-expanded".as_ptr(),
1240                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1241                    notify_is_expanded_trampoline::<Self, F> as *const (),
1242                )),
1243                Box_::into_raw(f),
1244            )
1245        }
1246    }
1247
1248    #[doc(alias = "is-expander")]
1249    fn connect_is_expander_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1250        unsafe extern "C" fn notify_is_expander_trampoline<
1251            P: IsA<CellRenderer>,
1252            F: Fn(&P) + 'static,
1253        >(
1254            this: *mut ffi::GtkCellRenderer,
1255            _param_spec: glib::ffi::gpointer,
1256            f: glib::ffi::gpointer,
1257        ) {
1258            unsafe {
1259                let f: &F = &*(f as *const F);
1260                f(CellRenderer::from_glib_borrow(this).unsafe_cast_ref())
1261            }
1262        }
1263        unsafe {
1264            let f: Box_<F> = Box_::new(f);
1265            connect_raw(
1266                self.as_ptr() as *mut _,
1267                c"notify::is-expander".as_ptr(),
1268                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1269                    notify_is_expander_trampoline::<Self, F> as *const (),
1270                )),
1271                Box_::into_raw(f),
1272            )
1273        }
1274    }
1275
1276    #[doc(alias = "mode")]
1277    fn connect_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1278        unsafe extern "C" fn notify_mode_trampoline<P: IsA<CellRenderer>, F: Fn(&P) + 'static>(
1279            this: *mut ffi::GtkCellRenderer,
1280            _param_spec: glib::ffi::gpointer,
1281            f: glib::ffi::gpointer,
1282        ) {
1283            unsafe {
1284                let f: &F = &*(f as *const F);
1285                f(CellRenderer::from_glib_borrow(this).unsafe_cast_ref())
1286            }
1287        }
1288        unsafe {
1289            let f: Box_<F> = Box_::new(f);
1290            connect_raw(
1291                self.as_ptr() as *mut _,
1292                c"notify::mode".as_ptr(),
1293                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1294                    notify_mode_trampoline::<Self, F> as *const (),
1295                )),
1296                Box_::into_raw(f),
1297            )
1298        }
1299    }
1300
1301    #[doc(alias = "sensitive")]
1302    fn connect_sensitive_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1303        unsafe extern "C" fn notify_sensitive_trampoline<
1304            P: IsA<CellRenderer>,
1305            F: Fn(&P) + 'static,
1306        >(
1307            this: *mut ffi::GtkCellRenderer,
1308            _param_spec: glib::ffi::gpointer,
1309            f: glib::ffi::gpointer,
1310        ) {
1311            unsafe {
1312                let f: &F = &*(f as *const F);
1313                f(CellRenderer::from_glib_borrow(this).unsafe_cast_ref())
1314            }
1315        }
1316        unsafe {
1317            let f: Box_<F> = Box_::new(f);
1318            connect_raw(
1319                self.as_ptr() as *mut _,
1320                c"notify::sensitive".as_ptr(),
1321                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1322                    notify_sensitive_trampoline::<Self, F> as *const (),
1323                )),
1324                Box_::into_raw(f),
1325            )
1326        }
1327    }
1328
1329    #[doc(alias = "visible")]
1330    fn connect_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1331        unsafe extern "C" fn notify_visible_trampoline<
1332            P: IsA<CellRenderer>,
1333            F: Fn(&P) + 'static,
1334        >(
1335            this: *mut ffi::GtkCellRenderer,
1336            _param_spec: glib::ffi::gpointer,
1337            f: glib::ffi::gpointer,
1338        ) {
1339            unsafe {
1340                let f: &F = &*(f as *const F);
1341                f(CellRenderer::from_glib_borrow(this).unsafe_cast_ref())
1342            }
1343        }
1344        unsafe {
1345            let f: Box_<F> = Box_::new(f);
1346            connect_raw(
1347                self.as_ptr() as *mut _,
1348                c"notify::visible".as_ptr(),
1349                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1350                    notify_visible_trampoline::<Self, F> as *const (),
1351                )),
1352                Box_::into_raw(f),
1353            )
1354        }
1355    }
1356
1357    #[doc(alias = "width")]
1358    fn connect_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1359        unsafe extern "C" fn notify_width_trampoline<P: IsA<CellRenderer>, F: Fn(&P) + 'static>(
1360            this: *mut ffi::GtkCellRenderer,
1361            _param_spec: glib::ffi::gpointer,
1362            f: glib::ffi::gpointer,
1363        ) {
1364            unsafe {
1365                let f: &F = &*(f as *const F);
1366                f(CellRenderer::from_glib_borrow(this).unsafe_cast_ref())
1367            }
1368        }
1369        unsafe {
1370            let f: Box_<F> = Box_::new(f);
1371            connect_raw(
1372                self.as_ptr() as *mut _,
1373                c"notify::width".as_ptr(),
1374                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1375                    notify_width_trampoline::<Self, F> as *const (),
1376                )),
1377                Box_::into_raw(f),
1378            )
1379        }
1380    }
1381
1382    #[doc(alias = "xalign")]
1383    fn connect_xalign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1384        unsafe extern "C" fn notify_xalign_trampoline<P: IsA<CellRenderer>, F: Fn(&P) + 'static>(
1385            this: *mut ffi::GtkCellRenderer,
1386            _param_spec: glib::ffi::gpointer,
1387            f: glib::ffi::gpointer,
1388        ) {
1389            unsafe {
1390                let f: &F = &*(f as *const F);
1391                f(CellRenderer::from_glib_borrow(this).unsafe_cast_ref())
1392            }
1393        }
1394        unsafe {
1395            let f: Box_<F> = Box_::new(f);
1396            connect_raw(
1397                self.as_ptr() as *mut _,
1398                c"notify::xalign".as_ptr(),
1399                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1400                    notify_xalign_trampoline::<Self, F> as *const (),
1401                )),
1402                Box_::into_raw(f),
1403            )
1404        }
1405    }
1406
1407    #[doc(alias = "xpad")]
1408    fn connect_xpad_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1409        unsafe extern "C" fn notify_xpad_trampoline<P: IsA<CellRenderer>, F: Fn(&P) + 'static>(
1410            this: *mut ffi::GtkCellRenderer,
1411            _param_spec: glib::ffi::gpointer,
1412            f: glib::ffi::gpointer,
1413        ) {
1414            unsafe {
1415                let f: &F = &*(f as *const F);
1416                f(CellRenderer::from_glib_borrow(this).unsafe_cast_ref())
1417            }
1418        }
1419        unsafe {
1420            let f: Box_<F> = Box_::new(f);
1421            connect_raw(
1422                self.as_ptr() as *mut _,
1423                c"notify::xpad".as_ptr(),
1424                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1425                    notify_xpad_trampoline::<Self, F> as *const (),
1426                )),
1427                Box_::into_raw(f),
1428            )
1429        }
1430    }
1431
1432    #[doc(alias = "yalign")]
1433    fn connect_yalign_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1434        unsafe extern "C" fn notify_yalign_trampoline<P: IsA<CellRenderer>, F: Fn(&P) + 'static>(
1435            this: *mut ffi::GtkCellRenderer,
1436            _param_spec: glib::ffi::gpointer,
1437            f: glib::ffi::gpointer,
1438        ) {
1439            unsafe {
1440                let f: &F = &*(f as *const F);
1441                f(CellRenderer::from_glib_borrow(this).unsafe_cast_ref())
1442            }
1443        }
1444        unsafe {
1445            let f: Box_<F> = Box_::new(f);
1446            connect_raw(
1447                self.as_ptr() as *mut _,
1448                c"notify::yalign".as_ptr(),
1449                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1450                    notify_yalign_trampoline::<Self, F> as *const (),
1451                )),
1452                Box_::into_raw(f),
1453            )
1454        }
1455    }
1456
1457    #[doc(alias = "ypad")]
1458    fn connect_ypad_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1459        unsafe extern "C" fn notify_ypad_trampoline<P: IsA<CellRenderer>, F: Fn(&P) + 'static>(
1460            this: *mut ffi::GtkCellRenderer,
1461            _param_spec: glib::ffi::gpointer,
1462            f: glib::ffi::gpointer,
1463        ) {
1464            unsafe {
1465                let f: &F = &*(f as *const F);
1466                f(CellRenderer::from_glib_borrow(this).unsafe_cast_ref())
1467            }
1468        }
1469        unsafe {
1470            let f: Box_<F> = Box_::new(f);
1471            connect_raw(
1472                self.as_ptr() as *mut _,
1473                c"notify::ypad".as_ptr(),
1474                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1475                    notify_ypad_trampoline::<Self, F> as *const (),
1476                )),
1477                Box_::into_raw(f),
1478            )
1479        }
1480    }
1481}
1482
1483impl<O: IsA<CellRenderer>> CellRendererExt for O {}