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 std::boxed::Box as Box_; 23 use std::fmt; 24 use std::mem; 25 use std::mem::transmute; 26 use std::ptr; 27 use Adjustment; 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 ScrollablePolicy; 37 use Tooltip; 38 use TreeIter; 39 use TreeModel; 40 use TreePath; 41 use TreeSelection; 42 use TreeViewColumn; 43 use TreeViewDropPosition; 44 use TreeViewGridLines; 45 use Widget; 46 47 glib_wrapper! { 48 pub struct TreeView(Object<gtk_sys::GtkTreeView, gtk_sys::GtkTreeViewClass, TreeViewClass>) @extends Container, Widget, @implements Buildable, Scrollable; 49 50 match fn { 51 get_type => || gtk_sys::gtk_tree_view_get_type(), 52 } 53 } 54 55 impl TreeView { new() -> TreeView56 pub fn new() -> TreeView { 57 assert_initialized_main_thread!(); 58 unsafe { Widget::from_glib_none(gtk_sys::gtk_tree_view_new()).unsafe_cast() } 59 } 60 new_with_model<P: IsA<TreeModel>>(model: &P) -> TreeView61 pub fn new_with_model<P: IsA<TreeModel>>(model: &P) -> TreeView { 62 skip_assert_initialized!(); 63 unsafe { 64 Widget::from_glib_none(gtk_sys::gtk_tree_view_new_with_model( 65 model.as_ref().to_glib_none().0, 66 )) 67 .unsafe_cast() 68 } 69 } 70 } 71 72 impl Default for TreeView { default() -> Self73 fn default() -> Self { 74 Self::new() 75 } 76 } 77 78 #[derive(Clone, Default)] 79 pub struct TreeViewBuilder { 80 activate_on_single_click: Option<bool>, 81 enable_grid_lines: Option<TreeViewGridLines>, 82 enable_search: Option<bool>, 83 enable_tree_lines: Option<bool>, 84 expander_column: Option<TreeViewColumn>, 85 fixed_height_mode: Option<bool>, 86 headers_clickable: Option<bool>, 87 headers_visible: Option<bool>, 88 hover_expand: Option<bool>, 89 hover_selection: Option<bool>, 90 level_indentation: Option<i32>, 91 model: Option<TreeModel>, 92 reorderable: Option<bool>, 93 rubber_banding: Option<bool>, 94 search_column: Option<i32>, 95 show_expanders: Option<bool>, 96 tooltip_column: Option<i32>, 97 ubuntu_almost_fixed_height_mode: Option<bool>, 98 border_width: Option<u32>, 99 child: Option<Widget>, 100 resize_mode: Option<ResizeMode>, 101 app_paintable: Option<bool>, 102 can_default: Option<bool>, 103 can_focus: Option<bool>, 104 events: Option<gdk::EventMask>, 105 expand: Option<bool>, 106 #[cfg(any(feature = "v3_20", feature = "dox"))] 107 focus_on_click: Option<bool>, 108 halign: Option<Align>, 109 has_default: Option<bool>, 110 has_focus: Option<bool>, 111 has_tooltip: Option<bool>, 112 height_request: Option<i32>, 113 hexpand: Option<bool>, 114 hexpand_set: Option<bool>, 115 is_focus: Option<bool>, 116 margin: Option<i32>, 117 margin_bottom: Option<i32>, 118 margin_end: Option<i32>, 119 margin_start: Option<i32>, 120 margin_top: Option<i32>, 121 name: Option<String>, 122 no_show_all: Option<bool>, 123 opacity: Option<f64>, 124 parent: Option<Container>, 125 receives_default: Option<bool>, 126 sensitive: Option<bool>, 127 tooltip_markup: Option<String>, 128 tooltip_text: Option<String>, 129 valign: Option<Align>, 130 vexpand: Option<bool>, 131 vexpand_set: Option<bool>, 132 visible: Option<bool>, 133 width_request: Option<i32>, 134 hadjustment: Option<Adjustment>, 135 hscroll_policy: Option<ScrollablePolicy>, 136 vadjustment: Option<Adjustment>, 137 vscroll_policy: Option<ScrollablePolicy>, 138 } 139 140 impl TreeViewBuilder { new() -> Self141 pub fn new() -> Self { 142 Self::default() 143 } 144 build(self) -> TreeView145 pub fn build(self) -> TreeView { 146 let mut properties: Vec<(&str, &dyn ToValue)> = vec![]; 147 if let Some(ref activate_on_single_click) = self.activate_on_single_click { 148 properties.push(("activate-on-single-click", activate_on_single_click)); 149 } 150 if let Some(ref enable_grid_lines) = self.enable_grid_lines { 151 properties.push(("enable-grid-lines", enable_grid_lines)); 152 } 153 if let Some(ref enable_search) = self.enable_search { 154 properties.push(("enable-search", enable_search)); 155 } 156 if let Some(ref enable_tree_lines) = self.enable_tree_lines { 157 properties.push(("enable-tree-lines", enable_tree_lines)); 158 } 159 if let Some(ref expander_column) = self.expander_column { 160 properties.push(("expander-column", expander_column)); 161 } 162 if let Some(ref fixed_height_mode) = self.fixed_height_mode { 163 properties.push(("fixed-height-mode", fixed_height_mode)); 164 } 165 if let Some(ref headers_clickable) = self.headers_clickable { 166 properties.push(("headers-clickable", headers_clickable)); 167 } 168 if let Some(ref headers_visible) = self.headers_visible { 169 properties.push(("headers-visible", headers_visible)); 170 } 171 if let Some(ref hover_expand) = self.hover_expand { 172 properties.push(("hover-expand", hover_expand)); 173 } 174 if let Some(ref hover_selection) = self.hover_selection { 175 properties.push(("hover-selection", hover_selection)); 176 } 177 if let Some(ref level_indentation) = self.level_indentation { 178 properties.push(("level-indentation", level_indentation)); 179 } 180 if let Some(ref model) = self.model { 181 properties.push(("model", model)); 182 } 183 if let Some(ref reorderable) = self.reorderable { 184 properties.push(("reorderable", reorderable)); 185 } 186 if let Some(ref rubber_banding) = self.rubber_banding { 187 properties.push(("rubber-banding", rubber_banding)); 188 } 189 if let Some(ref search_column) = self.search_column { 190 properties.push(("search-column", search_column)); 191 } 192 if let Some(ref show_expanders) = self.show_expanders { 193 properties.push(("show-expanders", show_expanders)); 194 } 195 if let Some(ref tooltip_column) = self.tooltip_column { 196 properties.push(("tooltip-column", tooltip_column)); 197 } 198 if let Some(ref ubuntu_almost_fixed_height_mode) = self.ubuntu_almost_fixed_height_mode { 199 properties.push(( 200 "ubuntu-almost-fixed-height-mode", 201 ubuntu_almost_fixed_height_mode, 202 )); 203 } 204 if let Some(ref border_width) = self.border_width { 205 properties.push(("border-width", border_width)); 206 } 207 if let Some(ref child) = self.child { 208 properties.push(("child", child)); 209 } 210 if let Some(ref resize_mode) = self.resize_mode { 211 properties.push(("resize-mode", resize_mode)); 212 } 213 if let Some(ref app_paintable) = self.app_paintable { 214 properties.push(("app-paintable", app_paintable)); 215 } 216 if let Some(ref can_default) = self.can_default { 217 properties.push(("can-default", can_default)); 218 } 219 if let Some(ref can_focus) = self.can_focus { 220 properties.push(("can-focus", can_focus)); 221 } 222 if let Some(ref events) = self.events { 223 properties.push(("events", events)); 224 } 225 if let Some(ref expand) = self.expand { 226 properties.push(("expand", expand)); 227 } 228 #[cfg(any(feature = "v3_20", feature = "dox"))] 229 { 230 if let Some(ref focus_on_click) = self.focus_on_click { 231 properties.push(("focus-on-click", focus_on_click)); 232 } 233 } 234 if let Some(ref halign) = self.halign { 235 properties.push(("halign", halign)); 236 } 237 if let Some(ref has_default) = self.has_default { 238 properties.push(("has-default", has_default)); 239 } 240 if let Some(ref has_focus) = self.has_focus { 241 properties.push(("has-focus", has_focus)); 242 } 243 if let Some(ref has_tooltip) = self.has_tooltip { 244 properties.push(("has-tooltip", has_tooltip)); 245 } 246 if let Some(ref height_request) = self.height_request { 247 properties.push(("height-request", height_request)); 248 } 249 if let Some(ref hexpand) = self.hexpand { 250 properties.push(("hexpand", hexpand)); 251 } 252 if let Some(ref hexpand_set) = self.hexpand_set { 253 properties.push(("hexpand-set", hexpand_set)); 254 } 255 if let Some(ref is_focus) = self.is_focus { 256 properties.push(("is-focus", is_focus)); 257 } 258 if let Some(ref margin) = self.margin { 259 properties.push(("margin", margin)); 260 } 261 if let Some(ref margin_bottom) = self.margin_bottom { 262 properties.push(("margin-bottom", margin_bottom)); 263 } 264 if let Some(ref margin_end) = self.margin_end { 265 properties.push(("margin-end", margin_end)); 266 } 267 if let Some(ref margin_start) = self.margin_start { 268 properties.push(("margin-start", margin_start)); 269 } 270 if let Some(ref margin_top) = self.margin_top { 271 properties.push(("margin-top", margin_top)); 272 } 273 if let Some(ref name) = self.name { 274 properties.push(("name", name)); 275 } 276 if let Some(ref no_show_all) = self.no_show_all { 277 properties.push(("no-show-all", no_show_all)); 278 } 279 if let Some(ref opacity) = self.opacity { 280 properties.push(("opacity", opacity)); 281 } 282 if let Some(ref parent) = self.parent { 283 properties.push(("parent", parent)); 284 } 285 if let Some(ref receives_default) = self.receives_default { 286 properties.push(("receives-default", receives_default)); 287 } 288 if let Some(ref sensitive) = self.sensitive { 289 properties.push(("sensitive", sensitive)); 290 } 291 if let Some(ref tooltip_markup) = self.tooltip_markup { 292 properties.push(("tooltip-markup", tooltip_markup)); 293 } 294 if let Some(ref tooltip_text) = self.tooltip_text { 295 properties.push(("tooltip-text", tooltip_text)); 296 } 297 if let Some(ref valign) = self.valign { 298 properties.push(("valign", valign)); 299 } 300 if let Some(ref vexpand) = self.vexpand { 301 properties.push(("vexpand", vexpand)); 302 } 303 if let Some(ref vexpand_set) = self.vexpand_set { 304 properties.push(("vexpand-set", vexpand_set)); 305 } 306 if let Some(ref visible) = self.visible { 307 properties.push(("visible", visible)); 308 } 309 if let Some(ref width_request) = self.width_request { 310 properties.push(("width-request", width_request)); 311 } 312 if let Some(ref hadjustment) = self.hadjustment { 313 properties.push(("hadjustment", hadjustment)); 314 } 315 if let Some(ref hscroll_policy) = self.hscroll_policy { 316 properties.push(("hscroll-policy", hscroll_policy)); 317 } 318 if let Some(ref vadjustment) = self.vadjustment { 319 properties.push(("vadjustment", vadjustment)); 320 } 321 if let Some(ref vscroll_policy) = self.vscroll_policy { 322 properties.push(("vscroll-policy", vscroll_policy)); 323 } 324 glib::Object::new(TreeView::static_type(), &properties) 325 .expect("object new") 326 .downcast() 327 .expect("downcast") 328 } 329 activate_on_single_click(mut self, activate_on_single_click: bool) -> Self330 pub fn activate_on_single_click(mut self, activate_on_single_click: bool) -> Self { 331 self.activate_on_single_click = Some(activate_on_single_click); 332 self 333 } 334 enable_grid_lines(mut self, enable_grid_lines: TreeViewGridLines) -> Self335 pub fn enable_grid_lines(mut self, enable_grid_lines: TreeViewGridLines) -> Self { 336 self.enable_grid_lines = Some(enable_grid_lines); 337 self 338 } 339 enable_search(mut self, enable_search: bool) -> Self340 pub fn enable_search(mut self, enable_search: bool) -> Self { 341 self.enable_search = Some(enable_search); 342 self 343 } 344 enable_tree_lines(mut self, enable_tree_lines: bool) -> Self345 pub fn enable_tree_lines(mut self, enable_tree_lines: bool) -> Self { 346 self.enable_tree_lines = Some(enable_tree_lines); 347 self 348 } 349 expander_column<P: IsA<TreeViewColumn>>(mut self, expander_column: &P) -> Self350 pub fn expander_column<P: IsA<TreeViewColumn>>(mut self, expander_column: &P) -> Self { 351 self.expander_column = Some(expander_column.clone().upcast()); 352 self 353 } 354 fixed_height_mode(mut self, fixed_height_mode: bool) -> Self355 pub fn fixed_height_mode(mut self, fixed_height_mode: bool) -> Self { 356 self.fixed_height_mode = Some(fixed_height_mode); 357 self 358 } 359 headers_clickable(mut self, headers_clickable: bool) -> Self360 pub fn headers_clickable(mut self, headers_clickable: bool) -> Self { 361 self.headers_clickable = Some(headers_clickable); 362 self 363 } 364 headers_visible(mut self, headers_visible: bool) -> Self365 pub fn headers_visible(mut self, headers_visible: bool) -> Self { 366 self.headers_visible = Some(headers_visible); 367 self 368 } 369 hover_expand(mut self, hover_expand: bool) -> Self370 pub fn hover_expand(mut self, hover_expand: bool) -> Self { 371 self.hover_expand = Some(hover_expand); 372 self 373 } 374 hover_selection(mut self, hover_selection: bool) -> Self375 pub fn hover_selection(mut self, hover_selection: bool) -> Self { 376 self.hover_selection = Some(hover_selection); 377 self 378 } 379 level_indentation(mut self, level_indentation: i32) -> Self380 pub fn level_indentation(mut self, level_indentation: i32) -> Self { 381 self.level_indentation = Some(level_indentation); 382 self 383 } 384 model<P: IsA<TreeModel>>(mut self, model: &P) -> Self385 pub fn model<P: IsA<TreeModel>>(mut self, model: &P) -> Self { 386 self.model = Some(model.clone().upcast()); 387 self 388 } 389 reorderable(mut self, reorderable: bool) -> Self390 pub fn reorderable(mut self, reorderable: bool) -> Self { 391 self.reorderable = Some(reorderable); 392 self 393 } 394 rubber_banding(mut self, rubber_banding: bool) -> Self395 pub fn rubber_banding(mut self, rubber_banding: bool) -> Self { 396 self.rubber_banding = Some(rubber_banding); 397 self 398 } 399 search_column(mut self, search_column: i32) -> Self400 pub fn search_column(mut self, search_column: i32) -> Self { 401 self.search_column = Some(search_column); 402 self 403 } 404 show_expanders(mut self, show_expanders: bool) -> Self405 pub fn show_expanders(mut self, show_expanders: bool) -> Self { 406 self.show_expanders = Some(show_expanders); 407 self 408 } 409 tooltip_column(mut self, tooltip_column: i32) -> Self410 pub fn tooltip_column(mut self, tooltip_column: i32) -> Self { 411 self.tooltip_column = Some(tooltip_column); 412 self 413 } 414 ubuntu_almost_fixed_height_mode( mut self, ubuntu_almost_fixed_height_mode: bool, ) -> Self415 pub fn ubuntu_almost_fixed_height_mode( 416 mut self, 417 ubuntu_almost_fixed_height_mode: bool, 418 ) -> Self { 419 self.ubuntu_almost_fixed_height_mode = Some(ubuntu_almost_fixed_height_mode); 420 self 421 } 422 border_width(mut self, border_width: u32) -> Self423 pub fn border_width(mut self, border_width: u32) -> Self { 424 self.border_width = Some(border_width); 425 self 426 } 427 child<P: IsA<Widget>>(mut self, child: &P) -> Self428 pub fn child<P: IsA<Widget>>(mut self, child: &P) -> Self { 429 self.child = Some(child.clone().upcast()); 430 self 431 } 432 resize_mode(mut self, resize_mode: ResizeMode) -> Self433 pub fn resize_mode(mut self, resize_mode: ResizeMode) -> Self { 434 self.resize_mode = Some(resize_mode); 435 self 436 } 437 app_paintable(mut self, app_paintable: bool) -> Self438 pub fn app_paintable(mut self, app_paintable: bool) -> Self { 439 self.app_paintable = Some(app_paintable); 440 self 441 } 442 can_default(mut self, can_default: bool) -> Self443 pub fn can_default(mut self, can_default: bool) -> Self { 444 self.can_default = Some(can_default); 445 self 446 } 447 can_focus(mut self, can_focus: bool) -> Self448 pub fn can_focus(mut self, can_focus: bool) -> Self { 449 self.can_focus = Some(can_focus); 450 self 451 } 452 events(mut self, events: gdk::EventMask) -> Self453 pub fn events(mut self, events: gdk::EventMask) -> Self { 454 self.events = Some(events); 455 self 456 } 457 expand(mut self, expand: bool) -> Self458 pub fn expand(mut self, expand: bool) -> Self { 459 self.expand = Some(expand); 460 self 461 } 462 463 #[cfg(any(feature = "v3_20", feature = "dox"))] focus_on_click(mut self, focus_on_click: bool) -> Self464 pub fn focus_on_click(mut self, focus_on_click: bool) -> Self { 465 self.focus_on_click = Some(focus_on_click); 466 self 467 } 468 halign(mut self, halign: Align) -> Self469 pub fn halign(mut self, halign: Align) -> Self { 470 self.halign = Some(halign); 471 self 472 } 473 has_default(mut self, has_default: bool) -> Self474 pub fn has_default(mut self, has_default: bool) -> Self { 475 self.has_default = Some(has_default); 476 self 477 } 478 has_focus(mut self, has_focus: bool) -> Self479 pub fn has_focus(mut self, has_focus: bool) -> Self { 480 self.has_focus = Some(has_focus); 481 self 482 } 483 has_tooltip(mut self, has_tooltip: bool) -> Self484 pub fn has_tooltip(mut self, has_tooltip: bool) -> Self { 485 self.has_tooltip = Some(has_tooltip); 486 self 487 } 488 height_request(mut self, height_request: i32) -> Self489 pub fn height_request(mut self, height_request: i32) -> Self { 490 self.height_request = Some(height_request); 491 self 492 } 493 hexpand(mut self, hexpand: bool) -> Self494 pub fn hexpand(mut self, hexpand: bool) -> Self { 495 self.hexpand = Some(hexpand); 496 self 497 } 498 hexpand_set(mut self, hexpand_set: bool) -> Self499 pub fn hexpand_set(mut self, hexpand_set: bool) -> Self { 500 self.hexpand_set = Some(hexpand_set); 501 self 502 } 503 is_focus(mut self, is_focus: bool) -> Self504 pub fn is_focus(mut self, is_focus: bool) -> Self { 505 self.is_focus = Some(is_focus); 506 self 507 } 508 margin(mut self, margin: i32) -> Self509 pub fn margin(mut self, margin: i32) -> Self { 510 self.margin = Some(margin); 511 self 512 } 513 margin_bottom(mut self, margin_bottom: i32) -> Self514 pub fn margin_bottom(mut self, margin_bottom: i32) -> Self { 515 self.margin_bottom = Some(margin_bottom); 516 self 517 } 518 margin_end(mut self, margin_end: i32) -> Self519 pub fn margin_end(mut self, margin_end: i32) -> Self { 520 self.margin_end = Some(margin_end); 521 self 522 } 523 margin_start(mut self, margin_start: i32) -> Self524 pub fn margin_start(mut self, margin_start: i32) -> Self { 525 self.margin_start = Some(margin_start); 526 self 527 } 528 margin_top(mut self, margin_top: i32) -> Self529 pub fn margin_top(mut self, margin_top: i32) -> Self { 530 self.margin_top = Some(margin_top); 531 self 532 } 533 name(mut self, name: &str) -> Self534 pub fn name(mut self, name: &str) -> Self { 535 self.name = Some(name.to_string()); 536 self 537 } 538 no_show_all(mut self, no_show_all: bool) -> Self539 pub fn no_show_all(mut self, no_show_all: bool) -> Self { 540 self.no_show_all = Some(no_show_all); 541 self 542 } 543 opacity(mut self, opacity: f64) -> Self544 pub fn opacity(mut self, opacity: f64) -> Self { 545 self.opacity = Some(opacity); 546 self 547 } 548 parent<P: IsA<Container>>(mut self, parent: &P) -> Self549 pub fn parent<P: IsA<Container>>(mut self, parent: &P) -> Self { 550 self.parent = Some(parent.clone().upcast()); 551 self 552 } 553 receives_default(mut self, receives_default: bool) -> Self554 pub fn receives_default(mut self, receives_default: bool) -> Self { 555 self.receives_default = Some(receives_default); 556 self 557 } 558 sensitive(mut self, sensitive: bool) -> Self559 pub fn sensitive(mut self, sensitive: bool) -> Self { 560 self.sensitive = Some(sensitive); 561 self 562 } 563 tooltip_markup(mut self, tooltip_markup: &str) -> Self564 pub fn tooltip_markup(mut self, tooltip_markup: &str) -> Self { 565 self.tooltip_markup = Some(tooltip_markup.to_string()); 566 self 567 } 568 tooltip_text(mut self, tooltip_text: &str) -> Self569 pub fn tooltip_text(mut self, tooltip_text: &str) -> Self { 570 self.tooltip_text = Some(tooltip_text.to_string()); 571 self 572 } 573 valign(mut self, valign: Align) -> Self574 pub fn valign(mut self, valign: Align) -> Self { 575 self.valign = Some(valign); 576 self 577 } 578 vexpand(mut self, vexpand: bool) -> Self579 pub fn vexpand(mut self, vexpand: bool) -> Self { 580 self.vexpand = Some(vexpand); 581 self 582 } 583 vexpand_set(mut self, vexpand_set: bool) -> Self584 pub fn vexpand_set(mut self, vexpand_set: bool) -> Self { 585 self.vexpand_set = Some(vexpand_set); 586 self 587 } 588 visible(mut self, visible: bool) -> Self589 pub fn visible(mut self, visible: bool) -> Self { 590 self.visible = Some(visible); 591 self 592 } 593 width_request(mut self, width_request: i32) -> Self594 pub fn width_request(mut self, width_request: i32) -> Self { 595 self.width_request = Some(width_request); 596 self 597 } 598 hadjustment<P: IsA<Adjustment>>(mut self, hadjustment: &P) -> Self599 pub fn hadjustment<P: IsA<Adjustment>>(mut self, hadjustment: &P) -> Self { 600 self.hadjustment = Some(hadjustment.clone().upcast()); 601 self 602 } 603 hscroll_policy(mut self, hscroll_policy: ScrollablePolicy) -> Self604 pub fn hscroll_policy(mut self, hscroll_policy: ScrollablePolicy) -> Self { 605 self.hscroll_policy = Some(hscroll_policy); 606 self 607 } 608 vadjustment<P: IsA<Adjustment>>(mut self, vadjustment: &P) -> Self609 pub fn vadjustment<P: IsA<Adjustment>>(mut self, vadjustment: &P) -> Self { 610 self.vadjustment = Some(vadjustment.clone().upcast()); 611 self 612 } 613 vscroll_policy(mut self, vscroll_policy: ScrollablePolicy) -> Self614 pub fn vscroll_policy(mut self, vscroll_policy: ScrollablePolicy) -> Self { 615 self.vscroll_policy = Some(vscroll_policy); 616 self 617 } 618 } 619 620 pub const NONE_TREE_VIEW: Option<&TreeView> = None; 621 622 pub trait TreeViewExt: 'static { append_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i32623 fn append_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i32; 624 collapse_all(&self)625 fn collapse_all(&self); 626 collapse_row(&self, path: &TreePath) -> bool627 fn collapse_row(&self, path: &TreePath) -> bool; 628 columns_autosize(&self)629 fn columns_autosize(&self); 630 convert_bin_window_to_tree_coords(&self, bx: i32, by: i32) -> (i32, i32)631 fn convert_bin_window_to_tree_coords(&self, bx: i32, by: i32) -> (i32, i32); 632 convert_bin_window_to_widget_coords(&self, bx: i32, by: i32) -> (i32, i32)633 fn convert_bin_window_to_widget_coords(&self, bx: i32, by: i32) -> (i32, i32); 634 convert_tree_to_bin_window_coords(&self, tx: i32, ty: i32) -> (i32, i32)635 fn convert_tree_to_bin_window_coords(&self, tx: i32, ty: i32) -> (i32, i32); 636 convert_tree_to_widget_coords(&self, tx: i32, ty: i32) -> (i32, i32)637 fn convert_tree_to_widget_coords(&self, tx: i32, ty: i32) -> (i32, i32); 638 convert_widget_to_bin_window_coords(&self, wx: i32, wy: i32) -> (i32, i32)639 fn convert_widget_to_bin_window_coords(&self, wx: i32, wy: i32) -> (i32, i32); 640 convert_widget_to_tree_coords(&self, wx: i32, wy: i32) -> (i32, i32)641 fn convert_widget_to_tree_coords(&self, wx: i32, wy: i32) -> (i32, i32); 642 create_row_drag_icon(&self, path: &TreePath) -> Option<cairo::Surface>643 fn create_row_drag_icon(&self, path: &TreePath) -> Option<cairo::Surface>; 644 expand_all(&self)645 fn expand_all(&self); 646 expand_row(&self, path: &TreePath, open_all: bool) -> bool647 fn expand_row(&self, path: &TreePath, open_all: bool) -> bool; 648 expand_to_path(&self, path: &TreePath)649 fn expand_to_path(&self, path: &TreePath); 650 get_activate_on_single_click(&self) -> bool651 fn get_activate_on_single_click(&self) -> bool; 652 get_background_area<P: IsA<TreeViewColumn>>( &self, path: Option<&TreePath>, column: Option<&P>, ) -> gdk::Rectangle653 fn get_background_area<P: IsA<TreeViewColumn>>( 654 &self, 655 path: Option<&TreePath>, 656 column: Option<&P>, 657 ) -> gdk::Rectangle; 658 get_bin_window(&self) -> Option<gdk::Window>659 fn get_bin_window(&self) -> Option<gdk::Window>; 660 get_cell_area<P: IsA<TreeViewColumn>>( &self, path: Option<&TreePath>, column: Option<&P>, ) -> gdk::Rectangle661 fn get_cell_area<P: IsA<TreeViewColumn>>( 662 &self, 663 path: Option<&TreePath>, 664 column: Option<&P>, 665 ) -> gdk::Rectangle; 666 get_column(&self, n: i32) -> Option<TreeViewColumn>667 fn get_column(&self, n: i32) -> Option<TreeViewColumn>; 668 get_columns(&self) -> Vec<TreeViewColumn>669 fn get_columns(&self) -> Vec<TreeViewColumn>; 670 get_cursor(&self) -> (Option<TreePath>, Option<TreeViewColumn>)671 fn get_cursor(&self) -> (Option<TreePath>, Option<TreeViewColumn>); 672 get_dest_row_at_pos( &self, drag_x: i32, drag_y: i32, ) -> Option<(Option<TreePath>, TreeViewDropPosition)>673 fn get_dest_row_at_pos( 674 &self, 675 drag_x: i32, 676 drag_y: i32, 677 ) -> Option<(Option<TreePath>, TreeViewDropPosition)>; 678 get_drag_dest_row(&self) -> (Option<TreePath>, TreeViewDropPosition)679 fn get_drag_dest_row(&self) -> (Option<TreePath>, TreeViewDropPosition); 680 get_enable_search(&self) -> bool681 fn get_enable_search(&self) -> bool; 682 get_enable_tree_lines(&self) -> bool683 fn get_enable_tree_lines(&self) -> bool; 684 get_expander_column(&self) -> Option<TreeViewColumn>685 fn get_expander_column(&self) -> Option<TreeViewColumn>; 686 get_fixed_height_mode(&self) -> bool687 fn get_fixed_height_mode(&self) -> bool; 688 get_grid_lines(&self) -> TreeViewGridLines689 fn get_grid_lines(&self) -> TreeViewGridLines; 690 get_headers_clickable(&self) -> bool691 fn get_headers_clickable(&self) -> bool; 692 get_headers_visible(&self) -> bool693 fn get_headers_visible(&self) -> bool; 694 get_hover_expand(&self) -> bool695 fn get_hover_expand(&self) -> bool; 696 get_hover_selection(&self) -> bool697 fn get_hover_selection(&self) -> bool; 698 get_level_indentation(&self) -> i32699 fn get_level_indentation(&self) -> i32; 700 get_model(&self) -> Option<TreeModel>701 fn get_model(&self) -> Option<TreeModel>; 702 get_n_columns(&self) -> u32703 fn get_n_columns(&self) -> u32; 704 get_path_at_pos( &self, x: i32, y: i32, ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)>705 fn get_path_at_pos( 706 &self, 707 x: i32, 708 y: i32, 709 ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)>; 710 get_reorderable(&self) -> bool711 fn get_reorderable(&self) -> bool; 712 713 //fn get_row_separator_func(&self) -> Option<Box_<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>; 714 get_rubber_banding(&self) -> bool715 fn get_rubber_banding(&self) -> bool; 716 get_search_column(&self) -> i32717 fn get_search_column(&self) -> i32; 718 get_search_entry(&self) -> Option<Entry>719 fn get_search_entry(&self) -> Option<Entry>; 720 721 //fn get_search_equal_func(&self) -> Option<Box_<dyn Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static>>; 722 723 //fn get_search_position_func(&self) -> Option<Box_<dyn Fn(&TreeView, &Widget) + 'static>>; 724 get_selection(&self) -> TreeSelection725 fn get_selection(&self) -> TreeSelection; 726 get_show_expanders(&self) -> bool727 fn get_show_expanders(&self) -> bool; 728 get_tooltip_column(&self) -> i32729 fn get_tooltip_column(&self) -> i32; 730 get_tooltip_context( &self, x: &mut i32, y: &mut i32, keyboard_tip: bool, ) -> Option<(Option<TreeModel>, TreePath, TreeIter)>731 fn get_tooltip_context( 732 &self, 733 x: &mut i32, 734 y: &mut i32, 735 keyboard_tip: bool, 736 ) -> Option<(Option<TreeModel>, TreePath, TreeIter)>; 737 get_visible_range(&self) -> Option<(TreePath, TreePath)>738 fn get_visible_range(&self) -> Option<(TreePath, TreePath)>; 739 get_visible_rect(&self) -> gdk::Rectangle740 fn get_visible_rect(&self) -> gdk::Rectangle; 741 insert_column<P: IsA<TreeViewColumn>>(&self, column: &P, position: i32) -> i32742 fn insert_column<P: IsA<TreeViewColumn>>(&self, column: &P, position: i32) -> i32; 743 744 //fn insert_column_with_attributes<P: IsA<CellRenderer>>(&self, position: i32, title: &str, cell: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> i32; 745 insert_column_with_data_func< P: IsA<CellRenderer>, Q: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static, >( &self, position: i32, title: &str, cell: &P, func: Q, ) -> i32746 fn insert_column_with_data_func< 747 P: IsA<CellRenderer>, 748 Q: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static, 749 >( 750 &self, 751 position: i32, 752 title: &str, 753 cell: &P, 754 func: Q, 755 ) -> i32; 756 is_blank_at_pos( &self, x: i32, y: i32, ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)>757 fn is_blank_at_pos( 758 &self, 759 x: i32, 760 y: i32, 761 ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)>; 762 is_rubber_banding_active(&self) -> bool763 fn is_rubber_banding_active(&self) -> bool; 764 map_expanded_rows<P: FnMut(&TreeView, &TreePath)>(&self, func: P)765 fn map_expanded_rows<P: FnMut(&TreeView, &TreePath)>(&self, func: P); 766 move_column_after<P: IsA<TreeViewColumn>, Q: IsA<TreeViewColumn>>( &self, column: &P, base_column: Option<&Q>, )767 fn move_column_after<P: IsA<TreeViewColumn>, Q: IsA<TreeViewColumn>>( 768 &self, 769 column: &P, 770 base_column: Option<&Q>, 771 ); 772 remove_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i32773 fn remove_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i32; 774 row_activated<P: IsA<TreeViewColumn>>(&self, path: &TreePath, column: &P)775 fn row_activated<P: IsA<TreeViewColumn>>(&self, path: &TreePath, column: &P); 776 row_expanded(&self, path: &TreePath) -> bool777 fn row_expanded(&self, path: &TreePath) -> bool; 778 scroll_to_cell<P: IsA<TreeViewColumn>>( &self, path: Option<&TreePath>, column: Option<&P>, use_align: bool, row_align: f32, col_align: f32, )779 fn scroll_to_cell<P: IsA<TreeViewColumn>>( 780 &self, 781 path: Option<&TreePath>, 782 column: Option<&P>, 783 use_align: bool, 784 row_align: f32, 785 col_align: f32, 786 ); 787 scroll_to_point(&self, tree_x: i32, tree_y: i32)788 fn scroll_to_point(&self, tree_x: i32, tree_y: i32); 789 set_activate_on_single_click(&self, single: bool)790 fn set_activate_on_single_click(&self, single: bool); 791 set_column_drag_function( &self, func: Option< Box_< dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool + 'static, >, >, )792 fn set_column_drag_function( 793 &self, 794 func: Option< 795 Box_< 796 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool 797 + 'static, 798 >, 799 >, 800 ); 801 set_cursor<P: IsA<TreeViewColumn>>( &self, path: &TreePath, focus_column: Option<&P>, start_editing: bool, )802 fn set_cursor<P: IsA<TreeViewColumn>>( 803 &self, 804 path: &TreePath, 805 focus_column: Option<&P>, 806 start_editing: bool, 807 ); 808 set_cursor_on_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( &self, path: &TreePath, focus_column: Option<&P>, focus_cell: Option<&Q>, start_editing: bool, )809 fn set_cursor_on_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( 810 &self, 811 path: &TreePath, 812 focus_column: Option<&P>, 813 focus_cell: Option<&Q>, 814 start_editing: bool, 815 ); 816 set_drag_dest_row(&self, path: Option<&TreePath>, pos: TreeViewDropPosition)817 fn set_drag_dest_row(&self, path: Option<&TreePath>, pos: TreeViewDropPosition); 818 set_enable_search(&self, enable_search: bool)819 fn set_enable_search(&self, enable_search: bool); 820 set_enable_tree_lines(&self, enabled: bool)821 fn set_enable_tree_lines(&self, enabled: bool); 822 set_expander_column<P: IsA<TreeViewColumn>>(&self, column: Option<&P>)823 fn set_expander_column<P: IsA<TreeViewColumn>>(&self, column: Option<&P>); 824 set_fixed_height_mode(&self, enable: bool)825 fn set_fixed_height_mode(&self, enable: bool); 826 set_grid_lines(&self, grid_lines: TreeViewGridLines)827 fn set_grid_lines(&self, grid_lines: TreeViewGridLines); 828 set_headers_clickable(&self, setting: bool)829 fn set_headers_clickable(&self, setting: bool); 830 set_headers_visible(&self, headers_visible: bool)831 fn set_headers_visible(&self, headers_visible: bool); 832 set_hover_expand(&self, expand: bool)833 fn set_hover_expand(&self, expand: bool); 834 set_hover_selection(&self, hover: bool)835 fn set_hover_selection(&self, hover: bool); 836 set_level_indentation(&self, indentation: i32)837 fn set_level_indentation(&self, indentation: i32); 838 set_model<P: IsA<TreeModel>>(&self, model: Option<&P>)839 fn set_model<P: IsA<TreeModel>>(&self, model: Option<&P>); 840 set_reorderable(&self, reorderable: bool)841 fn set_reorderable(&self, reorderable: bool); 842 set_row_separator_func( &self, func: Option<Box_<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>, )843 fn set_row_separator_func( 844 &self, 845 func: Option<Box_<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>, 846 ); 847 set_rubber_banding(&self, enable: bool)848 fn set_rubber_banding(&self, enable: bool); 849 set_search_column(&self, column: i32)850 fn set_search_column(&self, column: i32); 851 set_search_entry<P: IsA<Entry>>(&self, entry: Option<&P>)852 fn set_search_entry<P: IsA<Entry>>(&self, entry: Option<&P>); 853 set_search_equal_func<P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static>( &self, search_equal_func: P, )854 fn set_search_equal_func<P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static>( 855 &self, 856 search_equal_func: P, 857 ); 858 set_search_position_func(&self, func: Option<Box_<dyn Fn(&TreeView, &Widget) + 'static>>)859 fn set_search_position_func(&self, func: Option<Box_<dyn Fn(&TreeView, &Widget) + 'static>>); 860 set_show_expanders(&self, enabled: bool)861 fn set_show_expanders(&self, enabled: bool); 862 set_tooltip_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( &self, tooltip: &Tooltip, path: Option<&TreePath>, column: Option<&P>, cell: Option<&Q>, )863 fn set_tooltip_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( 864 &self, 865 tooltip: &Tooltip, 866 path: Option<&TreePath>, 867 column: Option<&P>, 868 cell: Option<&Q>, 869 ); 870 set_tooltip_column(&self, column: i32)871 fn set_tooltip_column(&self, column: i32); 872 set_tooltip_row(&self, tooltip: &Tooltip, path: &TreePath)873 fn set_tooltip_row(&self, tooltip: &Tooltip, path: &TreePath); 874 unset_rows_drag_dest(&self)875 fn unset_rows_drag_dest(&self); 876 unset_rows_drag_source(&self)877 fn unset_rows_drag_source(&self); 878 get_property_enable_grid_lines(&self) -> TreeViewGridLines879 fn get_property_enable_grid_lines(&self) -> TreeViewGridLines; 880 set_property_enable_grid_lines(&self, enable_grid_lines: TreeViewGridLines)881 fn set_property_enable_grid_lines(&self, enable_grid_lines: TreeViewGridLines); 882 set_property_ubuntu_almost_fixed_height_mode(&self, ubuntu_almost_fixed_height_mode: bool)883 fn set_property_ubuntu_almost_fixed_height_mode(&self, ubuntu_almost_fixed_height_mode: bool); 884 connect_columns_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId885 fn connect_columns_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 886 connect_cursor_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId887 fn connect_cursor_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 888 connect_expand_collapse_cursor_row<F: Fn(&Self, bool, bool, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId889 fn connect_expand_collapse_cursor_row<F: Fn(&Self, bool, bool, bool) -> bool + 'static>( 890 &self, 891 f: F, 892 ) -> SignalHandlerId; 893 emit_expand_collapse_cursor_row(&self, object: bool, p0: bool, p1: bool) -> bool894 fn emit_expand_collapse_cursor_row(&self, object: bool, p0: bool, p1: bool) -> bool; 895 connect_move_cursor<F: Fn(&Self, MovementStep, i32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId896 fn connect_move_cursor<F: Fn(&Self, MovementStep, i32) -> bool + 'static>( 897 &self, 898 f: F, 899 ) -> SignalHandlerId; 900 emit_move_cursor(&self, step: MovementStep, direction: i32) -> bool901 fn emit_move_cursor(&self, step: MovementStep, direction: i32) -> bool; 902 connect_row_activated<F: Fn(&Self, &TreePath, &TreeViewColumn) + 'static>( &self, f: F, ) -> SignalHandlerId903 fn connect_row_activated<F: Fn(&Self, &TreePath, &TreeViewColumn) + 'static>( 904 &self, 905 f: F, 906 ) -> SignalHandlerId; 907 emit_row_activated(&self, path: &TreePath, column: &TreeViewColumn)908 fn emit_row_activated(&self, path: &TreePath, column: &TreeViewColumn); 909 connect_row_collapsed<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( &self, f: F, ) -> SignalHandlerId910 fn connect_row_collapsed<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( 911 &self, 912 f: F, 913 ) -> SignalHandlerId; 914 connect_row_expanded<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( &self, f: F, ) -> SignalHandlerId915 fn connect_row_expanded<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( 916 &self, 917 f: F, 918 ) -> SignalHandlerId; 919 connect_select_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId920 fn connect_select_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId; 921 emit_select_all(&self) -> bool922 fn emit_select_all(&self) -> bool; 923 connect_select_cursor_parent<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId924 fn connect_select_cursor_parent<F: Fn(&Self) -> bool + 'static>(&self, f: F) 925 -> SignalHandlerId; 926 emit_select_cursor_parent(&self) -> bool927 fn emit_select_cursor_parent(&self) -> bool; 928 connect_select_cursor_row<F: Fn(&Self, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId929 fn connect_select_cursor_row<F: Fn(&Self, bool) -> bool + 'static>( 930 &self, 931 f: F, 932 ) -> SignalHandlerId; 933 emit_select_cursor_row(&self, object: bool) -> bool934 fn emit_select_cursor_row(&self, object: bool) -> bool; 935 connect_start_interactive_search<F: Fn(&Self) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId936 fn connect_start_interactive_search<F: Fn(&Self) -> bool + 'static>( 937 &self, 938 f: F, 939 ) -> SignalHandlerId; 940 emit_start_interactive_search(&self) -> bool941 fn emit_start_interactive_search(&self) -> bool; 942 connect_test_collapse_row< F: Fn(&Self, &TreeIter, &TreePath) -> glib::signal::Inhibit + 'static, >( &self, f: F, ) -> SignalHandlerId943 fn connect_test_collapse_row< 944 F: Fn(&Self, &TreeIter, &TreePath) -> glib::signal::Inhibit + 'static, 945 >( 946 &self, 947 f: F, 948 ) -> SignalHandlerId; 949 connect_test_expand_row< F: Fn(&Self, &TreeIter, &TreePath) -> glib::signal::Inhibit + 'static, >( &self, f: F, ) -> SignalHandlerId950 fn connect_test_expand_row< 951 F: Fn(&Self, &TreeIter, &TreePath) -> glib::signal::Inhibit + 'static, 952 >( 953 &self, 954 f: F, 955 ) -> SignalHandlerId; 956 connect_toggle_cursor_row<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId957 fn connect_toggle_cursor_row<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId; 958 emit_toggle_cursor_row(&self) -> bool959 fn emit_toggle_cursor_row(&self) -> bool; 960 connect_unselect_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId961 fn connect_unselect_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId; 962 emit_unselect_all(&self) -> bool963 fn emit_unselect_all(&self) -> bool; 964 connect_property_activate_on_single_click_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId965 fn connect_property_activate_on_single_click_notify<F: Fn(&Self) + 'static>( 966 &self, 967 f: F, 968 ) -> SignalHandlerId; 969 connect_property_enable_grid_lines_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId970 fn connect_property_enable_grid_lines_notify<F: Fn(&Self) + 'static>( 971 &self, 972 f: F, 973 ) -> SignalHandlerId; 974 connect_property_enable_search_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId975 fn connect_property_enable_search_notify<F: Fn(&Self) + 'static>( 976 &self, 977 f: F, 978 ) -> SignalHandlerId; 979 connect_property_enable_tree_lines_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId980 fn connect_property_enable_tree_lines_notify<F: Fn(&Self) + 'static>( 981 &self, 982 f: F, 983 ) -> SignalHandlerId; 984 connect_property_expander_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId985 fn connect_property_expander_column_notify<F: Fn(&Self) + 'static>( 986 &self, 987 f: F, 988 ) -> SignalHandlerId; 989 connect_property_fixed_height_mode_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId990 fn connect_property_fixed_height_mode_notify<F: Fn(&Self) + 'static>( 991 &self, 992 f: F, 993 ) -> SignalHandlerId; 994 connect_property_headers_clickable_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId995 fn connect_property_headers_clickable_notify<F: Fn(&Self) + 'static>( 996 &self, 997 f: F, 998 ) -> SignalHandlerId; 999 connect_property_headers_visible_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1000 fn connect_property_headers_visible_notify<F: Fn(&Self) + 'static>( 1001 &self, 1002 f: F, 1003 ) -> SignalHandlerId; 1004 connect_property_hover_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1005 fn connect_property_hover_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) 1006 -> SignalHandlerId; 1007 connect_property_hover_selection_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1008 fn connect_property_hover_selection_notify<F: Fn(&Self) + 'static>( 1009 &self, 1010 f: F, 1011 ) -> SignalHandlerId; 1012 connect_property_level_indentation_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1013 fn connect_property_level_indentation_notify<F: Fn(&Self) + 'static>( 1014 &self, 1015 f: F, 1016 ) -> SignalHandlerId; 1017 connect_property_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1018 fn connect_property_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1019 connect_property_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1020 fn connect_property_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 1021 connect_property_rubber_banding_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1022 fn connect_property_rubber_banding_notify<F: Fn(&Self) + 'static>( 1023 &self, 1024 f: F, 1025 ) -> SignalHandlerId; 1026 connect_property_search_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1027 fn connect_property_search_column_notify<F: Fn(&Self) + 'static>( 1028 &self, 1029 f: F, 1030 ) -> SignalHandlerId; 1031 connect_property_show_expanders_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1032 fn connect_property_show_expanders_notify<F: Fn(&Self) + 'static>( 1033 &self, 1034 f: F, 1035 ) -> SignalHandlerId; 1036 connect_property_tooltip_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1037 fn connect_property_tooltip_column_notify<F: Fn(&Self) + 'static>( 1038 &self, 1039 f: F, 1040 ) -> SignalHandlerId; 1041 connect_property_ubuntu_almost_fixed_height_mode_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1042 fn connect_property_ubuntu_almost_fixed_height_mode_notify<F: Fn(&Self) + 'static>( 1043 &self, 1044 f: F, 1045 ) -> SignalHandlerId; 1046 } 1047 1048 impl<O: IsA<TreeView>> TreeViewExt for O { append_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i321049 fn append_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i32 { 1050 unsafe { 1051 gtk_sys::gtk_tree_view_append_column( 1052 self.as_ref().to_glib_none().0, 1053 column.as_ref().to_glib_none().0, 1054 ) 1055 } 1056 } 1057 collapse_all(&self)1058 fn collapse_all(&self) { 1059 unsafe { 1060 gtk_sys::gtk_tree_view_collapse_all(self.as_ref().to_glib_none().0); 1061 } 1062 } 1063 collapse_row(&self, path: &TreePath) -> bool1064 fn collapse_row(&self, path: &TreePath) -> bool { 1065 unsafe { 1066 from_glib(gtk_sys::gtk_tree_view_collapse_row( 1067 self.as_ref().to_glib_none().0, 1068 mut_override(path.to_glib_none().0), 1069 )) 1070 } 1071 } 1072 columns_autosize(&self)1073 fn columns_autosize(&self) { 1074 unsafe { 1075 gtk_sys::gtk_tree_view_columns_autosize(self.as_ref().to_glib_none().0); 1076 } 1077 } 1078 convert_bin_window_to_tree_coords(&self, bx: i32, by: i32) -> (i32, i32)1079 fn convert_bin_window_to_tree_coords(&self, bx: i32, by: i32) -> (i32, i32) { 1080 unsafe { 1081 let mut tx = mem::MaybeUninit::uninit(); 1082 let mut ty = mem::MaybeUninit::uninit(); 1083 gtk_sys::gtk_tree_view_convert_bin_window_to_tree_coords( 1084 self.as_ref().to_glib_none().0, 1085 bx, 1086 by, 1087 tx.as_mut_ptr(), 1088 ty.as_mut_ptr(), 1089 ); 1090 let tx = tx.assume_init(); 1091 let ty = ty.assume_init(); 1092 (tx, ty) 1093 } 1094 } 1095 convert_bin_window_to_widget_coords(&self, bx: i32, by: i32) -> (i32, i32)1096 fn convert_bin_window_to_widget_coords(&self, bx: i32, by: i32) -> (i32, i32) { 1097 unsafe { 1098 let mut wx = mem::MaybeUninit::uninit(); 1099 let mut wy = mem::MaybeUninit::uninit(); 1100 gtk_sys::gtk_tree_view_convert_bin_window_to_widget_coords( 1101 self.as_ref().to_glib_none().0, 1102 bx, 1103 by, 1104 wx.as_mut_ptr(), 1105 wy.as_mut_ptr(), 1106 ); 1107 let wx = wx.assume_init(); 1108 let wy = wy.assume_init(); 1109 (wx, wy) 1110 } 1111 } 1112 convert_tree_to_bin_window_coords(&self, tx: i32, ty: i32) -> (i32, i32)1113 fn convert_tree_to_bin_window_coords(&self, tx: i32, ty: i32) -> (i32, i32) { 1114 unsafe { 1115 let mut bx = mem::MaybeUninit::uninit(); 1116 let mut by = mem::MaybeUninit::uninit(); 1117 gtk_sys::gtk_tree_view_convert_tree_to_bin_window_coords( 1118 self.as_ref().to_glib_none().0, 1119 tx, 1120 ty, 1121 bx.as_mut_ptr(), 1122 by.as_mut_ptr(), 1123 ); 1124 let bx = bx.assume_init(); 1125 let by = by.assume_init(); 1126 (bx, by) 1127 } 1128 } 1129 convert_tree_to_widget_coords(&self, tx: i32, ty: i32) -> (i32, i32)1130 fn convert_tree_to_widget_coords(&self, tx: i32, ty: i32) -> (i32, i32) { 1131 unsafe { 1132 let mut wx = mem::MaybeUninit::uninit(); 1133 let mut wy = mem::MaybeUninit::uninit(); 1134 gtk_sys::gtk_tree_view_convert_tree_to_widget_coords( 1135 self.as_ref().to_glib_none().0, 1136 tx, 1137 ty, 1138 wx.as_mut_ptr(), 1139 wy.as_mut_ptr(), 1140 ); 1141 let wx = wx.assume_init(); 1142 let wy = wy.assume_init(); 1143 (wx, wy) 1144 } 1145 } 1146 convert_widget_to_bin_window_coords(&self, wx: i32, wy: i32) -> (i32, i32)1147 fn convert_widget_to_bin_window_coords(&self, wx: i32, wy: i32) -> (i32, i32) { 1148 unsafe { 1149 let mut bx = mem::MaybeUninit::uninit(); 1150 let mut by = mem::MaybeUninit::uninit(); 1151 gtk_sys::gtk_tree_view_convert_widget_to_bin_window_coords( 1152 self.as_ref().to_glib_none().0, 1153 wx, 1154 wy, 1155 bx.as_mut_ptr(), 1156 by.as_mut_ptr(), 1157 ); 1158 let bx = bx.assume_init(); 1159 let by = by.assume_init(); 1160 (bx, by) 1161 } 1162 } 1163 convert_widget_to_tree_coords(&self, wx: i32, wy: i32) -> (i32, i32)1164 fn convert_widget_to_tree_coords(&self, wx: i32, wy: i32) -> (i32, i32) { 1165 unsafe { 1166 let mut tx = mem::MaybeUninit::uninit(); 1167 let mut ty = mem::MaybeUninit::uninit(); 1168 gtk_sys::gtk_tree_view_convert_widget_to_tree_coords( 1169 self.as_ref().to_glib_none().0, 1170 wx, 1171 wy, 1172 tx.as_mut_ptr(), 1173 ty.as_mut_ptr(), 1174 ); 1175 let tx = tx.assume_init(); 1176 let ty = ty.assume_init(); 1177 (tx, ty) 1178 } 1179 } 1180 create_row_drag_icon(&self, path: &TreePath) -> Option<cairo::Surface>1181 fn create_row_drag_icon(&self, path: &TreePath) -> Option<cairo::Surface> { 1182 unsafe { 1183 from_glib_full(gtk_sys::gtk_tree_view_create_row_drag_icon( 1184 self.as_ref().to_glib_none().0, 1185 mut_override(path.to_glib_none().0), 1186 )) 1187 } 1188 } 1189 expand_all(&self)1190 fn expand_all(&self) { 1191 unsafe { 1192 gtk_sys::gtk_tree_view_expand_all(self.as_ref().to_glib_none().0); 1193 } 1194 } 1195 expand_row(&self, path: &TreePath, open_all: bool) -> bool1196 fn expand_row(&self, path: &TreePath, open_all: bool) -> bool { 1197 unsafe { 1198 from_glib(gtk_sys::gtk_tree_view_expand_row( 1199 self.as_ref().to_glib_none().0, 1200 mut_override(path.to_glib_none().0), 1201 open_all.to_glib(), 1202 )) 1203 } 1204 } 1205 expand_to_path(&self, path: &TreePath)1206 fn expand_to_path(&self, path: &TreePath) { 1207 unsafe { 1208 gtk_sys::gtk_tree_view_expand_to_path( 1209 self.as_ref().to_glib_none().0, 1210 mut_override(path.to_glib_none().0), 1211 ); 1212 } 1213 } 1214 get_activate_on_single_click(&self) -> bool1215 fn get_activate_on_single_click(&self) -> bool { 1216 unsafe { 1217 from_glib(gtk_sys::gtk_tree_view_get_activate_on_single_click( 1218 self.as_ref().to_glib_none().0, 1219 )) 1220 } 1221 } 1222 get_background_area<P: IsA<TreeViewColumn>>( &self, path: Option<&TreePath>, column: Option<&P>, ) -> gdk::Rectangle1223 fn get_background_area<P: IsA<TreeViewColumn>>( 1224 &self, 1225 path: Option<&TreePath>, 1226 column: Option<&P>, 1227 ) -> gdk::Rectangle { 1228 unsafe { 1229 let mut rect = gdk::Rectangle::uninitialized(); 1230 gtk_sys::gtk_tree_view_get_background_area( 1231 self.as_ref().to_glib_none().0, 1232 mut_override(path.to_glib_none().0), 1233 column.map(|p| p.as_ref()).to_glib_none().0, 1234 rect.to_glib_none_mut().0, 1235 ); 1236 rect 1237 } 1238 } 1239 get_bin_window(&self) -> Option<gdk::Window>1240 fn get_bin_window(&self) -> Option<gdk::Window> { 1241 unsafe { 1242 from_glib_none(gtk_sys::gtk_tree_view_get_bin_window( 1243 self.as_ref().to_glib_none().0, 1244 )) 1245 } 1246 } 1247 get_cell_area<P: IsA<TreeViewColumn>>( &self, path: Option<&TreePath>, column: Option<&P>, ) -> gdk::Rectangle1248 fn get_cell_area<P: IsA<TreeViewColumn>>( 1249 &self, 1250 path: Option<&TreePath>, 1251 column: Option<&P>, 1252 ) -> gdk::Rectangle { 1253 unsafe { 1254 let mut rect = gdk::Rectangle::uninitialized(); 1255 gtk_sys::gtk_tree_view_get_cell_area( 1256 self.as_ref().to_glib_none().0, 1257 mut_override(path.to_glib_none().0), 1258 column.map(|p| p.as_ref()).to_glib_none().0, 1259 rect.to_glib_none_mut().0, 1260 ); 1261 rect 1262 } 1263 } 1264 get_column(&self, n: i32) -> Option<TreeViewColumn>1265 fn get_column(&self, n: i32) -> Option<TreeViewColumn> { 1266 unsafe { 1267 from_glib_none(gtk_sys::gtk_tree_view_get_column( 1268 self.as_ref().to_glib_none().0, 1269 n, 1270 )) 1271 } 1272 } 1273 get_columns(&self) -> Vec<TreeViewColumn>1274 fn get_columns(&self) -> Vec<TreeViewColumn> { 1275 unsafe { 1276 FromGlibPtrContainer::from_glib_container(gtk_sys::gtk_tree_view_get_columns( 1277 self.as_ref().to_glib_none().0, 1278 )) 1279 } 1280 } 1281 get_cursor(&self) -> (Option<TreePath>, Option<TreeViewColumn>)1282 fn get_cursor(&self) -> (Option<TreePath>, Option<TreeViewColumn>) { 1283 unsafe { 1284 let mut path = ptr::null_mut(); 1285 let mut focus_column = ptr::null_mut(); 1286 gtk_sys::gtk_tree_view_get_cursor( 1287 self.as_ref().to_glib_none().0, 1288 &mut path, 1289 &mut focus_column, 1290 ); 1291 (from_glib_full(path), from_glib_none(focus_column)) 1292 } 1293 } 1294 get_dest_row_at_pos( &self, drag_x: i32, drag_y: i32, ) -> Option<(Option<TreePath>, TreeViewDropPosition)>1295 fn get_dest_row_at_pos( 1296 &self, 1297 drag_x: i32, 1298 drag_y: i32, 1299 ) -> Option<(Option<TreePath>, TreeViewDropPosition)> { 1300 unsafe { 1301 let mut path = ptr::null_mut(); 1302 let mut pos = mem::MaybeUninit::uninit(); 1303 let ret = from_glib(gtk_sys::gtk_tree_view_get_dest_row_at_pos( 1304 self.as_ref().to_glib_none().0, 1305 drag_x, 1306 drag_y, 1307 &mut path, 1308 pos.as_mut_ptr(), 1309 )); 1310 let pos = pos.assume_init(); 1311 if ret { 1312 Some((from_glib_full(path), from_glib(pos))) 1313 } else { 1314 None 1315 } 1316 } 1317 } 1318 get_drag_dest_row(&self) -> (Option<TreePath>, TreeViewDropPosition)1319 fn get_drag_dest_row(&self) -> (Option<TreePath>, TreeViewDropPosition) { 1320 unsafe { 1321 let mut path = ptr::null_mut(); 1322 let mut pos = mem::MaybeUninit::uninit(); 1323 gtk_sys::gtk_tree_view_get_drag_dest_row( 1324 self.as_ref().to_glib_none().0, 1325 &mut path, 1326 pos.as_mut_ptr(), 1327 ); 1328 let pos = pos.assume_init(); 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::MaybeUninit::uninit(); 1430 let mut cell_y = mem::MaybeUninit::uninit(); 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 cell_x.as_mut_ptr(), 1438 cell_y.as_mut_ptr(), 1439 )); 1440 let cell_x = cell_x.assume_init(); 1441 let cell_y = cell_y.assume_init(); 1442 if ret { 1443 Some((from_glib_full(path), from_glib_none(column), cell_x, cell_y)) 1444 } else { 1445 None 1446 } 1447 } 1448 } 1449 get_reorderable(&self) -> bool1450 fn get_reorderable(&self) -> bool { 1451 unsafe { 1452 from_glib(gtk_sys::gtk_tree_view_get_reorderable( 1453 self.as_ref().to_glib_none().0, 1454 )) 1455 } 1456 } 1457 1458 //fn get_row_separator_func(&self) -> Option<Box_<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>> { 1459 // unsafe { TODO: call gtk_sys:gtk_tree_view_get_row_separator_func() } 1460 //} 1461 get_rubber_banding(&self) -> bool1462 fn get_rubber_banding(&self) -> bool { 1463 unsafe { 1464 from_glib(gtk_sys::gtk_tree_view_get_rubber_banding( 1465 self.as_ref().to_glib_none().0, 1466 )) 1467 } 1468 } 1469 get_search_column(&self) -> i321470 fn get_search_column(&self) -> i32 { 1471 unsafe { gtk_sys::gtk_tree_view_get_search_column(self.as_ref().to_glib_none().0) } 1472 } 1473 get_search_entry(&self) -> Option<Entry>1474 fn get_search_entry(&self) -> Option<Entry> { 1475 unsafe { 1476 from_glib_none(gtk_sys::gtk_tree_view_get_search_entry( 1477 self.as_ref().to_glib_none().0, 1478 )) 1479 } 1480 } 1481 1482 //fn get_search_equal_func(&self) -> Option<Box_<dyn Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static>> { 1483 // unsafe { TODO: call gtk_sys:gtk_tree_view_get_search_equal_func() } 1484 //} 1485 1486 //fn get_search_position_func(&self) -> Option<Box_<dyn Fn(&TreeView, &Widget) + 'static>> { 1487 // unsafe { TODO: call gtk_sys:gtk_tree_view_get_search_position_func() } 1488 //} 1489 get_selection(&self) -> TreeSelection1490 fn get_selection(&self) -> TreeSelection { 1491 unsafe { 1492 from_glib_none(gtk_sys::gtk_tree_view_get_selection( 1493 self.as_ref().to_glib_none().0, 1494 )) 1495 } 1496 } 1497 get_show_expanders(&self) -> bool1498 fn get_show_expanders(&self) -> bool { 1499 unsafe { 1500 from_glib(gtk_sys::gtk_tree_view_get_show_expanders( 1501 self.as_ref().to_glib_none().0, 1502 )) 1503 } 1504 } 1505 get_tooltip_column(&self) -> i321506 fn get_tooltip_column(&self) -> i32 { 1507 unsafe { gtk_sys::gtk_tree_view_get_tooltip_column(self.as_ref().to_glib_none().0) } 1508 } 1509 get_tooltip_context( &self, x: &mut i32, y: &mut i32, keyboard_tip: bool, ) -> Option<(Option<TreeModel>, TreePath, TreeIter)>1510 fn get_tooltip_context( 1511 &self, 1512 x: &mut i32, 1513 y: &mut i32, 1514 keyboard_tip: bool, 1515 ) -> Option<(Option<TreeModel>, TreePath, TreeIter)> { 1516 unsafe { 1517 let mut model = ptr::null_mut(); 1518 let mut path = ptr::null_mut(); 1519 let mut iter = TreeIter::uninitialized(); 1520 let ret = from_glib(gtk_sys::gtk_tree_view_get_tooltip_context( 1521 self.as_ref().to_glib_none().0, 1522 x, 1523 y, 1524 keyboard_tip.to_glib(), 1525 &mut model, 1526 &mut path, 1527 iter.to_glib_none_mut().0, 1528 )); 1529 if ret { 1530 Some((from_glib_none(model), from_glib_full(path), iter)) 1531 } else { 1532 None 1533 } 1534 } 1535 } 1536 get_visible_range(&self) -> Option<(TreePath, TreePath)>1537 fn get_visible_range(&self) -> Option<(TreePath, TreePath)> { 1538 unsafe { 1539 let mut start_path = ptr::null_mut(); 1540 let mut end_path = ptr::null_mut(); 1541 let ret = from_glib(gtk_sys::gtk_tree_view_get_visible_range( 1542 self.as_ref().to_glib_none().0, 1543 &mut start_path, 1544 &mut end_path, 1545 )); 1546 if ret { 1547 Some((from_glib_full(start_path), from_glib_full(end_path))) 1548 } else { 1549 None 1550 } 1551 } 1552 } 1553 get_visible_rect(&self) -> gdk::Rectangle1554 fn get_visible_rect(&self) -> gdk::Rectangle { 1555 unsafe { 1556 let mut visible_rect = gdk::Rectangle::uninitialized(); 1557 gtk_sys::gtk_tree_view_get_visible_rect( 1558 self.as_ref().to_glib_none().0, 1559 visible_rect.to_glib_none_mut().0, 1560 ); 1561 visible_rect 1562 } 1563 } 1564 insert_column<P: IsA<TreeViewColumn>>(&self, column: &P, position: i32) -> i321565 fn insert_column<P: IsA<TreeViewColumn>>(&self, column: &P, position: i32) -> i32 { 1566 unsafe { 1567 gtk_sys::gtk_tree_view_insert_column( 1568 self.as_ref().to_glib_none().0, 1569 column.as_ref().to_glib_none().0, 1570 position, 1571 ) 1572 } 1573 } 1574 1575 //fn insert_column_with_attributes<P: IsA<CellRenderer>>(&self, position: i32, title: &str, cell: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> i32 { 1576 // unsafe { TODO: call gtk_sys:gtk_tree_view_insert_column_with_attributes() } 1577 //} 1578 insert_column_with_data_func< P: IsA<CellRenderer>, Q: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static, >( &self, position: i32, title: &str, cell: &P, func: Q, ) -> i321579 fn insert_column_with_data_func< 1580 P: IsA<CellRenderer>, 1581 Q: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static, 1582 >( 1583 &self, 1584 position: i32, 1585 title: &str, 1586 cell: &P, 1587 func: Q, 1588 ) -> i32 { 1589 let func_data: Box_<Q> = Box_::new(func); 1590 unsafe extern "C" fn func_func< 1591 P: IsA<CellRenderer>, 1592 Q: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static, 1593 >( 1594 tree_column: *mut gtk_sys::GtkTreeViewColumn, 1595 cell: *mut gtk_sys::GtkCellRenderer, 1596 tree_model: *mut gtk_sys::GtkTreeModel, 1597 iter: *mut gtk_sys::GtkTreeIter, 1598 data: glib_sys::gpointer, 1599 ) { 1600 let tree_column = from_glib_borrow(tree_column); 1601 let cell = from_glib_borrow(cell); 1602 let tree_model = from_glib_borrow(tree_model); 1603 let iter = from_glib_borrow(iter); 1604 let callback: &Q = &*(data as *mut _); 1605 (*callback)(&tree_column, &cell, &tree_model, &iter); 1606 } 1607 let func = Some(func_func::<P, Q> as _); 1608 unsafe extern "C" fn dnotify_func< 1609 P: IsA<CellRenderer>, 1610 Q: Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static, 1611 >( 1612 data: glib_sys::gpointer, 1613 ) { 1614 let _callback: Box_<Q> = Box_::from_raw(data as *mut _); 1615 } 1616 let destroy_call6 = Some(dnotify_func::<P, Q> as _); 1617 let super_callback0: Box_<Q> = func_data; 1618 unsafe { 1619 gtk_sys::gtk_tree_view_insert_column_with_data_func( 1620 self.as_ref().to_glib_none().0, 1621 position, 1622 title.to_glib_none().0, 1623 cell.as_ref().to_glib_none().0, 1624 func, 1625 Box_::into_raw(super_callback0) as *mut _, 1626 destroy_call6, 1627 ) 1628 } 1629 } 1630 is_blank_at_pos( &self, x: i32, y: i32, ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)>1631 fn is_blank_at_pos( 1632 &self, 1633 x: i32, 1634 y: i32, 1635 ) -> Option<(Option<TreePath>, Option<TreeViewColumn>, i32, i32)> { 1636 unsafe { 1637 let mut path = ptr::null_mut(); 1638 let mut column = ptr::null_mut(); 1639 let mut cell_x = mem::MaybeUninit::uninit(); 1640 let mut cell_y = mem::MaybeUninit::uninit(); 1641 let ret = from_glib(gtk_sys::gtk_tree_view_is_blank_at_pos( 1642 self.as_ref().to_glib_none().0, 1643 x, 1644 y, 1645 &mut path, 1646 &mut column, 1647 cell_x.as_mut_ptr(), 1648 cell_y.as_mut_ptr(), 1649 )); 1650 let cell_x = cell_x.assume_init(); 1651 let cell_y = cell_y.assume_init(); 1652 if ret { 1653 Some((from_glib_full(path), from_glib_none(column), cell_x, cell_y)) 1654 } else { 1655 None 1656 } 1657 } 1658 } 1659 is_rubber_banding_active(&self) -> bool1660 fn is_rubber_banding_active(&self) -> bool { 1661 unsafe { 1662 from_glib(gtk_sys::gtk_tree_view_is_rubber_banding_active( 1663 self.as_ref().to_glib_none().0, 1664 )) 1665 } 1666 } 1667 map_expanded_rows<P: FnMut(&TreeView, &TreePath)>(&self, func: P)1668 fn map_expanded_rows<P: FnMut(&TreeView, &TreePath)>(&self, func: P) { 1669 let func_data: P = func; 1670 unsafe extern "C" fn func_func<P: FnMut(&TreeView, &TreePath)>( 1671 tree_view: *mut gtk_sys::GtkTreeView, 1672 path: *mut gtk_sys::GtkTreePath, 1673 user_data: glib_sys::gpointer, 1674 ) { 1675 let tree_view = from_glib_borrow(tree_view); 1676 let path = from_glib_borrow(path); 1677 let callback: *mut P = user_data as *const _ as usize as *mut P; 1678 (*callback)(&tree_view, &path); 1679 } 1680 let func = Some(func_func::<P> as _); 1681 let super_callback0: &P = &func_data; 1682 unsafe { 1683 gtk_sys::gtk_tree_view_map_expanded_rows( 1684 self.as_ref().to_glib_none().0, 1685 func, 1686 super_callback0 as *const _ as usize as *mut _, 1687 ); 1688 } 1689 } 1690 move_column_after<P: IsA<TreeViewColumn>, Q: IsA<TreeViewColumn>>( &self, column: &P, base_column: Option<&Q>, )1691 fn move_column_after<P: IsA<TreeViewColumn>, Q: IsA<TreeViewColumn>>( 1692 &self, 1693 column: &P, 1694 base_column: Option<&Q>, 1695 ) { 1696 unsafe { 1697 gtk_sys::gtk_tree_view_move_column_after( 1698 self.as_ref().to_glib_none().0, 1699 column.as_ref().to_glib_none().0, 1700 base_column.map(|p| p.as_ref()).to_glib_none().0, 1701 ); 1702 } 1703 } 1704 remove_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i321705 fn remove_column<P: IsA<TreeViewColumn>>(&self, column: &P) -> i32 { 1706 unsafe { 1707 gtk_sys::gtk_tree_view_remove_column( 1708 self.as_ref().to_glib_none().0, 1709 column.as_ref().to_glib_none().0, 1710 ) 1711 } 1712 } 1713 row_activated<P: IsA<TreeViewColumn>>(&self, path: &TreePath, column: &P)1714 fn row_activated<P: IsA<TreeViewColumn>>(&self, path: &TreePath, column: &P) { 1715 unsafe { 1716 gtk_sys::gtk_tree_view_row_activated( 1717 self.as_ref().to_glib_none().0, 1718 mut_override(path.to_glib_none().0), 1719 column.as_ref().to_glib_none().0, 1720 ); 1721 } 1722 } 1723 row_expanded(&self, path: &TreePath) -> bool1724 fn row_expanded(&self, path: &TreePath) -> bool { 1725 unsafe { 1726 from_glib(gtk_sys::gtk_tree_view_row_expanded( 1727 self.as_ref().to_glib_none().0, 1728 mut_override(path.to_glib_none().0), 1729 )) 1730 } 1731 } 1732 scroll_to_cell<P: IsA<TreeViewColumn>>( &self, path: Option<&TreePath>, column: Option<&P>, use_align: bool, row_align: f32, col_align: f32, )1733 fn scroll_to_cell<P: IsA<TreeViewColumn>>( 1734 &self, 1735 path: Option<&TreePath>, 1736 column: Option<&P>, 1737 use_align: bool, 1738 row_align: f32, 1739 col_align: f32, 1740 ) { 1741 unsafe { 1742 gtk_sys::gtk_tree_view_scroll_to_cell( 1743 self.as_ref().to_glib_none().0, 1744 mut_override(path.to_glib_none().0), 1745 column.map(|p| p.as_ref()).to_glib_none().0, 1746 use_align.to_glib(), 1747 row_align, 1748 col_align, 1749 ); 1750 } 1751 } 1752 scroll_to_point(&self, tree_x: i32, tree_y: i32)1753 fn scroll_to_point(&self, tree_x: i32, tree_y: i32) { 1754 unsafe { 1755 gtk_sys::gtk_tree_view_scroll_to_point(self.as_ref().to_glib_none().0, tree_x, tree_y); 1756 } 1757 } 1758 set_activate_on_single_click(&self, single: bool)1759 fn set_activate_on_single_click(&self, single: bool) { 1760 unsafe { 1761 gtk_sys::gtk_tree_view_set_activate_on_single_click( 1762 self.as_ref().to_glib_none().0, 1763 single.to_glib(), 1764 ); 1765 } 1766 } 1767 set_column_drag_function( &self, func: Option< Box_< dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool + 'static, >, >, )1768 fn set_column_drag_function( 1769 &self, 1770 func: Option< 1771 Box_< 1772 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool 1773 + 'static, 1774 >, 1775 >, 1776 ) { 1777 let func_data: Box_< 1778 Option< 1779 Box_< 1780 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool 1781 + 'static, 1782 >, 1783 >, 1784 > = Box_::new(func); 1785 unsafe extern "C" fn func_func( 1786 tree_view: *mut gtk_sys::GtkTreeView, 1787 column: *mut gtk_sys::GtkTreeViewColumn, 1788 prev_column: *mut gtk_sys::GtkTreeViewColumn, 1789 next_column: *mut gtk_sys::GtkTreeViewColumn, 1790 data: glib_sys::gpointer, 1791 ) -> glib_sys::gboolean { 1792 let tree_view = from_glib_borrow(tree_view); 1793 let column = from_glib_borrow(column); 1794 let prev_column = from_glib_borrow(prev_column); 1795 let next_column = from_glib_borrow(next_column); 1796 let callback: &Option< 1797 Box_< 1798 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool 1799 + 'static, 1800 >, 1801 > = &*(data as *mut _); 1802 let res = if let Some(ref callback) = *callback { 1803 callback(&tree_view, &column, &prev_column, &next_column) 1804 } else { 1805 panic!("cannot get closure...") 1806 }; 1807 res.to_glib() 1808 } 1809 let func = if func_data.is_some() { 1810 Some(func_func as _) 1811 } else { 1812 None 1813 }; 1814 unsafe extern "C" fn destroy_func(data: glib_sys::gpointer) { 1815 let _callback: Box_< 1816 Option< 1817 Box_< 1818 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool 1819 + 'static, 1820 >, 1821 >, 1822 > = Box_::from_raw(data as *mut _); 1823 } 1824 let destroy_call3 = Some(destroy_func as _); 1825 let super_callback0: Box_< 1826 Option< 1827 Box_< 1828 dyn Fn(&TreeView, &TreeViewColumn, &TreeViewColumn, &TreeViewColumn) -> bool 1829 + 'static, 1830 >, 1831 >, 1832 > = func_data; 1833 unsafe { 1834 gtk_sys::gtk_tree_view_set_column_drag_function( 1835 self.as_ref().to_glib_none().0, 1836 func, 1837 Box_::into_raw(super_callback0) as *mut _, 1838 destroy_call3, 1839 ); 1840 } 1841 } 1842 set_cursor<P: IsA<TreeViewColumn>>( &self, path: &TreePath, focus_column: Option<&P>, start_editing: bool, )1843 fn set_cursor<P: IsA<TreeViewColumn>>( 1844 &self, 1845 path: &TreePath, 1846 focus_column: Option<&P>, 1847 start_editing: bool, 1848 ) { 1849 unsafe { 1850 gtk_sys::gtk_tree_view_set_cursor( 1851 self.as_ref().to_glib_none().0, 1852 mut_override(path.to_glib_none().0), 1853 focus_column.map(|p| p.as_ref()).to_glib_none().0, 1854 start_editing.to_glib(), 1855 ); 1856 } 1857 } 1858 set_cursor_on_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( &self, path: &TreePath, focus_column: Option<&P>, focus_cell: Option<&Q>, start_editing: bool, )1859 fn set_cursor_on_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( 1860 &self, 1861 path: &TreePath, 1862 focus_column: Option<&P>, 1863 focus_cell: Option<&Q>, 1864 start_editing: bool, 1865 ) { 1866 unsafe { 1867 gtk_sys::gtk_tree_view_set_cursor_on_cell( 1868 self.as_ref().to_glib_none().0, 1869 mut_override(path.to_glib_none().0), 1870 focus_column.map(|p| p.as_ref()).to_glib_none().0, 1871 focus_cell.map(|p| p.as_ref()).to_glib_none().0, 1872 start_editing.to_glib(), 1873 ); 1874 } 1875 } 1876 set_drag_dest_row(&self, path: Option<&TreePath>, pos: TreeViewDropPosition)1877 fn set_drag_dest_row(&self, path: Option<&TreePath>, pos: TreeViewDropPosition) { 1878 unsafe { 1879 gtk_sys::gtk_tree_view_set_drag_dest_row( 1880 self.as_ref().to_glib_none().0, 1881 mut_override(path.to_glib_none().0), 1882 pos.to_glib(), 1883 ); 1884 } 1885 } 1886 set_enable_search(&self, enable_search: bool)1887 fn set_enable_search(&self, enable_search: bool) { 1888 unsafe { 1889 gtk_sys::gtk_tree_view_set_enable_search( 1890 self.as_ref().to_glib_none().0, 1891 enable_search.to_glib(), 1892 ); 1893 } 1894 } 1895 set_enable_tree_lines(&self, enabled: bool)1896 fn set_enable_tree_lines(&self, enabled: bool) { 1897 unsafe { 1898 gtk_sys::gtk_tree_view_set_enable_tree_lines( 1899 self.as_ref().to_glib_none().0, 1900 enabled.to_glib(), 1901 ); 1902 } 1903 } 1904 set_expander_column<P: IsA<TreeViewColumn>>(&self, column: Option<&P>)1905 fn set_expander_column<P: IsA<TreeViewColumn>>(&self, column: Option<&P>) { 1906 unsafe { 1907 gtk_sys::gtk_tree_view_set_expander_column( 1908 self.as_ref().to_glib_none().0, 1909 column.map(|p| p.as_ref()).to_glib_none().0, 1910 ); 1911 } 1912 } 1913 set_fixed_height_mode(&self, enable: bool)1914 fn set_fixed_height_mode(&self, enable: bool) { 1915 unsafe { 1916 gtk_sys::gtk_tree_view_set_fixed_height_mode( 1917 self.as_ref().to_glib_none().0, 1918 enable.to_glib(), 1919 ); 1920 } 1921 } 1922 set_grid_lines(&self, grid_lines: TreeViewGridLines)1923 fn set_grid_lines(&self, grid_lines: TreeViewGridLines) { 1924 unsafe { 1925 gtk_sys::gtk_tree_view_set_grid_lines( 1926 self.as_ref().to_glib_none().0, 1927 grid_lines.to_glib(), 1928 ); 1929 } 1930 } 1931 set_headers_clickable(&self, setting: bool)1932 fn set_headers_clickable(&self, setting: bool) { 1933 unsafe { 1934 gtk_sys::gtk_tree_view_set_headers_clickable( 1935 self.as_ref().to_glib_none().0, 1936 setting.to_glib(), 1937 ); 1938 } 1939 } 1940 set_headers_visible(&self, headers_visible: bool)1941 fn set_headers_visible(&self, headers_visible: bool) { 1942 unsafe { 1943 gtk_sys::gtk_tree_view_set_headers_visible( 1944 self.as_ref().to_glib_none().0, 1945 headers_visible.to_glib(), 1946 ); 1947 } 1948 } 1949 set_hover_expand(&self, expand: bool)1950 fn set_hover_expand(&self, expand: bool) { 1951 unsafe { 1952 gtk_sys::gtk_tree_view_set_hover_expand( 1953 self.as_ref().to_glib_none().0, 1954 expand.to_glib(), 1955 ); 1956 } 1957 } 1958 set_hover_selection(&self, hover: bool)1959 fn set_hover_selection(&self, hover: bool) { 1960 unsafe { 1961 gtk_sys::gtk_tree_view_set_hover_selection( 1962 self.as_ref().to_glib_none().0, 1963 hover.to_glib(), 1964 ); 1965 } 1966 } 1967 set_level_indentation(&self, indentation: i32)1968 fn set_level_indentation(&self, indentation: i32) { 1969 unsafe { 1970 gtk_sys::gtk_tree_view_set_level_indentation( 1971 self.as_ref().to_glib_none().0, 1972 indentation, 1973 ); 1974 } 1975 } 1976 set_model<P: IsA<TreeModel>>(&self, model: Option<&P>)1977 fn set_model<P: IsA<TreeModel>>(&self, model: Option<&P>) { 1978 unsafe { 1979 gtk_sys::gtk_tree_view_set_model( 1980 self.as_ref().to_glib_none().0, 1981 model.map(|p| p.as_ref()).to_glib_none().0, 1982 ); 1983 } 1984 } 1985 set_reorderable(&self, reorderable: bool)1986 fn set_reorderable(&self, reorderable: bool) { 1987 unsafe { 1988 gtk_sys::gtk_tree_view_set_reorderable( 1989 self.as_ref().to_glib_none().0, 1990 reorderable.to_glib(), 1991 ); 1992 } 1993 } 1994 set_row_separator_func( &self, func: Option<Box_<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>, )1995 fn set_row_separator_func( 1996 &self, 1997 func: Option<Box_<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>, 1998 ) { 1999 let func_data: Box_<Option<Box_<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>> = 2000 Box_::new(func); 2001 unsafe extern "C" fn func_func( 2002 model: *mut gtk_sys::GtkTreeModel, 2003 iter: *mut gtk_sys::GtkTreeIter, 2004 data: glib_sys::gpointer, 2005 ) -> glib_sys::gboolean { 2006 let model = from_glib_borrow(model); 2007 let iter = from_glib_borrow(iter); 2008 let callback: &Option<Box_<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>> = 2009 &*(data as *mut _); 2010 let res = if let Some(ref callback) = *callback { 2011 callback(&model, &iter) 2012 } else { 2013 panic!("cannot get closure...") 2014 }; 2015 res.to_glib() 2016 } 2017 let func = if func_data.is_some() { 2018 Some(func_func as _) 2019 } else { 2020 None 2021 }; 2022 unsafe extern "C" fn destroy_func(data: glib_sys::gpointer) { 2023 let _callback: Box_<Option<Box_<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>> = 2024 Box_::from_raw(data as *mut _); 2025 } 2026 let destroy_call3 = Some(destroy_func as _); 2027 let super_callback0: Box_<Option<Box_<dyn Fn(&TreeModel, &TreeIter) -> bool + 'static>>> = 2028 func_data; 2029 unsafe { 2030 gtk_sys::gtk_tree_view_set_row_separator_func( 2031 self.as_ref().to_glib_none().0, 2032 func, 2033 Box_::into_raw(super_callback0) as *mut _, 2034 destroy_call3, 2035 ); 2036 } 2037 } 2038 set_rubber_banding(&self, enable: bool)2039 fn set_rubber_banding(&self, enable: bool) { 2040 unsafe { 2041 gtk_sys::gtk_tree_view_set_rubber_banding( 2042 self.as_ref().to_glib_none().0, 2043 enable.to_glib(), 2044 ); 2045 } 2046 } 2047 set_search_column(&self, column: i32)2048 fn set_search_column(&self, column: i32) { 2049 unsafe { 2050 gtk_sys::gtk_tree_view_set_search_column(self.as_ref().to_glib_none().0, column); 2051 } 2052 } 2053 set_search_entry<P: IsA<Entry>>(&self, entry: Option<&P>)2054 fn set_search_entry<P: IsA<Entry>>(&self, entry: Option<&P>) { 2055 unsafe { 2056 gtk_sys::gtk_tree_view_set_search_entry( 2057 self.as_ref().to_glib_none().0, 2058 entry.map(|p| p.as_ref()).to_glib_none().0, 2059 ); 2060 } 2061 } 2062 set_search_equal_func<P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static>( &self, search_equal_func: P, )2063 fn set_search_equal_func<P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static>( 2064 &self, 2065 search_equal_func: P, 2066 ) { 2067 let search_equal_func_data: Box_<P> = Box_::new(search_equal_func); 2068 unsafe extern "C" fn search_equal_func_func< 2069 P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static, 2070 >( 2071 model: *mut gtk_sys::GtkTreeModel, 2072 column: libc::c_int, 2073 key: *const libc::c_char, 2074 iter: *mut gtk_sys::GtkTreeIter, 2075 search_data: glib_sys::gpointer, 2076 ) -> glib_sys::gboolean { 2077 let model = from_glib_borrow(model); 2078 let key: GString = from_glib_borrow(key); 2079 let iter = from_glib_borrow(iter); 2080 let callback: &P = &*(search_data as *mut _); 2081 let res = (*callback)(&model, column, key.as_str(), &iter); 2082 res.to_glib() 2083 } 2084 let search_equal_func = Some(search_equal_func_func::<P> as _); 2085 unsafe extern "C" fn search_destroy_func< 2086 P: Fn(&TreeModel, i32, &str, &TreeIter) -> bool + 'static, 2087 >( 2088 data: glib_sys::gpointer, 2089 ) { 2090 let _callback: Box_<P> = Box_::from_raw(data as *mut _); 2091 } 2092 let destroy_call3 = Some(search_destroy_func::<P> as _); 2093 let super_callback0: Box_<P> = search_equal_func_data; 2094 unsafe { 2095 gtk_sys::gtk_tree_view_set_search_equal_func( 2096 self.as_ref().to_glib_none().0, 2097 search_equal_func, 2098 Box_::into_raw(super_callback0) as *mut _, 2099 destroy_call3, 2100 ); 2101 } 2102 } 2103 set_search_position_func(&self, func: Option<Box_<dyn Fn(&TreeView, &Widget) + 'static>>)2104 fn set_search_position_func(&self, func: Option<Box_<dyn Fn(&TreeView, &Widget) + 'static>>) { 2105 let func_data: Box_<Option<Box_<dyn Fn(&TreeView, &Widget) + 'static>>> = Box_::new(func); 2106 unsafe extern "C" fn func_func( 2107 tree_view: *mut gtk_sys::GtkTreeView, 2108 search_dialog: *mut gtk_sys::GtkWidget, 2109 user_data: glib_sys::gpointer, 2110 ) { 2111 let tree_view = from_glib_borrow(tree_view); 2112 let search_dialog = from_glib_borrow(search_dialog); 2113 let callback: &Option<Box_<dyn Fn(&TreeView, &Widget) + 'static>> = 2114 &*(user_data as *mut _); 2115 if let Some(ref callback) = *callback { 2116 callback(&tree_view, &search_dialog) 2117 } else { 2118 panic!("cannot get closure...") 2119 }; 2120 } 2121 let func = if func_data.is_some() { 2122 Some(func_func as _) 2123 } else { 2124 None 2125 }; 2126 unsafe extern "C" fn destroy_func(data: glib_sys::gpointer) { 2127 let _callback: Box_<Option<Box_<dyn Fn(&TreeView, &Widget) + 'static>>> = 2128 Box_::from_raw(data as *mut _); 2129 } 2130 let destroy_call3 = Some(destroy_func as _); 2131 let super_callback0: Box_<Option<Box_<dyn Fn(&TreeView, &Widget) + 'static>>> = func_data; 2132 unsafe { 2133 gtk_sys::gtk_tree_view_set_search_position_func( 2134 self.as_ref().to_glib_none().0, 2135 func, 2136 Box_::into_raw(super_callback0) as *mut _, 2137 destroy_call3, 2138 ); 2139 } 2140 } 2141 set_show_expanders(&self, enabled: bool)2142 fn set_show_expanders(&self, enabled: bool) { 2143 unsafe { 2144 gtk_sys::gtk_tree_view_set_show_expanders( 2145 self.as_ref().to_glib_none().0, 2146 enabled.to_glib(), 2147 ); 2148 } 2149 } 2150 set_tooltip_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( &self, tooltip: &Tooltip, path: Option<&TreePath>, column: Option<&P>, cell: Option<&Q>, )2151 fn set_tooltip_cell<P: IsA<TreeViewColumn>, Q: IsA<CellRenderer>>( 2152 &self, 2153 tooltip: &Tooltip, 2154 path: Option<&TreePath>, 2155 column: Option<&P>, 2156 cell: Option<&Q>, 2157 ) { 2158 unsafe { 2159 gtk_sys::gtk_tree_view_set_tooltip_cell( 2160 self.as_ref().to_glib_none().0, 2161 tooltip.to_glib_none().0, 2162 mut_override(path.to_glib_none().0), 2163 column.map(|p| p.as_ref()).to_glib_none().0, 2164 cell.map(|p| p.as_ref()).to_glib_none().0, 2165 ); 2166 } 2167 } 2168 set_tooltip_column(&self, column: i32)2169 fn set_tooltip_column(&self, column: i32) { 2170 unsafe { 2171 gtk_sys::gtk_tree_view_set_tooltip_column(self.as_ref().to_glib_none().0, column); 2172 } 2173 } 2174 set_tooltip_row(&self, tooltip: &Tooltip, path: &TreePath)2175 fn set_tooltip_row(&self, tooltip: &Tooltip, path: &TreePath) { 2176 unsafe { 2177 gtk_sys::gtk_tree_view_set_tooltip_row( 2178 self.as_ref().to_glib_none().0, 2179 tooltip.to_glib_none().0, 2180 mut_override(path.to_glib_none().0), 2181 ); 2182 } 2183 } 2184 unset_rows_drag_dest(&self)2185 fn unset_rows_drag_dest(&self) { 2186 unsafe { 2187 gtk_sys::gtk_tree_view_unset_rows_drag_dest(self.as_ref().to_glib_none().0); 2188 } 2189 } 2190 unset_rows_drag_source(&self)2191 fn unset_rows_drag_source(&self) { 2192 unsafe { 2193 gtk_sys::gtk_tree_view_unset_rows_drag_source(self.as_ref().to_glib_none().0); 2194 } 2195 } 2196 get_property_enable_grid_lines(&self) -> TreeViewGridLines2197 fn get_property_enable_grid_lines(&self) -> TreeViewGridLines { 2198 unsafe { 2199 let mut value = Value::from_type(<TreeViewGridLines as StaticType>::static_type()); 2200 gobject_sys::g_object_get_property( 2201 self.to_glib_none().0 as *mut gobject_sys::GObject, 2202 b"enable-grid-lines\0".as_ptr() as *const _, 2203 value.to_glib_none_mut().0, 2204 ); 2205 value 2206 .get() 2207 .expect("Return Value for property `enable-grid-lines` getter") 2208 .unwrap() 2209 } 2210 } 2211 set_property_enable_grid_lines(&self, enable_grid_lines: TreeViewGridLines)2212 fn set_property_enable_grid_lines(&self, enable_grid_lines: TreeViewGridLines) { 2213 unsafe { 2214 gobject_sys::g_object_set_property( 2215 self.to_glib_none().0 as *mut gobject_sys::GObject, 2216 b"enable-grid-lines\0".as_ptr() as *const _, 2217 Value::from(&enable_grid_lines).to_glib_none().0, 2218 ); 2219 } 2220 } 2221 set_property_ubuntu_almost_fixed_height_mode(&self, ubuntu_almost_fixed_height_mode: bool)2222 fn set_property_ubuntu_almost_fixed_height_mode(&self, ubuntu_almost_fixed_height_mode: bool) { 2223 unsafe { 2224 gobject_sys::g_object_set_property( 2225 self.to_glib_none().0 as *mut gobject_sys::GObject, 2226 b"ubuntu-almost-fixed-height-mode\0".as_ptr() as *const _, 2227 Value::from(&ubuntu_almost_fixed_height_mode) 2228 .to_glib_none() 2229 .0, 2230 ); 2231 } 2232 } 2233 connect_columns_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2234 fn connect_columns_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 2235 unsafe extern "C" fn columns_changed_trampoline<P, F: Fn(&P) + 'static>( 2236 this: *mut gtk_sys::GtkTreeView, 2237 f: glib_sys::gpointer, 2238 ) where 2239 P: IsA<TreeView>, 2240 { 2241 let f: &F = &*(f as *const F); 2242 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2243 } 2244 unsafe { 2245 let f: Box_<F> = Box_::new(f); 2246 connect_raw( 2247 self.as_ptr() as *mut _, 2248 b"columns-changed\0".as_ptr() as *const _, 2249 Some(transmute(columns_changed_trampoline::<Self, F> as usize)), 2250 Box_::into_raw(f), 2251 ) 2252 } 2253 } 2254 connect_cursor_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId2255 fn connect_cursor_changed<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 2256 unsafe extern "C" fn cursor_changed_trampoline<P, F: Fn(&P) + 'static>( 2257 this: *mut gtk_sys::GtkTreeView, 2258 f: glib_sys::gpointer, 2259 ) where 2260 P: IsA<TreeView>, 2261 { 2262 let f: &F = &*(f as *const F); 2263 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2264 } 2265 unsafe { 2266 let f: Box_<F> = Box_::new(f); 2267 connect_raw( 2268 self.as_ptr() as *mut _, 2269 b"cursor-changed\0".as_ptr() as *const _, 2270 Some(transmute(cursor_changed_trampoline::<Self, F> as usize)), 2271 Box_::into_raw(f), 2272 ) 2273 } 2274 } 2275 connect_expand_collapse_cursor_row<F: Fn(&Self, bool, bool, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId2276 fn connect_expand_collapse_cursor_row<F: Fn(&Self, bool, bool, bool) -> bool + 'static>( 2277 &self, 2278 f: F, 2279 ) -> SignalHandlerId { 2280 unsafe extern "C" fn expand_collapse_cursor_row_trampoline< 2281 P, 2282 F: Fn(&P, bool, bool, bool) -> bool + 'static, 2283 >( 2284 this: *mut gtk_sys::GtkTreeView, 2285 object: glib_sys::gboolean, 2286 p0: glib_sys::gboolean, 2287 p1: glib_sys::gboolean, 2288 f: glib_sys::gpointer, 2289 ) -> glib_sys::gboolean 2290 where 2291 P: IsA<TreeView>, 2292 { 2293 let f: &F = &*(f as *const F); 2294 f( 2295 &TreeView::from_glib_borrow(this).unsafe_cast(), 2296 from_glib(object), 2297 from_glib(p0), 2298 from_glib(p1), 2299 ) 2300 .to_glib() 2301 } 2302 unsafe { 2303 let f: Box_<F> = Box_::new(f); 2304 connect_raw( 2305 self.as_ptr() as *mut _, 2306 b"expand-collapse-cursor-row\0".as_ptr() as *const _, 2307 Some(transmute( 2308 expand_collapse_cursor_row_trampoline::<Self, F> as usize, 2309 )), 2310 Box_::into_raw(f), 2311 ) 2312 } 2313 } 2314 emit_expand_collapse_cursor_row(&self, object: bool, p0: bool, p1: bool) -> bool2315 fn emit_expand_collapse_cursor_row(&self, object: bool, p0: bool, p1: bool) -> bool { 2316 let res = unsafe { 2317 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 2318 .emit("expand-collapse-cursor-row", &[&object, &p0, &p1]) 2319 .unwrap() 2320 }; 2321 res.unwrap() 2322 .get() 2323 .expect("Return Value for `emit_expand_collapse_cursor_row`") 2324 .unwrap() 2325 } 2326 connect_move_cursor<F: Fn(&Self, MovementStep, i32) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId2327 fn connect_move_cursor<F: Fn(&Self, MovementStep, i32) -> bool + 'static>( 2328 &self, 2329 f: F, 2330 ) -> SignalHandlerId { 2331 unsafe extern "C" fn move_cursor_trampoline< 2332 P, 2333 F: Fn(&P, MovementStep, i32) -> bool + 'static, 2334 >( 2335 this: *mut gtk_sys::GtkTreeView, 2336 step: gtk_sys::GtkMovementStep, 2337 direction: libc::c_int, 2338 f: glib_sys::gpointer, 2339 ) -> glib_sys::gboolean 2340 where 2341 P: IsA<TreeView>, 2342 { 2343 let f: &F = &*(f as *const F); 2344 f( 2345 &TreeView::from_glib_borrow(this).unsafe_cast(), 2346 from_glib(step), 2347 direction, 2348 ) 2349 .to_glib() 2350 } 2351 unsafe { 2352 let f: Box_<F> = Box_::new(f); 2353 connect_raw( 2354 self.as_ptr() as *mut _, 2355 b"move-cursor\0".as_ptr() as *const _, 2356 Some(transmute(move_cursor_trampoline::<Self, F> as usize)), 2357 Box_::into_raw(f), 2358 ) 2359 } 2360 } 2361 emit_move_cursor(&self, step: MovementStep, direction: i32) -> bool2362 fn emit_move_cursor(&self, step: MovementStep, direction: i32) -> bool { 2363 let res = unsafe { 2364 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 2365 .emit("move-cursor", &[&step, &direction]) 2366 .unwrap() 2367 }; 2368 res.unwrap() 2369 .get() 2370 .expect("Return Value for `emit_move_cursor`") 2371 .unwrap() 2372 } 2373 connect_row_activated<F: Fn(&Self, &TreePath, &TreeViewColumn) + 'static>( &self, f: F, ) -> SignalHandlerId2374 fn connect_row_activated<F: Fn(&Self, &TreePath, &TreeViewColumn) + 'static>( 2375 &self, 2376 f: F, 2377 ) -> SignalHandlerId { 2378 unsafe extern "C" fn row_activated_trampoline< 2379 P, 2380 F: Fn(&P, &TreePath, &TreeViewColumn) + 'static, 2381 >( 2382 this: *mut gtk_sys::GtkTreeView, 2383 path: *mut gtk_sys::GtkTreePath, 2384 column: *mut gtk_sys::GtkTreeViewColumn, 2385 f: glib_sys::gpointer, 2386 ) where 2387 P: IsA<TreeView>, 2388 { 2389 let f: &F = &*(f as *const F); 2390 f( 2391 &TreeView::from_glib_borrow(this).unsafe_cast(), 2392 &from_glib_borrow(path), 2393 &from_glib_borrow(column), 2394 ) 2395 } 2396 unsafe { 2397 let f: Box_<F> = Box_::new(f); 2398 connect_raw( 2399 self.as_ptr() as *mut _, 2400 b"row-activated\0".as_ptr() as *const _, 2401 Some(transmute(row_activated_trampoline::<Self, F> as usize)), 2402 Box_::into_raw(f), 2403 ) 2404 } 2405 } 2406 emit_row_activated(&self, path: &TreePath, column: &TreeViewColumn)2407 fn emit_row_activated(&self, path: &TreePath, column: &TreeViewColumn) { 2408 let _ = unsafe { 2409 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 2410 .emit("row-activated", &[&path, &column]) 2411 .unwrap() 2412 }; 2413 } 2414 connect_row_collapsed<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( &self, f: F, ) -> SignalHandlerId2415 fn connect_row_collapsed<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( 2416 &self, 2417 f: F, 2418 ) -> SignalHandlerId { 2419 unsafe extern "C" fn row_collapsed_trampoline< 2420 P, 2421 F: Fn(&P, &TreeIter, &TreePath) + 'static, 2422 >( 2423 this: *mut gtk_sys::GtkTreeView, 2424 iter: *mut gtk_sys::GtkTreeIter, 2425 path: *mut gtk_sys::GtkTreePath, 2426 f: glib_sys::gpointer, 2427 ) where 2428 P: IsA<TreeView>, 2429 { 2430 let f: &F = &*(f as *const F); 2431 f( 2432 &TreeView::from_glib_borrow(this).unsafe_cast(), 2433 &from_glib_borrow(iter), 2434 &from_glib_borrow(path), 2435 ) 2436 } 2437 unsafe { 2438 let f: Box_<F> = Box_::new(f); 2439 connect_raw( 2440 self.as_ptr() as *mut _, 2441 b"row-collapsed\0".as_ptr() as *const _, 2442 Some(transmute(row_collapsed_trampoline::<Self, F> as usize)), 2443 Box_::into_raw(f), 2444 ) 2445 } 2446 } 2447 connect_row_expanded<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( &self, f: F, ) -> SignalHandlerId2448 fn connect_row_expanded<F: Fn(&Self, &TreeIter, &TreePath) + 'static>( 2449 &self, 2450 f: F, 2451 ) -> SignalHandlerId { 2452 unsafe extern "C" fn row_expanded_trampoline<P, F: Fn(&P, &TreeIter, &TreePath) + 'static>( 2453 this: *mut gtk_sys::GtkTreeView, 2454 iter: *mut gtk_sys::GtkTreeIter, 2455 path: *mut gtk_sys::GtkTreePath, 2456 f: glib_sys::gpointer, 2457 ) where 2458 P: IsA<TreeView>, 2459 { 2460 let f: &F = &*(f as *const F); 2461 f( 2462 &TreeView::from_glib_borrow(this).unsafe_cast(), 2463 &from_glib_borrow(iter), 2464 &from_glib_borrow(path), 2465 ) 2466 } 2467 unsafe { 2468 let f: Box_<F> = Box_::new(f); 2469 connect_raw( 2470 self.as_ptr() as *mut _, 2471 b"row-expanded\0".as_ptr() as *const _, 2472 Some(transmute(row_expanded_trampoline::<Self, F> as usize)), 2473 Box_::into_raw(f), 2474 ) 2475 } 2476 } 2477 connect_select_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId2478 fn connect_select_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId { 2479 unsafe extern "C" fn select_all_trampoline<P, F: Fn(&P) -> bool + 'static>( 2480 this: *mut gtk_sys::GtkTreeView, 2481 f: glib_sys::gpointer, 2482 ) -> glib_sys::gboolean 2483 where 2484 P: IsA<TreeView>, 2485 { 2486 let f: &F = &*(f as *const F); 2487 f(&TreeView::from_glib_borrow(this).unsafe_cast()).to_glib() 2488 } 2489 unsafe { 2490 let f: Box_<F> = Box_::new(f); 2491 connect_raw( 2492 self.as_ptr() as *mut _, 2493 b"select-all\0".as_ptr() as *const _, 2494 Some(transmute(select_all_trampoline::<Self, F> as usize)), 2495 Box_::into_raw(f), 2496 ) 2497 } 2498 } 2499 emit_select_all(&self) -> bool2500 fn emit_select_all(&self) -> bool { 2501 let res = unsafe { 2502 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 2503 .emit("select-all", &[]) 2504 .unwrap() 2505 }; 2506 res.unwrap() 2507 .get() 2508 .expect("Return Value for `emit_select_all`") 2509 .unwrap() 2510 } 2511 connect_select_cursor_parent<F: Fn(&Self) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId2512 fn connect_select_cursor_parent<F: Fn(&Self) -> bool + 'static>( 2513 &self, 2514 f: F, 2515 ) -> SignalHandlerId { 2516 unsafe extern "C" fn select_cursor_parent_trampoline<P, F: Fn(&P) -> bool + 'static>( 2517 this: *mut gtk_sys::GtkTreeView, 2518 f: glib_sys::gpointer, 2519 ) -> glib_sys::gboolean 2520 where 2521 P: IsA<TreeView>, 2522 { 2523 let f: &F = &*(f as *const F); 2524 f(&TreeView::from_glib_borrow(this).unsafe_cast()).to_glib() 2525 } 2526 unsafe { 2527 let f: Box_<F> = Box_::new(f); 2528 connect_raw( 2529 self.as_ptr() as *mut _, 2530 b"select-cursor-parent\0".as_ptr() as *const _, 2531 Some(transmute( 2532 select_cursor_parent_trampoline::<Self, F> as usize, 2533 )), 2534 Box_::into_raw(f), 2535 ) 2536 } 2537 } 2538 emit_select_cursor_parent(&self) -> bool2539 fn emit_select_cursor_parent(&self) -> bool { 2540 let res = unsafe { 2541 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 2542 .emit("select-cursor-parent", &[]) 2543 .unwrap() 2544 }; 2545 res.unwrap() 2546 .get() 2547 .expect("Return Value for `emit_select_cursor_parent`") 2548 .unwrap() 2549 } 2550 connect_select_cursor_row<F: Fn(&Self, bool) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId2551 fn connect_select_cursor_row<F: Fn(&Self, bool) -> bool + 'static>( 2552 &self, 2553 f: F, 2554 ) -> SignalHandlerId { 2555 unsafe extern "C" fn select_cursor_row_trampoline<P, F: Fn(&P, bool) -> bool + 'static>( 2556 this: *mut gtk_sys::GtkTreeView, 2557 object: glib_sys::gboolean, 2558 f: glib_sys::gpointer, 2559 ) -> glib_sys::gboolean 2560 where 2561 P: IsA<TreeView>, 2562 { 2563 let f: &F = &*(f as *const F); 2564 f( 2565 &TreeView::from_glib_borrow(this).unsafe_cast(), 2566 from_glib(object), 2567 ) 2568 .to_glib() 2569 } 2570 unsafe { 2571 let f: Box_<F> = Box_::new(f); 2572 connect_raw( 2573 self.as_ptr() as *mut _, 2574 b"select-cursor-row\0".as_ptr() as *const _, 2575 Some(transmute(select_cursor_row_trampoline::<Self, F> as usize)), 2576 Box_::into_raw(f), 2577 ) 2578 } 2579 } 2580 emit_select_cursor_row(&self, object: bool) -> bool2581 fn emit_select_cursor_row(&self, object: bool) -> bool { 2582 let res = unsafe { 2583 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 2584 .emit("select-cursor-row", &[&object]) 2585 .unwrap() 2586 }; 2587 res.unwrap() 2588 .get() 2589 .expect("Return Value for `emit_select_cursor_row`") 2590 .unwrap() 2591 } 2592 connect_start_interactive_search<F: Fn(&Self) -> bool + 'static>( &self, f: F, ) -> SignalHandlerId2593 fn connect_start_interactive_search<F: Fn(&Self) -> bool + 'static>( 2594 &self, 2595 f: F, 2596 ) -> SignalHandlerId { 2597 unsafe extern "C" fn start_interactive_search_trampoline<P, F: Fn(&P) -> bool + 'static>( 2598 this: *mut gtk_sys::GtkTreeView, 2599 f: glib_sys::gpointer, 2600 ) -> glib_sys::gboolean 2601 where 2602 P: IsA<TreeView>, 2603 { 2604 let f: &F = &*(f as *const F); 2605 f(&TreeView::from_glib_borrow(this).unsafe_cast()).to_glib() 2606 } 2607 unsafe { 2608 let f: Box_<F> = Box_::new(f); 2609 connect_raw( 2610 self.as_ptr() as *mut _, 2611 b"start-interactive-search\0".as_ptr() as *const _, 2612 Some(transmute( 2613 start_interactive_search_trampoline::<Self, F> as usize, 2614 )), 2615 Box_::into_raw(f), 2616 ) 2617 } 2618 } 2619 emit_start_interactive_search(&self) -> bool2620 fn emit_start_interactive_search(&self) -> bool { 2621 let res = unsafe { 2622 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 2623 .emit("start-interactive-search", &[]) 2624 .unwrap() 2625 }; 2626 res.unwrap() 2627 .get() 2628 .expect("Return Value for `emit_start_interactive_search`") 2629 .unwrap() 2630 } 2631 connect_test_collapse_row< F: Fn(&Self, &TreeIter, &TreePath) -> glib::signal::Inhibit + 'static, >( &self, f: F, ) -> SignalHandlerId2632 fn connect_test_collapse_row< 2633 F: Fn(&Self, &TreeIter, &TreePath) -> glib::signal::Inhibit + 'static, 2634 >( 2635 &self, 2636 f: F, 2637 ) -> SignalHandlerId { 2638 unsafe extern "C" fn test_collapse_row_trampoline< 2639 P, 2640 F: Fn(&P, &TreeIter, &TreePath) -> glib::signal::Inhibit + 'static, 2641 >( 2642 this: *mut gtk_sys::GtkTreeView, 2643 iter: *mut gtk_sys::GtkTreeIter, 2644 path: *mut gtk_sys::GtkTreePath, 2645 f: glib_sys::gpointer, 2646 ) -> glib_sys::gboolean 2647 where 2648 P: IsA<TreeView>, 2649 { 2650 let f: &F = &*(f as *const F); 2651 f( 2652 &TreeView::from_glib_borrow(this).unsafe_cast(), 2653 &from_glib_borrow(iter), 2654 &from_glib_borrow(path), 2655 ) 2656 .to_glib() 2657 } 2658 unsafe { 2659 let f: Box_<F> = Box_::new(f); 2660 connect_raw( 2661 self.as_ptr() as *mut _, 2662 b"test-collapse-row\0".as_ptr() as *const _, 2663 Some(transmute(test_collapse_row_trampoline::<Self, F> as usize)), 2664 Box_::into_raw(f), 2665 ) 2666 } 2667 } 2668 connect_test_expand_row< F: Fn(&Self, &TreeIter, &TreePath) -> glib::signal::Inhibit + 'static, >( &self, f: F, ) -> SignalHandlerId2669 fn connect_test_expand_row< 2670 F: Fn(&Self, &TreeIter, &TreePath) -> glib::signal::Inhibit + 'static, 2671 >( 2672 &self, 2673 f: F, 2674 ) -> SignalHandlerId { 2675 unsafe extern "C" fn test_expand_row_trampoline< 2676 P, 2677 F: Fn(&P, &TreeIter, &TreePath) -> glib::signal::Inhibit + 'static, 2678 >( 2679 this: *mut gtk_sys::GtkTreeView, 2680 iter: *mut gtk_sys::GtkTreeIter, 2681 path: *mut gtk_sys::GtkTreePath, 2682 f: glib_sys::gpointer, 2683 ) -> glib_sys::gboolean 2684 where 2685 P: IsA<TreeView>, 2686 { 2687 let f: &F = &*(f as *const F); 2688 f( 2689 &TreeView::from_glib_borrow(this).unsafe_cast(), 2690 &from_glib_borrow(iter), 2691 &from_glib_borrow(path), 2692 ) 2693 .to_glib() 2694 } 2695 unsafe { 2696 let f: Box_<F> = Box_::new(f); 2697 connect_raw( 2698 self.as_ptr() as *mut _, 2699 b"test-expand-row\0".as_ptr() as *const _, 2700 Some(transmute(test_expand_row_trampoline::<Self, F> as usize)), 2701 Box_::into_raw(f), 2702 ) 2703 } 2704 } 2705 connect_toggle_cursor_row<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId2706 fn connect_toggle_cursor_row<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId { 2707 unsafe extern "C" fn toggle_cursor_row_trampoline<P, F: Fn(&P) -> bool + 'static>( 2708 this: *mut gtk_sys::GtkTreeView, 2709 f: glib_sys::gpointer, 2710 ) -> glib_sys::gboolean 2711 where 2712 P: IsA<TreeView>, 2713 { 2714 let f: &F = &*(f as *const F); 2715 f(&TreeView::from_glib_borrow(this).unsafe_cast()).to_glib() 2716 } 2717 unsafe { 2718 let f: Box_<F> = Box_::new(f); 2719 connect_raw( 2720 self.as_ptr() as *mut _, 2721 b"toggle-cursor-row\0".as_ptr() as *const _, 2722 Some(transmute(toggle_cursor_row_trampoline::<Self, F> as usize)), 2723 Box_::into_raw(f), 2724 ) 2725 } 2726 } 2727 emit_toggle_cursor_row(&self) -> bool2728 fn emit_toggle_cursor_row(&self) -> bool { 2729 let res = unsafe { 2730 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 2731 .emit("toggle-cursor-row", &[]) 2732 .unwrap() 2733 }; 2734 res.unwrap() 2735 .get() 2736 .expect("Return Value for `emit_toggle_cursor_row`") 2737 .unwrap() 2738 } 2739 connect_unselect_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId2740 fn connect_unselect_all<F: Fn(&Self) -> bool + 'static>(&self, f: F) -> SignalHandlerId { 2741 unsafe extern "C" fn unselect_all_trampoline<P, F: Fn(&P) -> bool + 'static>( 2742 this: *mut gtk_sys::GtkTreeView, 2743 f: glib_sys::gpointer, 2744 ) -> glib_sys::gboolean 2745 where 2746 P: IsA<TreeView>, 2747 { 2748 let f: &F = &*(f as *const F); 2749 f(&TreeView::from_glib_borrow(this).unsafe_cast()).to_glib() 2750 } 2751 unsafe { 2752 let f: Box_<F> = Box_::new(f); 2753 connect_raw( 2754 self.as_ptr() as *mut _, 2755 b"unselect-all\0".as_ptr() as *const _, 2756 Some(transmute(unselect_all_trampoline::<Self, F> as usize)), 2757 Box_::into_raw(f), 2758 ) 2759 } 2760 } 2761 emit_unselect_all(&self) -> bool2762 fn emit_unselect_all(&self) -> bool { 2763 let res = unsafe { 2764 glib::Object::from_glib_borrow(self.to_glib_none().0 as *mut gobject_sys::GObject) 2765 .emit("unselect-all", &[]) 2766 .unwrap() 2767 }; 2768 res.unwrap() 2769 .get() 2770 .expect("Return Value for `emit_unselect_all`") 2771 .unwrap() 2772 } 2773 connect_property_activate_on_single_click_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2774 fn connect_property_activate_on_single_click_notify<F: Fn(&Self) + 'static>( 2775 &self, 2776 f: F, 2777 ) -> SignalHandlerId { 2778 unsafe extern "C" fn notify_activate_on_single_click_trampoline<P, F: Fn(&P) + 'static>( 2779 this: *mut gtk_sys::GtkTreeView, 2780 _param_spec: glib_sys::gpointer, 2781 f: glib_sys::gpointer, 2782 ) where 2783 P: IsA<TreeView>, 2784 { 2785 let f: &F = &*(f as *const F); 2786 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2787 } 2788 unsafe { 2789 let f: Box_<F> = Box_::new(f); 2790 connect_raw( 2791 self.as_ptr() as *mut _, 2792 b"notify::activate-on-single-click\0".as_ptr() as *const _, 2793 Some(transmute( 2794 notify_activate_on_single_click_trampoline::<Self, F> as usize, 2795 )), 2796 Box_::into_raw(f), 2797 ) 2798 } 2799 } 2800 connect_property_enable_grid_lines_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2801 fn connect_property_enable_grid_lines_notify<F: Fn(&Self) + 'static>( 2802 &self, 2803 f: F, 2804 ) -> SignalHandlerId { 2805 unsafe extern "C" fn notify_enable_grid_lines_trampoline<P, F: Fn(&P) + 'static>( 2806 this: *mut gtk_sys::GtkTreeView, 2807 _param_spec: glib_sys::gpointer, 2808 f: glib_sys::gpointer, 2809 ) where 2810 P: IsA<TreeView>, 2811 { 2812 let f: &F = &*(f as *const F); 2813 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2814 } 2815 unsafe { 2816 let f: Box_<F> = Box_::new(f); 2817 connect_raw( 2818 self.as_ptr() as *mut _, 2819 b"notify::enable-grid-lines\0".as_ptr() as *const _, 2820 Some(transmute( 2821 notify_enable_grid_lines_trampoline::<Self, F> as usize, 2822 )), 2823 Box_::into_raw(f), 2824 ) 2825 } 2826 } 2827 connect_property_enable_search_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2828 fn connect_property_enable_search_notify<F: Fn(&Self) + 'static>( 2829 &self, 2830 f: F, 2831 ) -> SignalHandlerId { 2832 unsafe extern "C" fn notify_enable_search_trampoline<P, F: Fn(&P) + 'static>( 2833 this: *mut gtk_sys::GtkTreeView, 2834 _param_spec: glib_sys::gpointer, 2835 f: glib_sys::gpointer, 2836 ) where 2837 P: IsA<TreeView>, 2838 { 2839 let f: &F = &*(f as *const F); 2840 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2841 } 2842 unsafe { 2843 let f: Box_<F> = Box_::new(f); 2844 connect_raw( 2845 self.as_ptr() as *mut _, 2846 b"notify::enable-search\0".as_ptr() as *const _, 2847 Some(transmute( 2848 notify_enable_search_trampoline::<Self, F> as usize, 2849 )), 2850 Box_::into_raw(f), 2851 ) 2852 } 2853 } 2854 connect_property_enable_tree_lines_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2855 fn connect_property_enable_tree_lines_notify<F: Fn(&Self) + 'static>( 2856 &self, 2857 f: F, 2858 ) -> SignalHandlerId { 2859 unsafe extern "C" fn notify_enable_tree_lines_trampoline<P, F: Fn(&P) + 'static>( 2860 this: *mut gtk_sys::GtkTreeView, 2861 _param_spec: glib_sys::gpointer, 2862 f: glib_sys::gpointer, 2863 ) where 2864 P: IsA<TreeView>, 2865 { 2866 let f: &F = &*(f as *const F); 2867 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2868 } 2869 unsafe { 2870 let f: Box_<F> = Box_::new(f); 2871 connect_raw( 2872 self.as_ptr() as *mut _, 2873 b"notify::enable-tree-lines\0".as_ptr() as *const _, 2874 Some(transmute( 2875 notify_enable_tree_lines_trampoline::<Self, F> as usize, 2876 )), 2877 Box_::into_raw(f), 2878 ) 2879 } 2880 } 2881 connect_property_expander_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2882 fn connect_property_expander_column_notify<F: Fn(&Self) + 'static>( 2883 &self, 2884 f: F, 2885 ) -> SignalHandlerId { 2886 unsafe extern "C" fn notify_expander_column_trampoline<P, F: Fn(&P) + 'static>( 2887 this: *mut gtk_sys::GtkTreeView, 2888 _param_spec: glib_sys::gpointer, 2889 f: glib_sys::gpointer, 2890 ) where 2891 P: IsA<TreeView>, 2892 { 2893 let f: &F = &*(f as *const F); 2894 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2895 } 2896 unsafe { 2897 let f: Box_<F> = Box_::new(f); 2898 connect_raw( 2899 self.as_ptr() as *mut _, 2900 b"notify::expander-column\0".as_ptr() as *const _, 2901 Some(transmute( 2902 notify_expander_column_trampoline::<Self, F> as usize, 2903 )), 2904 Box_::into_raw(f), 2905 ) 2906 } 2907 } 2908 connect_property_fixed_height_mode_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2909 fn connect_property_fixed_height_mode_notify<F: Fn(&Self) + 'static>( 2910 &self, 2911 f: F, 2912 ) -> SignalHandlerId { 2913 unsafe extern "C" fn notify_fixed_height_mode_trampoline<P, F: Fn(&P) + 'static>( 2914 this: *mut gtk_sys::GtkTreeView, 2915 _param_spec: glib_sys::gpointer, 2916 f: glib_sys::gpointer, 2917 ) where 2918 P: IsA<TreeView>, 2919 { 2920 let f: &F = &*(f as *const F); 2921 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2922 } 2923 unsafe { 2924 let f: Box_<F> = Box_::new(f); 2925 connect_raw( 2926 self.as_ptr() as *mut _, 2927 b"notify::fixed-height-mode\0".as_ptr() as *const _, 2928 Some(transmute( 2929 notify_fixed_height_mode_trampoline::<Self, F> as usize, 2930 )), 2931 Box_::into_raw(f), 2932 ) 2933 } 2934 } 2935 connect_property_headers_clickable_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2936 fn connect_property_headers_clickable_notify<F: Fn(&Self) + 'static>( 2937 &self, 2938 f: F, 2939 ) -> SignalHandlerId { 2940 unsafe extern "C" fn notify_headers_clickable_trampoline<P, F: Fn(&P) + 'static>( 2941 this: *mut gtk_sys::GtkTreeView, 2942 _param_spec: glib_sys::gpointer, 2943 f: glib_sys::gpointer, 2944 ) where 2945 P: IsA<TreeView>, 2946 { 2947 let f: &F = &*(f as *const F); 2948 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2949 } 2950 unsafe { 2951 let f: Box_<F> = Box_::new(f); 2952 connect_raw( 2953 self.as_ptr() as *mut _, 2954 b"notify::headers-clickable\0".as_ptr() as *const _, 2955 Some(transmute( 2956 notify_headers_clickable_trampoline::<Self, F> as usize, 2957 )), 2958 Box_::into_raw(f), 2959 ) 2960 } 2961 } 2962 connect_property_headers_visible_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2963 fn connect_property_headers_visible_notify<F: Fn(&Self) + 'static>( 2964 &self, 2965 f: F, 2966 ) -> SignalHandlerId { 2967 unsafe extern "C" fn notify_headers_visible_trampoline<P, F: Fn(&P) + 'static>( 2968 this: *mut gtk_sys::GtkTreeView, 2969 _param_spec: glib_sys::gpointer, 2970 f: glib_sys::gpointer, 2971 ) where 2972 P: IsA<TreeView>, 2973 { 2974 let f: &F = &*(f as *const F); 2975 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 2976 } 2977 unsafe { 2978 let f: Box_<F> = Box_::new(f); 2979 connect_raw( 2980 self.as_ptr() as *mut _, 2981 b"notify::headers-visible\0".as_ptr() as *const _, 2982 Some(transmute( 2983 notify_headers_visible_trampoline::<Self, F> as usize, 2984 )), 2985 Box_::into_raw(f), 2986 ) 2987 } 2988 } 2989 connect_property_hover_expand_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId2990 fn connect_property_hover_expand_notify<F: Fn(&Self) + 'static>( 2991 &self, 2992 f: F, 2993 ) -> SignalHandlerId { 2994 unsafe extern "C" fn notify_hover_expand_trampoline<P, F: Fn(&P) + 'static>( 2995 this: *mut gtk_sys::GtkTreeView, 2996 _param_spec: glib_sys::gpointer, 2997 f: glib_sys::gpointer, 2998 ) where 2999 P: IsA<TreeView>, 3000 { 3001 let f: &F = &*(f as *const F); 3002 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 3003 } 3004 unsafe { 3005 let f: Box_<F> = Box_::new(f); 3006 connect_raw( 3007 self.as_ptr() as *mut _, 3008 b"notify::hover-expand\0".as_ptr() as *const _, 3009 Some(transmute( 3010 notify_hover_expand_trampoline::<Self, F> as usize, 3011 )), 3012 Box_::into_raw(f), 3013 ) 3014 } 3015 } 3016 connect_property_hover_selection_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId3017 fn connect_property_hover_selection_notify<F: Fn(&Self) + 'static>( 3018 &self, 3019 f: F, 3020 ) -> SignalHandlerId { 3021 unsafe extern "C" fn notify_hover_selection_trampoline<P, F: Fn(&P) + 'static>( 3022 this: *mut gtk_sys::GtkTreeView, 3023 _param_spec: glib_sys::gpointer, 3024 f: glib_sys::gpointer, 3025 ) where 3026 P: IsA<TreeView>, 3027 { 3028 let f: &F = &*(f as *const F); 3029 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 3030 } 3031 unsafe { 3032 let f: Box_<F> = Box_::new(f); 3033 connect_raw( 3034 self.as_ptr() as *mut _, 3035 b"notify::hover-selection\0".as_ptr() as *const _, 3036 Some(transmute( 3037 notify_hover_selection_trampoline::<Self, F> as usize, 3038 )), 3039 Box_::into_raw(f), 3040 ) 3041 } 3042 } 3043 connect_property_level_indentation_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId3044 fn connect_property_level_indentation_notify<F: Fn(&Self) + 'static>( 3045 &self, 3046 f: F, 3047 ) -> SignalHandlerId { 3048 unsafe extern "C" fn notify_level_indentation_trampoline<P, F: Fn(&P) + 'static>( 3049 this: *mut gtk_sys::GtkTreeView, 3050 _param_spec: glib_sys::gpointer, 3051 f: glib_sys::gpointer, 3052 ) where 3053 P: IsA<TreeView>, 3054 { 3055 let f: &F = &*(f as *const F); 3056 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 3057 } 3058 unsafe { 3059 let f: Box_<F> = Box_::new(f); 3060 connect_raw( 3061 self.as_ptr() as *mut _, 3062 b"notify::level-indentation\0".as_ptr() as *const _, 3063 Some(transmute( 3064 notify_level_indentation_trampoline::<Self, F> as usize, 3065 )), 3066 Box_::into_raw(f), 3067 ) 3068 } 3069 } 3070 connect_property_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId3071 fn connect_property_model_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 3072 unsafe extern "C" fn notify_model_trampoline<P, F: Fn(&P) + 'static>( 3073 this: *mut gtk_sys::GtkTreeView, 3074 _param_spec: glib_sys::gpointer, 3075 f: glib_sys::gpointer, 3076 ) where 3077 P: IsA<TreeView>, 3078 { 3079 let f: &F = &*(f as *const F); 3080 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 3081 } 3082 unsafe { 3083 let f: Box_<F> = Box_::new(f); 3084 connect_raw( 3085 self.as_ptr() as *mut _, 3086 b"notify::model\0".as_ptr() as *const _, 3087 Some(transmute(notify_model_trampoline::<Self, F> as usize)), 3088 Box_::into_raw(f), 3089 ) 3090 } 3091 } 3092 connect_property_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId3093 fn connect_property_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 3094 unsafe extern "C" fn notify_reorderable_trampoline<P, F: Fn(&P) + 'static>( 3095 this: *mut gtk_sys::GtkTreeView, 3096 _param_spec: glib_sys::gpointer, 3097 f: glib_sys::gpointer, 3098 ) where 3099 P: IsA<TreeView>, 3100 { 3101 let f: &F = &*(f as *const F); 3102 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 3103 } 3104 unsafe { 3105 let f: Box_<F> = Box_::new(f); 3106 connect_raw( 3107 self.as_ptr() as *mut _, 3108 b"notify::reorderable\0".as_ptr() as *const _, 3109 Some(transmute(notify_reorderable_trampoline::<Self, F> as usize)), 3110 Box_::into_raw(f), 3111 ) 3112 } 3113 } 3114 connect_property_rubber_banding_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId3115 fn connect_property_rubber_banding_notify<F: Fn(&Self) + 'static>( 3116 &self, 3117 f: F, 3118 ) -> SignalHandlerId { 3119 unsafe extern "C" fn notify_rubber_banding_trampoline<P, F: Fn(&P) + 'static>( 3120 this: *mut gtk_sys::GtkTreeView, 3121 _param_spec: glib_sys::gpointer, 3122 f: glib_sys::gpointer, 3123 ) where 3124 P: IsA<TreeView>, 3125 { 3126 let f: &F = &*(f as *const F); 3127 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 3128 } 3129 unsafe { 3130 let f: Box_<F> = Box_::new(f); 3131 connect_raw( 3132 self.as_ptr() as *mut _, 3133 b"notify::rubber-banding\0".as_ptr() as *const _, 3134 Some(transmute( 3135 notify_rubber_banding_trampoline::<Self, F> as usize, 3136 )), 3137 Box_::into_raw(f), 3138 ) 3139 } 3140 } 3141 connect_property_search_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId3142 fn connect_property_search_column_notify<F: Fn(&Self) + 'static>( 3143 &self, 3144 f: F, 3145 ) -> SignalHandlerId { 3146 unsafe extern "C" fn notify_search_column_trampoline<P, F: Fn(&P) + 'static>( 3147 this: *mut gtk_sys::GtkTreeView, 3148 _param_spec: glib_sys::gpointer, 3149 f: glib_sys::gpointer, 3150 ) where 3151 P: IsA<TreeView>, 3152 { 3153 let f: &F = &*(f as *const F); 3154 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 3155 } 3156 unsafe { 3157 let f: Box_<F> = Box_::new(f); 3158 connect_raw( 3159 self.as_ptr() as *mut _, 3160 b"notify::search-column\0".as_ptr() as *const _, 3161 Some(transmute( 3162 notify_search_column_trampoline::<Self, F> as usize, 3163 )), 3164 Box_::into_raw(f), 3165 ) 3166 } 3167 } 3168 connect_property_show_expanders_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId3169 fn connect_property_show_expanders_notify<F: Fn(&Self) + 'static>( 3170 &self, 3171 f: F, 3172 ) -> SignalHandlerId { 3173 unsafe extern "C" fn notify_show_expanders_trampoline<P, F: Fn(&P) + 'static>( 3174 this: *mut gtk_sys::GtkTreeView, 3175 _param_spec: glib_sys::gpointer, 3176 f: glib_sys::gpointer, 3177 ) where 3178 P: IsA<TreeView>, 3179 { 3180 let f: &F = &*(f as *const F); 3181 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 3182 } 3183 unsafe { 3184 let f: Box_<F> = Box_::new(f); 3185 connect_raw( 3186 self.as_ptr() as *mut _, 3187 b"notify::show-expanders\0".as_ptr() as *const _, 3188 Some(transmute( 3189 notify_show_expanders_trampoline::<Self, F> as usize, 3190 )), 3191 Box_::into_raw(f), 3192 ) 3193 } 3194 } 3195 connect_property_tooltip_column_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId3196 fn connect_property_tooltip_column_notify<F: Fn(&Self) + 'static>( 3197 &self, 3198 f: F, 3199 ) -> SignalHandlerId { 3200 unsafe extern "C" fn notify_tooltip_column_trampoline<P, F: Fn(&P) + 'static>( 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::tooltip-column\0".as_ptr() as *const _, 3215 Some(transmute( 3216 notify_tooltip_column_trampoline::<Self, F> as usize, 3217 )), 3218 Box_::into_raw(f), 3219 ) 3220 } 3221 } 3222 connect_property_ubuntu_almost_fixed_height_mode_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId3223 fn connect_property_ubuntu_almost_fixed_height_mode_notify<F: Fn(&Self) + 'static>( 3224 &self, 3225 f: F, 3226 ) -> SignalHandlerId { 3227 unsafe extern "C" fn notify_ubuntu_almost_fixed_height_mode_trampoline< 3228 P, 3229 F: Fn(&P) + 'static, 3230 >( 3231 this: *mut gtk_sys::GtkTreeView, 3232 _param_spec: glib_sys::gpointer, 3233 f: glib_sys::gpointer, 3234 ) where 3235 P: IsA<TreeView>, 3236 { 3237 let f: &F = &*(f as *const F); 3238 f(&TreeView::from_glib_borrow(this).unsafe_cast()) 3239 } 3240 unsafe { 3241 let f: Box_<F> = Box_::new(f); 3242 connect_raw( 3243 self.as_ptr() as *mut _, 3244 b"notify::ubuntu-almost-fixed-height-mode\0".as_ptr() as *const _, 3245 Some(transmute( 3246 notify_ubuntu_almost_fixed_height_mode_trampoline::<Self, F> as usize, 3247 )), 3248 Box_::into_raw(f), 3249 ) 3250 } 3251 } 3252 } 3253 3254 impl fmt::Display for TreeView { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result3255 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 3256 write!(f, "TreeView") 3257 } 3258 } 3259