2
* Copyright (C) 2001 Red Hat, Inc.
4
* This library is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU Library General Public
6
* License as published by the Free Software Foundation; either
7
* version 2 of the License, or (at your option) any later version.
9
* This library is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
* Library General Public License for more details.
14
* You should have received a copy of the GNU Library General Public
15
* License along with this library; if not, write to the
16
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
* Boston, MA 02111-1307, USA.
20
#if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
21
#error "Only <gtk/gtk.h> can be included directly."
24
#ifndef __GTK_TREE_DND_H__
25
#define __GTK_TREE_DND_H__
27
#include <gtk/gtktreemodel.h>
28
#include <gtk/gtkdnd.h>
32
#define GTK_TYPE_TREE_DRAG_SOURCE (gtk_tree_drag_source_get_type ())
33
#define GTK_TREE_DRAG_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TREE_DRAG_SOURCE, GtkTreeDragSource))
34
#define GTK_IS_TREE_DRAG_SOURCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TREE_DRAG_SOURCE))
35
#define GTK_TREE_DRAG_SOURCE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_TREE_DRAG_SOURCE, GtkTreeDragSourceIface))
37
typedef struct _GtkTreeDragSource GtkTreeDragSource; /* Dummy typedef */
38
typedef struct _GtkTreeDragSourceIface GtkTreeDragSourceIface;
40
struct _GtkTreeDragSourceIface
42
GTypeInterface g_iface;
44
/* VTable - not signals */
46
gboolean (* row_draggable) (GtkTreeDragSource *drag_source,
49
gboolean (* drag_data_get) (GtkTreeDragSource *drag_source,
51
GtkSelectionData *selection_data);
53
gboolean (* drag_data_delete) (GtkTreeDragSource *drag_source,
57
GType gtk_tree_drag_source_get_type (void) G_GNUC_CONST;
59
/* Returns whether the given row can be dragged */
60
gboolean gtk_tree_drag_source_row_draggable (GtkTreeDragSource *drag_source,
63
/* Deletes the given row, or returns FALSE if it can't */
64
gboolean gtk_tree_drag_source_drag_data_delete (GtkTreeDragSource *drag_source,
67
/* Fills in selection_data with type selection_data->target based on
68
* the row denoted by path, returns TRUE if it does anything
70
gboolean gtk_tree_drag_source_drag_data_get (GtkTreeDragSource *drag_source,
72
GtkSelectionData *selection_data);
74
#define GTK_TYPE_TREE_DRAG_DEST (gtk_tree_drag_dest_get_type ())
75
#define GTK_TREE_DRAG_DEST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TREE_DRAG_DEST, GtkTreeDragDest))
76
#define GTK_IS_TREE_DRAG_DEST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TREE_DRAG_DEST))
77
#define GTK_TREE_DRAG_DEST_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_TREE_DRAG_DEST, GtkTreeDragDestIface))
79
typedef struct _GtkTreeDragDest GtkTreeDragDest; /* Dummy typedef */
80
typedef struct _GtkTreeDragDestIface GtkTreeDragDestIface;
82
struct _GtkTreeDragDestIface
84
GTypeInterface g_iface;
86
/* VTable - not signals */
88
gboolean (* drag_data_received) (GtkTreeDragDest *drag_dest,
90
GtkSelectionData *selection_data);
92
gboolean (* row_drop_possible) (GtkTreeDragDest *drag_dest,
93
GtkTreePath *dest_path,
94
GtkSelectionData *selection_data);
97
GType gtk_tree_drag_dest_get_type (void) G_GNUC_CONST;
99
/* Inserts a row before dest which contains data in selection_data,
100
* or returns FALSE if it can't
102
gboolean gtk_tree_drag_dest_drag_data_received (GtkTreeDragDest *drag_dest,
104
GtkSelectionData *selection_data);
107
/* Returns TRUE if we can drop before path; path may not exist. */
108
gboolean gtk_tree_drag_dest_row_drop_possible (GtkTreeDragDest *drag_dest,
109
GtkTreePath *dest_path,
110
GtkSelectionData *selection_data);
113
/* The selection data would normally have target type GTK_TREE_MODEL_ROW in this
114
* case. If the target is wrong these functions return FALSE.
116
gboolean gtk_tree_set_row_drag_data (GtkSelectionData *selection_data,
117
GtkTreeModel *tree_model,
119
gboolean gtk_tree_get_row_drag_data (GtkSelectionData *selection_data,
120
GtkTreeModel **tree_model,
125
#endif /* __GTK_TREE_DND_H__ */