1 #ifndef __gtkmm2ext_dndtreeview_h__
2 #define __gtkmm2ext_dndtreeview_h__
6 #include <gtkmm/treeview.h>
7 #include <gtkmm/treeselection.h>
8 #include <gtkmm/selectiondata.h>
12 class DnDTreeView : public Gtk::TreeView
20 /* this is the structure pointed to if add_object_drag() is called
21 and a drop happens on a destination which has declared itself
22 willing to accept a target of the type named in the call
26 struct SerializedObjectPointers {
33 void add_drop_targets (std::list<Gtk::TargetEntry>&);
34 void add_object_drag (int column, std::string type_name);
35 sigc::signal<void,std::string,uint32_t,void**> signal_object_drop;
37 void on_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context) {
38 TreeView::on_drag_begin (context);
40 void on_drag_end(const Glib::RefPtr<Gdk::DragContext>& context) {
41 TreeView::on_drag_end (context);
43 void on_drag_data_delete(const Glib::RefPtr<Gdk::DragContext>& context) {
44 TreeView::on_drag_data_delete (context);
46 void on_drag_leave(const Glib::RefPtr<Gdk::DragContext>& context, guint time) {
47 suggested_action = context->get_suggested_action();
48 TreeView::on_drag_leave (context, time);
50 bool on_drag_motion(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time) {
51 suggested_action = context->get_suggested_action();
52 return TreeView::on_drag_motion (context, x, y, time);
54 bool on_drag_drop(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time);
55 void on_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context, Gtk::SelectionData& selection_data, guint info, guint time);
56 void on_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, const Gtk::SelectionData& selection_data, guint info, guint time);
59 std::list<Gtk::TargetEntry> draggable;
60 Gdk::DragAction suggested_action;
63 SerializedObjectPointers* serialize_pointers (Glib::RefPtr<Gtk::TreeModel> m,
64 Gtk::TreeSelection::ListHandle_Path*,
70 #endif /* __gtkmm2ext_dndtreeview_h__ */