rest gtk-icon-factory- functions
[cl-gtk2.git] / gdk / gdk.dnd.lisp
1 (in-package :gdk)
2
3 (gobject:define-g-enum "GdkDragProtocol" drag-protocol
4   (:export t :type-initializer "gdk_drag_protocol_get_type")
5   (:motif 0)
6   (:xdnd 1)
7   (:rootwin 2)
8   (:none 3)
9   (:win32-dropfiles 4)
10   (:ole2 5)
11   (:local 6))
12
13 (define-g-flags "GdkDragAction" drag-action
14     (:export t :type-initializer "gdk_drag_action_get_type")
15   (:default 1)
16   (:copy 2)
17   (:move 4)
18   (:link 8)
19   (:private 16)
20   (:ask 32))
21
22 (defcfun gdk-drag-get-selection gdk-atom
23   (context g-object))
24
25 (defun drag-get-selection (context)
26   (gdk-drag-get-selection context))
27
28 (export 'drag-get-selection)
29
30 (defcfun gdk-drag-abort :void
31   (context g-object)
32   (time :uint32))
33
34 (defun drag-abort (context time)
35   (gdk-drag-abort context time))
36
37 (export 'drag-abort)
38
39 (defcfun gdk-drop-reply :void
40   (context g-object)
41   (ok :boolean)
42   (time :uint32))
43
44 (defun drop-reply (context ok time)
45   (gdk-drop-reply context ok time))
46
47 (export 'drop-reply)
48
49 ;; TODO : GdkDragContext * gdk_drag_context_new(void);
50
51 (defcfun gdk-drag-drop :void
52   (context g-object)
53   (time :uint32))
54
55 (defun drag-drop (context time)
56   (gdk-drag-drop context time))
57
58 (export 'drag-drop)
59
60 #|
61 void                gdk_drag_find_window                (GdkDragContext *context,
62                                                          GdkWindow *drag_window,
63                                                          gint x_root,
64                                                          gint y_root,
65                                                          GdkWindow **dest_window,
66                                                          GdkDragProtocol *protocol);
67
68 void                gdk_drag_find_window_for_screen     (GdkDragContext *context,
69                                                          GdkWindow *drag_window,
70                                                          GdkScreen *screen,
71                                                          gint x_root,
72                                                          gint y_root,
73                                                          GdkWindow **dest_window,
74                                                          GdkDragProtocol *protocol);
75
76 GdkDragContext *    gdk_drag_begin                      (GdkWindow *window,
77                                                          GList *targets);
78
79 gboolean            gdk_drag_motion                     (GdkDragContext *context,
80                                                          GdkWindow *dest_window,
81                                                          GdkDragProtocol protocol,
82                                                          gint x_root,
83                                                          gint y_root,
84                                                          GdkDragAction suggested_action,
85                                                          GdkDragAction possible_actions,
86                                                          guint32 time_);
87 |#
88
89 (defcfun gdk-drop-finish :void
90   (context g-object)
91   (success :boolean)
92   (time :uint32))
93
94 (defun drop-finish (context success time)
95   (gdk-drop-finish context success time))
96
97 (export 'drop-finish)
98
99 (defcfun gdk-drag-get-protocol native-window
100   (xid native-window)
101   (protocol :pointer))
102
103 (defun drag-get-protocol (xid)
104   (with-foreign-objects ((protocol 'drag-protocol))
105     (let ((result (gdk-drag-get-protocol xid protocol)))
106       (values result
107               (mem-ref protocol 'drag-protocol)))))
108
109 (export 'drag-get-protocol)
110
111 (defcfun gdk-drag-get-protocol-for-display native-window
112   (display g-object)
113   (xid native-window)
114   (protocol :pointer))
115   
116 (defun drag-get-protocol-for-display (display xid)
117   (with-foreign-objects ((protocol 'drag-protocol))
118     (let ((result (gdk-drag-get-protocol-for-display display xid protocol)))
119       (values result
120               (mem-ref protocol 'drag-protocol)))))
121
122 (export 'drag-get-protocol-for-display)
123
124 (defcfun gdk-drag-status :void
125   (context g-object)
126   (action drag-action)
127   (time :uint))
128
129 (defun drag-status (context action time)
130   (gdk-drag-status context action time))
131
132 (export 'drag-status)
133
134 (defcfun gdk-drag-drop-succeeded :boolean
135   (context g-object))
136
137 (defun drag-drop-succeeded (context)
138   (gdk-drag-drop-succeeded context))
139
140 (export 'drag-drop-succeeded)
141