source: trunk/third/gtk/gtk/gtkdnd.h @ 14482

Revision 14482, 4.3 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r14481, which included commits to RCS files with non-trunk default branches.
Line 
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
20/*
21 * Modified by the GTK+ Team and others 1997-1999.  See the AUTHORS
22 * file for a list of people on the GTK+ Team.  See the ChangeLog
23 * files for a list of changes.  These files are distributed with
24 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
25 */
26
27#ifndef __GTK_DND_H__
28#define __GTK_DND_H__
29
30#include <gdk/gdk.h>
31#include <gtk/gtkenums.h>
32#include <gtk/gtkwidget.h>
33#include <gtk/gtkselection.h>
34
35#ifdef __cplusplus
36extern "C" {
37#endif /* __cplusplus */
38
39typedef enum {
40  GTK_DEST_DEFAULT_MOTION     = 1 << 0, /* respond to "drag_motion" */
41  GTK_DEST_DEFAULT_HIGHLIGHT  = 1 << 1, /* auto-highlight */
42  GTK_DEST_DEFAULT_DROP       = 1 << 2, /* respond to "drag_drop" */
43  GTK_DEST_DEFAULT_ALL        = 0x07
44} GtkDestDefaults;
45
46/* Flags for the GtkTargetEntry on the destination side
47 */
48typedef enum {
49  GTK_TARGET_SAME_APP = 1 << 0,    /*< nick=same-app >*/
50  GTK_TARGET_SAME_WIDGET = 1 << 1  /*< nick=same-widget >*/
51} GtkTargetFlags;
52
53/* Destination side */
54
55void gtk_drag_get_data (GtkWidget      *widget,
56                        GdkDragContext *context,
57                        GdkAtom         target,
58                        guint32         time);
59void gtk_drag_finish   (GdkDragContext *context,
60                        gboolean        success,
61                        gboolean        del,
62                        guint32         time);
63
64GtkWidget *gtk_drag_get_source_widget (GdkDragContext *context);
65
66void gtk_drag_highlight   (GtkWidget  *widget);
67void gtk_drag_unhighlight (GtkWidget  *widget);
68
69void gtk_drag_dest_set   (GtkWidget            *widget,
70                          GtkDestDefaults       flags,
71                          const GtkTargetEntry *targets,
72                          gint                  n_targets,
73                          GdkDragAction         actions);
74
75void gtk_drag_dest_set_proxy (GtkWidget      *widget,
76                              GdkWindow      *proxy_window,
77                              GdkDragProtocol protocol,
78                              gboolean        use_coordinates);
79
80/* There probably should be functions for setting the targets
81 * as a GtkTargetList
82 */
83
84void gtk_drag_dest_unset (GtkWidget          *widget);
85
86/* Source side */
87
88void gtk_drag_source_set  (GtkWidget            *widget,
89                           GdkModifierType       start_button_mask,
90                           const GtkTargetEntry *targets,
91                           gint                  n_targets,
92                           GdkDragAction         actions);
93
94void gtk_drag_source_unset (GtkWidget        *widget);
95
96void gtk_drag_source_set_icon (GtkWidget     *widget,
97                               GdkColormap   *colormap,
98                               GdkPixmap     *pixmap,
99                               GdkBitmap     *mask);
100
101/* There probably should be functions for setting the targets
102 * as a GtkTargetList
103 */
104
105GdkDragContext *gtk_drag_begin (GtkWidget         *widget,
106                                GtkTargetList     *targets,
107                                GdkDragAction      actions,
108                                gint               button,
109                                GdkEvent          *event);
110
111/* Set the image being dragged around
112 */
113void gtk_drag_set_icon_widget  (GdkDragContext    *context,
114                                GtkWidget         *widget,
115                                gint               hot_x,
116                                gint               hot_y);
117
118void gtk_drag_set_icon_pixmap  (GdkDragContext    *context,
119                                GdkColormap       *colormap,
120                                GdkPixmap         *pixmap,
121                                GdkBitmap         *mask,
122                                gint               hot_x,
123                                gint               hot_y);
124
125void gtk_drag_set_icon_default (GdkDragContext    *context);
126
127void gtk_drag_set_default_icon (GdkColormap   *colormap,
128                                GdkPixmap     *pixmap,
129                                GdkBitmap     *mask,
130                                gint           hot_x,
131                                gint           hot_y);
132
133
134/* Internal functions */
135void gtk_drag_source_handle_event (GtkWidget *widget,
136                                   GdkEvent  *event);
137void gtk_drag_dest_handle_event (GtkWidget *toplevel,
138                                 GdkEvent  *event);
139
140#ifdef __cplusplus
141}
142#endif /* __cplusplus */
143
144#endif /* __GTK_DND_H__ */
145
146
147
Note: See TracBrowser for help on using the repository browser.