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 5 use crate::Adjustment; 6 use crate::Align; 7 use crate::Buildable; 8 use crate::CellRenderer; 9 use crate::Container; 10 use crate::Entry; 11 use crate::MovementStep; 12 use crate::ResizeMode; 13 use crate::Scrollable; 14 use crate::ScrollablePolicy; 15 use crate::Tooltip; 16 use crate::TreeIter; 17 use crate::TreeModel; 18 use crate::TreePath; 19 use crate::TreeSelection; 20 use crate::TreeViewColumn; 21 use crate::TreeViewDropPosition; 22 use crate::TreeViewGridLines; 23 use crate::Widget; 24 use glib::object::Cast; 25 use glib::object::IsA; 26 use glib::object::ObjectExt; 27 use glib::signal::connect_raw; 28 use glib::signal::SignalHandlerId; 29 use glib::translate::*; 30 use glib::StaticType; 31 use glib::ToValue; 32 use std::boxed::Box as Box_; 33 use std::fmt; 34 use std::mem; 35 use std::mem::transmute; 36 use std::ptr; 37 38 glib::wrapper! { 39 #[doc(alias = "GtkTreeView")] 40 pub struct TreeView(Object<ffi::GtkTreeView, ffi::GtkTreeViewClass>) @extends Container, Widget, @implements Buildable, Scrollable; 41 42 match fn { 43 type_ => || ffi::gtk_tree_view_get_type(), 44 } 45 } 46 47 impl TreeView { 48 #[doc(alias = "gtk_tree_view_new")] new() -> TreeView49 pub fn new() -> TreeView { 50 assert_initialized_main_thread!(); 51 unsafe { Widget::from_glib_none(ffi::gtk_tree_view_new()).unsafe_cast() } 52 } 53 54 #[doc(alias = "gtk_tree_view_new_with_model")] 55 #[doc(alias = "new_with_model")] with_model<P: IsA<TreeModel>>(model: &P) -> TreeView56 pub fn with_model<P: IsA<TreeModel>>(model: &P) -> TreeView { 57 skip_assert_initialized!(); 58 unsafe { 59 Widget::from_glib_none(ffi::gtk_tree_view_new_with_model( 60 model.as_ref().to_glib_none().0, 61 )) 62 .unsafe_cast() 63 } 64 } 65 66 // rustdoc-stripper-ignore-next 67 /// Creates a new builder-pattern struct instance to construct [`TreeView`] objects. 68 /// 69 /// This method returns an instance of [`TreeViewBuilder`] which can be used to create [`TreeView`] objects. builder() -> TreeViewBuilder70 pub fn builder() -> TreeViewBuilder { 71 TreeViewBuilder::default() 72 } 73 } 74 75 impl Default for TreeView { default() -> Self76 fn default() -> Self { 77 Self::new() 78 } 79 } 80 81 #[derive(Clone, Default)] 82 // rustdoc-stripper-ignore-next 83 /// A [builder-pattern] type to construct [`TreeView`] objects. 84 /// 85 /// [builder-pattern]: https://doc.rust-lang.org/1.0.0/style/ownership/builders.html 86 pub struct TreeViewBuilder { 87 activate_on_single_click: Option<bool>, 88 enable_grid_lines: Option<TreeViewGridLines>, 89 enable_search: Option<bool>, 90 enable_tree_lines: Option<bool>, 91 expander_column: Option<TreeViewColumn>, 92 fixed_height_mode: Option<bool>, 93 headers_clickable: Option<bool>, 94 headers_visible: Option<bool>, 95 hover_expand: Option<bool>, 96 hover_selection: Option<bool>, 97 level_indentation: Option<i32>, 98 model: Option<TreeModel>, 99 reorderable: Option<bool>, 100 rubber_banding: Option<bool>, 101 search_column: Option<i32>, 102 show_expanders: Option<bool>, 103 tooltip_column: Option<i32>, 104 ubuntu_almost_fixed_height_mode: Option<bool>, 105 border_width: Option<u32>, 106 child: Option<Widget>, 107 resize_mode: Option<ResizeMode>, 108 app_paintable: Option<bool>, 109 can_default: Option<bool>, 110 can_focus: Option<bool>, 111 events: Option<gdk::EventMask>, 112 expand: Option<bool>, 113 #[cfg(any(feature = "v3_20", feature = "dox"))] 114 #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))] 115 focus_on_click: Option<bool>, 116 halign: Option<Align>, 117 has_default: Option<bool>, 118 has_focus: Option<bool>, 119 has_tooltip: Option<bool>, 120 height_request: Option<i32>, 121 hexpand: Option<bool>, 122 hexpand_set: Option<bool>, 123 is_focus: Option<bool>, 124 margin: Option<i32>, 125 margin_bottom: Option<i32>, 126 margin_end: Option<i32>, 127 margin_start: Option<i32>, 128 margin_top: Option<i32>, 129 name: Option<String>, 130 no_show_all: Option<bool>, 131 opacity: Option<f64>, 132 parent: Option<Container>, 133 receives_default: Option<bool>, 134 sensitive: Option<bool>, 135 tooltip_markup: Option<String>, 136 tooltip_text: Option<String>, 137 valign: Option<Align>, 138 vexpand: Option<bool>, 139 vexpand_set: Option<bool>, 140 visible: Option<bool>, 141 width_request: Option<i32>, 142 hadjustment: Option<Adjustment>, 143 hscroll_policy: Option<ScrollablePolicy>, 144 vadjustment: Option<Adjustment>, 145 vscroll_policy: Option<ScrollablePolicy>, 146 } 147 148 impl TreeViewBuilder { 149 // rustdoc-stripper-ignore-next 150 /// Create a new [`TreeViewBuilder`]. new() -> Self151 pub fn new() -> Self { 152 Self::default() 153 } 154 155 // rustdoc-stripper-ignore-next 156 /// Build the [`TreeView`]. build(self) -> TreeView157 pub fn build(self) -> TreeView { 158 let mut properties: Vec<(&str, &dyn ToValue)> = vec![]; 159 if let Some(ref activate_on_single_click) = self.activate_on_single_click { 160 properties.push(("activate-on-single-click", activate_on_single_click)); 161 } 162 if let Some(ref enable_grid_lines) = self.enable_grid_lines { 163 properties.push(("enable-grid-lines", enable_grid_lines)); 164 } 165 if let Some(ref enable_search) = self.enable_search { 166 properties.push(("enable-search", enable_search)); 167 } 168 if let Some(ref enable_tree_lines) = self.enable_tree_lines { 169 properties.push(("enable-tree-lines", enable_tree_lines)); 170 } 171 if let Some(ref expander_column) = self.expander_column { 172 properties.push(("expander-column", expander_column)); 173 } 174 if let Some(ref fixed_height_mode) = self.fixed_height_mode { 175 properties.push(("fixed-height-mode", fixed_height_mode)); 176 } 177 if let Some(ref headers_clickable) = self.headers_clickable { 178 properties.push(("headers-clickable", headers_clickable)); 179 } 180 if let Some(ref headers_visible) = self.headers_visible { 181 properties.push(("headers-visible", headers_visible)); 182 } 183 if let Some(ref hover_expand) = self.hover_expand { 184 properties.push(("hover-expand", hover_expand)); 185 } 186 if let Some(ref hover_selection) = self.hover_selection { 187 properties.push(("hover-selection", hover_selection)); 188 } 189 if let Some(ref level_indentation) = self.level_indentation { 190 properties.push(("level-indentation", level_indentation)); 191 } 192 if let Some(ref model) = self.model { 193 properties.push(("model", model)); 194 } 195 if let Some(ref reorderable) = self.reorderable { 196 properties.push(("reorderable", reorderable)); 197 } 198 if let Some(ref rubber_banding) = self.rubber_banding { 199 properties.push(("rubber-banding", rubber_banding)); 200 } 201 if let Some(ref search_column) = self.search_column { 202 properties.push(("search-column", search_column)); 203 } 204 if let Some(ref show_expanders) = self.show_expanders { 205 properties.push(("show-expanders", show_expanders)); 206 } 207 if let Some(ref tooltip_column) = self.tooltip_column { 208 properties.push(("tooltip-column", tooltip_column)); 209 } 210 if let Some(ref ubuntu_almost_fixed_height_mode) = self.ubuntu_almost_fixed_height_mode { 211 properties.push(( 212 "ubuntu-almost-fixed-height-mode", 213 ubuntu_almost_fixed_height_mode, 214 )); 215 } 216 if let Some(ref border_width) = self.border_width { 217 properties.push(("border-width", border_width)); 218 } 219 if let Some(ref child) = self.child { 220 properties.push(("child", child)); 221 } 222 if let Some(ref resize_mode) = self.resize_mode { 223 properties.push(("resize-mode", resize_mode)); 224 } 225 if let Some(ref app_paintable) = self.app_paintable { 226 properties.push(("app-paintable", app_paintable)); 227 } 228 if let Some(ref can_default) = self.can_default { 229 properties.push(("can-default", can_default)); 230 } 231 if let Some(ref can_focus) = self.can_focus { 232 properties.push(("can-focus", can_focus)); 233 } 234 if let Some(ref events) = self.events { 235 properties.push(("events", events)); 236 } 237 if let Some(ref expand) = self.expand { 238 properties.push(("expand", expand)); 239 } 240 #[cfg(any(feature = "v3_20", feature = "dox"))] 241 if let Some(ref focus_on_click) = self.focus_on_click { 242 properties.push(("focus-on-click", focus_on_click)); 243 } 244 if let Some(ref halign) = self.halign { 245 properties.push(("halign", halign)); 246 } 247 if let Some(ref has_default) = self.has_default { 248 properties.push(("has-default", has_default)); 249 } 250 if let Some(ref has_focus) = self.has_focus { 251 properties.push(("has-focus", has_focus)); 252 } 253 if let Some(ref has_tooltip) = self.has_tooltip { 254 properties.push(("has-tooltip", has_tooltip)); 255 } 256 if let Some(ref height_request) = self.height_request { 257 properties.push(("height-request", height_request)); 258 } 259 if let Some(ref hexpand) = self.hexpand { 260 properties.push(("hexpand", hexpand)); 261 } 262 if let Some(ref hexpand_set) = self.hexpand_set { 263 properties.push(("hexpand-set", hexpand_set)); 264 } 265 if let Some(ref is_focus) = self.is_focus { 266 properties.push(("is-focus", is_focus)); 267 } 268 if let Some(ref margin) = self.margin { 269 properties.push(("margin", margin)); 270 } 271 if let Some(ref margin_bottom) = self.margin_bottom { 272 properties.push(("margin-bottom", margin_bottom)); 273 } 274 if let Some(ref margin_end) = self.margin_end { 275 properties.push(("margin-end", margin_end)); 276 } 277 if let Some(ref margin_start) = self.margin_start { 278 properties.push(("margin-start", margin_start)); 279 } 280 if let Some(ref margin_top) = self.margin_top { 281 properties.push(("margin-top", margin_top)); 282 } 283 if let Some(ref name) = self.name { 284 properties.push(("name", name)); 285 } 286 if let Some(ref no_show_all) = self.no_show_all { 287 properties.push(("no-show-all", no_show_all)); 288 } 289 if let Some(ref opacity) = self.opacity { 290 properties.push(("opacity", opacity)); 291 } 292 if let Some(ref parent) = self.parent { 293 properties.push(("parent", parent)); 294 } 295 if let Some(ref receives_default) = self.receives_default { 296 properties.push(("receives-default", receives_default)); 297 } 298 if let Some(ref sensitive) = self.sensitive { 299 properties.push(("sensitive", sensitive)); 300 } 301 if let Some(ref tooltip_markup) = self.tooltip_markup { 302 properties.push(("tooltip-markup", tooltip_markup)); 303 } 304 if let Some(ref tooltip_text) = self.tooltip_text { 305 properties.push(("tooltip-text", tooltip_text)); 306 } 307 if let Some(ref valign) = self.valign { 308 properties.push(("valign", valign)); 309 } 310 if let Some(ref vexpand) = self.vexpand { 311 properties.push(("vexpand", vexpand)); 312 } 313 if let Some(ref vexpand_set) = self.vexpand_set { 314 properties.push(("vexpand-set", vexpand_set)); 315 } 316 if let Some(ref visible) = self.visible { 317 properties.push(("visible", visible)); 318 } 319 if let Some(ref width_request) = self.width_request { 320 properties.push(("width-request", width_request)); 321 } 322 if let Some(ref hadjustment) = self.hadjustment { 323 properties.push(("hadjustment", hadjustment)); 324 } 325 if let Some(ref hscroll_policy) = self.hscroll_policy { 326 properties.push(("hscroll-policy", hscroll_policy)); 327 } 328 if let Some(ref vadjustment) = self.vadjustment { 329 properties.push(("vadjustment", vadjustment)); 330 } 331 if let Some(ref vscroll_policy) = self.vscroll_policy { 332 properties.push(("vscroll-policy", vscroll_policy)); 333 } 334 glib::Object::new::<TreeView>(&properties) 335 .expect("Failed to create an instance of TreeView") 336 } 337 activate_on_single_click(mut self, activate_on_single_click: bool) -> Self338 pub fn activate_on_single_click(mut self, activate_on_single_click: bool) -> Self { 339 self.activate_on_single_click = Some(activate_on_single_click); 340 self 341 } 342 enable_grid_lines(mut self, enable_grid_lines: TreeViewGridLines) -> Self343 pub fn enable_grid_lines(mut self, enable_grid_lines: TreeViewGridLines) -> Self { 344 self.enable_grid_lines = Some(enable_grid_lines); 345 self 346 } 347 enable_search(mut self, enable_search: bool) -> Self348 pub fn enable_search(mut self, enable_search: bool) -> Self { 349 self.enable_search = Some(enable_search); 350 self 351 } 352 enable_tree_lines(mut self, enable_tree_lines: bool) -> Self353 pub fn enable_tree_lines(mut self, enable_tree_lines: bool) -> Self { 354 self.enable_tree_lines = Some(enable_tree_lines); 355 self 356 } 357 expander_column<P: IsA<TreeViewColumn>>(mut self, expander_column: &P) -> Self358 pub fn expander_column<P: IsA<TreeViewColumn>>(mut self, expander_column: &P) -> Self { 359 self.expander_column = Some(expander_column.clone().upcast()); 360 self 361 } 362 fixed_height_mode(mut self, fixed_height_mode: bool) -> Self363 pub fn fixed_height_mode(mut self, fixed_height_mode: bool) -> Self { 364 self.fixed_height_mode = Some(fixed_height_mode); 365 self 366 } 367 headers_clickable(mut self, headers_clickable: bool) -> Self368 pub fn headers_clickable(mut self, headers_clickable: bool) -> Self { 369 self.headers_clickable = Some(headers_clickable); 370 self 371 } 372 headers_visible(mut self, headers_visible: bool) -> Self373 pub fn headers_visible(mut self, headers_visible: bool) -> Self { 374 self.headers_visible = Some(headers_visible); 375 self 376 } 377 hover_expand(mut self, hover_expand: bool) -> Self378 pub fn hover_expand(mut self, hover_expand: bool) -> Self { 379 self.hover_expand = Some(hover_expand); 380 self 381 } 382 hover_selection(mut self, hover_selection: bool) -> Self383 pub fn hover_selection(mut self, hover_selection: bool) -> Self { 384 self.hover_selection = Some(hover_selection); 385 self 386 } 387 level_indentation(mut self, level_indentation: i32) -> Self388 pub fn level_indentation(mut self, level_indentation: i32) -> Self { 389 self.level_indentation = Some(level_indentation); 390 self 391 } 392 model<P: IsA<TreeModel>>(mut self, model: &P) -> Self393 pub fn model<P: IsA<TreeModel>>(mut self, model: &P) -> Self { 394 self.model = Some(model.clone().upcast()); 395 self 396 } 397 reorderable(mut self, reorderable: bool) -> Self398 pub fn reorderable(mut self, reorderable: bool) -> Self { 399 self.reorderable = Some(reorderable); 400 self 401 } 402 rubber_banding(mut self, rubber_banding: bool) -> Self403 pub fn rubber_banding(mut self, rubber_banding: bool) -> Self { 404 self.rubber_banding = Some(rubber_banding); 405 self 406 } 407 search_column(mut self, search_column: i32) -> Self408 pub fn search_column(mut self, search_column: i32) -> Self { 409 self.search_column = Some(search_column); 410 self 411 } 412 show_expanders(mut self, show_expanders: bool) -> Self413 pub fn show_expanders(mut self, show_expanders: bool) -> Self { 414 self.show_expanders = Some(show_expanders); 415 self 416 } 417 tooltip_column(mut self, tooltip_column: i32) -> Self418 pub fn tooltip_column(mut self, tooltip_column: i32) -> Self { 419 self.tooltip_column = Some(tooltip_column); 420 self 421 } 422 ubuntu_almost_fixed_height_mode( mut self, ubuntu_almost_fixed_height_mode: bool, ) -> Self423 pub fn ubuntu_almost_fixed_height_mode( 424 mut self, 425 ubuntu_almost_fixed_height_mode: bool, 426 ) -> Self { 427 self.ubuntu_almost_fixed_height_mode = Some(ubuntu_almost_fixed_height_mode); 428 self 429 } 430 border_width(mut self, border_width: u32) -> Self431 pub fn border_width(mut self, border_width: u32) -> Self { 432 self.border_width = Some(border_width); 433 self 434 } 435 child<P: IsA<Widget>>(mut self, child: &P) -> Self436 pub fn child<P: IsA<Widget>>(mut self, child: &P) -> Self { 437 self.child = Some(child.clone().upcast()); 438 self 439 } 440 resize_mode(mut self, resize_mode: ResizeMode) -> Self441 pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self { 442 self.resize_mode = Some(resize_mode); 443 self 444 } 445 app_paintable(mut self, app_paintable: bool) -> Self446 pub fn app_paintable(mut self, app_paintable: bool) -> Self { 447 self.app_paintable = Some(app_paintable); 448 self 449 } 450 can_default(mut self, can_default: bool) -> Self451 pub fn can_default(mut self, can_default: bool) -> Self { 452 self.can_default = Some(can_default); 453 self 454 } 455 can_focus(mut self, can_focus: bool) -> Self456 pub fn can_focus(mut self, can_focus: bool) -> Self { 457 self.can_focus = Some(can_focus); 458 self 459 } 460 events(mut self, events: gdk::EventMask) -> Self461 pub fn events(mut self, events: gdk::EventMask) -> Self { 462 self.events = Some(events); 463 self 464 } 465 expand(mut self, expand: bool) -> Self466 pub fn expand(mut self, expand: bool) -> Self { 467 self.expand = Some(expand); 468 self 469 } 470 471 #[cfg(any(feature = "v3_20", feature = "dox"))] 472 #[cfg_attr(feature = "dox", doc(cfg(feature = "v3_20")))] focus_on_click(mut self, focus_on_click: bool) -> Self473 pub fn focus_on_click(mut self, focus_on_click: bool) -> Self { 474 self.focus_on_click = Some(focus_on_click); 475 self 476 } 477 halign(mut self, halign: Align) -> Self478 pub fn halign(mut self, halign: Align) -> Self { 479 self.halign = Some(halign); 480 self 481 } 482 has_default(mut self, has_default: bool) -> Self483 pub fn has_default(mut self, has_default: bool) -> Self { 484 self.has_default = Some(has_default); 485 self 486 } 487 has_focus(mut self, has_focus: bool) -> Self488 pub fn has_focus(mut self, has_focus: bool) -> Self { 489 self.has_focus = Some(has_focus); 490 self 491 } 492 has_tooltip(mut self, has_tooltip: bool) -> Self493 pub fn has_tooltip(mut self, has_tooltip: bool) -> Self { 494 self.has_tooltip = Some(has_tooltip); 495 self 496 } 497 height_request(mut self, height_request: i32) -> Self498 pub fn height_request(mut self, height_request: i32) -> Self { 499 self.height_request = Some(height_request); 500 self 501 } 502 hexpand(mut self, hexpand: bool) -> Self503 pub fn hexpand(mut self, hexpand: bool) -> Self { 504 self.hexpand = Some(hexpand); 505 self 506 } 507 hexpand_set(mut self, hexpand_set: bool) -> Self508 pub fn hexpand_set(mut self, hexpand_set: bool) -> Self { 509 self.hexpand_set = Some(hexpand_set); 510 self 511 } 512 is_focus(mut self, is_focus: bool) -> Self513 pub fn is_focus(mut self, is_focus: bool) -> Self { 514 self.is_focus = Some(is_focus); 515 self 516 } 517 margin(mut self, margin: i32) -> Self518 pub fn margin(mut self, margin: i32) -> Self { 519 self.margin = Some(margin); 520 self 521 } 522 margin_bottom(mut self, margin_bottom: i32) -> Self523 pub fn margin_bottom(mut self, margin_bottom: i32) -> Self { 524 self.margin_bottom = Some(margin_bottom); 525 self 526 } 527 margin_end(mut self, margin_end: i32) -> Self528 pub fn margin_end(mut self, margin_end: i32) -> Self { 529 self.margin_end = Some(margin_end); 530 self 531 } 532 margin_start(mut self, margin_start: i32) -> Self533 pub fn margin_start(mut self, margin_start: i32) -> Self { 534 self.margin_start = Some(margin_start); 535 self 536 } 537 margin_top(mut self, margin_top: i32) -> Self538 pub fn margin_top(mut self, margin_top: i32) -> Self { 539 self.margin_top = Some(margin_top); 540 self 541 } 542 name(mut self, name: &str) -> Self543 pub fn name(mut self, name: &str) -> Self { 544 self.name = Some(name.to_string()); 545 self 546 } 547 no_show_all(mut self, no_show_all: bool) -> Self548 pub fn no_show_all(mut self, no_show_all: bool) -> Self { 549 self.no_show_all = Some(no_show_all); 550 self 551 } 552 opacity(mut self, opacity: f64) -> Self553 pub fn opacity(mut self, opacity: f64) -> Self { 554 self.opacity = Some(opacity); 555 self 556 } 557 parent<P: IsA<Container>>(mut self, parent: &P) -> Self558 pub fn parent<P: IsA<Container>>(mut self, parent: &P) -> Self { 559 self.parent = Some(parent.clone().upcast()); 560 self 561 } 562 receives_default(mut self, receives_default: bool) -> Self563 pub fn receives_default(mut self, receives_default: bool) -> Self { 564 self.receives_default = Some(receives_default); 565 self 566 } 567 sensitive(mut self, sensitive: bool) -> Self568 pub fn sensitive(mut self, sensitive: bool) -> Self { 569 self.sensitive = Some(sensitive); 570 self 571 } 572 tooltip_markup(mut self, tooltip_markup: &str) -> Self573 pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self { 574 self.tooltip_markup = Some(tooltip_markup.to_string()); 575 self 576 } 577 tooltip_text(mut self, tooltip_text: &str) -> Self578 pub fn tooltip_text(mut self, tooltip_text: &str) -> Self { 579 self.tooltip_text = Some(tooltip_text.to_string()); 580 self 581 } 582 valign(mut self, valign: Align) -> Self583 pub fn valign(mut self, valign: Align) -> Self { 584 self.valign = Some(valign); 585 self 586 } 587 vexpand(mut self, vexpand: bool) -> Self588 pub fn vexpand(mut self, vexpand: bool) -> Self { 589 self.vexpand = Some(vexpand); 590 self 591 } 592 vexpand_set(mut self, vexpand_set: bool) -> Self593 pub fn vexpand_set(mut self, vexpand_set: bool) -> Self { 594 self.vexpand_set = Some(vexpand_set); 595 self 596 } 597 visible(mut self, visible: bool) -> Self598 pub fn visible(mut self, visible: bool) -> Self { 599 self.visible = Some(visible); 600 self 601 } 602 width_request(mut self, width_request: i32) -> Self603 pub fn width_request(mut self, width_request: i32) -> Self { 604 self.width_request = Some(width_request); 605 self 606 } 607 hadjustment<P: IsA<Adjustment>>(mut self, hadjustment: &P) -> Self608 pub fn hadjustment<P: IsA<Adjustment>>(mut self, hadjustment: &P) -> Self { 609 self.hadjustment = Some(hadjustment.clone().upcast()); 610 self 611 } 612 hscroll_policy(mut self, hscroll_policy: ScrollablePolicy) -> Self613 pub fn hscroll_policy(mut self, hscroll_policy: ScrollablePolicy) -> Self { 614 self.hscroll_policy = Some(hscroll_policy); 615 self 616 } 617 vadjustment<P: IsA<Adjustment>>(mut self, vadjustment: &P) -> Self618 pub fn vadjustment<P: IsA<Adjustment>>(mut self, vadjustment: &P) -> Self { 619 self.vadjustment = Some(vadjustment.clone().upcast()); 620 self 621 } 622 vscroll_policy(mut self, vscroll_policy: ScrollablePolicy) -> Self623 pub fn vscroll_policy(mut self, vscroll_policy: ScrollablePolicy) -> Self { 624 self.vscroll_policy = Some(vscroll_policy); 625 self 626 } 627 } 628 629 pub const NONE_TREE_VIEW: Option<&TreeView> = None; 630 631 pub trait TreeViewExt: 'static { 632 #[doc(alias = "gtk_tree_view_append_column")] append_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i32633 fn append_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i32; 634 635 #[doc(alias = "gtk_tree_view_collapse_all")] collapse_all(&self)636 fn collapse_all(&self); 637 638 #[doc(alias = "gtk_tree_view_collapse_row")] collapse_row(&self, path: &TreePath) -> bool639 fn collapse_row(&self, path: &TreePath) -> bool; 640 641 #[doc(alias = "gtk_tree_view_columns_autosize")] columns_autosize(&self)642 fn columns_autosize(&self); 643 644 #[doc(alias = "gtk_tree_view_convert_bin_window_to_tree_coords")] convert_bin_window_to_tree_coords(&self, bx: i32, by: i32) -> (i32, i32)645 fn convert_bin_window_to_tree_coords(&self, bx: i32, by: i32) -> (i32, i32); 646 647 #[doc(alias = "gtk_tree_view_convert_bin_window_to_widget_coords")] convert_bin_window_to_widget_coords(&self, bx: i32, by: i32) -> (i32, i32)648 fn convert_bin_window_to_widget_coords(&self, bx: i32, by: i32) -> (i32, i32); 649 650 #[doc(alias = "gtk_tree_view_convert_tree_to_bin_window_coords")] convert_tree_to_bin_window_coords(&self, tx: i32, ty: i32) -> (i32, i32)651 fn convert_tree_to_bin_window_coords(&self, tx: i32, ty: i32) -> (i32, i32); 652 653 #[doc(alias = "gtk_tree_view_convert_tree_to_widget_coords")] convert_tree_to_widget_coords(&self, tx: i32, ty: i32) -> (i32, i32)654 fn convert_tree_to_widget_coords(&self, tx: i32, ty: i32) -> (i32, i32); 655 656 #[doc(alias = "gtk_tree_view_convert_widget_to_bin_window_coords")] convert_widget_to_bin_window_coords(&self, wx: i32, wy: i32) -> (i32, i32)657 fn convert_widget_to_bin_window_coords(&self, wx: i32, wy: i32) -> (i32, i32); 658 659 #[doc(alias = "gtk_tree_view_convert_widget_to_tree_coords")] convert_widget_to_tree_coords(&self, wx: i32, wy: i32) -> (i32, i32)660 fn convert_widget_to_tree_coords(&self, wx: i32, wy: i32) -> (i32, i32); 661 662 #[doc(alias = "gtk_tree_view_create_row_drag_icon")] create_row_drag_icon(&self, path: &TreePath) -> Option<cairo::Surface>663 fn create_row_drag_icon(&self, path: &TreePath) -> Option<cairo::Surface>; 664 665 #[doc(alias = "gtk_tree_view_expand_all")] expand_all(&self)666 fn expand_all(&self); 667 668 #[doc(alias = "gtk_tree_view_expand_row")] expand_row(&self, path: &TreePath, open_all: bool) -> bool669 fn expand_row(&self, path: &TreePath, open_all: bool) -> bool; 670 671 #[doc(alias = "gtk_tree_view_expand_to_path")] expand_to_path(&self, path: &TreePath)672 fn expand_to_path(&self, path: &TreePath); 673 674 #[doc(alias = "gtk_tree_view_get_activate_on_single_click")] 675 #[doc(alias = "get_activate_on_single_click")] activates_on_single_click(&self) -> bool676 fn activates_on_single_click(&self) -> bool; 677 678 #[doc(alias = "gtk_tree_view_get_background_area")] 679 #[doc(alias = "get_background_area")] background_area<P: IsA<TreeViewColumn>>( &self, path: Option<&TreePath>, column: Option<&P>, ) -> gdk::Rectangle680 fn background_area<P: IsA<TreeViewColumn>>( 681 &self, 682 path: Option<&TreePath>, 683 column: Option<&P>, 684 ) -> gdk::Rectangle; 685 686 #[doc(alias = "gtk_tree_view_get_bin_window")] 687 #[doc(alias = "get_bin_window")] bin_window(&self) -> Option<gdk::Window>688 fn bin_window(&self) -> Option<gdk::Window>; 689 690 #[doc(alias = "gtk_tree_view_get_cell_area")] 691 #[doc(alias = "get_cell_area")] cell_area<P: IsA<TreeViewColumn>>( &self, path: Option<&TreePath>, column: Option<&P>, ) -> gdk::Rectangle692 fn cell_area<P: IsA<TreeViewColumn>>( 693 &self, 694 path: Option<&TreePath>, 695 column: Option<&P>, 696 ) -> gdk::Rectangle; 697 698 #[doc(alias = "gtk_tree_view_get_column")] 699 #[doc(alias = "get_column")] column(&self, n: i32) -> Option<TreeViewColumn>700 fn column(&self, n: i32) -> Option<TreeViewColumn>; 701 702 #[doc(alias = "gtk_tree_view_get_columns")] 703 #[doc(alias = "get_columns")] columns(&self) -> Vec<TreeViewColumn>704 fn columns(&self) -> Vec<TreeViewColumn>; 705 706 #[doc(alias = "gtk_tree_view_get_cursor")] 707 #[doc(alias = "get_cursor")] cursor(&self) -> (Option<TreePath>, Option<TreeViewColumn>)708 fn cursor(&self) -> (Option<TreePath>, Option<TreeViewColumn>); 709 710 #[doc(alias = "gtk_tree_view_get_dest_row_at_pos")] 711 #[doc(alias = "get_dest_row_at_pos")] dest_row_at_pos( &self, drag_x: i32, drag_y: i32, ) -> Option<(Option<TreePath>, TreeViewDropPosition)>712 fn dest_row_at_pos( 713 &self, 714 drag_x: i32, 715 drag_y: i32, 716 ) -> Option<(Option<TreePath>, TreeViewDropPosition)>; 717 718 #[doc(alias = "gtk_tree_view_get_drag_dest_row")] 719 #[doc(alias = "get_drag_dest_row")] drag_dest_row(&self) -> (Option<TreePath>, TreeViewDropPosition)720 fn drag_dest_row(&self) -> (Option<TreePath>, TreeViewDropPosition); 721 722 #[doc(alias = "gtk_tree_view_get_enable_search")] 723 #[doc(alias = "get_enable_search")] enables_search(&self) -> bool724 fn enables_search(&self) -> bool; 725 726 #[doc(alias = "gtk_tree_view_get_enable_tree_lines")] 727 #[doc(alias = "get_enable_tree_lines")] enables_tree_lines(&self) -> bool728 fn enables_tree_lines(&self) -> bool; 729 730 #[doc(alias = "gtk_tree_view_get_expander_column")] 731 #[doc(alias = "get_expander_column")] expander_column(&self) -> Option<TreeViewColumn>732 fn expander_column(&self) -> Option<TreeViewColumn>; 733 734 #[doc(alias = "gtk_tree_view_get_fixed_height_mode")] 735 #[doc(alias = "get_fixed_height_mode")] is_fixed_height_mode(&self) -> bool736 fn is_fixed_height_mode(&self) -> bool; 737 738 #[doc(alias = "gtk_tree_view_get_grid_lines")] 739 #[doc(alias = "get_grid_lines")] grid_lines(&self) -> TreeViewGridLines740 fn grid_lines(&self) -> TreeViewGridLines; 741 742 #[doc(alias = "gtk_tree_view_get_headers_clickable")] 743 #[doc(alias = "get_headers_clickable")] is_headers_clickable(&self) -> bool744 fn is_headers_clickable(&self) -> bool; 745 746 #[doc(alias = "gtk_tree_view_get_headers_visible")] 747 #[doc(alias = "get_headers_visible")] is_headers_visible(&self) -> bool748 fn is_headers_visible(&self) -> bool; 749 750 #[doc(alias = "gtk_tree_view_get_hover_expand")] 751 #[doc(alias = "get_hover_expand")] hover_expands(&self) -> bool752 fn hover_expands(&self) -> bool; 753 754 #[doc(alias = "gtk_tree_view_get_hover_selection")] 755 #[doc(alias = "get_hover_selection")] is_hover_selection(&self) -> bool756 fn is_hover_selection(&self) -> bool; 757 758 #[doc(alias = "gtk_tree_view_get_level_indentation")] 759 #[doc(alias = "get_level_indentation")] level_indentation(&self) -> i32760 fn level_indentation(&self) -> i32; 761 762 #[doc(alias = "gtk_tree_view_get_model")] 763 #[doc(alias = "get_model")] model(&self) -> Option<TreeModel>764 fn model(&self) -> Option<TreeModel>; 765 766 #[doc(alias = "gtk_tree_view_get_n_columns")] 767 #[doc(alias = "get_n_columns")] n_columns(&self) -> u32768 fn n_columns(&self) -> u32; 769 770 #[doc(alias = "gtk_tree_view_get_path_at_pos")] 771 #[doc(alias = "get_path_at_pos")] path_at_pos( &self, x: i32, y: i32, ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)>772 fn path_at_pos( 773 &self, 774 x: i32, 775 y: i32, 776 ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)>; 777 778 #[doc(alias = "gtk_tree_view_get_reorderable")] 779 #[doc(alias = "get_reorderable")] is_reorderable(&self) -> bool780 fn is_reorderable(&self) -> bool; 781 782 //#[doc(alias = "gtk_tree_view_get_row_separator_func")] 783 //#[doc(alias = "get_row_separator_func")] 784 //fn row_separator_func(&self) -> Option<Box_<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>; 785 786 #[doc(alias = "gtk_tree_view_get_rubber_banding")] 787 #[doc(alias = "get_rubber_banding")] is_rubber_banding(&self) -> bool788 fn is_rubber_banding(&self) -> bool; 789 790 #[doc(alias = "gtk_tree_view_get_search_column")] 791 #[doc(alias = "get_search_column")] search_column(&self) -> i32792 fn search_column(&self) -> i32; 793 794 #[doc(alias = "gtk_tree_view_get_search_entry")] 795 #[doc(alias = "get_search_entry")] search_entry(&self) -> Option<Entry>796 fn search_entry(&self) -> Option<Entry>; 797 798 //#[doc(alias = "gtk_tree_view_get_search_equal_func")] 799 //#[doc(alias = "get_search_equal_func")] 800 //fn search_equal_func(&self) -> Option<Box_<dyn Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static>>; 801 802 //#[doc(alias = "gtk_tree_view_get_search_position_func")] 803 //#[doc(alias = "get_search_position_func")] 804 //fn search_position_func(&self) -> Option<Box_<dyn Fn(&TreeView, &Widget) + 'static>>; 805 806 #[doc(alias = "gtk_tree_view_get_selection")] 807 #[doc(alias = "get_selection")] selection(&self) -> TreeSelection808 fn selection(&self) -> TreeSelection; 809 810 #[doc(alias = "gtk_tree_view_get_show_expanders")] 811 #[doc(alias = "get_show_expanders")] shows_expanders(&self) -> bool812 fn shows_expanders(&self) -> bool; 813 814 #[doc(alias = "gtk_tree_view_get_tooltip_column")] 815 #[doc(alias = "get_tooltip_column")] tooltip_column(&self) -> i32816 fn tooltip_column(&self) -> i32; 817 818 #[doc(alias = "gtk_tree_view_get_tooltip_context")] 819 #[doc(alias = "get_tooltip_context")] tooltip_context( &self, x: &mut i32, y: &mut i32, keyboard_tip: bool, ) -> Option<(Option<TreeModel>, TreePath, TreeIter)>820 fn tooltip_context( 821 &self, 822 x: &mut i32, 823 y: &mut i32, 824 keyboard_tip: bool, 825 ) -> Option<(Option<TreeModel>, TreePath, TreeIter)>; 826 827 #[doc(alias = "gtk_tree_view_get_visible_range")] 828 #[doc(alias = "get_visible_range")] visible_range(&self) -> Option<(TreePath, TreePath)>829 fn visible_range(&self) -> Option<(TreePath, TreePath)>; 830 831 #[doc(alias = "gtk_tree_view_get_visible_rect")] 832 #[doc(alias = "get_visible_rect")] visible_rect(&self) -> gdk::Rectangle833 fn visible_rect(&self) -> gdk::Rectangle; 834 835 #[doc(alias = "gtk_tree_view_insert_column")] insert_column<P: IsA<TreeViewColumn>>(&self, column: &P, position: i32) -> i32836 fn insert_column<P: IsA<TreeViewColumn>>(&self, column: &P, position: i32) -> i32; 837 838 //#[doc(alias = "gtk_tree_view_insert_column_with_attributes")] 839 //fn insert_column_with_attributes<P: IsA<CellRenderer>>(&self, position: i32, title: &str, cell: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> i32; 840 841 #[doc(alias = "gtk_tree_view_insert_column_with_data_func")] insert_column_with_data_func< P: IsA<CellRenderer>, Q: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static, >( &self, position: i32, title: &str, cell: &P, func: Q, ) -> i32842 fn insert_column_with_data_func< 843 P: IsA<CellRenderer>, 844 Q: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static, 845 >( 846 &self, 847 position: i32, 848 title: &str, 849 cell: &P, 850 func: Q, 851 ) -> i32; 852 853 #[doc(alias = "gtk_tree_view_is_blank_at_pos")] is_blank_at_pos( &self, x: i32, y: i32, ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)>854 fn is_blank_at_pos( 855 &self, 856 x: i32, 857 y: i32, 858 ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)>; 859 860 #[doc(alias = "gtk_tree_view_is_rubber_banding_active")] is_rubber_banding_active(&self) -> bool861 fn is_rubber_banding_active(&self) -> bool; 862 863 #[doc(alias = "gtk_tree_view_map_expanded_rows")] map_expanded_rows<P: FnMut(&TreeView, &TreePath)>(&self, func: P)864 fn map_expanded_rows<P: FnMut(&TreeView, &TreePath)>(&self, func: P); 865 866 #[doc(alias = "gtk_tree_view_move_column_after")] move_column_after<P: IsA<TreeViewColumn>, Q: IsA<TreeViewColumn>>( &self, column: &P, base_column: Option<&Q>, )867 fn move_column_after<P: IsA<TreeViewColumn>, Q: IsA<TreeViewColumn>>( 868 &self, 869 column: &P, 870 base_column: Option<&Q>, 871 ); 872 873 #[doc(alias = "gtk_tree_view_remove_column")] remove_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i32874 fn remove_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i32; 875 876 #[doc(alias = "gtk_tree_view_row_activated")] row_activated<P: IsA<TreeViewColumn>>(&self, path: &TreePath, column: &P)877 fn row_activated<P: IsA<TreeViewColumn>>(&self, path: &TreePath, column: &P); 878 879 #[doc(alias = "gtk_tree_view_row_expanded")] row_expanded(&self, path: &TreePath) -> bool880 fn row_expanded(&self, path: &TreePath) -> bool; 881 882 #[doc(alias = "gtk_tree_view_scroll_to_cell")] scroll_to_cell<P: IsA<TreeViewColumn>>( &self, path: Option<&TreePath>, column: Option<&P>, use_align: bool, row_align: f32, col_align: f32, )883 fn scroll_to_cell<P: IsA<TreeViewColumn>>( 884 &self, 885 path: Option<&TreePath>, 886 column: Option<&P>, 887 use_align: bool, 888 row_align: f32, 889 col_align: f32, 890 ); 891 892 #[doc(alias = "gtk_tree_view_scroll_to_point")] scroll_to_point(&self, tree_x: i32, tree_y: i32)893 fn scroll_to_point(&self, tree_x: i32, tree_y: i32); 894 895 #[doc(alias = "gtk_tree_view_set_activate_on_single_click")] set_activate_on_single_click(&self, single: bool)896 fn set_activate_on_single_click(&self, single: bool); 897 898 #[doc(alias = "gtk_tree_view_set_column_drag_function")] set_column_drag_function( &self, func: Option< Box_< dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool + 'static, >, >, )899 fn set_column_drag_function( 900 &self, 901 func: Option< 902 Box_< 903 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool 904 + 'static, 905 >, 906 >, 907 ); 908 909 #[doc(alias = "gtk_tree_view_set_cursor")] set_cursor<P: IsA<TreeViewColumn>>( &self, path: &TreePath, focus_column: Option<&P>, start_editing: bool, )910 fn set_cursor<P: IsA<TreeViewColumn>>( 911 &self, 912 path: &TreePath, 913 focus_column: Option<&P>, 914 start_editing: bool, 915 ); 916 917 #[doc(alias = "gtk_tree_view_set_cursor_on_cell")] set_cursor_on_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( &self, path: &TreePath, focus_column: Option<&P>, focus_cell: Option<&Q>, start_editing: bool, )918 fn set_cursor_on_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( 919 &self, 920 path: &TreePath, 921 focus_column: Option<&P>, 922 focus_cell: Option<&Q>, 923 start_editing: bool, 924 ); 925 926 #[doc(alias = "gtk_tree_view_set_drag_dest_row")] set_drag_dest_row(&self, path: Option<&TreePath>, pos: TreeViewDropPosition)927 fn set_drag_dest_row(&self, path: Option<&TreePath>, pos: TreeViewDropPosition); 928 929 #[doc(alias = "gtk_tree_view_set_enable_search")] set_enable_search(&self, enable_search: bool)930 fn set_enable_search(&self, enable_search: bool); 931 932 #[doc(alias = "gtk_tree_view_set_enable_tree_lines")] set_enable_tree_lines(&self, enabled: bool)933 fn set_enable_tree_lines(&self, enabled: bool); 934 935 #[doc(alias = "gtk_tree_view_set_expander_column")] set_expander_column<P: IsA<TreeViewColumn>>(&self, column: Option<&P>)936 fn set_expander_column<P: IsA<TreeViewColumn>>(&self, column: Option<&P>); 937 938 #[doc(alias = "gtk_tree_view_set_fixed_height_mode")] set_fixed_height_mode(&self, enable: bool)939 fn set_fixed_height_mode(&self, enable: bool); 940 941 #[doc(alias = "gtk_tree_view_set_grid_lines")] set_grid_lines(&self, grid_lines: TreeViewGridLines)942 fn set_grid_lines(&self, grid_lines: TreeViewGridLines); 943 944 #[doc(alias = "gtk_tree_view_set_headers_clickable")] set_headers_clickable(&self, setting: bool)945 fn set_headers_clickable(&self, setting: bool); 946 947 #[doc(alias = "gtk_tree_view_set_headers_visible")] set_headers_visible(&self, headers_visible: bool)948 fn set_headers_visible(&self, headers_visible: bool); 949 950 #[doc(alias = "gtk_tree_view_set_hover_expand")] set_hover_expand(&self, expand: bool)951 fn set_hover_expand(&self, expand: bool); 952 953 #[doc(alias = "gtk_tree_view_set_hover_selection")] set_hover_selection(&self, hover: bool)954 fn set_hover_selection(&self, hover: bool); 955 956 #[doc(alias = "gtk_tree_view_set_level_indentation")] set_level_indentation(&self, indentation: i32)957 fn set_level_indentation(&self, indentation: i32); 958 959 #[doc(alias = "gtk_tree_view_set_model")] set_model<P: IsA<TreeModel>>(&self, model: Option<&P>)960 fn set_model<P: IsA<TreeModel>>(&self, model: Option<&P>); 961 962 #[doc(alias = "gtk_tree_view_set_reorderable")] set_reorderable(&self, reorderable: bool)963 fn set_reorderable(&self, reorderable: bool); 964 965 #[doc(alias = "gtk_tree_view_set_row_separator_func")] set_row_separator_func( &self, func: Option<Box_<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>, )966 fn set_row_separator_func( 967 &self, 968 func: Option<Box_<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>, 969 ); 970 971 #[doc(alias = "gtk_tree_view_set_rubber_banding")] set_rubber_banding(&self, enable: bool)972 fn set_rubber_banding(&self, enable: bool); 973 974 #[doc(alias = "gtk_tree_view_set_search_column")] set_search_column(&self, column: i32)975 fn set_search_column(&self, column: i32); 976 977 #[doc(alias = "gtk_tree_view_set_search_entry")] set_search_entry<P: IsA<Entry>>(&self, entry: Option<&P>)978 fn set_search_entry<P: IsA<Entry>>(&self, entry: Option<&P>); 979 980 #[doc(alias = "gtk_tree_view_set_search_equal_func")] set_search_equal_func<P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static>( &self, search_equal_func: P, )981 fn set_search_equal_func<P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static>( 982 &self, 983 search_equal_func: P, 984 ); 985 986 #[doc(alias = "gtk_tree_view_set_search_position_func")] set_search_position_func(&self, func: Option<Box_<dyn Fn(&TreeView, &Widget) + 'static>>)987 fn set_search_position_func(&self, func: Option<Box_<dyn Fn(&TreeView, &Widget) + 'static>>); 988 989 #[doc(alias = "gtk_tree_view_set_show_expanders")] set_show_expanders(&self, enabled: bool)990 fn set_show_expanders(&self, enabled: bool); 991 992 #[doc(alias = "gtk_tree_view_set_tooltip_cell")] set_tooltip_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( &self, tooltip: &Tooltip, path: Option<&TreePath>, column: Option<&P>, cell: Option<&Q>, )993 fn set_tooltip_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( 994 &self, 995 tooltip: &Tooltip, 996 path: Option<&TreePath>, 997 column: Option<&P>, 998 cell: Option<&Q>, 999 ); 1000 1001 #[doc(alias = "gtk_tree_view_set_tooltip_column")] set_tooltip_column(&self, column: i32)1002 fn set_tooltip_column(&self, column: i32); 1003 1004 #[doc(alias = "gtk_tree_view_set_tooltip_row")] set_tooltip_row(&self, tooltip: &Tooltip, path: &TreePath)1005 fn set_tooltip_row(&self, tooltip: &Tooltip, path: &TreePath); 1006 1007 #[doc(alias = "gtk_tree_view_unset_rows_drag_dest")] unset_rows_drag_dest(&self)1008 fn unset_rows_drag_dest(&self); 1009 1010 #[doc(alias = "gtk_tree_view_unset_rows_drag_source")] unset_rows_drag_source(&self)1011 fn unset_rows_drag_source(&self); 1012 1013 #[doc(alias = "enable-grid-lines")] enable_grid_lines(&self) -> TreeViewGridLines1014 fn enable_grid_lines(&self) -> TreeViewGridLines; 1015 1016 #[doc(alias = "enable-grid-lines")] set_enable_grid_lines(&self, enable_grid_lines: TreeViewGridLines)1017 fn set_enable_grid_lines(&self, enable_grid_lines: TreeViewGridLines); 1018 1019 #[doc(alias = "ubuntu-almost-fixed-height-mode")] set_ubuntu_almost_fixed_height_mode(&self, ubuntu_almost_fixed_height_mode: bool)1020 fn set_ubuntu_almost_fixed_height_mode(&self, ubuntu_almost_fixed_height_mode: bool); 1021 1022 #[doc(alias = "columns-changed")] connect_columns_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1023 fn connect_columns_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1024 1025 #[doc(alias = "cursor-changed")] connect_cursor_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1026 fn connect_cursor_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1027 1028 #[doc(alias = "expand-collapse-cursor-row")] connect_expand_collapse_cursor_row<F: Fn(&Self, bool, bool, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId1029 fn connect_expand_collapse_cursor_row<F: Fn(&Self, bool, bool, bool) -> bool + 'static>( 1030 &self, 1031 f: F, 1032 ) -> SignalHandlerId; 1033 emit_expand_collapse_cursor_row(&self, object: bool, p0: bool, p1: bool) -> bool1034 fn emit_expand_collapse_cursor_row(&self, object: bool, p0: bool, p1: bool) -> bool; 1035 1036 #[doc(alias = "move-cursor")] connect_move_cursor<F: Fn(&Self, MovementStep, i32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId1037 fn connect_move_cursor<F: Fn(&Self, MovementStep, i32) -> bool + 'static>( 1038 &self, 1039 f: F, 1040 ) -> SignalHandlerId; 1041 emit_move_cursor(&self, step: MovementStep, direction: i32) -> bool1042 fn emit_move_cursor(&self, step: MovementStep, direction: i32) -> bool; 1043 1044 #[doc(alias = "row-activated")] connect_row_activated<F: Fn(&Self, &TreePath, &TreeViewColumn) + 'static>( &self, f: F, ) -> SignalHandlerId1045 fn connect_row_activated<F: Fn(&Self, &TreePath, &TreeViewColumn) + 'static>( 1046 &self, 1047 f: F, 1048 ) -> SignalHandlerId; 1049 emit_row_activated(&self, path: &TreePath, column: &TreeViewColumn)1050 fn emit_row_activated(&self, path: &TreePath, column: &TreeViewColumn); 1051 1052 #[doc(alias = "row-collapsed")] connect_row_collapsed<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( &self, f: F, ) -> SignalHandlerId1053 fn connect_row_collapsed<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( 1054 &self, 1055 f: F, 1056 ) -> SignalHandlerId; 1057 1058 #[doc(alias = "row-expanded")] connect_row_expanded<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( &self, f: F, ) -> SignalHandlerId1059 fn connect_row_expanded<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( 1060 &self, 1061 f: F, 1062 ) -> SignalHandlerId; 1063 1064 #[doc(alias = "select-all")] connect_select_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId1065 fn connect_select_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId; 1066 emit_select_all(&self) -> bool1067 fn emit_select_all(&self) -> bool; 1068 1069 #[doc(alias = "select-cursor-parent")] connect_select_cursor_parent<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId1070 fn connect_select_cursor_parent<F: Fn(&Self) -> bool + 'static>(&self, f: F) 1071 -> SignalHandlerId; 1072 emit_select_cursor_parent(&self) -> bool1073 fn emit_select_cursor_parent(&self) -> bool; 1074 1075 #[doc(alias = "select-cursor-row")] connect_select_cursor_row<F: Fn(&Self, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId1076 fn connect_select_cursor_row<F: Fn(&Self, bool) -> bool + 'static>( 1077 &self, 1078 f: F, 1079 ) -> SignalHandlerId; 1080 emit_select_cursor_row(&self, object: bool) -> bool1081 fn emit_select_cursor_row(&self, object: bool) -> bool; 1082 1083 #[doc(alias = "start-interactive-search")] connect_start_interactive_search<F: Fn(&Self) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId1084 fn connect_start_interactive_search<F: Fn(&Self) -> bool + 'static>( 1085 &self, 1086 f: F, 1087 ) -> SignalHandlerId; 1088 emit_start_interactive_search(&self) -> bool1089 fn emit_start_interactive_search(&self) -> bool; 1090 1091 #[doc(alias = "test-collapse-row")] connect_test_collapse_row< F: Fn(&Self, &TreeIter, &TreePath) -> glib::signal::Inhibit + 'static, >( &self, f: F, ) -> SignalHandlerId1092 fn connect_test_collapse_row< 1093 F: Fn(&Self, &TreeIter, &TreePath) -> glib::signal::Inhibit + 'static, 1094 >( 1095 &self, 1096 f: F, 1097 ) -> SignalHandlerId; 1098 1099 #[doc(alias = "test-expand-row")] connect_test_expand_row< F: Fn(&Self, &TreeIter, &TreePath) -> glib::signal::Inhibit + 'static, >( &self, f: F, ) -> SignalHandlerId1100 fn connect_test_expand_row< 1101 F: Fn(&Self, &TreeIter, &TreePath) -> glib::signal::Inhibit + 'static, 1102 >( 1103 &self, 1104 f: F, 1105 ) -> SignalHandlerId; 1106 1107 #[doc(alias = "toggle-cursor-row")] connect_toggle_cursor_row<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId1108 fn connect_toggle_cursor_row<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId; 1109 emit_toggle_cursor_row(&self) -> bool1110 fn emit_toggle_cursor_row(&self) -> bool; 1111 1112 #[doc(alias = "unselect-all")] connect_unselect_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId1113 fn connect_unselect_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId; 1114 emit_unselect_all(&self) -> bool1115 fn emit_unselect_all(&self) -> bool; 1116 1117 #[doc(alias = "activate-on-single-click")] connect_activate_on_single_click_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1118 fn connect_activate_on_single_click_notify<F: Fn(&Self) + 'static>( 1119 &self, 1120 f: F, 1121 ) -> SignalHandlerId; 1122 1123 #[doc(alias = "enable-grid-lines")] connect_enable_grid_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1124 fn connect_enable_grid_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1125 1126 #[doc(alias = "enable-search")] connect_enable_search_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1127 fn connect_enable_search_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1128 1129 #[doc(alias = "enable-tree-lines")] connect_enable_tree_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1130 fn connect_enable_tree_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1131 1132 #[doc(alias = "expander-column")] connect_expander_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1133 fn connect_expander_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1134 1135 #[doc(alias = "fixed-height-mode")] connect_fixed_height_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1136 fn connect_fixed_height_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1137 1138 #[doc(alias = "headers-clickable")] connect_headers_clickable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1139 fn connect_headers_clickable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1140 1141 #[doc(alias = "headers-visible")] connect_headers_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1142 fn connect_headers_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1143 1144 #[doc(alias = "hover-expand")] connect_hover_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1145 fn connect_hover_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1146 1147 #[doc(alias = "hover-selection")] connect_hover_selection_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1148 fn connect_hover_selection_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1149 1150 #[doc(alias = "level-indentation")] connect_level_indentation_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1151 fn connect_level_indentation_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1152 1153 #[doc(alias = "model")] connect_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1154 fn connect_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1155 1156 #[doc(alias = "reorderable")] connect_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1157 fn connect_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1158 1159 #[doc(alias = "rubber-banding")] connect_rubber_banding_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1160 fn connect_rubber_banding_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1161 1162 #[doc(alias = "search-column")] connect_search_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1163 fn connect_search_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1164 1165 #[doc(alias = "show-expanders")] connect_show_expanders_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1166 fn connect_show_expanders_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1167 1168 #[doc(alias = "tooltip-column")] connect_tooltip_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1169 fn connect_tooltip_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1170 1171 #[doc(alias = "ubuntu-almost-fixed-height-mode")] connect_ubuntu_almost_fixed_height_mode_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1172 fn connect_ubuntu_almost_fixed_height_mode_notify<F: Fn(&Self) + 'static>( 1173 &self, 1174 f: F, 1175 ) -> SignalHandlerId; 1176 } 1177 1178 impl<O: IsA<TreeView>> TreeViewExt for O { append_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i321179 fn append_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i32 { 1180 unsafe { 1181 ffi::gtk_tree_view_append_column( 1182 self.as_ref().to_glib_none().0, 1183 column.as_ref().to_glib_none().0, 1184 ) 1185 } 1186 } 1187 collapse_all(&self)1188 fn collapse_all(&self) { 1189 unsafe { 1190 ffi::gtk_tree_view_collapse_all(self.as_ref().to_glib_none().0); 1191 } 1192 } 1193 collapse_row(&self, path: &TreePath) -> bool1194 fn collapse_row(&self, path: &TreePath) -> bool { 1195 unsafe { 1196 from_glib(ffi::gtk_tree_view_collapse_row( 1197 self.as_ref().to_glib_none().0, 1198 mut_override(path.to_glib_none().0), 1199 )) 1200 } 1201 } 1202 columns_autosize(&self)1203 fn columns_autosize(&self) { 1204 unsafe { 1205 ffi::gtk_tree_view_columns_autosize(self.as_ref().to_glib_none().0); 1206 } 1207 } 1208 convert_bin_window_to_tree_coords(&self, bx: i32, by: i32) -> (i32, i32)1209 fn convert_bin_window_to_tree_coords(&self, bx: i32, by: i32) -> (i32, i32) { 1210 unsafe { 1211 let mut tx = mem::MaybeUninit::uninit(); 1212 let mut ty = mem::MaybeUninit::uninit(); 1213 ffi::gtk_tree_view_convert_bin_window_to_tree_coords( 1214 self.as_ref().to_glib_none().0, 1215 bx, 1216 by, 1217 tx.as_mut_ptr(), 1218 ty.as_mut_ptr(), 1219 ); 1220 let tx = tx.assume_init(); 1221 let ty = ty.assume_init(); 1222 (tx, ty) 1223 } 1224 } 1225 convert_bin_window_to_widget_coords(&self, bx: i32, by: i32) -> (i32, i32)1226 fn convert_bin_window_to_widget_coords(&self, bx: i32, by: i32) -> (i32, i32) { 1227 unsafe { 1228 let mut wx = mem::MaybeUninit::uninit(); 1229 let mut wy = mem::MaybeUninit::uninit(); 1230 ffi::gtk_tree_view_convert_bin_window_to_widget_coords( 1231 self.as_ref().to_glib_none().0, 1232 bx, 1233 by, 1234 wx.as_mut_ptr(), 1235 wy.as_mut_ptr(), 1236 ); 1237 let wx = wx.assume_init(); 1238 let wy = wy.assume_init(); 1239 (wx, wy) 1240 } 1241 } 1242 convert_tree_to_bin_window_coords(&self, tx: i32, ty: i32) -> (i32, i32)1243 fn convert_tree_to_bin_window_coords(&self, tx: i32, ty: i32) -> (i32, i32) { 1244 unsafe { 1245 let mut bx = mem::MaybeUninit::uninit(); 1246 let mut by = mem::MaybeUninit::uninit(); 1247 ffi::gtk_tree_view_convert_tree_to_bin_window_coords( 1248 self.as_ref().to_glib_none().0, 1249 tx, 1250 ty, 1251 bx.as_mut_ptr(), 1252 by.as_mut_ptr(), 1253 ); 1254 let bx = bx.assume_init(); 1255 let by = by.assume_init(); 1256 (bx, by) 1257 } 1258 } 1259 convert_tree_to_widget_coords(&self, tx: i32, ty: i32) -> (i32, i32)1260 fn convert_tree_to_widget_coords(&self, tx: i32, ty: i32) -> (i32, i32) { 1261 unsafe { 1262 let mut wx = mem::MaybeUninit::uninit(); 1263 let mut wy = mem::MaybeUninit::uninit(); 1264 ffi::gtk_tree_view_convert_tree_to_widget_coords( 1265 self.as_ref().to_glib_none().0, 1266 tx, 1267 ty, 1268 wx.as_mut_ptr(), 1269 wy.as_mut_ptr(), 1270 ); 1271 let wx = wx.assume_init(); 1272 let wy = wy.assume_init(); 1273 (wx, wy) 1274 } 1275 } 1276 convert_widget_to_bin_window_coords(&self, wx: i32, wy: i32) -> (i32, i32)1277 fn convert_widget_to_bin_window_coords(&self, wx: i32, wy: i32) -> (i32, i32) { 1278 unsafe { 1279 let mut bx = mem::MaybeUninit::uninit(); 1280 let mut by = mem::MaybeUninit::uninit(); 1281 ffi::gtk_tree_view_convert_widget_to_bin_window_coords( 1282 self.as_ref().to_glib_none().0, 1283 wx, 1284 wy, 1285 bx.as_mut_ptr(), 1286 by.as_mut_ptr(), 1287 ); 1288 let bx = bx.assume_init(); 1289 let by = by.assume_init(); 1290 (bx, by) 1291 } 1292 } 1293 convert_widget_to_tree_coords(&self, wx: i32, wy: i32) -> (i32, i32)1294 fn convert_widget_to_tree_coords(&self, wx: i32, wy: i32) -> (i32, i32) { 1295 unsafe { 1296 let mut tx = mem::MaybeUninit::uninit(); 1297 let mut ty = mem::MaybeUninit::uninit(); 1298 ffi::gtk_tree_view_convert_widget_to_tree_coords( 1299 self.as_ref().to_glib_none().0, 1300 wx, 1301 wy, 1302 tx.as_mut_ptr(), 1303 ty.as_mut_ptr(), 1304 ); 1305 let tx = tx.assume_init(); 1306 let ty = ty.assume_init(); 1307 (tx, ty) 1308 } 1309 } 1310 create_row_drag_icon(&self, path: &TreePath) -> Option<cairo::Surface>1311 fn create_row_drag_icon(&self, path: &TreePath) -> Option<cairo::Surface> { 1312 unsafe { 1313 from_glib_full(ffi::gtk_tree_view_create_row_drag_icon( 1314 self.as_ref().to_glib_none().0, 1315 mut_override(path.to_glib_none().0), 1316 )) 1317 } 1318 } 1319 expand_all(&self)1320 fn expand_all(&self) { 1321 unsafe { 1322 ffi::gtk_tree_view_expand_all(self.as_ref().to_glib_none().0); 1323 } 1324 } 1325 expand_row(&self, path: &TreePath, open_all: bool) -> bool1326 fn expand_row(&self, path: &TreePath, open_all: bool) -> bool { 1327 unsafe { 1328 from_glib(ffi::gtk_tree_view_expand_row( 1329 self.as_ref().to_glib_none().0, 1330 mut_override(path.to_glib_none().0), 1331 open_all.into_glib(), 1332 )) 1333 } 1334 } 1335 expand_to_path(&self, path: &TreePath)1336 fn expand_to_path(&self, path: &TreePath) { 1337 unsafe { 1338 ffi::gtk_tree_view_expand_to_path( 1339 self.as_ref().to_glib_none().0, 1340 mut_override(path.to_glib_none().0), 1341 ); 1342 } 1343 } 1344 activates_on_single_click(&self) -> bool1345 fn activates_on_single_click(&self) -> bool { 1346 unsafe { 1347 from_glib(ffi::gtk_tree_view_get_activate_on_single_click( 1348 self.as_ref().to_glib_none().0, 1349 )) 1350 } 1351 } 1352 background_area<P: IsA<TreeViewColumn>>( &self, path: Option<&TreePath>, column: Option<&P>, ) -> gdk::Rectangle1353 fn background_area<P: IsA<TreeViewColumn>>( 1354 &self, 1355 path: Option<&TreePath>, 1356 column: Option<&P>, 1357 ) -> gdk::Rectangle { 1358 unsafe { 1359 let mut rect = gdk::Rectangle::uninitialized(); 1360 ffi::gtk_tree_view_get_background_area( 1361 self.as_ref().to_glib_none().0, 1362 mut_override(path.to_glib_none().0), 1363 column.map(|p| p.as_ref()).to_glib_none().0, 1364 rect.to_glib_none_mut().0, 1365 ); 1366 rect 1367 } 1368 } 1369 bin_window(&self) -> Option<gdk::Window>1370 fn bin_window(&self) -> Option<gdk::Window> { 1371 unsafe { 1372 from_glib_none(ffi::gtk_tree_view_get_bin_window( 1373 self.as_ref().to_glib_none().0, 1374 )) 1375 } 1376 } 1377 cell_area<P: IsA<TreeViewColumn>>( &self, path: Option<&TreePath>, column: Option<&P>, ) -> gdk::Rectangle1378 fn cell_area<P: IsA<TreeViewColumn>>( 1379 &self, 1380 path: Option<&TreePath>, 1381 column: Option<&P>, 1382 ) -> gdk::Rectangle { 1383 unsafe { 1384 let mut rect = gdk::Rectangle::uninitialized(); 1385 ffi::gtk_tree_view_get_cell_area( 1386 self.as_ref().to_glib_none().0, 1387 mut_override(path.to_glib_none().0), 1388 column.map(|p| p.as_ref()).to_glib_none().0, 1389 rect.to_glib_none_mut().0, 1390 ); 1391 rect 1392 } 1393 } 1394 column(&self, n: i32) -> Option<TreeViewColumn>1395 fn column(&self, n: i32) -> Option<TreeViewColumn> { 1396 unsafe { 1397 from_glib_none(ffi::gtk_tree_view_get_column( 1398 self.as_ref().to_glib_none().0, 1399 n, 1400 )) 1401 } 1402 } 1403 columns(&self) -> Vec<TreeViewColumn>1404 fn columns(&self) -> Vec<TreeViewColumn> { 1405 unsafe { 1406 FromGlibPtrContainer::from_glib_container(ffi::gtk_tree_view_get_columns( 1407 self.as_ref().to_glib_none().0, 1408 )) 1409 } 1410 } 1411 cursor(&self) -> (Option<TreePath>, Option<TreeViewColumn>)1412 fn cursor(&self) -> (Option<TreePath>, Option<TreeViewColumn>) { 1413 unsafe { 1414 let mut path = ptr::null_mut(); 1415 let mut focus_column = ptr::null_mut(); 1416 ffi::gtk_tree_view_get_cursor( 1417 self.as_ref().to_glib_none().0, 1418 &mut path, 1419 &mut focus_column, 1420 ); 1421 (from_glib_full(path), from_glib_none(focus_column)) 1422 } 1423 } 1424 dest_row_at_pos( &self, drag_x: i32, drag_y: i32, ) -> Option<(Option<TreePath>, TreeViewDropPosition)>1425 fn dest_row_at_pos( 1426 &self, 1427 drag_x: i32, 1428 drag_y: i32, 1429 ) -> Option<(Option<TreePath>, TreeViewDropPosition)> { 1430 unsafe { 1431 let mut path = ptr::null_mut(); 1432 let mut pos = mem::MaybeUninit::uninit(); 1433 let ret = from_glib(ffi::gtk_tree_view_get_dest_row_at_pos( 1434 self.as_ref().to_glib_none().0, 1435 drag_x, 1436 drag_y, 1437 &mut path, 1438 pos.as_mut_ptr(), 1439 )); 1440 let pos = pos.assume_init(); 1441 if ret { 1442 Some((from_glib_full(path), from_glib(pos))) 1443 } else { 1444 None 1445 } 1446 } 1447 } 1448 drag_dest_row(&self) -> (Option<TreePath>, TreeViewDropPosition)1449 fn drag_dest_row(&self) -> (Option<TreePath>, TreeViewDropPosition) { 1450 unsafe { 1451 let mut path = ptr::null_mut(); 1452 let mut pos = mem::MaybeUninit::uninit(); 1453 ffi::gtk_tree_view_get_drag_dest_row( 1454 self.as_ref().to_glib_none().0, 1455 &mut path, 1456 pos.as_mut_ptr(), 1457 ); 1458 let pos = pos.assume_init(); 1459 (from_glib_full(path), from_glib(pos)) 1460 } 1461 } 1462 enables_search(&self) -> bool1463 fn enables_search(&self) -> bool { 1464 unsafe { 1465 from_glib(ffi::gtk_tree_view_get_enable_search( 1466 self.as_ref().to_glib_none().0, 1467 )) 1468 } 1469 } 1470 enables_tree_lines(&self) -> bool1471 fn enables_tree_lines(&self) -> bool { 1472 unsafe { 1473 from_glib(ffi::gtk_tree_view_get_enable_tree_lines( 1474 self.as_ref().to_glib_none().0, 1475 )) 1476 } 1477 } 1478 expander_column(&self) -> Option<TreeViewColumn>1479 fn expander_column(&self) -> Option<TreeViewColumn> { 1480 unsafe { 1481 from_glib_none(ffi::gtk_tree_view_get_expander_column( 1482 self.as_ref().to_glib_none().0, 1483 )) 1484 } 1485 } 1486 is_fixed_height_mode(&self) -> bool1487 fn is_fixed_height_mode(&self) -> bool { 1488 unsafe { 1489 from_glib(ffi::gtk_tree_view_get_fixed_height_mode( 1490 self.as_ref().to_glib_none().0, 1491 )) 1492 } 1493 } 1494 grid_lines(&self) -> TreeViewGridLines1495 fn grid_lines(&self) -> TreeViewGridLines { 1496 unsafe { 1497 from_glib(ffi::gtk_tree_view_get_grid_lines( 1498 self.as_ref().to_glib_none().0, 1499 )) 1500 } 1501 } 1502 is_headers_clickable(&self) -> bool1503 fn is_headers_clickable(&self) -> bool { 1504 unsafe { 1505 from_glib(ffi::gtk_tree_view_get_headers_clickable( 1506 self.as_ref().to_glib_none().0, 1507 )) 1508 } 1509 } 1510 is_headers_visible(&self) -> bool1511 fn is_headers_visible(&self) -> bool { 1512 unsafe { 1513 from_glib(ffi::gtk_tree_view_get_headers_visible( 1514 self.as_ref().to_glib_none().0, 1515 )) 1516 } 1517 } 1518 hover_expands(&self) -> bool1519 fn hover_expands(&self) -> bool { 1520 unsafe { 1521 from_glib(ffi::gtk_tree_view_get_hover_expand( 1522 self.as_ref().to_glib_none().0, 1523 )) 1524 } 1525 } 1526 is_hover_selection(&self) -> bool1527 fn is_hover_selection(&self) -> bool { 1528 unsafe { 1529 from_glib(ffi::gtk_tree_view_get_hover_selection( 1530 self.as_ref().to_glib_none().0, 1531 )) 1532 } 1533 } 1534 level_indentation(&self) -> i321535 fn level_indentation(&self) -> i32 { 1536 unsafe { ffi::gtk_tree_view_get_level_indentation(self.as_ref().to_glib_none().0) } 1537 } 1538 model(&self) -> Option<TreeModel>1539 fn model(&self) -> Option<TreeModel> { 1540 unsafe { from_glib_none(ffi::gtk_tree_view_get_model(self.as_ref().to_glib_none().0)) } 1541 } 1542 n_columns(&self) -> u321543 fn n_columns(&self) -> u32 { 1544 unsafe { ffi::gtk_tree_view_get_n_columns(self.as_ref().to_glib_none().0) } 1545 } 1546 path_at_pos( &self, x: i32, y: i32, ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)>1547 fn path_at_pos( 1548 &self, 1549 x: i32, 1550 y: i32, 1551 ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)> { 1552 unsafe { 1553 let mut path = ptr::null_mut(); 1554 let mut column = ptr::null_mut(); 1555 let mut cell_x = mem::MaybeUninit::uninit(); 1556 let mut cell_y = mem::MaybeUninit::uninit(); 1557 let ret = from_glib(ffi::gtk_tree_view_get_path_at_pos( 1558 self.as_ref().to_glib_none().0, 1559 x, 1560 y, 1561 &mut path, 1562 &mut column, 1563 cell_x.as_mut_ptr(), 1564 cell_y.as_mut_ptr(), 1565 )); 1566 let cell_x = cell_x.assume_init(); 1567 let cell_y = cell_y.assume_init(); 1568 if ret { 1569 Some((from_glib_full(path), from_glib_none(column), cell_x, cell_y)) 1570 } else { 1571 None 1572 } 1573 } 1574 } 1575 is_reorderable(&self) -> bool1576 fn is_reorderable(&self) -> bool { 1577 unsafe { 1578 from_glib(ffi::gtk_tree_view_get_reorderable( 1579 self.as_ref().to_glib_none().0, 1580 )) 1581 } 1582 } 1583 1584 //fn row_separator_func(&self) -> Option<Box_<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>> { 1585 // unsafe { TODO: call ffi:gtk_tree_view_get_row_separator_func() } 1586 //} 1587 is_rubber_banding(&self) -> bool1588 fn is_rubber_banding(&self) -> bool { 1589 unsafe { 1590 from_glib(ffi::gtk_tree_view_get_rubber_banding( 1591 self.as_ref().to_glib_none().0, 1592 )) 1593 } 1594 } 1595 search_column(&self) -> i321596 fn search_column(&self) -> i32 { 1597 unsafe { ffi::gtk_tree_view_get_search_column(self.as_ref().to_glib_none().0) } 1598 } 1599 search_entry(&self) -> Option<Entry>1600 fn search_entry(&self) -> Option<Entry> { 1601 unsafe { 1602 from_glib_none(ffi::gtk_tree_view_get_search_entry( 1603 self.as_ref().to_glib_none().0, 1604 )) 1605 } 1606 } 1607 1608 //fn search_equal_func(&self) -> Option<Box_<dyn Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static>> { 1609 // unsafe { TODO: call ffi:gtk_tree_view_get_search_equal_func() } 1610 //} 1611 1612 //fn search_position_func(&self) -> Option<Box_<dyn Fn(&TreeView, &Widget) + 'static>> { 1613 // unsafe { TODO: call ffi:gtk_tree_view_get_search_position_func() } 1614 //} 1615 selection(&self) -> TreeSelection1616 fn selection(&self) -> TreeSelection { 1617 unsafe { 1618 from_glib_none(ffi::gtk_tree_view_get_selection( 1619 self.as_ref().to_glib_none().0, 1620 )) 1621 } 1622 } 1623 shows_expanders(&self) -> bool1624 fn shows_expanders(&self) -> bool { 1625 unsafe { 1626 from_glib(ffi::gtk_tree_view_get_show_expanders( 1627 self.as_ref().to_glib_none().0, 1628 )) 1629 } 1630 } 1631 tooltip_column(&self) -> i321632 fn tooltip_column(&self) -> i32 { 1633 unsafe { ffi::gtk_tree_view_get_tooltip_column(self.as_ref().to_glib_none().0) } 1634 } 1635 tooltip_context( &self, x: &mut i32, y: &mut i32, keyboard_tip: bool, ) -> Option<(Option<TreeModel>, TreePath, TreeIter)>1636 fn tooltip_context( 1637 &self, 1638 x: &mut i32, 1639 y: &mut i32, 1640 keyboard_tip: bool, 1641 ) -> Option<(Option<TreeModel>, TreePath, TreeIter)> { 1642 unsafe { 1643 let mut model = ptr::null_mut(); 1644 let mut path = ptr::null_mut(); 1645 let mut iter = TreeIter::uninitialized(); 1646 let ret = from_glib(ffi::gtk_tree_view_get_tooltip_context( 1647 self.as_ref().to_glib_none().0, 1648 x, 1649 y, 1650 keyboard_tip.into_glib(), 1651 &mut model, 1652 &mut path, 1653 iter.to_glib_none_mut().0, 1654 )); 1655 if ret { 1656 Some((from_glib_none(model), from_glib_full(path), iter)) 1657 } else { 1658 None 1659 } 1660 } 1661 } 1662 visible_range(&self) -> Option<(TreePath, TreePath)>1663 fn visible_range(&self) -> Option<(TreePath, TreePath)> { 1664 unsafe { 1665 let mut start_path = ptr::null_mut(); 1666 let mut end_path = ptr::null_mut(); 1667 let ret = from_glib(ffi::gtk_tree_view_get_visible_range( 1668 self.as_ref().to_glib_none().0, 1669 &mut start_path, 1670 &mut end_path, 1671 )); 1672 if ret { 1673 Some((from_glib_full(start_path), from_glib_full(end_path))) 1674 } else { 1675 None 1676 } 1677 } 1678 } 1679 visible_rect(&self) -> gdk::Rectangle1680 fn visible_rect(&self) -> gdk::Rectangle { 1681 unsafe { 1682 let mut visible_rect = gdk::Rectangle::uninitialized(); 1683 ffi::gtk_tree_view_get_visible_rect( 1684 self.as_ref().to_glib_none().0, 1685 visible_rect.to_glib_none_mut().0, 1686 ); 1687 visible_rect 1688 } 1689 } 1690 insert_column<P: IsA<TreeViewColumn>>(&self, column: &P, position: i32) -> i321691 fn insert_column<P: IsA<TreeViewColumn>>(&self, column: &P, position: i32) -> i32 { 1692 unsafe { 1693 ffi::gtk_tree_view_insert_column( 1694 self.as_ref().to_glib_none().0, 1695 column.as_ref().to_glib_none().0, 1696 position, 1697 ) 1698 } 1699 } 1700 1701 //fn insert_column_with_attributes<P: IsA<CellRenderer>>(&self, position: i32, title: &str, cell: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> i32 { 1702 // unsafe { TODO: call ffi:gtk_tree_view_insert_column_with_attributes() } 1703 //} 1704 insert_column_with_data_func< P: IsA<CellRenderer>, Q: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static, >( &self, position: i32, title: &str, cell: &P, func: Q, ) -> i321705 fn insert_column_with_data_func< 1706 P: IsA<CellRenderer>, 1707 Q: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static, 1708 >( 1709 &self, 1710 position: i32, 1711 title: &str, 1712 cell: &P, 1713 func: Q, 1714 ) -> i32 { 1715 let func_data: Box_<Q> = Box_::new(func); 1716 unsafe extern "C" fn func_func< 1717 P: IsA<CellRenderer>, 1718 Q: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static, 1719 >( 1720 tree_column: *mut ffi::GtkTreeViewColumn, 1721 cell: *mut ffi::GtkCellRenderer, 1722 tree_model: *mut ffi::GtkTreeModel, 1723 iter: *mut ffi::GtkTreeIter, 1724 data: glib::ffi::gpointer, 1725 ) { 1726 let tree_column = from_glib_borrow(tree_column); 1727 let cell = from_glib_borrow(cell); 1728 let tree_model = from_glib_borrow(tree_model); 1729 let iter = from_glib_borrow(iter); 1730 let callback: &Q = &*(data as *mut _); 1731 (*callback)(&tree_column, &cell, &tree_model, &iter); 1732 } 1733 let func = Some(func_func::<P, Q> as _); 1734 unsafe extern "C" fn dnotify_func< 1735 P: IsA<CellRenderer>, 1736 Q: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static, 1737 >( 1738 data: glib::ffi::gpointer, 1739 ) { 1740 let _callback: Box_<Q> = Box_::from_raw(data as *mut _); 1741 } 1742 let destroy_call6 = Some(dnotify_func::<P, Q> as _); 1743 let super_callback0: Box_<Q> = func_data; 1744 unsafe { 1745 ffi::gtk_tree_view_insert_column_with_data_func( 1746 self.as_ref().to_glib_none().0, 1747 position, 1748 title.to_glib_none().0, 1749 cell.as_ref().to_glib_none().0, 1750 func, 1751 Box_::into_raw(super_callback0) as *mut _, 1752 destroy_call6, 1753 ) 1754 } 1755 } 1756 is_blank_at_pos( &self, x: i32, y: i32, ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)>1757 fn is_blank_at_pos( 1758 &self, 1759 x: i32, 1760 y: i32, 1761 ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)> { 1762 unsafe { 1763 let mut path = ptr::null_mut(); 1764 let mut column = ptr::null_mut(); 1765 let mut cell_x = mem::MaybeUninit::uninit(); 1766 let mut cell_y = mem::MaybeUninit::uninit(); 1767 let ret = from_glib(ffi::gtk_tree_view_is_blank_at_pos( 1768 self.as_ref().to_glib_none().0, 1769 x, 1770 y, 1771 &mut path, 1772 &mut column, 1773 cell_x.as_mut_ptr(), 1774 cell_y.as_mut_ptr(), 1775 )); 1776 let cell_x = cell_x.assume_init(); 1777 let cell_y = cell_y.assume_init(); 1778 if ret { 1779 Some((from_glib_full(path), from_glib_none(column), cell_x, cell_y)) 1780 } else { 1781 None 1782 } 1783 } 1784 } 1785 is_rubber_banding_active(&self) -> bool1786 fn is_rubber_banding_active(&self) -> bool { 1787 unsafe { 1788 from_glib(ffi::gtk_tree_view_is_rubber_banding_active( 1789 self.as_ref().to_glib_none().0, 1790 )) 1791 } 1792 } 1793 map_expanded_rows<P: FnMut(&TreeView, &TreePath)>(&self, func: P)1794 fn map_expanded_rows<P: FnMut(&TreeView, &TreePath)>(&self, func: P) { 1795 let func_data: P = func; 1796 unsafe extern "C" fn func_func<P: FnMut(&TreeView, &TreePath)>( 1797 tree_view: *mut ffi::GtkTreeView, 1798 path: *mut ffi::GtkTreePath, 1799 user_data: glib::ffi::gpointer, 1800 ) { 1801 let tree_view = from_glib_borrow(tree_view); 1802 let path = from_glib_borrow(path); 1803 let callback: *mut P = user_data as *const _ as usize as *mut P; 1804 (*callback)(&tree_view, &path); 1805 } 1806 let func = Some(func_func::<P> as _); 1807 let super_callback0: &P = &func_data; 1808 unsafe { 1809 ffi::gtk_tree_view_map_expanded_rows( 1810 self.as_ref().to_glib_none().0, 1811 func, 1812 super_callback0 as *const _ as usize as *mut _, 1813 ); 1814 } 1815 } 1816 move_column_after<P: IsA<TreeViewColumn>, Q: IsA<TreeViewColumn>>( &self, column: &P, base_column: Option<&Q>, )1817 fn move_column_after<P: IsA<TreeViewColumn>, Q: IsA<TreeViewColumn>>( 1818 &self, 1819 column: &P, 1820 base_column: Option<&Q>, 1821 ) { 1822 unsafe { 1823 ffi::gtk_tree_view_move_column_after( 1824 self.as_ref().to_glib_none().0, 1825 column.as_ref().to_glib_none().0, 1826 base_column.map(|p| p.as_ref()).to_glib_none().0, 1827 ); 1828 } 1829 } 1830 remove_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i321831 fn remove_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i32 { 1832 unsafe { 1833 ffi::gtk_tree_view_remove_column( 1834 self.as_ref().to_glib_none().0, 1835 column.as_ref().to_glib_none().0, 1836 ) 1837 } 1838 } 1839 row_activated<P: IsA<TreeViewColumn>>(&self, path: &TreePath, column: &P)1840 fn row_activated<P: IsA<TreeViewColumn>>(&self, path: &TreePath, column: &P) { 1841 unsafe { 1842 ffi::gtk_tree_view_row_activated( 1843 self.as_ref().to_glib_none().0, 1844 mut_override(path.to_glib_none().0), 1845 column.as_ref().to_glib_none().0, 1846 ); 1847 } 1848 } 1849 row_expanded(&self, path: &TreePath) -> bool1850 fn row_expanded(&self, path: &TreePath) -> bool { 1851 unsafe { 1852 from_glib(ffi::gtk_tree_view_row_expanded( 1853 self.as_ref().to_glib_none().0, 1854 mut_override(path.to_glib_none().0), 1855 )) 1856 } 1857 } 1858 scroll_to_cell<P: IsA<TreeViewColumn>>( &self, path: Option<&TreePath>, column: Option<&P>, use_align: bool, row_align: f32, col_align: f32, )1859 fn scroll_to_cell<P: IsA<TreeViewColumn>>( 1860 &self, 1861 path: Option<&TreePath>, 1862 column: Option<&P>, 1863 use_align: bool, 1864 row_align: f32, 1865 col_align: f32, 1866 ) { 1867 unsafe { 1868 ffi::gtk_tree_view_scroll_to_cell( 1869 self.as_ref().to_glib_none().0, 1870 mut_override(path.to_glib_none().0), 1871 column.map(|p| p.as_ref()).to_glib_none().0, 1872 use_align.into_glib(), 1873 row_align, 1874 col_align, 1875 ); 1876 } 1877 } 1878 scroll_to_point(&self, tree_x: i32, tree_y: i32)1879 fn scroll_to_point(&self, tree_x: i32, tree_y: i32) { 1880 unsafe { 1881 ffi::gtk_tree_view_scroll_to_point(self.as_ref().to_glib_none().0, tree_x, tree_y); 1882 } 1883 } 1884 set_activate_on_single_click(&self, single: bool)1885 fn set_activate_on_single_click(&self, single: bool) { 1886 unsafe { 1887 ffi::gtk_tree_view_set_activate_on_single_click( 1888 self.as_ref().to_glib_none().0, 1889 single.into_glib(), 1890 ); 1891 } 1892 } 1893 set_column_drag_function( &self, func: Option< Box_< dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool + 'static, >, >, )1894 fn set_column_drag_function( 1895 &self, 1896 func: Option< 1897 Box_< 1898 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool 1899 + 'static, 1900 >, 1901 >, 1902 ) { 1903 let func_data: Box_< 1904 Option< 1905 Box_< 1906 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool 1907 + 'static, 1908 >, 1909 >, 1910 > = Box_::new(func); 1911 unsafe extern "C" fn func_func( 1912 tree_view: *mut ffi::GtkTreeView, 1913 column: *mut ffi::GtkTreeViewColumn, 1914 prev_column: *mut ffi::GtkTreeViewColumn, 1915 next_column: *mut ffi::GtkTreeViewColumn, 1916 data: glib::ffi::gpointer, 1917 ) -> glib::ffi::gboolean { 1918 let tree_view = from_glib_borrow(tree_view); 1919 let column = from_glib_borrow(column); 1920 let prev_column = from_glib_borrow(prev_column); 1921 let next_column = from_glib_borrow(next_column); 1922 let callback: &Option< 1923 Box_< 1924 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool 1925 + 'static, 1926 >, 1927 > = &*(data as *mut _); 1928 let res = if let Some(ref callback) = *callback { 1929 callback(&tree_view, &column, &prev_column, &next_column) 1930 } else { 1931 panic!("cannot get closure...") 1932 }; 1933 res.into_glib() 1934 } 1935 let func = if func_data.is_some() { 1936 Some(func_func as _) 1937 } else { 1938 None 1939 }; 1940 unsafe extern "C" fn destroy_func(data: glib::ffi::gpointer) { 1941 let _callback: Box_< 1942 Option< 1943 Box_< 1944 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool 1945 + 'static, 1946 >, 1947 >, 1948 > = Box_::from_raw(data as *mut _); 1949 } 1950 let destroy_call3 = Some(destroy_func as _); 1951 let super_callback0: Box_< 1952 Option< 1953 Box_< 1954 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool 1955 + 'static, 1956 >, 1957 >, 1958 > = func_data; 1959 unsafe { 1960 ffi::gtk_tree_view_set_column_drag_function( 1961 self.as_ref().to_glib_none().0, 1962 func, 1963 Box_::into_raw(super_callback0) as *mut _, 1964 destroy_call3, 1965 ); 1966 } 1967 } 1968 set_cursor<P: IsA<TreeViewColumn>>( &self, path: &TreePath, focus_column: Option<&P>, start_editing: bool, )1969 fn set_cursor<P: IsA<TreeViewColumn>>( 1970 &self, 1971 path: &TreePath, 1972 focus_column: Option<&P>, 1973 start_editing: bool, 1974 ) { 1975 unsafe { 1976 ffi::gtk_tree_view_set_cursor( 1977 self.as_ref().to_glib_none().0, 1978 mut_override(path.to_glib_none().0), 1979 focus_column.map(|p| p.as_ref()).to_glib_none().0, 1980 start_editing.into_glib(), 1981 ); 1982 } 1983 } 1984 set_cursor_on_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( &self, path: &TreePath, focus_column: Option<&P>, focus_cell: Option<&Q>, start_editing: bool, )1985 fn set_cursor_on_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( 1986 &self, 1987 path: &TreePath, 1988 focus_column: Option<&P>, 1989 focus_cell: Option<&Q>, 1990 start_editing: bool, 1991 ) { 1992 unsafe { 1993 ffi::gtk_tree_view_set_cursor_on_cell( 1994 self.as_ref().to_glib_none().0, 1995 mut_override(path.to_glib_none().0), 1996 focus_column.map(|p| p.as_ref()).to_glib_none().0, 1997 focus_cell.map(|p| p.as_ref()).to_glib_none().0, 1998 start_editing.into_glib(), 1999 ); 2000 } 2001 } 2002 set_drag_dest_row(&self, path: Option<&TreePath>, pos: TreeViewDropPosition)2003 fn set_drag_dest_row(&self, path: Option<&TreePath>, pos: TreeViewDropPosition) { 2004 unsafe { 2005 ffi::gtk_tree_view_set_drag_dest_row( 2006 self.as_ref().to_glib_none().0, 2007 mut_override(path.to_glib_none().0), 2008 pos.into_glib(), 2009 ); 2010 } 2011 } 2012 set_enable_search(&self, enable_search: bool)2013 fn set_enable_search(&self, enable_search: bool) { 2014 unsafe { 2015 ffi::gtk_tree_view_set_enable_search( 2016 self.as_ref().to_glib_none().0, 2017 enable_search.into_glib(), 2018 ); 2019 } 2020 } 2021 set_enable_tree_lines(&self, enabled: bool)2022 fn set_enable_tree_lines(&self, enabled: bool) { 2023 unsafe { 2024 ffi::gtk_tree_view_set_enable_tree_lines( 2025 self.as_ref().to_glib_none().0, 2026 enabled.into_glib(), 2027 ); 2028 } 2029 } 2030 set_expander_column<P: IsA<TreeViewColumn>>(&self, column: Option<&P>)2031 fn set_expander_column<P: IsA<TreeViewColumn>>(&self, column: Option<&P>) { 2032 unsafe { 2033 ffi::gtk_tree_view_set_expander_column( 2034 self.as_ref().to_glib_none().0, 2035 column.map(|p| p.as_ref()).to_glib_none().0, 2036 ); 2037 } 2038 } 2039 set_fixed_height_mode(&self, enable: bool)2040 fn set_fixed_height_mode(&self, enable: bool) { 2041 unsafe { 2042 ffi::gtk_tree_view_set_fixed_height_mode( 2043 self.as_ref().to_glib_none().0, 2044 enable.into_glib(), 2045 ); 2046 } 2047 } 2048 set_grid_lines(&self, grid_lines: TreeViewGridLines)2049 fn set_grid_lines(&self, grid_lines: TreeViewGridLines) { 2050 unsafe { 2051 ffi::gtk_tree_view_set_grid_lines( 2052 self.as_ref().to_glib_none().0, 2053 grid_lines.into_glib(), 2054 ); 2055 } 2056 } 2057 set_headers_clickable(&self, setting: bool)2058 fn set_headers_clickable(&self, setting: bool) { 2059 unsafe { 2060 ffi::gtk_tree_view_set_headers_clickable( 2061 self.as_ref().to_glib_none().0, 2062 setting.into_glib(), 2063 ); 2064 } 2065 } 2066 set_headers_visible(&self, headers_visible: bool)2067 fn set_headers_visible(&self, headers_visible: bool) { 2068 unsafe { 2069 ffi::gtk_tree_view_set_headers_visible( 2070 self.as_ref().to_glib_none().0, 2071 headers_visible.into_glib(), 2072 ); 2073 } 2074 } 2075 set_hover_expand(&self, expand: bool)2076 fn set_hover_expand(&self, expand: bool) { 2077 unsafe { 2078 ffi::gtk_tree_view_set_hover_expand(self.as_ref().to_glib_none().0, expand.into_glib()); 2079 } 2080 } 2081 set_hover_selection(&self, hover: bool)2082 fn set_hover_selection(&self, hover: bool) { 2083 unsafe { 2084 ffi::gtk_tree_view_set_hover_selection( 2085 self.as_ref().to_glib_none().0, 2086 hover.into_glib(), 2087 ); 2088 } 2089 } 2090 set_level_indentation(&self, indentation: i32)2091 fn set_level_indentation(&self, indentation: i32) { 2092 unsafe { 2093 ffi::gtk_tree_view_set_level_indentation(self.as_ref().to_glib_none().0, indentation); 2094 } 2095 } 2096 set_model<P: IsA<TreeModel>>(&self, model: Option<&P>)2097 fn set_model<P: IsA<TreeModel>>(&self, model: Option<&P>) { 2098 unsafe { 2099 ffi::gtk_tree_view_set_model( 2100 self.as_ref().to_glib_none().0, 2101 model.map(|p| p.as_ref()).to_glib_none().0, 2102 ); 2103 } 2104 } 2105 set_reorderable(&self, reorderable: bool)2106 fn set_reorderable(&self, reorderable: bool) { 2107 unsafe { 2108 ffi::gtk_tree_view_set_reorderable( 2109 self.as_ref().to_glib_none().0, 2110 reorderable.into_glib(), 2111 ); 2112 } 2113 } 2114 set_row_separator_func( &self, func: Option<Box_<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>, )2115 fn set_row_separator_func( 2116 &self, 2117 func: Option<Box_<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>, 2118 ) { 2119 let func_data: Box_<Option<Box_<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>> = 2120 Box_::new(func); 2121 unsafe extern "C" fn func_func( 2122 model: *mut ffi::GtkTreeModel, 2123 iter: *mut ffi::GtkTreeIter, 2124 data: glib::ffi::gpointer, 2125 ) -> glib::ffi::gboolean { 2126 let model = from_glib_borrow(model); 2127 let iter = from_glib_borrow(iter); 2128 let callback: &Option<Box_<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>> = 2129 &*(data as *mut _); 2130 let res = if let Some(ref callback) = *callback { 2131 callback(&model, &iter) 2132 } else { 2133 panic!("cannot get closure...") 2134 }; 2135 res.into_glib() 2136 } 2137 let func = if func_data.is_some() { 2138 Some(func_func as _) 2139 } else { 2140 None 2141 }; 2142 unsafe extern "C" fn destroy_func(data: glib::ffi::gpointer) { 2143 let _callback: Box_<Option<Box_<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>> = 2144 Box_::from_raw(data as *mut _); 2145 } 2146 let destroy_call3 = Some(destroy_func as _); 2147 let super_callback0: Box_<Option<Box_<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>> = 2148 func_data; 2149 unsafe { 2150 ffi::gtk_tree_view_set_row_separator_func( 2151 self.as_ref().to_glib_none().0, 2152 func, 2153 Box_::into_raw(super_callback0) as *mut _, 2154 destroy_call3, 2155 ); 2156 } 2157 } 2158 set_rubber_banding(&self, enable: bool)2159 fn set_rubber_banding(&self, enable: bool) { 2160 unsafe { 2161 ffi::gtk_tree_view_set_rubber_banding( 2162 self.as_ref().to_glib_none().0, 2163 enable.into_glib(), 2164 ); 2165 } 2166 } 2167 set_search_column(&self, column: i32)2168 fn set_search_column(&self, column: i32) { 2169 unsafe { 2170 ffi::gtk_tree_view_set_search_column(self.as_ref().to_glib_none().0, column); 2171 } 2172 } 2173 set_search_entry<P: IsA<Entry>>(&self, entry: Option<&P>)2174 fn set_search_entry<P: IsA<Entry>>(&self, entry: Option<&P>) { 2175 unsafe { 2176 ffi::gtk_tree_view_set_search_entry( 2177 self.as_ref().to_glib_none().0, 2178 entry.map(|p| p.as_ref()).to_glib_none().0, 2179 ); 2180 } 2181 } 2182 set_search_equal_func<P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static>( &self, search_equal_func: P, )2183 fn set_search_equal_func<P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static>( 2184 &self, 2185 search_equal_func: P, 2186 ) { 2187 let search_equal_func_data: Box_<P> = Box_::new(search_equal_func); 2188 unsafe extern "C" fn search_equal_func_func< 2189 P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static, 2190 >( 2191 model: *mut ffi::GtkTreeModel, 2192 column: libc::c_int, 2193 key: *const libc::c_char, 2194 iter: *mut ffi::GtkTreeIter, 2195 search_data: glib::ffi::gpointer, 2196 ) -> glib::ffi::gboolean { 2197 let model = from_glib_borrow(model); 2198 let key: Borrowed<glib::GString> = from_glib_borrow(key); 2199 let iter = from_glib_borrow(iter); 2200 let callback: &P = &*(search_data as *mut _); 2201 let res = (*callback)(&model, column, key.as_str(), &iter); 2202 res.into_glib() 2203 } 2204 let search_equal_func = Some(search_equal_func_func::<P> as _); 2205 unsafe extern "C" fn search_destroy_func< 2206 P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static, 2207 >( 2208 data: glib::ffi::gpointer, 2209 ) { 2210 let _callback: Box_<P> = Box_::from_raw(data as *mut _); 2211 } 2212 let destroy_call3 = Some(search_destroy_func::<P> as _); 2213 let super_callback0: Box_<P> = search_equal_func_data; 2214 unsafe { 2215 ffi::gtk_tree_view_set_search_equal_func( 2216 self.as_ref().to_glib_none().0, 2217 search_equal_func, 2218 Box_::into_raw(super_callback0) as *mut _, 2219 destroy_call3, 2220 ); 2221 } 2222 } 2223 set_search_position_func(&self, func: Option<Box_<dyn Fn(&TreeView, &Widget) + 'static>>)2224 fn set_search_position_func(&self, func: Option<Box_<dyn Fn(&TreeView, &Widget) + 'static>>) { 2225 let func_data: Box_<Option<Box_<dyn Fn(&TreeView, &Widget) + 'static>>> = Box_::new(func); 2226 unsafe extern "C" fn func_func( 2227 tree_view: *mut ffi::GtkTreeView, 2228 search_dialog: *mut ffi::GtkWidget, 2229 user_data: glib::ffi::gpointer, 2230 ) { 2231 let tree_view = from_glib_borrow(tree_view); 2232 let search_dialog = from_glib_borrow(search_dialog); 2233 let callback: &Option<Box_<dyn Fn(&TreeView, &Widget) + 'static>> = 2234 &*(user_data as *mut _); 2235 if let Some(ref callback) = *callback { 2236 callback(&tree_view, &search_dialog) 2237 } else { 2238 panic!("cannot get closure...") 2239 }; 2240 } 2241 let func = if func_data.is_some() { 2242 Some(func_func as _) 2243 } else { 2244 None 2245 }; 2246 unsafe extern "C" fn destroy_func(data: glib::ffi::gpointer) { 2247 let _callback: Box_<Option<Box_<dyn Fn(&TreeView, &Widget) + 'static>>> = 2248 Box_::from_raw(data as *mut _); 2249 } 2250 let destroy_call3 = Some(destroy_func as _); 2251 let super_callback0: Box_<Option<Box_<dyn Fn(&TreeView, &Widget) + 'static>>> = func_data; 2252 unsafe { 2253 ffi::gtk_tree_view_set_search_position_func( 2254 self.as_ref().to_glib_none().0, 2255 func, 2256 Box_::into_raw(super_callback0) as *mut _, 2257 destroy_call3, 2258 ); 2259 } 2260 } 2261 set_show_expanders(&self, enabled: bool)2262 fn set_show_expanders(&self, enabled: bool) { 2263 unsafe { 2264 ffi::gtk_tree_view_set_show_expanders( 2265 self.as_ref().to_glib_none().0, 2266 enabled.into_glib(), 2267 ); 2268 } 2269 } 2270 set_tooltip_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( &self, tooltip: &Tooltip, path: Option<&TreePath>, column: Option<&P>, cell: Option<&Q>, )2271 fn set_tooltip_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( 2272 &self, 2273 tooltip: &Tooltip, 2274 path: Option<&TreePath>, 2275 column: Option<&P>, 2276 cell: Option<&Q>, 2277 ) { 2278 unsafe { 2279 ffi::gtk_tree_view_set_tooltip_cell( 2280 self.as_ref().to_glib_none().0, 2281 tooltip.to_glib_none().0, 2282 mut_override(path.to_glib_none().0), 2283 column.map(|p| p.as_ref()).to_glib_none().0, 2284 cell.map(|p| p.as_ref()).to_glib_none().0, 2285 ); 2286 } 2287 } 2288 set_tooltip_column(&self, column: i32)2289 fn set_tooltip_column(&self, column: i32) { 2290 unsafe { 2291 ffi::gtk_tree_view_set_tooltip_column(self.as_ref().to_glib_none().0, column); 2292 } 2293 } 2294 set_tooltip_row(&self, tooltip: &Tooltip, path: &TreePath)2295 fn set_tooltip_row(&self, tooltip: &Tooltip, path: &TreePath) { 2296 unsafe { 2297 ffi::gtk_tree_view_set_tooltip_row( 2298 self.as_ref().to_glib_none().0, 2299 tooltip.to_glib_none().0, 2300 mut_override(path.to_glib_none().0), 2301 ); 2302 } 2303 } 2304 unset_rows_drag_dest(&self)2305 fn unset_rows_drag_dest(&self) { 2306 unsafe { 2307 ffi::gtk_tree_view_unset_rows_drag_dest(self.as_ref().to_glib_none().0); 2308 } 2309 } 2310 unset_rows_drag_source(&self)2311 fn unset_rows_drag_source(&self) { 2312 unsafe { 2313 ffi::gtk_tree_view_unset_rows_drag_source(self.as_ref().to_glib_none().0); 2314 } 2315 } 2316 enable_grid_lines(&self) -> TreeViewGridLines2317 fn enable_grid_lines(&self) -> TreeViewGridLines { 2318 unsafe { 2319 let mut value = 2320 glib::Value::from_type(<TreeViewGridLines as StaticType>::static_type()); 2321 glib::gobject_ffi::g_object_get_property( 2322 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 2323 b"enable-grid-lines\0".as_ptr() as *const _, 2324 value.to_glib_none_mut().0, 2325 ); 2326 value 2327 .get() 2328 .expect("Return Value for property `enable-grid-lines` getter") 2329 } 2330 } 2331 set_enable_grid_lines(&self, enable_grid_lines: TreeViewGridLines)2332 fn set_enable_grid_lines(&self, enable_grid_lines: TreeViewGridLines) { 2333 unsafe { 2334 glib::gobject_ffi::g_object_set_property( 2335 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 2336 b"enable-grid-lines\0".as_ptr() as *const _, 2337 enable_grid_lines.to_value().to_glib_none().0, 2338 ); 2339 } 2340 } 2341 set_ubuntu_almost_fixed_height_mode(&self, ubuntu_almost_fixed_height_mode: bool)2342 fn set_ubuntu_almost_fixed_height_mode(&self, ubuntu_almost_fixed_height_mode: bool) { 2343 unsafe { 2344 glib::gobject_ffi::g_object_set_property( 2345 self.to_glib_none().0 as *mut glib::gobject_ffi::GObject, 2346 b"ubuntu-almost-fixed-height-mode\0".as_ptr() as *const _, 2347 ubuntu_almost_fixed_height_mode.to_value().to_glib_none().0, 2348 ); 2349 } 2350 } 2351 connect_columns_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2352 fn connect_columns_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 2353 unsafe extern "C" fn columns_changed_trampoline<P: IsA<TreeView>, F: Fn(&P) + 'static>( 2354 this: *mut ffi::GtkTreeView, 2355 f: glib::ffi::gpointer, 2356 ) { 2357 let f: &F = &*(f as *const F); 2358 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()) 2359 } 2360 unsafe { 2361 let f: Box_<F> = Box_::new(f); 2362 connect_raw( 2363 self.as_ptr() as *mut _, 2364 b"columns-changed\0".as_ptr() as *const _, 2365 Some(transmute::<_, unsafe extern "C" fn()>( 2366 columns_changed_trampoline::<Self, F> as *const (), 2367 )), 2368 Box_::into_raw(f), 2369 ) 2370 } 2371 } 2372 connect_cursor_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2373 fn connect_cursor_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 2374 unsafe extern "C" fn cursor_changed_trampoline<P: IsA<TreeView>, F: Fn(&P) + 'static>( 2375 this: *mut ffi::GtkTreeView, 2376 f: glib::ffi::gpointer, 2377 ) { 2378 let f: &F = &*(f as *const F); 2379 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()) 2380 } 2381 unsafe { 2382 let f: Box_<F> = Box_::new(f); 2383 connect_raw( 2384 self.as_ptr() as *mut _, 2385 b"cursor-changed\0".as_ptr() as *const _, 2386 Some(transmute::<_, unsafe extern "C" fn()>( 2387 cursor_changed_trampoline::<Self, F> as *const (), 2388 )), 2389 Box_::into_raw(f), 2390 ) 2391 } 2392 } 2393 connect_expand_collapse_cursor_row<F: Fn(&Self, bool, bool, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId2394 fn connect_expand_collapse_cursor_row<F: Fn(&Self, bool, bool, bool) -> bool + 'static>( 2395 &self, 2396 f: F, 2397 ) -> SignalHandlerId { 2398 unsafe extern "C" fn expand_collapse_cursor_row_trampoline< 2399 P: IsA<TreeView>, 2400 F: Fn(&P, bool, bool, bool) -> bool + 'static, 2401 >( 2402 this: *mut ffi::GtkTreeView, 2403 object: glib::ffi::gboolean, 2404 p0: glib::ffi::gboolean, 2405 p1: glib::ffi::gboolean, 2406 f: glib::ffi::gpointer, 2407 ) -> glib::ffi::gboolean { 2408 let f: &F = &*(f as *const F); 2409 f( 2410 TreeView::from_glib_borrow(this).unsafe_cast_ref(), 2411 from_glib(object), 2412 from_glib(p0), 2413 from_glib(p1), 2414 ) 2415 .into_glib() 2416 } 2417 unsafe { 2418 let f: Box_<F> = Box_::new(f); 2419 connect_raw( 2420 self.as_ptr() as *mut _, 2421 b"expand-collapse-cursor-row\0".as_ptr() as *const _, 2422 Some(transmute::<_, unsafe extern "C" fn()>( 2423 expand_collapse_cursor_row_trampoline::<Self, F> as *const (), 2424 )), 2425 Box_::into_raw(f), 2426 ) 2427 } 2428 } 2429 emit_expand_collapse_cursor_row(&self, object: bool, p0: bool, p1: bool) -> bool2430 fn emit_expand_collapse_cursor_row(&self, object: bool, p0: bool, p1: bool) -> bool { 2431 let res = unsafe { 2432 glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject) 2433 .emit_by_name("expand-collapse-cursor-row", &[&object, &p0, &p1]) 2434 .unwrap() 2435 }; 2436 res.unwrap() 2437 .get() 2438 .expect("Return Value for `emit_expand_collapse_cursor_row`") 2439 } 2440 connect_move_cursor<F: Fn(&Self, MovementStep, i32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId2441 fn connect_move_cursor<F: Fn(&Self, MovementStep, i32) -> bool + 'static>( 2442 &self, 2443 f: F, 2444 ) -> SignalHandlerId { 2445 unsafe extern "C" fn move_cursor_trampoline< 2446 P: IsA<TreeView>, 2447 F: Fn(&P, MovementStep, i32) -> bool + 'static, 2448 >( 2449 this: *mut ffi::GtkTreeView, 2450 step: ffi::GtkMovementStep, 2451 direction: libc::c_int, 2452 f: glib::ffi::gpointer, 2453 ) -> glib::ffi::gboolean { 2454 let f: &F = &*(f as *const F); 2455 f( 2456 TreeView::from_glib_borrow(this).unsafe_cast_ref(), 2457 from_glib(step), 2458 direction, 2459 ) 2460 .into_glib() 2461 } 2462 unsafe { 2463 let f: Box_<F> = Box_::new(f); 2464 connect_raw( 2465 self.as_ptr() as *mut _, 2466 b"move-cursor\0".as_ptr() as *const _, 2467 Some(transmute::<_, unsafe extern "C" fn()>( 2468 move_cursor_trampoline::<Self, F> as *const (), 2469 )), 2470 Box_::into_raw(f), 2471 ) 2472 } 2473 } 2474 emit_move_cursor(&self, step: MovementStep, direction: i32) -> bool2475 fn emit_move_cursor(&self, step: MovementStep, direction: i32) -> bool { 2476 let res = unsafe { 2477 glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject) 2478 .emit_by_name("move-cursor", &[&step, &direction]) 2479 .unwrap() 2480 }; 2481 res.unwrap() 2482 .get() 2483 .expect("Return Value for `emit_move_cursor`") 2484 } 2485 connect_row_activated<F: Fn(&Self, &TreePath, &TreeViewColumn) + 'static>( &self, f: F, ) -> SignalHandlerId2486 fn connect_row_activated<F: Fn(&Self, &TreePath, &TreeViewColumn) + 'static>( 2487 &self, 2488 f: F, 2489 ) -> SignalHandlerId { 2490 unsafe extern "C" fn row_activated_trampoline< 2491 P: IsA<TreeView>, 2492 F: Fn(&P, &TreePath, &TreeViewColumn) + 'static, 2493 >( 2494 this: *mut ffi::GtkTreeView, 2495 path: *mut ffi::GtkTreePath, 2496 column: *mut ffi::GtkTreeViewColumn, 2497 f: glib::ffi::gpointer, 2498 ) { 2499 let f: &F = &*(f as *const F); 2500 f( 2501 TreeView::from_glib_borrow(this).unsafe_cast_ref(), 2502 &from_glib_borrow(path), 2503 &from_glib_borrow(column), 2504 ) 2505 } 2506 unsafe { 2507 let f: Box_<F> = Box_::new(f); 2508 connect_raw( 2509 self.as_ptr() as *mut _, 2510 b"row-activated\0".as_ptr() as *const _, 2511 Some(transmute::<_, unsafe extern "C" fn()>( 2512 row_activated_trampoline::<Self, F> as *const (), 2513 )), 2514 Box_::into_raw(f), 2515 ) 2516 } 2517 } 2518 emit_row_activated(&self, path: &TreePath, column: &TreeViewColumn)2519 fn emit_row_activated(&self, path: &TreePath, column: &TreeViewColumn) { 2520 let _ = unsafe { 2521 glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject) 2522 .emit_by_name("row-activated", &[&path, &column]) 2523 .unwrap() 2524 }; 2525 } 2526 connect_row_collapsed<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( &self, f: F, ) -> SignalHandlerId2527 fn connect_row_collapsed<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( 2528 &self, 2529 f: F, 2530 ) -> SignalHandlerId { 2531 unsafe extern "C" fn row_collapsed_trampoline< 2532 P: IsA<TreeView>, 2533 F: Fn(&P, &TreeIter, &TreePath) + 'static, 2534 >( 2535 this: *mut ffi::GtkTreeView, 2536 iter: *mut ffi::GtkTreeIter, 2537 path: *mut ffi::GtkTreePath, 2538 f: glib::ffi::gpointer, 2539 ) { 2540 let f: &F = &*(f as *const F); 2541 f( 2542 TreeView::from_glib_borrow(this).unsafe_cast_ref(), 2543 &from_glib_borrow(iter), 2544 &from_glib_borrow(path), 2545 ) 2546 } 2547 unsafe { 2548 let f: Box_<F> = Box_::new(f); 2549 connect_raw( 2550 self.as_ptr() as *mut _, 2551 b"row-collapsed\0".as_ptr() as *const _, 2552 Some(transmute::<_, unsafe extern "C" fn()>( 2553 row_collapsed_trampoline::<Self, F> as *const (), 2554 )), 2555 Box_::into_raw(f), 2556 ) 2557 } 2558 } 2559 connect_row_expanded<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( &self, f: F, ) -> SignalHandlerId2560 fn connect_row_expanded<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( 2561 &self, 2562 f: F, 2563 ) -> SignalHandlerId { 2564 unsafe extern "C" fn row_expanded_trampoline< 2565 P: IsA<TreeView>, 2566 F: Fn(&P, &TreeIter, &TreePath) + 'static, 2567 >( 2568 this: *mut ffi::GtkTreeView, 2569 iter: *mut ffi::GtkTreeIter, 2570 path: *mut ffi::GtkTreePath, 2571 f: glib::ffi::gpointer, 2572 ) { 2573 let f: &F = &*(f as *const F); 2574 f( 2575 TreeView::from_glib_borrow(this).unsafe_cast_ref(), 2576 &from_glib_borrow(iter), 2577 &from_glib_borrow(path), 2578 ) 2579 } 2580 unsafe { 2581 let f: Box_<F> = Box_::new(f); 2582 connect_raw( 2583 self.as_ptr() as *mut _, 2584 b"row-expanded\0".as_ptr() as *const _, 2585 Some(transmute::<_, unsafe extern "C" fn()>( 2586 row_expanded_trampoline::<Self, F> as *const (), 2587 )), 2588 Box_::into_raw(f), 2589 ) 2590 } 2591 } 2592 connect_select_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId2593 fn connect_select_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId { 2594 unsafe extern "C" fn select_all_trampoline< 2595 P: IsA<TreeView>, 2596 F: Fn(&P) -> bool + 'static, 2597 >( 2598 this: *mut ffi::GtkTreeView, 2599 f: glib::ffi::gpointer, 2600 ) -> glib::ffi::gboolean { 2601 let f: &F = &*(f as *const F); 2602 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()).into_glib() 2603 } 2604 unsafe { 2605 let f: Box_<F> = Box_::new(f); 2606 connect_raw( 2607 self.as_ptr() as *mut _, 2608 b"select-all\0".as_ptr() as *const _, 2609 Some(transmute::<_, unsafe extern "C" fn()>( 2610 select_all_trampoline::<Self, F> as *const (), 2611 )), 2612 Box_::into_raw(f), 2613 ) 2614 } 2615 } 2616 emit_select_all(&self) -> bool2617 fn emit_select_all(&self) -> bool { 2618 let res = unsafe { 2619 glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject) 2620 .emit_by_name("select-all", &[]) 2621 .unwrap() 2622 }; 2623 res.unwrap() 2624 .get() 2625 .expect("Return Value for `emit_select_all`") 2626 } 2627 connect_select_cursor_parent<F: Fn(&Self) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId2628 fn connect_select_cursor_parent<F: Fn(&Self) -> bool + 'static>( 2629 &self, 2630 f: F, 2631 ) -> SignalHandlerId { 2632 unsafe extern "C" fn select_cursor_parent_trampoline< 2633 P: IsA<TreeView>, 2634 F: Fn(&P) -> bool + 'static, 2635 >( 2636 this: *mut ffi::GtkTreeView, 2637 f: glib::ffi::gpointer, 2638 ) -> glib::ffi::gboolean { 2639 let f: &F = &*(f as *const F); 2640 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()).into_glib() 2641 } 2642 unsafe { 2643 let f: Box_<F> = Box_::new(f); 2644 connect_raw( 2645 self.as_ptr() as *mut _, 2646 b"select-cursor-parent\0".as_ptr() as *const _, 2647 Some(transmute::<_, unsafe extern "C" fn()>( 2648 select_cursor_parent_trampoline::<Self, F> as *const (), 2649 )), 2650 Box_::into_raw(f), 2651 ) 2652 } 2653 } 2654 emit_select_cursor_parent(&self) -> bool2655 fn emit_select_cursor_parent(&self) -> bool { 2656 let res = unsafe { 2657 glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject) 2658 .emit_by_name("select-cursor-parent", &[]) 2659 .unwrap() 2660 }; 2661 res.unwrap() 2662 .get() 2663 .expect("Return Value for `emit_select_cursor_parent`") 2664 } 2665 connect_select_cursor_row<F: Fn(&Self, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId2666 fn connect_select_cursor_row<F: Fn(&Self, bool) -> bool + 'static>( 2667 &self, 2668 f: F, 2669 ) -> SignalHandlerId { 2670 unsafe extern "C" fn select_cursor_row_trampoline< 2671 P: IsA<TreeView>, 2672 F: Fn(&P, bool) -> bool + 'static, 2673 >( 2674 this: *mut ffi::GtkTreeView, 2675 object: glib::ffi::gboolean, 2676 f: glib::ffi::gpointer, 2677 ) -> glib::ffi::gboolean { 2678 let f: &F = &*(f as *const F); 2679 f( 2680 TreeView::from_glib_borrow(this).unsafe_cast_ref(), 2681 from_glib(object), 2682 ) 2683 .into_glib() 2684 } 2685 unsafe { 2686 let f: Box_<F> = Box_::new(f); 2687 connect_raw( 2688 self.as_ptr() as *mut _, 2689 b"select-cursor-row\0".as_ptr() as *const _, 2690 Some(transmute::<_, unsafe extern "C" fn()>( 2691 select_cursor_row_trampoline::<Self, F> as *const (), 2692 )), 2693 Box_::into_raw(f), 2694 ) 2695 } 2696 } 2697 emit_select_cursor_row(&self, object: bool) -> bool2698 fn emit_select_cursor_row(&self, object: bool) -> bool { 2699 let res = unsafe { 2700 glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject) 2701 .emit_by_name("select-cursor-row", &[&object]) 2702 .unwrap() 2703 }; 2704 res.unwrap() 2705 .get() 2706 .expect("Return Value for `emit_select_cursor_row`") 2707 } 2708 connect_start_interactive_search<F: Fn(&Self) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId2709 fn connect_start_interactive_search<F: Fn(&Self) -> bool + 'static>( 2710 &self, 2711 f: F, 2712 ) -> SignalHandlerId { 2713 unsafe extern "C" fn start_interactive_search_trampoline< 2714 P: IsA<TreeView>, 2715 F: Fn(&P) -> bool + 'static, 2716 >( 2717 this: *mut ffi::GtkTreeView, 2718 f: glib::ffi::gpointer, 2719 ) -> glib::ffi::gboolean { 2720 let f: &F = &*(f as *const F); 2721 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()).into_glib() 2722 } 2723 unsafe { 2724 let f: Box_<F> = Box_::new(f); 2725 connect_raw( 2726 self.as_ptr() as *mut _, 2727 b"start-interactive-search\0".as_ptr() as *const _, 2728 Some(transmute::<_, unsafe extern "C" fn()>( 2729 start_interactive_search_trampoline::<Self, F> as *const (), 2730 )), 2731 Box_::into_raw(f), 2732 ) 2733 } 2734 } 2735 emit_start_interactive_search(&self) -> bool2736 fn emit_start_interactive_search(&self) -> bool { 2737 let res = unsafe { 2738 glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject) 2739 .emit_by_name("start-interactive-search", &[]) 2740 .unwrap() 2741 }; 2742 res.unwrap() 2743 .get() 2744 .expect("Return Value for `emit_start_interactive_search`") 2745 } 2746 connect_test_collapse_row< F: Fn(&Self, &TreeIter, &TreePath) -> glib::signal::Inhibit + 'static, >( &self, f: F, ) -> SignalHandlerId2747 fn connect_test_collapse_row< 2748 F: Fn(&Self, &TreeIter, &TreePath) -> glib::signal::Inhibit + 'static, 2749 >( 2750 &self, 2751 f: F, 2752 ) -> SignalHandlerId { 2753 unsafe extern "C" fn test_collapse_row_trampoline< 2754 P: IsA<TreeView>, 2755 F: Fn(&P, &TreeIter, &TreePath) -> glib::signal::Inhibit + 'static, 2756 >( 2757 this: *mut ffi::GtkTreeView, 2758 iter: *mut ffi::GtkTreeIter, 2759 path: *mut ffi::GtkTreePath, 2760 f: glib::ffi::gpointer, 2761 ) -> glib::ffi::gboolean { 2762 let f: &F = &*(f as *const F); 2763 f( 2764 TreeView::from_glib_borrow(this).unsafe_cast_ref(), 2765 &from_glib_borrow(iter), 2766 &from_glib_borrow(path), 2767 ) 2768 .into_glib() 2769 } 2770 unsafe { 2771 let f: Box_<F> = Box_::new(f); 2772 connect_raw( 2773 self.as_ptr() as *mut _, 2774 b"test-collapse-row\0".as_ptr() as *const _, 2775 Some(transmute::<_, unsafe extern "C" fn()>( 2776 test_collapse_row_trampoline::<Self, F> as *const (), 2777 )), 2778 Box_::into_raw(f), 2779 ) 2780 } 2781 } 2782 connect_test_expand_row< F: Fn(&Self, &TreeIter, &TreePath) -> glib::signal::Inhibit + 'static, >( &self, f: F, ) -> SignalHandlerId2783 fn connect_test_expand_row< 2784 F: Fn(&Self, &TreeIter, &TreePath) -> glib::signal::Inhibit + 'static, 2785 >( 2786 &self, 2787 f: F, 2788 ) -> SignalHandlerId { 2789 unsafe extern "C" fn test_expand_row_trampoline< 2790 P: IsA<TreeView>, 2791 F: Fn(&P, &TreeIter, &TreePath) -> glib::signal::Inhibit + 'static, 2792 >( 2793 this: *mut ffi::GtkTreeView, 2794 iter: *mut ffi::GtkTreeIter, 2795 path: *mut ffi::GtkTreePath, 2796 f: glib::ffi::gpointer, 2797 ) -> glib::ffi::gboolean { 2798 let f: &F = &*(f as *const F); 2799 f( 2800 TreeView::from_glib_borrow(this).unsafe_cast_ref(), 2801 &from_glib_borrow(iter), 2802 &from_glib_borrow(path), 2803 ) 2804 .into_glib() 2805 } 2806 unsafe { 2807 let f: Box_<F> = Box_::new(f); 2808 connect_raw( 2809 self.as_ptr() as *mut _, 2810 b"test-expand-row\0".as_ptr() as *const _, 2811 Some(transmute::<_, unsafe extern "C" fn()>( 2812 test_expand_row_trampoline::<Self, F> as *const (), 2813 )), 2814 Box_::into_raw(f), 2815 ) 2816 } 2817 } 2818 connect_toggle_cursor_row<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId2819 fn connect_toggle_cursor_row<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId { 2820 unsafe extern "C" fn toggle_cursor_row_trampoline< 2821 P: IsA<TreeView>, 2822 F: Fn(&P) -> bool + 'static, 2823 >( 2824 this: *mut ffi::GtkTreeView, 2825 f: glib::ffi::gpointer, 2826 ) -> glib::ffi::gboolean { 2827 let f: &F = &*(f as *const F); 2828 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()).into_glib() 2829 } 2830 unsafe { 2831 let f: Box_<F> = Box_::new(f); 2832 connect_raw( 2833 self.as_ptr() as *mut _, 2834 b"toggle-cursor-row\0".as_ptr() as *const _, 2835 Some(transmute::<_, unsafe extern "C" fn()>( 2836 toggle_cursor_row_trampoline::<Self, F> as *const (), 2837 )), 2838 Box_::into_raw(f), 2839 ) 2840 } 2841 } 2842 emit_toggle_cursor_row(&self) -> bool2843 fn emit_toggle_cursor_row(&self) -> bool { 2844 let res = unsafe { 2845 glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject) 2846 .emit_by_name("toggle-cursor-row", &[]) 2847 .unwrap() 2848 }; 2849 res.unwrap() 2850 .get() 2851 .expect("Return Value for `emit_toggle_cursor_row`") 2852 } 2853 connect_unselect_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId2854 fn connect_unselect_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId { 2855 unsafe extern "C" fn unselect_all_trampoline< 2856 P: IsA<TreeView>, 2857 F: Fn(&P) -> bool + 'static, 2858 >( 2859 this: *mut ffi::GtkTreeView, 2860 f: glib::ffi::gpointer, 2861 ) -> glib::ffi::gboolean { 2862 let f: &F = &*(f as *const F); 2863 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()).into_glib() 2864 } 2865 unsafe { 2866 let f: Box_<F> = Box_::new(f); 2867 connect_raw( 2868 self.as_ptr() as *mut _, 2869 b"unselect-all\0".as_ptr() as *const _, 2870 Some(transmute::<_, unsafe extern "C" fn()>( 2871 unselect_all_trampoline::<Self, F> as *const (), 2872 )), 2873 Box_::into_raw(f), 2874 ) 2875 } 2876 } 2877 emit_unselect_all(&self) -> bool2878 fn emit_unselect_all(&self) -> bool { 2879 let res = unsafe { 2880 glib::Object::from_glib_borrow(self.as_ptr() as *mut glib::gobject_ffi::GObject) 2881 .emit_by_name("unselect-all", &[]) 2882 .unwrap() 2883 }; 2884 res.unwrap() 2885 .get() 2886 .expect("Return Value for `emit_unselect_all`") 2887 } 2888 connect_activate_on_single_click_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2889 fn connect_activate_on_single_click_notify<F: Fn(&Self) + 'static>( 2890 &self, 2891 f: F, 2892 ) -> SignalHandlerId { 2893 unsafe extern "C" fn notify_activate_on_single_click_trampoline< 2894 P: IsA<TreeView>, 2895 F: Fn(&P) + 'static, 2896 >( 2897 this: *mut ffi::GtkTreeView, 2898 _param_spec: glib::ffi::gpointer, 2899 f: glib::ffi::gpointer, 2900 ) { 2901 let f: &F = &*(f as *const F); 2902 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()) 2903 } 2904 unsafe { 2905 let f: Box_<F> = Box_::new(f); 2906 connect_raw( 2907 self.as_ptr() as *mut _, 2908 b"notify::activate-on-single-click\0".as_ptr() as *const _, 2909 Some(transmute::<_, unsafe extern "C" fn()>( 2910 notify_activate_on_single_click_trampoline::<Self, F> as *const (), 2911 )), 2912 Box_::into_raw(f), 2913 ) 2914 } 2915 } 2916 connect_enable_grid_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2917 fn connect_enable_grid_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 2918 unsafe extern "C" fn notify_enable_grid_lines_trampoline< 2919 P: IsA<TreeView>, 2920 F: Fn(&P) + 'static, 2921 >( 2922 this: *mut ffi::GtkTreeView, 2923 _param_spec: glib::ffi::gpointer, 2924 f: glib::ffi::gpointer, 2925 ) { 2926 let f: &F = &*(f as *const F); 2927 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()) 2928 } 2929 unsafe { 2930 let f: Box_<F> = Box_::new(f); 2931 connect_raw( 2932 self.as_ptr() as *mut _, 2933 b"notify::enable-grid-lines\0".as_ptr() as *const _, 2934 Some(transmute::<_, unsafe extern "C" fn()>( 2935 notify_enable_grid_lines_trampoline::<Self, F> as *const (), 2936 )), 2937 Box_::into_raw(f), 2938 ) 2939 } 2940 } 2941 connect_enable_search_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2942 fn connect_enable_search_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 2943 unsafe extern "C" fn notify_enable_search_trampoline< 2944 P: IsA<TreeView>, 2945 F: Fn(&P) + 'static, 2946 >( 2947 this: *mut ffi::GtkTreeView, 2948 _param_spec: glib::ffi::gpointer, 2949 f: glib::ffi::gpointer, 2950 ) { 2951 let f: &F = &*(f as *const F); 2952 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()) 2953 } 2954 unsafe { 2955 let f: Box_<F> = Box_::new(f); 2956 connect_raw( 2957 self.as_ptr() as *mut _, 2958 b"notify::enable-search\0".as_ptr() as *const _, 2959 Some(transmute::<_, unsafe extern "C" fn()>( 2960 notify_enable_search_trampoline::<Self, F> as *const (), 2961 )), 2962 Box_::into_raw(f), 2963 ) 2964 } 2965 } 2966 connect_enable_tree_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2967 fn connect_enable_tree_lines_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 2968 unsafe extern "C" fn notify_enable_tree_lines_trampoline< 2969 P: IsA<TreeView>, 2970 F: Fn(&P) + 'static, 2971 >( 2972 this: *mut ffi::GtkTreeView, 2973 _param_spec: glib::ffi::gpointer, 2974 f: glib::ffi::gpointer, 2975 ) { 2976 let f: &F = &*(f as *const F); 2977 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()) 2978 } 2979 unsafe { 2980 let f: Box_<F> = Box_::new(f); 2981 connect_raw( 2982 self.as_ptr() as *mut _, 2983 b"notify::enable-tree-lines\0".as_ptr() as *const _, 2984 Some(transmute::<_, unsafe extern "C" fn()>( 2985 notify_enable_tree_lines_trampoline::<Self, F> as *const (), 2986 )), 2987 Box_::into_raw(f), 2988 ) 2989 } 2990 } 2991 connect_expander_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2992 fn connect_expander_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 2993 unsafe extern "C" fn notify_expander_column_trampoline< 2994 P: IsA<TreeView>, 2995 F: Fn(&P) + 'static, 2996 >( 2997 this: *mut ffi::GtkTreeView, 2998 _param_spec: glib::ffi::gpointer, 2999 f: glib::ffi::gpointer, 3000 ) { 3001 let f: &F = &*(f as *const F); 3002 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()) 3003 } 3004 unsafe { 3005 let f: Box_<F> = Box_::new(f); 3006 connect_raw( 3007 self.as_ptr() as *mut _, 3008 b"notify::expander-column\0".as_ptr() as *const _, 3009 Some(transmute::<_, unsafe extern "C" fn()>( 3010 notify_expander_column_trampoline::<Self, F> as *const (), 3011 )), 3012 Box_::into_raw(f), 3013 ) 3014 } 3015 } 3016 connect_fixed_height_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId3017 fn connect_fixed_height_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 3018 unsafe extern "C" fn notify_fixed_height_mode_trampoline< 3019 P: IsA<TreeView>, 3020 F: Fn(&P) + 'static, 3021 >( 3022 this: *mut ffi::GtkTreeView, 3023 _param_spec: glib::ffi::gpointer, 3024 f: glib::ffi::gpointer, 3025 ) { 3026 let f: &F = &*(f as *const F); 3027 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()) 3028 } 3029 unsafe { 3030 let f: Box_<F> = Box_::new(f); 3031 connect_raw( 3032 self.as_ptr() as *mut _, 3033 b"notify::fixed-height-mode\0".as_ptr() as *const _, 3034 Some(transmute::<_, unsafe extern "C" fn()>( 3035 notify_fixed_height_mode_trampoline::<Self, F> as *const (), 3036 )), 3037 Box_::into_raw(f), 3038 ) 3039 } 3040 } 3041 connect_headers_clickable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId3042 fn connect_headers_clickable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 3043 unsafe extern "C" fn notify_headers_clickable_trampoline< 3044 P: IsA<TreeView>, 3045 F: Fn(&P) + 'static, 3046 >( 3047 this: *mut ffi::GtkTreeView, 3048 _param_spec: glib::ffi::gpointer, 3049 f: glib::ffi::gpointer, 3050 ) { 3051 let f: &F = &*(f as *const F); 3052 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()) 3053 } 3054 unsafe { 3055 let f: Box_<F> = Box_::new(f); 3056 connect_raw( 3057 self.as_ptr() as *mut _, 3058 b"notify::headers-clickable\0".as_ptr() as *const _, 3059 Some(transmute::<_, unsafe extern "C" fn()>( 3060 notify_headers_clickable_trampoline::<Self, F> as *const (), 3061 )), 3062 Box_::into_raw(f), 3063 ) 3064 } 3065 } 3066 connect_headers_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId3067 fn connect_headers_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 3068 unsafe extern "C" fn notify_headers_visible_trampoline< 3069 P: IsA<TreeView>, 3070 F: Fn(&P) + 'static, 3071 >( 3072 this: *mut ffi::GtkTreeView, 3073 _param_spec: glib::ffi::gpointer, 3074 f: glib::ffi::gpointer, 3075 ) { 3076 let f: &F = &*(f as *const F); 3077 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()) 3078 } 3079 unsafe { 3080 let f: Box_<F> = Box_::new(f); 3081 connect_raw( 3082 self.as_ptr() as *mut _, 3083 b"notify::headers-visible\0".as_ptr() as *const _, 3084 Some(transmute::<_, unsafe extern "C" fn()>( 3085 notify_headers_visible_trampoline::<Self, F> as *const (), 3086 )), 3087 Box_::into_raw(f), 3088 ) 3089 } 3090 } 3091 connect_hover_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId3092 fn connect_hover_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 3093 unsafe extern "C" fn notify_hover_expand_trampoline< 3094 P: IsA<TreeView>, 3095 F: Fn(&P) + 'static, 3096 >( 3097 this: *mut ffi::GtkTreeView, 3098 _param_spec: glib::ffi::gpointer, 3099 f: glib::ffi::gpointer, 3100 ) { 3101 let f: &F = &*(f as *const F); 3102 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()) 3103 } 3104 unsafe { 3105 let f: Box_<F> = Box_::new(f); 3106 connect_raw( 3107 self.as_ptr() as *mut _, 3108 b"notify::hover-expand\0".as_ptr() as *const _, 3109 Some(transmute::<_, unsafe extern "C" fn()>( 3110 notify_hover_expand_trampoline::<Self, F> as *const (), 3111 )), 3112 Box_::into_raw(f), 3113 ) 3114 } 3115 } 3116 connect_hover_selection_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId3117 fn connect_hover_selection_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 3118 unsafe extern "C" fn notify_hover_selection_trampoline< 3119 P: IsA<TreeView>, 3120 F: Fn(&P) + 'static, 3121 >( 3122 this: *mut ffi::GtkTreeView, 3123 _param_spec: glib::ffi::gpointer, 3124 f: glib::ffi::gpointer, 3125 ) { 3126 let f: &F = &*(f as *const F); 3127 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()) 3128 } 3129 unsafe { 3130 let f: Box_<F> = Box_::new(f); 3131 connect_raw( 3132 self.as_ptr() as *mut _, 3133 b"notify::hover-selection\0".as_ptr() as *const _, 3134 Some(transmute::<_, unsafe extern "C" fn()>( 3135 notify_hover_selection_trampoline::<Self, F> as *const (), 3136 )), 3137 Box_::into_raw(f), 3138 ) 3139 } 3140 } 3141 connect_level_indentation_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId3142 fn connect_level_indentation_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 3143 unsafe extern "C" fn notify_level_indentation_trampoline< 3144 P: IsA<TreeView>, 3145 F: Fn(&P) + 'static, 3146 >( 3147 this: *mut ffi::GtkTreeView, 3148 _param_spec: glib::ffi::gpointer, 3149 f: glib::ffi::gpointer, 3150 ) { 3151 let f: &F = &*(f as *const F); 3152 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()) 3153 } 3154 unsafe { 3155 let f: Box_<F> = Box_::new(f); 3156 connect_raw( 3157 self.as_ptr() as *mut _, 3158 b"notify::level-indentation\0".as_ptr() as *const _, 3159 Some(transmute::<_, unsafe extern "C" fn()>( 3160 notify_level_indentation_trampoline::<Self, F> as *const (), 3161 )), 3162 Box_::into_raw(f), 3163 ) 3164 } 3165 } 3166 connect_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId3167 fn connect_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 3168 unsafe extern "C" fn notify_model_trampoline<P: IsA<TreeView>, F: Fn(&P) + 'static>( 3169 this: *mut ffi::GtkTreeView, 3170 _param_spec: glib::ffi::gpointer, 3171 f: glib::ffi::gpointer, 3172 ) { 3173 let f: &F = &*(f as *const F); 3174 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()) 3175 } 3176 unsafe { 3177 let f: Box_<F> = Box_::new(f); 3178 connect_raw( 3179 self.as_ptr() as *mut _, 3180 b"notify::model\0".as_ptr() as *const _, 3181 Some(transmute::<_, unsafe extern "C" fn()>( 3182 notify_model_trampoline::<Self, F> as *const (), 3183 )), 3184 Box_::into_raw(f), 3185 ) 3186 } 3187 } 3188 connect_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId3189 fn connect_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 3190 unsafe extern "C" fn notify_reorderable_trampoline< 3191 P: IsA<TreeView>, 3192 F: Fn(&P) + 'static, 3193 >( 3194 this: *mut ffi::GtkTreeView, 3195 _param_spec: glib::ffi::gpointer, 3196 f: glib::ffi::gpointer, 3197 ) { 3198 let f: &F = &*(f as *const F); 3199 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()) 3200 } 3201 unsafe { 3202 let f: Box_<F> = Box_::new(f); 3203 connect_raw( 3204 self.as_ptr() as *mut _, 3205 b"notify::reorderable\0".as_ptr() as *const _, 3206 Some(transmute::<_, unsafe extern "C" fn()>( 3207 notify_reorderable_trampoline::<Self, F> as *const (), 3208 )), 3209 Box_::into_raw(f), 3210 ) 3211 } 3212 } 3213 connect_rubber_banding_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId3214 fn connect_rubber_banding_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 3215 unsafe extern "C" fn notify_rubber_banding_trampoline< 3216 P: IsA<TreeView>, 3217 F: Fn(&P) + 'static, 3218 >( 3219 this: *mut ffi::GtkTreeView, 3220 _param_spec: glib::ffi::gpointer, 3221 f: glib::ffi::gpointer, 3222 ) { 3223 let f: &F = &*(f as *const F); 3224 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()) 3225 } 3226 unsafe { 3227 let f: Box_<F> = Box_::new(f); 3228 connect_raw( 3229 self.as_ptr() as *mut _, 3230 b"notify::rubber-banding\0".as_ptr() as *const _, 3231 Some(transmute::<_, unsafe extern "C" fn()>( 3232 notify_rubber_banding_trampoline::<Self, F> as *const (), 3233 )), 3234 Box_::into_raw(f), 3235 ) 3236 } 3237 } 3238 connect_search_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId3239 fn connect_search_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 3240 unsafe extern "C" fn notify_search_column_trampoline< 3241 P: IsA<TreeView>, 3242 F: Fn(&P) + 'static, 3243 >( 3244 this: *mut ffi::GtkTreeView, 3245 _param_spec: glib::ffi::gpointer, 3246 f: glib::ffi::gpointer, 3247 ) { 3248 let f: &F = &*(f as *const F); 3249 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()) 3250 } 3251 unsafe { 3252 let f: Box_<F> = Box_::new(f); 3253 connect_raw( 3254 self.as_ptr() as *mut _, 3255 b"notify::search-column\0".as_ptr() as *const _, 3256 Some(transmute::<_, unsafe extern "C" fn()>( 3257 notify_search_column_trampoline::<Self, F> as *const (), 3258 )), 3259 Box_::into_raw(f), 3260 ) 3261 } 3262 } 3263 connect_show_expanders_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId3264 fn connect_show_expanders_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 3265 unsafe extern "C" fn notify_show_expanders_trampoline< 3266 P: IsA<TreeView>, 3267 F: Fn(&P) + 'static, 3268 >( 3269 this: *mut ffi::GtkTreeView, 3270 _param_spec: glib::ffi::gpointer, 3271 f: glib::ffi::gpointer, 3272 ) { 3273 let f: &F = &*(f as *const F); 3274 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()) 3275 } 3276 unsafe { 3277 let f: Box_<F> = Box_::new(f); 3278 connect_raw( 3279 self.as_ptr() as *mut _, 3280 b"notify::show-expanders\0".as_ptr() as *const _, 3281 Some(transmute::<_, unsafe extern "C" fn()>( 3282 notify_show_expanders_trampoline::<Self, F> as *const (), 3283 )), 3284 Box_::into_raw(f), 3285 ) 3286 } 3287 } 3288 connect_tooltip_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId3289 fn connect_tooltip_column_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 3290 unsafe extern "C" fn notify_tooltip_column_trampoline< 3291 P: IsA<TreeView>, 3292 F: Fn(&P) + 'static, 3293 >( 3294 this: *mut ffi::GtkTreeView, 3295 _param_spec: glib::ffi::gpointer, 3296 f: glib::ffi::gpointer, 3297 ) { 3298 let f: &F = &*(f as *const F); 3299 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()) 3300 } 3301 unsafe { 3302 let f: Box_<F> = Box_::new(f); 3303 connect_raw( 3304 self.as_ptr() as *mut _, 3305 b"notify::tooltip-column\0".as_ptr() as *const _, 3306 Some(transmute::<_, unsafe extern "C" fn()>( 3307 notify_tooltip_column_trampoline::<Self, F> as *const (), 3308 )), 3309 Box_::into_raw(f), 3310 ) 3311 } 3312 } 3313 connect_ubuntu_almost_fixed_height_mode_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId3314 fn connect_ubuntu_almost_fixed_height_mode_notify<F: Fn(&Self) + 'static>( 3315 &self, 3316 f: F, 3317 ) -> SignalHandlerId { 3318 unsafe extern "C" fn notify_ubuntu_almost_fixed_height_mode_trampoline< 3319 P: IsA<TreeView>, 3320 F: Fn(&P) + 'static, 3321 >( 3322 this: *mut ffi::GtkTreeView, 3323 _param_spec: glib::ffi::gpointer, 3324 f: glib::ffi::gpointer, 3325 ) { 3326 let f: &F = &*(f as *const F); 3327 f(TreeView::from_glib_borrow(this).unsafe_cast_ref()) 3328 } 3329 unsafe { 3330 let f: Box_<F> = Box_::new(f); 3331 connect_raw( 3332 self.as_ptr() as *mut _, 3333 b"notify::ubuntu-almost-fixed-height-mode\0".as_ptr() as *const _, 3334 Some(transmute::<_, unsafe extern "C" fn()>( 3335 notify_ubuntu_almost_fixed_height_mode_trampoline::<Self, F> as *const (), 3336 )), 3337 Box_::into_raw(f), 3338 ) 3339 } 3340 } 3341 } 3342 3343 impl fmt::Display for TreeView { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result3344 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 3345 f.write_str("TreeView") 3346 } 3347 } 3348