1 /* -*- Mode: C; c-file-style: "gnu"; tab-width: 8 -*- */
2 /* GTK - The GIMP Toolkit
3 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser 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 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
22 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
23 * file for a list of people on the GTK+ Team. See the ChangeLog
24 * files for a list of changes. These files are distributed with
25 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
32 #include <gtk/gtkenums.h>
33 #include <gtk/gtkwidget.h>
34 #include <gtk/gtkselection.h>
39 GTK_DEST_DEFAULT_MOTION = 1 << 0, /* respond to "drag_motion" */
40 GTK_DEST_DEFAULT_HIGHLIGHT = 1 << 1, /* auto-highlight */
41 GTK_DEST_DEFAULT_DROP = 1 << 2, /* respond to "drag_drop" */
42 GTK_DEST_DEFAULT_ALL = 0x07
45 /* Flags for the GtkTargetEntry on the destination side
48 GTK_TARGET_SAME_APP = 1 << 0, /*< nick=same-app >*/
49 GTK_TARGET_SAME_WIDGET = 1 << 1, /*< nick=same-widget >*/
50 GTK_TARGET_OTHER_APP = 1 << 2, /*< nick=other-app >*/
51 GTK_TARGET_OTHER_WIDGET = 1 << 3 /*< nick=other-widget >*/
54 /* Destination side */
56 void gtk_drag_get_data (GtkWidget *widget,
57 GdkDragContext *context,
60 void gtk_drag_finish (GdkDragContext *context,
65 GtkWidget *gtk_drag_get_source_widget (GdkDragContext *context);
67 void gtk_drag_highlight (GtkWidget *widget);
68 void gtk_drag_unhighlight (GtkWidget *widget);
70 void gtk_drag_dest_set (GtkWidget *widget,
71 GtkDestDefaults flags,
72 const GtkTargetEntry *targets,
74 GdkDragAction actions);
76 void gtk_drag_dest_set_proxy (GtkWidget *widget,
77 GdkWindow *proxy_window,
78 GdkDragProtocol protocol,
79 gboolean use_coordinates);
81 void gtk_drag_dest_unset (GtkWidget *widget);
83 GdkAtom gtk_drag_dest_find_target (GtkWidget *widget,
84 GdkDragContext *context,
85 GtkTargetList *target_list);
86 GtkTargetList* gtk_drag_dest_get_target_list (GtkWidget *widget);
87 void gtk_drag_dest_set_target_list (GtkWidget *widget,
88 GtkTargetList *target_list);
89 void gtk_drag_dest_add_text_targets (GtkWidget *widget);
90 void gtk_drag_dest_add_image_targets (GtkWidget *widget);
91 void gtk_drag_dest_add_uri_targets (GtkWidget *widget);
93 void gtk_drag_dest_set_track_motion (GtkWidget *widget,
94 gboolean track_motion);
95 gboolean gtk_drag_dest_get_track_motion (GtkWidget *widget);
99 void gtk_drag_source_set (GtkWidget *widget,
100 GdkModifierType start_button_mask,
101 const GtkTargetEntry *targets,
103 GdkDragAction actions);
105 void gtk_drag_source_unset (GtkWidget *widget);
107 GtkTargetList* gtk_drag_source_get_target_list (GtkWidget *widget);
108 void gtk_drag_source_set_target_list (GtkWidget *widget,
109 GtkTargetList *target_list);
110 void gtk_drag_source_add_text_targets (GtkWidget *widget);
111 void gtk_drag_source_add_image_targets (GtkWidget *widget);
112 void gtk_drag_source_add_uri_targets (GtkWidget *widget);
114 void gtk_drag_source_set_icon (GtkWidget *widget,
115 GdkColormap *colormap,
118 void gtk_drag_source_set_icon_pixbuf (GtkWidget *widget,
120 void gtk_drag_source_set_icon_stock (GtkWidget *widget,
121 const gchar *stock_id);
122 void gtk_drag_source_set_icon_name (GtkWidget *widget,
123 const gchar *icon_name);
125 /* There probably should be functions for setting the targets
129 GdkDragContext *gtk_drag_begin (GtkWidget *widget,
130 GtkTargetList *targets,
131 GdkDragAction actions,
135 /* Set the image being dragged around
137 void gtk_drag_set_icon_widget (GdkDragContext *context,
141 void gtk_drag_set_icon_pixmap (GdkDragContext *context,
142 GdkColormap *colormap,
147 void gtk_drag_set_icon_pixbuf (GdkDragContext *context,
151 void gtk_drag_set_icon_stock (GdkDragContext *context,
152 const gchar *stock_id,
155 void gtk_drag_set_icon_name (GdkDragContext *context,
156 const gchar *icon_name,
160 void gtk_drag_set_icon_default (GdkDragContext *context);
162 gboolean gtk_drag_check_threshold (GtkWidget *widget,
168 /* Internal functions */
169 void _gtk_drag_source_handle_event (GtkWidget *widget,
171 void _gtk_drag_dest_handle_event (GtkWidget *toplevel,
174 #ifndef GTK_DISABLE_DEPRECATED
175 void gtk_drag_set_default_icon (GdkColormap *colormap,
180 #endif /* !GTK_DISABLE_DEPRECATED */
184 #endif /* __GTK_DND_H__ */