]> Pileus Git - ~andy/gtk/blob - gtk/gtkdnd.h
Merge from themes-2. See the ChangeLog for a somewhat detailed
[~andy/gtk] / gtk / gtkdnd.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3  *
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.
8  *
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.
13  *
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.
18  */
19 #ifndef __GTK_DND_H__
20 #define __GTK_DND_H__
21
22 #include <gdk/gdk.h>
23 #include <gtk/gtkenums.h>
24 #include <gtk/gtkwidget.h>
25 #include <gtk/gtkselection.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30
31 typedef enum {
32   GTK_DEST_DEFAULT_MOTION     = 1 << 0, /* respond to "drag_motion" */
33   GTK_DEST_DEFAULT_HIGHLIGHT  = 1 << 1, /* auto-highlight */
34   GTK_DEST_DEFAULT_DROP       = 1 << 2, /* respond to "drag_drop" */
35   GTK_DEST_DEFAULT_ALL        = 0x07
36 } GtkDestDefaults;
37
38 /* Destination side */
39
40 void gtk_drag_get_data (GtkWidget      *widget,
41                         GdkDragContext *context,
42                         GdkAtom         target,
43                         guint32         time);
44 void gtk_drag_finish   (GdkDragContext *context,
45                         gboolean        success,
46                         gboolean        del,
47                         guint32         time);
48
49 void gtk_drag_highlight   (GtkWidget  *widget);
50 void gtk_drag_unhighlight (GtkWidget  *widget);
51
52 void gtk_drag_dest_set   (GtkWidget          *widget,
53                           GtkDestDefaults     flags,
54                           GtkTargetEntry     *targets,
55                           gint                n_targets,
56                           GdkDragAction       actions);
57
58 void gtk_drag_dest_set_proxy (GtkWidget      *widget,
59                               GdkWindow      *proxy_window,
60                               GdkDragProtocol protocol,
61                               gboolean        use_coordinates);
62
63 /* There probably should be functions for setting the targets
64  * as a GtkTargetList
65  */
66
67 void gtk_drag_dest_unset (GtkWidget          *widget);
68
69 /* Source side */
70
71 void gtk_drag_source_set  (GtkWidget         *widget,
72                            GdkModifierType    start_button_mask,
73                            GtkTargetEntry    *targets,
74                            gint               n_targets,
75                            GdkDragAction      actions);
76
77 void gtk_drag_source_set_icon (GtkWidget     *widget,
78                                GdkColormap   *colormap,
79                                GdkPixmap     *pixmap,
80                                GdkBitmap     *mask);
81
82 /* There probably should be functions for setting the targets
83  * as a GtkTargetList
84  */
85
86 GdkDragContext *gtk_drag_begin (GtkWidget         *widget,
87                                 GtkTargetList     *targets,
88                                 GdkDragAction      actions,
89                                 gint               button,
90                                 GdkEvent          *event);
91
92 /* Set the image being dragged around
93  */
94 void gtk_drag_set_icon_widget  (GdkDragContext    *context,
95                                 GtkWidget         *widget,
96                                 gint               hot_x,
97                                 gint               hot_y);
98
99 void gtk_drag_set_icon_pixmap  (GdkDragContext    *context,
100                                 GdkColormap       *colormap,
101                                 GdkPixmap         *pixmap,
102                                 GdkBitmap         *mask,
103                                 gint               hot_x,
104                                 gint               hot_y);
105
106 void gtk_drag_set_icon_default (GdkDragContext    *context);
107
108 void gtk_drag_set_default_icon (GdkColormap   *colormap,
109                                 GdkPixmap     *pixmap,
110                                 GdkBitmap     *mask,
111                                 gint           hot_x,
112                                 gint           hot_y);
113
114
115 /* Internal functions */
116 void gtk_drag_source_handle_event (GtkWidget *widget,
117                                    GdkEvent  *event);
118 void gtk_drag_dest_handle_event (GtkWidget *toplevel,
119                                  GdkEvent  *event);
120
121 #ifdef __cplusplus
122 }
123 #endif /* __cplusplus */
124
125 #endif /* __GTK_DND_H__ */
126
127
128