1#![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 #[doc(alias = "GtkTreeView")]
22 pub struct TreeView(Object<ffi::GtkTreeView, ffi::GtkTreeViewClass>) @extends Widget, @implements Accessible, Buildable, ConstraintTarget, Scrollable;
23
24 match fn {
25 type_ => || ffi::gtk_tree_view_get_type(),
26 }
27}
28
29impl TreeView {
30 pub const NONE: Option<&'static TreeView> = None;
31
32 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
33 #[allow(deprecated)]
34 #[doc(alias = "gtk_tree_view_new")]
35 pub fn new() -> TreeView {
36 assert_initialized_main_thread!();
37 unsafe { Widget::from_glib_none(ffi::gtk_tree_view_new()).unsafe_cast() }
38 }
39
40 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
41 #[allow(deprecated)]
42 #[doc(alias = "gtk_tree_view_new_with_model")]
43 #[doc(alias = "new_with_model")]
44 pub fn with_model(model: &impl IsA<TreeModel>) -> TreeView {
45 skip_assert_initialized!();
46 unsafe {
47 Widget::from_glib_none(ffi::gtk_tree_view_new_with_model(
48 model.as_ref().to_glib_none().0,
49 ))
50 .unsafe_cast()
51 }
52 }
53
54 pub fn builder() -> TreeViewBuilder {
59 TreeViewBuilder::new()
60 }
61}
62
63impl Default for TreeView {
64 fn default() -> Self {
65 Self::new()
66 }
67}
68
69#[must_use = "The builder must be built to be used"]
74pub struct TreeViewBuilder {
75 builder: glib::object::ObjectBuilder<'static, TreeView>,
76}
77
78impl TreeViewBuilder {
79 fn new() -> Self {
80 Self {
81 builder: glib::object::Object::builder(),
82 }
83 }
84
85 pub fn activate_on_single_click(self, activate_on_single_click: bool) -> Self {
86 Self {
87 builder: self
88 .builder
89 .property("activate-on-single-click", activate_on_single_click),
90 }
91 }
92
93 pub fn enable_grid_lines(self, enable_grid_lines: TreeViewGridLines) -> Self {
94 Self {
95 builder: self
96 .builder
97 .property("enable-grid-lines", enable_grid_lines),
98 }
99 }
100
101 pub fn enable_search(self, enable_search: bool) -> Self {
102 Self {
103 builder: self.builder.property("enable-search", enable_search),
104 }
105 }
106
107 pub fn enable_tree_lines(self, enable_tree_lines: bool) -> Self {
108 Self {
109 builder: self
110 .builder
111 .property("enable-tree-lines", enable_tree_lines),
112 }
113 }
114
115 pub fn expander_column(self, expander_column: &TreeViewColumn) -> Self {
116 Self {
117 builder: self
118 .builder
119 .property("expander-column", expander_column.clone()),
120 }
121 }
122
123 pub fn fixed_height_mode(self, fixed_height_mode: bool) -> Self {
124 Self {
125 builder: self
126 .builder
127 .property("fixed-height-mode", fixed_height_mode),
128 }
129 }
130
131 pub fn headers_clickable(self, headers_clickable: bool) -> Self {
132 Self {
133 builder: self
134 .builder
135 .property("headers-clickable", headers_clickable),
136 }
137 }
138
139 pub fn headers_visible(self, headers_visible: bool) -> Self {
140 Self {
141 builder: self.builder.property("headers-visible", headers_visible),
142 }
143 }
144
145 pub fn hover_expand(self, hover_expand: bool) -> Self {
146 Self {
147 builder: self.builder.property("hover-expand", hover_expand),
148 }
149 }
150
151 pub fn hover_selection(self, hover_selection: bool) -> Self {
152 Self {
153 builder: self.builder.property("hover-selection", hover_selection),
154 }
155 }
156
157 pub fn level_indentation(self, level_indentation: i32) -> Self {
158 Self {
159 builder: self
160 .builder
161 .property("level-indentation", level_indentation),
162 }
163 }
164
165 pub fn model(self, model: &impl IsA<TreeModel>) -> Self {
166 Self {
167 builder: self.builder.property("model", model.clone().upcast()),
168 }
169 }
170
171 pub fn reorderable(self, reorderable: bool) -> Self {
172 Self {
173 builder: self.builder.property("reorderable", reorderable),
174 }
175 }
176
177 pub fn rubber_banding(self, rubber_banding: bool) -> Self {
178 Self {
179 builder: self.builder.property("rubber-banding", rubber_banding),
180 }
181 }
182
183 pub fn search_column(self, search_column: i32) -> Self {
184 Self {
185 builder: self.builder.property("search-column", search_column),
186 }
187 }
188
189 pub fn show_expanders(self, show_expanders: bool) -> Self {
190 Self {
191 builder: self.builder.property("show-expanders", show_expanders),
192 }
193 }
194
195 pub fn tooltip_column(self, tooltip_column: i32) -> Self {
196 Self {
197 builder: self.builder.property("tooltip-column", tooltip_column),
198 }
199 }
200
201 pub fn can_focus(self, can_focus: bool) -> Self {
202 Self {
203 builder: self.builder.property("can-focus", can_focus),
204 }
205 }
206
207 pub fn can_target(self, can_target: bool) -> Self {
208 Self {
209 builder: self.builder.property("can-target", can_target),
210 }
211 }
212
213 pub fn css_classes(self, css_classes: impl Into<glib::StrV>) -> Self {
214 Self {
215 builder: self.builder.property("css-classes", css_classes.into()),
216 }
217 }
218
219 pub fn css_name(self, css_name: impl Into<glib::GString>) -> Self {
220 Self {
221 builder: self.builder.property("css-name", css_name.into()),
222 }
223 }
224
225 pub fn cursor(self, cursor: &gdk::Cursor) -> Self {
226 Self {
227 builder: self.builder.property("cursor", cursor.clone()),
228 }
229 }
230
231 pub fn focus_on_click(self, focus_on_click: bool) -> Self {
232 Self {
233 builder: self.builder.property("focus-on-click", focus_on_click),
234 }
235 }
236
237 pub fn focusable(self, focusable: bool) -> Self {
238 Self {
239 builder: self.builder.property("focusable", focusable),
240 }
241 }
242
243 pub fn halign(self, halign: Align) -> Self {
244 Self {
245 builder: self.builder.property("halign", halign),
246 }
247 }
248
249 pub fn has_tooltip(self, has_tooltip: bool) -> Self {
250 Self {
251 builder: self.builder.property("has-tooltip", has_tooltip),
252 }
253 }
254
255 pub fn height_request(self, height_request: i32) -> Self {
256 Self {
257 builder: self.builder.property("height-request", height_request),
258 }
259 }
260
261 pub fn hexpand(self, hexpand: bool) -> Self {
262 Self {
263 builder: self.builder.property("hexpand", hexpand),
264 }
265 }
266
267 pub fn hexpand_set(self, hexpand_set: bool) -> Self {
268 Self {
269 builder: self.builder.property("hexpand-set", hexpand_set),
270 }
271 }
272
273 pub fn layout_manager(self, layout_manager: &impl IsA<LayoutManager>) -> Self {
274 Self {
275 builder: self
276 .builder
277 .property("layout-manager", layout_manager.clone().upcast()),
278 }
279 }
280
281 #[cfg(feature = "v4_18")]
282 #[cfg_attr(docsrs, doc(cfg(feature = "v4_18")))]
283 pub fn limit_events(self, limit_events: bool) -> Self {
284 Self {
285 builder: self.builder.property("limit-events", limit_events),
286 }
287 }
288
289 pub fn margin_bottom(self, margin_bottom: i32) -> Self {
290 Self {
291 builder: self.builder.property("margin-bottom", margin_bottom),
292 }
293 }
294
295 pub fn margin_end(self, margin_end: i32) -> Self {
296 Self {
297 builder: self.builder.property("margin-end", margin_end),
298 }
299 }
300
301 pub fn margin_start(self, margin_start: i32) -> Self {
302 Self {
303 builder: self.builder.property("margin-start", margin_start),
304 }
305 }
306
307 pub fn margin_top(self, margin_top: i32) -> Self {
308 Self {
309 builder: self.builder.property("margin-top", margin_top),
310 }
311 }
312
313 pub fn name(self, name: impl Into<glib::GString>) -> Self {
314 Self {
315 builder: self.builder.property("name", name.into()),
316 }
317 }
318
319 pub fn opacity(self, opacity: f64) -> Self {
320 Self {
321 builder: self.builder.property("opacity", opacity),
322 }
323 }
324
325 pub fn overflow(self, overflow: Overflow) -> Self {
326 Self {
327 builder: self.builder.property("overflow", overflow),
328 }
329 }
330
331 pub fn receives_default(self, receives_default: bool) -> Self {
332 Self {
333 builder: self.builder.property("receives-default", receives_default),
334 }
335 }
336
337 pub fn sensitive(self, sensitive: bool) -> Self {
338 Self {
339 builder: self.builder.property("sensitive", sensitive),
340 }
341 }
342
343 pub fn tooltip_markup(self, tooltip_markup: impl Into<glib::GString>) -> Self {
344 Self {
345 builder: self
346 .builder
347 .property("tooltip-markup", tooltip_markup.into()),
348 }
349 }
350
351 pub fn tooltip_text(self, tooltip_text: impl Into<glib::GString>) -> Self {
352 Self {
353 builder: self.builder.property("tooltip-text", tooltip_text.into()),
354 }
355 }
356
357 pub fn valign(self, valign: Align) -> Self {
358 Self {
359 builder: self.builder.property("valign", valign),
360 }
361 }
362
363 pub fn vexpand(self, vexpand: bool) -> Self {
364 Self {
365 builder: self.builder.property("vexpand", vexpand),
366 }
367 }
368
369 pub fn vexpand_set(self, vexpand_set: bool) -> Self {
370 Self {
371 builder: self.builder.property("vexpand-set", vexpand_set),
372 }
373 }
374
375 pub fn visible(self, visible: bool) -> Self {
376 Self {
377 builder: self.builder.property("visible", visible),
378 }
379 }
380
381 pub fn width_request(self, width_request: i32) -> Self {
382 Self {
383 builder: self.builder.property("width-request", width_request),
384 }
385 }
386
387 pub fn accessible_role(self, accessible_role: AccessibleRole) -> Self {
388 Self {
389 builder: self.builder.property("accessible-role", accessible_role),
390 }
391 }
392
393 pub fn hadjustment(self, hadjustment: &impl IsA<Adjustment>) -> Self {
394 Self {
395 builder: self
396 .builder
397 .property("hadjustment", hadjustment.clone().upcast()),
398 }
399 }
400
401 pub fn hscroll_policy(self, hscroll_policy: ScrollablePolicy) -> Self {
402 Self {
403 builder: self.builder.property("hscroll-policy", hscroll_policy),
404 }
405 }
406
407 pub fn vadjustment(self, vadjustment: &impl IsA<Adjustment>) -> Self {
408 Self {
409 builder: self
410 .builder
411 .property("vadjustment", vadjustment.clone().upcast()),
412 }
413 }
414
415 pub fn vscroll_policy(self, vscroll_policy: ScrollablePolicy) -> Self {
416 Self {
417 builder: self.builder.property("vscroll-policy", vscroll_policy),
418 }
419 }
420
421 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
424 pub fn build(self) -> TreeView {
425 assert_initialized_main_thread!();
426 self.builder.build()
427 }
428}
429
430pub trait TreeViewExt: IsA<TreeView> + 'static {
431 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
432 #[allow(deprecated)]
433 #[doc(alias = "gtk_tree_view_append_column")]
434 fn append_column(&self, column: &TreeViewColumn) -> i32 {
435 unsafe {
436 ffi::gtk_tree_view_append_column(
437 self.as_ref().to_glib_none().0,
438 column.to_glib_none().0,
439 )
440 }
441 }
442
443 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
444 #[allow(deprecated)]
445 #[doc(alias = "gtk_tree_view_collapse_all")]
446 fn collapse_all(&self) {
447 unsafe {
448 ffi::gtk_tree_view_collapse_all(self.as_ref().to_glib_none().0);
449 }
450 }
451
452 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
453 #[allow(deprecated)]
454 #[doc(alias = "gtk_tree_view_collapse_row")]
455 fn collapse_row(&self, path: &TreePath) -> bool {
456 unsafe {
457 from_glib(ffi::gtk_tree_view_collapse_row(
458 self.as_ref().to_glib_none().0,
459 mut_override(path.to_glib_none().0),
460 ))
461 }
462 }
463
464 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
465 #[allow(deprecated)]
466 #[doc(alias = "gtk_tree_view_columns_autosize")]
467 fn columns_autosize(&self) {
468 unsafe {
469 ffi::gtk_tree_view_columns_autosize(self.as_ref().to_glib_none().0);
470 }
471 }
472
473 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
474 #[allow(deprecated)]
475 #[doc(alias = "gtk_tree_view_convert_bin_window_to_tree_coords")]
476 fn convert_bin_window_to_tree_coords(&self, bx: i32, by: i32) -> (i32, i32) {
477 unsafe {
478 let mut tx = std::mem::MaybeUninit::uninit();
479 let mut ty = std::mem::MaybeUninit::uninit();
480 ffi::gtk_tree_view_convert_bin_window_to_tree_coords(
481 self.as_ref().to_glib_none().0,
482 bx,
483 by,
484 tx.as_mut_ptr(),
485 ty.as_mut_ptr(),
486 );
487 (tx.assume_init(), ty.assume_init())
488 }
489 }
490
491 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
492 #[allow(deprecated)]
493 #[doc(alias = "gtk_tree_view_convert_bin_window_to_widget_coords")]
494 fn convert_bin_window_to_widget_coords(&self, bx: i32, by: i32) -> (i32, i32) {
495 unsafe {
496 let mut wx = std::mem::MaybeUninit::uninit();
497 let mut wy = std::mem::MaybeUninit::uninit();
498 ffi::gtk_tree_view_convert_bin_window_to_widget_coords(
499 self.as_ref().to_glib_none().0,
500 bx,
501 by,
502 wx.as_mut_ptr(),
503 wy.as_mut_ptr(),
504 );
505 (wx.assume_init(), wy.assume_init())
506 }
507 }
508
509 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
510 #[allow(deprecated)]
511 #[doc(alias = "gtk_tree_view_convert_tree_to_bin_window_coords")]
512 fn convert_tree_to_bin_window_coords(&self, tx: i32, ty: i32) -> (i32, i32) {
513 unsafe {
514 let mut bx = std::mem::MaybeUninit::uninit();
515 let mut by = std::mem::MaybeUninit::uninit();
516 ffi::gtk_tree_view_convert_tree_to_bin_window_coords(
517 self.as_ref().to_glib_none().0,
518 tx,
519 ty,
520 bx.as_mut_ptr(),
521 by.as_mut_ptr(),
522 );
523 (bx.assume_init(), by.assume_init())
524 }
525 }
526
527 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
528 #[allow(deprecated)]
529 #[doc(alias = "gtk_tree_view_convert_tree_to_widget_coords")]
530 fn convert_tree_to_widget_coords(&self, tx: i32, ty: i32) -> (i32, i32) {
531 unsafe {
532 let mut wx = std::mem::MaybeUninit::uninit();
533 let mut wy = std::mem::MaybeUninit::uninit();
534 ffi::gtk_tree_view_convert_tree_to_widget_coords(
535 self.as_ref().to_glib_none().0,
536 tx,
537 ty,
538 wx.as_mut_ptr(),
539 wy.as_mut_ptr(),
540 );
541 (wx.assume_init(), wy.assume_init())
542 }
543 }
544
545 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
546 #[allow(deprecated)]
547 #[doc(alias = "gtk_tree_view_convert_widget_to_bin_window_coords")]
548 fn convert_widget_to_bin_window_coords(&self, wx: i32, wy: i32) -> (i32, i32) {
549 unsafe {
550 let mut bx = std::mem::MaybeUninit::uninit();
551 let mut by = std::mem::MaybeUninit::uninit();
552 ffi::gtk_tree_view_convert_widget_to_bin_window_coords(
553 self.as_ref().to_glib_none().0,
554 wx,
555 wy,
556 bx.as_mut_ptr(),
557 by.as_mut_ptr(),
558 );
559 (bx.assume_init(), by.assume_init())
560 }
561 }
562
563 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
564 #[allow(deprecated)]
565 #[doc(alias = "gtk_tree_view_convert_widget_to_tree_coords")]
566 fn convert_widget_to_tree_coords(&self, wx: i32, wy: i32) -> (i32, i32) {
567 unsafe {
568 let mut tx = std::mem::MaybeUninit::uninit();
569 let mut ty = std::mem::MaybeUninit::uninit();
570 ffi::gtk_tree_view_convert_widget_to_tree_coords(
571 self.as_ref().to_glib_none().0,
572 wx,
573 wy,
574 tx.as_mut_ptr(),
575 ty.as_mut_ptr(),
576 );
577 (tx.assume_init(), ty.assume_init())
578 }
579 }
580
581 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
582 #[allow(deprecated)]
583 #[doc(alias = "gtk_tree_view_create_row_drag_icon")]
584 fn create_row_drag_icon(&self, path: &TreePath) -> Option<gdk::Paintable> {
585 unsafe {
586 from_glib_full(ffi::gtk_tree_view_create_row_drag_icon(
587 self.as_ref().to_glib_none().0,
588 mut_override(path.to_glib_none().0),
589 ))
590 }
591 }
592
593 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
594 #[allow(deprecated)]
595 #[doc(alias = "gtk_tree_view_enable_model_drag_dest")]
596 fn enable_model_drag_dest(&self, formats: &gdk::ContentFormats, actions: gdk::DragAction) {
597 unsafe {
598 ffi::gtk_tree_view_enable_model_drag_dest(
599 self.as_ref().to_glib_none().0,
600 formats.to_glib_none().0,
601 actions.into_glib(),
602 );
603 }
604 }
605
606 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
607 #[allow(deprecated)]
608 #[doc(alias = "gtk_tree_view_enable_model_drag_source")]
609 fn enable_model_drag_source(
610 &self,
611 start_button_mask: gdk::ModifierType,
612 formats: &gdk::ContentFormats,
613 actions: gdk::DragAction,
614 ) {
615 unsafe {
616 ffi::gtk_tree_view_enable_model_drag_source(
617 self.as_ref().to_glib_none().0,
618 start_button_mask.into_glib(),
619 formats.to_glib_none().0,
620 actions.into_glib(),
621 );
622 }
623 }
624
625 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
626 #[allow(deprecated)]
627 #[doc(alias = "gtk_tree_view_expand_all")]
628 fn expand_all(&self) {
629 unsafe {
630 ffi::gtk_tree_view_expand_all(self.as_ref().to_glib_none().0);
631 }
632 }
633
634 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
635 #[allow(deprecated)]
636 #[doc(alias = "gtk_tree_view_expand_row")]
637 fn expand_row(&self, path: &TreePath, open_all: bool) -> bool {
638 unsafe {
639 from_glib(ffi::gtk_tree_view_expand_row(
640 self.as_ref().to_glib_none().0,
641 mut_override(path.to_glib_none().0),
642 open_all.into_glib(),
643 ))
644 }
645 }
646
647 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
648 #[allow(deprecated)]
649 #[doc(alias = "gtk_tree_view_expand_to_path")]
650 fn expand_to_path(&self, path: &TreePath) {
651 unsafe {
652 ffi::gtk_tree_view_expand_to_path(
653 self.as_ref().to_glib_none().0,
654 mut_override(path.to_glib_none().0),
655 );
656 }
657 }
658
659 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
660 #[allow(deprecated)]
661 #[doc(alias = "gtk_tree_view_get_activate_on_single_click")]
662 #[doc(alias = "get_activate_on_single_click")]
663 #[doc(alias = "activate-on-single-click")]
664 fn activates_on_single_click(&self) -> bool {
665 unsafe {
666 from_glib(ffi::gtk_tree_view_get_activate_on_single_click(
667 self.as_ref().to_glib_none().0,
668 ))
669 }
670 }
671
672 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
673 #[allow(deprecated)]
674 #[doc(alias = "gtk_tree_view_get_background_area")]
675 #[doc(alias = "get_background_area")]
676 fn background_area(
677 &self,
678 path: Option<&TreePath>,
679 column: Option<&TreeViewColumn>,
680 ) -> gdk::Rectangle {
681 unsafe {
682 let mut rect = gdk::Rectangle::uninitialized();
683 ffi::gtk_tree_view_get_background_area(
684 self.as_ref().to_glib_none().0,
685 mut_override(path.to_glib_none().0),
686 column.to_glib_none().0,
687 rect.to_glib_none_mut().0,
688 );
689 rect
690 }
691 }
692
693 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
694 #[allow(deprecated)]
695 #[doc(alias = "gtk_tree_view_get_cell_area")]
696 #[doc(alias = "get_cell_area")]
697 fn cell_area(
698 &self,
699 path: Option<&TreePath>,
700 column: Option<&TreeViewColumn>,
701 ) -> gdk::Rectangle {
702 unsafe {
703 let mut rect = gdk::Rectangle::uninitialized();
704 ffi::gtk_tree_view_get_cell_area(
705 self.as_ref().to_glib_none().0,
706 mut_override(path.to_glib_none().0),
707 column.to_glib_none().0,
708 rect.to_glib_none_mut().0,
709 );
710 rect
711 }
712 }
713
714 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
715 #[allow(deprecated)]
716 #[doc(alias = "gtk_tree_view_get_column")]
717 #[doc(alias = "get_column")]
718 fn column(&self, n: i32) -> Option<TreeViewColumn> {
719 unsafe {
720 from_glib_none(ffi::gtk_tree_view_get_column(
721 self.as_ref().to_glib_none().0,
722 n,
723 ))
724 }
725 }
726
727 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
728 #[allow(deprecated)]
729 #[doc(alias = "gtk_tree_view_get_columns")]
730 #[doc(alias = "get_columns")]
731 fn columns(&self) -> Vec<TreeViewColumn> {
732 unsafe {
733 FromGlibPtrContainer::from_glib_container(ffi::gtk_tree_view_get_columns(
734 self.as_ref().to_glib_none().0,
735 ))
736 }
737 }
738
739 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
740 #[allow(deprecated)]
741 #[doc(alias = "gtk_tree_view_get_cursor")]
742 #[doc(alias = "get_cursor")]
743 fn cursor(&self) -> (Option<TreePath>, Option<TreeViewColumn>) {
744 unsafe {
745 let mut path = std::ptr::null_mut();
746 let mut focus_column = std::ptr::null_mut();
747 ffi::gtk_tree_view_get_cursor(
748 self.as_ref().to_glib_none().0,
749 &mut path,
750 &mut focus_column,
751 );
752 (from_glib_full(path), from_glib_none(focus_column))
753 }
754 }
755
756 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
757 #[allow(deprecated)]
758 #[doc(alias = "gtk_tree_view_get_dest_row_at_pos")]
759 #[doc(alias = "get_dest_row_at_pos")]
760 fn dest_row_at_pos(
761 &self,
762 drag_x: i32,
763 drag_y: i32,
764 ) -> Option<(Option<TreePath>, TreeViewDropPosition)> {
765 unsafe {
766 let mut path = std::ptr::null_mut();
767 let mut pos = std::mem::MaybeUninit::uninit();
768 let ret = from_glib(ffi::gtk_tree_view_get_dest_row_at_pos(
769 self.as_ref().to_glib_none().0,
770 drag_x,
771 drag_y,
772 &mut path,
773 pos.as_mut_ptr(),
774 ));
775 if ret {
776 Some((from_glib_full(path), from_glib(pos.assume_init())))
777 } else {
778 None
779 }
780 }
781 }
782
783 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
784 #[allow(deprecated)]
785 #[doc(alias = "gtk_tree_view_get_drag_dest_row")]
786 #[doc(alias = "get_drag_dest_row")]
787 fn drag_dest_row(&self) -> (Option<TreePath>, TreeViewDropPosition) {
788 unsafe {
789 let mut path = std::ptr::null_mut();
790 let mut pos = std::mem::MaybeUninit::uninit();
791 ffi::gtk_tree_view_get_drag_dest_row(
792 self.as_ref().to_glib_none().0,
793 &mut path,
794 pos.as_mut_ptr(),
795 );
796 (from_glib_full(path), from_glib(pos.assume_init()))
797 }
798 }
799
800 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
801 #[allow(deprecated)]
802 #[doc(alias = "gtk_tree_view_get_enable_search")]
803 #[doc(alias = "get_enable_search")]
804 #[doc(alias = "enable-search")]
805 fn enables_search(&self) -> bool {
806 unsafe {
807 from_glib(ffi::gtk_tree_view_get_enable_search(
808 self.as_ref().to_glib_none().0,
809 ))
810 }
811 }
812
813 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
814 #[allow(deprecated)]
815 #[doc(alias = "gtk_tree_view_get_enable_tree_lines")]
816 #[doc(alias = "get_enable_tree_lines")]
817 #[doc(alias = "enable-tree-lines")]
818 fn enables_tree_lines(&self) -> bool {
819 unsafe {
820 from_glib(ffi::gtk_tree_view_get_enable_tree_lines(
821 self.as_ref().to_glib_none().0,
822 ))
823 }
824 }
825
826 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
827 #[allow(deprecated)]
828 #[doc(alias = "gtk_tree_view_get_expander_column")]
829 #[doc(alias = "get_expander_column")]
830 #[doc(alias = "expander-column")]
831 fn expander_column(&self) -> Option<TreeViewColumn> {
832 unsafe {
833 from_glib_none(ffi::gtk_tree_view_get_expander_column(
834 self.as_ref().to_glib_none().0,
835 ))
836 }
837 }
838
839 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
840 #[allow(deprecated)]
841 #[doc(alias = "gtk_tree_view_get_fixed_height_mode")]
842 #[doc(alias = "get_fixed_height_mode")]
843 #[doc(alias = "fixed-height-mode")]
844 fn is_fixed_height_mode(&self) -> bool {
845 unsafe {
846 from_glib(ffi::gtk_tree_view_get_fixed_height_mode(
847 self.as_ref().to_glib_none().0,
848 ))
849 }
850 }
851
852 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
853 #[allow(deprecated)]
854 #[doc(alias = "gtk_tree_view_get_grid_lines")]
855 #[doc(alias = "get_grid_lines")]
856 fn grid_lines(&self) -> TreeViewGridLines {
857 unsafe {
858 from_glib(ffi::gtk_tree_view_get_grid_lines(
859 self.as_ref().to_glib_none().0,
860 ))
861 }
862 }
863
864 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
865 #[allow(deprecated)]
866 #[doc(alias = "gtk_tree_view_get_headers_clickable")]
867 #[doc(alias = "get_headers_clickable")]
868 #[doc(alias = "headers-clickable")]
869 fn is_headers_clickable(&self) -> bool {
870 unsafe {
871 from_glib(ffi::gtk_tree_view_get_headers_clickable(
872 self.as_ref().to_glib_none().0,
873 ))
874 }
875 }
876
877 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
878 #[allow(deprecated)]
879 #[doc(alias = "gtk_tree_view_get_headers_visible")]
880 #[doc(alias = "get_headers_visible")]
881 #[doc(alias = "headers-visible")]
882 fn is_headers_visible(&self) -> bool {
883 unsafe {
884 from_glib(ffi::gtk_tree_view_get_headers_visible(
885 self.as_ref().to_glib_none().0,
886 ))
887 }
888 }
889
890 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
891 #[allow(deprecated)]
892 #[doc(alias = "gtk_tree_view_get_hover_expand")]
893 #[doc(alias = "get_hover_expand")]
894 #[doc(alias = "hover-expand")]
895 fn hover_expands(&self) -> bool {
896 unsafe {
897 from_glib(ffi::gtk_tree_view_get_hover_expand(
898 self.as_ref().to_glib_none().0,
899 ))
900 }
901 }
902
903 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
904 #[allow(deprecated)]
905 #[doc(alias = "gtk_tree_view_get_hover_selection")]
906 #[doc(alias = "get_hover_selection")]
907 #[doc(alias = "hover-selection")]
908 fn is_hover_selection(&self) -> bool {
909 unsafe {
910 from_glib(ffi::gtk_tree_view_get_hover_selection(
911 self.as_ref().to_glib_none().0,
912 ))
913 }
914 }
915
916 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
917 #[allow(deprecated)]
918 #[doc(alias = "gtk_tree_view_get_level_indentation")]
919 #[doc(alias = "get_level_indentation")]
920 #[doc(alias = "level-indentation")]
921 fn level_indentation(&self) -> i32 {
922 unsafe { ffi::gtk_tree_view_get_level_indentation(self.as_ref().to_glib_none().0) }
923 }
924
925 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
926 #[allow(deprecated)]
927 #[doc(alias = "gtk_tree_view_get_model")]
928 #[doc(alias = "get_model")]
929 fn model(&self) -> Option<TreeModel> {
930 unsafe { from_glib_none(ffi::gtk_tree_view_get_model(self.as_ref().to_glib_none().0)) }
931 }
932
933 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
934 #[allow(deprecated)]
935 #[doc(alias = "gtk_tree_view_get_n_columns")]
936 #[doc(alias = "get_n_columns")]
937 fn n_columns(&self) -> u32 {
938 unsafe { ffi::gtk_tree_view_get_n_columns(self.as_ref().to_glib_none().0) }
939 }
940
941 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
942 #[allow(deprecated)]
943 #[doc(alias = "gtk_tree_view_get_path_at_pos")]
944 #[doc(alias = "get_path_at_pos")]
945 fn path_at_pos(
946 &self,
947 x: i32,
948 y: i32,
949 ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)> {
950 unsafe {
951 let mut path = std::ptr::null_mut();
952 let mut column = std::ptr::null_mut();
953 let mut cell_x = std::mem::MaybeUninit::uninit();
954 let mut cell_y = std::mem::MaybeUninit::uninit();
955 let ret = from_glib(ffi::gtk_tree_view_get_path_at_pos(
956 self.as_ref().to_glib_none().0,
957 x,
958 y,
959 &mut path,
960 &mut column,
961 cell_x.as_mut_ptr(),
962 cell_y.as_mut_ptr(),
963 ));
964 if ret {
965 Some((
966 from_glib_full(path),
967 from_glib_none(column),
968 cell_x.assume_init(),
969 cell_y.assume_init(),
970 ))
971 } else {
972 None
973 }
974 }
975 }
976
977 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
978 #[allow(deprecated)]
979 #[doc(alias = "gtk_tree_view_get_reorderable")]
980 #[doc(alias = "get_reorderable")]
981 #[doc(alias = "reorderable")]
982 fn is_reorderable(&self) -> bool {
983 unsafe {
984 from_glib(ffi::gtk_tree_view_get_reorderable(
985 self.as_ref().to_glib_none().0,
986 ))
987 }
988 }
989
990 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
991 #[allow(deprecated)]
992 #[doc(alias = "gtk_tree_view_get_rubber_banding")]
993 #[doc(alias = "get_rubber_banding")]
994 #[doc(alias = "rubber-banding")]
995 fn is_rubber_banding(&self) -> bool {
996 unsafe {
997 from_glib(ffi::gtk_tree_view_get_rubber_banding(
998 self.as_ref().to_glib_none().0,
999 ))
1000 }
1001 }
1002
1003 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1004 #[allow(deprecated)]
1005 #[doc(alias = "gtk_tree_view_get_search_column")]
1006 #[doc(alias = "get_search_column")]
1007 #[doc(alias = "search-column")]
1008 fn search_column(&self) -> i32 {
1009 unsafe { ffi::gtk_tree_view_get_search_column(self.as_ref().to_glib_none().0) }
1010 }
1011
1012 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1013 #[allow(deprecated)]
1014 #[doc(alias = "gtk_tree_view_get_search_entry")]
1015 #[doc(alias = "get_search_entry")]
1016 fn search_entry(&self) -> Option<Editable> {
1017 unsafe {
1018 from_glib_none(ffi::gtk_tree_view_get_search_entry(
1019 self.as_ref().to_glib_none().0,
1020 ))
1021 }
1022 }
1023
1024 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1025 #[allow(deprecated)]
1026 #[doc(alias = "gtk_tree_view_get_selection")]
1027 #[doc(alias = "get_selection")]
1028 fn selection(&self) -> TreeSelection {
1029 unsafe {
1030 from_glib_none(ffi::gtk_tree_view_get_selection(
1031 self.as_ref().to_glib_none().0,
1032 ))
1033 }
1034 }
1035
1036 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1037 #[allow(deprecated)]
1038 #[doc(alias = "gtk_tree_view_get_show_expanders")]
1039 #[doc(alias = "get_show_expanders")]
1040 #[doc(alias = "show-expanders")]
1041 fn shows_expanders(&self) -> bool {
1042 unsafe {
1043 from_glib(ffi::gtk_tree_view_get_show_expanders(
1044 self.as_ref().to_glib_none().0,
1045 ))
1046 }
1047 }
1048
1049 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1050 #[allow(deprecated)]
1051 #[doc(alias = "gtk_tree_view_get_tooltip_column")]
1052 #[doc(alias = "get_tooltip_column")]
1053 #[doc(alias = "tooltip-column")]
1054 fn tooltip_column(&self) -> i32 {
1055 unsafe { ffi::gtk_tree_view_get_tooltip_column(self.as_ref().to_glib_none().0) }
1056 }
1057
1058 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1059 #[allow(deprecated)]
1060 #[doc(alias = "gtk_tree_view_get_tooltip_context")]
1061 #[doc(alias = "get_tooltip_context")]
1062 fn tooltip_context(
1063 &self,
1064 x: i32,
1065 y: i32,
1066 keyboard_tip: bool,
1067 ) -> Option<(Option<TreeModel>, TreePath, TreeIter)> {
1068 unsafe {
1069 let mut model = std::ptr::null_mut();
1070 let mut path = std::ptr::null_mut();
1071 let mut iter = TreeIter::uninitialized();
1072 let ret = from_glib(ffi::gtk_tree_view_get_tooltip_context(
1073 self.as_ref().to_glib_none().0,
1074 x,
1075 y,
1076 keyboard_tip.into_glib(),
1077 &mut model,
1078 &mut path,
1079 iter.to_glib_none_mut().0,
1080 ));
1081 if ret {
1082 Some((from_glib_none(model), from_glib_full(path), iter))
1083 } else {
1084 None
1085 }
1086 }
1087 }
1088
1089 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1090 #[allow(deprecated)]
1091 #[doc(alias = "gtk_tree_view_get_visible_range")]
1092 #[doc(alias = "get_visible_range")]
1093 fn visible_range(&self) -> Option<(TreePath, TreePath)> {
1094 unsafe {
1095 let mut start_path = std::ptr::null_mut();
1096 let mut end_path = std::ptr::null_mut();
1097 let ret = from_glib(ffi::gtk_tree_view_get_visible_range(
1098 self.as_ref().to_glib_none().0,
1099 &mut start_path,
1100 &mut end_path,
1101 ));
1102 if ret {
1103 Some((from_glib_full(start_path), from_glib_full(end_path)))
1104 } else {
1105 None
1106 }
1107 }
1108 }
1109
1110 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1111 #[allow(deprecated)]
1112 #[doc(alias = "gtk_tree_view_get_visible_rect")]
1113 #[doc(alias = "get_visible_rect")]
1114 fn visible_rect(&self) -> gdk::Rectangle {
1115 unsafe {
1116 let mut visible_rect = gdk::Rectangle::uninitialized();
1117 ffi::gtk_tree_view_get_visible_rect(
1118 self.as_ref().to_glib_none().0,
1119 visible_rect.to_glib_none_mut().0,
1120 );
1121 visible_rect
1122 }
1123 }
1124
1125 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1126 #[allow(deprecated)]
1127 #[doc(alias = "gtk_tree_view_insert_column")]
1128 fn insert_column(&self, column: &TreeViewColumn, position: i32) -> i32 {
1129 unsafe {
1130 ffi::gtk_tree_view_insert_column(
1131 self.as_ref().to_glib_none().0,
1132 column.to_glib_none().0,
1133 position,
1134 )
1135 }
1136 }
1137
1138 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1139 #[allow(deprecated)]
1140 #[doc(alias = "gtk_tree_view_insert_column_with_data_func")]
1141 fn insert_column_with_data_func<
1142 P: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static,
1143 >(
1144 &self,
1145 position: i32,
1146 title: &str,
1147 cell: &impl IsA<CellRenderer>,
1148 func: P,
1149 ) -> i32 {
1150 let func_data: Box_<P> = Box_::new(func);
1151 unsafe extern "C" fn func_func<
1152 P: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static,
1153 >(
1154 tree_column: *mut ffi::GtkTreeViewColumn,
1155 cell: *mut ffi::GtkCellRenderer,
1156 tree_model: *mut ffi::GtkTreeModel,
1157 iter: *mut ffi::GtkTreeIter,
1158 data: glib::ffi::gpointer,
1159 ) {
1160 let tree_column = from_glib_borrow(tree_column);
1161 let cell = from_glib_borrow(cell);
1162 let tree_model = from_glib_borrow(tree_model);
1163 let iter = from_glib_borrow(iter);
1164 let callback = &*(data as *mut P);
1165 (*callback)(&tree_column, &cell, &tree_model, &iter)
1166 }
1167 let func = Some(func_func::<P> as _);
1168 unsafe extern "C" fn dnotify_func<
1169 P: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static,
1170 >(
1171 data: glib::ffi::gpointer,
1172 ) {
1173 let _callback = Box_::from_raw(data as *mut P);
1174 }
1175 let destroy_call6 = Some(dnotify_func::<P> as _);
1176 let super_callback0: Box_<P> = func_data;
1177 unsafe {
1178 ffi::gtk_tree_view_insert_column_with_data_func(
1179 self.as_ref().to_glib_none().0,
1180 position,
1181 title.to_glib_none().0,
1182 cell.as_ref().to_glib_none().0,
1183 func,
1184 Box_::into_raw(super_callback0) as *mut _,
1185 destroy_call6,
1186 )
1187 }
1188 }
1189
1190 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1191 #[allow(deprecated)]
1192 #[doc(alias = "gtk_tree_view_is_blank_at_pos")]
1193 fn is_blank_at_pos(
1194 &self,
1195 x: i32,
1196 y: i32,
1197 ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)> {
1198 unsafe {
1199 let mut path = std::ptr::null_mut();
1200 let mut column = std::ptr::null_mut();
1201 let mut cell_x = std::mem::MaybeUninit::uninit();
1202 let mut cell_y = std::mem::MaybeUninit::uninit();
1203 let ret = from_glib(ffi::gtk_tree_view_is_blank_at_pos(
1204 self.as_ref().to_glib_none().0,
1205 x,
1206 y,
1207 &mut path,
1208 &mut column,
1209 cell_x.as_mut_ptr(),
1210 cell_y.as_mut_ptr(),
1211 ));
1212 if ret {
1213 Some((
1214 from_glib_full(path),
1215 from_glib_none(column),
1216 cell_x.assume_init(),
1217 cell_y.assume_init(),
1218 ))
1219 } else {
1220 None
1221 }
1222 }
1223 }
1224
1225 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1226 #[allow(deprecated)]
1227 #[doc(alias = "gtk_tree_view_is_rubber_banding_active")]
1228 fn is_rubber_banding_active(&self) -> bool {
1229 unsafe {
1230 from_glib(ffi::gtk_tree_view_is_rubber_banding_active(
1231 self.as_ref().to_glib_none().0,
1232 ))
1233 }
1234 }
1235
1236 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1237 #[allow(deprecated)]
1238 #[doc(alias = "gtk_tree_view_map_expanded_rows")]
1239 fn map_expanded_rows<P: FnMut(&TreeView, &TreePath)>(&self, func: P) {
1240 let mut func_data: P = func;
1241 unsafe extern "C" fn func_func<P: FnMut(&TreeView, &TreePath)>(
1242 tree_view: *mut ffi::GtkTreeView,
1243 path: *mut ffi::GtkTreePath,
1244 user_data: glib::ffi::gpointer,
1245 ) {
1246 let tree_view = from_glib_borrow(tree_view);
1247 let path = from_glib_borrow(path);
1248 let callback = user_data as *mut P;
1249 (*callback)(&tree_view, &path)
1250 }
1251 let func = Some(func_func::<P> as _);
1252 let super_callback0: &mut P = &mut func_data;
1253 unsafe {
1254 ffi::gtk_tree_view_map_expanded_rows(
1255 self.as_ref().to_glib_none().0,
1256 func,
1257 super_callback0 as *mut _ as *mut _,
1258 );
1259 }
1260 }
1261
1262 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1263 #[allow(deprecated)]
1264 #[doc(alias = "gtk_tree_view_move_column_after")]
1265 fn move_column_after(&self, column: &TreeViewColumn, base_column: Option<&TreeViewColumn>) {
1266 unsafe {
1267 ffi::gtk_tree_view_move_column_after(
1268 self.as_ref().to_glib_none().0,
1269 column.to_glib_none().0,
1270 base_column.to_glib_none().0,
1271 );
1272 }
1273 }
1274
1275 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1276 #[allow(deprecated)]
1277 #[doc(alias = "gtk_tree_view_remove_column")]
1278 fn remove_column(&self, column: &TreeViewColumn) -> i32 {
1279 unsafe {
1280 ffi::gtk_tree_view_remove_column(
1281 self.as_ref().to_glib_none().0,
1282 column.to_glib_none().0,
1283 )
1284 }
1285 }
1286
1287 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1288 #[allow(deprecated)]
1289 #[doc(alias = "gtk_tree_view_row_activated")]
1290 fn row_activated(&self, path: &TreePath, column: Option<&TreeViewColumn>) {
1291 unsafe {
1292 ffi::gtk_tree_view_row_activated(
1293 self.as_ref().to_glib_none().0,
1294 mut_override(path.to_glib_none().0),
1295 column.to_glib_none().0,
1296 );
1297 }
1298 }
1299
1300 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1301 #[allow(deprecated)]
1302 #[doc(alias = "gtk_tree_view_row_expanded")]
1303 fn row_expanded(&self, path: &TreePath) -> bool {
1304 unsafe {
1305 from_glib(ffi::gtk_tree_view_row_expanded(
1306 self.as_ref().to_glib_none().0,
1307 mut_override(path.to_glib_none().0),
1308 ))
1309 }
1310 }
1311
1312 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1313 #[allow(deprecated)]
1314 #[doc(alias = "gtk_tree_view_scroll_to_cell")]
1315 fn scroll_to_cell(
1316 &self,
1317 path: Option<&TreePath>,
1318 column: Option<&TreeViewColumn>,
1319 use_align: bool,
1320 row_align: f32,
1321 col_align: f32,
1322 ) {
1323 unsafe {
1324 ffi::gtk_tree_view_scroll_to_cell(
1325 self.as_ref().to_glib_none().0,
1326 mut_override(path.to_glib_none().0),
1327 column.to_glib_none().0,
1328 use_align.into_glib(),
1329 row_align,
1330 col_align,
1331 );
1332 }
1333 }
1334
1335 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1336 #[allow(deprecated)]
1337 #[doc(alias = "gtk_tree_view_scroll_to_point")]
1338 fn scroll_to_point(&self, tree_x: i32, tree_y: i32) {
1339 unsafe {
1340 ffi::gtk_tree_view_scroll_to_point(self.as_ref().to_glib_none().0, tree_x, tree_y);
1341 }
1342 }
1343
1344 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1345 #[allow(deprecated)]
1346 #[doc(alias = "gtk_tree_view_set_activate_on_single_click")]
1347 #[doc(alias = "activate-on-single-click")]
1348 fn set_activate_on_single_click(&self, single: bool) {
1349 unsafe {
1350 ffi::gtk_tree_view_set_activate_on_single_click(
1351 self.as_ref().to_glib_none().0,
1352 single.into_glib(),
1353 );
1354 }
1355 }
1356
1357 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1358 #[allow(deprecated)]
1359 #[doc(alias = "gtk_tree_view_set_column_drag_function")]
1360 fn set_column_drag_function(
1361 &self,
1362 func: Option<
1363 Box_<
1364 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool
1365 + 'static,
1366 >,
1367 >,
1368 ) {
1369 let func_data: Box_<
1370 Option<
1371 Box_<
1372 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool
1373 + 'static,
1374 >,
1375 >,
1376 > = Box_::new(func);
1377 unsafe extern "C" fn func_func(
1378 tree_view: *mut ffi::GtkTreeView,
1379 column: *mut ffi::GtkTreeViewColumn,
1380 prev_column: *mut ffi::GtkTreeViewColumn,
1381 next_column: *mut ffi::GtkTreeViewColumn,
1382 data: glib::ffi::gpointer,
1383 ) -> glib::ffi::gboolean {
1384 let tree_view = from_glib_borrow(tree_view);
1385 let column = from_glib_borrow(column);
1386 let prev_column = from_glib_borrow(prev_column);
1387 let next_column = from_glib_borrow(next_column);
1388 let callback = &*(data as *mut Option<
1389 Box_<
1390 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool
1391 + 'static,
1392 >,
1393 >);
1394 if let Some(ref callback) = *callback {
1395 callback(&tree_view, &column, &prev_column, &next_column)
1396 } else {
1397 panic!("cannot get closure...")
1398 }
1399 .into_glib()
1400 }
1401 let func = if func_data.is_some() {
1402 Some(func_func as _)
1403 } else {
1404 None
1405 };
1406 unsafe extern "C" fn destroy_func(data: glib::ffi::gpointer) {
1407 let _callback = Box_::from_raw(
1408 data as *mut Option<
1409 Box_<
1410 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool
1411 + 'static,
1412 >,
1413 >,
1414 );
1415 }
1416 let destroy_call3 = Some(destroy_func as _);
1417 let super_callback0: Box_<
1418 Option<
1419 Box_<
1420 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool
1421 + 'static,
1422 >,
1423 >,
1424 > = func_data;
1425 unsafe {
1426 ffi::gtk_tree_view_set_column_drag_function(
1427 self.as_ref().to_glib_none().0,
1428 func,
1429 Box_::into_raw(super_callback0) as *mut _,
1430 destroy_call3,
1431 );
1432 }
1433 }
1434
1435 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1436 #[allow(deprecated)]
1437 #[doc(alias = "gtk_tree_view_set_cursor")]
1438 fn set_cursor(
1439 &self,
1440 path: &TreePath,
1441 focus_column: Option<&TreeViewColumn>,
1442 start_editing: bool,
1443 ) {
1444 unsafe {
1445 ffi::gtk_tree_view_set_cursor(
1446 self.as_ref().to_glib_none().0,
1447 mut_override(path.to_glib_none().0),
1448 focus_column.to_glib_none().0,
1449 start_editing.into_glib(),
1450 );
1451 }
1452 }
1453
1454 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1455 #[allow(deprecated)]
1456 #[doc(alias = "gtk_tree_view_set_cursor_on_cell")]
1457 fn set_cursor_on_cell(
1458 &self,
1459 path: &TreePath,
1460 focus_column: Option<&TreeViewColumn>,
1461 focus_cell: Option<&impl IsA<CellRenderer>>,
1462 start_editing: bool,
1463 ) {
1464 unsafe {
1465 ffi::gtk_tree_view_set_cursor_on_cell(
1466 self.as_ref().to_glib_none().0,
1467 mut_override(path.to_glib_none().0),
1468 focus_column.to_glib_none().0,
1469 focus_cell.map(|p| p.as_ref()).to_glib_none().0,
1470 start_editing.into_glib(),
1471 );
1472 }
1473 }
1474
1475 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1476 #[allow(deprecated)]
1477 #[doc(alias = "gtk_tree_view_set_drag_dest_row")]
1478 fn set_drag_dest_row(&self, path: Option<&TreePath>, pos: TreeViewDropPosition) {
1479 unsafe {
1480 ffi::gtk_tree_view_set_drag_dest_row(
1481 self.as_ref().to_glib_none().0,
1482 mut_override(path.to_glib_none().0),
1483 pos.into_glib(),
1484 );
1485 }
1486 }
1487
1488 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1489 #[allow(deprecated)]
1490 #[doc(alias = "gtk_tree_view_set_enable_search")]
1491 #[doc(alias = "enable-search")]
1492 fn set_enable_search(&self, enable_search: bool) {
1493 unsafe {
1494 ffi::gtk_tree_view_set_enable_search(
1495 self.as_ref().to_glib_none().0,
1496 enable_search.into_glib(),
1497 );
1498 }
1499 }
1500
1501 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1502 #[allow(deprecated)]
1503 #[doc(alias = "gtk_tree_view_set_enable_tree_lines")]
1504 #[doc(alias = "enable-tree-lines")]
1505 fn set_enable_tree_lines(&self, enabled: bool) {
1506 unsafe {
1507 ffi::gtk_tree_view_set_enable_tree_lines(
1508 self.as_ref().to_glib_none().0,
1509 enabled.into_glib(),
1510 );
1511 }
1512 }
1513
1514 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1515 #[allow(deprecated)]
1516 #[doc(alias = "gtk_tree_view_set_expander_column")]
1517 #[doc(alias = "expander-column")]
1518 fn set_expander_column(&self, column: Option<&TreeViewColumn>) {
1519 unsafe {
1520 ffi::gtk_tree_view_set_expander_column(
1521 self.as_ref().to_glib_none().0,
1522 column.to_glib_none().0,
1523 );
1524 }
1525 }
1526
1527 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1528 #[allow(deprecated)]
1529 #[doc(alias = "gtk_tree_view_set_fixed_height_mode")]
1530 #[doc(alias = "fixed-height-mode")]
1531 fn set_fixed_height_mode(&self, enable: bool) {
1532 unsafe {
1533 ffi::gtk_tree_view_set_fixed_height_mode(
1534 self.as_ref().to_glib_none().0,
1535 enable.into_glib(),
1536 );
1537 }
1538 }
1539
1540 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1541 #[allow(deprecated)]
1542 #[doc(alias = "gtk_tree_view_set_grid_lines")]
1543 fn set_grid_lines(&self, grid_lines: TreeViewGridLines) {
1544 unsafe {
1545 ffi::gtk_tree_view_set_grid_lines(
1546 self.as_ref().to_glib_none().0,
1547 grid_lines.into_glib(),
1548 );
1549 }
1550 }
1551
1552 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1553 #[allow(deprecated)]
1554 #[doc(alias = "gtk_tree_view_set_headers_clickable")]
1555 #[doc(alias = "headers-clickable")]
1556 fn set_headers_clickable(&self, setting: bool) {
1557 unsafe {
1558 ffi::gtk_tree_view_set_headers_clickable(
1559 self.as_ref().to_glib_none().0,
1560 setting.into_glib(),
1561 );
1562 }
1563 }
1564
1565 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1566 #[allow(deprecated)]
1567 #[doc(alias = "gtk_tree_view_set_headers_visible")]
1568 #[doc(alias = "headers-visible")]
1569 fn set_headers_visible(&self, headers_visible: bool) {
1570 unsafe {
1571 ffi::gtk_tree_view_set_headers_visible(
1572 self.as_ref().to_glib_none().0,
1573 headers_visible.into_glib(),
1574 );
1575 }
1576 }
1577
1578 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1579 #[allow(deprecated)]
1580 #[doc(alias = "gtk_tree_view_set_hover_expand")]
1581 #[doc(alias = "hover-expand")]
1582 fn set_hover_expand(&self, expand: bool) {
1583 unsafe {
1584 ffi::gtk_tree_view_set_hover_expand(self.as_ref().to_glib_none().0, expand.into_glib());
1585 }
1586 }
1587
1588 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1589 #[allow(deprecated)]
1590 #[doc(alias = "gtk_tree_view_set_hover_selection")]
1591 #[doc(alias = "hover-selection")]
1592 fn set_hover_selection(&self, hover: bool) {
1593 unsafe {
1594 ffi::gtk_tree_view_set_hover_selection(
1595 self.as_ref().to_glib_none().0,
1596 hover.into_glib(),
1597 );
1598 }
1599 }
1600
1601 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1602 #[allow(deprecated)]
1603 #[doc(alias = "gtk_tree_view_set_level_indentation")]
1604 #[doc(alias = "level-indentation")]
1605 fn set_level_indentation(&self, indentation: i32) {
1606 unsafe {
1607 ffi::gtk_tree_view_set_level_indentation(self.as_ref().to_glib_none().0, indentation);
1608 }
1609 }
1610
1611 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1612 #[allow(deprecated)]
1613 #[doc(alias = "gtk_tree_view_set_model")]
1614 #[doc(alias = "model")]
1615 fn set_model(&self, model: Option<&impl IsA<TreeModel>>) {
1616 unsafe {
1617 ffi::gtk_tree_view_set_model(
1618 self.as_ref().to_glib_none().0,
1619 model.map(|p| p.as_ref()).to_glib_none().0,
1620 );
1621 }
1622 }
1623
1624 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1625 #[allow(deprecated)]
1626 #[doc(alias = "gtk_tree_view_set_reorderable")]
1627 #[doc(alias = "reorderable")]
1628 fn set_reorderable(&self, reorderable: bool) {
1629 unsafe {
1630 ffi::gtk_tree_view_set_reorderable(
1631 self.as_ref().to_glib_none().0,
1632 reorderable.into_glib(),
1633 );
1634 }
1635 }
1636
1637 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1638 #[allow(deprecated)]
1639 #[doc(alias = "gtk_tree_view_set_row_separator_func")]
1640 fn set_row_separator_func<P: Fn(&TreeModel, &TreeIter) -> bool + 'static>(&self, func: P) {
1641 let func_data: Box_<P> = Box_::new(func);
1642 unsafe extern "C" fn func_func<P: Fn(&TreeModel, &TreeIter) -> bool + 'static>(
1643 model: *mut ffi::GtkTreeModel,
1644 iter: *mut ffi::GtkTreeIter,
1645 data: glib::ffi::gpointer,
1646 ) -> glib::ffi::gboolean {
1647 let model = from_glib_borrow(model);
1648 let iter = from_glib_borrow(iter);
1649 let callback = &*(data as *mut P);
1650 (*callback)(&model, &iter).into_glib()
1651 }
1652 let func = Some(func_func::<P> as _);
1653 unsafe extern "C" fn destroy_func<P: Fn(&TreeModel, &TreeIter) -> bool + 'static>(
1654 data: glib::ffi::gpointer,
1655 ) {
1656 let _callback = Box_::from_raw(data as *mut P);
1657 }
1658 let destroy_call3 = Some(destroy_func::<P> as _);
1659 let super_callback0: Box_<P> = func_data;
1660 unsafe {
1661 ffi::gtk_tree_view_set_row_separator_func(
1662 self.as_ref().to_glib_none().0,
1663 func,
1664 Box_::into_raw(super_callback0) as *mut _,
1665 destroy_call3,
1666 );
1667 }
1668 }
1669
1670 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1671 #[allow(deprecated)]
1672 #[doc(alias = "gtk_tree_view_set_rubber_banding")]
1673 #[doc(alias = "rubber-banding")]
1674 fn set_rubber_banding(&self, enable: bool) {
1675 unsafe {
1676 ffi::gtk_tree_view_set_rubber_banding(
1677 self.as_ref().to_glib_none().0,
1678 enable.into_glib(),
1679 );
1680 }
1681 }
1682
1683 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1684 #[allow(deprecated)]
1685 #[doc(alias = "gtk_tree_view_set_search_column")]
1686 #[doc(alias = "search-column")]
1687 fn set_search_column(&self, column: i32) {
1688 unsafe {
1689 ffi::gtk_tree_view_set_search_column(self.as_ref().to_glib_none().0, column);
1690 }
1691 }
1692
1693 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1694 #[allow(deprecated)]
1695 #[doc(alias = "gtk_tree_view_set_search_entry")]
1696 fn set_search_entry(&self, entry: Option<&impl IsA<Editable>>) {
1697 unsafe {
1698 ffi::gtk_tree_view_set_search_entry(
1699 self.as_ref().to_glib_none().0,
1700 entry.map(|p| p.as_ref()).to_glib_none().0,
1701 );
1702 }
1703 }
1704
1705 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1706 #[allow(deprecated)]
1707 #[doc(alias = "gtk_tree_view_set_search_equal_func")]
1708 fn set_search_equal_func<P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static>(
1709 &self,
1710 search_equal_func: P,
1711 ) {
1712 let search_equal_func_data: Box_<P> = Box_::new(search_equal_func);
1713 unsafe extern "C" fn search_equal_func_func<
1714 P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static,
1715 >(
1716 model: *mut ffi::GtkTreeModel,
1717 column: std::ffi::c_int,
1718 key: *const std::ffi::c_char,
1719 iter: *mut ffi::GtkTreeIter,
1720 search_data: glib::ffi::gpointer,
1721 ) -> glib::ffi::gboolean {
1722 let model = from_glib_borrow(model);
1723 let key: Borrowed<glib::GString> = from_glib_borrow(key);
1724 let iter = from_glib_borrow(iter);
1725 let callback = &*(search_data as *mut P);
1726 (*callback)(&model, column, key.as_str(), &iter).into_glib()
1727 }
1728 let search_equal_func = Some(search_equal_func_func::<P> as _);
1729 unsafe extern "C" fn search_destroy_func<
1730 P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static,
1731 >(
1732 data: glib::ffi::gpointer,
1733 ) {
1734 let _callback = Box_::from_raw(data as *mut P);
1735 }
1736 let destroy_call3 = Some(search_destroy_func::<P> as _);
1737 let super_callback0: Box_<P> = search_equal_func_data;
1738 unsafe {
1739 ffi::gtk_tree_view_set_search_equal_func(
1740 self.as_ref().to_glib_none().0,
1741 search_equal_func,
1742 Box_::into_raw(super_callback0) as *mut _,
1743 destroy_call3,
1744 );
1745 }
1746 }
1747
1748 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1749 #[allow(deprecated)]
1750 #[doc(alias = "gtk_tree_view_set_show_expanders")]
1751 #[doc(alias = "show-expanders")]
1752 fn set_show_expanders(&self, enabled: bool) {
1753 unsafe {
1754 ffi::gtk_tree_view_set_show_expanders(
1755 self.as_ref().to_glib_none().0,
1756 enabled.into_glib(),
1757 );
1758 }
1759 }
1760
1761 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1762 #[allow(deprecated)]
1763 #[doc(alias = "gtk_tree_view_set_tooltip_cell")]
1764 fn set_tooltip_cell(
1765 &self,
1766 tooltip: &Tooltip,
1767 path: Option<&TreePath>,
1768 column: Option<&TreeViewColumn>,
1769 cell: Option<&impl IsA<CellRenderer>>,
1770 ) {
1771 unsafe {
1772 ffi::gtk_tree_view_set_tooltip_cell(
1773 self.as_ref().to_glib_none().0,
1774 tooltip.to_glib_none().0,
1775 mut_override(path.to_glib_none().0),
1776 column.to_glib_none().0,
1777 cell.map(|p| p.as_ref()).to_glib_none().0,
1778 );
1779 }
1780 }
1781
1782 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1783 #[allow(deprecated)]
1784 #[doc(alias = "gtk_tree_view_set_tooltip_column")]
1785 #[doc(alias = "tooltip-column")]
1786 fn set_tooltip_column(&self, column: i32) {
1787 unsafe {
1788 ffi::gtk_tree_view_set_tooltip_column(self.as_ref().to_glib_none().0, column);
1789 }
1790 }
1791
1792 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1793 #[allow(deprecated)]
1794 #[doc(alias = "gtk_tree_view_set_tooltip_row")]
1795 fn set_tooltip_row(&self, tooltip: &Tooltip, path: &TreePath) {
1796 unsafe {
1797 ffi::gtk_tree_view_set_tooltip_row(
1798 self.as_ref().to_glib_none().0,
1799 tooltip.to_glib_none().0,
1800 mut_override(path.to_glib_none().0),
1801 );
1802 }
1803 }
1804
1805 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1806 #[allow(deprecated)]
1807 #[doc(alias = "gtk_tree_view_unset_rows_drag_dest")]
1808 fn unset_rows_drag_dest(&self) {
1809 unsafe {
1810 ffi::gtk_tree_view_unset_rows_drag_dest(self.as_ref().to_glib_none().0);
1811 }
1812 }
1813
1814 #[cfg_attr(feature = "v4_10", deprecated = "Since 4.10")]
1815 #[allow(deprecated)]
1816 #[doc(alias = "gtk_tree_view_unset_rows_drag_source")]
1817 fn unset_rows_drag_source(&self) {
1818 unsafe {
1819 ffi::gtk_tree_view_unset_rows_drag_source(self.as_ref().to_glib_none().0);
1820 }
1821 }
1822
1823 #[doc(alias = "enable-grid-lines")]
1824 fn enable_grid_lines(&self) -> TreeViewGridLines {
1825 ObjectExt::property(self.as_ref(), "enable-grid-lines")
1826 }
1827
1828 #[doc(alias = "enable-grid-lines")]
1829 fn set_enable_grid_lines(&self, enable_grid_lines: TreeViewGridLines) {
1830 ObjectExt::set_property(self.as_ref(), "enable-grid-lines", enable_grid_lines)
1831 }
1832
1833 #[doc(alias = "columns-changed")]
1834 fn connect_columns_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1835 unsafe extern "C" fn columns_changed_trampoline<P: IsA<TreeView>, F: Fn(&P) + 'static>(
1836 this: *mut ffi::GtkTreeView,
1837 f: glib::ffi::gpointer,
1838 ) {
1839 let f: &F = &*(f as *const F);
1840 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
1841 }
1842 unsafe {
1843 let f: Box_<F> = Box_::new(f);
1844 connect_raw(
1845 self.as_ptr() as *mut _,
1846 c"columns-changed".as_ptr() as *const _,
1847 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1848 columns_changed_trampoline::<Self, F> as *const (),
1849 )),
1850 Box_::into_raw(f),
1851 )
1852 }
1853 }
1854
1855 #[doc(alias = "cursor-changed")]
1856 fn connect_cursor_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1857 unsafe extern "C" fn cursor_changed_trampoline<P: IsA<TreeView>, F: Fn(&P) + 'static>(
1858 this: *mut ffi::GtkTreeView,
1859 f: glib::ffi::gpointer,
1860 ) {
1861 let f: &F = &*(f as *const F);
1862 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
1863 }
1864 unsafe {
1865 let f: Box_<F> = Box_::new(f);
1866 connect_raw(
1867 self.as_ptr() as *mut _,
1868 c"cursor-changed".as_ptr() as *const _,
1869 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1870 cursor_changed_trampoline::<Self, F> as *const (),
1871 )),
1872 Box_::into_raw(f),
1873 )
1874 }
1875 }
1876
1877 #[doc(alias = "expand-collapse-cursor-row")]
1878 fn connect_expand_collapse_cursor_row<F: Fn(&Self, bool, bool, bool) -> bool + 'static>(
1879 &self,
1880 f: F,
1881 ) -> SignalHandlerId {
1882 unsafe extern "C" fn expand_collapse_cursor_row_trampoline<
1883 P: IsA<TreeView>,
1884 F: Fn(&P, bool, bool, bool) -> bool + 'static,
1885 >(
1886 this: *mut ffi::GtkTreeView,
1887 object: glib::ffi::gboolean,
1888 p0: glib::ffi::gboolean,
1889 p1: glib::ffi::gboolean,
1890 f: glib::ffi::gpointer,
1891 ) -> glib::ffi::gboolean {
1892 let f: &F = &*(f as *const F);
1893 f(
1894 TreeView::from_glib_borrow(this).unsafe_cast_ref(),
1895 from_glib(object),
1896 from_glib(p0),
1897 from_glib(p1),
1898 )
1899 .into_glib()
1900 }
1901 unsafe {
1902 let f: Box_<F> = Box_::new(f);
1903 connect_raw(
1904 self.as_ptr() as *mut _,
1905 c"expand-collapse-cursor-row".as_ptr() as *const _,
1906 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1907 expand_collapse_cursor_row_trampoline::<Self, F> as *const (),
1908 )),
1909 Box_::into_raw(f),
1910 )
1911 }
1912 }
1913
1914 fn emit_expand_collapse_cursor_row(&self, object: bool, p0: bool, p1: bool) -> bool {
1915 self.emit_by_name("expand-collapse-cursor-row", &[&object, &p0, &p1])
1916 }
1917
1918 #[doc(alias = "move-cursor")]
1919 fn connect_move_cursor<F: Fn(&Self, MovementStep, i32, bool, bool) -> bool + 'static>(
1920 &self,
1921 f: F,
1922 ) -> SignalHandlerId {
1923 unsafe extern "C" fn move_cursor_trampoline<
1924 P: IsA<TreeView>,
1925 F: Fn(&P, MovementStep, i32, bool, bool) -> bool + 'static,
1926 >(
1927 this: *mut ffi::GtkTreeView,
1928 step: ffi::GtkMovementStep,
1929 direction: std::ffi::c_int,
1930 extend: glib::ffi::gboolean,
1931 modify: glib::ffi::gboolean,
1932 f: glib::ffi::gpointer,
1933 ) -> glib::ffi::gboolean {
1934 let f: &F = &*(f as *const F);
1935 f(
1936 TreeView::from_glib_borrow(this).unsafe_cast_ref(),
1937 from_glib(step),
1938 direction,
1939 from_glib(extend),
1940 from_glib(modify),
1941 )
1942 .into_glib()
1943 }
1944 unsafe {
1945 let f: Box_<F> = Box_::new(f);
1946 connect_raw(
1947 self.as_ptr() as *mut _,
1948 c"move-cursor".as_ptr() as *const _,
1949 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1950 move_cursor_trampoline::<Self, F> as *const (),
1951 )),
1952 Box_::into_raw(f),
1953 )
1954 }
1955 }
1956
1957 fn emit_move_cursor(
1958 &self,
1959 step: MovementStep,
1960 direction: i32,
1961 extend: bool,
1962 modify: bool,
1963 ) -> bool {
1964 self.emit_by_name("move-cursor", &[&step, &direction, &extend, &modify])
1965 }
1966
1967 #[doc(alias = "row-activated")]
1968 fn connect_row_activated<F: Fn(&Self, &TreePath, Option<&TreeViewColumn>) + 'static>(
1969 &self,
1970 f: F,
1971 ) -> SignalHandlerId {
1972 unsafe extern "C" fn row_activated_trampoline<
1973 P: IsA<TreeView>,
1974 F: Fn(&P, &TreePath, Option<&TreeViewColumn>) + 'static,
1975 >(
1976 this: *mut ffi::GtkTreeView,
1977 path: *mut ffi::GtkTreePath,
1978 column: *mut ffi::GtkTreeViewColumn,
1979 f: glib::ffi::gpointer,
1980 ) {
1981 let f: &F = &*(f as *const F);
1982 f(
1983 TreeView::from_glib_borrow(this).unsafe_cast_ref(),
1984 &from_glib_borrow(path),
1985 Option::<TreeViewColumn>::from_glib_borrow(column)
1986 .as_ref()
1987 .as_ref(),
1988 )
1989 }
1990 unsafe {
1991 let f: Box_<F> = Box_::new(f);
1992 connect_raw(
1993 self.as_ptr() as *mut _,
1994 c"row-activated".as_ptr() as *const _,
1995 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
1996 row_activated_trampoline::<Self, F> as *const (),
1997 )),
1998 Box_::into_raw(f),
1999 )
2000 }
2001 }
2002
2003 fn emit_row_activated(&self, path: &TreePath, column: Option<&TreeViewColumn>) {
2004 self.emit_by_name::<()>("row-activated", &[&path, &column]);
2005 }
2006
2007 #[doc(alias = "row-collapsed")]
2008 fn connect_row_collapsed<F: Fn(&Self, &TreeIter, &TreePath) + 'static>(
2009 &self,
2010 f: F,
2011 ) -> SignalHandlerId {
2012 unsafe extern "C" fn row_collapsed_trampoline<
2013 P: IsA<TreeView>,
2014 F: Fn(&P, &TreeIter, &TreePath) + 'static,
2015 >(
2016 this: *mut ffi::GtkTreeView,
2017 iter: *mut ffi::GtkTreeIter,
2018 path: *mut ffi::GtkTreePath,
2019 f: glib::ffi::gpointer,
2020 ) {
2021 let f: &F = &*(f as *const F);
2022 f(
2023 TreeView::from_glib_borrow(this).unsafe_cast_ref(),
2024 &from_glib_borrow(iter),
2025 &from_glib_borrow(path),
2026 )
2027 }
2028 unsafe {
2029 let f: Box_<F> = Box_::new(f);
2030 connect_raw(
2031 self.as_ptr() as *mut _,
2032 c"row-collapsed".as_ptr() as *const _,
2033 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2034 row_collapsed_trampoline::<Self, F> as *const (),
2035 )),
2036 Box_::into_raw(f),
2037 )
2038 }
2039 }
2040
2041 #[doc(alias = "row-expanded")]
2042 fn connect_row_expanded<F: Fn(&Self, &TreeIter, &TreePath) + 'static>(
2043 &self,
2044 f: F,
2045 ) -> SignalHandlerId {
2046 unsafe extern "C" fn row_expanded_trampoline<
2047 P: IsA<TreeView>,
2048 F: Fn(&P, &TreeIter, &TreePath) + 'static,
2049 >(
2050 this: *mut ffi::GtkTreeView,
2051 iter: *mut ffi::GtkTreeIter,
2052 path: *mut ffi::GtkTreePath,
2053 f: glib::ffi::gpointer,
2054 ) {
2055 let f: &F = &*(f as *const F);
2056 f(
2057 TreeView::from_glib_borrow(this).unsafe_cast_ref(),
2058 &from_glib_borrow(iter),
2059 &from_glib_borrow(path),
2060 )
2061 }
2062 unsafe {
2063 let f: Box_<F> = Box_::new(f);
2064 connect_raw(
2065 self.as_ptr() as *mut _,
2066 c"row-expanded".as_ptr() as *const _,
2067 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2068 row_expanded_trampoline::<Self, F> as *const (),
2069 )),
2070 Box_::into_raw(f),
2071 )
2072 }
2073 }
2074
2075 #[doc(alias = "select-all")]
2076 fn connect_select_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId {
2077 unsafe extern "C" fn select_all_trampoline<
2078 P: IsA<TreeView>,
2079 F: Fn(&P) -> bool + 'static,
2080 >(
2081 this: *mut ffi::GtkTreeView,
2082 f: glib::ffi::gpointer,
2083 ) -> glib::ffi::gboolean {
2084 let f: &F = &*(f as *const F);
2085 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()).into_glib()
2086 }
2087 unsafe {
2088 let f: Box_<F> = Box_::new(f);
2089 connect_raw(
2090 self.as_ptr() as *mut _,
2091 c"select-all".as_ptr() as *const _,
2092 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2093 select_all_trampoline::<Self, F> as *const (),
2094 )),
2095 Box_::into_raw(f),
2096 )
2097 }
2098 }
2099
2100 fn emit_select_all(&self) -> bool {
2101 self.emit_by_name("select-all", &[])
2102 }
2103
2104 #[doc(alias = "select-cursor-parent")]
2105 fn connect_select_cursor_parent<F: Fn(&Self) -> bool + 'static>(
2106 &self,
2107 f: F,
2108 ) -> SignalHandlerId {
2109 unsafe extern "C" fn select_cursor_parent_trampoline<
2110 P: IsA<TreeView>,
2111 F: Fn(&P) -> bool + 'static,
2112 >(
2113 this: *mut ffi::GtkTreeView,
2114 f: glib::ffi::gpointer,
2115 ) -> glib::ffi::gboolean {
2116 let f: &F = &*(f as *const F);
2117 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()).into_glib()
2118 }
2119 unsafe {
2120 let f: Box_<F> = Box_::new(f);
2121 connect_raw(
2122 self.as_ptr() as *mut _,
2123 c"select-cursor-parent".as_ptr() as *const _,
2124 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2125 select_cursor_parent_trampoline::<Self, F> as *const (),
2126 )),
2127 Box_::into_raw(f),
2128 )
2129 }
2130 }
2131
2132 fn emit_select_cursor_parent(&self) -> bool {
2133 self.emit_by_name("select-cursor-parent", &[])
2134 }
2135
2136 #[doc(alias = "select-cursor-row")]
2137 fn connect_select_cursor_row<F: Fn(&Self, bool) -> bool + 'static>(
2138 &self,
2139 f: F,
2140 ) -> SignalHandlerId {
2141 unsafe extern "C" fn select_cursor_row_trampoline<
2142 P: IsA<TreeView>,
2143 F: Fn(&P, bool) -> bool + 'static,
2144 >(
2145 this: *mut ffi::GtkTreeView,
2146 object: glib::ffi::gboolean,
2147 f: glib::ffi::gpointer,
2148 ) -> glib::ffi::gboolean {
2149 let f: &F = &*(f as *const F);
2150 f(
2151 TreeView::from_glib_borrow(this).unsafe_cast_ref(),
2152 from_glib(object),
2153 )
2154 .into_glib()
2155 }
2156 unsafe {
2157 let f: Box_<F> = Box_::new(f);
2158 connect_raw(
2159 self.as_ptr() as *mut _,
2160 c"select-cursor-row".as_ptr() as *const _,
2161 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2162 select_cursor_row_trampoline::<Self, F> as *const (),
2163 )),
2164 Box_::into_raw(f),
2165 )
2166 }
2167 }
2168
2169 fn emit_select_cursor_row(&self, object: bool) -> bool {
2170 self.emit_by_name("select-cursor-row", &[&object])
2171 }
2172
2173 #[doc(alias = "start-interactive-search")]
2174 fn connect_start_interactive_search<F: Fn(&Self) -> bool + 'static>(
2175 &self,
2176 f: F,
2177 ) -> SignalHandlerId {
2178 unsafe extern "C" fn start_interactive_search_trampoline<
2179 P: IsA<TreeView>,
2180 F: Fn(&P) -> bool + 'static,
2181 >(
2182 this: *mut ffi::GtkTreeView,
2183 f: glib::ffi::gpointer,
2184 ) -> glib::ffi::gboolean {
2185 let f: &F = &*(f as *const F);
2186 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()).into_glib()
2187 }
2188 unsafe {
2189 let f: Box_<F> = Box_::new(f);
2190 connect_raw(
2191 self.as_ptr() as *mut _,
2192 c"start-interactive-search".as_ptr() as *const _,
2193 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2194 start_interactive_search_trampoline::<Self, F> as *const (),
2195 )),
2196 Box_::into_raw(f),
2197 )
2198 }
2199 }
2200
2201 fn emit_start_interactive_search(&self) -> bool {
2202 self.emit_by_name("start-interactive-search", &[])
2203 }
2204
2205 #[doc(alias = "test-collapse-row")]
2206 fn connect_test_collapse_row<
2207 F: Fn(&Self, &TreeIter, &TreePath) -> glib::Propagation + 'static,
2208 >(
2209 &self,
2210 f: F,
2211 ) -> SignalHandlerId {
2212 unsafe extern "C" fn test_collapse_row_trampoline<
2213 P: IsA<TreeView>,
2214 F: Fn(&P, &TreeIter, &TreePath) -> glib::Propagation + 'static,
2215 >(
2216 this: *mut ffi::GtkTreeView,
2217 iter: *mut ffi::GtkTreeIter,
2218 path: *mut ffi::GtkTreePath,
2219 f: glib::ffi::gpointer,
2220 ) -> glib::ffi::gboolean {
2221 let f: &F = &*(f as *const F);
2222 f(
2223 TreeView::from_glib_borrow(this).unsafe_cast_ref(),
2224 &from_glib_borrow(iter),
2225 &from_glib_borrow(path),
2226 )
2227 .into_glib()
2228 }
2229 unsafe {
2230 let f: Box_<F> = Box_::new(f);
2231 connect_raw(
2232 self.as_ptr() as *mut _,
2233 c"test-collapse-row".as_ptr() as *const _,
2234 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2235 test_collapse_row_trampoline::<Self, F> as *const (),
2236 )),
2237 Box_::into_raw(f),
2238 )
2239 }
2240 }
2241
2242 #[doc(alias = "test-expand-row")]
2243 fn connect_test_expand_row<
2244 F: Fn(&Self, &TreeIter, &TreePath) -> glib::Propagation + 'static,
2245 >(
2246 &self,
2247 f: F,
2248 ) -> SignalHandlerId {
2249 unsafe extern "C" fn test_expand_row_trampoline<
2250 P: IsA<TreeView>,
2251 F: Fn(&P, &TreeIter, &TreePath) -> glib::Propagation + 'static,
2252 >(
2253 this: *mut ffi::GtkTreeView,
2254 iter: *mut ffi::GtkTreeIter,
2255 path: *mut ffi::GtkTreePath,
2256 f: glib::ffi::gpointer,
2257 ) -> glib::ffi::gboolean {
2258 let f: &F = &*(f as *const F);
2259 f(
2260 TreeView::from_glib_borrow(this).unsafe_cast_ref(),
2261 &from_glib_borrow(iter),
2262 &from_glib_borrow(path),
2263 )
2264 .into_glib()
2265 }
2266 unsafe {
2267 let f: Box_<F> = Box_::new(f);
2268 connect_raw(
2269 self.as_ptr() as *mut _,
2270 c"test-expand-row".as_ptr() as *const _,
2271 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2272 test_expand_row_trampoline::<Self, F> as *const (),
2273 )),
2274 Box_::into_raw(f),
2275 )
2276 }
2277 }
2278
2279 #[doc(alias = "toggle-cursor-row")]
2280 fn connect_toggle_cursor_row<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId {
2281 unsafe extern "C" fn toggle_cursor_row_trampoline<
2282 P: IsA<TreeView>,
2283 F: Fn(&P) -> bool + 'static,
2284 >(
2285 this: *mut ffi::GtkTreeView,
2286 f: glib::ffi::gpointer,
2287 ) -> glib::ffi::gboolean {
2288 let f: &F = &*(f as *const F);
2289 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()).into_glib()
2290 }
2291 unsafe {
2292 let f: Box_<F> = Box_::new(f);
2293 connect_raw(
2294 self.as_ptr() as *mut _,
2295 c"toggle-cursor-row".as_ptr() as *const _,
2296 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2297 toggle_cursor_row_trampoline::<Self, F> as *const (),
2298 )),
2299 Box_::into_raw(f),
2300 )
2301 }
2302 }
2303
2304 fn emit_toggle_cursor_row(&self) -> bool {
2305 self.emit_by_name("toggle-cursor-row", &[])
2306 }
2307
2308 #[doc(alias = "unselect-all")]
2309 fn connect_unselect_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId {
2310 unsafe extern "C" fn unselect_all_trampoline<
2311 P: IsA<TreeView>,
2312 F: Fn(&P) -> bool + 'static,
2313 >(
2314 this: *mut ffi::GtkTreeView,
2315 f: glib::ffi::gpointer,
2316 ) -> glib::ffi::gboolean {
2317 let f: &F = &*(f as *const F);
2318 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()).into_glib()
2319 }
2320 unsafe {
2321 let f: Box_<F> = Box_::new(f);
2322 connect_raw(
2323 self.as_ptr() as *mut _,
2324 c"unselect-all".as_ptr() as *const _,
2325 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2326 unselect_all_trampoline::<Self, F> as *const (),
2327 )),
2328 Box_::into_raw(f),
2329 )
2330 }
2331 }
2332
2333 fn emit_unselect_all(&self) -> bool {
2334 self.emit_by_name("unselect-all", &[])
2335 }
2336
2337 #[doc(alias = "activate-on-single-click")]
2338 fn connect_activate_on_single_click_notify<F: Fn(&Self) + 'static>(
2339 &self,
2340 f: F,
2341 ) -> SignalHandlerId {
2342 unsafe extern "C" fn notify_activate_on_single_click_trampoline<
2343 P: IsA<TreeView>,
2344 F: Fn(&P) + 'static,
2345 >(
2346 this: *mut ffi::GtkTreeView,
2347 _param_spec: glib::ffi::gpointer,
2348 f: glib::ffi::gpointer,
2349 ) {
2350 let f: &F = &*(f as *const F);
2351 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
2352 }
2353 unsafe {
2354 let f: Box_<F> = Box_::new(f);
2355 connect_raw(
2356 self.as_ptr() as *mut _,
2357 c"notify::activate-on-single-click".as_ptr() as *const _,
2358 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2359 notify_activate_on_single_click_trampoline::<Self, F> as *const (),
2360 )),
2361 Box_::into_raw(f),
2362 )
2363 }
2364 }
2365
2366 #[doc(alias = "enable-grid-lines")]
2367 fn connect_enable_grid_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2368 unsafe extern "C" fn notify_enable_grid_lines_trampoline<
2369 P: IsA<TreeView>,
2370 F: Fn(&P) + 'static,
2371 >(
2372 this: *mut ffi::GtkTreeView,
2373 _param_spec: glib::ffi::gpointer,
2374 f: glib::ffi::gpointer,
2375 ) {
2376 let f: &F = &*(f as *const F);
2377 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
2378 }
2379 unsafe {
2380 let f: Box_<F> = Box_::new(f);
2381 connect_raw(
2382 self.as_ptr() as *mut _,
2383 c"notify::enable-grid-lines".as_ptr() as *const _,
2384 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2385 notify_enable_grid_lines_trampoline::<Self, F> as *const (),
2386 )),
2387 Box_::into_raw(f),
2388 )
2389 }
2390 }
2391
2392 #[doc(alias = "enable-search")]
2393 fn connect_enable_search_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2394 unsafe extern "C" fn notify_enable_search_trampoline<
2395 P: IsA<TreeView>,
2396 F: Fn(&P) + 'static,
2397 >(
2398 this: *mut ffi::GtkTreeView,
2399 _param_spec: glib::ffi::gpointer,
2400 f: glib::ffi::gpointer,
2401 ) {
2402 let f: &F = &*(f as *const F);
2403 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
2404 }
2405 unsafe {
2406 let f: Box_<F> = Box_::new(f);
2407 connect_raw(
2408 self.as_ptr() as *mut _,
2409 c"notify::enable-search".as_ptr() as *const _,
2410 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2411 notify_enable_search_trampoline::<Self, F> as *const (),
2412 )),
2413 Box_::into_raw(f),
2414 )
2415 }
2416 }
2417
2418 #[doc(alias = "enable-tree-lines")]
2419 fn connect_enable_tree_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2420 unsafe extern "C" fn notify_enable_tree_lines_trampoline<
2421 P: IsA<TreeView>,
2422 F: Fn(&P) + 'static,
2423 >(
2424 this: *mut ffi::GtkTreeView,
2425 _param_spec: glib::ffi::gpointer,
2426 f: glib::ffi::gpointer,
2427 ) {
2428 let f: &F = &*(f as *const F);
2429 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
2430 }
2431 unsafe {
2432 let f: Box_<F> = Box_::new(f);
2433 connect_raw(
2434 self.as_ptr() as *mut _,
2435 c"notify::enable-tree-lines".as_ptr() as *const _,
2436 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2437 notify_enable_tree_lines_trampoline::<Self, F> as *const (),
2438 )),
2439 Box_::into_raw(f),
2440 )
2441 }
2442 }
2443
2444 #[doc(alias = "expander-column")]
2445 fn connect_expander_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2446 unsafe extern "C" fn notify_expander_column_trampoline<
2447 P: IsA<TreeView>,
2448 F: Fn(&P) + 'static,
2449 >(
2450 this: *mut ffi::GtkTreeView,
2451 _param_spec: glib::ffi::gpointer,
2452 f: glib::ffi::gpointer,
2453 ) {
2454 let f: &F = &*(f as *const F);
2455 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
2456 }
2457 unsafe {
2458 let f: Box_<F> = Box_::new(f);
2459 connect_raw(
2460 self.as_ptr() as *mut _,
2461 c"notify::expander-column".as_ptr() as *const _,
2462 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2463 notify_expander_column_trampoline::<Self, F> as *const (),
2464 )),
2465 Box_::into_raw(f),
2466 )
2467 }
2468 }
2469
2470 #[doc(alias = "fixed-height-mode")]
2471 fn connect_fixed_height_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2472 unsafe extern "C" fn notify_fixed_height_mode_trampoline<
2473 P: IsA<TreeView>,
2474 F: Fn(&P) + 'static,
2475 >(
2476 this: *mut ffi::GtkTreeView,
2477 _param_spec: glib::ffi::gpointer,
2478 f: glib::ffi::gpointer,
2479 ) {
2480 let f: &F = &*(f as *const F);
2481 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
2482 }
2483 unsafe {
2484 let f: Box_<F> = Box_::new(f);
2485 connect_raw(
2486 self.as_ptr() as *mut _,
2487 c"notify::fixed-height-mode".as_ptr() as *const _,
2488 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2489 notify_fixed_height_mode_trampoline::<Self, F> as *const (),
2490 )),
2491 Box_::into_raw(f),
2492 )
2493 }
2494 }
2495
2496 #[doc(alias = "headers-clickable")]
2497 fn connect_headers_clickable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2498 unsafe extern "C" fn notify_headers_clickable_trampoline<
2499 P: IsA<TreeView>,
2500 F: Fn(&P) + 'static,
2501 >(
2502 this: *mut ffi::GtkTreeView,
2503 _param_spec: glib::ffi::gpointer,
2504 f: glib::ffi::gpointer,
2505 ) {
2506 let f: &F = &*(f as *const F);
2507 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
2508 }
2509 unsafe {
2510 let f: Box_<F> = Box_::new(f);
2511 connect_raw(
2512 self.as_ptr() as *mut _,
2513 c"notify::headers-clickable".as_ptr() as *const _,
2514 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2515 notify_headers_clickable_trampoline::<Self, F> as *const (),
2516 )),
2517 Box_::into_raw(f),
2518 )
2519 }
2520 }
2521
2522 #[doc(alias = "headers-visible")]
2523 fn connect_headers_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2524 unsafe extern "C" fn notify_headers_visible_trampoline<
2525 P: IsA<TreeView>,
2526 F: Fn(&P) + 'static,
2527 >(
2528 this: *mut ffi::GtkTreeView,
2529 _param_spec: glib::ffi::gpointer,
2530 f: glib::ffi::gpointer,
2531 ) {
2532 let f: &F = &*(f as *const F);
2533 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
2534 }
2535 unsafe {
2536 let f: Box_<F> = Box_::new(f);
2537 connect_raw(
2538 self.as_ptr() as *mut _,
2539 c"notify::headers-visible".as_ptr() as *const _,
2540 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2541 notify_headers_visible_trampoline::<Self, F> as *const (),
2542 )),
2543 Box_::into_raw(f),
2544 )
2545 }
2546 }
2547
2548 #[doc(alias = "hover-expand")]
2549 fn connect_hover_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2550 unsafe extern "C" fn notify_hover_expand_trampoline<
2551 P: IsA<TreeView>,
2552 F: Fn(&P) + 'static,
2553 >(
2554 this: *mut ffi::GtkTreeView,
2555 _param_spec: glib::ffi::gpointer,
2556 f: glib::ffi::gpointer,
2557 ) {
2558 let f: &F = &*(f as *const F);
2559 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
2560 }
2561 unsafe {
2562 let f: Box_<F> = Box_::new(f);
2563 connect_raw(
2564 self.as_ptr() as *mut _,
2565 c"notify::hover-expand".as_ptr() as *const _,
2566 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2567 notify_hover_expand_trampoline::<Self, F> as *const (),
2568 )),
2569 Box_::into_raw(f),
2570 )
2571 }
2572 }
2573
2574 #[doc(alias = "hover-selection")]
2575 fn connect_hover_selection_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2576 unsafe extern "C" fn notify_hover_selection_trampoline<
2577 P: IsA<TreeView>,
2578 F: Fn(&P) + 'static,
2579 >(
2580 this: *mut ffi::GtkTreeView,
2581 _param_spec: glib::ffi::gpointer,
2582 f: glib::ffi::gpointer,
2583 ) {
2584 let f: &F = &*(f as *const F);
2585 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
2586 }
2587 unsafe {
2588 let f: Box_<F> = Box_::new(f);
2589 connect_raw(
2590 self.as_ptr() as *mut _,
2591 c"notify::hover-selection".as_ptr() as *const _,
2592 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2593 notify_hover_selection_trampoline::<Self, F> as *const (),
2594 )),
2595 Box_::into_raw(f),
2596 )
2597 }
2598 }
2599
2600 #[doc(alias = "level-indentation")]
2601 fn connect_level_indentation_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2602 unsafe extern "C" fn notify_level_indentation_trampoline<
2603 P: IsA<TreeView>,
2604 F: Fn(&P) + 'static,
2605 >(
2606 this: *mut ffi::GtkTreeView,
2607 _param_spec: glib::ffi::gpointer,
2608 f: glib::ffi::gpointer,
2609 ) {
2610 let f: &F = &*(f as *const F);
2611 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
2612 }
2613 unsafe {
2614 let f: Box_<F> = Box_::new(f);
2615 connect_raw(
2616 self.as_ptr() as *mut _,
2617 c"notify::level-indentation".as_ptr() as *const _,
2618 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2619 notify_level_indentation_trampoline::<Self, F> as *const (),
2620 )),
2621 Box_::into_raw(f),
2622 )
2623 }
2624 }
2625
2626 #[doc(alias = "model")]
2627 fn connect_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2628 unsafe extern "C" fn notify_model_trampoline<P: IsA<TreeView>, F: Fn(&P) + 'static>(
2629 this: *mut ffi::GtkTreeView,
2630 _param_spec: glib::ffi::gpointer,
2631 f: glib::ffi::gpointer,
2632 ) {
2633 let f: &F = &*(f as *const F);
2634 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
2635 }
2636 unsafe {
2637 let f: Box_<F> = Box_::new(f);
2638 connect_raw(
2639 self.as_ptr() as *mut _,
2640 c"notify::model".as_ptr() as *const _,
2641 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2642 notify_model_trampoline::<Self, F> as *const (),
2643 )),
2644 Box_::into_raw(f),
2645 )
2646 }
2647 }
2648
2649 #[doc(alias = "reorderable")]
2650 fn connect_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2651 unsafe extern "C" fn notify_reorderable_trampoline<
2652 P: IsA<TreeView>,
2653 F: Fn(&P) + 'static,
2654 >(
2655 this: *mut ffi::GtkTreeView,
2656 _param_spec: glib::ffi::gpointer,
2657 f: glib::ffi::gpointer,
2658 ) {
2659 let f: &F = &*(f as *const F);
2660 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
2661 }
2662 unsafe {
2663 let f: Box_<F> = Box_::new(f);
2664 connect_raw(
2665 self.as_ptr() as *mut _,
2666 c"notify::reorderable".as_ptr() as *const _,
2667 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2668 notify_reorderable_trampoline::<Self, F> as *const (),
2669 )),
2670 Box_::into_raw(f),
2671 )
2672 }
2673 }
2674
2675 #[doc(alias = "rubber-banding")]
2676 fn connect_rubber_banding_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2677 unsafe extern "C" fn notify_rubber_banding_trampoline<
2678 P: IsA<TreeView>,
2679 F: Fn(&P) + 'static,
2680 >(
2681 this: *mut ffi::GtkTreeView,
2682 _param_spec: glib::ffi::gpointer,
2683 f: glib::ffi::gpointer,
2684 ) {
2685 let f: &F = &*(f as *const F);
2686 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
2687 }
2688 unsafe {
2689 let f: Box_<F> = Box_::new(f);
2690 connect_raw(
2691 self.as_ptr() as *mut _,
2692 c"notify::rubber-banding".as_ptr() as *const _,
2693 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2694 notify_rubber_banding_trampoline::<Self, F> as *const (),
2695 )),
2696 Box_::into_raw(f),
2697 )
2698 }
2699 }
2700
2701 #[doc(alias = "search-column")]
2702 fn connect_search_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2703 unsafe extern "C" fn notify_search_column_trampoline<
2704 P: IsA<TreeView>,
2705 F: Fn(&P) + 'static,
2706 >(
2707 this: *mut ffi::GtkTreeView,
2708 _param_spec: glib::ffi::gpointer,
2709 f: glib::ffi::gpointer,
2710 ) {
2711 let f: &F = &*(f as *const F);
2712 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
2713 }
2714 unsafe {
2715 let f: Box_<F> = Box_::new(f);
2716 connect_raw(
2717 self.as_ptr() as *mut _,
2718 c"notify::search-column".as_ptr() as *const _,
2719 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2720 notify_search_column_trampoline::<Self, F> as *const (),
2721 )),
2722 Box_::into_raw(f),
2723 )
2724 }
2725 }
2726
2727 #[doc(alias = "show-expanders")]
2728 fn connect_show_expanders_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2729 unsafe extern "C" fn notify_show_expanders_trampoline<
2730 P: IsA<TreeView>,
2731 F: Fn(&P) + 'static,
2732 >(
2733 this: *mut ffi::GtkTreeView,
2734 _param_spec: glib::ffi::gpointer,
2735 f: glib::ffi::gpointer,
2736 ) {
2737 let f: &F = &*(f as *const F);
2738 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
2739 }
2740 unsafe {
2741 let f: Box_<F> = Box_::new(f);
2742 connect_raw(
2743 self.as_ptr() as *mut _,
2744 c"notify::show-expanders".as_ptr() as *const _,
2745 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2746 notify_show_expanders_trampoline::<Self, F> as *const (),
2747 )),
2748 Box_::into_raw(f),
2749 )
2750 }
2751 }
2752
2753 #[doc(alias = "tooltip-column")]
2754 fn connect_tooltip_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
2755 unsafe extern "C" fn notify_tooltip_column_trampoline<
2756 P: IsA<TreeView>,
2757 F: Fn(&P) + 'static,
2758 >(
2759 this: *mut ffi::GtkTreeView,
2760 _param_spec: glib::ffi::gpointer,
2761 f: glib::ffi::gpointer,
2762 ) {
2763 let f: &F = &*(f as *const F);
2764 f(TreeView::from_glib_borrow(this).unsafe_cast_ref())
2765 }
2766 unsafe {
2767 let f: Box_<F> = Box_::new(f);
2768 connect_raw(
2769 self.as_ptr() as *mut _,
2770 c"notify::tooltip-column".as_ptr() as *const _,
2771 Some(std::mem::transmute::<*const (), unsafe extern "C" fn()>(
2772 notify_tooltip_column_trampoline::<Self, F> as *const (),
2773 )),
2774 Box_::into_raw(f),
2775 )
2776 }
2777 }
2778}
2779
2780impl<O: IsA<TreeView>> TreeViewExt for O {}