gtk4/auto/tree_view.rs
1// This file was generated by gir (https://github.com/gtk-rs/gir)
2// from gir-files (https://github.com/gtk-rs/gir-files)
3// DO NOT EDIT
4#![allow(deprecated)]
5
6use crate::{
7 ffi, Accessible, AccessibleRole, Adjustment, Align, Buildable, CellRenderer, ConstraintTarget,
8 Editable, LayoutManager, MovementStep, Overflow, Scrollable, ScrollablePolicy, Tooltip,
9 TreeIter, TreeModel, TreePath, TreeSelection, TreeViewColumn, TreeViewDropPosition,
10 TreeViewGridLines, Widget,
11};
12use glib::{
13 object::ObjectType as _,
14 prelude::*,
15 signal::{connect_raw, SignalHandlerId},
16 translate::*,
17};
18use std::boxed::Box as Box_;
19
20glib::wrapper! {
21 /// Use [`ListView`][crate::ListView] for lists, and [`ColumnView`][crate::ColumnView]
22 /// for tabular lists
23 /// A widget for displaying both trees and lists
24 ///
25 /// <picture>
26 /// <source srcset="list-and-tree-dark.png" media="(prefers-color-scheme: dark)">
27 /// <img alt="An example GtkTreeView" src="list-and-tree.png">
28 /// </picture>
29 ///
30 /// Widget that displays any object that implements the [`TreeModel`][crate::TreeModel] interface.
31 ///
32 /// Please refer to the [tree widget conceptual overview](section-tree-widget.html)
33 /// for an overview of all the objects and data types related to the tree
34 /// widget and how they work together.
35 ///
36 /// ## Coordinate systems in GtkTreeView API
37 ///
38 /// Several different coordinate systems are exposed in the [`TreeView`][crate::TreeView] API.
39 /// These are:
40 ///
41 /// 
42 ///
43 /// - Widget coordinates: Coordinates relative to the widget (usually `widget->window`).
44 ///
45 /// - Bin window coordinates: Coordinates relative to the window that GtkTreeView renders to.
46 ///
47 /// - Tree coordinates: Coordinates relative to the entire scrollable area of GtkTreeView. These
48 /// coordinates start at (0, 0) for row 0 of the tree.
49 ///
50 /// Several functions are available for converting between the different
51 /// coordinate systems. The most common translations are between widget and bin
52 /// window coordinates and between bin window and tree coordinates. For the
53 /// former you can use [`TreeViewExt::convert_widget_to_bin_window_coords()`][crate::prelude::TreeViewExt::convert_widget_to_bin_window_coords()]
54 /// (and vice versa), for the latter [`TreeViewExt::convert_bin_window_to_tree_coords()`][crate::prelude::TreeViewExt::convert_bin_window_to_tree_coords()]
55 /// (and vice versa).
56 ///
57 /// ## [`TreeView`][crate::TreeView] as [`Buildable`][crate::Buildable]
58 ///
59 /// The [`TreeView`][crate::TreeView] implementation of the [`Buildable`][crate::Buildable] interface accepts
60 /// [`TreeViewColumn`][crate::TreeViewColumn] objects as `<child>` elements and exposes the
61 /// internal [`TreeSelection`][crate::TreeSelection] in UI definitions.
62 ///
63 /// An example of a UI definition fragment with [`TreeView`][crate::TreeView]:
64 ///
65 /// ```xml
66 /// <object class="GtkTreeView" id="treeview">
67 /// <property name="model">liststore1</property>
68 /// <child>
69 /// <object class="GtkTreeViewColumn" id="test-column">
70 /// <property name="title">Test</property>
71 /// <child>
72 /// <object class="GtkCellRendererText" id="test-renderer"/>
73 /// <attributes>
74 /// <attribute name="text">1</attribute>
75 /// </attributes>
76 /// </child>
77 /// </object>
78 /// </child>
79 /// <child internal-child="selection">
80 /// <object class="GtkTreeSelection" id="selection">
81 /// <signal name="changed" handler="on_treeview_selection_changed"/>
82 /// </object>
83 /// </child>
84 /// </object>
85 /// ```
86 ///
87 /// ## CSS nodes
88 ///
89 /// ```text
90 /// treeview.view
91 /// ├── header
92 /// │ ├── button
93 /// │ │ ╰── [sort-indicator]
94 /// ┊ ┊
95 /// │ ╰── button
96 /// │ ╰── [sort-indicator]
97 /// │
98 /// ├── [rubberband]
99 /// ╰── [dndtarget]
100 /// ```
101 ///
102 /// [`TreeView`][crate::TreeView] has a main CSS node with name `treeview` and style class `.view`.
103 /// It has a subnode with name `header`, which is the parent for all the column
104 /// header widgets' CSS nodes.
105 ///
106 /// Each column header consists of a `button`, which among other content, has a
107 /// child with name `sort-indicator`, which carries the `.ascending` or `.descending`
108 /// style classes when the column header should show a sort indicator. The CSS
109 /// is expected to provide a suitable image using the `-gtk-icon-source` property.
110 ///
111 /// For rubberband selection, a subnode with name `rubberband` is used.
112 ///
113 /// For the drop target location during DND, a subnode with name `dndtarget` is used.
114 ///
115 /// ## Properties
116 ///
117 ///
118 /// #### `activate-on-single-click`
119 /// The activate-on-single-click property specifies whether the "row-activated" signal
120 /// will be emitted after a single click.
121 ///
122 /// Readable | Writeable
123 ///
124 ///
125 /// #### `enable-grid-lines`
126 /// Readable | Writeable
127 ///
128 ///
129 /// #### `enable-search`
130 /// Readable | Writeable
131 ///
132 ///
133 /// #### `enable-tree-lines`
134 /// Readable | Writeable
135 ///
136 ///
137 /// #### `expander-column`
138 /// Readable | Writeable
139 ///
140 ///
141 /// #### `fixed-height-mode`
142 /// Setting the ::fixed-height-mode property to [`true`] speeds up
143 /// [`TreeView`][crate::TreeView] by assuming that all rows have the same height.
144 /// Only enable this option if all rows are the same height.
145 /// Please see gtk_tree_view_set_fixed_height_mode() for more
146 /// information on this option.
147 ///
148 /// Readable | Writeable
149 ///
150 ///
151 /// #### `headers-clickable`
152 /// Readable | Writeable
153 ///
154 ///
155 /// #### `headers-visible`
156 /// Readable | Writeable
157 ///
158 ///
159 /// #### `hover-expand`
160 /// Enables or disables the hover expansion mode of @tree_view.
161 /// Hover expansion makes rows expand or collapse if the pointer moves
162 /// over them.
163 ///
164 /// This mode is primarily intended for treeviews in popups, e.g.
165 /// in [`ComboBox`][crate::ComboBox] or [`EntryCompletion`][crate::EntryCompletion].
166 ///
167 /// Readable | Writeable
168 ///
169 ///
170 /// #### `hover-selection`
171 /// Enables or disables the hover selection mode of @tree_view.
172 /// Hover selection makes the selected row follow the pointer.
173 /// Currently, this works only for the selection modes
174 /// [`SelectionMode::Single`][crate::SelectionMode::Single] and [`SelectionMode::Browse`][crate::SelectionMode::Browse].
175 ///
176 /// This mode is primarily intended for treeviews in popups, e.g.
177 /// in [`ComboBox`][crate::ComboBox] or [`EntryCompletion`][crate::EntryCompletion].
178 ///
179 /// Readable | Writeable
180 ///
181 ///
182 /// #### `level-indentation`
183 /// Extra indentation for each level.
184 ///
185 /// Readable | Writeable
186 ///
187 ///
188 /// #### `model`
189 /// Readable | Writeable
190 ///
191 ///
192 /// #### `reorderable`
193 /// Readable | Writeable
194 ///
195 ///
196 /// #### `rubber-banding`
197 /// Readable | Writeable
198 ///
199 ///
200 /// #### `search-column`
201 /// Readable | Writeable
202 ///
203 ///
204 /// #### `show-expanders`
205 /// [`true`] if the view has expanders.
206 ///
207 /// Readable | Writeable
208 ///
209 ///
210 /// #### `tooltip-column`
211 /// Readable | Writeable
212 /// <details><summary><h4>Widget</h4></summary>
213 ///
214 ///
215 /// #### `can-focus`
216 /// Whether the widget or any of its descendents can accept
217 /// the input focus.
218 ///
219 /// This property is meant to be set by widget implementations,
220 /// typically in their instance init function.
221 ///
222 /// Readable | Writeable
223 ///
224 ///
225 /// #### `can-target`
226 /// Whether the widget can receive pointer events.
227 ///
228 /// Readable | Writeable
229 ///
230 ///
231 /// #### `css-classes`
232 /// A list of css classes applied to this widget.
233 ///
234 /// Readable | Writeable
235 ///
236 ///
237 /// #### `css-name`
238 /// The name of this widget in the CSS tree.
239 ///
240 /// This property is meant to be set by widget implementations,
241 /// typically in their instance init function.
242 ///
243 /// Readable | Writeable | Construct Only
244 ///
245 ///
246 /// #### `cursor`
247 /// The cursor used by @widget.
248 ///
249 /// Readable | Writeable
250 ///
251 ///
252 /// #### `focus-on-click`
253 /// Whether the widget should grab focus when it is clicked with the mouse.
254 ///
255 /// This property is only relevant for widgets that can take focus.
256 ///
257 /// Readable | Writeable
258 ///
259 ///
260 /// #### `focusable`
261 /// Whether this widget itself will accept the input focus.
262 ///
263 /// Readable | Writeable
264 ///
265 ///
266 /// #### `halign`
267 /// How to distribute horizontal space if widget gets extra space.
268 ///
269 /// Readable | Writeable
270 ///
271 ///
272 /// #### `has-default`
273 /// Whether the widget is the default widget.
274 ///
275 /// Readable
276 ///
277 ///
278 /// #### `has-focus`
279 /// Whether the widget has the input focus.
280 ///
281 /// Readable
282 ///
283 ///
284 /// #### `has-tooltip`
285 /// Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
286 /// signal on @widget.
287 ///
288 /// A true value indicates that @widget can have a tooltip, in this case
289 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
290 /// determine whether it will provide a tooltip or not.
291 ///
292 /// Readable | Writeable
293 ///
294 ///
295 /// #### `height-request`
296 /// Overrides for height request of the widget.
297 ///
298 /// If this is -1, the natural request will be used.
299 ///
300 /// Readable | Writeable
301 ///
302 ///
303 /// #### `hexpand`
304 /// Whether to expand horizontally.
305 ///
306 /// Readable | Writeable
307 ///
308 ///
309 /// #### `hexpand-set`
310 /// Whether to use the `hexpand` property.
311 ///
312 /// Readable | Writeable
313 ///
314 ///
315 /// #### `layout-manager`
316 /// The [`LayoutManager`][crate::LayoutManager] instance to use to compute
317 /// the preferred size of the widget, and allocate its children.
318 ///
319 /// This property is meant to be set by widget implementations,
320 /// typically in their instance init function.
321 ///
322 /// Readable | Writeable
323 ///
324 ///
325 /// #### `limit-events`
326 /// Makes this widget act like a modal dialog, with respect to
327 /// event delivery.
328 ///
329 /// Global event controllers will not handle events with targets
330 /// inside the widget, unless they are set up to ignore propagation
331 /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
332 ///
333 /// Readable | Writeable
334 ///
335 ///
336 /// #### `margin-bottom`
337 /// Margin on bottom side of widget.
338 ///
339 /// This property adds margin outside of the widget's normal size
340 /// request, the margin will be added in addition to the size from
341 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
342 ///
343 /// Readable | Writeable
344 ///
345 ///
346 /// #### `margin-end`
347 /// Margin on end of widget, horizontally.
348 ///
349 /// This property supports left-to-right and right-to-left text
350 /// directions.
351 ///
352 /// This property adds margin outside of the widget's normal size
353 /// request, the margin will be added in addition to the size from
354 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
355 ///
356 /// Readable | Writeable
357 ///
358 ///
359 /// #### `margin-start`
360 /// Margin on start of widget, horizontally.
361 ///
362 /// This property supports left-to-right and right-to-left text
363 /// directions.
364 ///
365 /// This property adds margin outside of the widget's normal size
366 /// request, the margin will be added in addition to the size from
367 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
368 ///
369 /// Readable | Writeable
370 ///
371 ///
372 /// #### `margin-top`
373 /// Margin on top side of widget.
374 ///
375 /// This property adds margin outside of the widget's normal size
376 /// request, the margin will be added in addition to the size from
377 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
378 ///
379 /// Readable | Writeable
380 ///
381 ///
382 /// #### `name`
383 /// The name of the widget.
384 ///
385 /// Readable | Writeable
386 ///
387 ///
388 /// #### `opacity`
389 /// The requested opacity of the widget.
390 ///
391 /// Readable | Writeable
392 ///
393 ///
394 /// #### `overflow`
395 /// How content outside the widget's content area is treated.
396 ///
397 /// This property is meant to be set by widget implementations,
398 /// typically in their instance init function.
399 ///
400 /// Readable | Writeable
401 ///
402 ///
403 /// #### `parent`
404 /// The parent widget of this widget.
405 ///
406 /// Readable
407 ///
408 ///
409 /// #### `receives-default`
410 /// Whether the widget will receive the default action when it is focused.
411 ///
412 /// Readable | Writeable
413 ///
414 ///
415 /// #### `root`
416 /// The [`Root`][crate::Root] widget of the widget tree containing this widget.
417 ///
418 /// This will be `NULL` if the widget is not contained in a root widget.
419 ///
420 /// Readable
421 ///
422 ///
423 /// #### `scale-factor`
424 /// The scale factor of the widget.
425 ///
426 /// Readable
427 ///
428 ///
429 /// #### `sensitive`
430 /// Whether the widget responds to input.
431 ///
432 /// Readable | Writeable
433 ///
434 ///
435 /// #### `tooltip-markup`
436 /// Sets the text of tooltip to be the given string, which is marked up
437 /// with Pango markup.
438 ///
439 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
440 ///
441 /// This is a convenience property which will take care of getting the
442 /// tooltip shown if the given string is not `NULL`:
443 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
444 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
445 /// the default signal handler.
446 ///
447 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
448 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
449 ///
450 /// Readable | Writeable
451 ///
452 ///
453 /// #### `tooltip-text`
454 /// Sets the text of tooltip to be the given string.
455 ///
456 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
457 ///
458 /// This is a convenience property which will take care of getting the
459 /// tooltip shown if the given string is not `NULL`:
460 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
461 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
462 /// the default signal handler.
463 ///
464 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
465 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
466 ///
467 /// Readable | Writeable
468 ///
469 ///
470 /// #### `valign`
471 /// How to distribute vertical space if widget gets extra space.
472 ///
473 /// Readable | Writeable
474 ///
475 ///
476 /// #### `vexpand`
477 /// Whether to expand vertically.
478 ///
479 /// Readable | Writeable
480 ///
481 ///
482 /// #### `vexpand-set`
483 /// Whether to use the `vexpand` property.
484 ///
485 /// Readable | Writeable
486 ///
487 ///
488 /// #### `visible`
489 /// Whether the widget is visible.
490 ///
491 /// Readable | Writeable
492 ///
493 ///
494 /// #### `width-request`
495 /// Overrides for width request of the widget.
496 ///
497 /// If this is -1, the natural request will be used.
498 ///
499 /// Readable | Writeable
500 /// </details>
501 /// <details><summary><h4>Accessible</h4></summary>
502 ///
503 ///
504 /// #### `accessible-role`
505 /// The accessible role of the given [`Accessible`][crate::Accessible] implementation.
506 ///
507 /// The accessible role cannot be changed once set.
508 ///
509 /// Readable | Writeable
510 /// </details>
511 /// <details><summary><h4>Scrollable</h4></summary>
512 ///
513 ///
514 /// #### `hadjustment`
515 /// Horizontal [`Adjustment`][crate::Adjustment] of the scrollable widget.
516 ///
517 /// This adjustment is shared between the scrollable widget and its parent.
518 ///
519 /// Readable | Writeable | Construct
520 ///
521 ///
522 /// #### `hscroll-policy`
523 /// Determines when horizontal scrolling should start.
524 ///
525 /// Readable | Writeable
526 ///
527 ///
528 /// #### `vadjustment`
529 /// Vertical [`Adjustment`][crate::Adjustment] of the scrollable widget.
530 ///
531 /// This adjustment is shared between the scrollable widget and its parent.
532 ///
533 /// Readable | Writeable | Construct
534 ///
535 ///
536 /// #### `vscroll-policy`
537 /// Determines when vertical scrolling should start.
538 ///
539 /// Readable | Writeable
540 /// </details>
541 ///
542 /// ## Signals
543 ///
544 ///
545 /// #### `columns-changed`
546 /// The number of columns of the treeview has changed.
547 ///
548 ///
549 ///
550 ///
551 /// #### `cursor-changed`
552 /// The position of the cursor (focused cell) has changed.
553 ///
554 ///
555 ///
556 ///
557 /// #### `expand-collapse-cursor-row`
558 /// Action
559 ///
560 ///
561 /// #### `move-cursor`
562 /// The [`TreeView`][crate::TreeView]::move-cursor signal is a [keybinding
563 /// signal][`SignalAction`][crate::SignalAction] which gets emitted when the user
564 /// presses one of the cursor keys.
565 ///
566 /// Applications should not connect to it, but may emit it with
567 /// g_signal_emit_by_name() if they need to control the cursor
568 /// programmatically. In contrast to gtk_tree_view_set_cursor() and
569 /// gtk_tree_view_set_cursor_on_cell() when moving horizontally
570 /// [`TreeView`][crate::TreeView]::move-cursor does not reset the current selection.
571 ///
572 /// Action
573 ///
574 ///
575 /// #### `row-activated`
576 /// The "row-activated" signal is emitted when the method
577 /// [`TreeViewExt::row_activated()`][crate::prelude::TreeViewExt::row_activated()] is called.
578 ///
579 /// This signal is emitted when the user double-clicks a treeview row with the
580 /// [`activate-on-single-click`][struct@crate::TreeView#activate-on-single-click] property set to [`false`],
581 /// or when the user single-clicks a row when that property set to [`true`].
582 ///
583 /// This signal is also emitted when a non-editable row is selected and one
584 /// of the keys: <kbd>Space</kbd>, <kbd>Shift</kbd>+<kbd>Space</kbd>,
585 /// <kbd>Return</kbd> or <kbd>Enter</kbd> is pressed.
586 ///
587 /// For selection handling refer to the
588 /// [tree widget conceptual overview](section-tree-widget.html)
589 /// as well as [`TreeSelection`][crate::TreeSelection].
590 ///
591 /// Action
592 ///
593 ///
594 /// #### `row-collapsed`
595 /// The given row has been collapsed (child nodes are hidden).
596 ///
597 ///
598 ///
599 ///
600 /// #### `row-expanded`
601 /// The given row has been expanded (child nodes are shown).
602 ///
603 ///
604 ///
605 ///
606 /// #### `select-all`
607 /// Action
608 ///
609 ///
610 /// #### `select-cursor-parent`
611 /// Action
612 ///
613 ///
614 /// #### `select-cursor-row`
615 /// Action
616 ///
617 ///
618 /// #### `start-interactive-search`
619 /// Action
620 ///
621 ///
622 /// #### `test-collapse-row`
623 /// The given row is about to be collapsed (hide its children nodes). Use this
624 /// signal if you need to control the collapsibility of individual rows.
625 ///
626 ///
627 ///
628 ///
629 /// #### `test-expand-row`
630 /// The given row is about to be expanded (show its children nodes). Use this
631 /// signal if you need to control the expandability of individual rows.
632 ///
633 ///
634 ///
635 ///
636 /// #### `toggle-cursor-row`
637 /// Action
638 ///
639 ///
640 /// #### `unselect-all`
641 /// Action
642 /// <details><summary><h4>Widget</h4></summary>
643 ///
644 ///
645 /// #### `destroy`
646 /// Signals that all holders of a reference to the widget should release
647 /// the reference that they hold.
648 ///
649 /// May result in finalization of the widget if all references are released.
650 ///
651 /// This signal is not suitable for saving widget state.
652 ///
653 ///
654 ///
655 ///
656 /// #### `direction-changed`
657 /// Emitted when the text direction of a widget changes.
658 ///
659 ///
660 ///
661 ///
662 /// #### `hide`
663 /// Emitted when @widget is hidden.
664 ///
665 ///
666 ///
667 ///
668 /// #### `keynav-failed`
669 /// Emitted if keyboard navigation fails.
670 ///
671 /// See [`WidgetExt::keynav_failed()`][crate::prelude::WidgetExt::keynav_failed()] for details.
672 ///
673 ///
674 ///
675 ///
676 /// #### `map`
677 /// Emitted when @widget is going to be mapped.
678 ///
679 /// A widget is mapped when the widget is visible (which is controlled with
680 /// [`visible`][struct@crate::Widget#visible]) and all its parents up to the toplevel widget
681 /// are also visible.
682 ///
683 /// The `::map` signal can be used to determine whether a widget will be drawn,
684 /// for instance it can resume an animation that was stopped during the
685 /// emission of [`unmap`][struct@crate::Widget#unmap].
686 ///
687 ///
688 ///
689 ///
690 /// #### `mnemonic-activate`
691 /// Emitted when a widget is activated via a mnemonic.
692 ///
693 /// The default handler for this signal activates @widget if @group_cycling
694 /// is false, or just makes @widget grab focus if @group_cycling is true.
695 ///
696 ///
697 ///
698 ///
699 /// #### `move-focus`
700 /// Emitted when the focus is moved.
701 ///
702 /// The `::move-focus` signal is a [keybinding signal](class.SignalAction.html).
703 ///
704 /// The default bindings for this signal are <kbd>Tab</kbd> to move forward,
705 /// and <kbd>Shift</kbd>+<kbd>Tab</kbd> to move backward.
706 ///
707 /// Action
708 ///
709 ///
710 /// #### `query-tooltip`
711 /// Emitted when the widget’s tooltip is about to be shown.
712 ///
713 /// This happens when the [`has-tooltip`][struct@crate::Widget#has-tooltip] property
714 /// is true and the hover timeout has expired with the cursor hovering
715 /// above @widget; or emitted when @widget got focus in keyboard mode.
716 ///
717 /// Using the given coordinates, the signal handler should determine
718 /// whether a tooltip should be shown for @widget. If this is the case
719 /// true should be returned, false otherwise. Note that if @keyboard_mode
720 /// is true, the values of @x and @y are undefined and should not be used.
721 ///
722 /// The signal handler is free to manipulate @tooltip with the therefore
723 /// destined function calls.
724 ///
725 ///
726 ///
727 ///
728 /// #### `realize`
729 /// Emitted when @widget is associated with a [`gdk::Surface`][crate::gdk::Surface].
730 ///
731 /// This means that [`WidgetExt::realize()`][crate::prelude::WidgetExt::realize()] has been called
732 /// or the widget has been mapped (that is, it is going to be drawn).
733 ///
734 ///
735 ///
736 ///
737 /// #### `show`
738 /// Emitted when @widget is shown.
739 ///
740 ///
741 ///
742 ///
743 /// #### `state-flags-changed`
744 /// Emitted when the widget state changes.
745 ///
746 /// See [`WidgetExt::state_flags()`][crate::prelude::WidgetExt::state_flags()].
747 ///
748 ///
749 ///
750 ///
751 /// #### `unmap`
752 /// Emitted when @widget is going to be unmapped.
753 ///
754 /// A widget is unmapped when either it or any of its parents up to the
755 /// toplevel widget have been set as hidden.
756 ///
757 /// As `::unmap` indicates that a widget will not be shown any longer,
758 /// it can be used to, for example, stop an animation on the widget.
759 ///
760 ///
761 ///
762 ///
763 /// #### `unrealize`
764 /// Emitted when the [`gdk::Surface`][crate::gdk::Surface] associated with @widget is destroyed.
765 ///
766 /// This means that [`WidgetExt::unrealize()`][crate::prelude::WidgetExt::unrealize()] has been called
767 /// or the widget has been unmapped (that is, it is going to be hidden).
768 ///
769 ///
770 /// </details>
771 ///
772 /// # Implements
773 ///
774 /// [`TreeViewExt`][trait@crate::prelude::TreeViewExt], [`WidgetExt`][trait@crate::prelude::WidgetExt], [`trait@glib::ObjectExt`], [`AccessibleExt`][trait@crate::prelude::AccessibleExt], [`BuildableExt`][trait@crate::prelude::BuildableExt], [`ConstraintTargetExt`][trait@crate::prelude::ConstraintTargetExt], [`ScrollableExt`][trait@crate::prelude::ScrollableExt], [`TreeViewExtManual`][trait@crate::prelude::TreeViewExtManual], [`WidgetExtManual`][trait@crate::prelude::WidgetExtManual], [`AccessibleExtManual`][trait@crate::prelude::AccessibleExtManual]
775 #[doc(alias = "GtkTreeView")]
776 pub struct TreeView(Object<ffi::GtkTreeView, ffi::GtkTreeViewClass>) @extends Widget, @implements Accessible, Buildable, ConstraintTarget, Scrollable;
777
778 match fn {
779 type_ => || ffi::gtk_tree_view_get_type(),
780 }
781}
782
783impl TreeView {
784 pub const NONE: Option<&'static TreeView> = None;
785
786 /// Creates a new [`TreeView`][crate::TreeView] widget.
787 ///
788 /// # Deprecated since 4.10
789 ///
790 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
791 ///
792 /// # Returns
793 ///
794 /// A newly created [`TreeView`][crate::TreeView] widget.
795 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
796 #[allow(deprecated)]
797 #[doc(alias = "gtk_tree_view_new")]
798 pub fn new() -> TreeView {
799 assert_initialized_main_thread!();
800 unsafe { Widget::from_glib_none(ffi::gtk_tree_view_new()).unsafe_cast() }
801 }
802
803 /// Creates a new [`TreeView`][crate::TreeView] widget with the model initialized to @model.
804 ///
805 /// # Deprecated since 4.10
806 ///
807 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
808 /// ## `model`
809 /// the model.
810 ///
811 /// # Returns
812 ///
813 /// A newly created [`TreeView`][crate::TreeView] widget.
814 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
815 #[allow(deprecated)]
816 #[doc(alias = "gtk_tree_view_new_with_model")]
817 #[doc(alias = "new_with_model")]
818 pub fn with_model(model: &impl IsA<TreeModel>) -> TreeView {
819 skip_assert_initialized!();
820 unsafe {
821 Widget::from_glib_none(ffi::gtk_tree_view_new_with_model(
822 model.as_ref().to_glib_none().0,
823 ))
824 .unsafe_cast()
825 }
826 }
827
828 // rustdoc-stripper-ignore-next
829 /// Creates a new builder-pattern struct instance to construct [`TreeView`] objects.
830 ///
831 /// This method returns an instance of [`TreeViewBuilder`](crate::builders::TreeViewBuilder) which can be used to create [`TreeView`] objects.
832 pub fn builder() -> TreeViewBuilder {
833 TreeViewBuilder::new()
834 }
835}
836
837impl Default for TreeView {
838 fn default() -> Self {
839 Self::new()
840 }
841}
842
843// rustdoc-stripper-ignore-next
844/// A [builder-pattern] type to construct [`TreeView`] objects.
845///
846/// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html
847#[must_use = "The builder must be built to be used"]
848pub struct TreeViewBuilder {
849 builder: glib::object::ObjectBuilder<'static, TreeView>,
850}
851
852impl TreeViewBuilder {
853 fn new() -> Self {
854 Self {
855 builder: glib::object::Object::builder(),
856 }
857 }
858
859 /// The activate-on-single-click property specifies whether the "row-activated" signal
860 /// will be emitted after a single click.
861 pub fn activate_on_single_click(self, activate_on_single_click: bool) -> Self {
862 Self {
863 builder: self
864 .builder
865 .property("activate-on-single-click", activate_on_single_click),
866 }
867 }
868
869 pub fn enable_grid_lines(self, enable_grid_lines: TreeViewGridLines) -> Self {
870 Self {
871 builder: self
872 .builder
873 .property("enable-grid-lines", enable_grid_lines),
874 }
875 }
876
877 pub fn enable_search(self, enable_search: bool) -> Self {
878 Self {
879 builder: self.builder.property("enable-search", enable_search),
880 }
881 }
882
883 pub fn enable_tree_lines(self, enable_tree_lines: bool) -> Self {
884 Self {
885 builder: self
886 .builder
887 .property("enable-tree-lines", enable_tree_lines),
888 }
889 }
890
891 pub fn expander_column(self, expander_column: &TreeViewColumn) -> Self {
892 Self {
893 builder: self
894 .builder
895 .property("expander-column", expander_column.clone()),
896 }
897 }
898
899 /// Setting the ::fixed-height-mode property to [`true`] speeds up
900 /// [`TreeView`][crate::TreeView] by assuming that all rows have the same height.
901 /// Only enable this option if all rows are the same height.
902 /// Please see gtk_tree_view_set_fixed_height_mode() for more
903 /// information on this option.
904 pub fn fixed_height_mode(self, fixed_height_mode: bool) -> Self {
905 Self {
906 builder: self
907 .builder
908 .property("fixed-height-mode", fixed_height_mode),
909 }
910 }
911
912 pub fn headers_clickable(self, headers_clickable: bool) -> Self {
913 Self {
914 builder: self
915 .builder
916 .property("headers-clickable", headers_clickable),
917 }
918 }
919
920 pub fn headers_visible(self, headers_visible: bool) -> Self {
921 Self {
922 builder: self.builder.property("headers-visible", headers_visible),
923 }
924 }
925
926 /// Enables or disables the hover expansion mode of @tree_view.
927 /// Hover expansion makes rows expand or collapse if the pointer moves
928 /// over them.
929 ///
930 /// This mode is primarily intended for treeviews in popups, e.g.
931 /// in [`ComboBox`][crate::ComboBox] or [`EntryCompletion`][crate::EntryCompletion].
932 pub fn hover_expand(self, hover_expand: bool) -> Self {
933 Self {
934 builder: self.builder.property("hover-expand", hover_expand),
935 }
936 }
937
938 /// Enables or disables the hover selection mode of @tree_view.
939 /// Hover selection makes the selected row follow the pointer.
940 /// Currently, this works only for the selection modes
941 /// [`SelectionMode::Single`][crate::SelectionMode::Single] and [`SelectionMode::Browse`][crate::SelectionMode::Browse].
942 ///
943 /// This mode is primarily intended for treeviews in popups, e.g.
944 /// in [`ComboBox`][crate::ComboBox] or [`EntryCompletion`][crate::EntryCompletion].
945 pub fn hover_selection(self, hover_selection: bool) -> Self {
946 Self {
947 builder: self.builder.property("hover-selection", hover_selection),
948 }
949 }
950
951 /// Extra indentation for each level.
952 pub fn level_indentation(self, level_indentation: i32) -> Self {
953 Self {
954 builder: self
955 .builder
956 .property("level-indentation", level_indentation),
957 }
958 }
959
960 pub fn model(self, model: &impl IsA<TreeModel>) -> Self {
961 Self {
962 builder: self.builder.property("model", model.clone().upcast()),
963 }
964 }
965
966 pub fn reorderable(self, reorderable: bool) -> Self {
967 Self {
968 builder: self.builder.property("reorderable", reorderable),
969 }
970 }
971
972 pub fn rubber_banding(self, rubber_banding: bool) -> Self {
973 Self {
974 builder: self.builder.property("rubber-banding", rubber_banding),
975 }
976 }
977
978 pub fn search_column(self, search_column: i32) -> Self {
979 Self {
980 builder: self.builder.property("search-column", search_column),
981 }
982 }
983
984 /// [`true`] if the view has expanders.
985 pub fn show_expanders(self, show_expanders: bool) -> Self {
986 Self {
987 builder: self.builder.property("show-expanders", show_expanders),
988 }
989 }
990
991 pub fn tooltip_column(self, tooltip_column: i32) -> Self {
992 Self {
993 builder: self.builder.property("tooltip-column", tooltip_column),
994 }
995 }
996
997 /// Whether the widget or any of its descendents can accept
998 /// the input focus.
999 ///
1000 /// This property is meant to be set by widget implementations,
1001 /// typically in their instance init function.
1002 pub fn can_focus(self, can_focus: bool) -> Self {
1003 Self {
1004 builder: self.builder.property("can-focus", can_focus),
1005 }
1006 }
1007
1008 /// Whether the widget can receive pointer events.
1009 pub fn can_target(self, can_target: bool) -> Self {
1010 Self {
1011 builder: self.builder.property("can-target", can_target),
1012 }
1013 }
1014
1015 /// A list of css classes applied to this widget.
1016 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
1017 Self {
1018 builder: self.builder.property("css-classes", css_classes.into()),
1019 }
1020 }
1021
1022 /// The name of this widget in the CSS tree.
1023 ///
1024 /// This property is meant to be set by widget implementations,
1025 /// typically in their instance init function.
1026 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
1027 Self {
1028 builder: self.builder.property("css-name", css_name.into()),
1029 }
1030 }
1031
1032 /// The cursor used by @widget.
1033 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
1034 Self {
1035 builder: self.builder.property("cursor", cursor.clone()),
1036 }
1037 }
1038
1039 /// Whether the widget should grab focus when it is clicked with the mouse.
1040 ///
1041 /// This property is only relevant for widgets that can take focus.
1042 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
1043 Self {
1044 builder: self.builder.property("focus-on-click", focus_on_click),
1045 }
1046 }
1047
1048 /// Whether this widget itself will accept the input focus.
1049 pub fn focusable(self, focusable: bool) -> Self {
1050 Self {
1051 builder: self.builder.property("focusable", focusable),
1052 }
1053 }
1054
1055 /// How to distribute horizontal space if widget gets extra space.
1056 pub fn halign(self, halign: Align) -> Self {
1057 Self {
1058 builder: self.builder.property("halign", halign),
1059 }
1060 }
1061
1062 /// Enables or disables the emission of the [`query-tooltip`][struct@crate::Widget#query-tooltip]
1063 /// signal on @widget.
1064 ///
1065 /// A true value indicates that @widget can have a tooltip, in this case
1066 /// the widget will be queried using [`query-tooltip`][struct@crate::Widget#query-tooltip] to
1067 /// determine whether it will provide a tooltip or not.
1068 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
1069 Self {
1070 builder: self.builder.property("has-tooltip", has_tooltip),
1071 }
1072 }
1073
1074 /// Overrides for height request of the widget.
1075 ///
1076 /// If this is -1, the natural request will be used.
1077 pub fn height_request(self, height_request: i32) -> Self {
1078 Self {
1079 builder: self.builder.property("height-request", height_request),
1080 }
1081 }
1082
1083 /// Whether to expand horizontally.
1084 pub fn hexpand(self, hexpand: bool) -> Self {
1085 Self {
1086 builder: self.builder.property("hexpand", hexpand),
1087 }
1088 }
1089
1090 /// Whether to use the `hexpand` property.
1091 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
1092 Self {
1093 builder: self.builder.property("hexpand-set", hexpand_set),
1094 }
1095 }
1096
1097 /// The [`LayoutManager`][crate::LayoutManager] instance to use to compute
1098 /// the preferred size of the widget, and allocate its children.
1099 ///
1100 /// This property is meant to be set by widget implementations,
1101 /// typically in their instance init function.
1102 pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
1103 Self {
1104 builder: self
1105 .builder
1106 .property("layout-manager", layout_manager.clone().upcast()),
1107 }
1108 }
1109
1110 /// Makes this widget act like a modal dialog, with respect to
1111 /// event delivery.
1112 ///
1113 /// Global event controllers will not handle events with targets
1114 /// inside the widget, unless they are set up to ignore propagation
1115 /// limits. See [`EventControllerExt::set_propagation_limit()`][crate::prelude::EventControllerExt::set_propagation_limit()].
1116 #[cfg(feature = "v4_18")]
1117 #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
1118 pub fn limit_events(self, limit_events: bool) -> Self {
1119 Self {
1120 builder: self.builder.property("limit-events", limit_events),
1121 }
1122 }
1123
1124 /// Margin on bottom side of widget.
1125 ///
1126 /// This property adds margin outside of the widget's normal size
1127 /// request, the margin will be added in addition to the size from
1128 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1129 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
1130 Self {
1131 builder: self.builder.property("margin-bottom", margin_bottom),
1132 }
1133 }
1134
1135 /// Margin on end of widget, horizontally.
1136 ///
1137 /// This property supports left-to-right and right-to-left text
1138 /// directions.
1139 ///
1140 /// This property adds margin outside of the widget's normal size
1141 /// request, the margin will be added in addition to the size from
1142 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1143 pub fn margin_end(self, margin_end: i32) -> Self {
1144 Self {
1145 builder: self.builder.property("margin-end", margin_end),
1146 }
1147 }
1148
1149 /// Margin on start of widget, horizontally.
1150 ///
1151 /// This property supports left-to-right and right-to-left text
1152 /// directions.
1153 ///
1154 /// This property adds margin outside of the widget's normal size
1155 /// request, the margin will be added in addition to the size from
1156 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1157 pub fn margin_start(self, margin_start: i32) -> Self {
1158 Self {
1159 builder: self.builder.property("margin-start", margin_start),
1160 }
1161 }
1162
1163 /// Margin on top side of widget.
1164 ///
1165 /// This property adds margin outside of the widget's normal size
1166 /// request, the margin will be added in addition to the size from
1167 /// [`WidgetExt::set_size_request()`][crate::prelude::WidgetExt::set_size_request()] for example.
1168 pub fn margin_top(self, margin_top: i32) -> Self {
1169 Self {
1170 builder: self.builder.property("margin-top", margin_top),
1171 }
1172 }
1173
1174 /// The name of the widget.
1175 pub fn name(self, name: impl Into<glib::GString>) -> Self {
1176 Self {
1177 builder: self.builder.property("name", name.into()),
1178 }
1179 }
1180
1181 /// The requested opacity of the widget.
1182 pub fn opacity(self, opacity: f64) -> Self {
1183 Self {
1184 builder: self.builder.property("opacity", opacity),
1185 }
1186 }
1187
1188 /// How content outside the widget's content area is treated.
1189 ///
1190 /// This property is meant to be set by widget implementations,
1191 /// typically in their instance init function.
1192 pub fn overflow(self, overflow: Overflow) -> Self {
1193 Self {
1194 builder: self.builder.property("overflow", overflow),
1195 }
1196 }
1197
1198 /// Whether the widget will receive the default action when it is focused.
1199 pub fn receives_default(self, receives_default: bool) -> Self {
1200 Self {
1201 builder: self.builder.property("receives-default", receives_default),
1202 }
1203 }
1204
1205 /// Whether the widget responds to input.
1206 pub fn sensitive(self, sensitive: bool) -> Self {
1207 Self {
1208 builder: self.builder.property("sensitive", sensitive),
1209 }
1210 }
1211
1212 /// Sets the text of tooltip to be the given string, which is marked up
1213 /// with Pango markup.
1214 ///
1215 /// Also see [`Tooltip::set_markup()`][crate::Tooltip::set_markup()].
1216 ///
1217 /// This is a convenience property which will take care of getting the
1218 /// tooltip shown if the given string is not `NULL`:
1219 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
1220 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
1221 /// the default signal handler.
1222 ///
1223 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
1224 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
1225 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
1226 Self {
1227 builder: self
1228 .builder
1229 .property("tooltip-markup", tooltip_markup.into()),
1230 }
1231 }
1232
1233 /// Sets the text of tooltip to be the given string.
1234 ///
1235 /// Also see [`Tooltip::set_text()`][crate::Tooltip::set_text()].
1236 ///
1237 /// This is a convenience property which will take care of getting the
1238 /// tooltip shown if the given string is not `NULL`:
1239 /// [`has-tooltip`][struct@crate::Widget#has-tooltip] will automatically be set to true
1240 /// and there will be taken care of [`query-tooltip`][struct@crate::Widget#query-tooltip] in
1241 /// the default signal handler.
1242 ///
1243 /// Note that if both [`tooltip-text`][struct@crate::Widget#tooltip-text] and
1244 /// [`tooltip-markup`][struct@crate::Widget#tooltip-markup] are set, the last one wins.
1245 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
1246 Self {
1247 builder: self.builder.property("tooltip-text", tooltip_text.into()),
1248 }
1249 }
1250
1251 /// How to distribute vertical space if widget gets extra space.
1252 pub fn valign(self, valign: Align) -> Self {
1253 Self {
1254 builder: self.builder.property("valign", valign),
1255 }
1256 }
1257
1258 /// Whether to expand vertically.
1259 pub fn vexpand(self, vexpand: bool) -> Self {
1260 Self {
1261 builder: self.builder.property("vexpand", vexpand),
1262 }
1263 }
1264
1265 /// Whether to use the `vexpand` property.
1266 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
1267 Self {
1268 builder: self.builder.property("vexpand-set", vexpand_set),
1269 }
1270 }
1271
1272 /// Whether the widget is visible.
1273 pub fn visible(self, visible: bool) -> Self {
1274 Self {
1275 builder: self.builder.property("visible", visible),
1276 }
1277 }
1278
1279 /// Overrides for width request of the widget.
1280 ///
1281 /// If this is -1, the natural request will be used.
1282 pub fn width_request(self, width_request: i32) -> Self {
1283 Self {
1284 builder: self.builder.property("width-request", width_request),
1285 }
1286 }
1287
1288 /// The accessible role of the given [`Accessible`][crate::Accessible] implementation.
1289 ///
1290 /// The accessible role cannot be changed once set.
1291 pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
1292 Self {
1293 builder: self.builder.property("accessible-role", accessible_role),
1294 }
1295 }
1296
1297 /// Horizontal [`Adjustment`][crate::Adjustment] of the scrollable widget.
1298 ///
1299 /// This adjustment is shared between the scrollable widget and its parent.
1300 pub fn hadjustment(self, hadjustment: &impl IsA<Adjustment>) -> Self {
1301 Self {
1302 builder: self
1303 .builder
1304 .property("hadjustment", hadjustment.clone().upcast()),
1305 }
1306 }
1307
1308 /// Determines when horizontal scrolling should start.
1309 pub fn hscroll_policy(self, hscroll_policy: ScrollablePolicy) -> Self {
1310 Self {
1311 builder: self.builder.property("hscroll-policy", hscroll_policy),
1312 }
1313 }
1314
1315 /// Vertical [`Adjustment`][crate::Adjustment] of the scrollable widget.
1316 ///
1317 /// This adjustment is shared between the scrollable widget and its parent.
1318 pub fn vadjustment(self, vadjustment: &impl IsA<Adjustment>) -> Self {
1319 Self {
1320 builder: self
1321 .builder
1322 .property("vadjustment", vadjustment.clone().upcast()),
1323 }
1324 }
1325
1326 /// Determines when vertical scrolling should start.
1327 pub fn vscroll_policy(self, vscroll_policy: ScrollablePolicy) -> Self {
1328 Self {
1329 builder: self.builder.property("vscroll-policy", vscroll_policy),
1330 }
1331 }
1332
1333 // rustdoc-stripper-ignore-next
1334 /// Build the [`TreeView`].
1335 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
1336 pub fn build(self) -> TreeView {
1337 assert_initialized_main_thread!();
1338 self.builder.build()
1339 }
1340}
1341
1342/// Trait containing all [`struct@TreeView`] methods.
1343///
1344/// # Implementors
1345///
1346/// [`TreeView`][struct@crate::TreeView]
1347pub trait TreeViewExt: IsA<TreeView> + 'static {
1348 /// Appends @column to the list of columns. If @self has “fixed_height”
1349 /// mode enabled, then @column must have its “sizing” property set to be
1350 /// GTK_TREE_VIEW_COLUMN_FIXED.
1351 ///
1352 /// # Deprecated since 4.10
1353 ///
1354 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1355 /// ## `column`
1356 /// The [`TreeViewColumn`][crate::TreeViewColumn] to add.
1357 ///
1358 /// # Returns
1359 ///
1360 /// The number of columns in @self after appending.
1361 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1362 #[allow(deprecated)]
1363 #[doc(alias = "gtk_tree_view_append_column")]
1364 fn append_column(&self, column: &TreeViewColumn) -> i32 {
1365 unsafe {
1366 ffi::gtk_tree_view_append_column(
1367 self.as_ref().to_glib_none().0,
1368 column.to_glib_none().0,
1369 )
1370 }
1371 }
1372
1373 /// Recursively collapses all visible, expanded nodes in @self.
1374 ///
1375 /// # Deprecated since 4.10
1376 ///
1377 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1378 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1379 #[allow(deprecated)]
1380 #[doc(alias = "gtk_tree_view_collapse_all")]
1381 fn collapse_all(&self) {
1382 unsafe {
1383 ffi::gtk_tree_view_collapse_all(self.as_ref().to_glib_none().0);
1384 }
1385 }
1386
1387 /// Collapses a row (hides its child rows, if they exist).
1388 ///
1389 /// # Deprecated since 4.10
1390 ///
1391 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1392 /// ## `path`
1393 /// path to a row in the @self
1394 ///
1395 /// # Returns
1396 ///
1397 /// [`true`] if the row was collapsed.
1398 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1399 #[allow(deprecated)]
1400 #[doc(alias = "gtk_tree_view_collapse_row")]
1401 fn collapse_row(&self, path: &TreePath) -> bool {
1402 unsafe {
1403 from_glib(ffi::gtk_tree_view_collapse_row(
1404 self.as_ref().to_glib_none().0,
1405 mut_override(path.to_glib_none().0),
1406 ))
1407 }
1408 }
1409
1410 /// Resizes all columns to their optimal width. Only works after the
1411 /// treeview has been realized.
1412 ///
1413 /// # Deprecated since 4.10
1414 ///
1415 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1416 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1417 #[allow(deprecated)]
1418 #[doc(alias = "gtk_tree_view_columns_autosize")]
1419 fn columns_autosize(&self) {
1420 unsafe {
1421 ffi::gtk_tree_view_columns_autosize(self.as_ref().to_glib_none().0);
1422 }
1423 }
1424
1425 /// Converts bin_window coordinates to coordinates for the
1426 /// tree (the full scrollable area of the tree).
1427 ///
1428 /// # Deprecated since 4.10
1429 ///
1430 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1431 /// ## `bx`
1432 /// X coordinate relative to bin_window
1433 /// ## `by`
1434 /// Y coordinate relative to bin_window
1435 ///
1436 /// # Returns
1437 ///
1438 ///
1439 /// ## `tx`
1440 /// return location for tree X coordinate
1441 ///
1442 /// ## `ty`
1443 /// return location for tree Y coordinate
1444 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1445 #[allow(deprecated)]
1446 #[doc(alias = "gtk_tree_view_convert_bin_window_to_tree_coords")]
1447 fn convert_bin_window_to_tree_coords(&self, bx: i32, by: i32) -> (i32, i32) {
1448 unsafe {
1449 let mut tx = std::mem::MaybeUninit::uninit();
1450 let mut ty = std::mem::MaybeUninit::uninit();
1451 ffi::gtk_tree_view_convert_bin_window_to_tree_coords(
1452 self.as_ref().to_glib_none().0,
1453 bx,
1454 by,
1455 tx.as_mut_ptr(),
1456 ty.as_mut_ptr(),
1457 );
1458 (tx.assume_init(), ty.assume_init())
1459 }
1460 }
1461
1462 /// Converts bin_window coordinates to widget relative coordinates.
1463 ///
1464 /// # Deprecated since 4.10
1465 ///
1466 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1467 /// ## `bx`
1468 /// bin_window X coordinate
1469 /// ## `by`
1470 /// bin_window Y coordinate
1471 ///
1472 /// # Returns
1473 ///
1474 ///
1475 /// ## `wx`
1476 /// return location for widget X coordinate
1477 ///
1478 /// ## `wy`
1479 /// return location for widget Y coordinate
1480 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1481 #[allow(deprecated)]
1482 #[doc(alias = "gtk_tree_view_convert_bin_window_to_widget_coords")]
1483 fn convert_bin_window_to_widget_coords(&self, bx: i32, by: i32) -> (i32, i32) {
1484 unsafe {
1485 let mut wx = std::mem::MaybeUninit::uninit();
1486 let mut wy = std::mem::MaybeUninit::uninit();
1487 ffi::gtk_tree_view_convert_bin_window_to_widget_coords(
1488 self.as_ref().to_glib_none().0,
1489 bx,
1490 by,
1491 wx.as_mut_ptr(),
1492 wy.as_mut_ptr(),
1493 );
1494 (wx.assume_init(), wy.assume_init())
1495 }
1496 }
1497
1498 /// Converts tree coordinates (coordinates in full scrollable area of the tree)
1499 /// to bin_window coordinates.
1500 ///
1501 /// # Deprecated since 4.10
1502 ///
1503 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1504 /// ## `tx`
1505 /// tree X coordinate
1506 /// ## `ty`
1507 /// tree Y coordinate
1508 ///
1509 /// # Returns
1510 ///
1511 ///
1512 /// ## `bx`
1513 /// return location for X coordinate relative to bin_window
1514 ///
1515 /// ## `by`
1516 /// return location for Y coordinate relative to bin_window
1517 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1518 #[allow(deprecated)]
1519 #[doc(alias = "gtk_tree_view_convert_tree_to_bin_window_coords")]
1520 fn convert_tree_to_bin_window_coords(&self, tx: i32, ty: i32) -> (i32, i32) {
1521 unsafe {
1522 let mut bx = std::mem::MaybeUninit::uninit();
1523 let mut by = std::mem::MaybeUninit::uninit();
1524 ffi::gtk_tree_view_convert_tree_to_bin_window_coords(
1525 self.as_ref().to_glib_none().0,
1526 tx,
1527 ty,
1528 bx.as_mut_ptr(),
1529 by.as_mut_ptr(),
1530 );
1531 (bx.assume_init(), by.assume_init())
1532 }
1533 }
1534
1535 /// Converts tree coordinates (coordinates in full scrollable area of the tree)
1536 /// to widget coordinates.
1537 ///
1538 /// # Deprecated since 4.10
1539 ///
1540 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1541 /// ## `tx`
1542 /// X coordinate relative to the tree
1543 /// ## `ty`
1544 /// Y coordinate relative to the tree
1545 ///
1546 /// # Returns
1547 ///
1548 ///
1549 /// ## `wx`
1550 /// return location for widget X coordinate
1551 ///
1552 /// ## `wy`
1553 /// return location for widget Y coordinate
1554 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1555 #[allow(deprecated)]
1556 #[doc(alias = "gtk_tree_view_convert_tree_to_widget_coords")]
1557 fn convert_tree_to_widget_coords(&self, tx: i32, ty: i32) -> (i32, i32) {
1558 unsafe {
1559 let mut wx = std::mem::MaybeUninit::uninit();
1560 let mut wy = std::mem::MaybeUninit::uninit();
1561 ffi::gtk_tree_view_convert_tree_to_widget_coords(
1562 self.as_ref().to_glib_none().0,
1563 tx,
1564 ty,
1565 wx.as_mut_ptr(),
1566 wy.as_mut_ptr(),
1567 );
1568 (wx.assume_init(), wy.assume_init())
1569 }
1570 }
1571
1572 /// Converts widget coordinates to coordinates for the bin_window.
1573 ///
1574 /// # Deprecated since 4.10
1575 ///
1576 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1577 /// ## `wx`
1578 /// X coordinate relative to the widget
1579 /// ## `wy`
1580 /// Y coordinate relative to the widget
1581 ///
1582 /// # Returns
1583 ///
1584 ///
1585 /// ## `bx`
1586 /// return location for bin_window X coordinate
1587 ///
1588 /// ## `by`
1589 /// return location for bin_window Y coordinate
1590 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1591 #[allow(deprecated)]
1592 #[doc(alias = "gtk_tree_view_convert_widget_to_bin_window_coords")]
1593 fn convert_widget_to_bin_window_coords(&self, wx: i32, wy: i32) -> (i32, i32) {
1594 unsafe {
1595 let mut bx = std::mem::MaybeUninit::uninit();
1596 let mut by = std::mem::MaybeUninit::uninit();
1597 ffi::gtk_tree_view_convert_widget_to_bin_window_coords(
1598 self.as_ref().to_glib_none().0,
1599 wx,
1600 wy,
1601 bx.as_mut_ptr(),
1602 by.as_mut_ptr(),
1603 );
1604 (bx.assume_init(), by.assume_init())
1605 }
1606 }
1607
1608 /// Converts widget coordinates to coordinates for the
1609 /// tree (the full scrollable area of the tree).
1610 ///
1611 /// # Deprecated since 4.10
1612 ///
1613 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1614 /// ## `wx`
1615 /// X coordinate relative to the widget
1616 /// ## `wy`
1617 /// Y coordinate relative to the widget
1618 ///
1619 /// # Returns
1620 ///
1621 ///
1622 /// ## `tx`
1623 /// return location for tree X coordinate
1624 ///
1625 /// ## `ty`
1626 /// return location for tree Y coordinate
1627 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1628 #[allow(deprecated)]
1629 #[doc(alias = "gtk_tree_view_convert_widget_to_tree_coords")]
1630 fn convert_widget_to_tree_coords(&self, wx: i32, wy: i32) -> (i32, i32) {
1631 unsafe {
1632 let mut tx = std::mem::MaybeUninit::uninit();
1633 let mut ty = std::mem::MaybeUninit::uninit();
1634 ffi::gtk_tree_view_convert_widget_to_tree_coords(
1635 self.as_ref().to_glib_none().0,
1636 wx,
1637 wy,
1638 tx.as_mut_ptr(),
1639 ty.as_mut_ptr(),
1640 );
1641 (tx.assume_init(), ty.assume_init())
1642 }
1643 }
1644
1645 /// Creates a [`cairo::Surface`][crate::cairo::Surface] representation of the row at @path.
1646 /// This image is used for a drag icon.
1647 ///
1648 /// # Deprecated since 4.10
1649 ///
1650 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1651 /// ## `path`
1652 /// a [`TreePath`][crate::TreePath] in @self
1653 ///
1654 /// # Returns
1655 ///
1656 /// a newly-allocated surface of the drag icon.
1657 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1658 #[allow(deprecated)]
1659 #[doc(alias = "gtk_tree_view_create_row_drag_icon")]
1660 fn create_row_drag_icon(&self, path: &TreePath) -> Option<gdk::Paintable> {
1661 unsafe {
1662 from_glib_full(ffi::gtk_tree_view_create_row_drag_icon(
1663 self.as_ref().to_glib_none().0,
1664 mut_override(path.to_glib_none().0),
1665 ))
1666 }
1667 }
1668
1669 /// Turns @self into a drop destination for automatic DND. Calling
1670 /// this method sets [`TreeView`][crate::TreeView]:reorderable to [`false`].
1671 ///
1672 /// # Deprecated since 4.10
1673 ///
1674 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1675 /// ## `formats`
1676 /// the target formats that the drag will support
1677 /// ## `actions`
1678 /// the bitmask of possible actions for a drag from this
1679 /// widget
1680 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1681 #[allow(deprecated)]
1682 #[doc(alias = "gtk_tree_view_enable_model_drag_dest")]
1683 fn enable_model_drag_dest(&self, formats: &gdk::ContentFormats, actions: gdk::DragAction) {
1684 unsafe {
1685 ffi::gtk_tree_view_enable_model_drag_dest(
1686 self.as_ref().to_glib_none().0,
1687 formats.to_glib_none().0,
1688 actions.into_glib(),
1689 );
1690 }
1691 }
1692
1693 /// Turns @self into a drag source for automatic DND. Calling this
1694 /// method sets [`TreeView`][crate::TreeView]:reorderable to [`false`].
1695 ///
1696 /// # Deprecated since 4.10
1697 ///
1698 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1699 /// ## `start_button_mask`
1700 /// Mask of allowed buttons to start drag
1701 /// ## `formats`
1702 /// the target formats that the drag will support
1703 /// ## `actions`
1704 /// the bitmask of possible actions for a drag from this
1705 /// widget
1706 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1707 #[allow(deprecated)]
1708 #[doc(alias = "gtk_tree_view_enable_model_drag_source")]
1709 fn enable_model_drag_source(
1710 &self,
1711 start_button_mask: gdk::ModifierType,
1712 formats: &gdk::ContentFormats,
1713 actions: gdk::DragAction,
1714 ) {
1715 unsafe {
1716 ffi::gtk_tree_view_enable_model_drag_source(
1717 self.as_ref().to_glib_none().0,
1718 start_button_mask.into_glib(),
1719 formats.to_glib_none().0,
1720 actions.into_glib(),
1721 );
1722 }
1723 }
1724
1725 /// Recursively expands all nodes in the @self.
1726 ///
1727 /// # Deprecated since 4.10
1728 ///
1729 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1730 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1731 #[allow(deprecated)]
1732 #[doc(alias = "gtk_tree_view_expand_all")]
1733 fn expand_all(&self) {
1734 unsafe {
1735 ffi::gtk_tree_view_expand_all(self.as_ref().to_glib_none().0);
1736 }
1737 }
1738
1739 /// Opens the row so its children are visible.
1740 ///
1741 /// # Deprecated since 4.10
1742 ///
1743 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1744 /// ## `path`
1745 /// path to a row
1746 /// ## `open_all`
1747 /// whether to recursively expand, or just expand immediate children
1748 ///
1749 /// # Returns
1750 ///
1751 /// [`true`] if the row existed and had children
1752 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1753 #[allow(deprecated)]
1754 #[doc(alias = "gtk_tree_view_expand_row")]
1755 fn expand_row(&self, path: &TreePath, open_all: bool) -> bool {
1756 unsafe {
1757 from_glib(ffi::gtk_tree_view_expand_row(
1758 self.as_ref().to_glib_none().0,
1759 mut_override(path.to_glib_none().0),
1760 open_all.into_glib(),
1761 ))
1762 }
1763 }
1764
1765 /// Expands the row at @path. This will also expand all parent rows of
1766 /// @path as necessary.
1767 ///
1768 /// # Deprecated since 4.10
1769 ///
1770 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1771 /// ## `path`
1772 /// path to a row.
1773 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1774 #[allow(deprecated)]
1775 #[doc(alias = "gtk_tree_view_expand_to_path")]
1776 fn expand_to_path(&self, path: &TreePath) {
1777 unsafe {
1778 ffi::gtk_tree_view_expand_to_path(
1779 self.as_ref().to_glib_none().0,
1780 mut_override(path.to_glib_none().0),
1781 );
1782 }
1783 }
1784
1785 /// Gets the setting set by gtk_tree_view_set_activate_on_single_click().
1786 ///
1787 /// # Deprecated since 4.10
1788 ///
1789 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1790 ///
1791 /// # Returns
1792 ///
1793 /// [`true`] if row-activated will be emitted on a single click
1794 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1795 #[allow(deprecated)]
1796 #[doc(alias = "gtk_tree_view_get_activate_on_single_click")]
1797 #[doc(alias = "get_activate_on_single_click")]
1798 #[doc(alias = "activate-on-single-click")]
1799 fn activates_on_single_click(&self) -> bool {
1800 unsafe {
1801 from_glib(ffi::gtk_tree_view_get_activate_on_single_click(
1802 self.as_ref().to_glib_none().0,
1803 ))
1804 }
1805 }
1806
1807 /// Fills the bounding rectangle in bin_window coordinates for the cell at the
1808 /// row specified by @path and the column specified by @column. If @path is
1809 /// [`None`], or points to a node not found in the tree, the @y and @height fields of
1810 /// the rectangle will be filled with 0. If @column is [`None`], the @x and @width
1811 /// fields will be filled with 0. The returned rectangle is equivalent to the
1812 /// @background_area passed to gtk_cell_renderer_render(). These background
1813 /// areas tile to cover the entire bin window. Contrast with the @cell_area,
1814 /// returned by gtk_tree_view_get_cell_area(), which returns only the cell
1815 /// itself, excluding surrounding borders and the tree expander area.
1816 ///
1817 /// # Deprecated since 4.10
1818 ///
1819 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1820 /// ## `path`
1821 /// a [`TreePath`][crate::TreePath] for the row, or [`None`] to get only horizontal coordinates
1822 /// ## `column`
1823 /// a [`TreeViewColumn`][crate::TreeViewColumn] for the column, or [`None`] to get only vertical coordinates
1824 ///
1825 /// # Returns
1826 ///
1827 ///
1828 /// ## `rect`
1829 /// rectangle to fill with cell background rect
1830 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1831 #[allow(deprecated)]
1832 #[doc(alias = "gtk_tree_view_get_background_area")]
1833 #[doc(alias = "get_background_area")]
1834 fn background_area(
1835 &self,
1836 path: Option<&TreePath>,
1837 column: Option<&TreeViewColumn>,
1838 ) -> gdk::Rectangle {
1839 unsafe {
1840 let mut rect = gdk::Rectangle::uninitialized();
1841 ffi::gtk_tree_view_get_background_area(
1842 self.as_ref().to_glib_none().0,
1843 mut_override(path.to_glib_none().0),
1844 column.to_glib_none().0,
1845 rect.to_glib_none_mut().0,
1846 );
1847 rect
1848 }
1849 }
1850
1851 /// Fills the bounding rectangle in bin_window coordinates for the cell at the
1852 /// row specified by @path and the column specified by @column. If @path is
1853 /// [`None`], or points to a path not currently displayed, the @y and @height fields
1854 /// of the rectangle will be filled with 0. If @column is [`None`], the @x and @width
1855 /// fields will be filled with 0. The sum of all cell rects does not cover the
1856 /// entire tree; there are extra pixels in between rows, for example. The
1857 /// returned rectangle is equivalent to the @cell_area passed to
1858 /// gtk_cell_renderer_render(). This function is only valid if @self is
1859 /// realized.
1860 ///
1861 /// # Deprecated since 4.10
1862 ///
1863 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1864 /// ## `path`
1865 /// a [`TreePath`][crate::TreePath] for the row, or [`None`] to get only horizontal coordinates
1866 /// ## `column`
1867 /// a [`TreeViewColumn`][crate::TreeViewColumn] for the column, or [`None`] to get only vertical coordinates
1868 ///
1869 /// # Returns
1870 ///
1871 ///
1872 /// ## `rect`
1873 /// rectangle to fill with cell rect
1874 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1875 #[allow(deprecated)]
1876 #[doc(alias = "gtk_tree_view_get_cell_area")]
1877 #[doc(alias = "get_cell_area")]
1878 fn cell_area(
1879 &self,
1880 path: Option<&TreePath>,
1881 column: Option<&TreeViewColumn>,
1882 ) -> gdk::Rectangle {
1883 unsafe {
1884 let mut rect = gdk::Rectangle::uninitialized();
1885 ffi::gtk_tree_view_get_cell_area(
1886 self.as_ref().to_glib_none().0,
1887 mut_override(path.to_glib_none().0),
1888 column.to_glib_none().0,
1889 rect.to_glib_none_mut().0,
1890 );
1891 rect
1892 }
1893 }
1894
1895 /// Gets the [`TreeViewColumn`][crate::TreeViewColumn] at the given position in the #tree_view.
1896 ///
1897 /// # Deprecated since 4.10
1898 ///
1899 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1900 /// ## `n`
1901 /// The position of the column, counting from 0.
1902 ///
1903 /// # Returns
1904 ///
1905 /// The [`TreeViewColumn`][crate::TreeViewColumn], or [`None`] if the
1906 /// position is outside the range of columns.
1907 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1908 #[allow(deprecated)]
1909 #[doc(alias = "gtk_tree_view_get_column")]
1910 #[doc(alias = "get_column")]
1911 fn column(&self, n: i32) -> Option<TreeViewColumn> {
1912 unsafe {
1913 from_glib_none(ffi::gtk_tree_view_get_column(
1914 self.as_ref().to_glib_none().0,
1915 n,
1916 ))
1917 }
1918 }
1919
1920 /// Returns a `GList` of all the [`TreeViewColumn`][crate::TreeViewColumn]s currently in @self.
1921 /// The returned list must be freed with g_list_free ().
1922 ///
1923 /// # Deprecated since 4.10
1924 ///
1925 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1926 ///
1927 /// # Returns
1928 ///
1929 /// A list of [`TreeViewColumn`][crate::TreeViewColumn]s
1930 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1931 #[allow(deprecated)]
1932 #[doc(alias = "gtk_tree_view_get_columns")]
1933 #[doc(alias = "get_columns")]
1934 fn columns(&self) -> Vec<TreeViewColumn> {
1935 unsafe {
1936 FromGlibPtrContainer::from_glib_container(ffi::gtk_tree_view_get_columns(
1937 self.as_ref().to_glib_none().0,
1938 ))
1939 }
1940 }
1941
1942 /// Fills in @path and @focus_column with the current path and focus column. If
1943 /// the cursor isn’t currently set, then *@path will be [`None`]. If no column
1944 /// currently has focus, then *@focus_column will be [`None`].
1945 ///
1946 /// The returned [`TreePath`][crate::TreePath] must be freed with gtk_tree_path_free() when
1947 /// you are done with it.
1948 ///
1949 /// # Deprecated since 4.10
1950 ///
1951 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1952 ///
1953 /// # Returns
1954 ///
1955 ///
1956 /// ## `path`
1957 /// A pointer to be
1958 /// filled with the current cursor path
1959 ///
1960 /// ## `focus_column`
1961 /// A
1962 /// pointer to be filled with the current focus column
1963 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1964 #[allow(deprecated)]
1965 #[doc(alias = "gtk_tree_view_get_cursor")]
1966 #[doc(alias = "get_cursor")]
1967 fn cursor(&self) -> (Option<TreePath>, Option<TreeViewColumn>) {
1968 unsafe {
1969 let mut path = std::ptr::null_mut();
1970 let mut focus_column = std::ptr::null_mut();
1971 ffi::gtk_tree_view_get_cursor(
1972 self.as_ref().to_glib_none().0,
1973 &mut path,
1974 &mut focus_column,
1975 );
1976 (from_glib_full(path), from_glib_none(focus_column))
1977 }
1978 }
1979
1980 /// Determines the destination row for a given position. @drag_x and
1981 /// @drag_y are expected to be in widget coordinates. This function is only
1982 /// meaningful if @self is realized. Therefore this function will always
1983 /// return [`false`] if @self is not realized or does not have a model.
1984 ///
1985 /// # Deprecated since 4.10
1986 ///
1987 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
1988 /// ## `drag_x`
1989 /// the position to determine the destination row for
1990 /// ## `drag_y`
1991 /// the position to determine the destination row for
1992 ///
1993 /// # Returns
1994 ///
1995 /// whether there is a row at the given position, [`true`] if this
1996 /// is indeed the case.
1997 ///
1998 /// ## `path`
1999 /// Return location for the path of
2000 /// the highlighted row
2001 ///
2002 /// ## `pos`
2003 /// Return location for the drop position, or
2004 /// [`None`]
2005 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2006 #[allow(deprecated)]
2007 #[doc(alias = "gtk_tree_view_get_dest_row_at_pos")]
2008 #[doc(alias = "get_dest_row_at_pos")]
2009 fn dest_row_at_pos(
2010 &self,
2011 drag_x: i32,
2012 drag_y: i32,
2013 ) -> Option<(Option<TreePath>, TreeViewDropPosition)> {
2014 unsafe {
2015 let mut path = std::ptr::null_mut();
2016 let mut pos = std::mem::MaybeUninit::uninit();
2017 let ret = from_glib(ffi::gtk_tree_view_get_dest_row_at_pos(
2018 self.as_ref().to_glib_none().0,
2019 drag_x,
2020 drag_y,
2021 &mut path,
2022 pos.as_mut_ptr(),
2023 ));
2024 if ret {
2025 Some((from_glib_full(path), from_glib(pos.assume_init())))
2026 } else {
2027 None
2028 }
2029 }
2030 }
2031
2032 /// Gets information about the row that is highlighted for feedback.
2033 ///
2034 /// # Deprecated since 4.10
2035 ///
2036 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2037 ///
2038 /// # Returns
2039 ///
2040 ///
2041 /// ## `path`
2042 /// Return location for the path of the highlighted row
2043 ///
2044 /// ## `pos`
2045 /// Return location for the drop position
2046 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2047 #[allow(deprecated)]
2048 #[doc(alias = "gtk_tree_view_get_drag_dest_row")]
2049 #[doc(alias = "get_drag_dest_row")]
2050 fn drag_dest_row(&self) -> (Option<TreePath>, TreeViewDropPosition) {
2051 unsafe {
2052 let mut path = std::ptr::null_mut();
2053 let mut pos = std::mem::MaybeUninit::uninit();
2054 ffi::gtk_tree_view_get_drag_dest_row(
2055 self.as_ref().to_glib_none().0,
2056 &mut path,
2057 pos.as_mut_ptr(),
2058 );
2059 (from_glib_full(path), from_glib(pos.assume_init()))
2060 }
2061 }
2062
2063 /// Returns whether or not the tree allows to start interactive searching
2064 /// by typing in text.
2065 ///
2066 /// # Deprecated since 4.10
2067 ///
2068 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2069 ///
2070 /// # Returns
2071 ///
2072 /// whether or not to let the user search interactively
2073 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2074 #[allow(deprecated)]
2075 #[doc(alias = "gtk_tree_view_get_enable_search")]
2076 #[doc(alias = "get_enable_search")]
2077 #[doc(alias = "enable-search")]
2078 fn enables_search(&self) -> bool {
2079 unsafe {
2080 from_glib(ffi::gtk_tree_view_get_enable_search(
2081 self.as_ref().to_glib_none().0,
2082 ))
2083 }
2084 }
2085
2086 /// Returns whether or not tree lines are drawn in @self.
2087 ///
2088 /// # Deprecated since 4.10
2089 ///
2090 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2091 ///
2092 /// # Returns
2093 ///
2094 /// [`true`] if tree lines are drawn in @self, [`false`]
2095 /// otherwise.
2096 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2097 #[allow(deprecated)]
2098 #[doc(alias = "gtk_tree_view_get_enable_tree_lines")]
2099 #[doc(alias = "get_enable_tree_lines")]
2100 #[doc(alias = "enable-tree-lines")]
2101 fn enables_tree_lines(&self) -> bool {
2102 unsafe {
2103 from_glib(ffi::gtk_tree_view_get_enable_tree_lines(
2104 self.as_ref().to_glib_none().0,
2105 ))
2106 }
2107 }
2108
2109 /// Returns the column that is the current expander column,
2110 /// or [`None`] if none has been set.
2111 /// This column has the expander arrow drawn next to it.
2112 ///
2113 /// # Deprecated since 4.10
2114 ///
2115 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2116 ///
2117 /// # Returns
2118 ///
2119 /// The expander column.
2120 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2121 #[allow(deprecated)]
2122 #[doc(alias = "gtk_tree_view_get_expander_column")]
2123 #[doc(alias = "get_expander_column")]
2124 #[doc(alias = "expander-column")]
2125 fn expander_column(&self) -> Option<TreeViewColumn> {
2126 unsafe {
2127 from_glib_none(ffi::gtk_tree_view_get_expander_column(
2128 self.as_ref().to_glib_none().0,
2129 ))
2130 }
2131 }
2132
2133 /// Returns whether fixed height mode is turned on for @self.
2134 ///
2135 /// # Deprecated since 4.10
2136 ///
2137 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2138 ///
2139 /// # Returns
2140 ///
2141 /// [`true`] if @self is in fixed height mode
2142 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2143 #[allow(deprecated)]
2144 #[doc(alias = "gtk_tree_view_get_fixed_height_mode")]
2145 #[doc(alias = "get_fixed_height_mode")]
2146 #[doc(alias = "fixed-height-mode")]
2147 fn is_fixed_height_mode(&self) -> bool {
2148 unsafe {
2149 from_glib(ffi::gtk_tree_view_get_fixed_height_mode(
2150 self.as_ref().to_glib_none().0,
2151 ))
2152 }
2153 }
2154
2155 /// Returns which grid lines are enabled in @self.
2156 ///
2157 /// # Deprecated since 4.10
2158 ///
2159 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2160 ///
2161 /// # Returns
2162 ///
2163 /// a [`TreeView`][crate::TreeView]GridLines value indicating which grid lines
2164 /// are enabled.
2165 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2166 #[allow(deprecated)]
2167 #[doc(alias = "gtk_tree_view_get_grid_lines")]
2168 #[doc(alias = "get_grid_lines")]
2169 fn grid_lines(&self) -> TreeViewGridLines {
2170 unsafe {
2171 from_glib(ffi::gtk_tree_view_get_grid_lines(
2172 self.as_ref().to_glib_none().0,
2173 ))
2174 }
2175 }
2176
2177 /// Returns whether all header columns are clickable.
2178 ///
2179 /// # Deprecated since 4.10
2180 ///
2181 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2182 ///
2183 /// # Returns
2184 ///
2185 /// [`true`] if all header columns are clickable, otherwise [`false`]
2186 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2187 #[allow(deprecated)]
2188 #[doc(alias = "gtk_tree_view_get_headers_clickable")]
2189 #[doc(alias = "get_headers_clickable")]
2190 #[doc(alias = "headers-clickable")]
2191 fn is_headers_clickable(&self) -> bool {
2192 unsafe {
2193 from_glib(ffi::gtk_tree_view_get_headers_clickable(
2194 self.as_ref().to_glib_none().0,
2195 ))
2196 }
2197 }
2198
2199 /// Returns [`true`] if the headers on the @self are visible.
2200 ///
2201 /// # Deprecated since 4.10
2202 ///
2203 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2204 ///
2205 /// # Returns
2206 ///
2207 /// Whether the headers are visible or not.
2208 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2209 #[allow(deprecated)]
2210 #[doc(alias = "gtk_tree_view_get_headers_visible")]
2211 #[doc(alias = "get_headers_visible")]
2212 #[doc(alias = "headers-visible")]
2213 fn is_headers_visible(&self) -> bool {
2214 unsafe {
2215 from_glib(ffi::gtk_tree_view_get_headers_visible(
2216 self.as_ref().to_glib_none().0,
2217 ))
2218 }
2219 }
2220
2221 /// Returns whether hover expansion mode is turned on for @self.
2222 ///
2223 /// # Deprecated since 4.10
2224 ///
2225 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2226 ///
2227 /// # Returns
2228 ///
2229 /// [`true`] if @self is in hover expansion mode
2230 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2231 #[allow(deprecated)]
2232 #[doc(alias = "gtk_tree_view_get_hover_expand")]
2233 #[doc(alias = "get_hover_expand")]
2234 #[doc(alias = "hover-expand")]
2235 fn hover_expands(&self) -> bool {
2236 unsafe {
2237 from_glib(ffi::gtk_tree_view_get_hover_expand(
2238 self.as_ref().to_glib_none().0,
2239 ))
2240 }
2241 }
2242
2243 /// Returns whether hover selection mode is turned on for @self.
2244 ///
2245 /// # Deprecated since 4.10
2246 ///
2247 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2248 ///
2249 /// # Returns
2250 ///
2251 /// [`true`] if @self is in hover selection mode
2252 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2253 #[allow(deprecated)]
2254 #[doc(alias = "gtk_tree_view_get_hover_selection")]
2255 #[doc(alias = "get_hover_selection")]
2256 #[doc(alias = "hover-selection")]
2257 fn is_hover_selection(&self) -> bool {
2258 unsafe {
2259 from_glib(ffi::gtk_tree_view_get_hover_selection(
2260 self.as_ref().to_glib_none().0,
2261 ))
2262 }
2263 }
2264
2265 /// Returns the amount, in pixels, of extra indentation for child levels
2266 /// in @self.
2267 ///
2268 /// # Deprecated since 4.10
2269 ///
2270 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2271 ///
2272 /// # Returns
2273 ///
2274 /// the amount of extra indentation for child levels in
2275 /// @self. A return value of 0 means that this feature is disabled.
2276 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2277 #[allow(deprecated)]
2278 #[doc(alias = "gtk_tree_view_get_level_indentation")]
2279 #[doc(alias = "get_level_indentation")]
2280 #[doc(alias = "level-indentation")]
2281 fn level_indentation(&self) -> i32 {
2282 unsafe { ffi::gtk_tree_view_get_level_indentation(self.as_ref().to_glib_none().0) }
2283 }
2284
2285 /// Returns the model the [`TreeView`][crate::TreeView] is based on. Returns [`None`] if the
2286 /// model is unset.
2287 ///
2288 /// # Deprecated since 4.10
2289 ///
2290 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2291 ///
2292 /// # Returns
2293 ///
2294 /// A [`TreeModel`][crate::TreeModel]
2295 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2296 #[allow(deprecated)]
2297 #[doc(alias = "gtk_tree_view_get_model")]
2298 #[doc(alias = "get_model")]
2299 fn model(&self) -> Option<TreeModel> {
2300 unsafe { from_glib_none(ffi::gtk_tree_view_get_model(self.as_ref().to_glib_none().0)) }
2301 }
2302
2303 /// Queries the number of columns in the given @self.
2304 ///
2305 /// # Deprecated since 4.10
2306 ///
2307 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2308 ///
2309 /// # Returns
2310 ///
2311 /// The number of columns in the @self
2312 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2313 #[allow(deprecated)]
2314 #[doc(alias = "gtk_tree_view_get_n_columns")]
2315 #[doc(alias = "get_n_columns")]
2316 fn n_columns(&self) -> u32 {
2317 unsafe { ffi::gtk_tree_view_get_n_columns(self.as_ref().to_glib_none().0) }
2318 }
2319
2320 /// Finds the path at the point (@x, @y), relative to bin_window coordinates.
2321 /// That is, @x and @y are relative to an events coordinates. Widget-relative
2322 /// coordinates must be converted using
2323 /// gtk_tree_view_convert_widget_to_bin_window_coords(). It is primarily for
2324 /// things like popup menus. If @path is non-[`None`], then it will be filled
2325 /// with the [`TreePath`][crate::TreePath] at that point. This path should be freed with
2326 /// gtk_tree_path_free(). If @column is non-[`None`], then it will be filled
2327 /// with the column at that point. @cell_x and @cell_y return the coordinates
2328 /// relative to the cell background (i.e. the @background_area passed to
2329 /// gtk_cell_renderer_render()). This function is only meaningful if
2330 /// @self is realized. Therefore this function will always return [`false`]
2331 /// if @self is not realized or does not have a model.
2332 ///
2333 /// For converting widget coordinates (eg. the ones you get from
2334 /// GtkWidget::query-tooltip), please see
2335 /// gtk_tree_view_convert_widget_to_bin_window_coords().
2336 ///
2337 /// # Deprecated since 4.10
2338 ///
2339 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2340 /// ## `x`
2341 /// The x position to be identified (relative to bin_window).
2342 /// ## `y`
2343 /// The y position to be identified (relative to bin_window).
2344 ///
2345 /// # Returns
2346 ///
2347 /// [`true`] if a row exists at that coordinate.
2348 ///
2349 /// ## `path`
2350 /// A pointer to a [`TreePath`][crate::TreePath]
2351 /// pointer to be filled in
2352 ///
2353 /// ## `column`
2354 /// A pointer to
2355 /// a [`TreeViewColumn`][crate::TreeViewColumn] pointer to be filled in
2356 ///
2357 /// ## `cell_x`
2358 /// A pointer where the X coordinate
2359 /// relative to the cell can be placed
2360 ///
2361 /// ## `cell_y`
2362 /// A pointer where the Y coordinate
2363 /// relative to the cell can be placed
2364 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2365 #[allow(deprecated)]
2366 #[doc(alias = "gtk_tree_view_get_path_at_pos")]
2367 #[doc(alias = "get_path_at_pos")]
2368 fn path_at_pos(
2369 &self,
2370 x: i32,
2371 y: i32,
2372 ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)> {
2373 unsafe {
2374 let mut path = std::ptr::null_mut();
2375 let mut column = std::ptr::null_mut();
2376 let mut cell_x = std::mem::MaybeUninit::uninit();
2377 let mut cell_y = std::mem::MaybeUninit::uninit();
2378 let ret = from_glib(ffi::gtk_tree_view_get_path_at_pos(
2379 self.as_ref().to_glib_none().0,
2380 x,
2381 y,
2382 &mut path,
2383 &mut column,
2384 cell_x.as_mut_ptr(),
2385 cell_y.as_mut_ptr(),
2386 ));
2387 if ret {
2388 Some((
2389 from_glib_full(path),
2390 from_glib_none(column),
2391 cell_x.assume_init(),
2392 cell_y.assume_init(),
2393 ))
2394 } else {
2395 None
2396 }
2397 }
2398 }
2399
2400 /// Retrieves whether the user can reorder the tree via drag-and-drop. See
2401 /// gtk_tree_view_set_reorderable().
2402 ///
2403 /// # Deprecated since 4.10
2404 ///
2405 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2406 ///
2407 /// # Returns
2408 ///
2409 /// [`true`] if the tree can be reordered.
2410 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2411 #[allow(deprecated)]
2412 #[doc(alias = "gtk_tree_view_get_reorderable")]
2413 #[doc(alias = "get_reorderable")]
2414 #[doc(alias = "reorderable")]
2415 fn is_reorderable(&self) -> bool {
2416 unsafe {
2417 from_glib(ffi::gtk_tree_view_get_reorderable(
2418 self.as_ref().to_glib_none().0,
2419 ))
2420 }
2421 }
2422
2423 /// Returns whether rubber banding is turned on for @self. If the
2424 /// selection mode is [`SelectionMode::Multiple`][crate::SelectionMode::Multiple], rubber banding will allow the
2425 /// user to select multiple rows by dragging the mouse.
2426 ///
2427 /// # Deprecated since 4.10
2428 ///
2429 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2430 ///
2431 /// # Returns
2432 ///
2433 /// [`true`] if rubber banding in @self is enabled.
2434 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2435 #[allow(deprecated)]
2436 #[doc(alias = "gtk_tree_view_get_rubber_banding")]
2437 #[doc(alias = "get_rubber_banding")]
2438 #[doc(alias = "rubber-banding")]
2439 fn is_rubber_banding(&self) -> bool {
2440 unsafe {
2441 from_glib(ffi::gtk_tree_view_get_rubber_banding(
2442 self.as_ref().to_glib_none().0,
2443 ))
2444 }
2445 }
2446
2447 /// Gets the column searched on by the interactive search code.
2448 ///
2449 /// # Deprecated since 4.10
2450 ///
2451 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2452 ///
2453 /// # Returns
2454 ///
2455 /// the column the interactive search code searches in.
2456 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2457 #[allow(deprecated)]
2458 #[doc(alias = "gtk_tree_view_get_search_column")]
2459 #[doc(alias = "get_search_column")]
2460 #[doc(alias = "search-column")]
2461 fn search_column(&self) -> i32 {
2462 unsafe { ffi::gtk_tree_view_get_search_column(self.as_ref().to_glib_none().0) }
2463 }
2464
2465 /// Returns the [`Entry`][crate::Entry] which is currently in use as interactive search
2466 /// entry for @self. In case the built-in entry is being used, [`None`]
2467 /// will be returned.
2468 ///
2469 /// # Deprecated since 4.10
2470 ///
2471 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2472 ///
2473 /// # Returns
2474 ///
2475 /// the entry currently in use as search entry.
2476 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2477 #[allow(deprecated)]
2478 #[doc(alias = "gtk_tree_view_get_search_entry")]
2479 #[doc(alias = "get_search_entry")]
2480 fn search_entry(&self) -> Option<Editable> {
2481 unsafe {
2482 from_glib_none(ffi::gtk_tree_view_get_search_entry(
2483 self.as_ref().to_glib_none().0,
2484 ))
2485 }
2486 }
2487
2488 /// Gets the [`TreeSelection`][crate::TreeSelection] associated with @self.
2489 ///
2490 /// # Deprecated since 4.10
2491 ///
2492 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2493 ///
2494 /// # Returns
2495 ///
2496 /// A [`TreeSelection`][crate::TreeSelection] object.
2497 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2498 #[allow(deprecated)]
2499 #[doc(alias = "gtk_tree_view_get_selection")]
2500 #[doc(alias = "get_selection")]
2501 fn selection(&self) -> TreeSelection {
2502 unsafe {
2503 from_glib_none(ffi::gtk_tree_view_get_selection(
2504 self.as_ref().to_glib_none().0,
2505 ))
2506 }
2507 }
2508
2509 /// Returns whether or not expanders are drawn in @self.
2510 ///
2511 /// # Deprecated since 4.10
2512 ///
2513 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2514 ///
2515 /// # Returns
2516 ///
2517 /// [`true`] if expanders are drawn in @self, [`false`]
2518 /// otherwise.
2519 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2520 #[allow(deprecated)]
2521 #[doc(alias = "gtk_tree_view_get_show_expanders")]
2522 #[doc(alias = "get_show_expanders")]
2523 #[doc(alias = "show-expanders")]
2524 fn shows_expanders(&self) -> bool {
2525 unsafe {
2526 from_glib(ffi::gtk_tree_view_get_show_expanders(
2527 self.as_ref().to_glib_none().0,
2528 ))
2529 }
2530 }
2531
2532 /// Returns the column of @self’s model which is being used for
2533 /// displaying tooltips on @self’s rows.
2534 ///
2535 /// # Deprecated since 4.10
2536 ///
2537 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2538 ///
2539 /// # Returns
2540 ///
2541 /// the index of the tooltip column that is currently being
2542 /// used, or -1 if this is disabled.
2543 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2544 #[allow(deprecated)]
2545 #[doc(alias = "gtk_tree_view_get_tooltip_column")]
2546 #[doc(alias = "get_tooltip_column")]
2547 #[doc(alias = "tooltip-column")]
2548 fn tooltip_column(&self) -> i32 {
2549 unsafe { ffi::gtk_tree_view_get_tooltip_column(self.as_ref().to_glib_none().0) }
2550 }
2551
2552 /// This function is supposed to be used in a ::query-tooltip
2553 /// signal handler for [`TreeView`][crate::TreeView]. The @x, @y and @keyboard_tip values
2554 /// which are received in the signal handler, should be passed to this
2555 /// function without modification.
2556 ///
2557 /// The return value indicates whether there is a tree view row at the given
2558 /// coordinates ([`true`]) or not ([`false`]) for mouse tooltips. For keyboard
2559 /// tooltips the row returned will be the cursor row. When [`true`], then any of
2560 /// @model, @path and @iter which have been provided will be set to point to
2561 /// that row and the corresponding model. @x and @y will always be converted
2562 /// to be relative to @self’s bin_window if @keyboard_tooltip is [`false`].
2563 ///
2564 /// # Deprecated since 4.10
2565 ///
2566 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2567 /// ## `x`
2568 /// the x coordinate (relative to widget coordinates)
2569 /// ## `y`
2570 /// the y coordinate (relative to widget coordinates)
2571 /// ## `keyboard_tip`
2572 /// whether this is a keyboard tooltip or not
2573 ///
2574 /// # Returns
2575 ///
2576 /// whether or not the given tooltip context points to a row
2577 ///
2578 /// ## `model`
2579 /// a pointer to
2580 /// receive a [`TreeModel`][crate::TreeModel]
2581 ///
2582 /// ## `path`
2583 /// a pointer to receive a [`TreePath`][crate::TreePath]
2584 ///
2585 /// ## `iter`
2586 /// a pointer to receive a [`TreeIter`][crate::TreeIter]
2587 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2588 #[allow(deprecated)]
2589 #[doc(alias = "gtk_tree_view_get_tooltip_context")]
2590 #[doc(alias = "get_tooltip_context")]
2591 fn tooltip_context(
2592 &self,
2593 x: i32,
2594 y: i32,
2595 keyboard_tip: bool,
2596 ) -> Option<(Option<TreeModel>, TreePath, TreeIter)> {
2597 unsafe {
2598 let mut model = std::ptr::null_mut();
2599 let mut path = std::ptr::null_mut();
2600 let mut iter = TreeIter::uninitialized();
2601 let ret = from_glib(ffi::gtk_tree_view_get_tooltip_context(
2602 self.as_ref().to_glib_none().0,
2603 x,
2604 y,
2605 keyboard_tip.into_glib(),
2606 &mut model,
2607 &mut path,
2608 iter.to_glib_none_mut().0,
2609 ));
2610 if ret {
2611 Some((from_glib_none(model), from_glib_full(path), iter))
2612 } else {
2613 None
2614 }
2615 }
2616 }
2617
2618 /// Sets @start_path and @end_path to be the first and last visible path.
2619 /// Note that there may be invisible paths in between.
2620 ///
2621 /// The paths should be freed with gtk_tree_path_free() after use.
2622 ///
2623 /// # Deprecated since 4.10
2624 ///
2625 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2626 ///
2627 /// # Returns
2628 ///
2629 /// [`true`], if valid paths were placed in @start_path and @end_path.
2630 ///
2631 /// ## `start_path`
2632 /// Return location for start of region
2633 ///
2634 /// ## `end_path`
2635 /// Return location for end of region
2636 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2637 #[allow(deprecated)]
2638 #[doc(alias = "gtk_tree_view_get_visible_range")]
2639 #[doc(alias = "get_visible_range")]
2640 fn visible_range(&self) -> Option<(TreePath, TreePath)> {
2641 unsafe {
2642 let mut start_path = std::ptr::null_mut();
2643 let mut end_path = std::ptr::null_mut();
2644 let ret = from_glib(ffi::gtk_tree_view_get_visible_range(
2645 self.as_ref().to_glib_none().0,
2646 &mut start_path,
2647 &mut end_path,
2648 ));
2649 if ret {
2650 Some((from_glib_full(start_path), from_glib_full(end_path)))
2651 } else {
2652 None
2653 }
2654 }
2655 }
2656
2657 /// Fills @visible_rect with the currently-visible region of the
2658 /// buffer, in tree coordinates. Convert to bin_window coordinates with
2659 /// gtk_tree_view_convert_tree_to_bin_window_coords().
2660 /// Tree coordinates start at 0,0 for row 0 of the tree, and cover the entire
2661 /// scrollable area of the tree.
2662 ///
2663 /// # Deprecated since 4.10
2664 ///
2665 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2666 ///
2667 /// # Returns
2668 ///
2669 ///
2670 /// ## `visible_rect`
2671 /// rectangle to fill
2672 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2673 #[allow(deprecated)]
2674 #[doc(alias = "gtk_tree_view_get_visible_rect")]
2675 #[doc(alias = "get_visible_rect")]
2676 fn visible_rect(&self) -> gdk::Rectangle {
2677 unsafe {
2678 let mut visible_rect = gdk::Rectangle::uninitialized();
2679 ffi::gtk_tree_view_get_visible_rect(
2680 self.as_ref().to_glib_none().0,
2681 visible_rect.to_glib_none_mut().0,
2682 );
2683 visible_rect
2684 }
2685 }
2686
2687 /// This inserts the @column into the @self at @position. If @position is
2688 /// -1, then the column is inserted at the end. If @self has
2689 /// “fixed_height” mode enabled, then @column must have its “sizing” property
2690 /// set to be GTK_TREE_VIEW_COLUMN_FIXED.
2691 ///
2692 /// # Deprecated since 4.10
2693 ///
2694 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2695 /// ## `column`
2696 /// The [`TreeViewColumn`][crate::TreeViewColumn] to be inserted.
2697 /// ## `position`
2698 /// The position to insert @column in.
2699 ///
2700 /// # Returns
2701 ///
2702 /// The number of columns in @self after insertion.
2703 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2704 #[allow(deprecated)]
2705 #[doc(alias = "gtk_tree_view_insert_column")]
2706 fn insert_column(&self, column: &TreeViewColumn, position: i32) -> i32 {
2707 unsafe {
2708 ffi::gtk_tree_view_insert_column(
2709 self.as_ref().to_glib_none().0,
2710 column.to_glib_none().0,
2711 position,
2712 )
2713 }
2714 }
2715
2716 /// Convenience function that inserts a new column into the [`TreeView`][crate::TreeView]
2717 /// with the given cell renderer and a `GtkTreeCellDataFunc` to set cell renderer
2718 /// attributes (normally using data from the model). See also
2719 /// gtk_tree_view_column_set_cell_data_func(), gtk_tree_view_column_pack_start().
2720 /// If @self has “fixed_height” mode enabled, then the new column will have its
2721 /// “sizing” property set to be GTK_TREE_VIEW_COLUMN_FIXED.
2722 ///
2723 /// # Deprecated since 4.10
2724 ///
2725 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2726 /// ## `position`
2727 /// Position to insert, -1 for append
2728 /// ## `title`
2729 /// column title
2730 /// ## `cell`
2731 /// cell renderer for column
2732 /// ## `func`
2733 /// function to set attributes of cell renderer
2734 ///
2735 /// # Returns
2736 ///
2737 /// number of columns in the tree view post-insert
2738 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2739 #[allow(deprecated)]
2740 #[doc(alias = "gtk_tree_view_insert_column_with_data_func")]
2741 fn insert_column_with_data_func<
2742 P: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static,
2743 >(
2744 &self,
2745 position: i32,
2746 title: &str,
2747 cell: &impl IsA<CellRenderer>,
2748 func: P,
2749 ) -> i32 {
2750 let func_data: Box_<P> = Box_::new(func);
2751 unsafe extern "C" fn func_func<
2752 P: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static,
2753 >(
2754 tree_column: *mut ffi::GtkTreeViewColumn,
2755 cell: *mut ffi::GtkCellRenderer,
2756 tree_model: *mut ffi::GtkTreeModel,
2757 iter: *mut ffi::GtkTreeIter,
2758 data: glib::ffi::gpointer,
2759 ) {
2760 let tree_column = from_glib_borrow(tree_column);
2761 let cell = from_glib_borrow(cell);
2762 let tree_model = from_glib_borrow(tree_model);
2763 let iter = from_glib_borrow(iter);
2764 let callback = &*(data as *mut P);
2765 (*callback)(&tree_column, &cell, &tree_model, &iter)
2766 }
2767 let func = Some(func_func::<P> as _);
2768 unsafe extern "C" fn dnotify_func<
2769 P: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static,
2770 >(
2771 data: glib::ffi::gpointer,
2772 ) {
2773 let _callback = Box_::from_raw(data as *mut P);
2774 }
2775 let destroy_call6 = Some(dnotify_func::<P> as _);
2776 let super_callback0: Box_<P> = func_data;
2777 unsafe {
2778 ffi::gtk_tree_view_insert_column_with_data_func(
2779 self.as_ref().to_glib_none().0,
2780 position,
2781 title.to_glib_none().0,
2782 cell.as_ref().to_glib_none().0,
2783 func,
2784 Box_::into_raw(super_callback0) as *mut _,
2785 destroy_call6,
2786 )
2787 }
2788 }
2789
2790 /// Determine whether the point (@x, @y) in @self is blank, that is no
2791 /// cell content nor an expander arrow is drawn at the location. If so, the
2792 /// location can be considered as the background. You might wish to take
2793 /// special action on clicks on the background, such as clearing a current
2794 /// selection, having a custom context menu or starting rubber banding.
2795 ///
2796 /// The @x and @y coordinate that are provided must be relative to bin_window
2797 /// coordinates. Widget-relative coordinates must be converted using
2798 /// gtk_tree_view_convert_widget_to_bin_window_coords().
2799 ///
2800 /// For converting widget coordinates (eg. the ones you get from
2801 /// GtkWidget::query-tooltip), please see
2802 /// gtk_tree_view_convert_widget_to_bin_window_coords().
2803 ///
2804 /// The @path, @column, @cell_x and @cell_y arguments will be filled in
2805 /// likewise as for gtk_tree_view_get_path_at_pos(). Please see
2806 /// gtk_tree_view_get_path_at_pos() for more information.
2807 ///
2808 /// # Deprecated since 4.10
2809 ///
2810 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2811 /// ## `x`
2812 /// The x position to be identified (relative to bin_window)
2813 /// ## `y`
2814 /// The y position to be identified (relative to bin_window)
2815 ///
2816 /// # Returns
2817 ///
2818 /// [`true`] if the area at the given coordinates is blank,
2819 /// [`false`] otherwise.
2820 ///
2821 /// ## `path`
2822 /// A pointer to a [`TreePath`][crate::TreePath] pointer to
2823 /// be filled in
2824 ///
2825 /// ## `column`
2826 /// A pointer to a
2827 /// [`TreeViewColumn`][crate::TreeViewColumn] pointer to be filled in
2828 ///
2829 /// ## `cell_x`
2830 /// A pointer where the X coordinate relative to the
2831 /// cell can be placed
2832 ///
2833 /// ## `cell_y`
2834 /// A pointer where the Y coordinate relative to the
2835 /// cell can be placed
2836 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2837 #[allow(deprecated)]
2838 #[doc(alias = "gtk_tree_view_is_blank_at_pos")]
2839 fn is_blank_at_pos(
2840 &self,
2841 x: i32,
2842 y: i32,
2843 ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)> {
2844 unsafe {
2845 let mut path = std::ptr::null_mut();
2846 let mut column = std::ptr::null_mut();
2847 let mut cell_x = std::mem::MaybeUninit::uninit();
2848 let mut cell_y = std::mem::MaybeUninit::uninit();
2849 let ret = from_glib(ffi::gtk_tree_view_is_blank_at_pos(
2850 self.as_ref().to_glib_none().0,
2851 x,
2852 y,
2853 &mut path,
2854 &mut column,
2855 cell_x.as_mut_ptr(),
2856 cell_y.as_mut_ptr(),
2857 ));
2858 if ret {
2859 Some((
2860 from_glib_full(path),
2861 from_glib_none(column),
2862 cell_x.assume_init(),
2863 cell_y.assume_init(),
2864 ))
2865 } else {
2866 None
2867 }
2868 }
2869 }
2870
2871 /// Returns whether a rubber banding operation is currently being done
2872 /// in @self.
2873 ///
2874 /// # Deprecated since 4.10
2875 ///
2876 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2877 ///
2878 /// # Returns
2879 ///
2880 /// [`true`] if a rubber banding operation is currently being
2881 /// done in @self.
2882 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2883 #[allow(deprecated)]
2884 #[doc(alias = "gtk_tree_view_is_rubber_banding_active")]
2885 fn is_rubber_banding_active(&self) -> bool {
2886 unsafe {
2887 from_glib(ffi::gtk_tree_view_is_rubber_banding_active(
2888 self.as_ref().to_glib_none().0,
2889 ))
2890 }
2891 }
2892
2893 /// Calls @func on all expanded rows.
2894 ///
2895 /// # Deprecated since 4.10
2896 ///
2897 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2898 /// ## `func`
2899 /// A function to be called
2900 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2901 #[allow(deprecated)]
2902 #[doc(alias = "gtk_tree_view_map_expanded_rows")]
2903 fn map_expanded_rows<P: FnMut(&TreeView, &TreePath)>(&self, func: P) {
2904 let mut func_data: P = func;
2905 unsafe extern "C" fn func_func<P: FnMut(&TreeView, &TreePath)>(
2906 tree_view: *mut ffi::GtkTreeView,
2907 path: *mut ffi::GtkTreePath,
2908 user_data: glib::ffi::gpointer,
2909 ) {
2910 let tree_view = from_glib_borrow(tree_view);
2911 let path = from_glib_borrow(path);
2912 let callback = user_data as *mut P;
2913 (*callback)(&tree_view, &path)
2914 }
2915 let func = Some(func_func::<P> as _);
2916 let super_callback0: &mut P = &mut func_data;
2917 unsafe {
2918 ffi::gtk_tree_view_map_expanded_rows(
2919 self.as_ref().to_glib_none().0,
2920 func,
2921 super_callback0 as *mut _ as *mut _,
2922 );
2923 }
2924 }
2925
2926 /// Moves @column to be after to @base_column. If @base_column is [`None`], then
2927 /// @column is placed in the first position.
2928 ///
2929 /// # Deprecated since 4.10
2930 ///
2931 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2932 /// ## `column`
2933 /// The [`TreeViewColumn`][crate::TreeViewColumn] to be moved.
2934 /// ## `base_column`
2935 /// The [`TreeViewColumn`][crate::TreeViewColumn] to be moved relative to
2936 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2937 #[allow(deprecated)]
2938 #[doc(alias = "gtk_tree_view_move_column_after")]
2939 fn move_column_after(&self, column: &TreeViewColumn, base_column: Option<&TreeViewColumn>) {
2940 unsafe {
2941 ffi::gtk_tree_view_move_column_after(
2942 self.as_ref().to_glib_none().0,
2943 column.to_glib_none().0,
2944 base_column.to_glib_none().0,
2945 );
2946 }
2947 }
2948
2949 /// Removes @column from @self.
2950 ///
2951 /// # Deprecated since 4.10
2952 ///
2953 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2954 /// ## `column`
2955 /// The [`TreeViewColumn`][crate::TreeViewColumn] to remove.
2956 ///
2957 /// # Returns
2958 ///
2959 /// The number of columns in @self after removing.
2960 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2961 #[allow(deprecated)]
2962 #[doc(alias = "gtk_tree_view_remove_column")]
2963 fn remove_column(&self, column: &TreeViewColumn) -> i32 {
2964 unsafe {
2965 ffi::gtk_tree_view_remove_column(
2966 self.as_ref().to_glib_none().0,
2967 column.to_glib_none().0,
2968 )
2969 }
2970 }
2971
2972 /// Activates the cell determined by @path and @column.
2973 ///
2974 /// # Deprecated since 4.10
2975 ///
2976 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2977 /// ## `path`
2978 /// The [`TreePath`][crate::TreePath] to be activated.
2979 /// ## `column`
2980 /// The [`TreeViewColumn`][crate::TreeViewColumn] to be activated.
2981 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
2982 #[allow(deprecated)]
2983 #[doc(alias = "gtk_tree_view_row_activated")]
2984 fn row_activated(&self, path: &TreePath, column: Option<&TreeViewColumn>) {
2985 unsafe {
2986 ffi::gtk_tree_view_row_activated(
2987 self.as_ref().to_glib_none().0,
2988 mut_override(path.to_glib_none().0),
2989 column.to_glib_none().0,
2990 );
2991 }
2992 }
2993
2994 /// Returns [`true`] if the node pointed to by @path is expanded in @self.
2995 ///
2996 /// # Deprecated since 4.10
2997 ///
2998 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
2999 /// ## `path`
3000 /// A [`TreePath`][crate::TreePath] to test expansion state.
3001 ///
3002 /// # Returns
3003 ///
3004 /// [`true`] if #path is expanded.
3005 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3006 #[allow(deprecated)]
3007 #[doc(alias = "gtk_tree_view_row_expanded")]
3008 fn row_expanded(&self, path: &TreePath) -> bool {
3009 unsafe {
3010 from_glib(ffi::gtk_tree_view_row_expanded(
3011 self.as_ref().to_glib_none().0,
3012 mut_override(path.to_glib_none().0),
3013 ))
3014 }
3015 }
3016
3017 /// Moves the alignments of @self to the position specified by @column and
3018 /// @path. If @column is [`None`], then no horizontal scrolling occurs. Likewise,
3019 /// if @path is [`None`] no vertical scrolling occurs. At a minimum, one of @column
3020 /// or @path need to be non-[`None`]. @row_align determines where the row is
3021 /// placed, and @col_align determines where @column is placed. Both are expected
3022 /// to be between 0.0 and 1.0. 0.0 means left/top alignment, 1.0 means
3023 /// right/bottom alignment, 0.5 means center.
3024 ///
3025 /// If @use_align is [`false`], then the alignment arguments are ignored, and the
3026 /// tree does the minimum amount of work to scroll the cell onto the screen.
3027 /// This means that the cell will be scrolled to the edge closest to its current
3028 /// position. If the cell is currently visible on the screen, nothing is done.
3029 ///
3030 /// This function only works if the model is set, and @path is a valid row on the
3031 /// model. If the model changes before the @self is realized, the centered
3032 /// path will be modified to reflect this change.
3033 ///
3034 /// # Deprecated since 4.10
3035 ///
3036 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3037 /// ## `path`
3038 /// The path of the row to move to
3039 /// ## `column`
3040 /// The [`TreeViewColumn`][crate::TreeViewColumn] to move horizontally to
3041 /// ## `use_align`
3042 /// whether to use alignment arguments, or [`false`].
3043 /// ## `row_align`
3044 /// The vertical alignment of the row specified by @path.
3045 /// ## `col_align`
3046 /// The horizontal alignment of the column specified by @column.
3047 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3048 #[allow(deprecated)]
3049 #[doc(alias = "gtk_tree_view_scroll_to_cell")]
3050 fn scroll_to_cell(
3051 &self,
3052 path: Option<&TreePath>,
3053 column: Option<&TreeViewColumn>,
3054 use_align: bool,
3055 row_align: f32,
3056 col_align: f32,
3057 ) {
3058 unsafe {
3059 ffi::gtk_tree_view_scroll_to_cell(
3060 self.as_ref().to_glib_none().0,
3061 mut_override(path.to_glib_none().0),
3062 column.to_glib_none().0,
3063 use_align.into_glib(),
3064 row_align,
3065 col_align,
3066 );
3067 }
3068 }
3069
3070 /// Scrolls the tree view such that the top-left corner of the visible
3071 /// area is @tree_x, @tree_y, where @tree_x and @tree_y are specified
3072 /// in tree coordinates. The @self must be realized before
3073 /// this function is called. If it isn't, you probably want to be
3074 /// using gtk_tree_view_scroll_to_cell().
3075 ///
3076 /// If either @tree_x or @tree_y are -1, then that direction isn’t scrolled.
3077 ///
3078 /// # Deprecated since 4.10
3079 ///
3080 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3081 /// ## `tree_x`
3082 /// X coordinate of new top-left pixel of visible area, or -1
3083 /// ## `tree_y`
3084 /// Y coordinate of new top-left pixel of visible area, or -1
3085 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3086 #[allow(deprecated)]
3087 #[doc(alias = "gtk_tree_view_scroll_to_point")]
3088 fn scroll_to_point(&self, tree_x: i32, tree_y: i32) {
3089 unsafe {
3090 ffi::gtk_tree_view_scroll_to_point(self.as_ref().to_glib_none().0, tree_x, tree_y);
3091 }
3092 }
3093
3094 /// Cause the [`TreeView`][crate::TreeView]::row-activated signal to be emitted
3095 /// on a single click instead of a double click.
3096 ///
3097 /// # Deprecated since 4.10
3098 ///
3099 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3100 /// ## `single`
3101 /// [`true`] to emit row-activated on a single click
3102 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3103 #[allow(deprecated)]
3104 #[doc(alias = "gtk_tree_view_set_activate_on_single_click")]
3105 #[doc(alias = "activate-on-single-click")]
3106 fn set_activate_on_single_click(&self, single: bool) {
3107 unsafe {
3108 ffi::gtk_tree_view_set_activate_on_single_click(
3109 self.as_ref().to_glib_none().0,
3110 single.into_glib(),
3111 );
3112 }
3113 }
3114
3115 /// Sets a user function for determining where a column may be dropped when
3116 /// dragged. This function is called on every column pair in turn at the
3117 /// beginning of a column drag to determine where a drop can take place. The
3118 /// arguments passed to @func are: the @self, the [`TreeViewColumn`][crate::TreeViewColumn] being
3119 /// dragged, the two [`TreeViewColumn`][crate::TreeViewColumn]s determining the drop spot, and
3120 /// @user_data. If either of the [`TreeViewColumn`][crate::TreeViewColumn] arguments for the drop spot
3121 /// are [`None`], then they indicate an edge. If @func is set to be [`None`], then
3122 /// @self reverts to the default behavior of allowing all columns to be
3123 /// dropped everywhere.
3124 ///
3125 /// # Deprecated since 4.10
3126 ///
3127 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3128 /// ## `func`
3129 /// A function to determine which columns are reorderable
3130 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3131 #[allow(deprecated)]
3132 #[doc(alias = "gtk_tree_view_set_column_drag_function")]
3133 fn set_column_drag_function(
3134 &self,
3135 func: Option<
3136 Box_<
3137 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool
3138 + 'static,
3139 >,
3140 >,
3141 ) {
3142 let func_data: Box_<
3143 Option<
3144 Box_<
3145 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool
3146 + 'static,
3147 >,
3148 >,
3149 > = Box_::new(func);
3150 unsafe extern "C" fn func_func(
3151 tree_view: *mut ffi::GtkTreeView,
3152 column: *mut ffi::GtkTreeViewColumn,
3153 prev_column: *mut ffi::GtkTreeViewColumn,
3154 next_column: *mut ffi::GtkTreeViewColumn,
3155 data: glib::ffi::gpointer,
3156 ) -> glib::ffi::gboolean {
3157 let tree_view = from_glib_borrow(tree_view);
3158 let column = from_glib_borrow(column);
3159 let prev_column = from_glib_borrow(prev_column);
3160 let next_column = from_glib_borrow(next_column);
3161 let callback = &*(data as *mut Option<
3162 Box_<
3163 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool
3164 + 'static,
3165 >,
3166 >);
3167 if let Some(ref callback) = *callback {
3168 callback(&tree_view, &column, &prev_column, &next_column)
3169 } else {
3170 panic!("cannot get closure...")
3171 }
3172 .into_glib()
3173 }
3174 let func = if func_data.is_some() {
3175 Some(func_func as _)
3176 } else {
3177 None
3178 };
3179 unsafe extern "C" fn destroy_func(data: glib::ffi::gpointer) {
3180 let _callback = Box_::from_raw(
3181 data as *mut Option<
3182 Box_<
3183 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool
3184 + 'static,
3185 >,
3186 >,
3187 );
3188 }
3189 let destroy_call3 = Some(destroy_func as _);
3190 let super_callback0: Box_<
3191 Option<
3192 Box_<
3193 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool
3194 + 'static,
3195 >,
3196 >,
3197 > = func_data;
3198 unsafe {
3199 ffi::gtk_tree_view_set_column_drag_function(
3200 self.as_ref().to_glib_none().0,
3201 func,
3202 Box_::into_raw(super_callback0) as *mut _,
3203 destroy_call3,
3204 );
3205 }
3206 }
3207
3208 /// Sets the current keyboard focus to be at @path, and selects it. This is
3209 /// useful when you want to focus the user’s attention on a particular row. If
3210 /// @focus_column is not [`None`], then focus is given to the column specified by
3211 /// it. Additionally, if @focus_column is specified, and @start_editing is
3212 /// [`true`], then editing should be started in the specified cell.
3213 /// This function is often followed by @gtk_widget_grab_focus (@self)
3214 /// in order to give keyboard focus to the widget. Please note that editing
3215 /// can only happen when the widget is realized.
3216 ///
3217 /// If @path is invalid for @model, the current cursor (if any) will be unset
3218 /// and the function will return without failing.
3219 ///
3220 /// # Deprecated since 4.10
3221 ///
3222 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3223 /// ## `path`
3224 /// A [`TreePath`][crate::TreePath]
3225 /// ## `focus_column`
3226 /// A [`TreeViewColumn`][crate::TreeViewColumn]
3227 /// ## `start_editing`
3228 /// [`true`] if the specified cell should start being edited.
3229 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3230 #[allow(deprecated)]
3231 #[doc(alias = "gtk_tree_view_set_cursor")]
3232 fn set_cursor(
3233 &self,
3234 path: &TreePath,
3235 focus_column: Option<&TreeViewColumn>,
3236 start_editing: bool,
3237 ) {
3238 unsafe {
3239 ffi::gtk_tree_view_set_cursor(
3240 self.as_ref().to_glib_none().0,
3241 mut_override(path.to_glib_none().0),
3242 focus_column.to_glib_none().0,
3243 start_editing.into_glib(),
3244 );
3245 }
3246 }
3247
3248 /// Sets the current keyboard focus to be at @path, and selects it. This is
3249 /// useful when you want to focus the user’s attention on a particular row. If
3250 /// @focus_column is not [`None`], then focus is given to the column specified by
3251 /// it. If @focus_column and @focus_cell are not [`None`], and @focus_column
3252 /// contains 2 or more editable or activatable cells, then focus is given to
3253 /// the cell specified by @focus_cell. Additionally, if @focus_column is
3254 /// specified, and @start_editing is [`true`], then editing should be started in
3255 /// the specified cell. This function is often followed by
3256 /// @gtk_widget_grab_focus (@self) in order to give keyboard focus to the
3257 /// widget. Please note that editing can only happen when the widget is
3258 /// realized.
3259 ///
3260 /// If @path is invalid for @model, the current cursor (if any) will be unset
3261 /// and the function will return without failing.
3262 ///
3263 /// # Deprecated since 4.10
3264 ///
3265 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3266 /// ## `path`
3267 /// A [`TreePath`][crate::TreePath]
3268 /// ## `focus_column`
3269 /// A [`TreeViewColumn`][crate::TreeViewColumn]
3270 /// ## `focus_cell`
3271 /// A [`CellRenderer`][crate::CellRenderer]
3272 /// ## `start_editing`
3273 /// [`true`] if the specified cell should start being edited.
3274 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3275 #[allow(deprecated)]
3276 #[doc(alias = "gtk_tree_view_set_cursor_on_cell")]
3277 fn set_cursor_on_cell(
3278 &self,
3279 path: &TreePath,
3280 focus_column: Option<&TreeViewColumn>,
3281 focus_cell: Option<&impl IsA<CellRenderer>>,
3282 start_editing: bool,
3283 ) {
3284 unsafe {
3285 ffi::gtk_tree_view_set_cursor_on_cell(
3286 self.as_ref().to_glib_none().0,
3287 mut_override(path.to_glib_none().0),
3288 focus_column.to_glib_none().0,
3289 focus_cell.map(|p| p.as_ref()).to_glib_none().0,
3290 start_editing.into_glib(),
3291 );
3292 }
3293 }
3294
3295 /// Sets the row that is highlighted for feedback.
3296 /// If @path is [`None`], an existing highlight is removed.
3297 ///
3298 /// # Deprecated since 4.10
3299 ///
3300 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3301 /// ## `path`
3302 /// The path of the row to highlight
3303 /// ## `pos`
3304 /// Specifies whether to drop before, after or into the row
3305 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3306 #[allow(deprecated)]
3307 #[doc(alias = "gtk_tree_view_set_drag_dest_row")]
3308 fn set_drag_dest_row(&self, path: Option<&TreePath>, pos: TreeViewDropPosition) {
3309 unsafe {
3310 ffi::gtk_tree_view_set_drag_dest_row(
3311 self.as_ref().to_glib_none().0,
3312 mut_override(path.to_glib_none().0),
3313 pos.into_glib(),
3314 );
3315 }
3316 }
3317
3318 /// If @enable_search is set, then the user can type in text to search through
3319 /// the tree interactively (this is sometimes called "typeahead find").
3320 ///
3321 /// Note that even if this is [`false`], the user can still initiate a search
3322 /// using the “start-interactive-search” key binding.
3323 ///
3324 /// # Deprecated since 4.10
3325 ///
3326 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3327 /// ## `enable_search`
3328 /// [`true`], if the user can search interactively
3329 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3330 #[allow(deprecated)]
3331 #[doc(alias = "gtk_tree_view_set_enable_search")]
3332 #[doc(alias = "enable-search")]
3333 fn set_enable_search(&self, enable_search: bool) {
3334 unsafe {
3335 ffi::gtk_tree_view_set_enable_search(
3336 self.as_ref().to_glib_none().0,
3337 enable_search.into_glib(),
3338 );
3339 }
3340 }
3341
3342 /// Sets whether to draw lines interconnecting the expanders in @self.
3343 /// This does not have any visible effects for lists.
3344 ///
3345 /// # Deprecated since 4.10
3346 ///
3347 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3348 /// ## `enabled`
3349 /// [`true`] to enable tree line drawing, [`false`] otherwise.
3350 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3351 #[allow(deprecated)]
3352 #[doc(alias = "gtk_tree_view_set_enable_tree_lines")]
3353 #[doc(alias = "enable-tree-lines")]
3354 fn set_enable_tree_lines(&self, enabled: bool) {
3355 unsafe {
3356 ffi::gtk_tree_view_set_enable_tree_lines(
3357 self.as_ref().to_glib_none().0,
3358 enabled.into_glib(),
3359 );
3360 }
3361 }
3362
3363 /// Sets the column to draw the expander arrow at. It must be in @self.
3364 /// If @column is [`None`], then the expander arrow is always at the first
3365 /// visible column.
3366 ///
3367 /// If you do not want expander arrow to appear in your tree, set the
3368 /// expander column to a hidden column.
3369 ///
3370 /// # Deprecated since 4.10
3371 ///
3372 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3373 /// ## `column`
3374 /// [`None`], or the column to draw the expander arrow at.
3375 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3376 #[allow(deprecated)]
3377 #[doc(alias = "gtk_tree_view_set_expander_column")]
3378 #[doc(alias = "expander-column")]
3379 fn set_expander_column(&self, column: Option<&TreeViewColumn>) {
3380 unsafe {
3381 ffi::gtk_tree_view_set_expander_column(
3382 self.as_ref().to_glib_none().0,
3383 column.to_glib_none().0,
3384 );
3385 }
3386 }
3387
3388 /// Enables or disables the fixed height mode of @self.
3389 /// Fixed height mode speeds up [`TreeView`][crate::TreeView] by assuming that all
3390 /// rows have the same height.
3391 /// Only enable this option if all rows are the same height and all
3392 /// columns are of type [`TreeViewColumnSizing::Fixed`][crate::TreeViewColumnSizing::Fixed].
3393 ///
3394 /// # Deprecated since 4.10
3395 ///
3396 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3397 /// ## `enable`
3398 /// [`true`] to enable fixed height mode
3399 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3400 #[allow(deprecated)]
3401 #[doc(alias = "gtk_tree_view_set_fixed_height_mode")]
3402 #[doc(alias = "fixed-height-mode")]
3403 fn set_fixed_height_mode(&self, enable: bool) {
3404 unsafe {
3405 ffi::gtk_tree_view_set_fixed_height_mode(
3406 self.as_ref().to_glib_none().0,
3407 enable.into_glib(),
3408 );
3409 }
3410 }
3411
3412 /// Sets which grid lines to draw in @self.
3413 ///
3414 /// # Deprecated since 4.10
3415 ///
3416 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3417 /// ## `grid_lines`
3418 /// a [`TreeView`][crate::TreeView]GridLines value indicating which grid lines to
3419 /// enable.
3420 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3421 #[allow(deprecated)]
3422 #[doc(alias = "gtk_tree_view_set_grid_lines")]
3423 fn set_grid_lines(&self, grid_lines: TreeViewGridLines) {
3424 unsafe {
3425 ffi::gtk_tree_view_set_grid_lines(
3426 self.as_ref().to_glib_none().0,
3427 grid_lines.into_glib(),
3428 );
3429 }
3430 }
3431
3432 /// Allow the column title buttons to be clicked.
3433 ///
3434 /// # Deprecated since 4.10
3435 ///
3436 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3437 /// ## `setting`
3438 /// [`true`] if the columns are clickable.
3439 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3440 #[allow(deprecated)]
3441 #[doc(alias = "gtk_tree_view_set_headers_clickable")]
3442 #[doc(alias = "headers-clickable")]
3443 fn set_headers_clickable(&self, setting: bool) {
3444 unsafe {
3445 ffi::gtk_tree_view_set_headers_clickable(
3446 self.as_ref().to_glib_none().0,
3447 setting.into_glib(),
3448 );
3449 }
3450 }
3451
3452 /// Sets the visibility state of the headers.
3453 ///
3454 /// # Deprecated since 4.10
3455 ///
3456 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3457 /// ## `headers_visible`
3458 /// [`true`] if the headers are visible
3459 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3460 #[allow(deprecated)]
3461 #[doc(alias = "gtk_tree_view_set_headers_visible")]
3462 #[doc(alias = "headers-visible")]
3463 fn set_headers_visible(&self, headers_visible: bool) {
3464 unsafe {
3465 ffi::gtk_tree_view_set_headers_visible(
3466 self.as_ref().to_glib_none().0,
3467 headers_visible.into_glib(),
3468 );
3469 }
3470 }
3471
3472 /// Enables or disables the hover expansion mode of @self.
3473 /// Hover expansion makes rows expand or collapse if the pointer
3474 /// moves over them.
3475 ///
3476 /// # Deprecated since 4.10
3477 ///
3478 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3479 /// ## `expand`
3480 /// [`true`] to enable hover selection mode
3481 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3482 #[allow(deprecated)]
3483 #[doc(alias = "gtk_tree_view_set_hover_expand")]
3484 #[doc(alias = "hover-expand")]
3485 fn set_hover_expand(&self, expand: bool) {
3486 unsafe {
3487 ffi::gtk_tree_view_set_hover_expand(self.as_ref().to_glib_none().0, expand.into_glib());
3488 }
3489 }
3490
3491 /// Enables or disables the hover selection mode of @self.
3492 /// Hover selection makes the selected row follow the pointer.
3493 /// Currently, this works only for the selection modes
3494 /// [`SelectionMode::Single`][crate::SelectionMode::Single] and [`SelectionMode::Browse`][crate::SelectionMode::Browse].
3495 ///
3496 /// # Deprecated since 4.10
3497 ///
3498 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3499 /// ## `hover`
3500 /// [`true`] to enable hover selection mode
3501 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3502 #[allow(deprecated)]
3503 #[doc(alias = "gtk_tree_view_set_hover_selection")]
3504 #[doc(alias = "hover-selection")]
3505 fn set_hover_selection(&self, hover: bool) {
3506 unsafe {
3507 ffi::gtk_tree_view_set_hover_selection(
3508 self.as_ref().to_glib_none().0,
3509 hover.into_glib(),
3510 );
3511 }
3512 }
3513
3514 /// Sets the amount of extra indentation for child levels to use in @self
3515 /// in addition to the default indentation. The value should be specified in
3516 /// pixels, a value of 0 disables this feature and in this case only the default
3517 /// indentation will be used.
3518 /// This does not have any visible effects for lists.
3519 ///
3520 /// # Deprecated since 4.10
3521 ///
3522 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3523 /// ## `indentation`
3524 /// the amount, in pixels, of extra indentation in @self.
3525 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3526 #[allow(deprecated)]
3527 #[doc(alias = "gtk_tree_view_set_level_indentation")]
3528 #[doc(alias = "level-indentation")]
3529 fn set_level_indentation(&self, indentation: i32) {
3530 unsafe {
3531 ffi::gtk_tree_view_set_level_indentation(self.as_ref().to_glib_none().0, indentation);
3532 }
3533 }
3534
3535 /// Sets the model for a [`TreeView`][crate::TreeView]. If the @self already has a model
3536 /// set, it will remove it before setting the new model. If @model is [`None`],
3537 /// then it will unset the old model.
3538 ///
3539 /// # Deprecated since 4.10
3540 ///
3541 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3542 /// ## `model`
3543 /// The model.
3544 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3545 #[allow(deprecated)]
3546 #[doc(alias = "gtk_tree_view_set_model")]
3547 #[doc(alias = "model")]
3548 fn set_model(&self, model: Option<&impl IsA<TreeModel>>) {
3549 unsafe {
3550 ffi::gtk_tree_view_set_model(
3551 self.as_ref().to_glib_none().0,
3552 model.map(|p| p.as_ref()).to_glib_none().0,
3553 );
3554 }
3555 }
3556
3557 /// This function is a convenience function to allow you to reorder
3558 /// models that support the `GtkTreeDragSourceIface` and the
3559 /// `GtkTreeDragDestIface`. Both [`TreeStore`][crate::TreeStore] and [`ListStore`][crate::ListStore] support
3560 /// these. If @reorderable is [`true`], then the user can reorder the
3561 /// model by dragging and dropping rows. The developer can listen to
3562 /// these changes by connecting to the model’s `GtkTreeModel::row-inserted`
3563 /// and `GtkTreeModel::row-deleted` signals. The reordering is implemented
3564 /// by setting up the tree view as a drag source and destination.
3565 /// Therefore, drag and drop can not be used in a reorderable view for any
3566 /// other purpose.
3567 ///
3568 /// This function does not give you any degree of control over the order -- any
3569 /// reordering is allowed. If more control is needed, you should probably
3570 /// handle drag and drop manually.
3571 ///
3572 /// # Deprecated since 4.10
3573 ///
3574 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3575 /// ## `reorderable`
3576 /// [`true`], if the tree can be reordered.
3577 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3578 #[allow(deprecated)]
3579 #[doc(alias = "gtk_tree_view_set_reorderable")]
3580 #[doc(alias = "reorderable")]
3581 fn set_reorderable(&self, reorderable: bool) {
3582 unsafe {
3583 ffi::gtk_tree_view_set_reorderable(
3584 self.as_ref().to_glib_none().0,
3585 reorderable.into_glib(),
3586 );
3587 }
3588 }
3589
3590 /// Sets the row separator function, which is used to determine
3591 /// whether a row should be drawn as a separator. If the row separator
3592 /// function is [`None`], no separators are drawn. This is the default value.
3593 ///
3594 /// # Deprecated since 4.10
3595 ///
3596 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3597 /// ## `func`
3598 /// a [`TreeView`][crate::TreeView]RowSeparatorFunc
3599 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3600 #[allow(deprecated)]
3601 #[doc(alias = "gtk_tree_view_set_row_separator_func")]
3602 fn set_row_separator_func<P: Fn(&TreeModel, &TreeIter) -> bool + 'static>(&self, func: P) {
3603 let func_data: Box_<P> = Box_::new(func);
3604 unsafe extern "C" fn func_func<P: Fn(&TreeModel, &TreeIter) -> bool + 'static>(
3605 model: *mut ffi::GtkTreeModel,
3606 iter: *mut ffi::GtkTreeIter,
3607 data: glib::ffi::gpointer,
3608 ) -> glib::ffi::gboolean {
3609 let model = from_glib_borrow(model);
3610 let iter = from_glib_borrow(iter);
3611 let callback = &*(data as *mut P);
3612 (*callback)(&model, &iter).into_glib()
3613 }
3614 let func = Some(func_func::<P> as _);
3615 unsafe extern "C" fn destroy_func<P: Fn(&TreeModel, &TreeIter) -> bool + 'static>(
3616 data: glib::ffi::gpointer,
3617 ) {
3618 let _callback = Box_::from_raw(data as *mut P);
3619 }
3620 let destroy_call3 = Some(destroy_func::<P> as _);
3621 let super_callback0: Box_<P> = func_data;
3622 unsafe {
3623 ffi::gtk_tree_view_set_row_separator_func(
3624 self.as_ref().to_glib_none().0,
3625 func,
3626 Box_::into_raw(super_callback0) as *mut _,
3627 destroy_call3,
3628 );
3629 }
3630 }
3631
3632 /// Enables or disables rubber banding in @self. If the selection mode
3633 /// is [`SelectionMode::Multiple`][crate::SelectionMode::Multiple], rubber banding will allow the user to select
3634 /// multiple rows by dragging the mouse.
3635 ///
3636 /// # Deprecated since 4.10
3637 ///
3638 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3639 /// ## `enable`
3640 /// [`true`] to enable rubber banding
3641 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3642 #[allow(deprecated)]
3643 #[doc(alias = "gtk_tree_view_set_rubber_banding")]
3644 #[doc(alias = "rubber-banding")]
3645 fn set_rubber_banding(&self, enable: bool) {
3646 unsafe {
3647 ffi::gtk_tree_view_set_rubber_banding(
3648 self.as_ref().to_glib_none().0,
3649 enable.into_glib(),
3650 );
3651 }
3652 }
3653
3654 /// Sets @column as the column where the interactive search code should
3655 /// search in for the current model.
3656 ///
3657 /// If the search column is set, users can use the “start-interactive-search”
3658 /// key binding to bring up search popup. The enable-search property controls
3659 /// whether simply typing text will also start an interactive search.
3660 ///
3661 /// Note that @column refers to a column of the current model. The search
3662 /// column is reset to -1 when the model is changed.
3663 ///
3664 /// # Deprecated since 4.10
3665 ///
3666 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3667 /// ## `column`
3668 /// the column of the model to search in, or -1 to disable searching
3669 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3670 #[allow(deprecated)]
3671 #[doc(alias = "gtk_tree_view_set_search_column")]
3672 #[doc(alias = "search-column")]
3673 fn set_search_column(&self, column: i32) {
3674 unsafe {
3675 ffi::gtk_tree_view_set_search_column(self.as_ref().to_glib_none().0, column);
3676 }
3677 }
3678
3679 /// Sets the entry which the interactive search code will use for this
3680 /// @self. This is useful when you want to provide a search entry
3681 /// in our interface at all time at a fixed position. Passing [`None`] for
3682 /// @entry will make the interactive search code use the built-in popup
3683 /// entry again.
3684 ///
3685 /// # Deprecated since 4.10
3686 ///
3687 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3688 /// ## `entry`
3689 /// the entry the interactive search code of @self should use
3690 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3691 #[allow(deprecated)]
3692 #[doc(alias = "gtk_tree_view_set_search_entry")]
3693 fn set_search_entry(&self, entry: Option<&impl IsA<Editable>>) {
3694 unsafe {
3695 ffi::gtk_tree_view_set_search_entry(
3696 self.as_ref().to_glib_none().0,
3697 entry.map(|p| p.as_ref()).to_glib_none().0,
3698 );
3699 }
3700 }
3701
3702 /// Sets the compare function for the interactive search capabilities; note
3703 /// that somewhat like strcmp() returning 0 for equality
3704 /// [`TreeView`][crate::TreeView]SearchEqualFunc returns [`false`] on matches.
3705 ///
3706 /// # Deprecated since 4.10
3707 ///
3708 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3709 /// ## `search_equal_func`
3710 /// the compare function to use during the search
3711 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3712 #[allow(deprecated)]
3713 #[doc(alias = "gtk_tree_view_set_search_equal_func")]
3714 fn set_search_equal_func<P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static>(
3715 &self,
3716 search_equal_func: P,
3717 ) {
3718 let search_equal_func_data: Box_<P> = Box_::new(search_equal_func);
3719 unsafe extern "C" fn search_equal_func_func<
3720 P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static,
3721 >(
3722 model: *mut ffi::GtkTreeModel,
3723 column: std::ffi::c_int,
3724 key: *const std::ffi::c_char,
3725 iter: *mut ffi::GtkTreeIter,
3726 search_data: glib::ffi::gpointer,
3727 ) -> glib::ffi::gboolean {
3728 let model = from_glib_borrow(model);
3729 let key: Borrowed<glib::GString> = from_glib_borrow(key);
3730 let iter = from_glib_borrow(iter);
3731 let callback = &*(search_data as *mut P);
3732 (*callback)(&model, column, key.as_str(), &iter).into_glib()
3733 }
3734 let search_equal_func = Some(search_equal_func_func::<P> as _);
3735 unsafe extern "C" fn search_destroy_func<
3736 P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static,
3737 >(
3738 data: glib::ffi::gpointer,
3739 ) {
3740 let _callback = Box_::from_raw(data as *mut P);
3741 }
3742 let destroy_call3 = Some(search_destroy_func::<P> as _);
3743 let super_callback0: Box_<P> = search_equal_func_data;
3744 unsafe {
3745 ffi::gtk_tree_view_set_search_equal_func(
3746 self.as_ref().to_glib_none().0,
3747 search_equal_func,
3748 Box_::into_raw(super_callback0) as *mut _,
3749 destroy_call3,
3750 );
3751 }
3752 }
3753
3754 /// Sets whether to draw and enable expanders and indent child rows in
3755 /// @self. When disabled there will be no expanders visible in trees
3756 /// and there will be no way to expand and collapse rows by default. Also
3757 /// note that hiding the expanders will disable the default indentation. You
3758 /// can set a custom indentation in this case using
3759 /// gtk_tree_view_set_level_indentation().
3760 /// This does not have any visible effects for lists.
3761 ///
3762 /// # Deprecated since 4.10
3763 ///
3764 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3765 /// ## `enabled`
3766 /// [`true`] to enable expander drawing, [`false`] otherwise.
3767 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3768 #[allow(deprecated)]
3769 #[doc(alias = "gtk_tree_view_set_show_expanders")]
3770 #[doc(alias = "show-expanders")]
3771 fn set_show_expanders(&self, enabled: bool) {
3772 unsafe {
3773 ffi::gtk_tree_view_set_show_expanders(
3774 self.as_ref().to_glib_none().0,
3775 enabled.into_glib(),
3776 );
3777 }
3778 }
3779
3780 /// Sets the tip area of @tooltip to the area @path, @column and @cell have
3781 /// in common. For example if @path is [`None`] and @column is set, the tip
3782 /// area will be set to the full area covered by @column. See also
3783 /// gtk_tooltip_set_tip_area().
3784 ///
3785 /// Note that if @path is not specified and @cell is set and part of a column
3786 /// containing the expander, the tooltip might not show and hide at the correct
3787 /// position. In such cases @path must be set to the current node under the
3788 /// mouse cursor for this function to operate correctly.
3789 ///
3790 /// See also gtk_tree_view_set_tooltip_column() for a simpler alternative.
3791 ///
3792 /// # Deprecated since 4.10
3793 ///
3794 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3795 /// ## `tooltip`
3796 /// a [`Tooltip`][crate::Tooltip]
3797 /// ## `path`
3798 /// a [`TreePath`][crate::TreePath]
3799 /// ## `column`
3800 /// a [`TreeViewColumn`][crate::TreeViewColumn]
3801 /// ## `cell`
3802 /// a [`CellRenderer`][crate::CellRenderer]
3803 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3804 #[allow(deprecated)]
3805 #[doc(alias = "gtk_tree_view_set_tooltip_cell")]
3806 fn set_tooltip_cell(
3807 &self,
3808 tooltip: &Tooltip,
3809 path: Option<&TreePath>,
3810 column: Option<&TreeViewColumn>,
3811 cell: Option<&impl IsA<CellRenderer>>,
3812 ) {
3813 unsafe {
3814 ffi::gtk_tree_view_set_tooltip_cell(
3815 self.as_ref().to_glib_none().0,
3816 tooltip.to_glib_none().0,
3817 mut_override(path.to_glib_none().0),
3818 column.to_glib_none().0,
3819 cell.map(|p| p.as_ref()).to_glib_none().0,
3820 );
3821 }
3822 }
3823
3824 /// If you only plan to have simple (text-only) tooltips on full rows, you
3825 /// can use this function to have [`TreeView`][crate::TreeView] handle these automatically
3826 /// for you. @column should be set to the column in @self’s model
3827 /// containing the tooltip texts, or -1 to disable this feature.
3828 ///
3829 /// When enabled, `GtkWidget:has-tooltip` will be set to [`true`] and
3830 /// @self will connect a `GtkWidget::query-tooltip` signal handler.
3831 ///
3832 /// Note that the signal handler sets the text with gtk_tooltip_set_markup(),
3833 /// so &, <, etc have to be escaped in the text.
3834 ///
3835 /// # Deprecated since 4.10
3836 ///
3837 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3838 /// ## `column`
3839 /// an integer, which is a valid column number for @self’s model
3840 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3841 #[allow(deprecated)]
3842 #[doc(alias = "gtk_tree_view_set_tooltip_column")]
3843 #[doc(alias = "tooltip-column")]
3844 fn set_tooltip_column(&self, column: i32) {
3845 unsafe {
3846 ffi::gtk_tree_view_set_tooltip_column(self.as_ref().to_glib_none().0, column);
3847 }
3848 }
3849
3850 /// Sets the tip area of @tooltip to be the area covered by the row at @path.
3851 /// See also gtk_tree_view_set_tooltip_column() for a simpler alternative.
3852 /// See also gtk_tooltip_set_tip_area().
3853 ///
3854 /// # Deprecated since 4.10
3855 ///
3856 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3857 /// ## `tooltip`
3858 /// a [`Tooltip`][crate::Tooltip]
3859 /// ## `path`
3860 /// a [`TreePath`][crate::TreePath]
3861 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3862 #[allow(deprecated)]
3863 #[doc(alias = "gtk_tree_view_set_tooltip_row")]
3864 fn set_tooltip_row(&self, tooltip: &Tooltip, path: &TreePath) {
3865 unsafe {
3866 ffi::gtk_tree_view_set_tooltip_row(
3867 self.as_ref().to_glib_none().0,
3868 tooltip.to_glib_none().0,
3869 mut_override(path.to_glib_none().0),
3870 );
3871 }
3872 }
3873
3874 /// Undoes the effect of
3875 /// gtk_tree_view_enable_model_drag_dest(). Calling this method sets
3876 /// [`TreeView`][crate::TreeView]:reorderable to [`false`].
3877 ///
3878 /// # Deprecated since 4.10
3879 ///
3880 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3881 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3882 #[allow(deprecated)]
3883 #[doc(alias = "gtk_tree_view_unset_rows_drag_dest")]
3884 fn unset_rows_drag_dest(&self) {
3885 unsafe {
3886 ffi::gtk_tree_view_unset_rows_drag_dest(self.as_ref().to_glib_none().0);
3887 }
3888 }
3889
3890 /// Undoes the effect of
3891 /// gtk_tree_view_enable_model_drag_source(). Calling this method sets
3892 /// [`TreeView`][crate::TreeView]:reorderable to [`false`].
3893 ///
3894 /// # Deprecated since 4.10
3895 ///
3896 /// Use [`ListView`][crate::ListView] or [`ColumnView`][crate::ColumnView] instead
3897 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
3898 #[allow(deprecated)]
3899 #[doc(alias = "gtk_tree_view_unset_rows_drag_source")]
3900 fn unset_rows_drag_source(&self) {
3901 unsafe {
3902 ffi::gtk_tree_view_unset_rows_drag_source(self.as_ref().to_glib_none().0);
3903 }
3904 }
3905
3906 #[doc(alias = "enable-grid-lines")]
3907 fn enable_grid_lines(&self) -> TreeViewGridLines {
3908 ObjectExt::property(self.as_ref(), "enable-grid-lines")
3909 }
3910
3911 #[doc(alias = "enable-grid-lines")]
3912 fn set_enable_grid_lines(&self, enable_grid_lines: TreeViewGridLines) {
3913 ObjectExt::set_property(self.as_ref(), "enable-grid-lines", enable_grid_lines)
3914 }
3915
3916 /// The number of columns of the treeview has changed.
3917 #[doc(alias = "columns-changed")]
3918 fn connect_columns_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3919 unsafe extern "C" fn columns_changed_trampoline<P: IsA<TreeView>, F: Fn(&P) + 'static>(
3920 this: *mut ffi::GtkTreeView,
3921 f: glib::ffi::gpointer,
3922 ) {
3923 let f: &F = &*(f as *const F);
3924 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
3925 }
3926 unsafe {
3927 let f: Box_<F> = Box_::new(f);
3928 connect_raw(
3929 self.as_ptr() as *mut _,
3930 c"columns-changed".as_ptr() as *const _,
3931 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3932 columns_changed_trampoline::<Self, F> as *const (),
3933 )),
3934 Box_::into_raw(f),
3935 )
3936 }
3937 }
3938
3939 /// The position of the cursor (focused cell) has changed.
3940 #[doc(alias = "cursor-changed")]
3941 fn connect_cursor_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
3942 unsafe extern "C" fn cursor_changed_trampoline<P: IsA<TreeView>, F: Fn(&P) + 'static>(
3943 this: *mut ffi::GtkTreeView,
3944 f: glib::ffi::gpointer,
3945 ) {
3946 let f: &F = &*(f as *const F);
3947 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
3948 }
3949 unsafe {
3950 let f: Box_<F> = Box_::new(f);
3951 connect_raw(
3952 self.as_ptr() as *mut _,
3953 c"cursor-changed".as_ptr() as *const _,
3954 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3955 cursor_changed_trampoline::<Self, F> as *const (),
3956 )),
3957 Box_::into_raw(f),
3958 )
3959 }
3960 }
3961
3962 #[doc(alias = "expand-collapse-cursor-row")]
3963 fn connect_expand_collapse_cursor_row<F: Fn(&Self, bool, bool, bool) -> bool + 'static>(
3964 &self,
3965 f: F,
3966 ) -> SignalHandlerId {
3967 unsafe extern "C" fn expand_collapse_cursor_row_trampoline<
3968 P: IsA<TreeView>,
3969 F: Fn(&P, bool, bool, bool) -> bool + 'static,
3970 >(
3971 this: *mut ffi::GtkTreeView,
3972 object: glib::ffi::gboolean,
3973 p0: glib::ffi::gboolean,
3974 p1: glib::ffi::gboolean,
3975 f: glib::ffi::gpointer,
3976 ) -> glib::ffi::gboolean {
3977 let f: &F = &*(f as *const F);
3978 f(
3979 TreeView::from_glib_borrow(this).unsafe_cast_ref(),
3980 from_glib(object),
3981 from_glib(p0),
3982 from_glib(p1),
3983 )
3984 .into_glib()
3985 }
3986 unsafe {
3987 let f: Box_<F> = Box_::new(f);
3988 connect_raw(
3989 self.as_ptr() as *mut _,
3990 c"expand-collapse-cursor-row".as_ptr() as *const _,
3991 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
3992 expand_collapse_cursor_row_trampoline::<Self, F> as *const (),
3993 )),
3994 Box_::into_raw(f),
3995 )
3996 }
3997 }
3998
3999 fn emit_expand_collapse_cursor_row(&self, object: bool, p0: bool, p1: bool) -> bool {
4000 self.emit_by_name("expand-collapse-cursor-row", &[&object, &p0, &p1])
4001 }
4002
4003 /// The [`TreeView`][crate::TreeView]::move-cursor signal is a [keybinding
4004 /// signal][`SignalAction`][crate::SignalAction] which gets emitted when the user
4005 /// presses one of the cursor keys.
4006 ///
4007 /// Applications should not connect to it, but may emit it with
4008 /// g_signal_emit_by_name() if they need to control the cursor
4009 /// programmatically. In contrast to gtk_tree_view_set_cursor() and
4010 /// gtk_tree_view_set_cursor_on_cell() when moving horizontally
4011 /// [`TreeView`][crate::TreeView]::move-cursor does not reset the current selection.
4012 /// ## `step`
4013 /// the granularity of the move, as a [`MovementStep`][crate::MovementStep].
4014 /// [`MovementStep::LogicalPositions`][crate::MovementStep::LogicalPositions], [`MovementStep::VisualPositions`][crate::MovementStep::VisualPositions],
4015 /// [`MovementStep::DisplayLines`][crate::MovementStep::DisplayLines], [`MovementStep::Pages`][crate::MovementStep::Pages] and
4016 /// [`MovementStep::BufferEnds`][crate::MovementStep::BufferEnds] are supported.
4017 /// [`MovementStep::LogicalPositions`][crate::MovementStep::LogicalPositions] and [`MovementStep::VisualPositions`][crate::MovementStep::VisualPositions]
4018 /// are treated identically.
4019 /// ## `direction`
4020 /// the direction to move: +1 to move forwards; -1 to move
4021 /// backwards. The resulting movement is undefined for all other values.
4022 /// ## `extend`
4023 /// whether to extend the selection
4024 /// ## `modify`
4025 /// whether to modify the selection
4026 ///
4027 /// # Returns
4028 ///
4029 /// [`true`] if @step is supported, [`false`] otherwise.
4030 #[doc(alias = "move-cursor")]
4031 fn connect_move_cursor<F: Fn(&Self, MovementStep, i32, bool, bool) -> bool + 'static>(
4032 &self,
4033 f: F,
4034 ) -> SignalHandlerId {
4035 unsafe extern "C" fn move_cursor_trampoline<
4036 P: IsA<TreeView>,
4037 F: Fn(&P, MovementStep, i32, bool, bool) -> bool + 'static,
4038 >(
4039 this: *mut ffi::GtkTreeView,
4040 step: ffi::GtkMovementStep,
4041 direction: std::ffi::c_int,
4042 extend: glib::ffi::gboolean,
4043 modify: glib::ffi::gboolean,
4044 f: glib::ffi::gpointer,
4045 ) -> glib::ffi::gboolean {
4046 let f: &F = &*(f as *const F);
4047 f(
4048 TreeView::from_glib_borrow(this).unsafe_cast_ref(),
4049 from_glib(step),
4050 direction,
4051 from_glib(extend),
4052 from_glib(modify),
4053 )
4054 .into_glib()
4055 }
4056 unsafe {
4057 let f: Box_<F> = Box_::new(f);
4058 connect_raw(
4059 self.as_ptr() as *mut _,
4060 c"move-cursor".as_ptr() as *const _,
4061 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4062 move_cursor_trampoline::<Self, F> as *const (),
4063 )),
4064 Box_::into_raw(f),
4065 )
4066 }
4067 }
4068
4069 fn emit_move_cursor(
4070 &self,
4071 step: MovementStep,
4072 direction: i32,
4073 extend: bool,
4074 modify: bool,
4075 ) -> bool {
4076 self.emit_by_name("move-cursor", &[&step, &direction, &extend, &modify])
4077 }
4078
4079 /// The "row-activated" signal is emitted when the method
4080 /// [`row_activated()`][Self::row_activated()] is called.
4081 ///
4082 /// This signal is emitted when the user double-clicks a treeview row with the
4083 /// [`activate-on-single-click`][struct@crate::TreeView#activate-on-single-click] property set to [`false`],
4084 /// or when the user single-clicks a row when that property set to [`true`].
4085 ///
4086 /// This signal is also emitted when a non-editable row is selected and one
4087 /// of the keys: <kbd>Space</kbd>, <kbd>Shift</kbd>+<kbd>Space</kbd>,
4088 /// <kbd>Return</kbd> or <kbd>Enter</kbd> is pressed.
4089 ///
4090 /// For selection handling refer to the
4091 /// [tree widget conceptual overview](section-tree-widget.html)
4092 /// as well as [`TreeSelection`][crate::TreeSelection].
4093 /// ## `path`
4094 /// the [`TreePath`][crate::TreePath] for the activated row
4095 /// ## `column`
4096 /// the [`TreeViewColumn`][crate::TreeViewColumn] in which the activation occurred
4097 #[doc(alias = "row-activated")]
4098 fn connect_row_activated<F: Fn(&Self, &TreePath, Option<&TreeViewColumn>) + 'static>(
4099 &self,
4100 f: F,
4101 ) -> SignalHandlerId {
4102 unsafe extern "C" fn row_activated_trampoline<
4103 P: IsA<TreeView>,
4104 F: Fn(&P, &TreePath, Option<&TreeViewColumn>) + 'static,
4105 >(
4106 this: *mut ffi::GtkTreeView,
4107 path: *mut ffi::GtkTreePath,
4108 column: *mut ffi::GtkTreeViewColumn,
4109 f: glib::ffi::gpointer,
4110 ) {
4111 let f: &F = &*(f as *const F);
4112 f(
4113 TreeView::from_glib_borrow(this).unsafe_cast_ref(),
4114 &from_glib_borrow(path),
4115 Option::<TreeViewColumn>::from_glib_borrow(column)
4116 .as_ref()
4117 .as_ref(),
4118 )
4119 }
4120 unsafe {
4121 let f: Box_<F> = Box_::new(f);
4122 connect_raw(
4123 self.as_ptr() as *mut _,
4124 c"row-activated".as_ptr() as *const _,
4125 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4126 row_activated_trampoline::<Self, F> as *const (),
4127 )),
4128 Box_::into_raw(f),
4129 )
4130 }
4131 }
4132
4133 fn emit_row_activated(&self, path: &TreePath, column: Option<&TreeViewColumn>) {
4134 self.emit_by_name::<()>("row-activated", &[&path, &column]);
4135 }
4136
4137 /// The given row has been collapsed (child nodes are hidden).
4138 /// ## `iter`
4139 /// the tree iter of the collapsed row
4140 /// ## `path`
4141 /// a tree path that points to the row
4142 #[doc(alias = "row-collapsed")]
4143 fn connect_row_collapsed<F: Fn(&Self, &TreeIter, &TreePath) + 'static>(
4144 &self,
4145 f: F,
4146 ) -> SignalHandlerId {
4147 unsafe extern "C" fn row_collapsed_trampoline<
4148 P: IsA<TreeView>,
4149 F: Fn(&P, &TreeIter, &TreePath) + 'static,
4150 >(
4151 this: *mut ffi::GtkTreeView,
4152 iter: *mut ffi::GtkTreeIter,
4153 path: *mut ffi::GtkTreePath,
4154 f: glib::ffi::gpointer,
4155 ) {
4156 let f: &F = &*(f as *const F);
4157 f(
4158 TreeView::from_glib_borrow(this).unsafe_cast_ref(),
4159 &from_glib_borrow(iter),
4160 &from_glib_borrow(path),
4161 )
4162 }
4163 unsafe {
4164 let f: Box_<F> = Box_::new(f);
4165 connect_raw(
4166 self.as_ptr() as *mut _,
4167 c"row-collapsed".as_ptr() as *const _,
4168 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4169 row_collapsed_trampoline::<Self, F> as *const (),
4170 )),
4171 Box_::into_raw(f),
4172 )
4173 }
4174 }
4175
4176 /// The given row has been expanded (child nodes are shown).
4177 /// ## `iter`
4178 /// the tree iter of the expanded row
4179 /// ## `path`
4180 /// a tree path that points to the row
4181 #[doc(alias = "row-expanded")]
4182 fn connect_row_expanded<F: Fn(&Self, &TreeIter, &TreePath) + 'static>(
4183 &self,
4184 f: F,
4185 ) -> SignalHandlerId {
4186 unsafe extern "C" fn row_expanded_trampoline<
4187 P: IsA<TreeView>,
4188 F: Fn(&P, &TreeIter, &TreePath) + 'static,
4189 >(
4190 this: *mut ffi::GtkTreeView,
4191 iter: *mut ffi::GtkTreeIter,
4192 path: *mut ffi::GtkTreePath,
4193 f: glib::ffi::gpointer,
4194 ) {
4195 let f: &F = &*(f as *const F);
4196 f(
4197 TreeView::from_glib_borrow(this).unsafe_cast_ref(),
4198 &from_glib_borrow(iter),
4199 &from_glib_borrow(path),
4200 )
4201 }
4202 unsafe {
4203 let f: Box_<F> = Box_::new(f);
4204 connect_raw(
4205 self.as_ptr() as *mut _,
4206 c"row-expanded".as_ptr() as *const _,
4207 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4208 row_expanded_trampoline::<Self, F> as *const (),
4209 )),
4210 Box_::into_raw(f),
4211 )
4212 }
4213 }
4214
4215 #[doc(alias = "select-all")]
4216 fn connect_select_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId {
4217 unsafe extern "C" fn select_all_trampoline<
4218 P: IsA<TreeView>,
4219 F: Fn(&P) -> bool + 'static,
4220 >(
4221 this: *mut ffi::GtkTreeView,
4222 f: glib::ffi::gpointer,
4223 ) -> glib::ffi::gboolean {
4224 let f: &F = &*(f as *const F);
4225 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()).into_glib()
4226 }
4227 unsafe {
4228 let f: Box_<F> = Box_::new(f);
4229 connect_raw(
4230 self.as_ptr() as *mut _,
4231 c"select-all".as_ptr() as *const _,
4232 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4233 select_all_trampoline::<Self, F> as *const (),
4234 )),
4235 Box_::into_raw(f),
4236 )
4237 }
4238 }
4239
4240 fn emit_select_all(&self) -> bool {
4241 self.emit_by_name("select-all", &[])
4242 }
4243
4244 #[doc(alias = "select-cursor-parent")]
4245 fn connect_select_cursor_parent<F: Fn(&Self) -> bool + 'static>(
4246 &self,
4247 f: F,
4248 ) -> SignalHandlerId {
4249 unsafe extern "C" fn select_cursor_parent_trampoline<
4250 P: IsA<TreeView>,
4251 F: Fn(&P) -> bool + 'static,
4252 >(
4253 this: *mut ffi::GtkTreeView,
4254 f: glib::ffi::gpointer,
4255 ) -> glib::ffi::gboolean {
4256 let f: &F = &*(f as *const F);
4257 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()).into_glib()
4258 }
4259 unsafe {
4260 let f: Box_<F> = Box_::new(f);
4261 connect_raw(
4262 self.as_ptr() as *mut _,
4263 c"select-cursor-parent".as_ptr() as *const _,
4264 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4265 select_cursor_parent_trampoline::<Self, F> as *const (),
4266 )),
4267 Box_::into_raw(f),
4268 )
4269 }
4270 }
4271
4272 fn emit_select_cursor_parent(&self) -> bool {
4273 self.emit_by_name("select-cursor-parent", &[])
4274 }
4275
4276 #[doc(alias = "select-cursor-row")]
4277 fn connect_select_cursor_row<F: Fn(&Self, bool) -> bool + 'static>(
4278 &self,
4279 f: F,
4280 ) -> SignalHandlerId {
4281 unsafe extern "C" fn select_cursor_row_trampoline<
4282 P: IsA<TreeView>,
4283 F: Fn(&P, bool) -> bool + 'static,
4284 >(
4285 this: *mut ffi::GtkTreeView,
4286 object: glib::ffi::gboolean,
4287 f: glib::ffi::gpointer,
4288 ) -> glib::ffi::gboolean {
4289 let f: &F = &*(f as *const F);
4290 f(
4291 TreeView::from_glib_borrow(this).unsafe_cast_ref(),
4292 from_glib(object),
4293 )
4294 .into_glib()
4295 }
4296 unsafe {
4297 let f: Box_<F> = Box_::new(f);
4298 connect_raw(
4299 self.as_ptr() as *mut _,
4300 c"select-cursor-row".as_ptr() as *const _,
4301 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4302 select_cursor_row_trampoline::<Self, F> as *const (),
4303 )),
4304 Box_::into_raw(f),
4305 )
4306 }
4307 }
4308
4309 fn emit_select_cursor_row(&self, object: bool) -> bool {
4310 self.emit_by_name("select-cursor-row", &[&object])
4311 }
4312
4313 #[doc(alias = "start-interactive-search")]
4314 fn connect_start_interactive_search<F: Fn(&Self) -> bool + 'static>(
4315 &self,
4316 f: F,
4317 ) -> SignalHandlerId {
4318 unsafe extern "C" fn start_interactive_search_trampoline<
4319 P: IsA<TreeView>,
4320 F: Fn(&P) -> bool + 'static,
4321 >(
4322 this: *mut ffi::GtkTreeView,
4323 f: glib::ffi::gpointer,
4324 ) -> glib::ffi::gboolean {
4325 let f: &F = &*(f as *const F);
4326 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()).into_glib()
4327 }
4328 unsafe {
4329 let f: Box_<F> = Box_::new(f);
4330 connect_raw(
4331 self.as_ptr() as *mut _,
4332 c"start-interactive-search".as_ptr() as *const _,
4333 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4334 start_interactive_search_trampoline::<Self, F> as *const (),
4335 )),
4336 Box_::into_raw(f),
4337 )
4338 }
4339 }
4340
4341 fn emit_start_interactive_search(&self) -> bool {
4342 self.emit_by_name("start-interactive-search", &[])
4343 }
4344
4345 /// The given row is about to be collapsed (hide its children nodes). Use this
4346 /// signal if you need to control the collapsibility of individual rows.
4347 /// ## `iter`
4348 /// the tree iter of the row to collapse
4349 /// ## `path`
4350 /// a tree path that points to the row
4351 ///
4352 /// # Returns
4353 ///
4354 /// [`false`] to allow collapsing, [`true`] to reject
4355 #[doc(alias = "test-collapse-row")]
4356 fn connect_test_collapse_row<
4357 F: Fn(&Self, &TreeIter, &TreePath) -> glib::Propagation + 'static,
4358 >(
4359 &self,
4360 f: F,
4361 ) -> SignalHandlerId {
4362 unsafe extern "C" fn test_collapse_row_trampoline<
4363 P: IsA<TreeView>,
4364 F: Fn(&P, &TreeIter, &TreePath) -> glib::Propagation + 'static,
4365 >(
4366 this: *mut ffi::GtkTreeView,
4367 iter: *mut ffi::GtkTreeIter,
4368 path: *mut ffi::GtkTreePath,
4369 f: glib::ffi::gpointer,
4370 ) -> glib::ffi::gboolean {
4371 let f: &F = &*(f as *const F);
4372 f(
4373 TreeView::from_glib_borrow(this).unsafe_cast_ref(),
4374 &from_glib_borrow(iter),
4375 &from_glib_borrow(path),
4376 )
4377 .into_glib()
4378 }
4379 unsafe {
4380 let f: Box_<F> = Box_::new(f);
4381 connect_raw(
4382 self.as_ptr() as *mut _,
4383 c"test-collapse-row".as_ptr() as *const _,
4384 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4385 test_collapse_row_trampoline::<Self, F> as *const (),
4386 )),
4387 Box_::into_raw(f),
4388 )
4389 }
4390 }
4391
4392 /// The given row is about to be expanded (show its children nodes). Use this
4393 /// signal if you need to control the expandability of individual rows.
4394 /// ## `iter`
4395 /// the tree iter of the row to expand
4396 /// ## `path`
4397 /// a tree path that points to the row
4398 ///
4399 /// # Returns
4400 ///
4401 /// [`false`] to allow expansion, [`true`] to reject
4402 #[doc(alias = "test-expand-row")]
4403 fn connect_test_expand_row<
4404 F: Fn(&Self, &TreeIter, &TreePath) -> glib::Propagation + 'static,
4405 >(
4406 &self,
4407 f: F,
4408 ) -> SignalHandlerId {
4409 unsafe extern "C" fn test_expand_row_trampoline<
4410 P: IsA<TreeView>,
4411 F: Fn(&P, &TreeIter, &TreePath) -> glib::Propagation + 'static,
4412 >(
4413 this: *mut ffi::GtkTreeView,
4414 iter: *mut ffi::GtkTreeIter,
4415 path: *mut ffi::GtkTreePath,
4416 f: glib::ffi::gpointer,
4417 ) -> glib::ffi::gboolean {
4418 let f: &F = &*(f as *const F);
4419 f(
4420 TreeView::from_glib_borrow(this).unsafe_cast_ref(),
4421 &from_glib_borrow(iter),
4422 &from_glib_borrow(path),
4423 )
4424 .into_glib()
4425 }
4426 unsafe {
4427 let f: Box_<F> = Box_::new(f);
4428 connect_raw(
4429 self.as_ptr() as *mut _,
4430 c"test-expand-row".as_ptr() as *const _,
4431 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4432 test_expand_row_trampoline::<Self, F> as *const (),
4433 )),
4434 Box_::into_raw(f),
4435 )
4436 }
4437 }
4438
4439 #[doc(alias = "toggle-cursor-row")]
4440 fn connect_toggle_cursor_row<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId {
4441 unsafe extern "C" fn toggle_cursor_row_trampoline<
4442 P: IsA<TreeView>,
4443 F: Fn(&P) -> bool + 'static,
4444 >(
4445 this: *mut ffi::GtkTreeView,
4446 f: glib::ffi::gpointer,
4447 ) -> glib::ffi::gboolean {
4448 let f: &F = &*(f as *const F);
4449 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()).into_glib()
4450 }
4451 unsafe {
4452 let f: Box_<F> = Box_::new(f);
4453 connect_raw(
4454 self.as_ptr() as *mut _,
4455 c"toggle-cursor-row".as_ptr() as *const _,
4456 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4457 toggle_cursor_row_trampoline::<Self, F> as *const (),
4458 )),
4459 Box_::into_raw(f),
4460 )
4461 }
4462 }
4463
4464 fn emit_toggle_cursor_row(&self) -> bool {
4465 self.emit_by_name("toggle-cursor-row", &[])
4466 }
4467
4468 #[doc(alias = "unselect-all")]
4469 fn connect_unselect_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId {
4470 unsafe extern "C" fn unselect_all_trampoline<
4471 P: IsA<TreeView>,
4472 F: Fn(&P) -> bool + 'static,
4473 >(
4474 this: *mut ffi::GtkTreeView,
4475 f: glib::ffi::gpointer,
4476 ) -> glib::ffi::gboolean {
4477 let f: &F = &*(f as *const F);
4478 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()).into_glib()
4479 }
4480 unsafe {
4481 let f: Box_<F> = Box_::new(f);
4482 connect_raw(
4483 self.as_ptr() as *mut _,
4484 c"unselect-all".as_ptr() as *const _,
4485 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4486 unselect_all_trampoline::<Self, F> as *const (),
4487 )),
4488 Box_::into_raw(f),
4489 )
4490 }
4491 }
4492
4493 fn emit_unselect_all(&self) -> bool {
4494 self.emit_by_name("unselect-all", &[])
4495 }
4496
4497 #[doc(alias = "activate-on-single-click")]
4498 fn connect_activate_on_single_click_notify<F: Fn(&Self) + 'static>(
4499 &self,
4500 f: F,
4501 ) -> SignalHandlerId {
4502 unsafe extern "C" fn notify_activate_on_single_click_trampoline<
4503 P: IsA<TreeView>,
4504 F: Fn(&P) + 'static,
4505 >(
4506 this: *mut ffi::GtkTreeView,
4507 _param_spec: glib::ffi::gpointer,
4508 f: glib::ffi::gpointer,
4509 ) {
4510 let f: &F = &*(f as *const F);
4511 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
4512 }
4513 unsafe {
4514 let f: Box_<F> = Box_::new(f);
4515 connect_raw(
4516 self.as_ptr() as *mut _,
4517 c"notify::activate-on-single-click".as_ptr() as *const _,
4518 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4519 notify_activate_on_single_click_trampoline::<Self, F> as *const (),
4520 )),
4521 Box_::into_raw(f),
4522 )
4523 }
4524 }
4525
4526 #[doc(alias = "enable-grid-lines")]
4527 fn connect_enable_grid_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4528 unsafe extern "C" fn notify_enable_grid_lines_trampoline<
4529 P: IsA<TreeView>,
4530 F: Fn(&P) + 'static,
4531 >(
4532 this: *mut ffi::GtkTreeView,
4533 _param_spec: glib::ffi::gpointer,
4534 f: glib::ffi::gpointer,
4535 ) {
4536 let f: &F = &*(f as *const F);
4537 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
4538 }
4539 unsafe {
4540 let f: Box_<F> = Box_::new(f);
4541 connect_raw(
4542 self.as_ptr() as *mut _,
4543 c"notify::enable-grid-lines".as_ptr() as *const _,
4544 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4545 notify_enable_grid_lines_trampoline::<Self, F> as *const (),
4546 )),
4547 Box_::into_raw(f),
4548 )
4549 }
4550 }
4551
4552 #[doc(alias = "enable-search")]
4553 fn connect_enable_search_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4554 unsafe extern "C" fn notify_enable_search_trampoline<
4555 P: IsA<TreeView>,
4556 F: Fn(&P) + 'static,
4557 >(
4558 this: *mut ffi::GtkTreeView,
4559 _param_spec: glib::ffi::gpointer,
4560 f: glib::ffi::gpointer,
4561 ) {
4562 let f: &F = &*(f as *const F);
4563 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
4564 }
4565 unsafe {
4566 let f: Box_<F> = Box_::new(f);
4567 connect_raw(
4568 self.as_ptr() as *mut _,
4569 c"notify::enable-search".as_ptr() as *const _,
4570 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4571 notify_enable_search_trampoline::<Self, F> as *const (),
4572 )),
4573 Box_::into_raw(f),
4574 )
4575 }
4576 }
4577
4578 #[doc(alias = "enable-tree-lines")]
4579 fn connect_enable_tree_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4580 unsafe extern "C" fn notify_enable_tree_lines_trampoline<
4581 P: IsA<TreeView>,
4582 F: Fn(&P) + 'static,
4583 >(
4584 this: *mut ffi::GtkTreeView,
4585 _param_spec: glib::ffi::gpointer,
4586 f: glib::ffi::gpointer,
4587 ) {
4588 let f: &F = &*(f as *const F);
4589 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
4590 }
4591 unsafe {
4592 let f: Box_<F> = Box_::new(f);
4593 connect_raw(
4594 self.as_ptr() as *mut _,
4595 c"notify::enable-tree-lines".as_ptr() as *const _,
4596 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4597 notify_enable_tree_lines_trampoline::<Self, F> as *const (),
4598 )),
4599 Box_::into_raw(f),
4600 )
4601 }
4602 }
4603
4604 #[doc(alias = "expander-column")]
4605 fn connect_expander_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4606 unsafe extern "C" fn notify_expander_column_trampoline<
4607 P: IsA<TreeView>,
4608 F: Fn(&P) + 'static,
4609 >(
4610 this: *mut ffi::GtkTreeView,
4611 _param_spec: glib::ffi::gpointer,
4612 f: glib::ffi::gpointer,
4613 ) {
4614 let f: &F = &*(f as *const F);
4615 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
4616 }
4617 unsafe {
4618 let f: Box_<F> = Box_::new(f);
4619 connect_raw(
4620 self.as_ptr() as *mut _,
4621 c"notify::expander-column".as_ptr() as *const _,
4622 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4623 notify_expander_column_trampoline::<Self, F> as *const (),
4624 )),
4625 Box_::into_raw(f),
4626 )
4627 }
4628 }
4629
4630 #[doc(alias = "fixed-height-mode")]
4631 fn connect_fixed_height_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4632 unsafe extern "C" fn notify_fixed_height_mode_trampoline<
4633 P: IsA<TreeView>,
4634 F: Fn(&P) + 'static,
4635 >(
4636 this: *mut ffi::GtkTreeView,
4637 _param_spec: glib::ffi::gpointer,
4638 f: glib::ffi::gpointer,
4639 ) {
4640 let f: &F = &*(f as *const F);
4641 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
4642 }
4643 unsafe {
4644 let f: Box_<F> = Box_::new(f);
4645 connect_raw(
4646 self.as_ptr() as *mut _,
4647 c"notify::fixed-height-mode".as_ptr() as *const _,
4648 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4649 notify_fixed_height_mode_trampoline::<Self, F> as *const (),
4650 )),
4651 Box_::into_raw(f),
4652 )
4653 }
4654 }
4655
4656 #[doc(alias = "headers-clickable")]
4657 fn connect_headers_clickable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4658 unsafe extern "C" fn notify_headers_clickable_trampoline<
4659 P: IsA<TreeView>,
4660 F: Fn(&P) + 'static,
4661 >(
4662 this: *mut ffi::GtkTreeView,
4663 _param_spec: glib::ffi::gpointer,
4664 f: glib::ffi::gpointer,
4665 ) {
4666 let f: &F = &*(f as *const F);
4667 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
4668 }
4669 unsafe {
4670 let f: Box_<F> = Box_::new(f);
4671 connect_raw(
4672 self.as_ptr() as *mut _,
4673 c"notify::headers-clickable".as_ptr() as *const _,
4674 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4675 notify_headers_clickable_trampoline::<Self, F> as *const (),
4676 )),
4677 Box_::into_raw(f),
4678 )
4679 }
4680 }
4681
4682 #[doc(alias = "headers-visible")]
4683 fn connect_headers_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4684 unsafe extern "C" fn notify_headers_visible_trampoline<
4685 P: IsA<TreeView>,
4686 F: Fn(&P) + 'static,
4687 >(
4688 this: *mut ffi::GtkTreeView,
4689 _param_spec: glib::ffi::gpointer,
4690 f: glib::ffi::gpointer,
4691 ) {
4692 let f: &F = &*(f as *const F);
4693 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
4694 }
4695 unsafe {
4696 let f: Box_<F> = Box_::new(f);
4697 connect_raw(
4698 self.as_ptr() as *mut _,
4699 c"notify::headers-visible".as_ptr() as *const _,
4700 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4701 notify_headers_visible_trampoline::<Self, F> as *const (),
4702 )),
4703 Box_::into_raw(f),
4704 )
4705 }
4706 }
4707
4708 #[doc(alias = "hover-expand")]
4709 fn connect_hover_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4710 unsafe extern "C" fn notify_hover_expand_trampoline<
4711 P: IsA<TreeView>,
4712 F: Fn(&P) + 'static,
4713 >(
4714 this: *mut ffi::GtkTreeView,
4715 _param_spec: glib::ffi::gpointer,
4716 f: glib::ffi::gpointer,
4717 ) {
4718 let f: &F = &*(f as *const F);
4719 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
4720 }
4721 unsafe {
4722 let f: Box_<F> = Box_::new(f);
4723 connect_raw(
4724 self.as_ptr() as *mut _,
4725 c"notify::hover-expand".as_ptr() as *const _,
4726 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4727 notify_hover_expand_trampoline::<Self, F> as *const (),
4728 )),
4729 Box_::into_raw(f),
4730 )
4731 }
4732 }
4733
4734 #[doc(alias = "hover-selection")]
4735 fn connect_hover_selection_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4736 unsafe extern "C" fn notify_hover_selection_trampoline<
4737 P: IsA<TreeView>,
4738 F: Fn(&P) + 'static,
4739 >(
4740 this: *mut ffi::GtkTreeView,
4741 _param_spec: glib::ffi::gpointer,
4742 f: glib::ffi::gpointer,
4743 ) {
4744 let f: &F = &*(f as *const F);
4745 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
4746 }
4747 unsafe {
4748 let f: Box_<F> = Box_::new(f);
4749 connect_raw(
4750 self.as_ptr() as *mut _,
4751 c"notify::hover-selection".as_ptr() as *const _,
4752 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4753 notify_hover_selection_trampoline::<Self, F> as *const (),
4754 )),
4755 Box_::into_raw(f),
4756 )
4757 }
4758 }
4759
4760 #[doc(alias = "level-indentation")]
4761 fn connect_level_indentation_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4762 unsafe extern "C" fn notify_level_indentation_trampoline<
4763 P: IsA<TreeView>,
4764 F: Fn(&P) + 'static,
4765 >(
4766 this: *mut ffi::GtkTreeView,
4767 _param_spec: glib::ffi::gpointer,
4768 f: glib::ffi::gpointer,
4769 ) {
4770 let f: &F = &*(f as *const F);
4771 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
4772 }
4773 unsafe {
4774 let f: Box_<F> = Box_::new(f);
4775 connect_raw(
4776 self.as_ptr() as *mut _,
4777 c"notify::level-indentation".as_ptr() as *const _,
4778 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4779 notify_level_indentation_trampoline::<Self, F> as *const (),
4780 )),
4781 Box_::into_raw(f),
4782 )
4783 }
4784 }
4785
4786 #[doc(alias = "model")]
4787 fn connect_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4788 unsafe extern "C" fn notify_model_trampoline<P: IsA<TreeView>, F: Fn(&P) + 'static>(
4789 this: *mut ffi::GtkTreeView,
4790 _param_spec: glib::ffi::gpointer,
4791 f: glib::ffi::gpointer,
4792 ) {
4793 let f: &F = &*(f as *const F);
4794 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
4795 }
4796 unsafe {
4797 let f: Box_<F> = Box_::new(f);
4798 connect_raw(
4799 self.as_ptr() as *mut _,
4800 c"notify::model".as_ptr() as *const _,
4801 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4802 notify_model_trampoline::<Self, F> as *const (),
4803 )),
4804 Box_::into_raw(f),
4805 )
4806 }
4807 }
4808
4809 #[doc(alias = "reorderable")]
4810 fn connect_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4811 unsafe extern "C" fn notify_reorderable_trampoline<
4812 P: IsA<TreeView>,
4813 F: Fn(&P) + 'static,
4814 >(
4815 this: *mut ffi::GtkTreeView,
4816 _param_spec: glib::ffi::gpointer,
4817 f: glib::ffi::gpointer,
4818 ) {
4819 let f: &F = &*(f as *const F);
4820 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
4821 }
4822 unsafe {
4823 let f: Box_<F> = Box_::new(f);
4824 connect_raw(
4825 self.as_ptr() as *mut _,
4826 c"notify::reorderable".as_ptr() as *const _,
4827 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4828 notify_reorderable_trampoline::<Self, F> as *const (),
4829 )),
4830 Box_::into_raw(f),
4831 )
4832 }
4833 }
4834
4835 #[doc(alias = "rubber-banding")]
4836 fn connect_rubber_banding_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4837 unsafe extern "C" fn notify_rubber_banding_trampoline<
4838 P: IsA<TreeView>,
4839 F: Fn(&P) + 'static,
4840 >(
4841 this: *mut ffi::GtkTreeView,
4842 _param_spec: glib::ffi::gpointer,
4843 f: glib::ffi::gpointer,
4844 ) {
4845 let f: &F = &*(f as *const F);
4846 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
4847 }
4848 unsafe {
4849 let f: Box_<F> = Box_::new(f);
4850 connect_raw(
4851 self.as_ptr() as *mut _,
4852 c"notify::rubber-banding".as_ptr() as *const _,
4853 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4854 notify_rubber_banding_trampoline::<Self, F> as *const (),
4855 )),
4856 Box_::into_raw(f),
4857 )
4858 }
4859 }
4860
4861 #[doc(alias = "search-column")]
4862 fn connect_search_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4863 unsafe extern "C" fn notify_search_column_trampoline<
4864 P: IsA<TreeView>,
4865 F: Fn(&P) + 'static,
4866 >(
4867 this: *mut ffi::GtkTreeView,
4868 _param_spec: glib::ffi::gpointer,
4869 f: glib::ffi::gpointer,
4870 ) {
4871 let f: &F = &*(f as *const F);
4872 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
4873 }
4874 unsafe {
4875 let f: Box_<F> = Box_::new(f);
4876 connect_raw(
4877 self.as_ptr() as *mut _,
4878 c"notify::search-column".as_ptr() as *const _,
4879 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4880 notify_search_column_trampoline::<Self, F> as *const (),
4881 )),
4882 Box_::into_raw(f),
4883 )
4884 }
4885 }
4886
4887 #[doc(alias = "show-expanders")]
4888 fn connect_show_expanders_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4889 unsafe extern "C" fn notify_show_expanders_trampoline<
4890 P: IsA<TreeView>,
4891 F: Fn(&P) + 'static,
4892 >(
4893 this: *mut ffi::GtkTreeView,
4894 _param_spec: glib::ffi::gpointer,
4895 f: glib::ffi::gpointer,
4896 ) {
4897 let f: &F = &*(f as *const F);
4898 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
4899 }
4900 unsafe {
4901 let f: Box_<F> = Box_::new(f);
4902 connect_raw(
4903 self.as_ptr() as *mut _,
4904 c"notify::show-expanders".as_ptr() as *const _,
4905 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4906 notify_show_expanders_trampoline::<Self, F> as *const (),
4907 )),
4908 Box_::into_raw(f),
4909 )
4910 }
4911 }
4912
4913 #[doc(alias = "tooltip-column")]
4914 fn connect_tooltip_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
4915 unsafe extern "C" fn notify_tooltip_column_trampoline<
4916 P: IsA<TreeView>,
4917 F: Fn(&P) + 'static,
4918 >(
4919 this: *mut ffi::GtkTreeView,
4920 _param_spec: glib::ffi::gpointer,
4921 f: glib::ffi::gpointer,
4922 ) {
4923 let f: &F = &*(f as *const F);
4924 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
4925 }
4926 unsafe {
4927 let f: Box_<F> = Box_::new(f);
4928 connect_raw(
4929 self.as_ptr() as *mut _,
4930 c"notify::tooltip-column".as_ptr() as *const _,
4931 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
4932 notify_tooltip_column_trampoline::<Self, F> as *const (),
4933 )),
4934 Box_::into_raw(f),
4935 )
4936 }
4937 }
4938}
4939
4940impl<O: IsA<TreeView>> TreeViewExt for O {}