1use crate::{
6 Buildable, CellArea, CellLayout, CellRenderer, SortType, TreeIter, TreeModel,
7 TreeViewColumnSizing, Widget,
8};
9use glib::{
10 prelude::*,
11 signal::{connect_raw, SignalHandlerId},
12 translate::*,
13};
14use std::{boxed::Box as Box_, fmt, mem, mem::transmute};
15
16glib::wrapper! {
17 #[doc(alias = "GtkTreeViewColumn")]
121 pub struct TreeViewColumn(Object<ffi::GtkTreeViewColumn, ffi::GtkTreeViewColumnClass>) @implements Buildable, CellLayout;
122
123 match fn {
124 type_ => || ffi::gtk_tree_view_column_get_type(),
125 }
126}
127
128impl TreeViewColumn {
129 pub const NONE: Option<&'static TreeViewColumn> = None;
130
131 #[doc(alias = "gtk_tree_view_column_new")]
137 pub fn new() -> TreeViewColumn {
138 assert_initialized_main_thread!();
139 unsafe { from_glib_none(ffi::gtk_tree_view_column_new()) }
140 }
141
142 #[doc(alias = "gtk_tree_view_column_new_with_area")]
150 #[doc(alias = "new_with_area")]
151 pub fn with_area(area: &impl IsA<CellArea>) -> TreeViewColumn {
152 skip_assert_initialized!();
153 unsafe {
154 from_glib_none(ffi::gtk_tree_view_column_new_with_area(
155 area.as_ref().to_glib_none().0,
156 ))
157 }
158 }
159
160 pub fn builder() -> TreeViewColumnBuilder {
165 TreeViewColumnBuilder::new()
166 }
167}
168
169impl Default for TreeViewColumn {
170 fn default() -> Self {
171 Self::new()
172 }
173}
174
175#[must_use = "The builder must be built to be used"]
180pub struct TreeViewColumnBuilder {
181 builder: glib::object::ObjectBuilder<'static, TreeViewColumn>,
182}
183
184impl TreeViewColumnBuilder {
185 fn new() -> Self {
186 Self {
187 builder: glib::object::Object::builder(),
188 }
189 }
190
191 pub fn alignment(self, alignment: f32) -> Self {
192 Self {
193 builder: self.builder.property("alignment", alignment),
194 }
195 }
196
197 pub fn cell_area(self, cell_area: &impl IsA<CellArea>) -> Self {
202 Self {
203 builder: self
204 .builder
205 .property("cell-area", cell_area.clone().upcast()),
206 }
207 }
208
209 pub fn clickable(self, clickable: bool) -> Self {
210 Self {
211 builder: self.builder.property("clickable", clickable),
212 }
213 }
214
215 pub fn expand(self, expand: bool) -> Self {
216 Self {
217 builder: self.builder.property("expand", expand),
218 }
219 }
220
221 pub fn fixed_width(self, fixed_width: i32) -> Self {
222 Self {
223 builder: self.builder.property("fixed-width", fixed_width),
224 }
225 }
226
227 pub fn max_width(self, max_width: i32) -> Self {
228 Self {
229 builder: self.builder.property("max-width", max_width),
230 }
231 }
232
233 pub fn min_width(self, min_width: i32) -> Self {
234 Self {
235 builder: self.builder.property("min-width", min_width),
236 }
237 }
238
239 pub fn reorderable(self, reorderable: bool) -> Self {
240 Self {
241 builder: self.builder.property("reorderable", reorderable),
242 }
243 }
244
245 pub fn resizable(self, resizable: bool) -> Self {
246 Self {
247 builder: self.builder.property("resizable", resizable),
248 }
249 }
250
251 pub fn sizing(self, sizing: TreeViewColumnSizing) -> Self {
252 Self {
253 builder: self.builder.property("sizing", sizing),
254 }
255 }
256
257 pub fn sort_column_id(self, sort_column_id: i32) -> Self {
260 Self {
261 builder: self.builder.property("sort-column-id", sort_column_id),
262 }
263 }
264
265 pub fn sort_indicator(self, sort_indicator: bool) -> Self {
266 Self {
267 builder: self.builder.property("sort-indicator", sort_indicator),
268 }
269 }
270
271 pub fn sort_order(self, sort_order: SortType) -> Self {
272 Self {
273 builder: self.builder.property("sort-order", sort_order),
274 }
275 }
276
277 pub fn spacing(self, spacing: i32) -> Self {
278 Self {
279 builder: self.builder.property("spacing", spacing),
280 }
281 }
282
283 pub fn title(self, title: impl Into<glib::GString>) -> Self {
284 Self {
285 builder: self.builder.property("title", title.into()),
286 }
287 }
288
289 pub fn visible(self, visible: bool) -> Self {
290 Self {
291 builder: self.builder.property("visible", visible),
292 }
293 }
294
295 pub fn widget(self, widget: &impl IsA<Widget>) -> Self {
296 Self {
297 builder: self.builder.property("widget", widget.clone().upcast()),
298 }
299 }
300
301 #[must_use = "Building the object from the builder is usually expensive and is not expected to have side effects"]
304 pub fn build(self) -> TreeViewColumn {
305 self.builder.build()
306 }
307}
308
309mod sealed {
310 pub trait Sealed {}
311 impl<T: super::IsA<super::TreeViewColumn>> Sealed for T {}
312}
313
314pub trait TreeViewColumnExt: IsA<TreeViewColumn> + sealed::Sealed + 'static {
320 #[doc(alias = "gtk_tree_view_column_add_attribute")]
333 fn add_attribute(&self, cell_renderer: &impl IsA<CellRenderer>, attribute: &str, column: i32) {
334 unsafe {
335 ffi::gtk_tree_view_column_add_attribute(
336 self.as_ref().to_glib_none().0,
337 cell_renderer.as_ref().to_glib_none().0,
338 attribute.to_glib_none().0,
339 column,
340 );
341 }
342 }
343
344 #[doc(alias = "gtk_tree_view_column_cell_get_position")]
362 fn cell_get_position(&self, cell_renderer: &impl IsA<CellRenderer>) -> Option<(i32, i32)> {
363 unsafe {
364 let mut x_offset = mem::MaybeUninit::uninit();
365 let mut width = mem::MaybeUninit::uninit();
366 let ret = from_glib(ffi::gtk_tree_view_column_cell_get_position(
367 self.as_ref().to_glib_none().0,
368 cell_renderer.as_ref().to_glib_none().0,
369 x_offset.as_mut_ptr(),
370 width.as_mut_ptr(),
371 ));
372 if ret {
373 Some((x_offset.assume_init(), width.assume_init()))
374 } else {
375 None
376 }
377 }
378 }
379
380 #[doc(alias = "gtk_tree_view_column_cell_get_size")]
400 fn cell_get_size(&self, cell_area: Option<&gdk::Rectangle>) -> (i32, i32, i32, i32) {
401 unsafe {
402 let mut x_offset = mem::MaybeUninit::uninit();
403 let mut y_offset = mem::MaybeUninit::uninit();
404 let mut width = mem::MaybeUninit::uninit();
405 let mut height = mem::MaybeUninit::uninit();
406 ffi::gtk_tree_view_column_cell_get_size(
407 self.as_ref().to_glib_none().0,
408 cell_area.to_glib_none().0,
409 x_offset.as_mut_ptr(),
410 y_offset.as_mut_ptr(),
411 width.as_mut_ptr(),
412 height.as_mut_ptr(),
413 );
414 (
415 x_offset.assume_init(),
416 y_offset.assume_init(),
417 width.assume_init(),
418 height.assume_init(),
419 )
420 }
421 }
422
423 #[doc(alias = "gtk_tree_view_column_cell_is_visible")]
431 fn cell_is_visible(&self) -> bool {
432 unsafe {
433 from_glib(ffi::gtk_tree_view_column_cell_is_visible(
434 self.as_ref().to_glib_none().0,
435 ))
436 }
437 }
438
439 #[doc(alias = "gtk_tree_view_column_cell_set_cell_data")]
452 fn cell_set_cell_data(
453 &self,
454 tree_model: &impl IsA<TreeModel>,
455 iter: &TreeIter,
456 is_expander: bool,
457 is_expanded: bool,
458 ) {
459 unsafe {
460 ffi::gtk_tree_view_column_cell_set_cell_data(
461 self.as_ref().to_glib_none().0,
462 tree_model.as_ref().to_glib_none().0,
463 mut_override(iter.to_glib_none().0),
464 is_expander.into_glib(),
465 is_expanded.into_glib(),
466 );
467 }
468 }
469
470 #[doc(alias = "gtk_tree_view_column_clear")]
472 fn clear(&self) {
473 unsafe {
474 ffi::gtk_tree_view_column_clear(self.as_ref().to_glib_none().0);
475 }
476 }
477
478 #[doc(alias = "gtk_tree_view_column_clear_attributes")]
483 fn clear_attributes(&self, cell_renderer: &impl IsA<CellRenderer>) {
484 unsafe {
485 ffi::gtk_tree_view_column_clear_attributes(
486 self.as_ref().to_glib_none().0,
487 cell_renderer.as_ref().to_glib_none().0,
488 );
489 }
490 }
491
492 #[doc(alias = "gtk_tree_view_column_clicked")]
495 fn clicked(&self) {
496 unsafe {
497 ffi::gtk_tree_view_column_clicked(self.as_ref().to_glib_none().0);
498 }
499 }
500
501 #[doc(alias = "gtk_tree_view_column_focus_cell")]
506 fn focus_cell(&self, cell: &impl IsA<CellRenderer>) {
507 unsafe {
508 ffi::gtk_tree_view_column_focus_cell(
509 self.as_ref().to_glib_none().0,
510 cell.as_ref().to_glib_none().0,
511 );
512 }
513 }
514
515 #[doc(alias = "gtk_tree_view_column_get_alignment")]
522 #[doc(alias = "get_alignment")]
523 fn alignment(&self) -> f32 {
524 unsafe { ffi::gtk_tree_view_column_get_alignment(self.as_ref().to_glib_none().0) }
525 }
526
527 #[doc(alias = "gtk_tree_view_column_get_button")]
533 #[doc(alias = "get_button")]
534 fn button(&self) -> Option<Widget> {
535 unsafe {
536 from_glib_none(ffi::gtk_tree_view_column_get_button(
537 self.as_ref().to_glib_none().0,
538 ))
539 }
540 }
541
542 #[doc(alias = "gtk_tree_view_column_get_clickable")]
548 #[doc(alias = "get_clickable")]
549 fn is_clickable(&self) -> bool {
550 unsafe {
551 from_glib(ffi::gtk_tree_view_column_get_clickable(
552 self.as_ref().to_glib_none().0,
553 ))
554 }
555 }
556
557 #[doc(alias = "gtk_tree_view_column_get_expand")]
563 #[doc(alias = "get_expand")]
564 fn expands(&self) -> bool {
565 unsafe {
566 from_glib(ffi::gtk_tree_view_column_get_expand(
567 self.as_ref().to_glib_none().0,
568 ))
569 }
570 }
571
572 #[doc(alias = "gtk_tree_view_column_get_fixed_width")]
579 #[doc(alias = "get_fixed_width")]
580 fn fixed_width(&self) -> i32 {
581 unsafe { ffi::gtk_tree_view_column_get_fixed_width(self.as_ref().to_glib_none().0) }
582 }
583
584 #[doc(alias = "gtk_tree_view_column_get_max_width")]
591 #[doc(alias = "get_max_width")]
592 fn max_width(&self) -> i32 {
593 unsafe { ffi::gtk_tree_view_column_get_max_width(self.as_ref().to_glib_none().0) }
594 }
595
596 #[doc(alias = "gtk_tree_view_column_get_min_width")]
603 #[doc(alias = "get_min_width")]
604 fn min_width(&self) -> i32 {
605 unsafe { ffi::gtk_tree_view_column_get_min_width(self.as_ref().to_glib_none().0) }
606 }
607
608 #[doc(alias = "gtk_tree_view_column_get_reorderable")]
614 #[doc(alias = "get_reorderable")]
615 fn is_reorderable(&self) -> bool {
616 unsafe {
617 from_glib(ffi::gtk_tree_view_column_get_reorderable(
618 self.as_ref().to_glib_none().0,
619 ))
620 }
621 }
622
623 #[doc(alias = "gtk_tree_view_column_get_resizable")]
629 #[doc(alias = "get_resizable")]
630 fn is_resizable(&self) -> bool {
631 unsafe {
632 from_glib(ffi::gtk_tree_view_column_get_resizable(
633 self.as_ref().to_glib_none().0,
634 ))
635 }
636 }
637
638 #[doc(alias = "gtk_tree_view_column_get_sizing")]
644 #[doc(alias = "get_sizing")]
645 fn sizing(&self) -> TreeViewColumnSizing {
646 unsafe {
647 from_glib(ffi::gtk_tree_view_column_get_sizing(
648 self.as_ref().to_glib_none().0,
649 ))
650 }
651 }
652
653 #[doc(alias = "gtk_tree_view_column_get_sort_column_id")]
662 #[doc(alias = "get_sort_column_id")]
663 fn sort_column_id(&self) -> i32 {
664 unsafe { ffi::gtk_tree_view_column_get_sort_column_id(self.as_ref().to_glib_none().0) }
665 }
666
667 #[doc(alias = "gtk_tree_view_column_get_sort_indicator")]
673 #[doc(alias = "get_sort_indicator")]
674 fn is_sort_indicator(&self) -> bool {
675 unsafe {
676 from_glib(ffi::gtk_tree_view_column_get_sort_indicator(
677 self.as_ref().to_glib_none().0,
678 ))
679 }
680 }
681
682 #[doc(alias = "gtk_tree_view_column_get_sort_order")]
688 #[doc(alias = "get_sort_order")]
689 fn sort_order(&self) -> SortType {
690 unsafe {
691 from_glib(ffi::gtk_tree_view_column_get_sort_order(
692 self.as_ref().to_glib_none().0,
693 ))
694 }
695 }
696
697 #[doc(alias = "gtk_tree_view_column_get_spacing")]
703 #[doc(alias = "get_spacing")]
704 fn spacing(&self) -> i32 {
705 unsafe { ffi::gtk_tree_view_column_get_spacing(self.as_ref().to_glib_none().0) }
706 }
707
708 #[doc(alias = "gtk_tree_view_column_get_title")]
715 #[doc(alias = "get_title")]
716 fn title(&self) -> Option<glib::GString> {
717 unsafe {
718 from_glib_none(ffi::gtk_tree_view_column_get_title(
719 self.as_ref().to_glib_none().0,
720 ))
721 }
722 }
723
724 #[doc(alias = "gtk_tree_view_column_get_tree_view")]
733 #[doc(alias = "get_tree_view")]
734 fn tree_view(&self) -> Option<Widget> {
735 unsafe {
736 from_glib_none(ffi::gtk_tree_view_column_get_tree_view(
737 self.as_ref().to_glib_none().0,
738 ))
739 }
740 }
741
742 #[doc(alias = "gtk_tree_view_column_get_visible")]
749 #[doc(alias = "get_visible")]
750 fn is_visible(&self) -> bool {
751 unsafe {
752 from_glib(ffi::gtk_tree_view_column_get_visible(
753 self.as_ref().to_glib_none().0,
754 ))
755 }
756 }
757
758 #[doc(alias = "gtk_tree_view_column_get_widget")]
766 #[doc(alias = "get_widget")]
767 fn widget(&self) -> Option<Widget> {
768 unsafe {
769 from_glib_none(ffi::gtk_tree_view_column_get_widget(
770 self.as_ref().to_glib_none().0,
771 ))
772 }
773 }
774
775 #[doc(alias = "gtk_tree_view_column_get_width")]
781 #[doc(alias = "get_width")]
782 fn width(&self) -> i32 {
783 unsafe { ffi::gtk_tree_view_column_get_width(self.as_ref().to_glib_none().0) }
784 }
785
786 #[doc(alias = "gtk_tree_view_column_get_x_offset")]
792 #[doc(alias = "get_x_offset")]
793 fn x_offset(&self) -> i32 {
794 unsafe { ffi::gtk_tree_view_column_get_x_offset(self.as_ref().to_glib_none().0) }
795 }
796
797 #[doc(alias = "gtk_tree_view_column_pack_end")]
805 fn pack_end(&self, cell: &impl IsA<CellRenderer>, expand: bool) {
806 unsafe {
807 ffi::gtk_tree_view_column_pack_end(
808 self.as_ref().to_glib_none().0,
809 cell.as_ref().to_glib_none().0,
810 expand.into_glib(),
811 );
812 }
813 }
814
815 #[doc(alias = "gtk_tree_view_column_pack_start")]
823 fn pack_start(&self, cell: &impl IsA<CellRenderer>, expand: bool) {
824 unsafe {
825 ffi::gtk_tree_view_column_pack_start(
826 self.as_ref().to_glib_none().0,
827 cell.as_ref().to_glib_none().0,
828 expand.into_glib(),
829 );
830 }
831 }
832
833 #[doc(alias = "gtk_tree_view_column_queue_resize")]
836 fn queue_resize(&self) {
837 unsafe {
838 ffi::gtk_tree_view_column_queue_resize(self.as_ref().to_glib_none().0);
839 }
840 }
841
842 #[doc(alias = "gtk_tree_view_column_set_alignment")]
848 fn set_alignment(&self, xalign: f32) {
849 unsafe {
850 ffi::gtk_tree_view_column_set_alignment(self.as_ref().to_glib_none().0, xalign);
851 }
852 }
853
854 #[doc(alias = "gtk_tree_view_column_set_cell_data_func")]
871 fn set_cell_data_func(
872 &self,
873 cell_renderer: &impl IsA<CellRenderer>,
874 func: Option<Box_<dyn Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static>>,
875 ) {
876 let func_data: Box_<
877 Option<Box_<dyn Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static>>,
878 > = Box_::new(func);
879 unsafe extern "C" fn func_func(
880 tree_column: *mut ffi::GtkTreeViewColumn,
881 cell: *mut ffi::GtkCellRenderer,
882 tree_model: *mut ffi::GtkTreeModel,
883 iter: *mut ffi::GtkTreeIter,
884 data: glib::ffi::gpointer,
885 ) {
886 let tree_column = from_glib_borrow(tree_column);
887 let cell = from_glib_borrow(cell);
888 let tree_model = from_glib_borrow(tree_model);
889 let iter = from_glib_borrow(iter);
890 let callback: &Option<
891 Box_<dyn Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static>,
892 > = &*(data as *mut _);
893 if let Some(ref callback) = *callback {
894 callback(&tree_column, &cell, &tree_model, &iter)
895 } else {
896 panic!("cannot get closure...")
897 }
898 }
899 let func = if func_data.is_some() {
900 Some(func_func as _)
901 } else {
902 None
903 };
904 unsafe extern "C" fn destroy_func(data: glib::ffi::gpointer) {
905 let _callback: Box_<
906 Option<
907 Box_<dyn Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static>,
908 >,
909 > = Box_::from_raw(data as *mut _);
910 }
911 let destroy_call4 = Some(destroy_func as _);
912 let super_callback0: Box_<
913 Option<Box_<dyn Fn(&TreeViewColumn, &CellRenderer, &TreeModel, &TreeIter) + 'static>>,
914 > = func_data;
915 unsafe {
916 ffi::gtk_tree_view_column_set_cell_data_func(
917 self.as_ref().to_glib_none().0,
918 cell_renderer.as_ref().to_glib_none().0,
919 func,
920 Box_::into_raw(super_callback0) as *mut _,
921 destroy_call4,
922 );
923 }
924 }
925
926 #[doc(alias = "gtk_tree_view_column_set_clickable")]
931 fn set_clickable(&self, clickable: bool) {
932 unsafe {
933 ffi::gtk_tree_view_column_set_clickable(
934 self.as_ref().to_glib_none().0,
935 clickable.into_glib(),
936 );
937 }
938 }
939
940 #[doc(alias = "gtk_tree_view_column_set_expand")]
950 fn set_expand(&self, expand: bool) {
951 unsafe {
952 ffi::gtk_tree_view_column_set_expand(
953 self.as_ref().to_glib_none().0,
954 expand.into_glib(),
955 );
956 }
957 }
958
959 #[doc(alias = "gtk_tree_view_column_set_fixed_width")]
973 fn set_fixed_width(&self, fixed_width: i32) {
974 unsafe {
975 ffi::gtk_tree_view_column_set_fixed_width(self.as_ref().to_glib_none().0, fixed_width);
976 }
977 }
978
979 #[doc(alias = "gtk_tree_view_column_set_max_width")]
986 fn set_max_width(&self, max_width: i32) {
987 unsafe {
988 ffi::gtk_tree_view_column_set_max_width(self.as_ref().to_glib_none().0, max_width);
989 }
990 }
991
992 #[doc(alias = "gtk_tree_view_column_set_min_width")]
997 fn set_min_width(&self, min_width: i32) {
998 unsafe {
999 ffi::gtk_tree_view_column_set_min_width(self.as_ref().to_glib_none().0, min_width);
1000 }
1001 }
1002
1003 #[doc(alias = "gtk_tree_view_column_set_reorderable")]
1008 fn set_reorderable(&self, reorderable: bool) {
1009 unsafe {
1010 ffi::gtk_tree_view_column_set_reorderable(
1011 self.as_ref().to_glib_none().0,
1012 reorderable.into_glib(),
1013 );
1014 }
1015 }
1016
1017 #[doc(alias = "gtk_tree_view_column_set_resizable")]
1024 fn set_resizable(&self, resizable: bool) {
1025 unsafe {
1026 ffi::gtk_tree_view_column_set_resizable(
1027 self.as_ref().to_glib_none().0,
1028 resizable.into_glib(),
1029 );
1030 }
1031 }
1032
1033 #[doc(alias = "gtk_tree_view_column_set_sizing")]
1037 fn set_sizing(&self, type_: TreeViewColumnSizing) {
1038 unsafe {
1039 ffi::gtk_tree_view_column_set_sizing(self.as_ref().to_glib_none().0, type_.into_glib());
1040 }
1041 }
1042
1043 #[doc(alias = "gtk_tree_view_column_set_sort_column_id")]
1048 fn set_sort_column_id(&self, sort_column_id: i32) {
1049 unsafe {
1050 ffi::gtk_tree_view_column_set_sort_column_id(
1051 self.as_ref().to_glib_none().0,
1052 sort_column_id,
1053 );
1054 }
1055 }
1056
1057 #[doc(alias = "gtk_tree_view_column_set_sort_indicator")]
1064 fn set_sort_indicator(&self, setting: bool) {
1065 unsafe {
1066 ffi::gtk_tree_view_column_set_sort_indicator(
1067 self.as_ref().to_glib_none().0,
1068 setting.into_glib(),
1069 );
1070 }
1071 }
1072
1073 #[doc(alias = "gtk_tree_view_column_set_sort_order")]
1087 fn set_sort_order(&self, order: SortType) {
1088 unsafe {
1089 ffi::gtk_tree_view_column_set_sort_order(
1090 self.as_ref().to_glib_none().0,
1091 order.into_glib(),
1092 );
1093 }
1094 }
1095
1096 #[doc(alias = "gtk_tree_view_column_set_spacing")]
1101 fn set_spacing(&self, spacing: i32) {
1102 unsafe {
1103 ffi::gtk_tree_view_column_set_spacing(self.as_ref().to_glib_none().0, spacing);
1104 }
1105 }
1106
1107 #[doc(alias = "gtk_tree_view_column_set_title")]
1112 fn set_title(&self, title: &str) {
1113 unsafe {
1114 ffi::gtk_tree_view_column_set_title(
1115 self.as_ref().to_glib_none().0,
1116 title.to_glib_none().0,
1117 );
1118 }
1119 }
1120
1121 #[doc(alias = "gtk_tree_view_column_set_visible")]
1125 fn set_visible(&self, visible: bool) {
1126 unsafe {
1127 ffi::gtk_tree_view_column_set_visible(
1128 self.as_ref().to_glib_none().0,
1129 visible.into_glib(),
1130 );
1131 }
1132 }
1133
1134 #[doc(alias = "gtk_tree_view_column_set_widget")]
1139 fn set_widget(&self, widget: Option<&impl IsA<Widget>>) {
1140 unsafe {
1141 ffi::gtk_tree_view_column_set_widget(
1142 self.as_ref().to_glib_none().0,
1143 widget.map(|p| p.as_ref()).to_glib_none().0,
1144 );
1145 }
1146 }
1147
1148 #[doc(alias = "cell-area")]
1153 fn cell_area(&self) -> Option<CellArea> {
1154 ObjectExt::property(self.as_ref(), "cell-area")
1155 }
1156
1157 #[doc(alias = "clicked")]
1158 fn connect_clicked<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1159 unsafe extern "C" fn clicked_trampoline<P: IsA<TreeViewColumn>, F: Fn(&P) + 'static>(
1160 this: *mut ffi::GtkTreeViewColumn,
1161 f: glib::ffi::gpointer,
1162 ) {
1163 let f: &F = &*(f as *const F);
1164 f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1165 }
1166 unsafe {
1167 let f: Box_<F> = Box_::new(f);
1168 connect_raw(
1169 self.as_ptr() as *mut _,
1170 b"clicked\0".as_ptr() as *const _,
1171 Some(transmute::<_, unsafe extern "C" fn()>(
1172 clicked_trampoline::<Self, F> as *const (),
1173 )),
1174 Box_::into_raw(f),
1175 )
1176 }
1177 }
1178
1179 #[doc(alias = "alignment")]
1180 fn connect_alignment_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1181 unsafe extern "C" fn notify_alignment_trampoline<
1182 P: IsA<TreeViewColumn>,
1183 F: Fn(&P) + 'static,
1184 >(
1185 this: *mut ffi::GtkTreeViewColumn,
1186 _param_spec: glib::ffi::gpointer,
1187 f: glib::ffi::gpointer,
1188 ) {
1189 let f: &F = &*(f as *const F);
1190 f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1191 }
1192 unsafe {
1193 let f: Box_<F> = Box_::new(f);
1194 connect_raw(
1195 self.as_ptr() as *mut _,
1196 b"notify::alignment\0".as_ptr() as *const _,
1197 Some(transmute::<_, unsafe extern "C" fn()>(
1198 notify_alignment_trampoline::<Self, F> as *const (),
1199 )),
1200 Box_::into_raw(f),
1201 )
1202 }
1203 }
1204
1205 #[doc(alias = "clickable")]
1206 fn connect_clickable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1207 unsafe extern "C" fn notify_clickable_trampoline<
1208 P: IsA<TreeViewColumn>,
1209 F: Fn(&P) + 'static,
1210 >(
1211 this: *mut ffi::GtkTreeViewColumn,
1212 _param_spec: glib::ffi::gpointer,
1213 f: glib::ffi::gpointer,
1214 ) {
1215 let f: &F = &*(f as *const F);
1216 f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1217 }
1218 unsafe {
1219 let f: Box_<F> = Box_::new(f);
1220 connect_raw(
1221 self.as_ptr() as *mut _,
1222 b"notify::clickable\0".as_ptr() as *const _,
1223 Some(transmute::<_, unsafe extern "C" fn()>(
1224 notify_clickable_trampoline::<Self, F> as *const (),
1225 )),
1226 Box_::into_raw(f),
1227 )
1228 }
1229 }
1230
1231 #[doc(alias = "expand")]
1232 fn connect_expand_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1233 unsafe extern "C" fn notify_expand_trampoline<
1234 P: IsA<TreeViewColumn>,
1235 F: Fn(&P) + 'static,
1236 >(
1237 this: *mut ffi::GtkTreeViewColumn,
1238 _param_spec: glib::ffi::gpointer,
1239 f: glib::ffi::gpointer,
1240 ) {
1241 let f: &F = &*(f as *const F);
1242 f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1243 }
1244 unsafe {
1245 let f: Box_<F> = Box_::new(f);
1246 connect_raw(
1247 self.as_ptr() as *mut _,
1248 b"notify::expand\0".as_ptr() as *const _,
1249 Some(transmute::<_, unsafe extern "C" fn()>(
1250 notify_expand_trampoline::<Self, F> as *const (),
1251 )),
1252 Box_::into_raw(f),
1253 )
1254 }
1255 }
1256
1257 #[doc(alias = "fixed-width")]
1258 fn connect_fixed_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1259 unsafe extern "C" fn notify_fixed_width_trampoline<
1260 P: IsA<TreeViewColumn>,
1261 F: Fn(&P) + 'static,
1262 >(
1263 this: *mut ffi::GtkTreeViewColumn,
1264 _param_spec: glib::ffi::gpointer,
1265 f: glib::ffi::gpointer,
1266 ) {
1267 let f: &F = &*(f as *const F);
1268 f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1269 }
1270 unsafe {
1271 let f: Box_<F> = Box_::new(f);
1272 connect_raw(
1273 self.as_ptr() as *mut _,
1274 b"notify::fixed-width\0".as_ptr() as *const _,
1275 Some(transmute::<_, unsafe extern "C" fn()>(
1276 notify_fixed_width_trampoline::<Self, F> as *const (),
1277 )),
1278 Box_::into_raw(f),
1279 )
1280 }
1281 }
1282
1283 #[doc(alias = "max-width")]
1284 fn connect_max_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1285 unsafe extern "C" fn notify_max_width_trampoline<
1286 P: IsA<TreeViewColumn>,
1287 F: Fn(&P) + 'static,
1288 >(
1289 this: *mut ffi::GtkTreeViewColumn,
1290 _param_spec: glib::ffi::gpointer,
1291 f: glib::ffi::gpointer,
1292 ) {
1293 let f: &F = &*(f as *const F);
1294 f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1295 }
1296 unsafe {
1297 let f: Box_<F> = Box_::new(f);
1298 connect_raw(
1299 self.as_ptr() as *mut _,
1300 b"notify::max-width\0".as_ptr() as *const _,
1301 Some(transmute::<_, unsafe extern "C" fn()>(
1302 notify_max_width_trampoline::<Self, F> as *const (),
1303 )),
1304 Box_::into_raw(f),
1305 )
1306 }
1307 }
1308
1309 #[doc(alias = "min-width")]
1310 fn connect_min_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1311 unsafe extern "C" fn notify_min_width_trampoline<
1312 P: IsA<TreeViewColumn>,
1313 F: Fn(&P) + 'static,
1314 >(
1315 this: *mut ffi::GtkTreeViewColumn,
1316 _param_spec: glib::ffi::gpointer,
1317 f: glib::ffi::gpointer,
1318 ) {
1319 let f: &F = &*(f as *const F);
1320 f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1321 }
1322 unsafe {
1323 let f: Box_<F> = Box_::new(f);
1324 connect_raw(
1325 self.as_ptr() as *mut _,
1326 b"notify::min-width\0".as_ptr() as *const _,
1327 Some(transmute::<_, unsafe extern "C" fn()>(
1328 notify_min_width_trampoline::<Self, F> as *const (),
1329 )),
1330 Box_::into_raw(f),
1331 )
1332 }
1333 }
1334
1335 #[doc(alias = "reorderable")]
1336 fn connect_reorderable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1337 unsafe extern "C" fn notify_reorderable_trampoline<
1338 P: IsA<TreeViewColumn>,
1339 F: Fn(&P) + 'static,
1340 >(
1341 this: *mut ffi::GtkTreeViewColumn,
1342 _param_spec: glib::ffi::gpointer,
1343 f: glib::ffi::gpointer,
1344 ) {
1345 let f: &F = &*(f as *const F);
1346 f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1347 }
1348 unsafe {
1349 let f: Box_<F> = Box_::new(f);
1350 connect_raw(
1351 self.as_ptr() as *mut _,
1352 b"notify::reorderable\0".as_ptr() as *const _,
1353 Some(transmute::<_, unsafe extern "C" fn()>(
1354 notify_reorderable_trampoline::<Self, F> as *const (),
1355 )),
1356 Box_::into_raw(f),
1357 )
1358 }
1359 }
1360
1361 #[doc(alias = "resizable")]
1362 fn connect_resizable_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1363 unsafe extern "C" fn notify_resizable_trampoline<
1364 P: IsA<TreeViewColumn>,
1365 F: Fn(&P) + 'static,
1366 >(
1367 this: *mut ffi::GtkTreeViewColumn,
1368 _param_spec: glib::ffi::gpointer,
1369 f: glib::ffi::gpointer,
1370 ) {
1371 let f: &F = &*(f as *const F);
1372 f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1373 }
1374 unsafe {
1375 let f: Box_<F> = Box_::new(f);
1376 connect_raw(
1377 self.as_ptr() as *mut _,
1378 b"notify::resizable\0".as_ptr() as *const _,
1379 Some(transmute::<_, unsafe extern "C" fn()>(
1380 notify_resizable_trampoline::<Self, F> as *const (),
1381 )),
1382 Box_::into_raw(f),
1383 )
1384 }
1385 }
1386
1387 #[doc(alias = "sizing")]
1388 fn connect_sizing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1389 unsafe extern "C" fn notify_sizing_trampoline<
1390 P: IsA<TreeViewColumn>,
1391 F: Fn(&P) + 'static,
1392 >(
1393 this: *mut ffi::GtkTreeViewColumn,
1394 _param_spec: glib::ffi::gpointer,
1395 f: glib::ffi::gpointer,
1396 ) {
1397 let f: &F = &*(f as *const F);
1398 f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1399 }
1400 unsafe {
1401 let f: Box_<F> = Box_::new(f);
1402 connect_raw(
1403 self.as_ptr() as *mut _,
1404 b"notify::sizing\0".as_ptr() as *const _,
1405 Some(transmute::<_, unsafe extern "C" fn()>(
1406 notify_sizing_trampoline::<Self, F> as *const (),
1407 )),
1408 Box_::into_raw(f),
1409 )
1410 }
1411 }
1412
1413 #[doc(alias = "sort-column-id")]
1414 fn connect_sort_column_id_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1415 unsafe extern "C" fn notify_sort_column_id_trampoline<
1416 P: IsA<TreeViewColumn>,
1417 F: Fn(&P) + 'static,
1418 >(
1419 this: *mut ffi::GtkTreeViewColumn,
1420 _param_spec: glib::ffi::gpointer,
1421 f: glib::ffi::gpointer,
1422 ) {
1423 let f: &F = &*(f as *const F);
1424 f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1425 }
1426 unsafe {
1427 let f: Box_<F> = Box_::new(f);
1428 connect_raw(
1429 self.as_ptr() as *mut _,
1430 b"notify::sort-column-id\0".as_ptr() as *const _,
1431 Some(transmute::<_, unsafe extern "C" fn()>(
1432 notify_sort_column_id_trampoline::<Self, F> as *const (),
1433 )),
1434 Box_::into_raw(f),
1435 )
1436 }
1437 }
1438
1439 #[doc(alias = "sort-indicator")]
1440 fn connect_sort_indicator_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1441 unsafe extern "C" fn notify_sort_indicator_trampoline<
1442 P: IsA<TreeViewColumn>,
1443 F: Fn(&P) + 'static,
1444 >(
1445 this: *mut ffi::GtkTreeViewColumn,
1446 _param_spec: glib::ffi::gpointer,
1447 f: glib::ffi::gpointer,
1448 ) {
1449 let f: &F = &*(f as *const F);
1450 f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1451 }
1452 unsafe {
1453 let f: Box_<F> = Box_::new(f);
1454 connect_raw(
1455 self.as_ptr() as *mut _,
1456 b"notify::sort-indicator\0".as_ptr() as *const _,
1457 Some(transmute::<_, unsafe extern "C" fn()>(
1458 notify_sort_indicator_trampoline::<Self, F> as *const (),
1459 )),
1460 Box_::into_raw(f),
1461 )
1462 }
1463 }
1464
1465 #[doc(alias = "sort-order")]
1466 fn connect_sort_order_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1467 unsafe extern "C" fn notify_sort_order_trampoline<
1468 P: IsA<TreeViewColumn>,
1469 F: Fn(&P) + 'static,
1470 >(
1471 this: *mut ffi::GtkTreeViewColumn,
1472 _param_spec: glib::ffi::gpointer,
1473 f: glib::ffi::gpointer,
1474 ) {
1475 let f: &F = &*(f as *const F);
1476 f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1477 }
1478 unsafe {
1479 let f: Box_<F> = Box_::new(f);
1480 connect_raw(
1481 self.as_ptr() as *mut _,
1482 b"notify::sort-order\0".as_ptr() as *const _,
1483 Some(transmute::<_, unsafe extern "C" fn()>(
1484 notify_sort_order_trampoline::<Self, F> as *const (),
1485 )),
1486 Box_::into_raw(f),
1487 )
1488 }
1489 }
1490
1491 #[doc(alias = "spacing")]
1492 fn connect_spacing_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1493 unsafe extern "C" fn notify_spacing_trampoline<
1494 P: IsA<TreeViewColumn>,
1495 F: Fn(&P) + 'static,
1496 >(
1497 this: *mut ffi::GtkTreeViewColumn,
1498 _param_spec: glib::ffi::gpointer,
1499 f: glib::ffi::gpointer,
1500 ) {
1501 let f: &F = &*(f as *const F);
1502 f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1503 }
1504 unsafe {
1505 let f: Box_<F> = Box_::new(f);
1506 connect_raw(
1507 self.as_ptr() as *mut _,
1508 b"notify::spacing\0".as_ptr() as *const _,
1509 Some(transmute::<_, unsafe extern "C" fn()>(
1510 notify_spacing_trampoline::<Self, F> as *const (),
1511 )),
1512 Box_::into_raw(f),
1513 )
1514 }
1515 }
1516
1517 #[doc(alias = "title")]
1518 fn connect_title_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1519 unsafe extern "C" fn notify_title_trampoline<
1520 P: IsA<TreeViewColumn>,
1521 F: Fn(&P) + 'static,
1522 >(
1523 this: *mut ffi::GtkTreeViewColumn,
1524 _param_spec: glib::ffi::gpointer,
1525 f: glib::ffi::gpointer,
1526 ) {
1527 let f: &F = &*(f as *const F);
1528 f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1529 }
1530 unsafe {
1531 let f: Box_<F> = Box_::new(f);
1532 connect_raw(
1533 self.as_ptr() as *mut _,
1534 b"notify::title\0".as_ptr() as *const _,
1535 Some(transmute::<_, unsafe extern "C" fn()>(
1536 notify_title_trampoline::<Self, F> as *const (),
1537 )),
1538 Box_::into_raw(f),
1539 )
1540 }
1541 }
1542
1543 #[doc(alias = "visible")]
1544 fn connect_visible_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1545 unsafe extern "C" fn notify_visible_trampoline<
1546 P: IsA<TreeViewColumn>,
1547 F: Fn(&P) + 'static,
1548 >(
1549 this: *mut ffi::GtkTreeViewColumn,
1550 _param_spec: glib::ffi::gpointer,
1551 f: glib::ffi::gpointer,
1552 ) {
1553 let f: &F = &*(f as *const F);
1554 f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1555 }
1556 unsafe {
1557 let f: Box_<F> = Box_::new(f);
1558 connect_raw(
1559 self.as_ptr() as *mut _,
1560 b"notify::visible\0".as_ptr() as *const _,
1561 Some(transmute::<_, unsafe extern "C" fn()>(
1562 notify_visible_trampoline::<Self, F> as *const (),
1563 )),
1564 Box_::into_raw(f),
1565 )
1566 }
1567 }
1568
1569 #[doc(alias = "widget")]
1570 fn connect_widget_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1571 unsafe extern "C" fn notify_widget_trampoline<
1572 P: IsA<TreeViewColumn>,
1573 F: Fn(&P) + 'static,
1574 >(
1575 this: *mut ffi::GtkTreeViewColumn,
1576 _param_spec: glib::ffi::gpointer,
1577 f: glib::ffi::gpointer,
1578 ) {
1579 let f: &F = &*(f as *const F);
1580 f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1581 }
1582 unsafe {
1583 let f: Box_<F> = Box_::new(f);
1584 connect_raw(
1585 self.as_ptr() as *mut _,
1586 b"notify::widget\0".as_ptr() as *const _,
1587 Some(transmute::<_, unsafe extern "C" fn()>(
1588 notify_widget_trampoline::<Self, F> as *const (),
1589 )),
1590 Box_::into_raw(f),
1591 )
1592 }
1593 }
1594
1595 #[doc(alias = "width")]
1596 fn connect_width_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1597 unsafe extern "C" fn notify_width_trampoline<
1598 P: IsA<TreeViewColumn>,
1599 F: Fn(&P) + 'static,
1600 >(
1601 this: *mut ffi::GtkTreeViewColumn,
1602 _param_spec: glib::ffi::gpointer,
1603 f: glib::ffi::gpointer,
1604 ) {
1605 let f: &F = &*(f as *const F);
1606 f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1607 }
1608 unsafe {
1609 let f: Box_<F> = Box_::new(f);
1610 connect_raw(
1611 self.as_ptr() as *mut _,
1612 b"notify::width\0".as_ptr() as *const _,
1613 Some(transmute::<_, unsafe extern "C" fn()>(
1614 notify_width_trampoline::<Self, F> as *const (),
1615 )),
1616 Box_::into_raw(f),
1617 )
1618 }
1619 }
1620
1621 #[doc(alias = "x-offset")]
1622 fn connect_x_offset_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
1623 unsafe extern "C" fn notify_x_offset_trampoline<
1624 P: IsA<TreeViewColumn>,
1625 F: Fn(&P) + 'static,
1626 >(
1627 this: *mut ffi::GtkTreeViewColumn,
1628 _param_spec: glib::ffi::gpointer,
1629 f: glib::ffi::gpointer,
1630 ) {
1631 let f: &F = &*(f as *const F);
1632 f(TreeViewColumn::from_glib_borrow(this).unsafe_cast_ref())
1633 }
1634 unsafe {
1635 let f: Box_<F> = Box_::new(f);
1636 connect_raw(
1637 self.as_ptr() as *mut _,
1638 b"notify::x-offset\0".as_ptr() as *const _,
1639 Some(transmute::<_, unsafe extern "C" fn()>(
1640 notify_x_offset_trampoline::<Self, F> as *const (),
1641 )),
1642 Box_::into_raw(f),
1643 )
1644 }
1645 }
1646}
1647
1648impl<O: IsA<TreeViewColumn>> TreeViewColumnExt for O {}
1649
1650impl fmt::Display for TreeViewColumn {
1651 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1652 f.write_str("TreeViewColumn")
1653 }
1654}