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