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 void add_object_drag (int column, std::string type_name);
21 sigc::signal<void,std::string,uint32_t,void**> signal_object_drop;
23 void on_drag_begin(const Glib::RefPtr<Gdk::DragContext>& context) {
24 TreeView::on_drag_begin (context);
26 void on_drag_end(const Glib::RefPtr<Gdk::DragContext>& context) {
27 TreeView::on_drag_end (context);
29 void on_drag_data_delete(const Glib::RefPtr<Gdk::DragContext>& context) {
30 TreeView::on_drag_data_delete (context);
32 void on_drag_leave(const Glib::RefPtr<Gdk::DragContext>& context, guint time) {
33 suggested_action = context->get_suggested_action();
34 TreeView::on_drag_leave (context, time);
36 bool on_drag_motion(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time) {
37 suggested_action = context->get_suggested_action();
38 return TreeView::on_drag_motion (context, x, y, time);
40 bool on_drag_drop(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, guint time) {
41 suggested_action = Gdk::DragAction (0);
42 return TreeView::on_drag_drop (context, x, y, time);
45 void on_drag_data_get(const Glib::RefPtr<Gdk::DragContext>& context, Gtk::SelectionData& selection_data, guint info, guint time);
46 void on_drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, const Gtk::SelectionData& selection_data, guint info, guint time);
49 std::list<Gtk::TargetEntry> draggable;
50 Gdk::DragAction suggested_action;
53 struct SerializedObjectPointers {
60 SerializedObjectPointers* serialize_pointers (Glib::RefPtr<Gtk::TreeModel> m,
61 Gtk::TreeSelection::ListHandle_Path*,
67 #endif /* __gtkmm2ext_dndtreeview_h__ */