forked from dmitryvk/cl-gtk2
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgdk.drag-and-drop.lisp
158 lines (118 loc) · 4.87 KB
/
gdk.drag-and-drop.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
(in-package :gdk)
(defcstruct %gdk-drag-context
(parent-instance gobject.ffi::%g-object)
(protocol gdk-drag-protocol)
(is-source :boolean)
(source-window (g-object gdk-window))
(dest-window (g-object gdk-window))
(targets (glib:glist gdk-atom-as-string :free-from-foreign nil))
(actions gdk-drag-action)
(suggested-action gdk-drag-action)
(action gdk-drag-action)
(start-time :uint32))
(defctype %gdk-drag-context (:struct %gdk-drag-context))
(defun %gdk-drag-context-get-protocol (context)
(foreign-slot-value (pointer context) '%gdk-drag-context 'protocol))
(defun %gdk-drag-context-get-is-source (context)
(foreign-slot-value (pointer context) '%gdk-drag-context 'is-source))
(defun %gdk-drag-context-get-source-window (context)
(foreign-slot-value (pointer context) '%gdk-drag-context 'source-window))
(defun %gdk-drag-context-get-dest-window (context)
(foreign-slot-value (pointer context) '%gdk-drag-context 'dest-window))
(defun %gdk-drag-context-get-targets (context)
(foreign-slot-value (pointer context) '%gdk-drag-context 'targets))
(defun %gdk-drag-context-get-actions (context)
(foreign-slot-value (pointer context) '%gdk-drag-context 'actions))
(defun %gdk-drag-context-get-suggested-action (context)
(foreign-slot-value (pointer context) '%gdk-drag-context 'suggested-action))
(defun %gdk-drag-context-get-action (context)
(foreign-slot-value (pointer context) '%gdk-drag-context 'action))
(defun %gdk-drag-context-get-start-time (context)
(foreign-slot-value (pointer context) '%gdk-drag-context 'start-time))
(defcfun gdk-drag-get-selection gdk-atom-as-string
(context (g-object drag-context)))
(export 'gdk-drag-get-selection)
(defcfun gdk-drag-abort :void
(context (g-object drag-context))
(time :uint32))
(export 'gdk-drag-abort)
(defcfun gdk-drop-reply :void
(context (g-object drag-context))
(ok :boolean)
(time :uint32))
(export 'gdk-drop-reply)
(defcfun gdk-drag-drop :void
(context (g-object drag-context))
(time :uint32))
(export 'gdk-drag-drop)
(defcfun gdk_drag_find_window :void
(context (g-object drag-context))
(window (g-object gdk-window))
(x-root :int)
(y-root :int)
(dest-window (:pointer (g-object gdk-window)))
(protocol (:pointer gdk-drag-protocol)))
(defun gdk-drag-find-window (context window x-root y-root)
(with-foreign-objects ((dest-window :pointer) (protocol 'gdk-drag-protocol))
(gdk_drag_find_window context window x-root y-root dest-window protocol)
(values (mem-ref dest-window '(g-object gdk-window))
(mem-ref protocol 'gdk-drag-protocol))))
(export 'gdk-drag-find-window)
(defcfun gdk_drag_find_window_for_screen :void
(context (g-object drag-context))
(window (g-object gdk-window))
(screen (g-object screen))
(x-root :int)
(y-root :int)
(dest-window (:pointer (g-object gdk-window)))
(protocol (:pointer gdk-drag-protocol)))
(defun gdk-drag-find-window-for-screen (context window screen x-root y-root)
(with-foreign-objects ((dest-window :pointer) (protocol 'gdk-drag-protocol))
(gdk_drag_find_window_for_screen context window screen x-root y-root dest-window protocol)
(values (mem-ref dest-window '(g-object gdk-window))
(mem-ref protocol 'gdk-drag-protocol))))
(export 'gdk-drag-find-window-for-screen)
(defcfun gdk-drag-begin (g-object gdk-drag-context :already-referenced)
(window (g-object gdk-window))
(targets (glib:glist gdk-atom-as-string)))
(export 'gdk-drag-begin)
(defcfun gdk-drag-motion :boolean
(context (g-object drag-context))
(dest-window (g-object gdk-window))
(protocol gdk-drag-protocol)
(x-root :int)
(y-root :int)
(suggested-action gdk-drag-action)
(possible-actions gdk-drag-action)
(time :uint32))
(export 'gdk-drag-motion)
(defcfun gdk-drop-finish :void
(context (g-object drag-context))
(success :boolean)
(time :uint32))
(export 'gdk-drop-finish)
(defcfun gdk_drag_get_protocol native-window
(xid native-window)
(protocol (:pointer gdk-drag-protocol)))
(defun gdk-drag-get-protocol (xid)
(with-foreign-object (protocol 'gdk-drag-protocol)
(let ((dest-window (gdk_drag_get_protocol xid protocol)))
(values dest-window (mem-ref protocol 'gdk-drag-protocol)))))
(export 'gdk-drag-get-protocol)
(defcfun gdk_drag_get_protocol_for_display native-window
(display (g-object display))
(xid native-window)
(protocol (:pointer gdk-drag-protocol)))
(defun gdk-drag-get-protocol-for-dispaly (display xid)
(with-foreign-object (protocol 'gdk-drag-protocol)
(let ((dest-window (gdk_drag_get_protocol_for_display display xid protocol)))
(values dest-window (mem-ref protocol 'gdk-drag-protocol)))))
(export 'gdk-drag-get-protocol-for-display)
(defcfun gdk-drag-status :void
(context (g-object drag-context))
(action gdk-drag-action)
(time :uint32))
(export 'gdk-drag-status)
(defcfun gdk-drag-drop-succeeded :boolean
(context (g-object drag-context)))
(export 'gdk-drag-drop-succeeded)