Debian Codegraph @

gtk/src/treedragsource.hg

raw
1 /* Copyright (C) 1998-2002 The gtkmm Development Team
2 *
3 * This library is free software; you can redistribute it and/or
4 * modify it under the terms of the GNU Lesser General Public
5 * License as published by the Free Software Foundation; either
6 * version 2.1 of the License, or (at your option) any later version.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public
14 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
15 */
16
17 #include <glibmm/interface.h>
18 #include <gtkmm/treemodel.h>
19 #include <gtkmm/selectiondata.h>
20 _DEFS(gtkmm,gtk)
21 _PINCLUDE(glibmm/private/interface_p.h)
22
23 #ifndef DOXYGEN_SHOULD_SKIP_THIS
24 extern "C"
25 {
26 typedef struct _GtkTreeDragSourceIface GtkTreeDragSourceIface;
27 typedef struct _GtkSelectionData GtkSelectionData;
28 }
29 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
30
31
32 namespace Gtk
33 {
34
35 /**
36 * @ingroup TreeView
37 */
38 class GTKMM_API TreeDragSource : public Glib::Interface
39 {
40 _CLASS_INTERFACE(TreeDragSource, GtkTreeDragSource, GTK_TREE_DRAG_SOURCE, GtkTreeDragSourceIface, , , GTKMM_API)
41
42 public:
43 _WRAP_METHOD(bool row_draggable(const TreeModel::Path& path) const, gtk_tree_drag_source_row_draggable)
44
45 _WRAP_METHOD(bool drag_data_get(const TreeModel::Path& path, SelectionData& selection_data), gtk_tree_drag_source_drag_data_get)
46
47 _WRAP_METHOD(bool drag_data_delete(const TreeModel::Path& path), gtk_tree_drag_source_drag_data_delete)
48
49 protected:
50
51 #m4begin
52 dnl// We want to hand-code these C vfunc callbacks,
53 _PUSH(SECTION_PCC_CLASS_INIT_VFUNCS)
54 klass->drag_data_get = &drag_data_get_vfunc_callback;
55 _SECTION(SECTION_PH_VFUNCS)
56 static gboolean drag_data_get_vfunc_callback(GtkTreeDragSource* self, GtkTreePath* path, GtkSelectionData* selection_data);
57 _POP()
58 #m4end
59
60 _WRAP_VFUNC(bool row_draggable(const TreeModel::Path& path) const, row_draggable)
61
62 //We hand-code this so that we can use a temporary instance for the SelectionData& output parameter:
63 virtual bool drag_data_get_vfunc(const TreeModel::Path& path, SelectionData& selection_data) const;
64
65 _WRAP_VFUNC(bool drag_data_delete(const TreeModel::Path& path), drag_data_delete)
66 };
67
68 } // namespace Gtk