gtk/auto/
tree_drag_dest.rs

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
5use glib::object::IsA;
6use glib::translate::*;
7use gtk_sys;
8use std::fmt;
9use SelectionData;
10use TreePath;
11
12glib_wrapper! {
13    pub struct TreeDragDest(Interface<gtk_sys::GtkTreeDragDest>);
14
15    match fn {
16        get_type => || gtk_sys::gtk_tree_drag_dest_get_type(),
17    }
18}
19
20pub const NONE_TREE_DRAG_DEST: Option<&TreeDragDest> = None;
21
22pub trait TreeDragDestExt: 'static {
23    fn drag_data_received(&self, dest: &mut TreePath, selection_data: &mut SelectionData) -> bool;
24
25    fn row_drop_possible(
26        &self,
27        dest_path: &mut TreePath,
28        selection_data: &mut SelectionData,
29    ) -> bool;
30}
31
32impl<O: IsA<TreeDragDest>> TreeDragDestExt for O {
33    fn drag_data_received(&self, dest: &mut TreePath, selection_data: &mut SelectionData) -> bool {
34        unsafe {
35            from_glib(gtk_sys::gtk_tree_drag_dest_drag_data_received(
36                self.as_ref().to_glib_none().0,
37                dest.to_glib_none_mut().0,
38                selection_data.to_glib_none_mut().0,
39            ))
40        }
41    }
42
43    fn row_drop_possible(
44        &self,
45        dest_path: &mut TreePath,
46        selection_data: &mut SelectionData,
47    ) -> bool {
48        unsafe {
49            from_glib(gtk_sys::gtk_tree_drag_dest_row_drop_possible(
50                self.as_ref().to_glib_none().0,
51                dest_path.to_glib_none_mut().0,
52                selection_data.to_glib_none_mut().0,
53            ))
54        }
55    }
56}
57
58impl fmt::Display for TreeDragDest {
59    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
60        write!(f, "TreeDragDest")
61    }
62}