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 gdk; 6 use glib::object::Cast; 7 use glib::object::IsA; 8 use glib::signal::connect_raw; 9 use glib::signal::SignalHandlerId; 10 use glib::translate::*; 11 use glib::GString; 12 use glib::StaticType; 13 use glib::ToValue; 14 use glib::Value; 15 use glib_sys; 16 use gobject_sys; 17 use gtk_sys; 18 use std::boxed::Box as Box_; 19 use std::fmt; 20 use std::mem; 21 use std::mem::transmute; 22 use Buildable; 23 use CellArea; 24 use CellLayout; 25 use CellRenderer; 26 use SortType; 27 use TreeIter; 28 use TreeModel; 29 use TreeViewColumnSizing; 30 use Widget; 31 32 glib_wrapper! { 33 pub struct TreeViewColumn(Object<gtk_sys::GtkTreeViewColumn, gtk_sys::GtkTreeViewColumnClass, TreeViewColumnClass>) @implements Buildable, CellLayout; 34 35 match fn { 36 get_type => || gtk_sys::gtk_tree_view_column_get_type(), 37 } 38 } 39 40 impl TreeViewColumn { new() -> TreeViewColumn41 pub fn new() -> TreeViewColumn { 42 assert_initialized_main_thread!(); 43 unsafe { from_glib_none(gtk_sys::gtk_tree_view_column_new()) } 44 } 45 new_with_area<P: IsA<CellArea>>(area: &P) -> TreeViewColumn46 pub fn new_with_area<P: IsA<CellArea>>(area: &P) -> TreeViewColumn { 47 skip_assert_initialized!(); 48 unsafe { 49 from_glib_none(gtk_sys::gtk_tree_view_column_new_with_area( 50 area.as_ref().to_glib_none().0, 51 )) 52 } 53 } 54 55 //pub fn new_with_attributes<P: IsA<CellRenderer>>(title: &str, cell: &P, : /*Unknown conversion*//*Unimplemented*/Fundamental: VarArgs) -> TreeViewColumn { 56 // unsafe { TODO: call gtk_sys:gtk_tree_view_column_new_with_attributes() } 57 //} 58 } 59 60 impl Default for TreeViewColumn { default() -> Self61 fn default() -> Self { 62 Self::new() 63 } 64 } 65 66 #[derive(Clone, Default)] 67 pub struct TreeViewColumnBuilder { 68 alignment: Option<f32>, 69 cell_area: Option<CellArea>, 70 clickable: Option<bool>, 71 expand: Option<bool>, 72 fixed_width: Option<i32>, 73 max_width: Option<i32>, 74 min_width: Option<i32>, 75 reorderable: Option<bool>, 76 resizable: Option<bool>, 77 sizing: Option<TreeViewColumnSizing>, 78 sort_column_id: Option<i32>, 79 sort_indicator: Option<bool>, 80 sort_order: Option<SortType>, 81 spacing: Option<i32>, 82 title: Option<String>, 83 visible: Option<bool>, 84 widget: Option<Widget>, 85 } 86 87 impl TreeViewColumnBuilder { new() -> Self88 pub fn new() -> Self { 89 Self::default() 90 } 91 build(self) -> TreeViewColumn92 pub fn build(self) -> TreeViewColumn { 93 let mut properties: Vec<(&str, &dyn ToValue)> = vec![]; 94 if let Some(ref alignment) = self.alignment { 95 properties.push(("alignment", alignment)); 96 } 97 if let Some(ref cell_area) = self.cell_area { 98 properties.push(("cell-area", cell_area)); 99 } 100 if let Some(ref clickable) = self.clickable { 101 properties.push(("clickable", clickable)); 102 } 103 if let Some(ref expand) = self.expand { 104 properties.push(("expand", expand)); 105 } 106 if let Some(ref fixed_width) = self.fixed_width { 107 properties.push(("fixed-width", fixed_width)); 108 } 109 if let Some(ref max_width) = self.max_width { 110 properties.push(("max-width", max_width)); 111 } 112 if let Some(ref min_width) = self.min_width { 113 properties.push(("min-width", min_width)); 114 } 115 if let Some(ref reorderable) = self.reorderable { 116 properties.push(("reorderable", reorderable)); 117 } 118 if let Some(ref resizable) = self.resizable { 119 properties.push(("resizable", resizable)); 120 } 121 if let Some(ref sizing) = self.sizing { 122 properties.push(("sizing", sizing)); 123 } 124 if let Some(ref sort_column_id) = self.sort_column_id { 125 properties.push(("sort-column-id", sort_column_id)); 126 } 127 if let Some(ref sort_indicator) = self.sort_indicator { 128 properties.push(("sort-indicator", sort_indicator)); 129 } 130 if let Some(ref sort_order) = self.sort_order { 131 properties.push(("sort-order", sort_order)); 132 } 133 if let Some(ref spacing) = self.spacing { 134 properties.push(("spacing", spacing)); 135 } 136 if let Some(ref title) = self.title { 137 properties.push(("title", title)); 138 } 139 if let Some(ref visible) = self.visible { 140 properties.push(("visible", visible)); 141 } 142 if let Some(ref widget) = self.widget { 143 properties.push(("widget", widget)); 144 } 145 glib::Object::new(TreeViewColumn::static_type(), &properties) 146 .expect("object new") 147 .downcast() 148 .expect("downcast") 149 } 150 alignment(mut self, alignment: f32) -> Self151 pub fn alignment(mut self, alignment: f32) -> Self { 152 self.alignment = Some(alignment); 153 self 154 } 155 cell_area<P: IsA<CellArea>>(mut self, cell_area: &P) -> Self156 pub fn cell_area<P: IsA<CellArea>>(mut self, cell_area: &P) -> Self { 157 self.cell_area = Some(cell_area.clone().upcast()); 158 self 159 } 160 clickable(mut self, clickable: bool) -> Self161 pub fn clickable(mut self, clickable: bool) -> Self { 162 self.clickable = Some(clickable); 163 self 164 } 165 expand(mut self, expand: bool) -> Self166 pub fn expand(mut self, expand: bool) -> Self { 167 self.expand = Some(expand); 168 self 169 } 170 fixed_width(mut self, fixed_width: i32) -> Self171 pub fn fixed_width(mut self, fixed_width: i32) -> Self { 172 self.fixed_width = Some(fixed_width); 173 self 174 } 175 max_width(mut self, max_width: i32) -> Self176 pub fn max_width(mut self, max_width: i32) -> Self { 177 self.max_width = Some(max_width); 178 self 179 } 180 min_width(mut self, min_width: i32) -> Self181 pub fn min_width(mut self, min_width: i32) -> Self { 182 self.min_width = Some(min_width); 183 self 184 } 185 reorderable(mut self, reorderable: bool) -> Self186 pub fn reorderable(mut self, reorderable: bool) -> Self { 187 self.reorderable = Some(reorderable); 188 self 189 } 190 resizable(mut self, resizable: bool) -> Self191 pub fn resizable(mut self, resizable: bool) -> Self { 192 self.resizable = Some(resizable); 193 self 194 } 195 sizing(mut self, sizing: TreeViewColumnSizing) -> Self196 pub fn sizing(mut self, sizing: TreeViewColumnSizing) -> Self { 197 self.sizing = Some(sizing); 198 self 199 } 200 sort_column_id(mut self, sort_column_id: i32) -> Self201 pub fn sort_column_id(mut self, sort_column_id: i32) -> Self { 202 self.sort_column_id = Some(sort_column_id); 203 self 204 } 205 sort_indicator(mut self, sort_indicator: bool) -> Self206 pub fn sort_indicator(mut self, sort_indicator: bool) -> Self { 207 self.sort_indicator = Some(sort_indicator); 208 self 209 } 210 sort_order(mut self, sort_order: SortType) -> Self211 pub fn sort_order(mut self, sort_order: SortType) -> Self { 212 self.sort_order = Some(sort_order); 213 self 214 } 215 spacing(mut self, spacing: i32) -> Self216 pub fn spacing(mut self, spacing: i32) -> Self { 217 self.spacing = Some(spacing); 218 self 219 } 220 title(mut self, title: &str) -> Self221 pub fn title(mut self, title: &str) -> Self { 222 self.title = Some(title.to_string()); 223 self 224 } 225 visible(mut self, visible: bool) -> Self226 pub fn visible(mut self, visible: bool) -> Self { 227 self.visible = Some(visible); 228 self 229 } 230 widget<P: IsA<Widget>>(mut self, widget: &P) -> Self231 pub fn widget<P: IsA<Widget>>(mut self, widget: &P) -> Self { 232 self.widget = Some(widget.clone().upcast()); 233 self 234 } 235 } 236 237 pub const NONE_TREE_VIEW_COLUMN: Option<&TreeViewColumn> = None; 238 239 pub trait TreeViewColumnExt: 'static { cell_get_position<P: IsA<CellRenderer>>(&self, cell_renderer: &P) -> Option<(i32, i32)>240 fn cell_get_position<P: IsA<CellRenderer>>(&self, cell_renderer: &P) -> Option<(i32, i32)>; 241 cell_get_size(&self, cell_area: Option<&gdk::Rectangle>) -> (i32, i32, i32, i32)242 fn cell_get_size(&self, cell_area: Option<&gdk::Rectangle>) -> (i32, i32, i32, i32); 243 cell_is_visible(&self) -> bool244 fn cell_is_visible(&self) -> bool; 245 cell_set_cell_data<P: IsA<TreeModel>>( &self, tree_model: &P, iter: &TreeIter, is_expander: bool, is_expanded: bool, )246 fn cell_set_cell_data<P: IsA<TreeModel>>( 247 &self, 248 tree_model: &P, 249 iter: &TreeIter, 250 is_expander: bool, 251 is_expanded: bool, 252 ); 253 clicked(&self)254 fn clicked(&self); 255 focus_cell<P: IsA<CellRenderer>>(&self, cell: &P)256 fn focus_cell<P: IsA<CellRenderer>>(&self, cell: &P); 257 get_alignment(&self) -> f32258 fn get_alignment(&self) -> f32; 259 get_button(&self) -> Option<Widget>260 fn get_button(&self) -> Option<Widget>; 261 get_clickable(&self) -> bool262 fn get_clickable(&self) -> bool; 263 get_expand(&self) -> bool264 fn get_expand(&self) -> bool; 265 get_fixed_width(&self) -> i32266 fn get_fixed_width(&self) -> i32; 267 get_max_width(&self) -> i32268 fn get_max_width(&self) -> i32; 269 get_min_width(&self) -> i32270 fn get_min_width(&self) -> i32; 271 get_reorderable(&self) -> bool272 fn get_reorderable(&self) -> bool; 273 get_resizable(&self) -> bool274 fn get_resizable(&self) -> bool; 275 get_sizing(&self) -> TreeViewColumnSizing276 fn get_sizing(&self) -> TreeViewColumnSizing; 277 get_sort_column_id(&self) -> i32278 fn get_sort_column_id(&self) -> i32; 279 get_sort_indicator(&self) -> bool280 fn get_sort_indicator(&self) -> bool; 281 get_sort_order(&self) -> SortType282 fn get_sort_order(&self) -> SortType; 283 get_spacing(&self) -> i32284 fn get_spacing(&self) -> i32; 285 get_title(&self) -> Option<GString>286 fn get_title(&self) -> Option<GString>; 287 get_tree_view(&self) -> Option<Widget>288 fn get_tree_view(&self) -> Option<Widget>; 289 get_visible(&self) -> bool290 fn get_visible(&self) -> bool; 291 get_widget(&self) -> Option<Widget>292 fn get_widget(&self) -> Option<Widget>; 293 get_width(&self) -> i32294 fn get_width(&self) -> i32; 295 get_x_offset(&self) -> i32296 fn get_x_offset(&self) -> i32; 297 queue_resize(&self)298 fn queue_resize(&self); 299 set_alignment(&self, xalign: f32)300 fn set_alignment(&self, xalign: f32); 301 set_cell_data_func<P: IsA<CellRenderer>>( &self, cell_renderer: &P, func: Option<Box_<dyn Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static>>, )302 fn set_cell_data_func<P: IsA<CellRenderer>>( 303 &self, 304 cell_renderer: &P, 305 func: Option<Box_<dyn Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static>>, 306 ); 307 set_clickable(&self, clickable: bool)308 fn set_clickable(&self, clickable: bool); 309 set_expand(&self, expand: bool)310 fn set_expand(&self, expand: bool); 311 set_fixed_width(&self, fixed_width: i32)312 fn set_fixed_width(&self, fixed_width: i32); 313 set_max_width(&self, max_width: i32)314 fn set_max_width(&self, max_width: i32); 315 set_min_width(&self, min_width: i32)316 fn set_min_width(&self, min_width: i32); 317 set_reorderable(&self, reorderable: bool)318 fn set_reorderable(&self, reorderable: bool); 319 set_resizable(&self, resizable: bool)320 fn set_resizable(&self, resizable: bool); 321 set_sizing(&self, type_: TreeViewColumnSizing)322 fn set_sizing(&self, type_: TreeViewColumnSizing); 323 set_sort_column_id(&self, sort_column_id: i32)324 fn set_sort_column_id(&self, sort_column_id: i32); 325 set_sort_indicator(&self, setting: bool)326 fn set_sort_indicator(&self, setting: bool); 327 set_sort_order(&self, order: SortType)328 fn set_sort_order(&self, order: SortType); 329 set_spacing(&self, spacing: i32)330 fn set_spacing(&self, spacing: i32); 331 set_title(&self, title: &str)332 fn set_title(&self, title: &str); 333 set_visible(&self, visible: bool)334 fn set_visible(&self, visible: bool); 335 set_widget<P: IsA<Widget>>(&self, widget: Option<&P>)336 fn set_widget<P: IsA<Widget>>(&self, widget: Option<&P>); 337 get_property_cell_area(&self) -> Option<CellArea>338 fn get_property_cell_area(&self) -> Option<CellArea>; 339 connect_clicked<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId340 fn connect_clicked<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 341 connect_property_alignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId342 fn connect_property_alignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 343 connect_property_clickable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId344 fn connect_property_clickable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 345 connect_property_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId346 fn connect_property_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 347 connect_property_fixed_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId348 fn connect_property_fixed_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 349 connect_property_max_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId350 fn connect_property_max_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 351 connect_property_min_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId352 fn connect_property_min_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 353 connect_property_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId354 fn connect_property_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 355 connect_property_resizable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId356 fn connect_property_resizable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 357 connect_property_sizing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId358 fn connect_property_sizing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 359 connect_property_sort_column_id_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId360 fn connect_property_sort_column_id_notify<F: Fn(&Self) + 'static>( 361 &self, 362 f: F, 363 ) -> SignalHandlerId; 364 connect_property_sort_indicator_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId365 fn connect_property_sort_indicator_notify<F: Fn(&Self) + 'static>( 366 &self, 367 f: F, 368 ) -> SignalHandlerId; 369 connect_property_sort_order_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId370 fn connect_property_sort_order_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 371 connect_property_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId372 fn connect_property_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 373 connect_property_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId374 fn connect_property_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 375 connect_property_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId376 fn connect_property_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 377 connect_property_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId378 fn connect_property_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 379 connect_property_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId380 fn connect_property_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 381 connect_property_x_offset_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId382 fn connect_property_x_offset_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; 383 } 384 385 impl<O: IsA<TreeViewColumn>> TreeViewColumnExt for O { cell_get_position<P: IsA<CellRenderer>>(&self, cell_renderer: &P) -> Option<(i32, i32)>386 fn cell_get_position<P: IsA<CellRenderer>>(&self, cell_renderer: &P) -> Option<(i32, i32)> { 387 unsafe { 388 let mut x_offset = mem::MaybeUninit::uninit(); 389 let mut width = mem::MaybeUninit::uninit(); 390 let ret = from_glib(gtk_sys::gtk_tree_view_column_cell_get_position( 391 self.as_ref().to_glib_none().0, 392 cell_renderer.as_ref().to_glib_none().0, 393 x_offset.as_mut_ptr(), 394 width.as_mut_ptr(), 395 )); 396 let x_offset = x_offset.assume_init(); 397 let width = width.assume_init(); 398 if ret { 399 Some((x_offset, width)) 400 } else { 401 None 402 } 403 } 404 } 405 cell_get_size(&self, cell_area: Option<&gdk::Rectangle>) -> (i32, i32, i32, i32)406 fn cell_get_size(&self, cell_area: Option<&gdk::Rectangle>) -> (i32, i32, i32, i32) { 407 unsafe { 408 let mut x_offset = mem::MaybeUninit::uninit(); 409 let mut y_offset = mem::MaybeUninit::uninit(); 410 let mut width = mem::MaybeUninit::uninit(); 411 let mut height = mem::MaybeUninit::uninit(); 412 gtk_sys::gtk_tree_view_column_cell_get_size( 413 self.as_ref().to_glib_none().0, 414 cell_area.to_glib_none().0, 415 x_offset.as_mut_ptr(), 416 y_offset.as_mut_ptr(), 417 width.as_mut_ptr(), 418 height.as_mut_ptr(), 419 ); 420 let x_offset = x_offset.assume_init(); 421 let y_offset = y_offset.assume_init(); 422 let width = width.assume_init(); 423 let height = height.assume_init(); 424 (x_offset, y_offset, width, height) 425 } 426 } 427 cell_is_visible(&self) -> bool428 fn cell_is_visible(&self) -> bool { 429 unsafe { 430 from_glib(gtk_sys::gtk_tree_view_column_cell_is_visible( 431 self.as_ref().to_glib_none().0, 432 )) 433 } 434 } 435 cell_set_cell_data<P: IsA<TreeModel>>( &self, tree_model: &P, iter: &TreeIter, is_expander: bool, is_expanded: bool, )436 fn cell_set_cell_data<P: IsA<TreeModel>>( 437 &self, 438 tree_model: &P, 439 iter: &TreeIter, 440 is_expander: bool, 441 is_expanded: bool, 442 ) { 443 unsafe { 444 gtk_sys::gtk_tree_view_column_cell_set_cell_data( 445 self.as_ref().to_glib_none().0, 446 tree_model.as_ref().to_glib_none().0, 447 mut_override(iter.to_glib_none().0), 448 is_expander.to_glib(), 449 is_expanded.to_glib(), 450 ); 451 } 452 } 453 clicked(&self)454 fn clicked(&self) { 455 unsafe { 456 gtk_sys::gtk_tree_view_column_clicked(self.as_ref().to_glib_none().0); 457 } 458 } 459 focus_cell<P: IsA<CellRenderer>>(&self, cell: &P)460 fn focus_cell<P: IsA<CellRenderer>>(&self, cell: &P) { 461 unsafe { 462 gtk_sys::gtk_tree_view_column_focus_cell( 463 self.as_ref().to_glib_none().0, 464 cell.as_ref().to_glib_none().0, 465 ); 466 } 467 } 468 get_alignment(&self) -> f32469 fn get_alignment(&self) -> f32 { 470 unsafe { gtk_sys::gtk_tree_view_column_get_alignment(self.as_ref().to_glib_none().0) } 471 } 472 get_button(&self) -> Option<Widget>473 fn get_button(&self) -> Option<Widget> { 474 unsafe { 475 from_glib_none(gtk_sys::gtk_tree_view_column_get_button( 476 self.as_ref().to_glib_none().0, 477 )) 478 } 479 } 480 get_clickable(&self) -> bool481 fn get_clickable(&self) -> bool { 482 unsafe { 483 from_glib(gtk_sys::gtk_tree_view_column_get_clickable( 484 self.as_ref().to_glib_none().0, 485 )) 486 } 487 } 488 get_expand(&self) -> bool489 fn get_expand(&self) -> bool { 490 unsafe { 491 from_glib(gtk_sys::gtk_tree_view_column_get_expand( 492 self.as_ref().to_glib_none().0, 493 )) 494 } 495 } 496 get_fixed_width(&self) -> i32497 fn get_fixed_width(&self) -> i32 { 498 unsafe { gtk_sys::gtk_tree_view_column_get_fixed_width(self.as_ref().to_glib_none().0) } 499 } 500 get_max_width(&self) -> i32501 fn get_max_width(&self) -> i32 { 502 unsafe { gtk_sys::gtk_tree_view_column_get_max_width(self.as_ref().to_glib_none().0) } 503 } 504 get_min_width(&self) -> i32505 fn get_min_width(&self) -> i32 { 506 unsafe { gtk_sys::gtk_tree_view_column_get_min_width(self.as_ref().to_glib_none().0) } 507 } 508 get_reorderable(&self) -> bool509 fn get_reorderable(&self) -> bool { 510 unsafe { 511 from_glib(gtk_sys::gtk_tree_view_column_get_reorderable( 512 self.as_ref().to_glib_none().0, 513 )) 514 } 515 } 516 get_resizable(&self) -> bool517 fn get_resizable(&self) -> bool { 518 unsafe { 519 from_glib(gtk_sys::gtk_tree_view_column_get_resizable( 520 self.as_ref().to_glib_none().0, 521 )) 522 } 523 } 524 get_sizing(&self) -> TreeViewColumnSizing525 fn get_sizing(&self) -> TreeViewColumnSizing { 526 unsafe { 527 from_glib(gtk_sys::gtk_tree_view_column_get_sizing( 528 self.as_ref().to_glib_none().0, 529 )) 530 } 531 } 532 get_sort_column_id(&self) -> i32533 fn get_sort_column_id(&self) -> i32 { 534 unsafe { gtk_sys::gtk_tree_view_column_get_sort_column_id(self.as_ref().to_glib_none().0) } 535 } 536 get_sort_indicator(&self) -> bool537 fn get_sort_indicator(&self) -> bool { 538 unsafe { 539 from_glib(gtk_sys::gtk_tree_view_column_get_sort_indicator( 540 self.as_ref().to_glib_none().0, 541 )) 542 } 543 } 544 get_sort_order(&self) -> SortType545 fn get_sort_order(&self) -> SortType { 546 unsafe { 547 from_glib(gtk_sys::gtk_tree_view_column_get_sort_order( 548 self.as_ref().to_glib_none().0, 549 )) 550 } 551 } 552 get_spacing(&self) -> i32553 fn get_spacing(&self) -> i32 { 554 unsafe { gtk_sys::gtk_tree_view_column_get_spacing(self.as_ref().to_glib_none().0) } 555 } 556 get_title(&self) -> Option<GString>557 fn get_title(&self) -> Option<GString> { 558 unsafe { 559 from_glib_none(gtk_sys::gtk_tree_view_column_get_title( 560 self.as_ref().to_glib_none().0, 561 )) 562 } 563 } 564 get_tree_view(&self) -> Option<Widget>565 fn get_tree_view(&self) -> Option<Widget> { 566 unsafe { 567 from_glib_none(gtk_sys::gtk_tree_view_column_get_tree_view( 568 self.as_ref().to_glib_none().0, 569 )) 570 } 571 } 572 get_visible(&self) -> bool573 fn get_visible(&self) -> bool { 574 unsafe { 575 from_glib(gtk_sys::gtk_tree_view_column_get_visible( 576 self.as_ref().to_glib_none().0, 577 )) 578 } 579 } 580 get_widget(&self) -> Option<Widget>581 fn get_widget(&self) -> Option<Widget> { 582 unsafe { 583 from_glib_none(gtk_sys::gtk_tree_view_column_get_widget( 584 self.as_ref().to_glib_none().0, 585 )) 586 } 587 } 588 get_width(&self) -> i32589 fn get_width(&self) -> i32 { 590 unsafe { gtk_sys::gtk_tree_view_column_get_width(self.as_ref().to_glib_none().0) } 591 } 592 get_x_offset(&self) -> i32593 fn get_x_offset(&self) -> i32 { 594 unsafe { gtk_sys::gtk_tree_view_column_get_x_offset(self.as_ref().to_glib_none().0) } 595 } 596 queue_resize(&self)597 fn queue_resize(&self) { 598 unsafe { 599 gtk_sys::gtk_tree_view_column_queue_resize(self.as_ref().to_glib_none().0); 600 } 601 } 602 set_alignment(&self, xalign: f32)603 fn set_alignment(&self, xalign: f32) { 604 unsafe { 605 gtk_sys::gtk_tree_view_column_set_alignment(self.as_ref().to_glib_none().0, xalign); 606 } 607 } 608 set_cell_data_func<P: IsA<CellRenderer>>( &self, cell_renderer: &P, func: Option<Box_<dyn Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static>>, )609 fn set_cell_data_func<P: IsA<CellRenderer>>( 610 &self, 611 cell_renderer: &P, 612 func: Option<Box_<dyn Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static>>, 613 ) { 614 let func_data: Box_< 615 Option<Box_<dyn Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static>>, 616 > = Box_::new(func); 617 unsafe extern "C" fn func_func<P: IsA<CellRenderer>>( 618 tree_column: *mut gtk_sys::GtkTreeViewColumn, 619 cell: *mut gtk_sys::GtkCellRenderer, 620 tree_model: *mut gtk_sys::GtkTreeModel, 621 iter: *mut gtk_sys::GtkTreeIter, 622 data: glib_sys::gpointer, 623 ) { 624 let tree_column = from_glib_borrow(tree_column); 625 let cell = from_glib_borrow(cell); 626 let tree_model = from_glib_borrow(tree_model); 627 let iter = from_glib_borrow(iter); 628 let callback: &Option< 629 Box_<dyn Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static>, 630 > = &*(data as *mut _); 631 if let Some(ref callback) = *callback { 632 callback(&tree_column, &cell, &tree_model, &iter) 633 } else { 634 panic!("cannot get closure...") 635 }; 636 } 637 let func = if func_data.is_some() { 638 Some(func_func::<P> as _) 639 } else { 640 None 641 }; 642 unsafe extern "C" fn destroy_func<P: IsA<CellRenderer>>(data: glib_sys::gpointer) { 643 let _callback: Box_< 644 Option< 645 Box_<dyn Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static>, 646 >, 647 > = Box_::from_raw(data as *mut _); 648 } 649 let destroy_call4 = Some(destroy_func::<P> as _); 650 let super_callback0: Box_< 651 Option<Box_<dyn Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static>>, 652 > = func_data; 653 unsafe { 654 gtk_sys::gtk_tree_view_column_set_cell_data_func( 655 self.as_ref().to_glib_none().0, 656 cell_renderer.as_ref().to_glib_none().0, 657 func, 658 Box_::into_raw(super_callback0) as *mut _, 659 destroy_call4, 660 ); 661 } 662 } 663 set_clickable(&self, clickable: bool)664 fn set_clickable(&self, clickable: bool) { 665 unsafe { 666 gtk_sys::gtk_tree_view_column_set_clickable( 667 self.as_ref().to_glib_none().0, 668 clickable.to_glib(), 669 ); 670 } 671 } 672 set_expand(&self, expand: bool)673 fn set_expand(&self, expand: bool) { 674 unsafe { 675 gtk_sys::gtk_tree_view_column_set_expand( 676 self.as_ref().to_glib_none().0, 677 expand.to_glib(), 678 ); 679 } 680 } 681 set_fixed_width(&self, fixed_width: i32)682 fn set_fixed_width(&self, fixed_width: i32) { 683 unsafe { 684 gtk_sys::gtk_tree_view_column_set_fixed_width( 685 self.as_ref().to_glib_none().0, 686 fixed_width, 687 ); 688 } 689 } 690 set_max_width(&self, max_width: i32)691 fn set_max_width(&self, max_width: i32) { 692 unsafe { 693 gtk_sys::gtk_tree_view_column_set_max_width(self.as_ref().to_glib_none().0, max_width); 694 } 695 } 696 set_min_width(&self, min_width: i32)697 fn set_min_width(&self, min_width: i32) { 698 unsafe { 699 gtk_sys::gtk_tree_view_column_set_min_width(self.as_ref().to_glib_none().0, min_width); 700 } 701 } 702 set_reorderable(&self, reorderable: bool)703 fn set_reorderable(&self, reorderable: bool) { 704 unsafe { 705 gtk_sys::gtk_tree_view_column_set_reorderable( 706 self.as_ref().to_glib_none().0, 707 reorderable.to_glib(), 708 ); 709 } 710 } 711 set_resizable(&self, resizable: bool)712 fn set_resizable(&self, resizable: bool) { 713 unsafe { 714 gtk_sys::gtk_tree_view_column_set_resizable( 715 self.as_ref().to_glib_none().0, 716 resizable.to_glib(), 717 ); 718 } 719 } 720 set_sizing(&self, type_: TreeViewColumnSizing)721 fn set_sizing(&self, type_: TreeViewColumnSizing) { 722 unsafe { 723 gtk_sys::gtk_tree_view_column_set_sizing( 724 self.as_ref().to_glib_none().0, 725 type_.to_glib(), 726 ); 727 } 728 } 729 set_sort_column_id(&self, sort_column_id: i32)730 fn set_sort_column_id(&self, sort_column_id: i32) { 731 unsafe { 732 gtk_sys::gtk_tree_view_column_set_sort_column_id( 733 self.as_ref().to_glib_none().0, 734 sort_column_id, 735 ); 736 } 737 } 738 set_sort_indicator(&self, setting: bool)739 fn set_sort_indicator(&self, setting: bool) { 740 unsafe { 741 gtk_sys::gtk_tree_view_column_set_sort_indicator( 742 self.as_ref().to_glib_none().0, 743 setting.to_glib(), 744 ); 745 } 746 } 747 set_sort_order(&self, order: SortType)748 fn set_sort_order(&self, order: SortType) { 749 unsafe { 750 gtk_sys::gtk_tree_view_column_set_sort_order( 751 self.as_ref().to_glib_none().0, 752 order.to_glib(), 753 ); 754 } 755 } 756 set_spacing(&self, spacing: i32)757 fn set_spacing(&self, spacing: i32) { 758 unsafe { 759 gtk_sys::gtk_tree_view_column_set_spacing(self.as_ref().to_glib_none().0, spacing); 760 } 761 } 762 set_title(&self, title: &str)763 fn set_title(&self, title: &str) { 764 unsafe { 765 gtk_sys::gtk_tree_view_column_set_title( 766 self.as_ref().to_glib_none().0, 767 title.to_glib_none().0, 768 ); 769 } 770 } 771 set_visible(&self, visible: bool)772 fn set_visible(&self, visible: bool) { 773 unsafe { 774 gtk_sys::gtk_tree_view_column_set_visible( 775 self.as_ref().to_glib_none().0, 776 visible.to_glib(), 777 ); 778 } 779 } 780 set_widget<P: IsA<Widget>>(&self, widget: Option<&P>)781 fn set_widget<P: IsA<Widget>>(&self, widget: Option<&P>) { 782 unsafe { 783 gtk_sys::gtk_tree_view_column_set_widget( 784 self.as_ref().to_glib_none().0, 785 widget.map(|p| p.as_ref()).to_glib_none().0, 786 ); 787 } 788 } 789 get_property_cell_area(&self) -> Option<CellArea>790 fn get_property_cell_area(&self) -> Option<CellArea> { 791 unsafe { 792 let mut value = Value::from_type(<CellArea as StaticType>::static_type()); 793 gobject_sys::g_object_get_property( 794 self.to_glib_none().0 as *mut gobject_sys::GObject, 795 b"cell-area\0".as_ptr() as *const _, 796 value.to_glib_none_mut().0, 797 ); 798 value 799 .get() 800 .expect("Return Value for property `cell-area` getter") 801 } 802 } 803 connect_clicked<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId804 fn connect_clicked<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 805 unsafe extern "C" fn clicked_trampoline<P, F: Fn(&P) + 'static>( 806 this: *mut gtk_sys::GtkTreeViewColumn, 807 f: glib_sys::gpointer, 808 ) where 809 P: IsA<TreeViewColumn>, 810 { 811 let f: &F = &*(f as *const F); 812 f(&TreeViewColumn::from_glib_borrow(this).unsafe_cast()) 813 } 814 unsafe { 815 let f: Box_<F> = Box_::new(f); 816 connect_raw( 817 self.as_ptr() as *mut _, 818 b"clicked\0".as_ptr() as *const _, 819 Some(transmute(clicked_trampoline::<Self, F> as usize)), 820 Box_::into_raw(f), 821 ) 822 } 823 } 824 connect_property_alignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId825 fn connect_property_alignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 826 unsafe extern "C" fn notify_alignment_trampoline<P, F: Fn(&P) + 'static>( 827 this: *mut gtk_sys::GtkTreeViewColumn, 828 _param_spec: glib_sys::gpointer, 829 f: glib_sys::gpointer, 830 ) where 831 P: IsA<TreeViewColumn>, 832 { 833 let f: &F = &*(f as *const F); 834 f(&TreeViewColumn::from_glib_borrow(this).unsafe_cast()) 835 } 836 unsafe { 837 let f: Box_<F> = Box_::new(f); 838 connect_raw( 839 self.as_ptr() as *mut _, 840 b"notify::alignment\0".as_ptr() as *const _, 841 Some(transmute(notify_alignment_trampoline::<Self, F> as usize)), 842 Box_::into_raw(f), 843 ) 844 } 845 } 846 connect_property_clickable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId847 fn connect_property_clickable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 848 unsafe extern "C" fn notify_clickable_trampoline<P, F: Fn(&P) + 'static>( 849 this: *mut gtk_sys::GtkTreeViewColumn, 850 _param_spec: glib_sys::gpointer, 851 f: glib_sys::gpointer, 852 ) where 853 P: IsA<TreeViewColumn>, 854 { 855 let f: &F = &*(f as *const F); 856 f(&TreeViewColumn::from_glib_borrow(this).unsafe_cast()) 857 } 858 unsafe { 859 let f: Box_<F> = Box_::new(f); 860 connect_raw( 861 self.as_ptr() as *mut _, 862 b"notify::clickable\0".as_ptr() as *const _, 863 Some(transmute(notify_clickable_trampoline::<Self, F> as usize)), 864 Box_::into_raw(f), 865 ) 866 } 867 } 868 connect_property_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId869 fn connect_property_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 870 unsafe extern "C" fn notify_expand_trampoline<P, F: Fn(&P) + 'static>( 871 this: *mut gtk_sys::GtkTreeViewColumn, 872 _param_spec: glib_sys::gpointer, 873 f: glib_sys::gpointer, 874 ) where 875 P: IsA<TreeViewColumn>, 876 { 877 let f: &F = &*(f as *const F); 878 f(&TreeViewColumn::from_glib_borrow(this).unsafe_cast()) 879 } 880 unsafe { 881 let f: Box_<F> = Box_::new(f); 882 connect_raw( 883 self.as_ptr() as *mut _, 884 b"notify::expand\0".as_ptr() as *const _, 885 Some(transmute(notify_expand_trampoline::<Self, F> as usize)), 886 Box_::into_raw(f), 887 ) 888 } 889 } 890 connect_property_fixed_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId891 fn connect_property_fixed_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 892 unsafe extern "C" fn notify_fixed_width_trampoline<P, F: Fn(&P) + 'static>( 893 this: *mut gtk_sys::GtkTreeViewColumn, 894 _param_spec: glib_sys::gpointer, 895 f: glib_sys::gpointer, 896 ) where 897 P: IsA<TreeViewColumn>, 898 { 899 let f: &F = &*(f as *const F); 900 f(&TreeViewColumn::from_glib_borrow(this).unsafe_cast()) 901 } 902 unsafe { 903 let f: Box_<F> = Box_::new(f); 904 connect_raw( 905 self.as_ptr() as *mut _, 906 b"notify::fixed-width\0".as_ptr() as *const _, 907 Some(transmute(notify_fixed_width_trampoline::<Self, F> as usize)), 908 Box_::into_raw(f), 909 ) 910 } 911 } 912 connect_property_max_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId913 fn connect_property_max_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 914 unsafe extern "C" fn notify_max_width_trampoline<P, F: Fn(&P) + 'static>( 915 this: *mut gtk_sys::GtkTreeViewColumn, 916 _param_spec: glib_sys::gpointer, 917 f: glib_sys::gpointer, 918 ) where 919 P: IsA<TreeViewColumn>, 920 { 921 let f: &F = &*(f as *const F); 922 f(&TreeViewColumn::from_glib_borrow(this).unsafe_cast()) 923 } 924 unsafe { 925 let f: Box_<F> = Box_::new(f); 926 connect_raw( 927 self.as_ptr() as *mut _, 928 b"notify::max-width\0".as_ptr() as *const _, 929 Some(transmute(notify_max_width_trampoline::<Self, F> as usize)), 930 Box_::into_raw(f), 931 ) 932 } 933 } 934 connect_property_min_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId935 fn connect_property_min_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 936 unsafe extern "C" fn notify_min_width_trampoline<P, F: Fn(&P) + 'static>( 937 this: *mut gtk_sys::GtkTreeViewColumn, 938 _param_spec: glib_sys::gpointer, 939 f: glib_sys::gpointer, 940 ) where 941 P: IsA<TreeViewColumn>, 942 { 943 let f: &F = &*(f as *const F); 944 f(&TreeViewColumn::from_glib_borrow(this).unsafe_cast()) 945 } 946 unsafe { 947 let f: Box_<F> = Box_::new(f); 948 connect_raw( 949 self.as_ptr() as *mut _, 950 b"notify::min-width\0".as_ptr() as *const _, 951 Some(transmute(notify_min_width_trampoline::<Self, F> as usize)), 952 Box_::into_raw(f), 953 ) 954 } 955 } 956 connect_property_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId957 fn connect_property_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 958 unsafe extern "C" fn notify_reorderable_trampoline<P, F: Fn(&P) + 'static>( 959 this: *mut gtk_sys::GtkTreeViewColumn, 960 _param_spec: glib_sys::gpointer, 961 f: glib_sys::gpointer, 962 ) where 963 P: IsA<TreeViewColumn>, 964 { 965 let f: &F = &*(f as *const F); 966 f(&TreeViewColumn::from_glib_borrow(this).unsafe_cast()) 967 } 968 unsafe { 969 let f: Box_<F> = Box_::new(f); 970 connect_raw( 971 self.as_ptr() as *mut _, 972 b"notify::reorderable\0".as_ptr() as *const _, 973 Some(transmute(notify_reorderable_trampoline::<Self, F> as usize)), 974 Box_::into_raw(f), 975 ) 976 } 977 } 978 connect_property_resizable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId979 fn connect_property_resizable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 980 unsafe extern "C" fn notify_resizable_trampoline<P, F: Fn(&P) + 'static>( 981 this: *mut gtk_sys::GtkTreeViewColumn, 982 _param_spec: glib_sys::gpointer, 983 f: glib_sys::gpointer, 984 ) where 985 P: IsA<TreeViewColumn>, 986 { 987 let f: &F = &*(f as *const F); 988 f(&TreeViewColumn::from_glib_borrow(this).unsafe_cast()) 989 } 990 unsafe { 991 let f: Box_<F> = Box_::new(f); 992 connect_raw( 993 self.as_ptr() as *mut _, 994 b"notify::resizable\0".as_ptr() as *const _, 995 Some(transmute(notify_resizable_trampoline::<Self, F> as usize)), 996 Box_::into_raw(f), 997 ) 998 } 999 } 1000 connect_property_sizing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1001 fn connect_property_sizing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1002 unsafe extern "C" fn notify_sizing_trampoline<P, F: Fn(&P) + 'static>( 1003 this: *mut gtk_sys::GtkTreeViewColumn, 1004 _param_spec: glib_sys::gpointer, 1005 f: glib_sys::gpointer, 1006 ) where 1007 P: IsA<TreeViewColumn>, 1008 { 1009 let f: &F = &*(f as *const F); 1010 f(&TreeViewColumn::from_glib_borrow(this).unsafe_cast()) 1011 } 1012 unsafe { 1013 let f: Box_<F> = Box_::new(f); 1014 connect_raw( 1015 self.as_ptr() as *mut _, 1016 b"notify::sizing\0".as_ptr() as *const _, 1017 Some(transmute(notify_sizing_trampoline::<Self, F> as usize)), 1018 Box_::into_raw(f), 1019 ) 1020 } 1021 } 1022 connect_property_sort_column_id_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1023 fn connect_property_sort_column_id_notify<F: Fn(&Self) + 'static>( 1024 &self, 1025 f: F, 1026 ) -> SignalHandlerId { 1027 unsafe extern "C" fn notify_sort_column_id_trampoline<P, F: Fn(&P) + 'static>( 1028 this: *mut gtk_sys::GtkTreeViewColumn, 1029 _param_spec: glib_sys::gpointer, 1030 f: glib_sys::gpointer, 1031 ) where 1032 P: IsA<TreeViewColumn>, 1033 { 1034 let f: &F = &*(f as *const F); 1035 f(&TreeViewColumn::from_glib_borrow(this).unsafe_cast()) 1036 } 1037 unsafe { 1038 let f: Box_<F> = Box_::new(f); 1039 connect_raw( 1040 self.as_ptr() as *mut _, 1041 b"notify::sort-column-id\0".as_ptr() as *const _, 1042 Some(transmute( 1043 notify_sort_column_id_trampoline::<Self, F> as usize, 1044 )), 1045 Box_::into_raw(f), 1046 ) 1047 } 1048 } 1049 connect_property_sort_indicator_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId1050 fn connect_property_sort_indicator_notify<F: Fn(&Self) + 'static>( 1051 &self, 1052 f: F, 1053 ) -> SignalHandlerId { 1054 unsafe extern "C" fn notify_sort_indicator_trampoline<P, F: Fn(&P) + 'static>( 1055 this: *mut gtk_sys::GtkTreeViewColumn, 1056 _param_spec: glib_sys::gpointer, 1057 f: glib_sys::gpointer, 1058 ) where 1059 P: IsA<TreeViewColumn>, 1060 { 1061 let f: &F = &*(f as *const F); 1062 f(&TreeViewColumn::from_glib_borrow(this).unsafe_cast()) 1063 } 1064 unsafe { 1065 let f: Box_<F> = Box_::new(f); 1066 connect_raw( 1067 self.as_ptr() as *mut _, 1068 b"notify::sort-indicator\0".as_ptr() as *const _, 1069 Some(transmute( 1070 notify_sort_indicator_trampoline::<Self, F> as usize, 1071 )), 1072 Box_::into_raw(f), 1073 ) 1074 } 1075 } 1076 connect_property_sort_order_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1077 fn connect_property_sort_order_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1078 unsafe extern "C" fn notify_sort_order_trampoline<P, F: Fn(&P) + 'static>( 1079 this: *mut gtk_sys::GtkTreeViewColumn, 1080 _param_spec: glib_sys::gpointer, 1081 f: glib_sys::gpointer, 1082 ) where 1083 P: IsA<TreeViewColumn>, 1084 { 1085 let f: &F = &*(f as *const F); 1086 f(&TreeViewColumn::from_glib_borrow(this).unsafe_cast()) 1087 } 1088 unsafe { 1089 let f: Box_<F> = Box_::new(f); 1090 connect_raw( 1091 self.as_ptr() as *mut _, 1092 b"notify::sort-order\0".as_ptr() as *const _, 1093 Some(transmute(notify_sort_order_trampoline::<Self, F> as usize)), 1094 Box_::into_raw(f), 1095 ) 1096 } 1097 } 1098 connect_property_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1099 fn connect_property_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1100 unsafe extern "C" fn notify_spacing_trampoline<P, F: Fn(&P) + 'static>( 1101 this: *mut gtk_sys::GtkTreeViewColumn, 1102 _param_spec: glib_sys::gpointer, 1103 f: glib_sys::gpointer, 1104 ) where 1105 P: IsA<TreeViewColumn>, 1106 { 1107 let f: &F = &*(f as *const F); 1108 f(&TreeViewColumn::from_glib_borrow(this).unsafe_cast()) 1109 } 1110 unsafe { 1111 let f: Box_<F> = Box_::new(f); 1112 connect_raw( 1113 self.as_ptr() as *mut _, 1114 b"notify::spacing\0".as_ptr() as *const _, 1115 Some(transmute(notify_spacing_trampoline::<Self, F> as usize)), 1116 Box_::into_raw(f), 1117 ) 1118 } 1119 } 1120 connect_property_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1121 fn connect_property_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1122 unsafe extern "C" fn notify_title_trampoline<P, F: Fn(&P) + 'static>( 1123 this: *mut gtk_sys::GtkTreeViewColumn, 1124 _param_spec: glib_sys::gpointer, 1125 f: glib_sys::gpointer, 1126 ) where 1127 P: IsA<TreeViewColumn>, 1128 { 1129 let f: &F = &*(f as *const F); 1130 f(&TreeViewColumn::from_glib_borrow(this).unsafe_cast()) 1131 } 1132 unsafe { 1133 let f: Box_<F> = Box_::new(f); 1134 connect_raw( 1135 self.as_ptr() as *mut _, 1136 b"notify::title\0".as_ptr() as *const _, 1137 Some(transmute(notify_title_trampoline::<Self, F> as usize)), 1138 Box_::into_raw(f), 1139 ) 1140 } 1141 } 1142 connect_property_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1143 fn connect_property_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1144 unsafe extern "C" fn notify_visible_trampoline<P, F: Fn(&P) + 'static>( 1145 this: *mut gtk_sys::GtkTreeViewColumn, 1146 _param_spec: glib_sys::gpointer, 1147 f: glib_sys::gpointer, 1148 ) where 1149 P: IsA<TreeViewColumn>, 1150 { 1151 let f: &F = &*(f as *const F); 1152 f(&TreeViewColumn::from_glib_borrow(this).unsafe_cast()) 1153 } 1154 unsafe { 1155 let f: Box_<F> = Box_::new(f); 1156 connect_raw( 1157 self.as_ptr() as *mut _, 1158 b"notify::visible\0".as_ptr() as *const _, 1159 Some(transmute(notify_visible_trampoline::<Self, F> as usize)), 1160 Box_::into_raw(f), 1161 ) 1162 } 1163 } 1164 connect_property_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1165 fn connect_property_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1166 unsafe extern "C" fn notify_widget_trampoline<P, F: Fn(&P) + 'static>( 1167 this: *mut gtk_sys::GtkTreeViewColumn, 1168 _param_spec: glib_sys::gpointer, 1169 f: glib_sys::gpointer, 1170 ) where 1171 P: IsA<TreeViewColumn>, 1172 { 1173 let f: &F = &*(f as *const F); 1174 f(&TreeViewColumn::from_glib_borrow(this).unsafe_cast()) 1175 } 1176 unsafe { 1177 let f: Box_<F> = Box_::new(f); 1178 connect_raw( 1179 self.as_ptr() as *mut _, 1180 b"notify::widget\0".as_ptr() as *const _, 1181 Some(transmute(notify_widget_trampoline::<Self, F> as usize)), 1182 Box_::into_raw(f), 1183 ) 1184 } 1185 } 1186 connect_property_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1187 fn connect_property_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1188 unsafe extern "C" fn notify_width_trampoline<P, F: Fn(&P) + 'static>( 1189 this: *mut gtk_sys::GtkTreeViewColumn, 1190 _param_spec: glib_sys::gpointer, 1191 f: glib_sys::gpointer, 1192 ) where 1193 P: IsA<TreeViewColumn>, 1194 { 1195 let f: &F = &*(f as *const F); 1196 f(&TreeViewColumn::from_glib_borrow(this).unsafe_cast()) 1197 } 1198 unsafe { 1199 let f: Box_<F> = Box_::new(f); 1200 connect_raw( 1201 self.as_ptr() as *mut _, 1202 b"notify::width\0".as_ptr() as *const _, 1203 Some(transmute(notify_width_trampoline::<Self, F> as usize)), 1204 Box_::into_raw(f), 1205 ) 1206 } 1207 } 1208 connect_property_x_offset_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId1209 fn connect_property_x_offset_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { 1210 unsafe extern "C" fn notify_x_offset_trampoline<P, F: Fn(&P) + 'static>( 1211 this: *mut gtk_sys::GtkTreeViewColumn, 1212 _param_spec: glib_sys::gpointer, 1213 f: glib_sys::gpointer, 1214 ) where 1215 P: IsA<TreeViewColumn>, 1216 { 1217 let f: &F = &*(f as *const F); 1218 f(&TreeViewColumn::from_glib_borrow(this).unsafe_cast()) 1219 } 1220 unsafe { 1221 let f: Box_<F> = Box_::new(f); 1222 connect_raw( 1223 self.as_ptr() as *mut _, 1224 b"notify::x-offset\0".as_ptr() as *const _, 1225 Some(transmute(notify_x_offset_trampoline::<Self, F> as usize)), 1226 Box_::into_raw(f), 1227 ) 1228 } 1229 } 1230 } 1231 1232 impl fmt::Display for TreeViewColumn { fmt(&self, f: &mut fmt::Formatter) -> fmt::Result1233 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { 1234 write!(f, "TreeViewColumn") 1235 } 1236 } 1237