]> Pileus Git - ~andy/gtk/blob - gdk/gdkdnd.h
Fix some reported (but not significant) UMR's from purify. (#73160, Morten
[~andy/gtk] / gdk / gdkdnd.h
1 #ifndef __GDK_DND_H__
2 #define __GDK_DND_H__
3
4 #include <gdk/gdktypes.h>
5
6 #ifdef __cplusplus
7 extern "C" {
8 #endif /* __cplusplus */
9
10 typedef struct _GdkDragContext        GdkDragContext;
11
12 typedef enum
13 {
14   GDK_ACTION_DEFAULT = 1 << 0,
15   GDK_ACTION_COPY    = 1 << 1,
16   GDK_ACTION_MOVE    = 1 << 2,
17   GDK_ACTION_LINK    = 1 << 3,
18   GDK_ACTION_PRIVATE = 1 << 4,
19   GDK_ACTION_ASK     = 1 << 5
20 } GdkDragAction;
21
22 typedef enum
23 {
24   GDK_DRAG_PROTO_MOTIF,
25   GDK_DRAG_PROTO_XDND,
26   GDK_DRAG_PROTO_ROOTWIN,         /* A root window with nobody claiming
27                                    * drags */
28   GDK_DRAG_PROTO_NONE,            /* Not a valid drag window */
29   GDK_DRAG_PROTO_WIN32_DROPFILES, /* The simple WM_DROPFILES dnd */
30   GDK_DRAG_PROTO_OLE2,            /* The complex OLE2 dnd (not implemented) */
31   GDK_DRAG_PROTO_LOCAL            /* Intra-app */
32 } GdkDragProtocol;
33
34 /* Object that holds information about a drag in progress.
35  * this is used on both source and destination sides.
36  */
37
38 typedef struct _GdkDragContextClass GdkDragContextClass;
39
40 #define GDK_TYPE_DRAG_CONTEXT              (gdk_drag_context_get_type ())
41 #define GDK_DRAG_CONTEXT(object)           (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DRAG_CONTEXT, GdkDragContext))
42 #define GDK_DRAG_CONTEXT_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_DRAG_CONTEXT, GdkDragContextClass))
43 #define GDK_IS_DRAG_CONTEXT(object)        (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DRAG_CONTEXT))
44 #define GDK_IS_DRAG_CONTEXT_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_DRAG_CONTEXT))
45 #define GDK_DRAG_CONTEXT_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_DRAG_CONTEXT, GdkDragContextClass))
46
47 struct _GdkDragContext {
48   GObject parent_instance;
49
50   /*< public >*/
51   
52   GdkDragProtocol protocol;
53   
54   gboolean is_source;
55   
56   GdkWindow *source_window;
57   GdkWindow *dest_window;
58
59   GList *targets;
60   GdkDragAction actions;
61   GdkDragAction suggested_action;
62   GdkDragAction action; 
63
64   guint32 start_time;
65
66   /*< private >*/
67   
68   gpointer windowing_data;
69 };
70
71 struct _GdkDragContextClass {
72   GObjectClass parent_class;
73
74   
75 };
76
77 /* Drag and Drop */
78
79 GType            gdk_drag_context_get_type   (void) G_GNUC_CONST;
80 GdkDragContext * gdk_drag_context_new        (void);
81
82 #ifndef GDK_DISABLE_DEPRECATED
83 void             gdk_drag_context_ref        (GdkDragContext *context);
84 void             gdk_drag_context_unref      (GdkDragContext *context);
85 #endif
86
87 /* Destination side */
88
89 void             gdk_drag_status        (GdkDragContext   *context,
90                                          GdkDragAction     action,
91                                          guint32           time);
92 void             gdk_drop_reply         (GdkDragContext   *context,
93                                          gboolean          ok,
94                                          guint32           time);
95 void             gdk_drop_finish        (GdkDragContext   *context,
96                                          gboolean          success,
97                                          guint32           time);
98 GdkAtom          gdk_drag_get_selection (GdkDragContext   *context);
99
100 /* Source side */
101
102 GdkDragContext * gdk_drag_begin      (GdkWindow      *window,
103                                       GList          *targets);
104 guint32         gdk_drag_get_protocol (guint32          xid,
105                                        GdkDragProtocol *protocol);
106 void             gdk_drag_find_window (GdkDragContext   *context,
107                                        GdkWindow       *drag_window,
108                                        gint             x_root,
109                                        gint             y_root,
110                                        GdkWindow      **dest_window,
111                                        GdkDragProtocol *protocol);
112 gboolean        gdk_drag_motion      (GdkDragContext *context,
113                                       GdkWindow      *dest_window,
114                                       GdkDragProtocol protocol,
115                                       gint            x_root, 
116                                       gint            y_root,
117                                       GdkDragAction   suggested_action,
118                                       GdkDragAction   possible_actions,
119                                       guint32         time);
120 void            gdk_drag_drop        (GdkDragContext *context,
121                                       guint32         time);
122 void            gdk_drag_abort       (GdkDragContext *context,
123                                       guint32         time);
124
125 #ifdef __cplusplus
126 }
127 #endif /* __cplusplus */
128
129 #endif /* __GDK_DND_H__ */