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 = "GtkTreeDragSource")]
13     pub struct TreeDragSource(Interface<ffi::GtkTreeDragSource, ffi::GtkTreeDragSourceIface>);
14 
15     match fn {
16         type_ => || ffi::gtk_tree_drag_source_get_type(),
17     }
18 }
19 
20 pub const NONE_TREE_DRAG_SOURCE: Option<&TreeDragSource> = None;
21 
22 pub trait TreeDragSourceExt: 'static {
23     #[doc(alias = "gtk_tree_drag_source_drag_data_delete")]
drag_data_delete(&self, path: &mut TreePath) -> bool24     fn drag_data_delete(&self, path: &mut TreePath) -> bool;
25 
26     #[doc(alias = "gtk_tree_drag_source_drag_data_get")]
drag_data_get(&self, path: &mut TreePath, selection_data: &mut SelectionData) -> bool27     fn drag_data_get(&self, path: &mut TreePath, selection_data: &mut SelectionData) -> bool;
28 
29     #[doc(alias = "gtk_tree_drag_source_row_draggable")]
row_draggable(&self, path: &mut TreePath) -> bool30     fn row_draggable(&self, path: &mut TreePath) -> bool;
31 }
32 
33 impl<O: IsA<TreeDragSource>> TreeDragSourceExt for O {
drag_data_delete(&self, path: &mut TreePath) -> bool34     fn drag_data_delete(&self, path: &mut TreePath) -> bool {
35         unsafe {
36             from_glib(ffi::gtk_tree_drag_source_drag_data_delete(
37                 self.as_ref().to_glib_none().0,
38                 path.to_glib_none_mut().0,
39             ))
40         }
41     }
42 
drag_data_get(&self, path: &mut TreePath, selection_data: &mut SelectionData) -> bool43     fn drag_data_get(&self, path: &mut TreePath, selection_data: &mut SelectionData) -> bool {
44         unsafe {
45             from_glib(ffi::gtk_tree_drag_source_drag_data_get(
46                 self.as_ref().to_glib_none().0,
47                 path.to_glib_none_mut().0,
48                 selection_data.to_glib_none_mut().0,
49             ))
50         }
51     }
52 
row_draggable(&self, path: &mut TreePath) -> bool53     fn row_draggable(&self, path: &mut TreePath) -> bool {
54         unsafe {
55             from_glib(ffi::gtk_tree_drag_source_row_draggable(
56                 self.as_ref().to_glib_none().0,
57                 path.to_glib_none_mut().0,
58             ))
59         }
60     }
61 }
62 
63 impl fmt::Display for TreeDragSource {
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result64     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
65         f.write_str("TreeDragSource")
66     }
67 }
68