1 /* $Id: treedragsource.hg,v 1.8 2006/05/10 20:59:28 murrayc Exp $ */
3 /* Copyright (C) 1998-2002 The gtkmm Development Team
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the Free
17 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include <glibmm/interface.h>
21 #include <gtkmm/treemodel.h>
22 #include <gtkmm/selectiondata.h>
24 _PINCLUDE(glibmm/private/interface_p.h)
26 #ifndef DOXYGEN_SHOULD_SKIP_THIS
29 typedef struct _GtkTreeDragSourceIface GtkTreeDragSourceIface;
30 typedef struct _GtkSelectionData GtkSelectionData;
32 #endif /* DOXYGEN_SHOULD_SKIP_THIS */
41 class TreeDragSource : public Glib::Interface
43 _CLASS_INTERFACE(TreeDragSource, GtkTreeDragSource, GTK_TREE_DRAG_SOURCE, GtkTreeDragSourceIface)
46 _WRAP_METHOD(bool row_draggable(const TreeModel::Path& path) const, gtk_tree_drag_source_row_draggable)
48 _WRAP_METHOD(bool drag_data_get(const TreeModel::Path& path, SelectionData& selection_data), gtk_tree_drag_source_drag_data_get)
50 _WRAP_METHOD(bool drag_data_delete(const TreeModel::Path& path), gtk_tree_drag_source_drag_data_delete)
55 dnl// We want to hand-code these C vfunc callbacks,
56 _PUSH(SECTION_PCC_CLASS_INIT_VFUNCS)
57 klass->drag_data_get = &drag_data_get_vfunc_callback;
58 _SECTION(SECTION_PH_VFUNCS)
59 static gboolean drag_data_get_vfunc_callback(GtkTreeDragSource* self, GtkTreePath* path, GtkSelectionData* selection_data);
63 _WRAP_VFUNC(bool row_draggable(const TreeModel::Path& path) const, row_draggable)
65 //We hand-code this so that we can use a temporary instance for the SelectionData& output parameter:
66 #ifdef GLIBMM_VFUNCS_ENABLED
67 virtual bool drag_data_get_vfunc(const TreeModel::Path& path, SelectionData& selection_data) const;
68 #endif //GLIBMM_VFUNCS_ENABLED
70 _WRAP_VFUNC(bool drag_data_delete(const TreeModel::Path& path), drag_data_delete)