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 cairo; 6 use gdk; 7 use glib; 8 use glib::object::Cast; 9 use glib::object::IsA; 10 use glib::object::ObjectExt; 11 use glib::signal::connect_raw; 12 use glib::signal::SignalHandlerId; 13 use glib::translate::*; 14 use glib::GString; 15 use glib::StaticType; 16 use glib::ToValue; 17 use glib::Value; 18 use glib_sys; 19 use gobject_sys; 20 use gtk_sys; 21 use libc; 22 use signal::Inhibit; 23 use std::boxed::Box as Box_; 24 use std::fmt; 25 use std::mem; 26 use std::mem::transmute; 27 use std::ptr; 28 use Align; 29 use Buildable; 30 use CellRenderer; 31 use Container; 32 use Entry; 33 use MovementStep; 34 use ResizeMode; 35 use Scrollable; 36 use Tooltip; 37 use TreeIter; 38 use TreeModel; 39 use TreePath; 40 use TreeSelection; 41 use TreeViewColumn; 42 use TreeViewDropPosition; 43 use TreeViewGridLines; 44 use Widget; 45 46 glib_wrapper! { 47 pub struct TreeView(Object<gtk_sys::GtkTreeView, gtk_sys::GtkTreeViewClass, TreeViewClass>) @extends Container, Widget, @implements Buildable, Scrollable; 48 49 match fn { 50 get_type => || gtk_sys::gtk_tree_view_get_type(), 51 } 52 } 53 54 impl TreeView { new() -> TreeView55 pub fn new() -> TreeView { 56 assert_initialized_main_thread!(); 57 unsafe { Widget::from_glib_none(gtk_sys::gtk_tree_view_new()).unsafe_cast() } 58 } 59 new_with_model<P: IsA<TreeModel>>(model: &P) -> TreeView60 pub fn new_with_model<P: IsA<TreeModel>>(model: &P) -> TreeView { 61 skip_assert_initialized!(); 62 unsafe { 63 Widget::from_glib_none(gtk_sys::gtk_tree_view_new_with_model( 64 model.as_ref().to_glib_none().0, 65 )) 66 .unsafe_cast() 67 } 68 } 69 } 70 71 impl Default for TreeView { default() -> Self72 fn default() -> Self { 73 Self::new() 74 } 75 } 76 77 pub struct TreeViewBuilder { 78 activate_on_single_click: Option<bool>, 79 enable_grid_lines: Option<TreeViewGridLines>, 80 enable_search: Option<bool>, 81 enable_tree_lines: Option<bool>, 82 expander_column: Option<TreeViewColumn>, 83 fixed_height_mode: Option<bool>, 84 headers_clickable: Option<bool>, 85 headers_visible: Option<bool>, 86 hover_expand: Option<bool>, 87 hover_selection: Option<bool>, 88 level_indentation: Option<i32>, 89 model: Option<TreeModel>, 90 reorderable: Option<bool>, 91 rubber_banding: Option<bool>, 92 search_column: Option<i32>, 93 show_expanders: Option<bool>, 94 tooltip_column: Option<i32>, 95 ubuntu_almost_fixed_height_mode: Option<bool>, 96 border_width: Option<u32>, 97 child: Option<Widget>, 98 resize_mode: Option<ResizeMode>, 99 app_paintable: Option<bool>, 100 can_default: Option<bool>, 101 can_focus: Option<bool>, 102 events: Option<gdk::EventMask>, 103 expand: Option<bool>, 104 #[cfg(any(feature = "v3_20", feature = "dox"))] 105 focus_on_click: Option<bool>, 106 halign: Option<Align>, 107 has_default: Option<bool>, 108 has_focus: Option<bool>, 109 has_tooltip: Option<bool>, 110 height_request: Option<i32>, 111 hexpand: Option<bool>, 112 hexpand_set: Option<bool>, 113 is_focus: Option<bool>, 114 margin: Option<i32>, 115 margin_bottom: Option<i32>, 116 margin_end: Option<i32>, 117 margin_start: Option<i32>, 118 margin_top: Option<i32>, 119 name: Option<String>, 120 no_show_all: Option<bool>, 121 opacity: Option<f64>, 122 parent: Option<Container>, 123 receives_default: Option<bool>, 124 sensitive: Option<bool>, 125 //style: /*Unknown type*/, 126 tooltip_markup: Option<String>, 127 tooltip_text: Option<String>, 128 valign: Option<Align>, 129 vexpand: Option<bool>, 130 vexpand_set: Option<bool>, 131 visible: Option<bool>, 132 width_request: Option<i32>, 133 } 134 135 impl TreeViewBuilder { new() -> Self136 pub fn new() -> Self { 137 Self { 138 activate_on_single_click: None, 139 enable_grid_lines: None, 140 enable_search: None, 141 enable_tree_lines: None, 142 expander_column: None, 143 fixed_height_mode: None, 144 headers_clickable: None, 145 headers_visible: None, 146 hover_expand: None, 147 hover_selection: None, 148 level_indentation: None, 149 model: None, 150 reorderable: None, 151 rubber_banding: None, 152 search_column: None, 153 show_expanders: None, 154 tooltip_column: None, 155 ubuntu_almost_fixed_height_mode: None, 156 border_width: None, 157 child: None, 158 resize_mode: None, 159 app_paintable: None, 160 can_default: None, 161 can_focus: None, 162 events: None, 163 expand: None, 164 #[cfg(any(feature = "v3_20", feature = "dox"))] 165 focus_on_click: None, 166 halign: None, 167 has_default: None, 168 has_focus: None, 169 has_tooltip: None, 170 height_request: None, 171 hexpand: None, 172 hexpand_set: None, 173 is_focus: None, 174 margin: None, 175 margin_bottom: None, 176 margin_end: None, 177 margin_start: None, 178 margin_top: None, 179 name: None, 180 no_show_all: None, 181 opacity: None, 182 parent: None, 183 receives_default: None, 184 sensitive: None, 185 tooltip_markup: None, 186 tooltip_text: None, 187 valign: None, 188 vexpand: None, 189 vexpand_set: None, 190 visible: None, 191 width_request: None, 192 } 193 } 194 build(self) -> TreeView195 pub fn build(self) -> TreeView { 196 let mut properties: Vec<(&str, &dyn ToValue)> = vec![]; 197 if let Some(ref activate_on_single_click) = self.activate_on_single_click { 198 properties.push(("activate-on-single-click", activate_on_single_click)); 199 } 200 if let Some(ref enable_grid_lines) = self.enable_grid_lines { 201 properties.push(("enable-grid-lines", enable_grid_lines)); 202 } 203 if let Some(ref enable_search) = self.enable_search { 204 properties.push(("enable-search", enable_search)); 205 } 206 if let Some(ref enable_tree_lines) = self.enable_tree_lines { 207 properties.push(("enable-tree-lines", enable_tree_lines)); 208 } 209 if let Some(ref expander_column) = self.expander_column { 210 properties.push(("expander-column", expander_column)); 211 } 212 if let Some(ref fixed_height_mode) = self.fixed_height_mode { 213 properties.push(("fixed-height-mode", fixed_height_mode)); 214 } 215 if let Some(ref headers_clickable) = self.headers_clickable { 216 properties.push(("headers-clickable", headers_clickable)); 217 } 218 if let Some(ref headers_visible) = self.headers_visible { 219 properties.push(("headers-visible", headers_visible)); 220 } 221 if let Some(ref hover_expand) = self.hover_expand { 222 properties.push(("hover-expand", hover_expand)); 223 } 224 if let Some(ref hover_selection) = self.hover_selection { 225 properties.push(("hover-selection", hover_selection)); 226 } 227 if let Some(ref level_indentation) = self.level_indentation { 228 properties.push(("level-indentation", level_indentation)); 229 } 230 if let Some(ref model) = self.model { 231 properties.push(("model", model)); 232 } 233 if let Some(ref reorderable) = self.reorderable { 234 properties.push(("reorderable", reorderable)); 235 } 236 if let Some(ref rubber_banding) = self.rubber_banding { 237 properties.push(("rubber-banding", rubber_banding)); 238 } 239 if let Some(ref search_column) = self.search_column { 240 properties.push(("search-column", search_column)); 241 } 242 if let Some(ref show_expanders) = self.show_expanders { 243 properties.push(("show-expanders", show_expanders)); 244 } 245 if let Some(ref tooltip_column) = self.tooltip_column { 246 properties.push(("tooltip-column", tooltip_column)); 247 } 248 if let Some(ref ubuntu_almost_fixed_height_mode) = self.ubuntu_almost_fixed_height_mode { 249 properties.push(( 250 "ubuntu-almost-fixed-height-mode", 251 ubuntu_almost_fixed_height_mode, 252 )); 253 } 254 if let Some(ref border_width) = self.border_width { 255 properties.push(("border-width", border_width)); 256 } 257 if let Some(ref child) = self.child { 258 properties.push(("child", child)); 259 } 260 if let Some(ref resize_mode) = self.resize_mode { 261 properties.push(("resize-mode", resize_mode)); 262 } 263 if let Some(ref app_paintable) = self.app_paintable { 264 properties.push(("app-paintable", app_paintable)); 265 } 266 if let Some(ref can_default) = self.can_default { 267 properties.push(("can-default", can_default)); 268 } 269 if let Some(ref can_focus) = self.can_focus { 270 properties.push(("can-focus", can_focus)); 271 } 272 if let Some(ref events) = self.events { 273 properties.push(("events", events)); 274 } 275 if let Some(ref expand) = self.expand { 276 properties.push(("expand", expand)); 277 } 278 #[cfg(any(feature = "v3_20", feature = "dox"))] 279 { 280 if let Some(ref focus_on_click) = self.focus_on_click { 281 properties.push(("focus-on-click", focus_on_click)); 282 } 283 } 284 if let Some(ref halign) = self.halign { 285 properties.push(("halign", halign)); 286 } 287 if let Some(ref has_default) = self.has_default { 288 properties.push(("has-default", has_default)); 289 } 290 if let Some(ref has_focus) = self.has_focus { 291 properties.push(("has-focus", has_focus)); 292 } 293 if let Some(ref has_tooltip) = self.has_tooltip { 294 properties.push(("has-tooltip", has_tooltip)); 295 } 296 if let Some(ref height_request) = self.height_request { 297 properties.push(("height-request", height_request)); 298 } 299 if let Some(ref hexpand) = self.hexpand { 300 properties.push(("hexpand", hexpand)); 301 } 302 if let Some(ref hexpand_set) = self.hexpand_set { 303 properties.push(("hexpand-set", hexpand_set)); 304 } 305 if let Some(ref is_focus) = self.is_focus { 306 properties.push(("is-focus", is_focus)); 307 } 308 if let Some(ref margin) = self.margin { 309 properties.push(("margin", margin)); 310 } 311 if let Some(ref margin_bottom) = self.margin_bottom { 312 properties.push(("margin-bottom", margin_bottom)); 313 } 314 if let Some(ref margin_end) = self.margin_end { 315 properties.push(("margin-end", margin_end)); 316 } 317 if let Some(ref margin_start) = self.margin_start { 318 properties.push(("margin-start", margin_start)); 319 } 320 if let Some(ref margin_top) = self.margin_top { 321 properties.push(("margin-top", margin_top)); 322 } 323 if let Some(ref name) = self.name { 324 properties.push(("name", name)); 325 } 326 if let Some(ref no_show_all) = self.no_show_all { 327 properties.push(("no-show-all", no_show_all)); 328 } 329 if let Some(ref opacity) = self.opacity { 330 properties.push(("opacity", opacity)); 331 } 332 if let Some(ref parent) = self.parent { 333 properties.push(("parent", parent)); 334 } 335 if let Some(ref receives_default) = self.receives_default { 336 properties.push(("receives-default", receives_default)); 337 } 338 if let Some(ref sensitive) = self.sensitive { 339 properties.push(("sensitive", sensitive)); 340 } 341 if let Some(ref tooltip_markup) = self.tooltip_markup { 342 properties.push(("tooltip-markup", tooltip_markup)); 343 } 344 if let Some(ref tooltip_text) = self.tooltip_text { 345 properties.push(("tooltip-text", tooltip_text)); 346 } 347 if let Some(ref valign) = self.valign { 348 properties.push(("valign", valign)); 349 } 350 if let Some(ref vexpand) = self.vexpand { 351 properties.push(("vexpand", vexpand)); 352 } 353 if let Some(ref vexpand_set) = self.vexpand_set { 354 properties.push(("vexpand-set", vexpand_set)); 355 } 356 if let Some(ref visible) = self.visible { 357 properties.push(("visible", visible)); 358 } 359 if let Some(ref width_request) = self.width_request { 360 properties.push(("width-request", width_request)); 361 } 362 glib::Object::new(TreeView::static_type(), &properties) 363 .expect("object new") 364 .downcast() 365 .expect("downcast") 366 } 367 activate_on_single_click(mut self, activate_on_single_click: bool) -> Self368 pub fn activate_on_single_click(mut self, activate_on_single_click: bool) -> Self { 369 self.activate_on_single_click = Some(activate_on_single_click); 370 self 371 } 372 enable_grid_lines(mut self, enable_grid_lines: TreeViewGridLines) -> Self373 pub fn enable_grid_lines(mut self, enable_grid_lines: TreeViewGridLines) -> Self { 374 self.enable_grid_lines = Some(enable_grid_lines); 375 self 376 } 377 enable_search(mut self, enable_search: bool) -> Self378 pub fn enable_search(mut self, enable_search: bool) -> Self { 379 self.enable_search = Some(enable_search); 380 self 381 } 382 enable_tree_lines(mut self, enable_tree_lines: bool) -> Self383 pub fn enable_tree_lines(mut self, enable_tree_lines: bool) -> Self { 384 self.enable_tree_lines = Some(enable_tree_lines); 385 self 386 } 387 expander_column(mut self, expander_column: &TreeViewColumn) -> Self388 pub fn expander_column(mut self, expander_column: &TreeViewColumn) -> Self { 389 self.expander_column = Some(expander_column.clone()); 390 self 391 } 392 fixed_height_mode(mut self, fixed_height_mode: bool) -> Self393 pub fn fixed_height_mode(mut self, fixed_height_mode: bool) -> Self { 394 self.fixed_height_mode = Some(fixed_height_mode); 395 self 396 } 397 headers_clickable(mut self, headers_clickable: bool) -> Self398 pub fn headers_clickable(mut self, headers_clickable: bool) -> Self { 399 self.headers_clickable = Some(headers_clickable); 400 self 401 } 402 headers_visible(mut self, headers_visible: bool) -> Self403 pub fn headers_visible(mut self, headers_visible: bool) -> Self { 404 self.headers_visible = Some(headers_visible); 405 self 406 } 407 hover_expand(mut self, hover_expand: bool) -> Self408 pub fn hover_expand(mut self, hover_expand: bool) -> Self { 409 self.hover_expand = Some(hover_expand); 410 self 411 } 412 hover_selection(mut self, hover_selection: bool) -> Self413 pub fn hover_selection(mut self, hover_selection: bool) -> Self { 414 self.hover_selection = Some(hover_selection); 415 self 416 } 417 level_indentation(mut self, level_indentation: i32) -> Self418 pub fn level_indentation(mut self, level_indentation: i32) -> Self { 419 self.level_indentation = Some(level_indentation); 420 self 421 } 422 model(mut self, model: &TreeModel) -> Self423 pub fn model(mut self, model: &TreeModel) -> Self { 424 self.model = Some(model.clone()); 425 self 426 } 427 reorderable(mut self, reorderable: bool) -> Self428 pub fn reorderable(mut self, reorderable: bool) -> Self { 429 self.reorderable = Some(reorderable); 430 self 431 } 432 rubber_banding(mut self, rubber_banding: bool) -> Self433 pub fn rubber_banding(mut self, rubber_banding: bool) -> Self { 434 self.rubber_banding = Some(rubber_banding); 435 self 436 } 437 search_column(mut self, search_column: i32) -> Self438 pub fn search_column(mut self, search_column: i32) -> Self { 439 self.search_column = Some(search_column); 440 self 441 } 442 show_expanders(mut self, show_expanders: bool) -> Self443 pub fn show_expanders(mut self, show_expanders: bool) -> Self { 444 self.show_expanders = Some(show_expanders); 445 self 446 } 447 tooltip_column(mut self, tooltip_column: i32) -> Self448 pub fn tooltip_column(mut self, tooltip_column: i32) -> Self { 449 self.tooltip_column = Some(tooltip_column); 450 self 451 } 452 ubuntu_almost_fixed_height_mode( mut self, ubuntu_almost_fixed_height_mode: bool, ) -> Self453 pub fn ubuntu_almost_fixed_height_mode( 454 mut self, 455 ubuntu_almost_fixed_height_mode: bool, 456 ) -> Self { 457 self.ubuntu_almost_fixed_height_mode = Some(ubuntu_almost_fixed_height_mode); 458 self 459 } 460 border_width(mut self, border_width: u32) -> Self461 pub fn border_width(mut self, border_width: u32) -> Self { 462 self.border_width = Some(border_width); 463 self 464 } 465 child(mut self, child: &Widget) -> Self466 pub fn child(mut self, child: &Widget) -> Self { 467 self.child = Some(child.clone()); 468 self 469 } 470 resize_mode(mut self, resize_mode: ResizeMode) -> Self471 pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self { 472 self.resize_mode = Some(resize_mode); 473 self 474 } 475 app_paintable(mut self, app_paintable: bool) -> Self476 pub fn app_paintable(mut self, app_paintable: bool) -> Self { 477 self.app_paintable = Some(app_paintable); 478 self 479 } 480 can_default(mut self, can_default: bool) -> Self481 pub fn can_default(mut self, can_default: bool) -> Self { 482 self.can_default = Some(can_default); 483 self 484 } 485 can_focus(mut self, can_focus: bool) -> Self486 pub fn can_focus(mut self, can_focus: bool) -> Self { 487 self.can_focus = Some(can_focus); 488 self 489 } 490 events(mut self, events: gdk::EventMask) -> Self491 pub fn events(mut self, events: gdk::EventMask) -> Self { 492 self.events = Some(events); 493 self 494 } 495 expand(mut self, expand: bool) -> Self496 pub fn expand(mut self, expand: bool) -> Self { 497 self.expand = Some(expand); 498 self 499 } 500 501 #[cfg(any(feature = "v3_20", feature = "dox"))] focus_on_click(mut self, focus_on_click: bool) -> Self502 pub fn focus_on_click(mut self, focus_on_click: bool) -> Self { 503 self.focus_on_click = Some(focus_on_click); 504 self 505 } 506 halign(mut self, halign: Align) -> Self507 pub fn halign(mut self, halign: Align) -> Self { 508 self.halign = Some(halign); 509 self 510 } 511 has_default(mut self, has_default: bool) -> Self512 pub fn has_default(mut self, has_default: bool) -> Self { 513 self.has_default = Some(has_default); 514 self 515 } 516 has_focus(mut self, has_focus: bool) -> Self517 pub fn has_focus(mut self, has_focus: bool) -> Self { 518 self.has_focus = Some(has_focus); 519 self 520 } 521 has_tooltip(mut self, has_tooltip: bool) -> Self522 pub fn has_tooltip(mut self, has_tooltip: bool) -> Self { 523 self.has_tooltip = Some(has_tooltip); 524 self 525 } 526 height_request(mut self, height_request: i32) -> Self527 pub fn height_request(mut self, height_request: i32) -> Self { 528 self.height_request = Some(height_request); 529 self 530 } 531 hexpand(mut self, hexpand: bool) -> Self532 pub fn hexpand(mut self, hexpand: bool) -> Self { 533 self.hexpand = Some(hexpand); 534 self 535 } 536 hexpand_set(mut self, hexpand_set: bool) -> Self537 pub fn hexpand_set(mut self, hexpand_set: bool) -> Self { 538 self.hexpand_set = Some(hexpand_set); 539 self 540 } 541 is_focus(mut self, is_focus: bool) -> Self542 pub fn is_focus(mut self, is_focus: bool) -> Self { 543 self.is_focus = Some(is_focus); 544 self 545 } 546 margin(mut self, margin: i32) -> Self547 pub fn margin(mut self, margin: i32) -> Self { 548 self.margin = Some(margin); 549 self 550 } 551 margin_bottom(mut self, margin_bottom: i32) -> Self552 pub fn margin_bottom(mut self, margin_bottom: i32) -> Self { 553 self.margin_bottom = Some(margin_bottom); 554 self 555 } 556 margin_end(mut self, margin_end: i32) -> Self557 pub fn margin_end(mut self, margin_end: i32) -> Self { 558 self.margin_end = Some(margin_end); 559 self 560 } 561 margin_start(mut self, margin_start: i32) -> Self562 pub fn margin_start(mut self, margin_start: i32) -> Self { 563 self.margin_start = Some(margin_start); 564 self 565 } 566 margin_top(mut self, margin_top: i32) -> Self567 pub fn margin_top(mut self, margin_top: i32) -> Self { 568 self.margin_top = Some(margin_top); 569 self 570 } 571 name(mut self, name: &str) -> Self572 pub fn name(mut self, name: &str) -> Self { 573 self.name = Some(name.to_string()); 574 self 575 } 576 no_show_all(mut self, no_show_all: bool) -> Self577 pub fn no_show_all(mut self, no_show_all: bool) -> Self { 578 self.no_show_all = Some(no_show_all); 579 self 580 } 581 opacity(mut self, opacity: f64) -> Self582 pub fn opacity(mut self, opacity: f64) -> Self { 583 self.opacity = Some(opacity); 584 self 585 } 586 parent(mut self, parent: &Container) -> Self587 pub fn parent(mut self, parent: &Container) -> Self { 588 self.parent = Some(parent.clone()); 589 self 590 } 591 receives_default(mut self, receives_default: bool) -> Self592 pub fn receives_default(mut self, receives_default: bool) -> Self { 593 self.receives_default = Some(receives_default); 594 self 595 } 596 sensitive(mut self, sensitive: bool) -> Self597 pub fn sensitive(mut self, sensitive: bool) -> Self { 598 self.sensitive = Some(sensitive); 599 self 600 } 601 tooltip_markup(mut self, tooltip_markup: &str) -> Self602 pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self { 603 self.tooltip_markup = Some(tooltip_markup.to_string()); 604 self 605 } 606 tooltip_text(mut self, tooltip_text: &str) -> Self607 pub fn tooltip_text(mut self, tooltip_text: &str) -> Self { 608 self.tooltip_text = Some(tooltip_text.to_string()); 609 self 610 } 611 valign(mut self, valign: Align) -> Self612 pub fn valign(mut self, valign: Align) -> Self { 613 self.valign = Some(valign); 614 self 615 } 616 vexpand(mut self, vexpand: bool) -> Self617 pub fn vexpand(mut self, vexpand: bool) -> Self { 618 self.vexpand = Some(vexpand); 619 self 620 } 621 vexpand_set(mut self, vexpand_set: bool) -> Self622 pub fn vexpand_set(mut self, vexpand_set: bool) -> Self { 623 self.vexpand_set = Some(vexpand_set); 624 self 625 } 626 visible(mut self, visible: bool) -> Self627 pub fn visible(mut self, visible: bool) -> Self { 628 self.visible = Some(visible); 629 self 630 } 631 width_request(mut self, width_request: i32) -> Self632 pub fn width_request(mut self, width_request: i32) -> Self { 633 self.width_request = Some(width_request); 634 self 635 } 636 } 637 638 pub const NONE_TREE_VIEW: Option<&TreeView> = None; 639 640 pub trait TreeViewExt: 'static { append_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i32641 fn append_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i32; 642 collapse_all(&self)643 fn collapse_all(&self); 644 collapse_row(&self, path: &TreePath) -> bool645 fn collapse_row(&self, path: &TreePath) -> bool; 646 columns_autosize(&self)647 fn columns_autosize(&self); 648 convert_bin_window_to_tree_coords(&self, bx: i32, by: i32) -> (i32, i32)649 fn convert_bin_window_to_tree_coords(&self, bx: i32, by: i32) -> (i32, i32); 650 convert_bin_window_to_widget_coords(&self, bx: i32, by: i32) -> (i32, i32)651 fn convert_bin_window_to_widget_coords(&self, bx: i32, by: i32) -> (i32, i32); 652 convert_tree_to_bin_window_coords(&self, tx: i32, ty: i32) -> (i32, i32)653 fn convert_tree_to_bin_window_coords(&self, tx: i32, ty: i32) -> (i32, i32); 654 convert_tree_to_widget_coords(&self, tx: i32, ty: i32) -> (i32, i32)655 fn convert_tree_to_widget_coords(&self, tx: i32, ty: i32) -> (i32, i32); 656 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 convert_widget_to_tree_coords(&self, wx: i32, wy: i32) -> (i32, i32)659 fn convert_widget_to_tree_coords(&self, wx: i32, wy: i32) -> (i32, i32); 660 create_row_drag_icon(&self, path: &TreePath) -> Option<cairo::Surface>661 fn create_row_drag_icon(&self, path: &TreePath) -> Option<cairo::Surface>; 662 expand_all(&self)663 fn expand_all(&self); 664 expand_row(&self, path: &TreePath, open_all: bool) -> bool665 fn expand_row(&self, path: &TreePath, open_all: bool) -> bool; 666 expand_to_path(&self, path: &TreePath)667 fn expand_to_path(&self, path: &TreePath); 668 get_activate_on_single_click(&self) -> bool669 fn get_activate_on_single_click(&self) -> bool; 670 get_background_area<P: IsA<TreeViewColumn>>( &self, path: Option<&TreePath>, column: Option<&P>, ) -> gdk::Rectangle671 fn get_background_area<P: IsA<TreeViewColumn>>( 672 &self, 673 path: Option<&TreePath>, 674 column: Option<&P>, 675 ) -> gdk::Rectangle; 676 get_bin_window(&self) -> Option<gdk::Window>677 fn get_bin_window(&self) -> Option<gdk::Window>; 678 get_cell_area<P: IsA<TreeViewColumn>>( &self, path: Option<&TreePath>, column: Option<&P>, ) -> gdk::Rectangle679 fn get_cell_area<P: IsA<TreeViewColumn>>( 680 &self, 681 path: Option<&TreePath>, 682 column: Option<&P>, 683 ) -> gdk::Rectangle; 684 get_column(&self, n: i32) -> Option<TreeViewColumn>685 fn get_column(&self, n: i32) -> Option<TreeViewColumn>; 686 get_columns(&self) -> Vec<TreeViewColumn>687 fn get_columns(&self) -> Vec<TreeViewColumn>; 688 get_cursor(&self) -> (Option<TreePath>, Option<TreeViewColumn>)689 fn get_cursor(&self) -> (Option<TreePath>, Option<TreeViewColumn>); 690 get_dest_row_at_pos( &self, drag_x: i32, drag_y: i32, ) -> Option<(Option<TreePath>, TreeViewDropPosition)>691 fn get_dest_row_at_pos( 692 &self, 693 drag_x: i32, 694 drag_y: i32, 695 ) -> Option<(Option<TreePath>, TreeViewDropPosition)>; 696 get_drag_dest_row(&self) -> (Option<TreePath>, TreeViewDropPosition)697 fn get_drag_dest_row(&self) -> (Option<TreePath>, TreeViewDropPosition); 698 get_enable_search(&self) -> bool699 fn get_enable_search(&self) -> bool; 700 get_enable_tree_lines(&self) -> bool701 fn get_enable_tree_lines(&self) -> bool; 702 get_expander_column(&self) -> Option<TreeViewColumn>703 fn get_expander_column(&self) -> Option<TreeViewColumn>; 704 get_fixed_height_mode(&self) -> bool705 fn get_fixed_height_mode(&self) -> bool; 706 get_grid_lines(&self) -> TreeViewGridLines707 fn get_grid_lines(&self) -> TreeViewGridLines; 708 get_headers_clickable(&self) -> bool709 fn get_headers_clickable(&self) -> bool; 710 get_headers_visible(&self) -> bool711 fn get_headers_visible(&self) -> bool; 712 get_hover_expand(&self) -> bool713 fn get_hover_expand(&self) -> bool; 714 get_hover_selection(&self) -> bool715 fn get_hover_selection(&self) -> bool; 716 get_level_indentation(&self) -> i32717 fn get_level_indentation(&self) -> i32; 718 get_model(&self) -> Option<TreeModel>719 fn get_model(&self) -> Option<TreeModel>; 720 get_n_columns(&self) -> u32721 fn get_n_columns(&self) -> u32; 722 get_path_at_pos( &self, x: i32, y: i32, ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)>723 fn get_path_at_pos( 724 &self, 725 x: i32, 726 y: i32, 727 ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)>; 728 get_reorderable(&self) -> bool729 fn get_reorderable(&self) -> bool; 730 731 //fn get_row_separator_func(&self) -> Option<Box<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>; 732 get_rubber_banding(&self) -> bool733 fn get_rubber_banding(&self) -> bool; 734 get_search_column(&self) -> i32735 fn get_search_column(&self) -> i32; 736 get_search_entry(&self) -> Option<Entry>737 fn get_search_entry(&self) -> Option<Entry>; 738 739 //fn get_search_equal_func(&self) -> Option<Box<dyn Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static>>; 740 741 //fn get_search_position_func(&self) -> Option<Box<dyn Fn(&TreeView, &Widget) + 'static>>; 742 get_selection(&self) -> TreeSelection743 fn get_selection(&self) -> TreeSelection; 744 get_show_expanders(&self) -> bool745 fn get_show_expanders(&self) -> bool; 746 get_tooltip_column(&self) -> i32747 fn get_tooltip_column(&self) -> i32; 748 get_tooltip_context( &self, x: &mut i32, y: &mut i32, keyboard_tip: bool, ) -> Option<(Option<TreeModel>, TreePath, TreeIter)>749 fn get_tooltip_context( 750 &self, 751 x: &mut i32, 752 y: &mut i32, 753 keyboard_tip: bool, 754 ) -> Option<(Option<TreeModel>, TreePath, TreeIter)>; 755 get_visible_range(&self) -> Option<(TreePath, TreePath)>756 fn get_visible_range(&self) -> Option<(TreePath, TreePath)>; 757 get_visible_rect(&self) -> gdk::Rectangle758 fn get_visible_rect(&self) -> gdk::Rectangle; 759 insert_column<P: IsA<TreeViewColumn>>(&self, column: &P, position: i32) -> i32760 fn insert_column<P: IsA<TreeViewColumn>>(&self, column: &P, position: i32) -> i32; 761 762 //fn insert_column_with_attributes<P: IsA<CellRenderer>>(&self, position: i32, title: &str, cell: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> i32; 763 insert_column_with_data_func< P: IsA<CellRenderer>, Q: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static, >( &self, position: i32, title: &str, cell: &P, func: Q, ) -> i32764 fn insert_column_with_data_func< 765 P: IsA<CellRenderer>, 766 Q: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static, 767 >( 768 &self, 769 position: i32, 770 title: &str, 771 cell: &P, 772 func: Q, 773 ) -> i32; 774 is_blank_at_pos( &self, x: i32, y: i32, ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)>775 fn is_blank_at_pos( 776 &self, 777 x: i32, 778 y: i32, 779 ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)>; 780 is_rubber_banding_active(&self) -> bool781 fn is_rubber_banding_active(&self) -> bool; 782 map_expanded_rows<P: FnMut(&TreeView, &TreePath)>(&self, func: P)783 fn map_expanded_rows<P: FnMut(&TreeView, &TreePath)>(&self, func: P); 784 move_column_after<P: IsA<TreeViewColumn>, Q: IsA<TreeViewColumn>>( &self, column: &P, base_column: Option<&Q>, )785 fn move_column_after<P: IsA<TreeViewColumn>, Q: IsA<TreeViewColumn>>( 786 &self, 787 column: &P, 788 base_column: Option<&Q>, 789 ); 790 remove_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i32791 fn remove_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i32; 792 row_activated<P: IsA<TreeViewColumn>>(&self, path: &TreePath, column: &P)793 fn row_activated<P: IsA<TreeViewColumn>>(&self, path: &TreePath, column: &P); 794 row_expanded(&self, path: &TreePath) -> bool795 fn row_expanded(&self, path: &TreePath) -> bool; 796 scroll_to_cell<P: IsA<TreeViewColumn>>( &self, path: Option<&TreePath>, column: Option<&P>, use_align: bool, row_align: f32, col_align: f32, )797 fn scroll_to_cell<P: IsA<TreeViewColumn>>( 798 &self, 799 path: Option<&TreePath>, 800 column: Option<&P>, 801 use_align: bool, 802 row_align: f32, 803 col_align: f32, 804 ); 805 scroll_to_point(&self, tree_x: i32, tree_y: i32)806 fn scroll_to_point(&self, tree_x: i32, tree_y: i32); 807 set_activate_on_single_click(&self, single: bool)808 fn set_activate_on_single_click(&self, single: bool); 809 set_column_drag_function( &self, func: Option< Box< dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool + 'static, >, >, )810 fn set_column_drag_function( 811 &self, 812 func: Option< 813 Box< 814 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool 815 + 'static, 816 >, 817 >, 818 ); 819 set_cursor<P: IsA<TreeViewColumn>>( &self, path: &TreePath, focus_column: Option<&P>, start_editing: bool, )820 fn set_cursor<P: IsA<TreeViewColumn>>( 821 &self, 822 path: &TreePath, 823 focus_column: Option<&P>, 824 start_editing: bool, 825 ); 826 set_cursor_on_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( &self, path: &TreePath, focus_column: Option<&P>, focus_cell: Option<&Q>, start_editing: bool, )827 fn set_cursor_on_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( 828 &self, 829 path: &TreePath, 830 focus_column: Option<&P>, 831 focus_cell: Option<&Q>, 832 start_editing: bool, 833 ); 834 set_drag_dest_row(&self, path: Option<&TreePath>, pos: TreeViewDropPosition)835 fn set_drag_dest_row(&self, path: Option<&TreePath>, pos: TreeViewDropPosition); 836 set_enable_search(&self, enable_search: bool)837 fn set_enable_search(&self, enable_search: bool); 838 set_enable_tree_lines(&self, enabled: bool)839 fn set_enable_tree_lines(&self, enabled: bool); 840 set_expander_column<P: IsA<TreeViewColumn>>(&self, column: Option<&P>)841 fn set_expander_column<P: IsA<TreeViewColumn>>(&self, column: Option<&P>); 842 set_fixed_height_mode(&self, enable: bool)843 fn set_fixed_height_mode(&self, enable: bool); 844 set_grid_lines(&self, grid_lines: TreeViewGridLines)845 fn set_grid_lines(&self, grid_lines: TreeViewGridLines); 846 set_headers_clickable(&self, setting: bool)847 fn set_headers_clickable(&self, setting: bool); 848 set_headers_visible(&self, headers_visible: bool)849 fn set_headers_visible(&self, headers_visible: bool); 850 set_hover_expand(&self, expand: bool)851 fn set_hover_expand(&self, expand: bool); 852 set_hover_selection(&self, hover: bool)853 fn set_hover_selection(&self, hover: bool); 854 set_level_indentation(&self, indentation: i32)855 fn set_level_indentation(&self, indentation: i32); 856 set_model<P: IsA<TreeModel>>(&self, model: Option<&P>)857 fn set_model<P: IsA<TreeModel>>(&self, model: Option<&P>); 858 set_reorderable(&self, reorderable: bool)859 fn set_reorderable(&self, reorderable: bool); 860 set_row_separator_func( &self, func: Option<Box<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>, )861 fn set_row_separator_func( 862 &self, 863 func: Option<Box<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>, 864 ); 865 set_rubber_banding(&self, enable: bool)866 fn set_rubber_banding(&self, enable: bool); 867 set_search_column(&self, column: i32)868 fn set_search_column(&self, column: i32); 869 set_search_entry<P: IsA<Entry>>(&self, entry: Option<&P>)870 fn set_search_entry<P: IsA<Entry>>(&self, entry: Option<&P>); 871 set_search_equal_func<P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static>( &self, search_equal_func: P, )872 fn set_search_equal_func<P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static>( 873 &self, 874 search_equal_func: P, 875 ); 876 set_search_position_func(&self, func: Option<Box<dyn Fn(&TreeView, &Widget) + 'static>>)877 fn set_search_position_func(&self, func: Option<Box<dyn Fn(&TreeView, &Widget) + 'static>>); 878 set_show_expanders(&self, enabled: bool)879 fn set_show_expanders(&self, enabled: bool); 880 set_tooltip_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( &self, tooltip: &Tooltip, path: Option<&TreePath>, column: Option<&P>, cell: Option<&Q>, )881 fn set_tooltip_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( 882 &self, 883 tooltip: &Tooltip, 884 path: Option<&TreePath>, 885 column: Option<&P>, 886 cell: Option<&Q>, 887 ); 888 set_tooltip_column(&self, column: i32)889 fn set_tooltip_column(&self, column: i32); 890 set_tooltip_row(&self, tooltip: &Tooltip, path: &TreePath)891 fn set_tooltip_row(&self, tooltip: &Tooltip, path: &TreePath); 892 unset_rows_drag_dest(&self)893 fn unset_rows_drag_dest(&self); 894 unset_rows_drag_source(&self)895 fn unset_rows_drag_source(&self); 896 get_property_enable_grid_lines(&self) -> TreeViewGridLines897 fn get_property_enable_grid_lines(&self) -> TreeViewGridLines; 898 set_property_enable_grid_lines(&self, enable_grid_lines: TreeViewGridLines)899 fn set_property_enable_grid_lines(&self, enable_grid_lines: TreeViewGridLines); 900 set_property_ubuntu_almost_fixed_height_mode(&self, ubuntu_almost_fixed_height_mode: bool)901 fn set_property_ubuntu_almost_fixed_height_mode(&self, ubuntu_almost_fixed_height_mode: bool); 902 connect_columns_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId903 fn connect_columns_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 904 connect_cursor_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId905 fn connect_cursor_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 906 connect_expand_collapse_cursor_row<F: Fn(&Self, bool, bool, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId907 fn connect_expand_collapse_cursor_row<F: Fn(&Self, bool, bool, bool) -> bool + 'static>( 908 &self, 909 f: F, 910 ) -> SignalHandlerId; 911 emit_expand_collapse_cursor_row(&self, object: bool, p0: bool, p1: bool) -> bool912 fn emit_expand_collapse_cursor_row(&self, object: bool, p0: bool, p1: bool) -> bool; 913 connect_move_cursor<F: Fn(&Self, MovementStep, i32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId914 fn connect_move_cursor<F: Fn(&Self, MovementStep, i32) -> bool + 'static>( 915 &self, 916 f: F, 917 ) -> SignalHandlerId; 918 emit_move_cursor(&self, step: MovementStep, direction: i32) -> bool919 fn emit_move_cursor(&self, step: MovementStep, direction: i32) -> bool; 920 connect_row_activated<F: Fn(&Self, &TreePath, &TreeViewColumn) + 'static>( &self, f: F, ) -> SignalHandlerId921 fn connect_row_activated<F: Fn(&Self, &TreePath, &TreeViewColumn) + 'static>( 922 &self, 923 f: F, 924 ) -> SignalHandlerId; 925 emit_row_activated(&self, path: &TreePath, column: &TreeViewColumn)926 fn emit_row_activated(&self, path: &TreePath, column: &TreeViewColumn); 927 connect_row_collapsed<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( &self, f: F, ) -> SignalHandlerId928 fn connect_row_collapsed<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( 929 &self, 930 f: F, 931 ) -> SignalHandlerId; 932 connect_row_expanded<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( &self, f: F, ) -> SignalHandlerId933 fn connect_row_expanded<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( 934 &self, 935 f: F, 936 ) -> SignalHandlerId; 937 connect_select_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId938 fn connect_select_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId; 939 emit_select_all(&self) -> bool940 fn emit_select_all(&self) -> bool; 941 connect_select_cursor_parent<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId942 fn connect_select_cursor_parent<F: Fn(&Self) -> bool + 'static>(&self, f: F) 943 -> SignalHandlerId; 944 emit_select_cursor_parent(&self) -> bool945 fn emit_select_cursor_parent(&self) -> bool; 946 connect_select_cursor_row<F: Fn(&Self, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId947 fn connect_select_cursor_row<F: Fn(&Self, bool) -> bool + 'static>( 948 &self, 949 f: F, 950 ) -> SignalHandlerId; 951 emit_select_cursor_row(&self, object: bool) -> bool952 fn emit_select_cursor_row(&self, object: bool) -> bool; 953 connect_start_interactive_search<F: Fn(&Self) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId954 fn connect_start_interactive_search<F: Fn(&Self) -> bool + 'static>( 955 &self, 956 f: F, 957 ) -> SignalHandlerId; 958 emit_start_interactive_search(&self) -> bool959 fn emit_start_interactive_search(&self) -> bool; 960 connect_test_collapse_row<F: Fn(&Self, &TreeIter, &TreePath) -> Inhibit + 'static>( &self, f: F, ) -> SignalHandlerId961 fn connect_test_collapse_row<F: Fn(&Self, &TreeIter, &TreePath) -> Inhibit + 'static>( 962 &self, 963 f: F, 964 ) -> SignalHandlerId; 965 connect_test_expand_row<F: Fn(&Self, &TreeIter, &TreePath) -> Inhibit + 'static>( &self, f: F, ) -> SignalHandlerId966 fn connect_test_expand_row<F: Fn(&Self, &TreeIter, &TreePath) -> Inhibit + 'static>( 967 &self, 968 f: F, 969 ) -> SignalHandlerId; 970 connect_toggle_cursor_row<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId971 fn connect_toggle_cursor_row<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId; 972 emit_toggle_cursor_row(&self) -> bool973 fn emit_toggle_cursor_row(&self) -> bool; 974 connect_unselect_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId975 fn connect_unselect_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId; 976 emit_unselect_all(&self) -> bool977 fn emit_unselect_all(&self) -> bool; 978 connect_property_activate_on_single_click_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId979 fn connect_property_activate_on_single_click_notify<F: Fn(&Self) + 'static>( 980 &self, 981 f: F, 982 ) -> SignalHandlerId; 983 connect_property_enable_grid_lines_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId984 fn connect_property_enable_grid_lines_notify<F: Fn(&Self) + 'static>( 985 &self, 986 f: F, 987 ) -> SignalHandlerId; 988 connect_property_enable_search_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId989 fn connect_property_enable_search_notify<F: Fn(&Self) + 'static>( 990 &self, 991 f: F, 992 ) -> SignalHandlerId; 993 connect_property_enable_tree_lines_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId994 fn connect_property_enable_tree_lines_notify<F: Fn(&Self) + 'static>( 995 &self, 996 f: F, 997 ) -> SignalHandlerId; 998 connect_property_expander_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId999 fn connect_property_expander_column_notify<F: Fn(&Self) + 'static>( 1000 &self, 1001 f: F, 1002 ) -> SignalHandlerId; 1003 connect_property_fixed_height_mode_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1004 fn connect_property_fixed_height_mode_notify<F: Fn(&Self) + 'static>( 1005 &self, 1006 f: F, 1007 ) -> SignalHandlerId; 1008 connect_property_headers_clickable_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1009 fn connect_property_headers_clickable_notify<F: Fn(&Self) + 'static>( 1010 &self, 1011 f: F, 1012 ) -> SignalHandlerId; 1013 connect_property_headers_visible_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1014 fn connect_property_headers_visible_notify<F: Fn(&Self) + 'static>( 1015 &self, 1016 f: F, 1017 ) -> SignalHandlerId; 1018 connect_property_hover_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1019 fn connect_property_hover_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) 1020 -> SignalHandlerId; 1021 connect_property_hover_selection_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1022 fn connect_property_hover_selection_notify<F: Fn(&Self) + 'static>( 1023 &self, 1024 f: F, 1025 ) -> SignalHandlerId; 1026 connect_property_level_indentation_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1027 fn connect_property_level_indentation_notify<F: Fn(&Self) + 'static>( 1028 &self, 1029 f: F, 1030 ) -> SignalHandlerId; 1031 connect_property_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1032 fn connect_property_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1033 connect_property_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1034 fn connect_property_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1035 connect_property_rubber_banding_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1036 fn connect_property_rubber_banding_notify<F: Fn(&Self) + 'static>( 1037 &self, 1038 f: F, 1039 ) -> SignalHandlerId; 1040 connect_property_search_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1041 fn connect_property_search_column_notify<F: Fn(&Self) + 'static>( 1042 &self, 1043 f: F, 1044 ) -> SignalHandlerId; 1045 connect_property_show_expanders_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1046 fn connect_property_show_expanders_notify<F: Fn(&Self) + 'static>( 1047 &self, 1048 f: F, 1049 ) -> SignalHandlerId; 1050 connect_property_tooltip_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1051 fn connect_property_tooltip_column_notify<F: Fn(&Self) + 'static>( 1052 &self, 1053 f: F, 1054 ) -> SignalHandlerId; 1055 connect_property_ubuntu_almost_fixed_height_mode_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1056 fn connect_property_ubuntu_almost_fixed_height_mode_notify<F: Fn(&Self) + 'static>( 1057 &self, 1058 f: F, 1059 ) -> SignalHandlerId; 1060 } 1061 1062 impl<O: IsA<TreeView>> TreeViewExt for O { append_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i321063 fn append_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i32 { 1064 unsafe { 1065 gtk_sys::gtk_tree_view_append_column( 1066 self.as_ref().to_glib_none().0, 1067 column.as_ref().to_glib_none().0, 1068 ) 1069 } 1070 } 1071 collapse_all(&self)1072 fn collapse_all(&self) { 1073 unsafe { 1074 gtk_sys::gtk_tree_view_collapse_all(self.as_ref().to_glib_none().0); 1075 } 1076 } 1077 collapse_row(&self, path: &TreePath) -> bool1078 fn collapse_row(&self, path: &TreePath) -> bool { 1079 unsafe { 1080 from_glib(gtk_sys::gtk_tree_view_collapse_row( 1081 self.as_ref().to_glib_none().0, 1082 mut_override(path.to_glib_none().0), 1083 )) 1084 } 1085 } 1086 columns_autosize(&self)1087 fn columns_autosize(&self) { 1088 unsafe { 1089 gtk_sys::gtk_tree_view_columns_autosize(self.as_ref().to_glib_none().0); 1090 } 1091 } 1092 convert_bin_window_to_tree_coords(&self, bx: i32, by: i32) -> (i32, i32)1093 fn convert_bin_window_to_tree_coords(&self, bx: i32, by: i32) -> (i32, i32) { 1094 unsafe { 1095 let mut tx = mem::uninitialized(); 1096 let mut ty = mem::uninitialized(); 1097 gtk_sys::gtk_tree_view_convert_bin_window_to_tree_coords( 1098 self.as_ref().to_glib_none().0, 1099 bx, 1100 by, 1101 &mut tx, 1102 &mut ty, 1103 ); 1104 (tx, ty) 1105 } 1106 } 1107 convert_bin_window_to_widget_coords(&self, bx: i32, by: i32) -> (i32, i32)1108 fn convert_bin_window_to_widget_coords(&self, bx: i32, by: i32) -> (i32, i32) { 1109 unsafe { 1110 let mut wx = mem::uninitialized(); 1111 let mut wy = mem::uninitialized(); 1112 gtk_sys::gtk_tree_view_convert_bin_window_to_widget_coords( 1113 self.as_ref().to_glib_none().0, 1114 bx, 1115 by, 1116 &mut wx, 1117 &mut wy, 1118 ); 1119 (wx, wy) 1120 } 1121 } 1122 convert_tree_to_bin_window_coords(&self, tx: i32, ty: i32) -> (i32, i32)1123 fn convert_tree_to_bin_window_coords(&self, tx: i32, ty: i32) -> (i32, i32) { 1124 unsafe { 1125 let mut bx = mem::uninitialized(); 1126 let mut by = mem::uninitialized(); 1127 gtk_sys::gtk_tree_view_convert_tree_to_bin_window_coords( 1128 self.as_ref().to_glib_none().0, 1129 tx, 1130 ty, 1131 &mut bx, 1132 &mut by, 1133 ); 1134 (bx, by) 1135 } 1136 } 1137 convert_tree_to_widget_coords(&self, tx: i32, ty: i32) -> (i32, i32)1138 fn convert_tree_to_widget_coords(&self, tx: i32, ty: i32) -> (i32, i32) { 1139 unsafe { 1140 let mut wx = mem::uninitialized(); 1141 let mut wy = mem::uninitialized(); 1142 gtk_sys::gtk_tree_view_convert_tree_to_widget_coords( 1143 self.as_ref().to_glib_none().0, 1144 tx, 1145 ty, 1146 &mut wx, 1147 &mut wy, 1148 ); 1149 (wx, wy) 1150 } 1151 } 1152 convert_widget_to_bin_window_coords(&self, wx: i32, wy: i32) -> (i32, i32)1153 fn convert_widget_to_bin_window_coords(&self, wx: i32, wy: i32) -> (i32, i32) { 1154 unsafe { 1155 let mut bx = mem::uninitialized(); 1156 let mut by = mem::uninitialized(); 1157 gtk_sys::gtk_tree_view_convert_widget_to_bin_window_coords( 1158 self.as_ref().to_glib_none().0, 1159 wx, 1160 wy, 1161 &mut bx, 1162 &mut by, 1163 ); 1164 (bx, by) 1165 } 1166 } 1167 convert_widget_to_tree_coords(&self, wx: i32, wy: i32) -> (i32, i32)1168 fn convert_widget_to_tree_coords(&self, wx: i32, wy: i32) -> (i32, i32) { 1169 unsafe { 1170 let mut tx = mem::uninitialized(); 1171 let mut ty = mem::uninitialized(); 1172 gtk_sys::gtk_tree_view_convert_widget_to_tree_coords( 1173 self.as_ref().to_glib_none().0, 1174 wx, 1175 wy, 1176 &mut tx, 1177 &mut ty, 1178 ); 1179 (tx, ty) 1180 } 1181 } 1182 create_row_drag_icon(&self, path: &TreePath) -> Option<cairo::Surface>1183 fn create_row_drag_icon(&self, path: &TreePath) -> Option<cairo::Surface> { 1184 unsafe { 1185 from_glib_full(gtk_sys::gtk_tree_view_create_row_drag_icon( 1186 self.as_ref().to_glib_none().0, 1187 mut_override(path.to_glib_none().0), 1188 )) 1189 } 1190 } 1191 expand_all(&self)1192 fn expand_all(&self) { 1193 unsafe { 1194 gtk_sys::gtk_tree_view_expand_all(self.as_ref().to_glib_none().0); 1195 } 1196 } 1197 expand_row(&self, path: &TreePath, open_all: bool) -> bool1198 fn expand_row(&self, path: &TreePath, open_all: bool) -> bool { 1199 unsafe { 1200 from_glib(gtk_sys::gtk_tree_view_expand_row( 1201 self.as_ref().to_glib_none().0, 1202 mut_override(path.to_glib_none().0), 1203 open_all.to_glib(), 1204 )) 1205 } 1206 } 1207 expand_to_path(&self, path: &TreePath)1208 fn expand_to_path(&self, path: &TreePath) { 1209 unsafe { 1210 gtk_sys::gtk_tree_view_expand_to_path( 1211 self.as_ref().to_glib_none().0, 1212 mut_override(path.to_glib_none().0), 1213 ); 1214 } 1215 } 1216 get_activate_on_single_click(&self) -> bool1217 fn get_activate_on_single_click(&self) -> bool { 1218 unsafe { 1219 from_glib(gtk_sys::gtk_tree_view_get_activate_on_single_click( 1220 self.as_ref().to_glib_none().0, 1221 )) 1222 } 1223 } 1224 get_background_area<P: IsA<TreeViewColumn>>( &self, path: Option<&TreePath>, column: Option<&P>, ) -> gdk::Rectangle1225 fn get_background_area<P: IsA<TreeViewColumn>>( 1226 &self, 1227 path: Option<&TreePath>, 1228 column: Option<&P>, 1229 ) -> gdk::Rectangle { 1230 unsafe { 1231 let mut rect = gdk::Rectangle::uninitialized(); 1232 gtk_sys::gtk_tree_view_get_background_area( 1233 self.as_ref().to_glib_none().0, 1234 mut_override(path.to_glib_none().0), 1235 column.map(|p| p.as_ref()).to_glib_none().0, 1236 rect.to_glib_none_mut().0, 1237 ); 1238 rect 1239 } 1240 } 1241 get_bin_window(&self) -> Option<gdk::Window>1242 fn get_bin_window(&self) -> Option<gdk::Window> { 1243 unsafe { 1244 from_glib_none(gtk_sys::gtk_tree_view_get_bin_window( 1245 self.as_ref().to_glib_none().0, 1246 )) 1247 } 1248 } 1249 get_cell_area<P: IsA<TreeViewColumn>>( &self, path: Option<&TreePath>, column: Option<&P>, ) -> gdk::Rectangle1250 fn get_cell_area<P: IsA<TreeViewColumn>>( 1251 &self, 1252 path: Option<&TreePath>, 1253 column: Option<&P>, 1254 ) -> gdk::Rectangle { 1255 unsafe { 1256 let mut rect = gdk::Rectangle::uninitialized(); 1257 gtk_sys::gtk_tree_view_get_cell_area( 1258 self.as_ref().to_glib_none().0, 1259 mut_override(path.to_glib_none().0), 1260 column.map(|p| p.as_ref()).to_glib_none().0, 1261 rect.to_glib_none_mut().0, 1262 ); 1263 rect 1264 } 1265 } 1266 get_column(&self, n: i32) -> Option<TreeViewColumn>1267 fn get_column(&self, n: i32) -> Option<TreeViewColumn> { 1268 unsafe { 1269 from_glib_none(gtk_sys::gtk_tree_view_get_column( 1270 self.as_ref().to_glib_none().0, 1271 n, 1272 )) 1273 } 1274 } 1275 get_columns(&self) -> Vec<TreeViewColumn>1276 fn get_columns(&self) -> Vec<TreeViewColumn> { 1277 unsafe { 1278 FromGlibPtrContainer::from_glib_container(gtk_sys::gtk_tree_view_get_columns( 1279 self.as_ref().to_glib_none().0, 1280 )) 1281 } 1282 } 1283 get_cursor(&self) -> (Option<TreePath>, Option<TreeViewColumn>)1284 fn get_cursor(&self) -> (Option<TreePath>, Option<TreeViewColumn>) { 1285 unsafe { 1286 let mut path = ptr::null_mut(); 1287 let mut focus_column = ptr::null_mut(); 1288 gtk_sys::gtk_tree_view_get_cursor( 1289 self.as_ref().to_glib_none().0, 1290 &mut path, 1291 &mut focus_column, 1292 ); 1293 (from_glib_full(path), from_glib_none(focus_column)) 1294 } 1295 } 1296 get_dest_row_at_pos( &self, drag_x: i32, drag_y: i32, ) -> Option<(Option<TreePath>, TreeViewDropPosition)>1297 fn get_dest_row_at_pos( 1298 &self, 1299 drag_x: i32, 1300 drag_y: i32, 1301 ) -> Option<(Option<TreePath>, TreeViewDropPosition)> { 1302 unsafe { 1303 let mut path = ptr::null_mut(); 1304 let mut pos = mem::uninitialized(); 1305 let ret = from_glib(gtk_sys::gtk_tree_view_get_dest_row_at_pos( 1306 self.as_ref().to_glib_none().0, 1307 drag_x, 1308 drag_y, 1309 &mut path, 1310 &mut pos, 1311 )); 1312 if ret { 1313 Some((from_glib_full(path), from_glib(pos))) 1314 } else { 1315 None 1316 } 1317 } 1318 } 1319 get_drag_dest_row(&self) -> (Option<TreePath>, TreeViewDropPosition)1320 fn get_drag_dest_row(&self) -> (Option<TreePath>, TreeViewDropPosition) { 1321 unsafe { 1322 let mut path = ptr::null_mut(); 1323 let mut pos = mem::uninitialized(); 1324 gtk_sys::gtk_tree_view_get_drag_dest_row( 1325 self.as_ref().to_glib_none().0, 1326 &mut path, 1327 &mut pos, 1328 ); 1329 (from_glib_full(path), from_glib(pos)) 1330 } 1331 } 1332 get_enable_search(&self) -> bool1333 fn get_enable_search(&self) -> bool { 1334 unsafe { 1335 from_glib(gtk_sys::gtk_tree_view_get_enable_search( 1336 self.as_ref().to_glib_none().0, 1337 )) 1338 } 1339 } 1340 get_enable_tree_lines(&self) -> bool1341 fn get_enable_tree_lines(&self) -> bool { 1342 unsafe { 1343 from_glib(gtk_sys::gtk_tree_view_get_enable_tree_lines( 1344 self.as_ref().to_glib_none().0, 1345 )) 1346 } 1347 } 1348 get_expander_column(&self) -> Option<TreeViewColumn>1349 fn get_expander_column(&self) -> Option<TreeViewColumn> { 1350 unsafe { 1351 from_glib_none(gtk_sys::gtk_tree_view_get_expander_column( 1352 self.as_ref().to_glib_none().0, 1353 )) 1354 } 1355 } 1356 get_fixed_height_mode(&self) -> bool1357 fn get_fixed_height_mode(&self) -> bool { 1358 unsafe { 1359 from_glib(gtk_sys::gtk_tree_view_get_fixed_height_mode( 1360 self.as_ref().to_glib_none().0, 1361 )) 1362 } 1363 } 1364 get_grid_lines(&self) -> TreeViewGridLines1365 fn get_grid_lines(&self) -> TreeViewGridLines { 1366 unsafe { 1367 from_glib(gtk_sys::gtk_tree_view_get_grid_lines( 1368 self.as_ref().to_glib_none().0, 1369 )) 1370 } 1371 } 1372 get_headers_clickable(&self) -> bool1373 fn get_headers_clickable(&self) -> bool { 1374 unsafe { 1375 from_glib(gtk_sys::gtk_tree_view_get_headers_clickable( 1376 self.as_ref().to_glib_none().0, 1377 )) 1378 } 1379 } 1380 get_headers_visible(&self) -> bool1381 fn get_headers_visible(&self) -> bool { 1382 unsafe { 1383 from_glib(gtk_sys::gtk_tree_view_get_headers_visible( 1384 self.as_ref().to_glib_none().0, 1385 )) 1386 } 1387 } 1388 get_hover_expand(&self) -> bool1389 fn get_hover_expand(&self) -> bool { 1390 unsafe { 1391 from_glib(gtk_sys::gtk_tree_view_get_hover_expand( 1392 self.as_ref().to_glib_none().0, 1393 )) 1394 } 1395 } 1396 get_hover_selection(&self) -> bool1397 fn get_hover_selection(&self) -> bool { 1398 unsafe { 1399 from_glib(gtk_sys::gtk_tree_view_get_hover_selection( 1400 self.as_ref().to_glib_none().0, 1401 )) 1402 } 1403 } 1404 get_level_indentation(&self) -> i321405 fn get_level_indentation(&self) -> i32 { 1406 unsafe { gtk_sys::gtk_tree_view_get_level_indentation(self.as_ref().to_glib_none().0) } 1407 } 1408 get_model(&self) -> Option<TreeModel>1409 fn get_model(&self) -> Option<TreeModel> { 1410 unsafe { 1411 from_glib_none(gtk_sys::gtk_tree_view_get_model( 1412 self.as_ref().to_glib_none().0, 1413 )) 1414 } 1415 } 1416 get_n_columns(&self) -> u321417 fn get_n_columns(&self) -> u32 { 1418 unsafe { gtk_sys::gtk_tree_view_get_n_columns(self.as_ref().to_glib_none().0) } 1419 } 1420 get_path_at_pos( &self, x: i32, y: i32, ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)>1421 fn get_path_at_pos( 1422 &self, 1423 x: i32, 1424 y: i32, 1425 ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)> { 1426 unsafe { 1427 let mut path = ptr::null_mut(); 1428 let mut column = ptr::null_mut(); 1429 let mut cell_x = mem::uninitialized(); 1430 let mut cell_y = mem::uninitialized(); 1431 let ret = from_glib(gtk_sys::gtk_tree_view_get_path_at_pos( 1432 self.as_ref().to_glib_none().0, 1433 x, 1434 y, 1435 &mut path, 1436 &mut column, 1437 &mut cell_x, 1438 &mut cell_y, 1439 )); 1440 if ret { 1441 Some((from_glib_full(path), from_glib_none(column), cell_x, cell_y)) 1442 } else { 1443 None 1444 } 1445 } 1446 } 1447 get_reorderable(&self) -> bool1448 fn get_reorderable(&self) -> bool { 1449 unsafe { 1450 from_glib(gtk_sys::gtk_tree_view_get_reorderable( 1451 self.as_ref().to_glib_none().0, 1452 )) 1453 } 1454 } 1455 1456 //fn get_row_separator_func(&self) -> Option<Box<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>> { 1457 // unsafe { TODO: call gtk_sys:gtk_tree_view_get_row_separator_func() } 1458 //} 1459 get_rubber_banding(&self) -> bool1460 fn get_rubber_banding(&self) -> bool { 1461 unsafe { 1462 from_glib(gtk_sys::gtk_tree_view_get_rubber_banding( 1463 self.as_ref().to_glib_none().0, 1464 )) 1465 } 1466 } 1467 get_search_column(&self) -> i321468 fn get_search_column(&self) -> i32 { 1469 unsafe { gtk_sys::gtk_tree_view_get_search_column(self.as_ref().to_glib_none().0) } 1470 } 1471 get_search_entry(&self) -> Option<Entry>1472 fn get_search_entry(&self) -> Option<Entry> { 1473 unsafe { 1474 from_glib_none(gtk_sys::gtk_tree_view_get_search_entry( 1475 self.as_ref().to_glib_none().0, 1476 )) 1477 } 1478 } 1479 1480 //fn get_search_equal_func(&self) -> Option<Box<dyn Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static>> { 1481 // unsafe { TODO: call gtk_sys:gtk_tree_view_get_search_equal_func() } 1482 //} 1483 1484 //fn get_search_position_func(&self) -> Option<Box<dyn Fn(&TreeView, &Widget) + 'static>> { 1485 // unsafe { TODO: call gtk_sys:gtk_tree_view_get_search_position_func() } 1486 //} 1487 get_selection(&self) -> TreeSelection1488 fn get_selection(&self) -> TreeSelection { 1489 unsafe { 1490 from_glib_none(gtk_sys::gtk_tree_view_get_selection( 1491 self.as_ref().to_glib_none().0, 1492 )) 1493 } 1494 } 1495 get_show_expanders(&self) -> bool1496 fn get_show_expanders(&self) -> bool { 1497 unsafe { 1498 from_glib(gtk_sys::gtk_tree_view_get_show_expanders( 1499 self.as_ref().to_glib_none().0, 1500 )) 1501 } 1502 } 1503 get_tooltip_column(&self) -> i321504 fn get_tooltip_column(&self) -> i32 { 1505 unsafe { gtk_sys::gtk_tree_view_get_tooltip_column(self.as_ref().to_glib_none().0) } 1506 } 1507 get_tooltip_context( &self, x: &mut i32, y: &mut i32, keyboard_tip: bool, ) -> Option<(Option<TreeModel>, TreePath, TreeIter)>1508 fn get_tooltip_context( 1509 &self, 1510 x: &mut i32, 1511 y: &mut i32, 1512 keyboard_tip: bool, 1513 ) -> Option<(Option<TreeModel>, TreePath, TreeIter)> { 1514 unsafe { 1515 let mut model = ptr::null_mut(); 1516 let mut path = ptr::null_mut(); 1517 let mut iter = TreeIter::uninitialized(); 1518 let ret = from_glib(gtk_sys::gtk_tree_view_get_tooltip_context( 1519 self.as_ref().to_glib_none().0, 1520 x, 1521 y, 1522 keyboard_tip.to_glib(), 1523 &mut model, 1524 &mut path, 1525 iter.to_glib_none_mut().0, 1526 )); 1527 if ret { 1528 Some((from_glib_none(model), from_glib_full(path), iter)) 1529 } else { 1530 None 1531 } 1532 } 1533 } 1534 get_visible_range(&self) -> Option<(TreePath, TreePath)>1535 fn get_visible_range(&self) -> Option<(TreePath, TreePath)> { 1536 unsafe { 1537 let mut start_path = ptr::null_mut(); 1538 let mut end_path = ptr::null_mut(); 1539 let ret = from_glib(gtk_sys::gtk_tree_view_get_visible_range( 1540 self.as_ref().to_glib_none().0, 1541 &mut start_path, 1542 &mut end_path, 1543 )); 1544 if ret { 1545 Some((from_glib_full(start_path), from_glib_full(end_path))) 1546 } else { 1547 None 1548 } 1549 } 1550 } 1551 get_visible_rect(&self) -> gdk::Rectangle1552 fn get_visible_rect(&self) -> gdk::Rectangle { 1553 unsafe { 1554 let mut visible_rect = gdk::Rectangle::uninitialized(); 1555 gtk_sys::gtk_tree_view_get_visible_rect( 1556 self.as_ref().to_glib_none().0, 1557 visible_rect.to_glib_none_mut().0, 1558 ); 1559 visible_rect 1560 } 1561 } 1562 insert_column<P: IsA<TreeViewColumn>>(&self, column: &P, position: i32) -> i321563 fn insert_column<P: IsA<TreeViewColumn>>(&self, column: &P, position: i32) -> i32 { 1564 unsafe { 1565 gtk_sys::gtk_tree_view_insert_column( 1566 self.as_ref().to_glib_none().0, 1567 column.as_ref().to_glib_none().0, 1568 position, 1569 ) 1570 } 1571 } 1572 1573 //fn insert_column_with_attributes<P: IsA<CellRenderer>>(&self, position: i32, title: &str, cell: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> i32 { 1574 // unsafe { TODO: call gtk_sys:gtk_tree_view_insert_column_with_attributes() } 1575 //} 1576 insert_column_with_data_func< P: IsA<CellRenderer>, Q: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static, >( &self, position: i32, title: &str, cell: &P, func: Q, ) -> i321577 fn insert_column_with_data_func< 1578 P: IsA<CellRenderer>, 1579 Q: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static, 1580 >( 1581 &self, 1582 position: i32, 1583 title: &str, 1584 cell: &P, 1585 func: Q, 1586 ) -> i32 { 1587 let func_data: Box_<Q> = Box::new(func); 1588 unsafe extern "C" fn func_func< 1589 P: IsA<CellRenderer>, 1590 Q: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static, 1591 >( 1592 tree_column: *mut gtk_sys::GtkTreeViewColumn, 1593 cell: *mut gtk_sys::GtkCellRenderer, 1594 tree_model: *mut gtk_sys::GtkTreeModel, 1595 iter: *mut gtk_sys::GtkTreeIter, 1596 data: glib_sys::gpointer, 1597 ) { 1598 let tree_column = from_glib_borrow(tree_column); 1599 let cell = from_glib_borrow(cell); 1600 let tree_model = from_glib_borrow(tree_model); 1601 let iter = from_glib_borrow(iter); 1602 let callback: &Q = &*(data as *mut _); 1603 (*callback)(&tree_column, &cell, &tree_model, &iter); 1604 } 1605 let func = Some(func_func::<P, Q> as _); 1606 unsafe extern "C" fn dnotify_func< 1607 P: IsA<CellRenderer>, 1608 Q: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static, 1609 >( 1610 data: glib_sys::gpointer, 1611 ) { 1612 let _callback: Box_<Q> = Box_::from_raw(data as *mut _); 1613 } 1614 let destroy_call6 = Some(dnotify_func::<P, Q> as _); 1615 let super_callback0: Box_<Q> = func_data; 1616 unsafe { 1617 gtk_sys::gtk_tree_view_insert_column_with_data_func( 1618 self.as_ref().to_glib_none().0, 1619 position, 1620 title.to_glib_none().0, 1621 cell.as_ref().to_glib_none().0, 1622 func, 1623 Box::into_raw(super_callback0) as *mut _, 1624 destroy_call6, 1625 ) 1626 } 1627 } 1628 is_blank_at_pos( &self, x: i32, y: i32, ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)>1629 fn is_blank_at_pos( 1630 &self, 1631 x: i32, 1632 y: i32, 1633 ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)> { 1634 unsafe { 1635 let mut path = ptr::null_mut(); 1636 let mut column = ptr::null_mut(); 1637 let mut cell_x = mem::uninitialized(); 1638 let mut cell_y = mem::uninitialized(); 1639 let ret = from_glib(gtk_sys::gtk_tree_view_is_blank_at_pos( 1640 self.as_ref().to_glib_none().0, 1641 x, 1642 y, 1643 &mut path, 1644 &mut column, 1645 &mut cell_x, 1646 &mut cell_y, 1647 )); 1648 if ret { 1649 Some((from_glib_full(path), from_glib_none(column), cell_x, cell_y)) 1650 } else { 1651 None 1652 } 1653 } 1654 } 1655 is_rubber_banding_active(&self) -> bool1656 fn is_rubber_banding_active(&self) -> bool { 1657 unsafe { 1658 from_glib(gtk_sys::gtk_tree_view_is_rubber_banding_active( 1659 self.as_ref().to_glib_none().0, 1660 )) 1661 } 1662 } 1663 map_expanded_rows<P: FnMut(&TreeView, &TreePath)>(&self, func: P)1664 fn map_expanded_rows<P: FnMut(&TreeView, &TreePath)>(&self, func: P) { 1665 let func_data: P = func; 1666 unsafe extern "C" fn func_func<P: FnMut(&TreeView, &TreePath)>( 1667 tree_view: *mut gtk_sys::GtkTreeView, 1668 path: *mut gtk_sys::GtkTreePath, 1669 user_data: glib_sys::gpointer, 1670 ) { 1671 let tree_view = from_glib_borrow(tree_view); 1672 let path = from_glib_borrow(path); 1673 let callback: *mut P = user_data as *const _ as usize as *mut P; 1674 (*callback)(&tree_view, &path); 1675 } 1676 let func = Some(func_func::<P> as _); 1677 let super_callback0: &P = &func_data; 1678 unsafe { 1679 gtk_sys::gtk_tree_view_map_expanded_rows( 1680 self.as_ref().to_glib_none().0, 1681 func, 1682 super_callback0 as *const _ as usize as *mut _, 1683 ); 1684 } 1685 } 1686 move_column_after<P: IsA<TreeViewColumn>, Q: IsA<TreeViewColumn>>( &self, column: &P, base_column: Option<&Q>, )1687 fn move_column_after<P: IsA<TreeViewColumn>, Q: IsA<TreeViewColumn>>( 1688 &self, 1689 column: &P, 1690 base_column: Option<&Q>, 1691 ) { 1692 unsafe { 1693 gtk_sys::gtk_tree_view_move_column_after( 1694 self.as_ref().to_glib_none().0, 1695 column.as_ref().to_glib_none().0, 1696 base_column.map(|p| p.as_ref()).to_glib_none().0, 1697 ); 1698 } 1699 } 1700 remove_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i321701 fn remove_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i32 { 1702 unsafe { 1703 gtk_sys::gtk_tree_view_remove_column( 1704 self.as_ref().to_glib_none().0, 1705 column.as_ref().to_glib_none().0, 1706 ) 1707 } 1708 } 1709 row_activated<P: IsA<TreeViewColumn>>(&self, path: &TreePath, column: &P)1710 fn row_activated<P: IsA<TreeViewColumn>>(&self, path: &TreePath, column: &P) { 1711 unsafe { 1712 gtk_sys::gtk_tree_view_row_activated( 1713 self.as_ref().to_glib_none().0, 1714 mut_override(path.to_glib_none().0), 1715 column.as_ref().to_glib_none().0, 1716 ); 1717 } 1718 } 1719 row_expanded(&self, path: &TreePath) -> bool1720 fn row_expanded(&self, path: &TreePath) -> bool { 1721 unsafe { 1722 from_glib(gtk_sys::gtk_tree_view_row_expanded( 1723 self.as_ref().to_glib_none().0, 1724 mut_override(path.to_glib_none().0), 1725 )) 1726 } 1727 } 1728 scroll_to_cell<P: IsA<TreeViewColumn>>( &self, path: Option<&TreePath>, column: Option<&P>, use_align: bool, row_align: f32, col_align: f32, )1729 fn scroll_to_cell<P: IsA<TreeViewColumn>>( 1730 &self, 1731 path: Option<&TreePath>, 1732 column: Option<&P>, 1733 use_align: bool, 1734 row_align: f32, 1735 col_align: f32, 1736 ) { 1737 unsafe { 1738 gtk_sys::gtk_tree_view_scroll_to_cell( 1739 self.as_ref().to_glib_none().0, 1740 mut_override(path.to_glib_none().0), 1741 column.map(|p| p.as_ref()).to_glib_none().0, 1742 use_align.to_glib(), 1743 row_align, 1744 col_align, 1745 ); 1746 } 1747 } 1748 scroll_to_point(&self, tree_x: i32, tree_y: i32)1749 fn scroll_to_point(&self, tree_x: i32, tree_y: i32) { 1750 unsafe { 1751 gtk_sys::gtk_tree_view_scroll_to_point(self.as_ref().to_glib_none().0, tree_x, tree_y); 1752 } 1753 } 1754 set_activate_on_single_click(&self, single: bool)1755 fn set_activate_on_single_click(&self, single: bool) { 1756 unsafe { 1757 gtk_sys::gtk_tree_view_set_activate_on_single_click( 1758 self.as_ref().to_glib_none().0, 1759 single.to_glib(), 1760 ); 1761 } 1762 } 1763 set_column_drag_function( &self, func: Option< Box< dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool + 'static, >, >, )1764 fn set_column_drag_function( 1765 &self, 1766 func: Option< 1767 Box< 1768 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool 1769 + 'static, 1770 >, 1771 >, 1772 ) { 1773 let func_data: Box_< 1774 Option< 1775 Box< 1776 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool 1777 + 'static, 1778 >, 1779 >, 1780 > = Box::new(func); 1781 unsafe extern "C" fn func_func( 1782 tree_view: *mut gtk_sys::GtkTreeView, 1783 column: *mut gtk_sys::GtkTreeViewColumn, 1784 prev_column: *mut gtk_sys::GtkTreeViewColumn, 1785 next_column: *mut gtk_sys::GtkTreeViewColumn, 1786 data: glib_sys::gpointer, 1787 ) -> glib_sys::gboolean { 1788 let tree_view = from_glib_borrow(tree_view); 1789 let column = from_glib_borrow(column); 1790 let prev_column = from_glib_borrow(prev_column); 1791 let next_column = from_glib_borrow(next_column); 1792 let callback: &Option< 1793 Box< 1794 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool 1795 + 'static, 1796 >, 1797 > = &*(data as *mut _); 1798 let res = if let Some(ref callback) = *callback { 1799 callback(&tree_view, &column, &prev_column, &next_column) 1800 } else { 1801 panic!("cannot get closure...") 1802 }; 1803 res.to_glib() 1804 } 1805 let func = if func_data.is_some() { 1806 Some(func_func as _) 1807 } else { 1808 None 1809 }; 1810 unsafe extern "C" fn destroy_func(data: glib_sys::gpointer) { 1811 let _callback: Box_< 1812 Option< 1813 Box< 1814 dyn Fn( 1815 &TreeView, 1816 &TreeViewColumn, 1817 &TreeViewColumn, 1818 &TreeViewColumn, 1819 ) -> bool 1820 + 'static, 1821 >, 1822 >, 1823 > = Box_::from_raw(data as *mut _); 1824 } 1825 let destroy_call3 = Some(destroy_func as _); 1826 let super_callback0: Box_< 1827 Option< 1828 Box< 1829 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool 1830 + 'static, 1831 >, 1832 >, 1833 > = func_data; 1834 unsafe { 1835 gtk_sys::gtk_tree_view_set_column_drag_function( 1836 self.as_ref().to_glib_none().0, 1837 func, 1838 Box::into_raw(super_callback0) as *mut _, 1839 destroy_call3, 1840 ); 1841 } 1842 } 1843 set_cursor<P: IsA<TreeViewColumn>>( &self, path: &TreePath, focus_column: Option<&P>, start_editing: bool, )1844 fn set_cursor<P: IsA<TreeViewColumn>>( 1845 &self, 1846 path: &TreePath, 1847 focus_column: Option<&P>, 1848 start_editing: bool, 1849 ) { 1850 unsafe { 1851 gtk_sys::gtk_tree_view_set_cursor( 1852 self.as_ref().to_glib_none().0, 1853 mut_override(path.to_glib_none().0), 1854 focus_column.map(|p| p.as_ref()).to_glib_none().0, 1855 start_editing.to_glib(), 1856 ); 1857 } 1858 } 1859 set_cursor_on_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( &self, path: &TreePath, focus_column: Option<&P>, focus_cell: Option<&Q>, start_editing: bool, )1860 fn set_cursor_on_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( 1861 &self, 1862 path: &TreePath, 1863 focus_column: Option<&P>, 1864 focus_cell: Option<&Q>, 1865 start_editing: bool, 1866 ) { 1867 unsafe { 1868 gtk_sys::gtk_tree_view_set_cursor_on_cell( 1869 self.as_ref().to_glib_none().0, 1870 mut_override(path.to_glib_none().0), 1871 focus_column.map(|p| p.as_ref()).to_glib_none().0, 1872 focus_cell.map(|p| p.as_ref()).to_glib_none().0, 1873 start_editing.to_glib(), 1874 ); 1875 } 1876 } 1877 set_drag_dest_row(&self, path: Option<&TreePath>, pos: TreeViewDropPosition)1878 fn set_drag_dest_row(&self, path: Option<&TreePath>, pos: TreeViewDropPosition) { 1879 unsafe { 1880 gtk_sys::gtk_tree_view_set_drag_dest_row( 1881 self.as_ref().to_glib_none().0, 1882 mut_override(path.to_glib_none().0), 1883 pos.to_glib(), 1884 ); 1885 } 1886 } 1887 set_enable_search(&self, enable_search: bool)1888 fn set_enable_search(&self, enable_search: bool) { 1889 unsafe { 1890 gtk_sys::gtk_tree_view_set_enable_search( 1891 self.as_ref().to_glib_none().0, 1892 enable_search.to_glib(), 1893 ); 1894 } 1895 } 1896 set_enable_tree_lines(&self, enabled: bool)1897 fn set_enable_tree_lines(&self, enabled: bool) { 1898 unsafe { 1899 gtk_sys::gtk_tree_view_set_enable_tree_lines( 1900 self.as_ref().to_glib_none().0, 1901 enabled.to_glib(), 1902 ); 1903 } 1904 } 1905 set_expander_column<P: IsA<TreeViewColumn>>(&self, column: Option<&P>)1906 fn set_expander_column<P: IsA<TreeViewColumn>>(&self, column: Option<&P>) { 1907 unsafe { 1908 gtk_sys::gtk_tree_view_set_expander_column( 1909 self.as_ref().to_glib_none().0, 1910 column.map(|p| p.as_ref()).to_glib_none().0, 1911 ); 1912 } 1913 } 1914 set_fixed_height_mode(&self, enable: bool)1915 fn set_fixed_height_mode(&self, enable: bool) { 1916 unsafe { 1917 gtk_sys::gtk_tree_view_set_fixed_height_mode( 1918 self.as_ref().to_glib_none().0, 1919 enable.to_glib(), 1920 ); 1921 } 1922 } 1923 set_grid_lines(&self, grid_lines: TreeViewGridLines)1924 fn set_grid_lines(&self, grid_lines: TreeViewGridLines) { 1925 unsafe { 1926 gtk_sys::gtk_tree_view_set_grid_lines( 1927 self.as_ref().to_glib_none().0, 1928 grid_lines.to_glib(), 1929 ); 1930 } 1931 } 1932 set_headers_clickable(&self, setting: bool)1933 fn set_headers_clickable(&self, setting: bool) { 1934 unsafe { 1935 gtk_sys::gtk_tree_view_set_headers_clickable( 1936 self.as_ref().to_glib_none().0, 1937 setting.to_glib(), 1938 ); 1939 } 1940 } 1941 set_headers_visible(&self, headers_visible: bool)1942 fn set_headers_visible(&self, headers_visible: bool) { 1943 unsafe { 1944 gtk_sys::gtk_tree_view_set_headers_visible( 1945 self.as_ref().to_glib_none().0, 1946 headers_visible.to_glib(), 1947 ); 1948 } 1949 } 1950 set_hover_expand(&self, expand: bool)1951 fn set_hover_expand(&self, expand: bool) { 1952 unsafe { 1953 gtk_sys::gtk_tree_view_set_hover_expand( 1954 self.as_ref().to_glib_none().0, 1955 expand.to_glib(), 1956 ); 1957 } 1958 } 1959 set_hover_selection(&self, hover: bool)1960 fn set_hover_selection(&self, hover: bool) { 1961 unsafe { 1962 gtk_sys::gtk_tree_view_set_hover_selection( 1963 self.as_ref().to_glib_none().0, 1964 hover.to_glib(), 1965 ); 1966 } 1967 } 1968 set_level_indentation(&self, indentation: i32)1969 fn set_level_indentation(&self, indentation: i32) { 1970 unsafe { 1971 gtk_sys::gtk_tree_view_set_level_indentation( 1972 self.as_ref().to_glib_none().0, 1973 indentation, 1974 ); 1975 } 1976 } 1977 set_model<P: IsA<TreeModel>>(&self, model: Option<&P>)1978 fn set_model<P: IsA<TreeModel>>(&self, model: Option<&P>) { 1979 unsafe { 1980 gtk_sys::gtk_tree_view_set_model( 1981 self.as_ref().to_glib_none().0, 1982 model.map(|p| p.as_ref()).to_glib_none().0, 1983 ); 1984 } 1985 } 1986 set_reorderable(&self, reorderable: bool)1987 fn set_reorderable(&self, reorderable: bool) { 1988 unsafe { 1989 gtk_sys::gtk_tree_view_set_reorderable( 1990 self.as_ref().to_glib_none().0, 1991 reorderable.to_glib(), 1992 ); 1993 } 1994 } 1995 set_row_separator_func( &self, func: Option<Box<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>, )1996 fn set_row_separator_func( 1997 &self, 1998 func: Option<Box<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>, 1999 ) { 2000 let func_data: Box_<Option<Box<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>> = 2001 Box::new(func); 2002 unsafe extern "C" fn func_func( 2003 model: *mut gtk_sys::GtkTreeModel, 2004 iter: *mut gtk_sys::GtkTreeIter, 2005 data: glib_sys::gpointer, 2006 ) -> glib_sys::gboolean { 2007 let model = from_glib_borrow(model); 2008 let iter = from_glib_borrow(iter); 2009 let callback: &Option<Box<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>> = 2010 &*(data as *mut _); 2011 let res = if let Some(ref callback) = *callback { 2012 callback(&model, &iter) 2013 } else { 2014 panic!("cannot get closure...") 2015 }; 2016 res.to_glib() 2017 } 2018 let func = if func_data.is_some() { 2019 Some(func_func as _) 2020 } else { 2021 None 2022 }; 2023 unsafe extern "C" fn destroy_func(data: glib_sys::gpointer) { 2024 let _callback: Box_<Option<Box<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>> = 2025 Box_::from_raw(data as *mut _); 2026 } 2027 let destroy_call3 = Some(destroy_func as _); 2028 let super_callback0: Box_<Option<Box<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>> = 2029 func_data; 2030 unsafe { 2031 gtk_sys::gtk_tree_view_set_row_separator_func( 2032 self.as_ref().to_glib_none().0, 2033 func, 2034 Box::into_raw(super_callback0) as *mut _, 2035 destroy_call3, 2036 ); 2037 } 2038 } 2039 set_rubber_banding(&self, enable: bool)2040 fn set_rubber_banding(&self, enable: bool) { 2041 unsafe { 2042 gtk_sys::gtk_tree_view_set_rubber_banding( 2043 self.as_ref().to_glib_none().0, 2044 enable.to_glib(), 2045 ); 2046 } 2047 } 2048 set_search_column(&self, column: i32)2049 fn set_search_column(&self, column: i32) { 2050 unsafe { 2051 gtk_sys::gtk_tree_view_set_search_column(self.as_ref().to_glib_none().0, column); 2052 } 2053 } 2054 set_search_entry<P: IsA<Entry>>(&self, entry: Option<&P>)2055 fn set_search_entry<P: IsA<Entry>>(&self, entry: Option<&P>) { 2056 unsafe { 2057 gtk_sys::gtk_tree_view_set_search_entry( 2058 self.as_ref().to_glib_none().0, 2059 entry.map(|p| p.as_ref()).to_glib_none().0, 2060 ); 2061 } 2062 } 2063 set_search_equal_func<P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static>( &self, search_equal_func: P, )2064 fn set_search_equal_func<P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static>( 2065 &self, 2066 search_equal_func: P, 2067 ) { 2068 let search_equal_func_data: Box_<P> = Box::new(search_equal_func); 2069 unsafe extern "C" fn search_equal_func_func< 2070 P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static, 2071 >( 2072 model: *mut gtk_sys::GtkTreeModel, 2073 column: libc::c_int, 2074 key: *const libc::c_char, 2075 iter: *mut gtk_sys::GtkTreeIter, 2076 search_data: glib_sys::gpointer, 2077 ) -> glib_sys::gboolean { 2078 let model = from_glib_borrow(model); 2079 let key: GString = from_glib_borrow(key); 2080 let iter = from_glib_borrow(iter); 2081 let callback: &P = &*(search_data as *mut _); 2082 let res = (*callback)(&model, column, key.as_str(), &iter); 2083 res.to_glib() 2084 } 2085 let search_equal_func = Some(search_equal_func_func::<P> as _); 2086 unsafe extern "C" fn search_destroy_func< 2087 P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static, 2088 >( 2089 data: glib_sys::gpointer, 2090 ) { 2091 let _callback: Box_<P> = Box_::from_raw(data as *mut _); 2092 } 2093 let destroy_call3 = Some(search_destroy_func::<P> as _); 2094 let super_callback0: Box_<P> = search_equal_func_data; 2095 unsafe { 2096 gtk_sys::gtk_tree_view_set_search_equal_func( 2097 self.as_ref().to_glib_none().0, 2098 search_equal_func, 2099 Box::into_raw(super_callback0) as *mut _, 2100 destroy_call3, 2101 ); 2102 } 2103 } 2104 set_search_position_func(&self, func: Option<Box<dyn Fn(&TreeView, &Widget) + 'static>>)2105 fn set_search_position_func(&self, func: Option<Box<dyn Fn(&TreeView, &Widget) + 'static>>) { 2106 let func_data: Box_<Option<Box<dyn Fn(&TreeView, &Widget) + 'static>>> = Box::new(func); 2107 unsafe extern "C" fn func_func( 2108 tree_view: *mut gtk_sys::GtkTreeView, 2109 search_dialog: *mut gtk_sys::GtkWidget, 2110 user_data: glib_sys::gpointer, 2111 ) { 2112 let tree_view = from_glib_borrow(tree_view); 2113 let search_dialog = from_glib_borrow(search_dialog); 2114 let callback: &Option<Box<dyn Fn(&TreeView, &Widget) + 'static>> = 2115 &*(user_data as *mut _); 2116 if let Some(ref callback) = *callback { 2117 callback(&tree_view, &search_dialog) 2118 } else { 2119 panic!("cannot get closure...") 2120 }; 2121 } 2122 let func = if func_data.is_some() { 2123 Some(func_func as _) 2124 } else { 2125 None 2126 }; 2127 unsafe extern "C" fn destroy_func(data: glib_sys::gpointer) { 2128 let _callback: Box_<Option<Box<dyn Fn(&TreeView, &Widget) + 'static>>> = 2129 Box_::from_raw(data as *mut _); 2130 } 2131 let destroy_call3 = Some(destroy_func as _); 2132 let super_callback0: Box_<Option<Box<dyn Fn(&TreeView, &Widget) + 'static>>> = func_data; 2133 unsafe { 2134 gtk_sys::gtk_tree_view_set_search_position_func( 2135 self.as_ref().to_glib_none().0, 2136 func, 2137 Box::into_raw(super_callback0) as *mut _, 2138 destroy_call3, 2139 ); 2140 } 2141 } 2142 set_show_expanders(&self, enabled: bool)2143 fn set_show_expanders(&self, enabled: bool) { 2144 unsafe { 2145 gtk_sys::gtk_tree_view_set_show_expanders( 2146 self.as_ref().to_glib_none().0, 2147 enabled.to_glib(), 2148 ); 2149 } 2150 } 2151 set_tooltip_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( &self, tooltip: &Tooltip, path: Option<&TreePath>, column: Option<&P>, cell: Option<&Q>, )2152 fn set_tooltip_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( 2153 &self, 2154 tooltip: &Tooltip, 2155 path: Option<&TreePath>, 2156 column: Option<&P>, 2157 cell: Option<&Q>, 2158 ) { 2159 unsafe { 2160 gtk_sys::gtk_tree_view_set_tooltip_cell( 2161 self.as_ref().to_glib_none().0, 2162 tooltip.to_glib_none().0, 2163 mut_override(path.to_glib_none().0), 2164 column.map(|p| p.as_ref()).to_glib_none().0, 2165 cell.map(|p| p.as_ref()).to_glib_none().0, 2166 ); 2167 } 2168 } 2169 set_tooltip_column(&self, column: i32)2170 fn set_tooltip_column(&self, column: i32) { 2171 unsafe { 2172 gtk_sys::gtk_tree_view_set_tooltip_column(self.as_ref().to_glib_none().0, column); 2173 } 2174 } 2175 set_tooltip_row(&self, tooltip: &Tooltip, path: &TreePath)2176 fn set_tooltip_row(&self, tooltip: &Tooltip, path: &TreePath) { 2177 unsafe { 2178 gtk_sys::gtk_tree_view_set_tooltip_row( 2179 self.as_ref().to_glib_none().0, 2180 tooltip.to_glib_none().0, 2181 mut_override(path.to_glib_none().0), 2182 ); 2183 } 2184 } 2185 unset_rows_drag_dest(&self)2186 fn unset_rows_drag_dest(&self) { 2187 unsafe { 2188 gtk_sys::gtk_tree_view_unset_rows_drag_dest(self.as_ref().to_glib_none().0); 2189 } 2190 } 2191 unset_rows_drag_source(&self)2192 fn unset_rows_drag_source(&self) { 2193 unsafe { 2194 gtk_sys::gtk_tree_view_unset_rows_drag_source(self.as_ref().to_glib_none().0); 2195 } 2196 } 2197 get_property_enable_grid_lines(&self) -> TreeViewGridLines2198 fn get_property_enable_grid_lines(&self) -> TreeViewGridLines { 2199 unsafe { 2200 let mut value = Value::from_type(<TreeViewGridLines as StaticType>::static_type()); 2201 gobject_sys::g_object_get_property( 2202 self.to_glib_none().0 as *mut gobject_sys::GObject, 2203 b"enable-grid-lines\0".as_ptr() as *const _, 2204 value.to_glib_none_mut().0, 2205 ); 2206 value.get().unwrap() 2207 } 2208 } 2209 set_property_enable_grid_lines(&self, enable_grid_lines: TreeViewGridLines)2210 fn set_property_enable_grid_lines(&self, enable_grid_lines: TreeViewGridLines) { 2211 unsafe { 2212 gobject_sys::g_object_set_property( 2213 self.to_glib_none().0 as *mut gobject_sys::GObject, 2214 b"enable-grid-lines\0".as_ptr() as *const _, 2215 Value::from(&enable_grid_lines).to_glib_none().0, 2216 ); 2217 } 2218 } 2219 set_property_ubuntu_almost_fixed_height_mode(&self, ubuntu_almost_fixed_height_mode: bool)2220 fn set_property_ubuntu_almost_fixed_height_mode(&self, ubuntu_almost_fixed_height_mode: bool) { 2221 unsafe { 2222 gobject_sys::g_object_set_property( 2223 self.to_glib_none().0 as *mut gobject_sys::GObject, 2224 b"ubuntu-almost-fixed-height-mode\0".as_ptr() as *const _, 2225 Value::from(&ubuntu_almost_fixed_height_mode) 2226 .to_glib_none() 2227 .0, 2228 ); 2229 } 2230 } 2231 connect_columns_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2232 fn connect_columns_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 2233 unsafe extern "C" fn columns_changed_trampoline<P, F: Fn(&P) + 'static>( 2234 this: *mut gtk_sys::GtkTreeView, 2235 f: glib_sys::gpointer, 2236 ) where 2237 P: IsA<TreeView>, 2238 { 2239 let f: &F = &*(f as *const F); 2240 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2241 } 2242 unsafe { 2243 let f: Box_<F> = Box_::new(f); 2244 connect_raw( 2245 self.as_ptr() as *mut _, 2246 b"columns-changed\0".as_ptr() as *const _, 2247 Some(transmute(columns_changed_trampoline::<Self, F> as usize)), 2248 Box_::into_raw(f), 2249 ) 2250 } 2251 } 2252 connect_cursor_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2253 fn connect_cursor_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 2254 unsafe extern "C" fn cursor_changed_trampoline<P, F: Fn(&P) + 'static>( 2255 this: *mut gtk_sys::GtkTreeView, 2256 f: glib_sys::gpointer, 2257 ) where 2258 P: IsA<TreeView>, 2259 { 2260 let f: &F = &*(f as *const F); 2261 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2262 } 2263 unsafe { 2264 let f: Box_<F> = Box_::new(f); 2265 connect_raw( 2266 self.as_ptr() as *mut _, 2267 b"cursor-changed\0".as_ptr() as *const _, 2268 Some(transmute(cursor_changed_trampoline::<Self, F> as usize)), 2269 Box_::into_raw(f), 2270 ) 2271 } 2272 } 2273 connect_expand_collapse_cursor_row<F: Fn(&Self, bool, bool, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId2274 fn connect_expand_collapse_cursor_row<F: Fn(&Self, bool, bool, bool) -> bool + 'static>( 2275 &self, 2276 f: F, 2277 ) -> SignalHandlerId { 2278 unsafe extern "C" fn expand_collapse_cursor_row_trampoline< 2279 P, 2280 F: Fn(&P, bool, bool, bool) -> bool + 'static, 2281 >( 2282 this: *mut gtk_sys::GtkTreeView, 2283 object: glib_sys::gboolean, 2284 p0: glib_sys::gboolean, 2285 p1: glib_sys::gboolean, 2286 f: glib_sys::gpointer, 2287 ) -> glib_sys::gboolean 2288 where 2289 P: IsA<TreeView>, 2290 { 2291 let f: &F = &*(f as *const F); 2292 f( 2293 &TreeView::from_glib_borrow(this).unsafe_cast(), 2294 from_glib(object), 2295 from_glib(p0), 2296 from_glib(p1), 2297 ) 2298 .to_glib() 2299 } 2300 unsafe { 2301 let f: Box_<F> = Box_::new(f); 2302 connect_raw( 2303 self.as_ptr() as *mut _, 2304 b"expand-collapse-cursor-row\0".as_ptr() as *const _, 2305 Some(transmute( 2306 expand_collapse_cursor_row_trampoline::<Self, F> as usize, 2307 )), 2308 Box_::into_raw(f), 2309 ) 2310 } 2311 } 2312 emit_expand_collapse_cursor_row(&self, object: bool, p0: bool, p1: bool) -> bool2313 fn emit_expand_collapse_cursor_row(&self, object: bool, p0: bool, p1: bool) -> bool { 2314 let res = unsafe { 2315 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 2316 .emit("expand-collapse-cursor-row", &[&object, &p0, &p1]) 2317 .unwrap() 2318 }; 2319 res.unwrap().get().unwrap() 2320 } 2321 connect_move_cursor<F: Fn(&Self, MovementStep, i32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId2322 fn connect_move_cursor<F: Fn(&Self, MovementStep, i32) -> bool + 'static>( 2323 &self, 2324 f: F, 2325 ) -> SignalHandlerId { 2326 unsafe extern "C" fn move_cursor_trampoline< 2327 P, 2328 F: Fn(&P, MovementStep, i32) -> bool + 'static, 2329 >( 2330 this: *mut gtk_sys::GtkTreeView, 2331 step: gtk_sys::GtkMovementStep, 2332 direction: libc::c_int, 2333 f: glib_sys::gpointer, 2334 ) -> glib_sys::gboolean 2335 where 2336 P: IsA<TreeView>, 2337 { 2338 let f: &F = &*(f as *const F); 2339 f( 2340 &TreeView::from_glib_borrow(this).unsafe_cast(), 2341 from_glib(step), 2342 direction, 2343 ) 2344 .to_glib() 2345 } 2346 unsafe { 2347 let f: Box_<F> = Box_::new(f); 2348 connect_raw( 2349 self.as_ptr() as *mut _, 2350 b"move-cursor\0".as_ptr() as *const _, 2351 Some(transmute(move_cursor_trampoline::<Self, F> as usize)), 2352 Box_::into_raw(f), 2353 ) 2354 } 2355 } 2356 emit_move_cursor(&self, step: MovementStep, direction: i32) -> bool2357 fn emit_move_cursor(&self, step: MovementStep, direction: i32) -> bool { 2358 let res = unsafe { 2359 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 2360 .emit("move-cursor", &[&step, &direction]) 2361 .unwrap() 2362 }; 2363 res.unwrap().get().unwrap() 2364 } 2365 connect_row_activated<F: Fn(&Self, &TreePath, &TreeViewColumn) + 'static>( &self, f: F, ) -> SignalHandlerId2366 fn connect_row_activated<F: Fn(&Self, &TreePath, &TreeViewColumn) + 'static>( 2367 &self, 2368 f: F, 2369 ) -> SignalHandlerId { 2370 unsafe extern "C" fn row_activated_trampoline< 2371 P, 2372 F: Fn(&P, &TreePath, &TreeViewColumn) + 'static, 2373 >( 2374 this: *mut gtk_sys::GtkTreeView, 2375 path: *mut gtk_sys::GtkTreePath, 2376 column: *mut gtk_sys::GtkTreeViewColumn, 2377 f: glib_sys::gpointer, 2378 ) where 2379 P: IsA<TreeView>, 2380 { 2381 let f: &F = &*(f as *const F); 2382 f( 2383 &TreeView::from_glib_borrow(this).unsafe_cast(), 2384 &from_glib_borrow(path), 2385 &from_glib_borrow(column), 2386 ) 2387 } 2388 unsafe { 2389 let f: Box_<F> = Box_::new(f); 2390 connect_raw( 2391 self.as_ptr() as *mut _, 2392 b"row-activated\0".as_ptr() as *const _, 2393 Some(transmute(row_activated_trampoline::<Self, F> as usize)), 2394 Box_::into_raw(f), 2395 ) 2396 } 2397 } 2398 emit_row_activated(&self, path: &TreePath, column: &TreeViewColumn)2399 fn emit_row_activated(&self, path: &TreePath, column: &TreeViewColumn) { 2400 let _ = unsafe { 2401 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 2402 .emit("row-activated", &[&path, &column]) 2403 .unwrap() 2404 }; 2405 } 2406 connect_row_collapsed<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( &self, f: F, ) -> SignalHandlerId2407 fn connect_row_collapsed<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( 2408 &self, 2409 f: F, 2410 ) -> SignalHandlerId { 2411 unsafe extern "C" fn row_collapsed_trampoline< 2412 P, 2413 F: Fn(&P, &TreeIter, &TreePath) + 'static, 2414 >( 2415 this: *mut gtk_sys::GtkTreeView, 2416 iter: *mut gtk_sys::GtkTreeIter, 2417 path: *mut gtk_sys::GtkTreePath, 2418 f: glib_sys::gpointer, 2419 ) where 2420 P: IsA<TreeView>, 2421 { 2422 let f: &F = &*(f as *const F); 2423 f( 2424 &TreeView::from_glib_borrow(this).unsafe_cast(), 2425 &from_glib_borrow(iter), 2426 &from_glib_borrow(path), 2427 ) 2428 } 2429 unsafe { 2430 let f: Box_<F> = Box_::new(f); 2431 connect_raw( 2432 self.as_ptr() as *mut _, 2433 b"row-collapsed\0".as_ptr() as *const _, 2434 Some(transmute(row_collapsed_trampoline::<Self, F> as usize)), 2435 Box_::into_raw(f), 2436 ) 2437 } 2438 } 2439 connect_row_expanded<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( &self, f: F, ) -> SignalHandlerId2440 fn connect_row_expanded<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( 2441 &self, 2442 f: F, 2443 ) -> SignalHandlerId { 2444 unsafe extern "C" fn row_expanded_trampoline<P, F: Fn(&P, &TreeIter, &TreePath) + 'static>( 2445 this: *mut gtk_sys::GtkTreeView, 2446 iter: *mut gtk_sys::GtkTreeIter, 2447 path: *mut gtk_sys::GtkTreePath, 2448 f: glib_sys::gpointer, 2449 ) where 2450 P: IsA<TreeView>, 2451 { 2452 let f: &F = &*(f as *const F); 2453 f( 2454 &TreeView::from_glib_borrow(this).unsafe_cast(), 2455 &from_glib_borrow(iter), 2456 &from_glib_borrow(path), 2457 ) 2458 } 2459 unsafe { 2460 let f: Box_<F> = Box_::new(f); 2461 connect_raw( 2462 self.as_ptr() as *mut _, 2463 b"row-expanded\0".as_ptr() as *const _, 2464 Some(transmute(row_expanded_trampoline::<Self, F> as usize)), 2465 Box_::into_raw(f), 2466 ) 2467 } 2468 } 2469 connect_select_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId2470 fn connect_select_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId { 2471 unsafe extern "C" fn select_all_trampoline<P, F: Fn(&P) -> bool + 'static>( 2472 this: *mut gtk_sys::GtkTreeView, 2473 f: glib_sys::gpointer, 2474 ) -> glib_sys::gboolean 2475 where 2476 P: IsA<TreeView>, 2477 { 2478 let f: &F = &*(f as *const F); 2479 f(&TreeView::from_glib_borrow(this).unsafe_cast()).to_glib() 2480 } 2481 unsafe { 2482 let f: Box_<F> = Box_::new(f); 2483 connect_raw( 2484 self.as_ptr() as *mut _, 2485 b"select-all\0".as_ptr() as *const _, 2486 Some(transmute(select_all_trampoline::<Self, F> as usize)), 2487 Box_::into_raw(f), 2488 ) 2489 } 2490 } 2491 emit_select_all(&self) -> bool2492 fn emit_select_all(&self) -> bool { 2493 let res = unsafe { 2494 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 2495 .emit("select-all", &[]) 2496 .unwrap() 2497 }; 2498 res.unwrap().get().unwrap() 2499 } 2500 connect_select_cursor_parent<F: Fn(&Self) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId2501 fn connect_select_cursor_parent<F: Fn(&Self) -> bool + 'static>( 2502 &self, 2503 f: F, 2504 ) -> SignalHandlerId { 2505 unsafe extern "C" fn select_cursor_parent_trampoline<P, F: Fn(&P) -> bool + 'static>( 2506 this: *mut gtk_sys::GtkTreeView, 2507 f: glib_sys::gpointer, 2508 ) -> glib_sys::gboolean 2509 where 2510 P: IsA<TreeView>, 2511 { 2512 let f: &F = &*(f as *const F); 2513 f(&TreeView::from_glib_borrow(this).unsafe_cast()).to_glib() 2514 } 2515 unsafe { 2516 let f: Box_<F> = Box_::new(f); 2517 connect_raw( 2518 self.as_ptr() as *mut _, 2519 b"select-cursor-parent\0".as_ptr() as *const _, 2520 Some(transmute( 2521 select_cursor_parent_trampoline::<Self, F> as usize, 2522 )), 2523 Box_::into_raw(f), 2524 ) 2525 } 2526 } 2527 emit_select_cursor_parent(&self) -> bool2528 fn emit_select_cursor_parent(&self) -> bool { 2529 let res = unsafe { 2530 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 2531 .emit("select-cursor-parent", &[]) 2532 .unwrap() 2533 }; 2534 res.unwrap().get().unwrap() 2535 } 2536 connect_select_cursor_row<F: Fn(&Self, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId2537 fn connect_select_cursor_row<F: Fn(&Self, bool) -> bool + 'static>( 2538 &self, 2539 f: F, 2540 ) -> SignalHandlerId { 2541 unsafe extern "C" fn select_cursor_row_trampoline<P, F: Fn(&P, bool) -> bool + 'static>( 2542 this: *mut gtk_sys::GtkTreeView, 2543 object: glib_sys::gboolean, 2544 f: glib_sys::gpointer, 2545 ) -> glib_sys::gboolean 2546 where 2547 P: IsA<TreeView>, 2548 { 2549 let f: &F = &*(f as *const F); 2550 f( 2551 &TreeView::from_glib_borrow(this).unsafe_cast(), 2552 from_glib(object), 2553 ) 2554 .to_glib() 2555 } 2556 unsafe { 2557 let f: Box_<F> = Box_::new(f); 2558 connect_raw( 2559 self.as_ptr() as *mut _, 2560 b"select-cursor-row\0".as_ptr() as *const _, 2561 Some(transmute(select_cursor_row_trampoline::<Self, F> as usize)), 2562 Box_::into_raw(f), 2563 ) 2564 } 2565 } 2566 emit_select_cursor_row(&self, object: bool) -> bool2567 fn emit_select_cursor_row(&self, object: bool) -> bool { 2568 let res = unsafe { 2569 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 2570 .emit("select-cursor-row", &[&object]) 2571 .unwrap() 2572 }; 2573 res.unwrap().get().unwrap() 2574 } 2575 connect_start_interactive_search<F: Fn(&Self) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId2576 fn connect_start_interactive_search<F: Fn(&Self) -> bool + 'static>( 2577 &self, 2578 f: F, 2579 ) -> SignalHandlerId { 2580 unsafe extern "C" fn start_interactive_search_trampoline<P, F: Fn(&P) -> bool + 'static>( 2581 this: *mut gtk_sys::GtkTreeView, 2582 f: glib_sys::gpointer, 2583 ) -> glib_sys::gboolean 2584 where 2585 P: IsA<TreeView>, 2586 { 2587 let f: &F = &*(f as *const F); 2588 f(&TreeView::from_glib_borrow(this).unsafe_cast()).to_glib() 2589 } 2590 unsafe { 2591 let f: Box_<F> = Box_::new(f); 2592 connect_raw( 2593 self.as_ptr() as *mut _, 2594 b"start-interactive-search\0".as_ptr() as *const _, 2595 Some(transmute( 2596 start_interactive_search_trampoline::<Self, F> as usize, 2597 )), 2598 Box_::into_raw(f), 2599 ) 2600 } 2601 } 2602 emit_start_interactive_search(&self) -> bool2603 fn emit_start_interactive_search(&self) -> bool { 2604 let res = unsafe { 2605 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 2606 .emit("start-interactive-search", &[]) 2607 .unwrap() 2608 }; 2609 res.unwrap().get().unwrap() 2610 } 2611 connect_test_collapse_row<F: Fn(&Self, &TreeIter, &TreePath) -> Inhibit + 'static>( &self, f: F, ) -> SignalHandlerId2612 fn connect_test_collapse_row<F: Fn(&Self, &TreeIter, &TreePath) -> Inhibit + 'static>( 2613 &self, 2614 f: F, 2615 ) -> SignalHandlerId { 2616 unsafe extern "C" fn test_collapse_row_trampoline< 2617 P, 2618 F: Fn(&P, &TreeIter, &TreePath) -> Inhibit + 'static, 2619 >( 2620 this: *mut gtk_sys::GtkTreeView, 2621 iter: *mut gtk_sys::GtkTreeIter, 2622 path: *mut gtk_sys::GtkTreePath, 2623 f: glib_sys::gpointer, 2624 ) -> glib_sys::gboolean 2625 where 2626 P: IsA<TreeView>, 2627 { 2628 let f: &F = &*(f as *const F); 2629 f( 2630 &TreeView::from_glib_borrow(this).unsafe_cast(), 2631 &from_glib_borrow(iter), 2632 &from_glib_borrow(path), 2633 ) 2634 .to_glib() 2635 } 2636 unsafe { 2637 let f: Box_<F> = Box_::new(f); 2638 connect_raw( 2639 self.as_ptr() as *mut _, 2640 b"test-collapse-row\0".as_ptr() as *const _, 2641 Some(transmute(test_collapse_row_trampoline::<Self, F> as usize)), 2642 Box_::into_raw(f), 2643 ) 2644 } 2645 } 2646 connect_test_expand_row<F: Fn(&Self, &TreeIter, &TreePath) -> Inhibit + 'static>( &self, f: F, ) -> SignalHandlerId2647 fn connect_test_expand_row<F: Fn(&Self, &TreeIter, &TreePath) -> Inhibit + 'static>( 2648 &self, 2649 f: F, 2650 ) -> SignalHandlerId { 2651 unsafe extern "C" fn test_expand_row_trampoline< 2652 P, 2653 F: Fn(&P, &TreeIter, &TreePath) -> Inhibit + 'static, 2654 >( 2655 this: *mut gtk_sys::GtkTreeView, 2656 iter: *mut gtk_sys::GtkTreeIter, 2657 path: *mut gtk_sys::GtkTreePath, 2658 f: glib_sys::gpointer, 2659 ) -> glib_sys::gboolean 2660 where 2661 P: IsA<TreeView>, 2662 { 2663 let f: &F = &*(f as *const F); 2664 f( 2665 &TreeView::from_glib_borrow(this).unsafe_cast(), 2666 &from_glib_borrow(iter), 2667 &from_glib_borrow(path), 2668 ) 2669 .to_glib() 2670 } 2671 unsafe { 2672 let f: Box_<F> = Box_::new(f); 2673 connect_raw( 2674 self.as_ptr() as *mut _, 2675 b"test-expand-row\0".as_ptr() as *const _, 2676 Some(transmute(test_expand_row_trampoline::<Self, F> as usize)), 2677 Box_::into_raw(f), 2678 ) 2679 } 2680 } 2681 connect_toggle_cursor_row<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId2682 fn connect_toggle_cursor_row<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId { 2683 unsafe extern "C" fn toggle_cursor_row_trampoline<P, F: Fn(&P) -> bool + 'static>( 2684 this: *mut gtk_sys::GtkTreeView, 2685 f: glib_sys::gpointer, 2686 ) -> glib_sys::gboolean 2687 where 2688 P: IsA<TreeView>, 2689 { 2690 let f: &F = &*(f as *const F); 2691 f(&TreeView::from_glib_borrow(this).unsafe_cast()).to_glib() 2692 } 2693 unsafe { 2694 let f: Box_<F> = Box_::new(f); 2695 connect_raw( 2696 self.as_ptr() as *mut _, 2697 b"toggle-cursor-row\0".as_ptr() as *const _, 2698 Some(transmute(toggle_cursor_row_trampoline::<Self, F> as usize)), 2699 Box_::into_raw(f), 2700 ) 2701 } 2702 } 2703 emit_toggle_cursor_row(&self) -> bool2704 fn emit_toggle_cursor_row(&self) -> bool { 2705 let res = unsafe { 2706 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 2707 .emit("toggle-cursor-row", &[]) 2708 .unwrap() 2709 }; 2710 res.unwrap().get().unwrap() 2711 } 2712 connect_unselect_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId2713 fn connect_unselect_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId { 2714 unsafe extern "C" fn unselect_all_trampoline<P, F: Fn(&P) -> bool + 'static>( 2715 this: *mut gtk_sys::GtkTreeView, 2716 f: glib_sys::gpointer, 2717 ) -> glib_sys::gboolean 2718 where 2719 P: IsA<TreeView>, 2720 { 2721 let f: &F = &*(f as *const F); 2722 f(&TreeView::from_glib_borrow(this).unsafe_cast()).to_glib() 2723 } 2724 unsafe { 2725 let f: Box_<F> = Box_::new(f); 2726 connect_raw( 2727 self.as_ptr() as *mut _, 2728 b"unselect-all\0".as_ptr() as *const _, 2729 Some(transmute(unselect_all_trampoline::<Self, F> as usize)), 2730 Box_::into_raw(f), 2731 ) 2732 } 2733 } 2734 emit_unselect_all(&self) -> bool2735 fn emit_unselect_all(&self) -> bool { 2736 let res = unsafe { 2737 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 2738 .emit("unselect-all", &[]) 2739 .unwrap() 2740 }; 2741 res.unwrap().get().unwrap() 2742 } 2743 connect_property_activate_on_single_click_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2744 fn connect_property_activate_on_single_click_notify<F: Fn(&Self) + 'static>( 2745 &self, 2746 f: F, 2747 ) -> SignalHandlerId { 2748 unsafe extern "C" fn notify_activate_on_single_click_trampoline<P, F: Fn(&P) + 'static>( 2749 this: *mut gtk_sys::GtkTreeView, 2750 _param_spec: glib_sys::gpointer, 2751 f: glib_sys::gpointer, 2752 ) where 2753 P: IsA<TreeView>, 2754 { 2755 let f: &F = &*(f as *const F); 2756 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2757 } 2758 unsafe { 2759 let f: Box_<F> = Box_::new(f); 2760 connect_raw( 2761 self.as_ptr() as *mut _, 2762 b"notify::activate-on-single-click\0".as_ptr() as *const _, 2763 Some(transmute( 2764 notify_activate_on_single_click_trampoline::<Self, F> as usize, 2765 )), 2766 Box_::into_raw(f), 2767 ) 2768 } 2769 } 2770 connect_property_enable_grid_lines_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2771 fn connect_property_enable_grid_lines_notify<F: Fn(&Self) + 'static>( 2772 &self, 2773 f: F, 2774 ) -> SignalHandlerId { 2775 unsafe extern "C" fn notify_enable_grid_lines_trampoline<P, F: Fn(&P) + 'static>( 2776 this: *mut gtk_sys::GtkTreeView, 2777 _param_spec: glib_sys::gpointer, 2778 f: glib_sys::gpointer, 2779 ) where 2780 P: IsA<TreeView>, 2781 { 2782 let f: &F = &*(f as *const F); 2783 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2784 } 2785 unsafe { 2786 let f: Box_<F> = Box_::new(f); 2787 connect_raw( 2788 self.as_ptr() as *mut _, 2789 b"notify::enable-grid-lines\0".as_ptr() as *const _, 2790 Some(transmute( 2791 notify_enable_grid_lines_trampoline::<Self, F> as usize, 2792 )), 2793 Box_::into_raw(f), 2794 ) 2795 } 2796 } 2797 connect_property_enable_search_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2798 fn connect_property_enable_search_notify<F: Fn(&Self) + 'static>( 2799 &self, 2800 f: F, 2801 ) -> SignalHandlerId { 2802 unsafe extern "C" fn notify_enable_search_trampoline<P, F: Fn(&P) + 'static>( 2803 this: *mut gtk_sys::GtkTreeView, 2804 _param_spec: glib_sys::gpointer, 2805 f: glib_sys::gpointer, 2806 ) where 2807 P: IsA<TreeView>, 2808 { 2809 let f: &F = &*(f as *const F); 2810 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2811 } 2812 unsafe { 2813 let f: Box_<F> = Box_::new(f); 2814 connect_raw( 2815 self.as_ptr() as *mut _, 2816 b"notify::enable-search\0".as_ptr() as *const _, 2817 Some(transmute( 2818 notify_enable_search_trampoline::<Self, F> as usize, 2819 )), 2820 Box_::into_raw(f), 2821 ) 2822 } 2823 } 2824 connect_property_enable_tree_lines_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2825 fn connect_property_enable_tree_lines_notify<F: Fn(&Self) + 'static>( 2826 &self, 2827 f: F, 2828 ) -> SignalHandlerId { 2829 unsafe extern "C" fn notify_enable_tree_lines_trampoline<P, F: Fn(&P) + 'static>( 2830 this: *mut gtk_sys::GtkTreeView, 2831 _param_spec: glib_sys::gpointer, 2832 f: glib_sys::gpointer, 2833 ) where 2834 P: IsA<TreeView>, 2835 { 2836 let f: &F = &*(f as *const F); 2837 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2838 } 2839 unsafe { 2840 let f: Box_<F> = Box_::new(f); 2841 connect_raw( 2842 self.as_ptr() as *mut _, 2843 b"notify::enable-tree-lines\0".as_ptr() as *const _, 2844 Some(transmute( 2845 notify_enable_tree_lines_trampoline::<Self, F> as usize, 2846 )), 2847 Box_::into_raw(f), 2848 ) 2849 } 2850 } 2851 connect_property_expander_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2852 fn connect_property_expander_column_notify<F: Fn(&Self) + 'static>( 2853 &self, 2854 f: F, 2855 ) -> SignalHandlerId { 2856 unsafe extern "C" fn notify_expander_column_trampoline<P, F: Fn(&P) + 'static>( 2857 this: *mut gtk_sys::GtkTreeView, 2858 _param_spec: glib_sys::gpointer, 2859 f: glib_sys::gpointer, 2860 ) where 2861 P: IsA<TreeView>, 2862 { 2863 let f: &F = &*(f as *const F); 2864 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2865 } 2866 unsafe { 2867 let f: Box_<F> = Box_::new(f); 2868 connect_raw( 2869 self.as_ptr() as *mut _, 2870 b"notify::expander-column\0".as_ptr() as *const _, 2871 Some(transmute( 2872 notify_expander_column_trampoline::<Self, F> as usize, 2873 )), 2874 Box_::into_raw(f), 2875 ) 2876 } 2877 } 2878 connect_property_fixed_height_mode_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2879 fn connect_property_fixed_height_mode_notify<F: Fn(&Self) + 'static>( 2880 &self, 2881 f: F, 2882 ) -> SignalHandlerId { 2883 unsafe extern "C" fn notify_fixed_height_mode_trampoline<P, F: Fn(&P) + 'static>( 2884 this: *mut gtk_sys::GtkTreeView, 2885 _param_spec: glib_sys::gpointer, 2886 f: glib_sys::gpointer, 2887 ) where 2888 P: IsA<TreeView>, 2889 { 2890 let f: &F = &*(f as *const F); 2891 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2892 } 2893 unsafe { 2894 let f: Box_<F> = Box_::new(f); 2895 connect_raw( 2896 self.as_ptr() as *mut _, 2897 b"notify::fixed-height-mode\0".as_ptr() as *const _, 2898 Some(transmute( 2899 notify_fixed_height_mode_trampoline::<Self, F> as usize, 2900 )), 2901 Box_::into_raw(f), 2902 ) 2903 } 2904 } 2905 connect_property_headers_clickable_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2906 fn connect_property_headers_clickable_notify<F: Fn(&Self) + 'static>( 2907 &self, 2908 f: F, 2909 ) -> SignalHandlerId { 2910 unsafe extern "C" fn notify_headers_clickable_trampoline<P, F: Fn(&P) + 'static>( 2911 this: *mut gtk_sys::GtkTreeView, 2912 _param_spec: glib_sys::gpointer, 2913 f: glib_sys::gpointer, 2914 ) where 2915 P: IsA<TreeView>, 2916 { 2917 let f: &F = &*(f as *const F); 2918 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2919 } 2920 unsafe { 2921 let f: Box_<F> = Box_::new(f); 2922 connect_raw( 2923 self.as_ptr() as *mut _, 2924 b"notify::headers-clickable\0".as_ptr() as *const _, 2925 Some(transmute( 2926 notify_headers_clickable_trampoline::<Self, F> as usize, 2927 )), 2928 Box_::into_raw(f), 2929 ) 2930 } 2931 } 2932 connect_property_headers_visible_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2933 fn connect_property_headers_visible_notify<F: Fn(&Self) + 'static>( 2934 &self, 2935 f: F, 2936 ) -> SignalHandlerId { 2937 unsafe extern "C" fn notify_headers_visible_trampoline<P, F: Fn(&P) + 'static>( 2938 this: *mut gtk_sys::GtkTreeView, 2939 _param_spec: glib_sys::gpointer, 2940 f: glib_sys::gpointer, 2941 ) where 2942 P: IsA<TreeView>, 2943 { 2944 let f: &F = &*(f as *const F); 2945 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2946 } 2947 unsafe { 2948 let f: Box_<F> = Box_::new(f); 2949 connect_raw( 2950 self.as_ptr() as *mut _, 2951 b"notify::headers-visible\0".as_ptr() as *const _, 2952 Some(transmute( 2953 notify_headers_visible_trampoline::<Self, F> as usize, 2954 )), 2955 Box_::into_raw(f), 2956 ) 2957 } 2958 } 2959 connect_property_hover_expand_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2960 fn connect_property_hover_expand_notify<F: Fn(&Self) + 'static>( 2961 &self, 2962 f: F, 2963 ) -> SignalHandlerId { 2964 unsafe extern "C" fn notify_hover_expand_trampoline<P, F: Fn(&P) + 'static>( 2965 this: *mut gtk_sys::GtkTreeView, 2966 _param_spec: glib_sys::gpointer, 2967 f: glib_sys::gpointer, 2968 ) where 2969 P: IsA<TreeView>, 2970 { 2971 let f: &F = &*(f as *const F); 2972 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2973 } 2974 unsafe { 2975 let f: Box_<F> = Box_::new(f); 2976 connect_raw( 2977 self.as_ptr() as *mut _, 2978 b"notify::hover-expand\0".as_ptr() as *const _, 2979 Some(transmute( 2980 notify_hover_expand_trampoline::<Self, F> as usize, 2981 )), 2982 Box_::into_raw(f), 2983 ) 2984 } 2985 } 2986 connect_property_hover_selection_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2987 fn connect_property_hover_selection_notify<F: Fn(&Self) + 'static>( 2988 &self, 2989 f: F, 2990 ) -> SignalHandlerId { 2991 unsafe extern "C" fn notify_hover_selection_trampoline<P, F: Fn(&P) + 'static>( 2992 this: *mut gtk_sys::GtkTreeView, 2993 _param_spec: glib_sys::gpointer, 2994 f: glib_sys::gpointer, 2995 ) where 2996 P: IsA<TreeView>, 2997 { 2998 let f: &F = &*(f as *const F); 2999 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 3000 } 3001 unsafe { 3002 let f: Box_<F> = Box_::new(f); 3003 connect_raw( 3004 self.as_ptr() as *mut _, 3005 b"notify::hover-selection\0".as_ptr() as *const _, 3006 Some(transmute( 3007 notify_hover_selection_trampoline::<Self, F> as usize, 3008 )), 3009 Box_::into_raw(f), 3010 ) 3011 } 3012 } 3013 connect_property_level_indentation_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId3014 fn connect_property_level_indentation_notify<F: Fn(&Self) + 'static>( 3015 &self, 3016 f: F, 3017 ) -> SignalHandlerId { 3018 unsafe extern "C" fn notify_level_indentation_trampoline<P, F: Fn(&P) + 'static>( 3019 this: *mut gtk_sys::GtkTreeView, 3020 _param_spec: glib_sys::gpointer, 3021 f: glib_sys::gpointer, 3022 ) where 3023 P: IsA<TreeView>, 3024 { 3025 let f: &F = &*(f as *const F); 3026 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 3027 } 3028 unsafe { 3029 let f: Box_<F> = Box_::new(f); 3030 connect_raw( 3031 self.as_ptr() as *mut _, 3032 b"notify::level-indentation\0".as_ptr() as *const _, 3033 Some(transmute( 3034 notify_level_indentation_trampoline::<Self, F> as usize, 3035 )), 3036 Box_::into_raw(f), 3037 ) 3038 } 3039 } 3040 connect_property_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId3041 fn connect_property_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 3042 unsafe extern "C" fn notify_model_trampoline<P, F: Fn(&P) + 'static>( 3043 this: *mut gtk_sys::GtkTreeView, 3044 _param_spec: glib_sys::gpointer, 3045 f: glib_sys::gpointer, 3046 ) where 3047 P: IsA<TreeView>, 3048 { 3049 let f: &F = &*(f as *const F); 3050 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 3051 } 3052 unsafe { 3053 let f: Box_<F> = Box_::new(f); 3054 connect_raw( 3055 self.as_ptr() as *mut _, 3056 b"notify::model\0".as_ptr() as *const _, 3057 Some(transmute(notify_model_trampoline::<Self, F> as usize)), 3058 Box_::into_raw(f), 3059 ) 3060 } 3061 } 3062 connect_property_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId3063 fn connect_property_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 3064 unsafe extern "C" fn notify_reorderable_trampoline<P, F: Fn(&P) + 'static>( 3065 this: *mut gtk_sys::GtkTreeView, 3066 _param_spec: glib_sys::gpointer, 3067 f: glib_sys::gpointer, 3068 ) where 3069 P: IsA<TreeView>, 3070 { 3071 let f: &F = &*(f as *const F); 3072 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 3073 } 3074 unsafe { 3075 let f: Box_<F> = Box_::new(f); 3076 connect_raw( 3077 self.as_ptr() as *mut _, 3078 b"notify::reorderable\0".as_ptr() as *const _, 3079 Some(transmute(notify_reorderable_trampoline::<Self, F> as usize)), 3080 Box_::into_raw(f), 3081 ) 3082 } 3083 } 3084 connect_property_rubber_banding_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId3085 fn connect_property_rubber_banding_notify<F: Fn(&Self) + 'static>( 3086 &self, 3087 f: F, 3088 ) -> SignalHandlerId { 3089 unsafe extern "C" fn notify_rubber_banding_trampoline<P, F: Fn(&P) + 'static>( 3090 this: *mut gtk_sys::GtkTreeView, 3091 _param_spec: glib_sys::gpointer, 3092 f: glib_sys::gpointer, 3093 ) where 3094 P: IsA<TreeView>, 3095 { 3096 let f: &F = &*(f as *const F); 3097 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 3098 } 3099 unsafe { 3100 let f: Box_<F> = Box_::new(f); 3101 connect_raw( 3102 self.as_ptr() as *mut _, 3103 b"notify::rubber-banding\0".as_ptr() as *const _, 3104 Some(transmute( 3105 notify_rubber_banding_trampoline::<Self, F> as usize, 3106 )), 3107 Box_::into_raw(f), 3108 ) 3109 } 3110 } 3111 connect_property_search_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId3112 fn connect_property_search_column_notify<F: Fn(&Self) + 'static>( 3113 &self, 3114 f: F, 3115 ) -> SignalHandlerId { 3116 unsafe extern "C" fn notify_search_column_trampoline<P, F: Fn(&P) + 'static>( 3117 this: *mut gtk_sys::GtkTreeView, 3118 _param_spec: glib_sys::gpointer, 3119 f: glib_sys::gpointer, 3120 ) where 3121 P: IsA<TreeView>, 3122 { 3123 let f: &F = &*(f as *const F); 3124 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 3125 } 3126 unsafe { 3127 let f: Box_<F> = Box_::new(f); 3128 connect_raw( 3129 self.as_ptr() as *mut _, 3130 b"notify::search-column\0".as_ptr() as *const _, 3131 Some(transmute( 3132 notify_search_column_trampoline::<Self, F> as usize, 3133 )), 3134 Box_::into_raw(f), 3135 ) 3136 } 3137 } 3138 connect_property_show_expanders_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId3139 fn connect_property_show_expanders_notify<F: Fn(&Self) + 'static>( 3140 &self, 3141 f: F, 3142 ) -> SignalHandlerId { 3143 unsafe extern "C" fn notify_show_expanders_trampoline<P, F: Fn(&P) + 'static>( 3144 this: *mut gtk_sys::GtkTreeView, 3145 _param_spec: glib_sys::gpointer, 3146 f: glib_sys::gpointer, 3147 ) where 3148 P: IsA<TreeView>, 3149 { 3150 let f: &F = &*(f as *const F); 3151 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 3152 } 3153 unsafe { 3154 let f: Box_<F> = Box_::new(f); 3155 connect_raw( 3156 self.as_ptr() as *mut _, 3157 b"notify::show-expanders\0".as_ptr() as *const _, 3158 Some(transmute( 3159 notify_show_expanders_trampoline::<Self, F> as usize, 3160 )), 3161 Box_::into_raw(f), 3162 ) 3163 } 3164 } 3165 connect_property_tooltip_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId3166 fn connect_property_tooltip_column_notify<F: Fn(&Self) + 'static>( 3167 &self, 3168 f: F, 3169 ) -> SignalHandlerId { 3170 unsafe extern "C" fn notify_tooltip_column_trampoline<P, F: Fn(&P) + 'static>( 3171 this: *mut gtk_sys::GtkTreeView, 3172 _param_spec: glib_sys::gpointer, 3173 f: glib_sys::gpointer, 3174 ) where 3175 P: IsA<TreeView>, 3176 { 3177 let f: &F = &*(f as *const F); 3178 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 3179 } 3180 unsafe { 3181 let f: Box_<F> = Box_::new(f); 3182 connect_raw( 3183 self.as_ptr() as *mut _, 3184 b"notify::tooltip-column\0".as_ptr() as *const _, 3185 Some(transmute( 3186 notify_tooltip_column_trampoline::<Self, F> as usize, 3187 )), 3188 Box_::into_raw(f), 3189 ) 3190 } 3191 } 3192 connect_property_ubuntu_almost_fixed_height_mode_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId3193 fn connect_property_ubuntu_almost_fixed_height_mode_notify<F: Fn(&Self) + 'static>( 3194 &self, 3195 f: F, 3196 ) -> SignalHandlerId { 3197 unsafe extern "C" fn notify_ubuntu_almost_fixed_height_mode_trampoline< 3198 P, 3199 F: Fn(&P) + 'static, 3200 >( 3201 this: *mut gtk_sys::GtkTreeView, 3202 _param_spec: glib_sys::gpointer, 3203 f: glib_sys::gpointer, 3204 ) where 3205 P: IsA<TreeView>, 3206 { 3207 let f: &F = &*(f as *const F); 3208 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 3209 } 3210 unsafe { 3211 let f: Box_<F> = Box_::new(f); 3212 connect_raw( 3213 self.as_ptr() as *mut _, 3214 b"notify::ubuntu-almost-fixed-height-mode\0".as_ptr() as *const _, 3215 Some(transmute( 3216 notify_ubuntu_almost_fixed_height_mode_trampoline::<Self, F> as usize, 3217 )), 3218 Box_::into_raw(f), 3219 ) 3220 } 3221 } 3222 } 3223 3224 impl fmt::Display for TreeView { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result3225 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 3226 write!(f, "TreeView") 3227 } 3228 } 3229