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
4  *
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.
9  *
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.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 /*
20  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
21  * file for a list of people on the GTK+ Team.  See the ChangeLog
22  * files for a list of changes.  These files are distributed with
23  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
24  */
25 
26 #ifndef __GTK_DRAG_DEST_H__
27 #define __GTK_DRAG_DEST_H__
28 
29 
30 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
31 #error "Only <gtk/gtk.h> can be included directly."
32 #endif
33 
34 #include <gtk/gtkselection.h>
35 #include <gtk/gtkwidget.h>
36 
37 
38 G_BEGIN_DECLS
39 
40 /**
41  * GtkDestDefaults:
42  * @GTK_DEST_DEFAULT_MOTION: If set for a widget, GTK+, during a drag over this
43  *   widget will check if the drag matches this widget’s list of possible targets
44  *   and actions.
45  *   GTK+ will then call gdk_drag_status() as appropriate.
46  * @GTK_DEST_DEFAULT_HIGHLIGHT: If set for a widget, GTK+ will draw a highlight on
47  *   this widget as long as a drag is over this widget and the widget drag format
48  *   and action are acceptable.
49  * @GTK_DEST_DEFAULT_DROP: If set for a widget, when a drop occurs, GTK+ will
50  *   will check if the drag matches this widget’s list of possible targets and
51  *   actions. If so, GTK+ will call gtk_drag_get_data() on behalf of the widget.
52  *   Whether or not the drop is successful, GTK+ will call gtk_drag_finish(). If
53  *   the action was a move, then if the drag was successful, then %TRUE will be
54  *   passed for the @delete parameter to gtk_drag_finish().
55  * @GTK_DEST_DEFAULT_ALL: If set, specifies that all default actions should
56  *   be taken.
57  *
58  * The #GtkDestDefaults enumeration specifies the various
59  * types of action that will be taken on behalf
60  * of the user for a drag destination site.
61  */
62 typedef enum {
63   GTK_DEST_DEFAULT_MOTION     = 1 << 0,
64   GTK_DEST_DEFAULT_HIGHLIGHT  = 1 << 1,
65   GTK_DEST_DEFAULT_DROP       = 1 << 2,
66   GTK_DEST_DEFAULT_ALL        = 0x07
67 } GtkDestDefaults;
68 
69 GDK_AVAILABLE_IN_ALL
70 void gtk_drag_dest_set   (GtkWidget            *widget,
71                           GtkDestDefaults       flags,
72                           const GtkTargetEntry *targets,
73                           gint                  n_targets,
74                           GdkDragAction         actions);
75 
76 GDK_DEPRECATED_IN_3_22
77 void gtk_drag_dest_set_proxy (GtkWidget      *widget,
78                               GdkWindow      *proxy_window,
79                               GdkDragProtocol protocol,
80                               gboolean        use_coordinates);
81 
82 GDK_AVAILABLE_IN_ALL
83 void gtk_drag_dest_unset (GtkWidget          *widget);
84 
85 GDK_AVAILABLE_IN_ALL
86 GdkAtom        gtk_drag_dest_find_target     (GtkWidget      *widget,
87                                               GdkDragContext *context,
88                                               GtkTargetList  *target_list);
89 GDK_AVAILABLE_IN_ALL
90 GtkTargetList* gtk_drag_dest_get_target_list (GtkWidget      *widget);
91 GDK_AVAILABLE_IN_ALL
92 void           gtk_drag_dest_set_target_list (GtkWidget      *widget,
93                                               GtkTargetList  *target_list);
94 GDK_AVAILABLE_IN_ALL
95 void           gtk_drag_dest_add_text_targets  (GtkWidget    *widget);
96 GDK_AVAILABLE_IN_ALL
97 void           gtk_drag_dest_add_image_targets (GtkWidget    *widget);
98 GDK_AVAILABLE_IN_ALL
99 void           gtk_drag_dest_add_uri_targets   (GtkWidget    *widget);
100 
101 GDK_AVAILABLE_IN_ALL
102 void           gtk_drag_dest_set_track_motion  (GtkWidget *widget,
103                                                 gboolean   track_motion);
104 GDK_AVAILABLE_IN_ALL
105 gboolean       gtk_drag_dest_get_track_motion  (GtkWidget *widget);
106 
107 
108 G_END_DECLS
109 
110 #endif /* __GTK_DRAG_DEST_H__ */
111