1 // This file was generated by gir (https://github.com/gtk-rs/gir)
2 // from gir-files (https://github.com/gtk-rs/gir-files)
3 // DO NOT EDIT
4 
5 use crate::SelectionData;
6 use crate::TreePath;
7 use glib::object::IsA;
8 use glib::translate::*;
9 use std::fmt;
10 
11 glib::wrapper! {
12     #[doc(alias = "GtkTreeDragDest")]
13     pub struct TreeDragDest(Interface<ffi::GtkTreeDragDest, ffi::GtkTreeDragDestIface>);
14 
15     match fn {
16         type_ => || ffi::gtk_tree_drag_dest_get_type(),
17     }
18 }
19 
20 pub const NONE_TREE_DRAG_DEST: Option<&TreeDragDest> = None;
21 
22 pub trait TreeDragDestExt: 'static {
23     #[doc(alias = "gtk_tree_drag_dest_drag_data_received")]
drag_data_received(&self, dest: &mut TreePath, selection_data: &mut SelectionData) -> bool24     fn drag_data_received(&self, dest: &mut TreePath, selection_data: &mut SelectionData) -> bool;
25 
26     #[doc(alias = "gtk_tree_drag_dest_row_drop_possible")]
row_drop_possible( &self, dest_path: &mut TreePath, selection_data: &mut SelectionData, ) -> bool27     fn row_drop_possible(
28         &self,
29         dest_path: &mut TreePath,
30         selection_data: &mut SelectionData,
31     ) -> bool;
32 }
33 
34 impl<O: IsA<TreeDragDest>> TreeDragDestExt for O {
drag_data_received(&self, dest: &mut TreePath, selection_data: &mut SelectionData) -> bool35     fn drag_data_received(&self, dest: &mut TreePath, selection_data: &mut SelectionData) -> bool {
36         unsafe {
37             from_glib(ffi::gtk_tree_drag_dest_drag_data_received(
38                 self.as_ref().to_glib_none().0,
39                 dest.to_glib_none_mut().0,
40                 selection_data.to_glib_none_mut().0,
41             ))
42         }
43     }
44 
row_drop_possible( &self, dest_path: &mut TreePath, selection_data: &mut SelectionData, ) -> bool45     fn row_drop_possible(
46         &self,
47         dest_path: &mut TreePath,
48         selection_data: &mut SelectionData,
49     ) -> bool {
50         unsafe {
51             from_glib(ffi::gtk_tree_drag_dest_row_drop_possible(
52                 self.as_ref().to_glib_none().0,
53                 dest_path.to_glib_none_mut().0,
54                 selection_data.to_glib_none_mut().0,
55             ))
56         }
57     }
58 }
59 
60 impl fmt::Display for TreeDragDest {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result61     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
62         f.write_str("TreeDragDest")
63     }
64 }
65