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