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/.
28 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
29 #error "Only <gtk/gtk.h> can be included directly."
36 #include <gtk/gtkwidget.h>
37 #include <gtk/gtkselection.h>
43 GTK_DEST_DEFAULT_MOTION = 1 << 0, /* respond to "drag_motion" */
44 GTK_DEST_DEFAULT_HIGHLIGHT = 1 << 1, /* auto-highlight */
45 GTK_DEST_DEFAULT_DROP = 1 << 2, /* respond to "drag_drop" */
46 GTK_DEST_DEFAULT_ALL = 0x07
49 /* Flags for the GtkTargetEntry on the destination side
52 GTK_TARGET_SAME_APP = 1 << 0, /*< nick=same-app >*/
53 GTK_TARGET_SAME_WIDGET = 1 << 1, /*< nick=same-widget >*/
54 GTK_TARGET_OTHER_APP = 1 << 2, /*< nick=other-app >*/
55 GTK_TARGET_OTHER_WIDGET = 1 << 3 /*< nick=other-widget >*/
58 /* Destination side */
60 void gtk_drag_get_data (GtkWidget *widget,
61 GdkDragContext *context,
64 void gtk_drag_finish (GdkDragContext *context,
69 GtkWidget *gtk_drag_get_source_widget (GdkDragContext *context);
71 void gtk_drag_highlight (GtkWidget *widget);
72 void gtk_drag_unhighlight (GtkWidget *widget);
74 void gtk_drag_dest_set (GtkWidget *widget,
75 GtkDestDefaults flags,
76 const GtkTargetEntry *targets,
78 GdkDragAction actions);
80 void gtk_drag_dest_set_proxy (GtkWidget *widget,
81 GdkWindow *proxy_window,
82 GdkDragProtocol protocol,
83 gboolean use_coordinates);
85 void gtk_drag_dest_unset (GtkWidget *widget);
87 GdkAtom gtk_drag_dest_find_target (GtkWidget *widget,
88 GdkDragContext *context,
89 GtkTargetList *target_list);
90 GtkTargetList* gtk_drag_dest_get_target_list (GtkWidget *widget);
91 void gtk_drag_dest_set_target_list (GtkWidget *widget,
92 GtkTargetList *target_list);
93 void gtk_drag_dest_add_text_targets (GtkWidget *widget);
94 void gtk_drag_dest_add_image_targets (GtkWidget *widget);
95 void gtk_drag_dest_add_uri_targets (GtkWidget *widget);
97 void gtk_drag_dest_set_track_motion (GtkWidget *widget,
98 gboolean track_motion);
99 gboolean gtk_drag_dest_get_track_motion (GtkWidget *widget);
103 void gtk_drag_source_set (GtkWidget *widget,
104 GdkModifierType start_button_mask,
105 const GtkTargetEntry *targets,
107 GdkDragAction actions);
109 void gtk_drag_source_unset (GtkWidget *widget);
111 GtkTargetList* gtk_drag_source_get_target_list (GtkWidget *widget);
112 void gtk_drag_source_set_target_list (GtkWidget *widget,
113 GtkTargetList *target_list);
114 void gtk_drag_source_add_text_targets (GtkWidget *widget);
115 void gtk_drag_source_add_image_targets (GtkWidget *widget);
116 void gtk_drag_source_add_uri_targets (GtkWidget *widget);
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_pixbuf (GdkDragContext *context,
145 void gtk_drag_set_icon_stock (GdkDragContext *context,
146 const gchar *stock_id,
149 void gtk_drag_set_icon_surface(GdkDragContext *context,
150 cairo_surface_t *surface);
151 void gtk_drag_set_icon_name (GdkDragContext *context,
152 const gchar *icon_name,
156 void gtk_drag_set_icon_default (GdkDragContext *context);
158 gboolean gtk_drag_check_threshold (GtkWidget *widget,
164 /* Internal functions */
165 void _gtk_drag_source_handle_event (GtkWidget *widget,
167 void _gtk_drag_dest_handle_event (GtkWidget *toplevel,
172 #endif /* __GTK_DND_H__ */