1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser 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 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser 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.
21 * Modified by the GTK+ Team and others 1997-2000. 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/.
31 #include <gtk/gtkenums.h>
32 #include <gtk/gtkwidget.h>
33 #include <gtk/gtkselection.h>
37 #endif /* __cplusplus */
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
46 /* Flags for the GtkTargetEntry on the destination side
49 GTK_TARGET_SAME_APP = 1 << 0, /*< nick=same-app >*/
50 GTK_TARGET_SAME_WIDGET = 1 << 1 /*< nick=same-widget >*/
53 /* Destination side */
55 void gtk_drag_get_data (GtkWidget *widget,
56 GdkDragContext *context,
59 void gtk_drag_finish (GdkDragContext *context,
64 GtkWidget *gtk_drag_get_source_widget (GdkDragContext *context);
66 void gtk_drag_highlight (GtkWidget *widget);
67 void gtk_drag_unhighlight (GtkWidget *widget);
69 void gtk_drag_dest_set (GtkWidget *widget,
70 GtkDestDefaults flags,
71 const GtkTargetEntry *targets,
73 GdkDragAction actions);
75 void gtk_drag_dest_set_proxy (GtkWidget *widget,
76 GdkWindow *proxy_window,
77 GdkDragProtocol protocol,
78 gboolean use_coordinates);
80 void gtk_drag_dest_unset (GtkWidget *widget);
82 GdkAtom gtk_drag_dest_find_target (GtkWidget *widget,
83 GdkDragContext *context,
84 GtkTargetList *target_list);
85 GtkTargetList* gtk_drag_dest_get_target_list (GtkWidget *widget);
86 void gtk_drag_dest_set_target_list (GtkWidget *widget,
87 GtkTargetList *target_list);
88 void gtk_drag_dest_add_text_targets (GtkWidget *widget);
89 void gtk_drag_dest_add_image_targets (GtkWidget *widget);
93 void gtk_drag_source_set (GtkWidget *widget,
94 GdkModifierType start_button_mask,
95 const GtkTargetEntry *targets,
97 GdkDragAction actions);
99 void gtk_drag_source_unset (GtkWidget *widget);
101 GtkTargetList* gtk_drag_source_get_target_list (GtkWidget *widget);
102 void gtk_drag_source_set_target_list (GtkWidget *widget,
103 GtkTargetList *target_list);
104 void gtk_drag_source_add_text_targets (GtkWidget *widget);
105 void gtk_drag_source_add_image_targets (GtkWidget *widget);
107 void gtk_drag_source_set_icon (GtkWidget *widget,
108 GdkColormap *colormap,
111 void gtk_drag_source_set_icon_pixbuf (GtkWidget *widget,
113 void gtk_drag_source_set_icon_stock (GtkWidget *widget,
114 const gchar *stock_id);
116 /* There probably should be functions for setting the targets
120 GdkDragContext *gtk_drag_begin (GtkWidget *widget,
121 GtkTargetList *targets,
122 GdkDragAction actions,
126 /* Set the image being dragged around
128 void gtk_drag_set_icon_widget (GdkDragContext *context,
132 void gtk_drag_set_icon_pixmap (GdkDragContext *context,
133 GdkColormap *colormap,
138 void gtk_drag_set_icon_pixbuf (GdkDragContext *context,
142 void gtk_drag_set_icon_stock (GdkDragContext *context,
143 const gchar *stock_id,
147 void gtk_drag_set_icon_default (GdkDragContext *context);
149 gboolean gtk_drag_check_threshold (GtkWidget *widget,
155 /* Internal functions */
156 void _gtk_drag_source_handle_event (GtkWidget *widget,
158 void _gtk_drag_dest_handle_event (GtkWidget *toplevel,
161 #ifndef GTK_DISABLE_DEPRECATED
162 void gtk_drag_set_default_icon (GdkColormap *colormap,
167 #endif /* !GTK_DISABLE_DEPRECATED */
171 #endif /* __cplusplus */
173 #endif /* __GTK_DND_H__ */