Skip to main content

gtk/auto/
tree_view_column.rs

1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4
5use crate::{
6    Buildable, CellArea, CellLayout, CellRenderer, SortType, TreeIter, TreeModel,
7    TreeViewColumnSizing, Widget, ffi,
8};
9use glib::{
10    object::ObjectType as _,
11    prelude::*,
12    signal::{SignalHandlerId, connect_raw},
13    translate::*,
14};
15use std::boxed::Box as Box_;
16
17glib::wrapper! {
18    /// The GtkTreeViewColumn object represents a visible column in a [`TreeView`][crate::TreeView] widget.
19    /// It allows to set properties of the column header, and functions as a holding pen for
20    /// the cell renderers which determine how the data in the column is displayed.
21    ///
22    /// Please refer to the [tree widget conceptual overview](TreeWidget.html)
23    /// for an overview of all the objects and data types related to the tree widget and how
24    /// they work together.
25    ///
26    /// ## Properties
27    ///
28    ///
29    /// #### `alignment`
30    ///  Readable | Writable
31    ///
32    ///
33    /// #### `cell-area`
34    ///  The [`CellArea`][crate::CellArea] used to layout cell renderers for this column.
35    ///
36    /// If no area is specified when creating the tree view column with [`TreeViewColumn::with_area()`][crate::TreeViewColumn::with_area()]
37    /// a horizontally oriented [`CellAreaBox`][crate::CellAreaBox] will be used.
38    ///
39    /// Readable | Writable | Construct Only
40    ///
41    ///
42    /// #### `clickable`
43    ///  Readable | Writable
44    ///
45    ///
46    /// #### `expand`
47    ///  Readable | Writable
48    ///
49    ///
50    /// #### `fixed-width`
51    ///  Readable | Writable
52    ///
53    ///
54    /// #### `max-width`
55    ///  Readable | Writable
56    ///
57    ///
58    /// #### `min-width`
59    ///  Readable | Writable
60    ///
61    ///
62    /// #### `reorderable`
63    ///  Readable | Writable
64    ///
65    ///
66    /// #### `resizable`
67    ///  Readable | Writable
68    ///
69    ///
70    /// #### `sizing`
71    ///  Readable | Writable
72    ///
73    ///
74    /// #### `sort-column-id`
75    ///  Logical sort column ID this column sorts on when selected for sorting. Setting the sort column ID makes the column header
76    /// clickable. Set to -1 to make the column unsortable.
77    ///
78    /// Readable | Writable
79    ///
80    ///
81    /// #### `sort-indicator`
82    ///  Readable | Writable
83    ///
84    ///
85    /// #### `sort-order`
86    ///  Readable | Writable
87    ///
88    ///
89    /// #### `spacing`
90    ///  Readable | Writable
91    ///
92    ///
93    /// #### `title`
94    ///  Readable | Writable
95    ///
96    ///
97    /// #### `visible`
98    ///  Readable | Writable
99    ///
100    ///
101    /// #### `widget`
102    ///  Readable | Writable
103    ///
104    ///
105    /// #### `width`
106    ///  Readable
107    ///
108    ///
109    /// #### `x-offset`
110    ///  Readable
111    ///
112    /// ## Signals
113    ///
114    ///
115    /// #### `clicked`
116    ///
117    ///
118    /// # Implements
119    ///
120    /// [`TreeViewColumnExt`][trait@crate::prelude::TreeViewColumnExt], [`trait@glib::ObjectExt`], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`CellLayoutExt`][trait@crate::prelude::CellLayoutExt], [`BuildableExtManual`][trait@crate::prelude::BuildableExtManual]
121    #[doc(alias = "GtkTreeViewColumn")]
122    pub struct TreeViewColumn(Object<ffi::GtkTreeViewColumn, ffi::GtkTreeViewColumnClass>) @implements Buildable, CellLayout;
123
124    match fn {
125        type_ => || ffi::gtk_tree_view_column_get_type(),
126    }
127}
128
129impl TreeViewColumn {
130    pub const NONE: Option<&'static TreeViewColumn> = None;
131
132    /// Creates a new [`TreeViewColumn`][crate::TreeViewColumn].
133    ///
134    /// # Returns
135    ///
136    /// A newly created [`TreeViewColumn`][crate::TreeViewColumn].
137    #[doc(alias = "gtk_tree_view_column_new")]
138    pub fn new() -> TreeViewColumn {
139        assert_initialized_main_thread!();
140        unsafe { from_glib_none(ffi::gtk_tree_view_column_new()) }
141    }
142
143    /// Creates a new [`TreeViewColumn`][crate::TreeViewColumn] using `area` to render its cells.
144    /// ## `area`
145    /// the [`CellArea`][crate::CellArea] that the newly created column should use to layout cells.
146    ///
147    /// # Returns
148    ///
149    /// A newly created [`TreeViewColumn`][crate::TreeViewColumn].
150    #[doc(alias = "gtk_tree_view_column_new_with_area")]
151    #[doc(alias = "new_with_area")]
152    pub fn with_area(area: &impl IsA<CellArea>) -> TreeViewColumn {
153        skip_assert_initialized!();
154        unsafe {
155            from_glib_none(ffi::gtk_tree_view_column_new_with_area(
156                area.as_ref().to_glib_none().0,
157            ))
158        }
159    }
160
161    // rustdoc-stripper-ignore-next
162    /// Creates a new builder-pattern struct instance to construct [`TreeViewColumn`] objects.
163    ///
164    /// This method returns an instance of [`TreeViewColumnBuilder`](crate::builders::TreeViewColumnBuilder) which can be used to create [`TreeViewColumn`] objects.
165    pub fn builder() -> TreeViewColumnBuilder {
166        TreeViewColumnBuilder::new()
167    }
168}
169
170impl Default for TreeViewColumn {
171    fn default() -> Self {
172        Self::new()
173    }
174}
175
176// rustdoc-stripper-ignore-next
177/// A [builder-pattern] type to construct [`TreeViewColumn`] objects.
178///
179/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
180#[must_use = "The builder must be built to be used"]
181pub struct TreeViewColumnBuilder {
182    builder: glib::object::ObjectBuilder<'static, TreeViewColumn>,
183}
184
185impl TreeViewColumnBuilder {
186    fn new() -> Self {
187        Self {
188            builder: glib::object::Object::builder(),
189        }
190    }
191
192    pub fn alignment(self, alignment: f32) -> Self {
193        Self {
194            builder: self.builder.property("alignment", alignment),
195        }
196    }
197
198    /// The [`CellArea`][crate::CellArea] used to layout cell renderers for this column.
199    ///
200    /// If no area is specified when creating the tree view column with [`TreeViewColumn::with_area()`][crate::TreeViewColumn::with_area()]
201    /// a horizontally oriented [`CellAreaBox`][crate::CellAreaBox] will be used.
202    pub fn cell_area(self, cell_area: &impl IsA<CellArea>) -> Self {
203        Self {
204            builder: self
205                .builder
206                .property("cell-area", cell_area.clone().upcast()),
207        }
208    }
209
210    pub fn clickable(self, clickable: bool) -> Self {
211        Self {
212            builder: self.builder.property("clickable", clickable),
213        }
214    }
215
216    pub fn expand(self, expand: bool) -> Self {
217        Self {
218            builder: self.builder.property("expand", expand),
219        }
220    }
221
222    pub fn fixed_width(self, fixed_width: i32) -> Self {
223        Self {
224            builder: self.builder.property("fixed-width", fixed_width),
225        }
226    }
227
228    pub fn max_width(self, max_width: i32) -> Self {
229        Self {
230            builder: self.builder.property("max-width", max_width),
231        }
232    }
233
234    pub fn min_width(self, min_width: i32) -> Self {
235        Self {
236            builder: self.builder.property("min-width", min_width),
237        }
238    }
239
240    pub fn reorderable(self, reorderable: bool) -> Self {
241        Self {
242            builder: self.builder.property("reorderable", reorderable),
243        }
244    }
245
246    pub fn resizable(self, resizable: bool) -> Self {
247        Self {
248            builder: self.builder.property("resizable", resizable),
249        }
250    }
251
252    pub fn sizing(self, sizing: TreeViewColumnSizing) -> Self {
253        Self {
254            builder: self.builder.property("sizing", sizing),
255        }
256    }
257
258    /// Logical sort column ID this column sorts on when selected for sorting. Setting the sort column ID makes the column header
259    /// clickable. Set to -1 to make the column unsortable.
260    pub fn sort_column_id(self, sort_column_id: i32) -> Self {
261        Self {
262            builder: self.builder.property("sort-column-id", sort_column_id),
263        }
264    }
265
266    pub fn sort_indicator(self, sort_indicator: bool) -> Self {
267        Self {
268            builder: self.builder.property("sort-indicator", sort_indicator),
269        }
270    }
271
272    pub fn sort_order(self, sort_order: SortType) -> Self {
273        Self {
274            builder: self.builder.property("sort-order", sort_order),
275        }
276    }
277
278    pub fn spacing(self, spacing: i32) -> Self {
279        Self {
280            builder: self.builder.property("spacing", spacing),
281        }
282    }
283
284    pub fn title(self, title: impl Into<glib::GString>) -> Self {
285        Self {
286            builder: self.builder.property("title", title.into()),
287        }
288    }
289
290    pub fn visible(self, visible: bool) -> Self {
291        Self {
292            builder: self.builder.property("visible", visible),
293        }
294    }
295
296    pub fn widget(self, widget: &impl IsA<Widget>) -> Self {
297        Self {
298            builder: self.builder.property("widget", widget.clone().upcast()),
299        }
300    }
301
302    // rustdoc-stripper-ignore-next
303    /// Build the [`TreeViewColumn`].
304    #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
305    pub fn build(self) -> TreeViewColumn {
306        assert_initialized_main_thread!();
307        self.builder.build()
308    }
309}
310
311/// Trait containing all [`struct@TreeViewColumn`] methods.
312///
313/// # Implementors
314///
315/// [`TreeViewColumn`][struct@crate::TreeViewColumn]
316pub trait TreeViewColumnExt: IsA<TreeViewColumn> + 'static {
317    /// Adds an attribute mapping to the list in `self`. The `column` is the
318    /// column of the model to get a value from, and the `attribute` is the
319    /// parameter on `cell_renderer` to be set from the value. So for example
320    /// if column 2 of the model contains strings, you could have the
321    /// “text” attribute of a [`CellRendererText`][crate::CellRendererText] get its values from
322    /// column 2.
323    /// ## `cell_renderer`
324    /// the [`CellRenderer`][crate::CellRenderer] to set attributes on
325    /// ## `attribute`
326    /// An attribute on the renderer
327    /// ## `column`
328    /// The column position on the model to get the attribute from.
329    #[doc(alias = "gtk_tree_view_column_add_attribute")]
330    fn add_attribute(&self, cell_renderer: &impl IsA<CellRenderer>, attribute: &str, column: i32) {
331        unsafe {
332            ffi::gtk_tree_view_column_add_attribute(
333                self.as_ref().to_glib_none().0,
334                cell_renderer.as_ref().to_glib_none().0,
335                attribute.to_glib_none().0,
336                column,
337            );
338        }
339    }
340
341    /// Obtains the horizontal position and size of a cell in a column. If the
342    /// cell is not found in the column, `start_pos` and `width` are not changed and
343    /// [`false`] is returned.
344    /// ## `cell_renderer`
345    /// a [`CellRenderer`][crate::CellRenderer]
346    ///
347    /// # Returns
348    ///
349    /// [`true`] if `cell` belongs to `self`.
350    ///
351    /// ## `x_offset`
352    /// return location for the horizontal
353    ///  position of `cell` within `self`, may be [`None`]
354    ///
355    /// ## `width`
356    /// return location for the width of `cell`,
357    ///  may be [`None`]
358    #[doc(alias = "gtk_tree_view_column_cell_get_position")]
359    fn cell_get_position(&self, cell_renderer: &impl IsA<CellRenderer>) -> Option<(i32, i32)> {
360        unsafe {
361            let mut x_offset = std::mem::MaybeUninit::uninit();
362            let mut width = std::mem::MaybeUninit::uninit();
363            let ret = from_glib(ffi::gtk_tree_view_column_cell_get_position(
364                self.as_ref().to_glib_none().0,
365                cell_renderer.as_ref().to_glib_none().0,
366                x_offset.as_mut_ptr(),
367                width.as_mut_ptr(),
368            ));
369            if ret {
370                Some((x_offset.assume_init(), width.assume_init()))
371            } else {
372                None
373            }
374        }
375    }
376
377    /// Obtains the width and height needed to render the column. This is used
378    /// primarily by the [`TreeView`][crate::TreeView].
379    /// ## `cell_area`
380    /// The area a cell in the column will be allocated, or [`None`]
381    ///
382    /// # Returns
383    ///
384    ///
385    /// ## `x_offset`
386    /// location to return x offset of a cell relative to `cell_area`, or [`None`]
387    ///
388    /// ## `y_offset`
389    /// location to return y offset of a cell relative to `cell_area`, or [`None`]
390    ///
391    /// ## `width`
392    /// location to return width needed to render a cell, or [`None`]
393    ///
394    /// ## `height`
395    /// location to return height needed to render a cell, or [`None`]
396    #[doc(alias = "gtk_tree_view_column_cell_get_size")]
397    fn cell_get_size(&self, cell_area: Option<&gdk::Rectangle>) -> (i32, i32, i32, i32) {
398        unsafe {
399            let mut x_offset = std::mem::MaybeUninit::uninit();
400            let mut y_offset = std::mem::MaybeUninit::uninit();
401            let mut width = std::mem::MaybeUninit::uninit();
402            let mut height = std::mem::MaybeUninit::uninit();
403            ffi::gtk_tree_view_column_cell_get_size(
404                self.as_ref().to_glib_none().0,
405                cell_area.to_glib_none().0,
406                x_offset.as_mut_ptr(),
407                y_offset.as_mut_ptr(),
408                width.as_mut_ptr(),
409                height.as_mut_ptr(),
410            );
411            (
412                x_offset.assume_init(),
413                y_offset.assume_init(),
414                width.assume_init(),
415                height.assume_init(),
416            )
417        }
418    }
419
420    /// Returns [`true`] if any of the cells packed into the `self` are visible.
421    /// For this to be meaningful, you must first initialize the cells with
422    /// [`cell_set_cell_data()`][Self::cell_set_cell_data()]
423    ///
424    /// # Returns
425    ///
426    /// [`true`], if any of the cells packed into the `self` are currently visible
427    #[doc(alias = "gtk_tree_view_column_cell_is_visible")]
428    fn cell_is_visible(&self) -> bool {
429        unsafe {
430            from_glib(ffi::gtk_tree_view_column_cell_is_visible(
431                self.as_ref().to_glib_none().0,
432            ))
433        }
434    }
435
436    /// Sets the cell renderer based on the `tree_model` and `iter`. That is, for
437    /// every attribute mapping in `self`, it will get a value from the set
438    /// column on the `iter`, and use that value to set the attribute on the cell
439    /// renderer. This is used primarily by the [`TreeView`][crate::TreeView].
440    /// ## `tree_model`
441    /// The [`TreeModel`][crate::TreeModel] to to get the cell renderers attributes from.
442    /// ## `iter`
443    /// The [`TreeIter`][crate::TreeIter] to to get the cell renderer’s attributes from.
444    /// ## `is_expander`
445    /// [`true`], if the row has children
446    /// ## `is_expanded`
447    /// [`true`], if the row has visible children
448    #[doc(alias = "gtk_tree_view_column_cell_set_cell_data")]
449    fn cell_set_cell_data(
450        &self,
451        tree_model: &impl IsA<TreeModel>,
452        iter: &TreeIter,
453        is_expander: bool,
454        is_expanded: bool,
455    ) {
456        unsafe {
457            ffi::gtk_tree_view_column_cell_set_cell_data(
458                self.as_ref().to_glib_none().0,
459                tree_model.as_ref().to_glib_none().0,
460                mut_override(iter.to_glib_none().0),
461                is_expander.into_glib(),
462                is_expanded.into_glib(),
463            );
464        }
465    }
466
467    /// Unsets all the mappings on all renderers on the `self`.
468    #[doc(alias = "gtk_tree_view_column_clear")]
469    fn clear(&self) {
470        unsafe {
471            ffi::gtk_tree_view_column_clear(self.as_ref().to_glib_none().0);
472        }
473    }
474
475    /// Clears all existing attributes previously set with
476    /// `gtk_tree_view_column_set_attributes()`.
477    /// ## `cell_renderer`
478    /// a [`CellRenderer`][crate::CellRenderer] to clear the attribute mapping on.
479    #[doc(alias = "gtk_tree_view_column_clear_attributes")]
480    fn clear_attributes(&self, cell_renderer: &impl IsA<CellRenderer>) {
481        unsafe {
482            ffi::gtk_tree_view_column_clear_attributes(
483                self.as_ref().to_glib_none().0,
484                cell_renderer.as_ref().to_glib_none().0,
485            );
486        }
487    }
488
489    /// Emits the “clicked” signal on the column. This function will only work if
490    /// `self` is clickable.
491    #[doc(alias = "gtk_tree_view_column_clicked")]
492    fn clicked(&self) {
493        unsafe {
494            ffi::gtk_tree_view_column_clicked(self.as_ref().to_glib_none().0);
495        }
496    }
497
498    /// Sets the current keyboard focus to be at `cell`, if the column contains
499    /// 2 or more editable and activatable cells.
500    /// ## `cell`
501    /// A [`CellRenderer`][crate::CellRenderer]
502    #[doc(alias = "gtk_tree_view_column_focus_cell")]
503    fn focus_cell(&self, cell: &impl IsA<CellRenderer>) {
504        unsafe {
505            ffi::gtk_tree_view_column_focus_cell(
506                self.as_ref().to_glib_none().0,
507                cell.as_ref().to_glib_none().0,
508            );
509        }
510    }
511
512    /// Returns the current x alignment of `self`. This value can range
513    /// between 0.0 and 1.0.
514    ///
515    /// # Returns
516    ///
517    /// The current alignent of `self`.
518    #[doc(alias = "gtk_tree_view_column_get_alignment")]
519    #[doc(alias = "get_alignment")]
520    fn alignment(&self) -> f32 {
521        unsafe { ffi::gtk_tree_view_column_get_alignment(self.as_ref().to_glib_none().0) }
522    }
523
524    /// Returns the button used in the treeview column header
525    ///
526    /// # Returns
527    ///
528    /// The button for the column header.
529    #[doc(alias = "gtk_tree_view_column_get_button")]
530    #[doc(alias = "get_button")]
531    fn button(&self) -> Option<Widget> {
532        unsafe {
533            from_glib_none(ffi::gtk_tree_view_column_get_button(
534                self.as_ref().to_glib_none().0,
535            ))
536        }
537    }
538
539    /// Returns [`true`] if the user can click on the header for the column.
540    ///
541    /// # Returns
542    ///
543    /// [`true`] if user can click the column header.
544    #[doc(alias = "gtk_tree_view_column_get_clickable")]
545    #[doc(alias = "get_clickable")]
546    #[doc(alias = "clickable")]
547    fn is_clickable(&self) -> bool {
548        unsafe {
549            from_glib(ffi::gtk_tree_view_column_get_clickable(
550                self.as_ref().to_glib_none().0,
551            ))
552        }
553    }
554
555    /// Returns [`true`] if the column expands to fill available space.
556    ///
557    /// # Returns
558    ///
559    /// [`true`] if the column expands to fill available space.
560    #[doc(alias = "gtk_tree_view_column_get_expand")]
561    #[doc(alias = "get_expand")]
562    #[doc(alias = "expand")]
563    fn expands(&self) -> bool {
564        unsafe {
565            from_glib(ffi::gtk_tree_view_column_get_expand(
566                self.as_ref().to_glib_none().0,
567            ))
568        }
569    }
570
571    /// Gets the fixed width of the column. This may not be the actual displayed
572    /// width of the column; for that, use [`width()`][Self::width()].
573    ///
574    /// # Returns
575    ///
576    /// The fixed width of the column.
577    #[doc(alias = "gtk_tree_view_column_get_fixed_width")]
578    #[doc(alias = "get_fixed_width")]
579    #[doc(alias = "fixed-width")]
580    fn fixed_width(&self) -> i32 {
581        unsafe { ffi::gtk_tree_view_column_get_fixed_width(self.as_ref().to_glib_none().0) }
582    }
583
584    /// Returns the maximum width in pixels of the `self`, or -1 if no maximum
585    /// width is set.
586    ///
587    /// # Returns
588    ///
589    /// The maximum width of the `self`.
590    #[doc(alias = "gtk_tree_view_column_get_max_width")]
591    #[doc(alias = "get_max_width")]
592    #[doc(alias = "max-width")]
593    fn max_width(&self) -> i32 {
594        unsafe { ffi::gtk_tree_view_column_get_max_width(self.as_ref().to_glib_none().0) }
595    }
596
597    /// Returns the minimum width in pixels of the `self`, or -1 if no minimum
598    /// width is set.
599    ///
600    /// # Returns
601    ///
602    /// The minimum width of the `self`.
603    #[doc(alias = "gtk_tree_view_column_get_min_width")]
604    #[doc(alias = "get_min_width")]
605    #[doc(alias = "min-width")]
606    fn min_width(&self) -> i32 {
607        unsafe { ffi::gtk_tree_view_column_get_min_width(self.as_ref().to_glib_none().0) }
608    }
609
610    /// Returns [`true`] if the `self` can be reordered by the user.
611    ///
612    /// # Returns
613    ///
614    /// [`true`] if the `self` can be reordered by the user.
615    #[doc(alias = "gtk_tree_view_column_get_reorderable")]
616    #[doc(alias = "get_reorderable")]
617    #[doc(alias = "reorderable")]
618    fn is_reorderable(&self) -> bool {
619        unsafe {
620            from_glib(ffi::gtk_tree_view_column_get_reorderable(
621                self.as_ref().to_glib_none().0,
622            ))
623        }
624    }
625
626    /// Returns [`true`] if the `self` can be resized by the end user.
627    ///
628    /// # Returns
629    ///
630    /// [`true`], if the `self` can be resized.
631    #[doc(alias = "gtk_tree_view_column_get_resizable")]
632    #[doc(alias = "get_resizable")]
633    #[doc(alias = "resizable")]
634    fn is_resizable(&self) -> bool {
635        unsafe {
636            from_glib(ffi::gtk_tree_view_column_get_resizable(
637                self.as_ref().to_glib_none().0,
638            ))
639        }
640    }
641
642    /// Returns the current type of `self`.
643    ///
644    /// # Returns
645    ///
646    /// The type of `self`.
647    #[doc(alias = "gtk_tree_view_column_get_sizing")]
648    #[doc(alias = "get_sizing")]
649    fn sizing(&self) -> TreeViewColumnSizing {
650        unsafe {
651            from_glib(ffi::gtk_tree_view_column_get_sizing(
652                self.as_ref().to_glib_none().0,
653            ))
654        }
655    }
656
657    /// Gets the logical `sort_column_id` that the model sorts on when this
658    /// column is selected for sorting.
659    /// See [`set_sort_column_id()`][Self::set_sort_column_id()].
660    ///
661    /// # Returns
662    ///
663    /// the current `sort_column_id` for this column, or -1 if
664    ///  this column can’t be used for sorting.
665    #[doc(alias = "gtk_tree_view_column_get_sort_column_id")]
666    #[doc(alias = "get_sort_column_id")]
667    #[doc(alias = "sort-column-id")]
668    fn sort_column_id(&self) -> i32 {
669        unsafe { ffi::gtk_tree_view_column_get_sort_column_id(self.as_ref().to_glib_none().0) }
670    }
671
672    /// Gets the value set by [`set_sort_indicator()`][Self::set_sort_indicator()].
673    ///
674    /// # Returns
675    ///
676    /// whether the sort indicator arrow is displayed
677    #[doc(alias = "gtk_tree_view_column_get_sort_indicator")]
678    #[doc(alias = "get_sort_indicator")]
679    #[doc(alias = "sort-indicator")]
680    fn is_sort_indicator(&self) -> bool {
681        unsafe {
682            from_glib(ffi::gtk_tree_view_column_get_sort_indicator(
683                self.as_ref().to_glib_none().0,
684            ))
685        }
686    }
687
688    /// Gets the value set by [`set_sort_order()`][Self::set_sort_order()].
689    ///
690    /// # Returns
691    ///
692    /// the sort order the sort indicator is indicating
693    #[doc(alias = "gtk_tree_view_column_get_sort_order")]
694    #[doc(alias = "get_sort_order")]
695    #[doc(alias = "sort-order")]
696    fn sort_order(&self) -> SortType {
697        unsafe {
698            from_glib(ffi::gtk_tree_view_column_get_sort_order(
699                self.as_ref().to_glib_none().0,
700            ))
701        }
702    }
703
704    /// Returns the spacing of `self`.
705    ///
706    /// # Returns
707    ///
708    /// the spacing of `self`.
709    #[doc(alias = "gtk_tree_view_column_get_spacing")]
710    #[doc(alias = "get_spacing")]
711    fn spacing(&self) -> i32 {
712        unsafe { ffi::gtk_tree_view_column_get_spacing(self.as_ref().to_glib_none().0) }
713    }
714
715    /// Returns the title of the widget.
716    ///
717    /// # Returns
718    ///
719    /// the title of the column. This string should not be
720    /// modified or freed.
721    #[doc(alias = "gtk_tree_view_column_get_title")]
722    #[doc(alias = "get_title")]
723    fn title(&self) -> Option<glib::GString> {
724        unsafe {
725            from_glib_none(ffi::gtk_tree_view_column_get_title(
726                self.as_ref().to_glib_none().0,
727            ))
728        }
729    }
730
731    /// Returns the [`TreeView`][crate::TreeView] wherein `self` has been inserted.
732    /// If `column` is currently not inserted in any tree view, [`None`] is
733    /// returned.
734    ///
735    /// # Returns
736    ///
737    /// The tree view wherein `column` has
738    ///  been inserted if any, [`None`] otherwise.
739    #[doc(alias = "gtk_tree_view_column_get_tree_view")]
740    #[doc(alias = "get_tree_view")]
741    fn tree_view(&self) -> Option<Widget> {
742        unsafe {
743            from_glib_none(ffi::gtk_tree_view_column_get_tree_view(
744                self.as_ref().to_glib_none().0,
745            ))
746        }
747    }
748
749    /// Returns [`true`] if `self` is visible.
750    ///
751    /// # Returns
752    ///
753    /// whether the column is visible or not. If it is visible, then
754    /// the tree will show the column.
755    #[doc(alias = "gtk_tree_view_column_get_visible")]
756    #[doc(alias = "get_visible")]
757    #[doc(alias = "visible")]
758    fn is_visible(&self) -> bool {
759        unsafe {
760            from_glib(ffi::gtk_tree_view_column_get_visible(
761                self.as_ref().to_glib_none().0,
762            ))
763        }
764    }
765
766    /// Returns the [`Widget`][crate::Widget] in the button on the column header.
767    /// If a custom widget has not been set then [`None`] is returned.
768    ///
769    /// # Returns
770    ///
771    /// The [`Widget`][crate::Widget] in the column
772    ///  header, or [`None`]
773    #[doc(alias = "gtk_tree_view_column_get_widget")]
774    #[doc(alias = "get_widget")]
775    fn widget(&self) -> Option<Widget> {
776        unsafe {
777            from_glib_none(ffi::gtk_tree_view_column_get_widget(
778                self.as_ref().to_glib_none().0,
779            ))
780        }
781    }
782
783    /// Returns the current size of `self` in pixels.
784    ///
785    /// # Returns
786    ///
787    /// The current width of `self`.
788    #[doc(alias = "gtk_tree_view_column_get_width")]
789    #[doc(alias = "get_width")]
790    fn width(&self) -> i32 {
791        unsafe { ffi::gtk_tree_view_column_get_width(self.as_ref().to_glib_none().0) }
792    }
793
794    /// Returns the current X offset of `self` in pixels.
795    ///
796    /// # Returns
797    ///
798    /// The current X offset of `self`.
799    #[doc(alias = "gtk_tree_view_column_get_x_offset")]
800    #[doc(alias = "get_x_offset")]
801    #[doc(alias = "x-offset")]
802    fn x_offset(&self) -> i32 {
803        unsafe { ffi::gtk_tree_view_column_get_x_offset(self.as_ref().to_glib_none().0) }
804    }
805
806    /// Adds the `cell` to end of the column. If `expand` is [`false`], then the `cell`
807    /// is allocated no more space than it needs. Any unused space is divided
808    /// evenly between cells for which `expand` is [`true`].
809    /// ## `cell`
810    /// The [`CellRenderer`][crate::CellRenderer].
811    /// ## `expand`
812    /// [`true`] if `cell` is to be given extra space allocated to `self`.
813    #[doc(alias = "gtk_tree_view_column_pack_end")]
814    fn pack_end(&self, cell: &impl IsA<CellRenderer>, expand: bool) {
815        unsafe {
816            ffi::gtk_tree_view_column_pack_end(
817                self.as_ref().to_glib_none().0,
818                cell.as_ref().to_glib_none().0,
819                expand.into_glib(),
820            );
821        }
822    }
823
824    /// Packs the `cell` into the beginning of the column. If `expand` is [`false`], then
825    /// the `cell` is allocated no more space than it needs. Any unused space is divided
826    /// evenly between cells for which `expand` is [`true`].
827    /// ## `cell`
828    /// The [`CellRenderer`][crate::CellRenderer].
829    /// ## `expand`
830    /// [`true`] if `cell` is to be given extra space allocated to `self`.
831    #[doc(alias = "gtk_tree_view_column_pack_start")]
832    fn pack_start(&self, cell: &impl IsA<CellRenderer>, expand: bool) {
833        unsafe {
834            ffi::gtk_tree_view_column_pack_start(
835                self.as_ref().to_glib_none().0,
836                cell.as_ref().to_glib_none().0,
837                expand.into_glib(),
838            );
839        }
840    }
841
842    /// Flags the column, and the cell renderers added to this column, to have
843    /// their sizes renegotiated.
844    #[doc(alias = "gtk_tree_view_column_queue_resize")]
845    fn queue_resize(&self) {
846        unsafe {
847            ffi::gtk_tree_view_column_queue_resize(self.as_ref().to_glib_none().0);
848        }
849    }
850
851    /// Sets the alignment of the title or custom widget inside the column header.
852    /// The alignment determines its location inside the button -- 0.0 for left, 0.5
853    /// for center, 1.0 for right.
854    /// ## `xalign`
855    /// The alignment, which is between [0.0 and 1.0] inclusive.
856    #[doc(alias = "gtk_tree_view_column_set_alignment")]
857    #[doc(alias = "alignment")]
858    fn set_alignment(&self, xalign: f32) {
859        unsafe {
860            ffi::gtk_tree_view_column_set_alignment(self.as_ref().to_glib_none().0, xalign);
861        }
862    }
863
864    //#[doc(alias = "gtk_tree_view_column_set_attributes")]
865    //fn set_attributes(&self, cell_renderer: &impl IsA<CellRenderer>, : /*Unknown conversion*//*Unimplemented*/Basic: VarArgs) {
866    //    unsafe { TODO: call ffi:gtk_tree_view_column_set_attributes() }
867    //}
868
869    /// Sets the `GtkTreeCellDataFunc` to use for the column. This
870    /// function is used instead of the standard attributes mapping for
871    /// setting the column value, and should set the value of `self`'s
872    /// cell renderer as appropriate. `func` may be [`None`] to remove an
873    /// older one.
874    /// ## `cell_renderer`
875    /// A [`CellRenderer`][crate::CellRenderer]
876    /// ## `func`
877    /// The `GtkTreeCellDataFunc` to use.
878    /// ## `func_data`
879    /// The user data for `func`.
880    #[doc(alias = "gtk_tree_view_column_set_cell_data_func")]
881    fn set_cell_data_func(
882        &self,
883        cell_renderer: &impl IsA<CellRenderer>,
884        func: Option<Box_<dyn Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static>>,
885    ) {
886        let func_data: Box_<
887            Option<Box_<dyn Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static>>,
888        > = Box_::new(func);
889        unsafe extern "C" fn func_func(
890            tree_column: *mut ffi::GtkTreeViewColumn,
891            cell: *mut ffi::GtkCellRenderer,
892            tree_model: *mut ffi::GtkTreeModel,
893            iter: *mut ffi::GtkTreeIter,
894            data: glib::ffi::gpointer,
895        ) {
896            unsafe {
897                let tree_column = from_glib_borrow(tree_column);
898                let cell = from_glib_borrow(cell);
899                let tree_model = from_glib_borrow(tree_model);
900                let iter = from_glib_borrow(iter);
901                let callback = &*(data as *mut Option<
902                    Box_<dyn Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static>,
903                >);
904                if let Some(ref callback) = *callback {
905                    callback(&tree_column, &cell, &tree_model, &iter)
906                } else {
907                    panic!("cannot get closure...")
908                }
909            }
910        }
911        let func = if func_data.is_some() {
912            Some(func_func as _)
913        } else {
914            None
915        };
916        unsafe extern "C" fn destroy_func(data: glib::ffi::gpointer) {
917            unsafe {
918                let _callback = Box_::from_raw(
919                    data as *mut Option<
920                        Box_<
921                            dyn Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static,
922                        >,
923                    >,
924                );
925            }
926        }
927        let destroy_call4 = Some(destroy_func as _);
928        let super_callback0: Box_<
929            Option<Box_<dyn Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static>>,
930        > = func_data;
931        unsafe {
932            ffi::gtk_tree_view_column_set_cell_data_func(
933                self.as_ref().to_glib_none().0,
934                cell_renderer.as_ref().to_glib_none().0,
935                func,
936                Box_::into_raw(super_callback0) as *mut _,
937                destroy_call4,
938            );
939        }
940    }
941
942    /// Sets the header to be active if `clickable` is [`true`]. When the header is
943    /// active, then it can take keyboard focus, and can be clicked.
944    /// ## `clickable`
945    /// [`true`] if the header is active.
946    #[doc(alias = "gtk_tree_view_column_set_clickable")]
947    #[doc(alias = "clickable")]
948    fn set_clickable(&self, clickable: bool) {
949        unsafe {
950            ffi::gtk_tree_view_column_set_clickable(
951                self.as_ref().to_glib_none().0,
952                clickable.into_glib(),
953            );
954        }
955    }
956
957    /// Sets the column to take available extra space. This space is shared equally
958    /// amongst all columns that have the expand set to [`true`]. If no column has this
959    /// option set, then the last column gets all extra space. By default, every
960    /// column is created with this [`false`].
961    ///
962    /// Along with “fixed-width”, the “expand” property changes when the column is
963    /// resized by the user.
964    /// ## `expand`
965    /// [`true`] if the column should expand to fill available space.
966    #[doc(alias = "gtk_tree_view_column_set_expand")]
967    #[doc(alias = "expand")]
968    fn set_expand(&self, expand: bool) {
969        unsafe {
970            ffi::gtk_tree_view_column_set_expand(
971                self.as_ref().to_glib_none().0,
972                expand.into_glib(),
973            );
974        }
975    }
976
977    /// If `fixed_width` is not -1, sets the fixed width of `self`; otherwise
978    /// unsets it. The effective value of `fixed_width` is clamped between the
979    /// minimum and maximum width of the column; however, the value stored in the
980    /// “fixed-width” property is not clamped. If the column sizing is
981    /// [`TreeViewColumnSizing::GrowOnly`][crate::TreeViewColumnSizing::GrowOnly] or [`TreeViewColumnSizing::Autosize`][crate::TreeViewColumnSizing::Autosize], setting
982    /// a fixed width overrides the automatically calculated width. Note that
983    /// `fixed_width` is only a hint to GTK+; the width actually allocated to the
984    /// column may be greater or less than requested.
985    ///
986    /// Along with “expand”, the “fixed-width” property changes when the column is
987    /// resized by the user.
988    /// ## `fixed_width`
989    /// The new fixed width, in pixels, or -1.
990    #[doc(alias = "gtk_tree_view_column_set_fixed_width")]
991    #[doc(alias = "fixed-width")]
992    fn set_fixed_width(&self, fixed_width: i32) {
993        unsafe {
994            ffi::gtk_tree_view_column_set_fixed_width(self.as_ref().to_glib_none().0, fixed_width);
995        }
996    }
997
998    /// Sets the maximum width of the `self`. If `max_width` is -1, then the
999    /// maximum width is unset. Note, the column can actually be wider than max
1000    /// width if it’s the last column in a view. In this case, the column expands to
1001    /// fill any extra space.
1002    /// ## `max_width`
1003    /// The maximum width of the column in pixels, or -1.
1004    #[doc(alias = "gtk_tree_view_column_set_max_width")]
1005    #[doc(alias = "max-width")]
1006    fn set_max_width(&self, max_width: i32) {
1007        unsafe {
1008            ffi::gtk_tree_view_column_set_max_width(self.as_ref().to_glib_none().0, max_width);
1009        }
1010    }
1011
1012    /// Sets the minimum width of the `self`. If `min_width` is -1, then the
1013    /// minimum width is unset.
1014    /// ## `min_width`
1015    /// The minimum width of the column in pixels, or -1.
1016    #[doc(alias = "gtk_tree_view_column_set_min_width")]
1017    #[doc(alias = "min-width")]
1018    fn set_min_width(&self, min_width: i32) {
1019        unsafe {
1020            ffi::gtk_tree_view_column_set_min_width(self.as_ref().to_glib_none().0, min_width);
1021        }
1022    }
1023
1024    /// If `reorderable` is [`true`], then the column can be reordered by the end user
1025    /// dragging the header.
1026    /// ## `reorderable`
1027    /// [`true`], if the column can be reordered.
1028    #[doc(alias = "gtk_tree_view_column_set_reorderable")]
1029    #[doc(alias = "reorderable")]
1030    fn set_reorderable(&self, reorderable: bool) {
1031        unsafe {
1032            ffi::gtk_tree_view_column_set_reorderable(
1033                self.as_ref().to_glib_none().0,
1034                reorderable.into_glib(),
1035            );
1036        }
1037    }
1038
1039    /// If `resizable` is [`true`], then the user can explicitly resize the column by
1040    /// grabbing the outer edge of the column button. If resizable is [`true`] and
1041    /// sizing mode of the column is [`TreeViewColumnSizing::Autosize`][crate::TreeViewColumnSizing::Autosize], then the sizing
1042    /// mode is changed to [`TreeViewColumnSizing::GrowOnly`][crate::TreeViewColumnSizing::GrowOnly].
1043    /// ## `resizable`
1044    /// [`true`], if the column can be resized
1045    #[doc(alias = "gtk_tree_view_column_set_resizable")]
1046    #[doc(alias = "resizable")]
1047    fn set_resizable(&self, resizable: bool) {
1048        unsafe {
1049            ffi::gtk_tree_view_column_set_resizable(
1050                self.as_ref().to_glib_none().0,
1051                resizable.into_glib(),
1052            );
1053        }
1054    }
1055
1056    /// Sets the growth behavior of `self` to `type_`.
1057    /// ## `type_`
1058    /// The [`TreeViewColumnSizing`][crate::TreeViewColumnSizing].
1059    #[doc(alias = "gtk_tree_view_column_set_sizing")]
1060    #[doc(alias = "sizing")]
1061    fn set_sizing(&self, type_: TreeViewColumnSizing) {
1062        unsafe {
1063            ffi::gtk_tree_view_column_set_sizing(self.as_ref().to_glib_none().0, type_.into_glib());
1064        }
1065    }
1066
1067    /// Sets the logical `sort_column_id` that this column sorts on when this column
1068    /// is selected for sorting. Doing so makes the column header clickable.
1069    /// ## `sort_column_id`
1070    /// The `sort_column_id` of the model to sort on.
1071    #[doc(alias = "gtk_tree_view_column_set_sort_column_id")]
1072    #[doc(alias = "sort-column-id")]
1073    fn set_sort_column_id(&self, sort_column_id: i32) {
1074        unsafe {
1075            ffi::gtk_tree_view_column_set_sort_column_id(
1076                self.as_ref().to_glib_none().0,
1077                sort_column_id,
1078            );
1079        }
1080    }
1081
1082    /// Call this function with a `setting` of [`true`] to display an arrow in
1083    /// the header button indicating the column is sorted. Call
1084    /// [`set_sort_order()`][Self::set_sort_order()] to change the direction of
1085    /// the arrow.
1086    /// ## `setting`
1087    /// [`true`] to display an indicator that the column is sorted
1088    #[doc(alias = "gtk_tree_view_column_set_sort_indicator")]
1089    #[doc(alias = "sort-indicator")]
1090    fn set_sort_indicator(&self, setting: bool) {
1091        unsafe {
1092            ffi::gtk_tree_view_column_set_sort_indicator(
1093                self.as_ref().to_glib_none().0,
1094                setting.into_glib(),
1095            );
1096        }
1097    }
1098
1099    /// Changes the appearance of the sort indicator.
1100    ///
1101    /// This does not actually sort the model. Use
1102    /// [`set_sort_column_id()`][Self::set_sort_column_id()] if you want automatic sorting
1103    /// support. This function is primarily for custom sorting behavior, and should
1104    /// be used in conjunction with [`TreeSortableExtManual::set_sort_column_id()`][crate::prelude::TreeSortableExtManual::set_sort_column_id()] to do
1105    /// that. For custom models, the mechanism will vary.
1106    ///
1107    /// The sort indicator changes direction to indicate normal sort or reverse sort.
1108    /// Note that you must have the sort indicator enabled to see anything when
1109    /// calling this function; see [`set_sort_indicator()`][Self::set_sort_indicator()].
1110    /// ## `order`
1111    /// sort order that the sort indicator should indicate
1112    #[doc(alias = "gtk_tree_view_column_set_sort_order")]
1113    #[doc(alias = "sort-order")]
1114    fn set_sort_order(&self, order: SortType) {
1115        unsafe {
1116            ffi::gtk_tree_view_column_set_sort_order(
1117                self.as_ref().to_glib_none().0,
1118                order.into_glib(),
1119            );
1120        }
1121    }
1122
1123    /// Sets the spacing field of `self`, which is the number of pixels to
1124    /// place between cell renderers packed into it.
1125    /// ## `spacing`
1126    /// distance between cell renderers in pixels.
1127    #[doc(alias = "gtk_tree_view_column_set_spacing")]
1128    #[doc(alias = "spacing")]
1129    fn set_spacing(&self, spacing: i32) {
1130        unsafe {
1131            ffi::gtk_tree_view_column_set_spacing(self.as_ref().to_glib_none().0, spacing);
1132        }
1133    }
1134
1135    /// Sets the title of the `self`. If a custom widget has been set, then
1136    /// this value is ignored.
1137    /// ## `title`
1138    /// The title of the `self`.
1139    #[doc(alias = "gtk_tree_view_column_set_title")]
1140    #[doc(alias = "title")]
1141    fn set_title(&self, title: &str) {
1142        unsafe {
1143            ffi::gtk_tree_view_column_set_title(
1144                self.as_ref().to_glib_none().0,
1145                title.to_glib_none().0,
1146            );
1147        }
1148    }
1149
1150    /// Sets the visibility of `self`.
1151    /// ## `visible`
1152    /// [`true`] if the `self` is visible.
1153    #[doc(alias = "gtk_tree_view_column_set_visible")]
1154    #[doc(alias = "visible")]
1155    fn set_visible(&self, visible: bool) {
1156        unsafe {
1157            ffi::gtk_tree_view_column_set_visible(
1158                self.as_ref().to_glib_none().0,
1159                visible.into_glib(),
1160            );
1161        }
1162    }
1163
1164    /// Sets the widget in the header to be `widget`. If widget is [`None`], then the
1165    /// header button is set with a [`Label`][crate::Label] set to the title of `self`.
1166    /// ## `widget`
1167    /// A child [`Widget`][crate::Widget], or [`None`].
1168    #[doc(alias = "gtk_tree_view_column_set_widget")]
1169    #[doc(alias = "widget")]
1170    fn set_widget(&self, widget: Option<&impl IsA<Widget>>) {
1171        unsafe {
1172            ffi::gtk_tree_view_column_set_widget(
1173                self.as_ref().to_glib_none().0,
1174                widget.map(|p| p.as_ref()).to_glib_none().0,
1175            );
1176        }
1177    }
1178
1179    /// The [`CellArea`][crate::CellArea] used to layout cell renderers for this column.
1180    ///
1181    /// If no area is specified when creating the tree view column with [`TreeViewColumn::with_area()`][crate::TreeViewColumn::with_area()]
1182    /// a horizontally oriented [`CellAreaBox`][crate::CellAreaBox] will be used.
1183    #[doc(alias = "cell-area")]
1184    fn cell_area(&self) -> Option<CellArea> {
1185        ObjectExt::property(self.as_ref(), "cell-area")
1186    }
1187
1188    #[doc(alias = "clicked")]
1189    fn connect_clicked<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1190        unsafe extern "C" fn clicked_trampoline<P: IsA<TreeViewColumn>, F: Fn(&P) + 'static>(
1191            this: *mut ffi::GtkTreeViewColumn,
1192            f: glib::ffi::gpointer,
1193        ) {
1194            unsafe {
1195                let f: &F = &*(f as *const F);
1196                f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1197            }
1198        }
1199        unsafe {
1200            let f: Box_<F> = Box_::new(f);
1201            connect_raw(
1202                self.as_ptr() as *mut _,
1203                c"clicked".as_ptr(),
1204                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1205                    clicked_trampoline::<Self, F> as *const (),
1206                )),
1207                Box_::into_raw(f),
1208            )
1209        }
1210    }
1211
1212    #[doc(alias = "alignment")]
1213    fn connect_alignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1214        unsafe extern "C" fn notify_alignment_trampoline<
1215            P: IsA<TreeViewColumn>,
1216            F: Fn(&P) + 'static,
1217        >(
1218            this: *mut ffi::GtkTreeViewColumn,
1219            _param_spec: glib::ffi::gpointer,
1220            f: glib::ffi::gpointer,
1221        ) {
1222            unsafe {
1223                let f: &F = &*(f as *const F);
1224                f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1225            }
1226        }
1227        unsafe {
1228            let f: Box_<F> = Box_::new(f);
1229            connect_raw(
1230                self.as_ptr() as *mut _,
1231                c"notify::alignment".as_ptr(),
1232                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1233                    notify_alignment_trampoline::<Self, F> as *const (),
1234                )),
1235                Box_::into_raw(f),
1236            )
1237        }
1238    }
1239
1240    #[doc(alias = "clickable")]
1241    fn connect_clickable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1242        unsafe extern "C" fn notify_clickable_trampoline<
1243            P: IsA<TreeViewColumn>,
1244            F: Fn(&P) + 'static,
1245        >(
1246            this: *mut ffi::GtkTreeViewColumn,
1247            _param_spec: glib::ffi::gpointer,
1248            f: glib::ffi::gpointer,
1249        ) {
1250            unsafe {
1251                let f: &F = &*(f as *const F);
1252                f(TreeViewColumn::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::clickable".as_ptr(),
1260                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1261                    notify_clickable_trampoline::<Self, F> as *const (),
1262                )),
1263                Box_::into_raw(f),
1264            )
1265        }
1266    }
1267
1268    #[doc(alias = "expand")]
1269    fn connect_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1270        unsafe extern "C" fn notify_expand_trampoline<
1271            P: IsA<TreeViewColumn>,
1272            F: Fn(&P) + 'static,
1273        >(
1274            this: *mut ffi::GtkTreeViewColumn,
1275            _param_spec: glib::ffi::gpointer,
1276            f: glib::ffi::gpointer,
1277        ) {
1278            unsafe {
1279                let f: &F = &*(f as *const F);
1280                f(TreeViewColumn::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::expand".as_ptr(),
1288                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1289                    notify_expand_trampoline::<Self, F> as *const (),
1290                )),
1291                Box_::into_raw(f),
1292            )
1293        }
1294    }
1295
1296    #[doc(alias = "fixed-width")]
1297    fn connect_fixed_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1298        unsafe extern "C" fn notify_fixed_width_trampoline<
1299            P: IsA<TreeViewColumn>,
1300            F: Fn(&P) + 'static,
1301        >(
1302            this: *mut ffi::GtkTreeViewColumn,
1303            _param_spec: glib::ffi::gpointer,
1304            f: glib::ffi::gpointer,
1305        ) {
1306            unsafe {
1307                let f: &F = &*(f as *const F);
1308                f(TreeViewColumn::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::fixed-width".as_ptr(),
1316                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1317                    notify_fixed_width_trampoline::<Self, F> as *const (),
1318                )),
1319                Box_::into_raw(f),
1320            )
1321        }
1322    }
1323
1324    #[doc(alias = "max-width")]
1325    fn connect_max_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1326        unsafe extern "C" fn notify_max_width_trampoline<
1327            P: IsA<TreeViewColumn>,
1328            F: Fn(&P) + 'static,
1329        >(
1330            this: *mut ffi::GtkTreeViewColumn,
1331            _param_spec: glib::ffi::gpointer,
1332            f: glib::ffi::gpointer,
1333        ) {
1334            unsafe {
1335                let f: &F = &*(f as *const F);
1336                f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1337            }
1338        }
1339        unsafe {
1340            let f: Box_<F> = Box_::new(f);
1341            connect_raw(
1342                self.as_ptr() as *mut _,
1343                c"notify::max-width".as_ptr(),
1344                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1345                    notify_max_width_trampoline::<Self, F> as *const (),
1346                )),
1347                Box_::into_raw(f),
1348            )
1349        }
1350    }
1351
1352    #[doc(alias = "min-width")]
1353    fn connect_min_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1354        unsafe extern "C" fn notify_min_width_trampoline<
1355            P: IsA<TreeViewColumn>,
1356            F: Fn(&P) + 'static,
1357        >(
1358            this: *mut ffi::GtkTreeViewColumn,
1359            _param_spec: glib::ffi::gpointer,
1360            f: glib::ffi::gpointer,
1361        ) {
1362            unsafe {
1363                let f: &F = &*(f as *const F);
1364                f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1365            }
1366        }
1367        unsafe {
1368            let f: Box_<F> = Box_::new(f);
1369            connect_raw(
1370                self.as_ptr() as *mut _,
1371                c"notify::min-width".as_ptr(),
1372                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1373                    notify_min_width_trampoline::<Self, F> as *const (),
1374                )),
1375                Box_::into_raw(f),
1376            )
1377        }
1378    }
1379
1380    #[doc(alias = "reorderable")]
1381    fn connect_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1382        unsafe extern "C" fn notify_reorderable_trampoline<
1383            P: IsA<TreeViewColumn>,
1384            F: Fn(&P) + 'static,
1385        >(
1386            this: *mut ffi::GtkTreeViewColumn,
1387            _param_spec: glib::ffi::gpointer,
1388            f: glib::ffi::gpointer,
1389        ) {
1390            unsafe {
1391                let f: &F = &*(f as *const F);
1392                f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1393            }
1394        }
1395        unsafe {
1396            let f: Box_<F> = Box_::new(f);
1397            connect_raw(
1398                self.as_ptr() as *mut _,
1399                c"notify::reorderable".as_ptr(),
1400                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1401                    notify_reorderable_trampoline::<Self, F> as *const (),
1402                )),
1403                Box_::into_raw(f),
1404            )
1405        }
1406    }
1407
1408    #[doc(alias = "resizable")]
1409    fn connect_resizable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1410        unsafe extern "C" fn notify_resizable_trampoline<
1411            P: IsA<TreeViewColumn>,
1412            F: Fn(&P) + 'static,
1413        >(
1414            this: *mut ffi::GtkTreeViewColumn,
1415            _param_spec: glib::ffi::gpointer,
1416            f: glib::ffi::gpointer,
1417        ) {
1418            unsafe {
1419                let f: &F = &*(f as *const F);
1420                f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1421            }
1422        }
1423        unsafe {
1424            let f: Box_<F> = Box_::new(f);
1425            connect_raw(
1426                self.as_ptr() as *mut _,
1427                c"notify::resizable".as_ptr(),
1428                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1429                    notify_resizable_trampoline::<Self, F> as *const (),
1430                )),
1431                Box_::into_raw(f),
1432            )
1433        }
1434    }
1435
1436    #[doc(alias = "sizing")]
1437    fn connect_sizing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1438        unsafe extern "C" fn notify_sizing_trampoline<
1439            P: IsA<TreeViewColumn>,
1440            F: Fn(&P) + 'static,
1441        >(
1442            this: *mut ffi::GtkTreeViewColumn,
1443            _param_spec: glib::ffi::gpointer,
1444            f: glib::ffi::gpointer,
1445        ) {
1446            unsafe {
1447                let f: &F = &*(f as *const F);
1448                f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1449            }
1450        }
1451        unsafe {
1452            let f: Box_<F> = Box_::new(f);
1453            connect_raw(
1454                self.as_ptr() as *mut _,
1455                c"notify::sizing".as_ptr(),
1456                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1457                    notify_sizing_trampoline::<Self, F> as *const (),
1458                )),
1459                Box_::into_raw(f),
1460            )
1461        }
1462    }
1463
1464    #[doc(alias = "sort-column-id")]
1465    fn connect_sort_column_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1466        unsafe extern "C" fn notify_sort_column_id_trampoline<
1467            P: IsA<TreeViewColumn>,
1468            F: Fn(&P) + 'static,
1469        >(
1470            this: *mut ffi::GtkTreeViewColumn,
1471            _param_spec: glib::ffi::gpointer,
1472            f: glib::ffi::gpointer,
1473        ) {
1474            unsafe {
1475                let f: &F = &*(f as *const F);
1476                f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1477            }
1478        }
1479        unsafe {
1480            let f: Box_<F> = Box_::new(f);
1481            connect_raw(
1482                self.as_ptr() as *mut _,
1483                c"notify::sort-column-id".as_ptr(),
1484                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1485                    notify_sort_column_id_trampoline::<Self, F> as *const (),
1486                )),
1487                Box_::into_raw(f),
1488            )
1489        }
1490    }
1491
1492    #[doc(alias = "sort-indicator")]
1493    fn connect_sort_indicator_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1494        unsafe extern "C" fn notify_sort_indicator_trampoline<
1495            P: IsA<TreeViewColumn>,
1496            F: Fn(&P) + 'static,
1497        >(
1498            this: *mut ffi::GtkTreeViewColumn,
1499            _param_spec: glib::ffi::gpointer,
1500            f: glib::ffi::gpointer,
1501        ) {
1502            unsafe {
1503                let f: &F = &*(f as *const F);
1504                f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1505            }
1506        }
1507        unsafe {
1508            let f: Box_<F> = Box_::new(f);
1509            connect_raw(
1510                self.as_ptr() as *mut _,
1511                c"notify::sort-indicator".as_ptr(),
1512                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1513                    notify_sort_indicator_trampoline::<Self, F> as *const (),
1514                )),
1515                Box_::into_raw(f),
1516            )
1517        }
1518    }
1519
1520    #[doc(alias = "sort-order")]
1521    fn connect_sort_order_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1522        unsafe extern "C" fn notify_sort_order_trampoline<
1523            P: IsA<TreeViewColumn>,
1524            F: Fn(&P) + 'static,
1525        >(
1526            this: *mut ffi::GtkTreeViewColumn,
1527            _param_spec: glib::ffi::gpointer,
1528            f: glib::ffi::gpointer,
1529        ) {
1530            unsafe {
1531                let f: &F = &*(f as *const F);
1532                f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1533            }
1534        }
1535        unsafe {
1536            let f: Box_<F> = Box_::new(f);
1537            connect_raw(
1538                self.as_ptr() as *mut _,
1539                c"notify::sort-order".as_ptr(),
1540                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1541                    notify_sort_order_trampoline::<Self, F> as *const (),
1542                )),
1543                Box_::into_raw(f),
1544            )
1545        }
1546    }
1547
1548    #[doc(alias = "spacing")]
1549    fn connect_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1550        unsafe extern "C" fn notify_spacing_trampoline<
1551            P: IsA<TreeViewColumn>,
1552            F: Fn(&P) + 'static,
1553        >(
1554            this: *mut ffi::GtkTreeViewColumn,
1555            _param_spec: glib::ffi::gpointer,
1556            f: glib::ffi::gpointer,
1557        ) {
1558            unsafe {
1559                let f: &F = &*(f as *const F);
1560                f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1561            }
1562        }
1563        unsafe {
1564            let f: Box_<F> = Box_::new(f);
1565            connect_raw(
1566                self.as_ptr() as *mut _,
1567                c"notify::spacing".as_ptr(),
1568                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1569                    notify_spacing_trampoline::<Self, F> as *const (),
1570                )),
1571                Box_::into_raw(f),
1572            )
1573        }
1574    }
1575
1576    #[doc(alias = "title")]
1577    fn connect_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1578        unsafe extern "C" fn notify_title_trampoline<
1579            P: IsA<TreeViewColumn>,
1580            F: Fn(&P) + 'static,
1581        >(
1582            this: *mut ffi::GtkTreeViewColumn,
1583            _param_spec: glib::ffi::gpointer,
1584            f: glib::ffi::gpointer,
1585        ) {
1586            unsafe {
1587                let f: &F = &*(f as *const F);
1588                f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1589            }
1590        }
1591        unsafe {
1592            let f: Box_<F> = Box_::new(f);
1593            connect_raw(
1594                self.as_ptr() as *mut _,
1595                c"notify::title".as_ptr(),
1596                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1597                    notify_title_trampoline::<Self, F> as *const (),
1598                )),
1599                Box_::into_raw(f),
1600            )
1601        }
1602    }
1603
1604    #[doc(alias = "visible")]
1605    fn connect_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1606        unsafe extern "C" fn notify_visible_trampoline<
1607            P: IsA<TreeViewColumn>,
1608            F: Fn(&P) + 'static,
1609        >(
1610            this: *mut ffi::GtkTreeViewColumn,
1611            _param_spec: glib::ffi::gpointer,
1612            f: glib::ffi::gpointer,
1613        ) {
1614            unsafe {
1615                let f: &F = &*(f as *const F);
1616                f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1617            }
1618        }
1619        unsafe {
1620            let f: Box_<F> = Box_::new(f);
1621            connect_raw(
1622                self.as_ptr() as *mut _,
1623                c"notify::visible".as_ptr(),
1624                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1625                    notify_visible_trampoline::<Self, F> as *const (),
1626                )),
1627                Box_::into_raw(f),
1628            )
1629        }
1630    }
1631
1632    #[doc(alias = "widget")]
1633    fn connect_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1634        unsafe extern "C" fn notify_widget_trampoline<
1635            P: IsA<TreeViewColumn>,
1636            F: Fn(&P) + 'static,
1637        >(
1638            this: *mut ffi::GtkTreeViewColumn,
1639            _param_spec: glib::ffi::gpointer,
1640            f: glib::ffi::gpointer,
1641        ) {
1642            unsafe {
1643                let f: &F = &*(f as *const F);
1644                f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1645            }
1646        }
1647        unsafe {
1648            let f: Box_<F> = Box_::new(f);
1649            connect_raw(
1650                self.as_ptr() as *mut _,
1651                c"notify::widget".as_ptr(),
1652                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1653                    notify_widget_trampoline::<Self, F> as *const (),
1654                )),
1655                Box_::into_raw(f),
1656            )
1657        }
1658    }
1659
1660    #[doc(alias = "width")]
1661    fn connect_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1662        unsafe extern "C" fn notify_width_trampoline<
1663            P: IsA<TreeViewColumn>,
1664            F: Fn(&P) + 'static,
1665        >(
1666            this: *mut ffi::GtkTreeViewColumn,
1667            _param_spec: glib::ffi::gpointer,
1668            f: glib::ffi::gpointer,
1669        ) {
1670            unsafe {
1671                let f: &F = &*(f as *const F);
1672                f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1673            }
1674        }
1675        unsafe {
1676            let f: Box_<F> = Box_::new(f);
1677            connect_raw(
1678                self.as_ptr() as *mut _,
1679                c"notify::width".as_ptr(),
1680                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1681                    notify_width_trampoline::<Self, F> as *const (),
1682                )),
1683                Box_::into_raw(f),
1684            )
1685        }
1686    }
1687
1688    #[doc(alias = "x-offset")]
1689    fn connect_x_offset_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1690        unsafe extern "C" fn notify_x_offset_trampoline<
1691            P: IsA<TreeViewColumn>,
1692            F: Fn(&P) + 'static,
1693        >(
1694            this: *mut ffi::GtkTreeViewColumn,
1695            _param_spec: glib::ffi::gpointer,
1696            f: glib::ffi::gpointer,
1697        ) {
1698            unsafe {
1699                let f: &F = &*(f as *const F);
1700                f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1701            }
1702        }
1703        unsafe {
1704            let f: Box_<F> = Box_::new(f);
1705            connect_raw(
1706                self.as_ptr() as *mut _,
1707                c"notify::x-offset".as_ptr(),
1708                Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1709                    notify_x_offset_trampoline::<Self, F> as *const (),
1710                )),
1711                Box_::into_raw(f),
1712            )
1713        }
1714    }
1715}
1716
1717impl<O: IsA<TreeViewColumn>> TreeViewColumnExt for O {}