-
Notifications
You must be signed in to change notification settings - Fork 6
/
xdg-shell-server-protocol.lisp
313 lines (276 loc) · 13.1 KB
/
xdg-shell-server-protocol.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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
(DEFPACKAGE :XDG-SHELL-SERVER-PROTOCOL
(:USE :COMMON-LISP
:CFFI
:WAYLAND-UTIL
:WAYLAND-SERVER-CORE
:WAYLAND-SERVER-PROTOCOL)
(:EXPORT XDG-SHELL-INTERFACE
XDG-SHELL-IMPLEMENTATION
EMPTY-XDG-SHELL-DESTROY
EMPTY-XDG-SHELL-USE-UNSTABLE-VERSION
EMPTY-XDG-SHELL-GET-XDG-SURFACE
EMPTY-XDG-SHELL-GET-XDG-POPUP
EMPTY-XDG-SHELL-PONG
IMPLEMENT-XDG-SHELL
XDG-SHELL-SEND-PING
XDG-SURFACE-INTERFACE
XDG-SURFACE-IMPLEMENTATION
EMPTY-XDG-SURFACE-DESTROY
EMPTY-XDG-SURFACE-SET-PARENT
EMPTY-XDG-SURFACE-SET-TITLE
EMPTY-XDG-SURFACE-SET-APP-ID
EMPTY-XDG-SURFACE-SHOW-WINDOW-MENU
EMPTY-XDG-SURFACE-MOVE
EMPTY-XDG-SURFACE-RESIZE
EMPTY-XDG-SURFACE-ACK-CONFIGURE
EMPTY-XDG-SURFACE-SET-WINDOW-GEOMETRY
EMPTY-XDG-SURFACE-SET-MAXIMIZED
EMPTY-XDG-SURFACE-UNSET-MAXIMIZED
EMPTY-XDG-SURFACE-SET-FULLSCREEN
EMPTY-XDG-SURFACE-UNSET-FULLSCREEN
EMPTY-XDG-SURFACE-SET-MINIMIZED
IMPLEMENT-XDG-SURFACE
XDG-SURFACE-SEND-CONFIGURE
XDG-SURFACE-SEND-CLOSE
XDG-POPUP-INTERFACE
XDG-POPUP-IMPLEMENTATION
EMPTY-XDG-POPUP-DESTROY
IMPLEMENT-XDG-POPUP
XDG-POPUP-SEND-POPUP-DONE
XDG-SHELL-SERVER-TYPES
INITIALIZE-XDG-SHELL-SERVER-INTERFACES))
(IN-PACKAGE :XDG-SHELL-SERVER-PROTOCOL)
(DEFPARAMETER XDG-SHELL-INTERFACE NIL)
(DEFCSTRUCT XDG-SHELL-IMPLEMENTATION (DESTROY :POINTER)
(USE-UNSTABLE-VERSION :POINTER) (GET-XDG-SURFACE :POINTER)
(GET-XDG-POPUP :POINTER) (PONG :POINTER))
(DEFCALLBACK EMPTY-XDG-SHELL-DESTROY :VOID
((CLIENT :POINTER) (RESOURCE :POINTER)))
(DEFCALLBACK EMPTY-XDG-SHELL-USE-UNSTABLE-VERSION :VOID
((CLIENT :POINTER) (RESOURCE :POINTER) (VERSION :INT32)))
(DEFCALLBACK EMPTY-XDG-SHELL-GET-XDG-SURFACE :VOID
((CLIENT :POINTER) (RESOURCE :POINTER) (ID :POINTER) (SURFACE :POINTER)))
(DEFCALLBACK EMPTY-XDG-SHELL-GET-XDG-POPUP :VOID
((CLIENT :POINTER) (RESOURCE :POINTER) (ID :POINTER) (SURFACE :POINTER)
(PARENT :POINTER) (SEAT :POINTER) (SERIAL :UINT32) (X :INT32) (Y :INT32)))
(DEFCALLBACK EMPTY-XDG-SHELL-PONG :VOID
((CLIENT :POINTER) (RESOURCE :POINTER) (SERIAL :UINT32)))
(DEFUN IMPLEMENT-XDG-SHELL
(
&KEY (DESTROY NIL) (USE-UNSTABLE-VERSION NIL) (GET-XDG-SURFACE NIL)
(GET-XDG-POPUP NIL) (PONG NIL))
(LET ((IMPLEMENTATION (FOREIGN-ALLOC '(:STRUCT XDG-SHELL-IMPLEMENTATION))))
(SETF (FOREIGN-SLOT-VALUE IMPLEMENTATION
'(:STRUCT XDG-SHELL-IMPLEMENTATION) 'DESTROY)
(IF DESTROY
DESTROY
(GET-CALLBACK 'EMPTY-XDG-SHELL-DESTROY)))
(SETF (FOREIGN-SLOT-VALUE IMPLEMENTATION
'(:STRUCT XDG-SHELL-IMPLEMENTATION) 'USE-UNSTABLE-VERSION)
(IF USE-UNSTABLE-VERSION
USE-UNSTABLE-VERSION
(GET-CALLBACK 'EMPTY-XDG-SHELL-USE-UNSTABLE-VERSION)))
(SETF (FOREIGN-SLOT-VALUE IMPLEMENTATION
'(:STRUCT XDG-SHELL-IMPLEMENTATION) 'GET-XDG-SURFACE)
(IF GET-XDG-SURFACE
GET-XDG-SURFACE
(GET-CALLBACK 'EMPTY-XDG-SHELL-GET-XDG-SURFACE)))
(SETF (FOREIGN-SLOT-VALUE IMPLEMENTATION
'(:STRUCT XDG-SHELL-IMPLEMENTATION) 'GET-XDG-POPUP)
(IF GET-XDG-POPUP
GET-XDG-POPUP
(GET-CALLBACK 'EMPTY-XDG-SHELL-GET-XDG-POPUP)))
(SETF (FOREIGN-SLOT-VALUE IMPLEMENTATION
'(:STRUCT XDG-SHELL-IMPLEMENTATION) 'PONG)
(IF PONG
PONG
(GET-CALLBACK 'EMPTY-XDG-SHELL-PONG)))
IMPLEMENTATION))
(DEFUN XDG-SHELL-SEND-PING (RESOURCE SERIAL)
(WL-RESOURCE-POST-EVENT RESOURCE 0 :UINT32 SERIAL))
(DEFPARAMETER XDG-SURFACE-INTERFACE NIL)
(DEFCSTRUCT XDG-SURFACE-IMPLEMENTATION (DESTROY :POINTER) (SET-PARENT :POINTER)
(SET-TITLE :POINTER) (SET-APP-ID :POINTER) (SHOW-WINDOW-MENU :POINTER)
(MOVE :POINTER) (RESIZE :POINTER) (ACK-CONFIGURE :POINTER)
(SET-WINDOW-GEOMETRY :POINTER) (SET-MAXIMIZED :POINTER)
(UNSET-MAXIMIZED :POINTER) (SET-FULLSCREEN :POINTER)
(UNSET-FULLSCREEN :POINTER) (SET-MINIMIZED :POINTER))
(DEFCALLBACK EMPTY-XDG-SURFACE-DESTROY :VOID
((CLIENT :POINTER) (RESOURCE :POINTER)))
(DEFCALLBACK EMPTY-XDG-SURFACE-SET-PARENT :VOID
((CLIENT :POINTER) (RESOURCE :POINTER) (PARENT :POINTER)))
(DEFCALLBACK EMPTY-XDG-SURFACE-SET-TITLE :VOID
((CLIENT :POINTER) (RESOURCE :POINTER) (TITLE :STRING)))
(DEFCALLBACK EMPTY-XDG-SURFACE-SET-APP-ID :VOID
((CLIENT :POINTER) (RESOURCE :POINTER) (APP-ID :STRING)))
(DEFCALLBACK EMPTY-XDG-SURFACE-SHOW-WINDOW-MENU :VOID
((CLIENT :POINTER) (RESOURCE :POINTER) (SEAT :POINTER) (SERIAL :UINT32)
(X :INT32) (Y :INT32)))
(DEFCALLBACK EMPTY-XDG-SURFACE-MOVE :VOID
((CLIENT :POINTER) (RESOURCE :POINTER) (SEAT :POINTER) (SERIAL :UINT32)))
(DEFCALLBACK EMPTY-XDG-SURFACE-RESIZE :VOID
((CLIENT :POINTER) (RESOURCE :POINTER) (SEAT :POINTER) (SERIAL :UINT32)
(EDGES :UINT32)))
(DEFCALLBACK EMPTY-XDG-SURFACE-ACK-CONFIGURE :VOID
((CLIENT :POINTER) (RESOURCE :POINTER) (SERIAL :UINT32)))
(DEFCALLBACK EMPTY-XDG-SURFACE-SET-WINDOW-GEOMETRY :VOID
((CLIENT :POINTER) (RESOURCE :POINTER) (X :INT32) (Y :INT32) (WIDTH :INT32)
(HEIGHT :INT32)))
(DEFCALLBACK EMPTY-XDG-SURFACE-SET-MAXIMIZED :VOID
((CLIENT :POINTER) (RESOURCE :POINTER)))
(DEFCALLBACK EMPTY-XDG-SURFACE-UNSET-MAXIMIZED :VOID
((CLIENT :POINTER) (RESOURCE :POINTER)))
(DEFCALLBACK EMPTY-XDG-SURFACE-SET-FULLSCREEN :VOID
((CLIENT :POINTER) (RESOURCE :POINTER) (OUTPUT :POINTER)))
(DEFCALLBACK EMPTY-XDG-SURFACE-UNSET-FULLSCREEN :VOID
((CLIENT :POINTER) (RESOURCE :POINTER)))
(DEFCALLBACK EMPTY-XDG-SURFACE-SET-MINIMIZED :VOID
((CLIENT :POINTER) (RESOURCE :POINTER)))
(DEFUN IMPLEMENT-XDG-SURFACE
(
&KEY (DESTROY NIL) (SET-PARENT NIL) (SET-TITLE NIL) (SET-APP-ID NIL)
(SHOW-WINDOW-MENU NIL) (MOVE NIL) (RESIZE NIL) (ACK-CONFIGURE NIL)
(SET-WINDOW-GEOMETRY NIL) (SET-MAXIMIZED NIL) (UNSET-MAXIMIZED NIL)
(SET-FULLSCREEN NIL) (UNSET-FULLSCREEN NIL) (SET-MINIMIZED NIL))
(LET ((IMPLEMENTATION (FOREIGN-ALLOC '(:STRUCT XDG-SURFACE-IMPLEMENTATION))))
(SETF (FOREIGN-SLOT-VALUE IMPLEMENTATION
'(:STRUCT XDG-SURFACE-IMPLEMENTATION) 'DESTROY)
(IF DESTROY
DESTROY
(GET-CALLBACK 'EMPTY-XDG-SURFACE-DESTROY)))
(SETF (FOREIGN-SLOT-VALUE IMPLEMENTATION
'(:STRUCT XDG-SURFACE-IMPLEMENTATION) 'SET-PARENT)
(IF SET-PARENT
SET-PARENT
(GET-CALLBACK 'EMPTY-XDG-SURFACE-SET-PARENT)))
(SETF (FOREIGN-SLOT-VALUE IMPLEMENTATION
'(:STRUCT XDG-SURFACE-IMPLEMENTATION) 'SET-TITLE)
(IF SET-TITLE
SET-TITLE
(GET-CALLBACK 'EMPTY-XDG-SURFACE-SET-TITLE)))
(SETF (FOREIGN-SLOT-VALUE IMPLEMENTATION
'(:STRUCT XDG-SURFACE-IMPLEMENTATION) 'SET-APP-ID)
(IF SET-APP-ID
SET-APP-ID
(GET-CALLBACK 'EMPTY-XDG-SURFACE-SET-APP-ID)))
(SETF (FOREIGN-SLOT-VALUE IMPLEMENTATION
'(:STRUCT XDG-SURFACE-IMPLEMENTATION) 'SHOW-WINDOW-MENU)
(IF SHOW-WINDOW-MENU
SHOW-WINDOW-MENU
(GET-CALLBACK 'EMPTY-XDG-SURFACE-SHOW-WINDOW-MENU)))
(SETF (FOREIGN-SLOT-VALUE IMPLEMENTATION
'(:STRUCT XDG-SURFACE-IMPLEMENTATION) 'MOVE)
(IF MOVE
MOVE
(GET-CALLBACK 'EMPTY-XDG-SURFACE-MOVE)))
(SETF (FOREIGN-SLOT-VALUE IMPLEMENTATION
'(:STRUCT XDG-SURFACE-IMPLEMENTATION) 'RESIZE)
(IF RESIZE
RESIZE
(GET-CALLBACK 'EMPTY-XDG-SURFACE-RESIZE)))
(SETF (FOREIGN-SLOT-VALUE IMPLEMENTATION
'(:STRUCT XDG-SURFACE-IMPLEMENTATION) 'ACK-CONFIGURE)
(IF ACK-CONFIGURE
ACK-CONFIGURE
(GET-CALLBACK 'EMPTY-XDG-SURFACE-ACK-CONFIGURE)))
(SETF (FOREIGN-SLOT-VALUE IMPLEMENTATION
'(:STRUCT XDG-SURFACE-IMPLEMENTATION) 'SET-WINDOW-GEOMETRY)
(IF SET-WINDOW-GEOMETRY
SET-WINDOW-GEOMETRY
(GET-CALLBACK 'EMPTY-XDG-SURFACE-SET-WINDOW-GEOMETRY)))
(SETF (FOREIGN-SLOT-VALUE IMPLEMENTATION
'(:STRUCT XDG-SURFACE-IMPLEMENTATION) 'SET-MAXIMIZED)
(IF SET-MAXIMIZED
SET-MAXIMIZED
(GET-CALLBACK 'EMPTY-XDG-SURFACE-SET-MAXIMIZED)))
(SETF (FOREIGN-SLOT-VALUE IMPLEMENTATION
'(:STRUCT XDG-SURFACE-IMPLEMENTATION) 'UNSET-MAXIMIZED)
(IF UNSET-MAXIMIZED
UNSET-MAXIMIZED
(GET-CALLBACK 'EMPTY-XDG-SURFACE-UNSET-MAXIMIZED)))
(SETF (FOREIGN-SLOT-VALUE IMPLEMENTATION
'(:STRUCT XDG-SURFACE-IMPLEMENTATION) 'SET-FULLSCREEN)
(IF SET-FULLSCREEN
SET-FULLSCREEN
(GET-CALLBACK 'EMPTY-XDG-SURFACE-SET-FULLSCREEN)))
(SETF (FOREIGN-SLOT-VALUE IMPLEMENTATION
'(:STRUCT XDG-SURFACE-IMPLEMENTATION) 'UNSET-FULLSCREEN)
(IF UNSET-FULLSCREEN
UNSET-FULLSCREEN
(GET-CALLBACK 'EMPTY-XDG-SURFACE-UNSET-FULLSCREEN)))
(SETF (FOREIGN-SLOT-VALUE IMPLEMENTATION
'(:STRUCT XDG-SURFACE-IMPLEMENTATION) 'SET-MINIMIZED)
(IF SET-MINIMIZED
SET-MINIMIZED
(GET-CALLBACK 'EMPTY-XDG-SURFACE-SET-MINIMIZED)))
IMPLEMENTATION))
(DEFUN XDG-SURFACE-SEND-CONFIGURE (RESOURCE WIDTH HEIGHT STATES SERIAL)
(WL-RESOURCE-POST-EVENT RESOURCE 0 :INT32 WIDTH :INT32 HEIGHT :POINTER STATES
:UINT32 SERIAL))
(DEFUN XDG-SURFACE-SEND-CLOSE (RESOURCE) (WL-RESOURCE-POST-EVENT RESOURCE 1))
(DEFPARAMETER XDG-POPUP-INTERFACE NIL)
(DEFCSTRUCT XDG-POPUP-IMPLEMENTATION (DESTROY :POINTER))
(DEFCALLBACK EMPTY-XDG-POPUP-DESTROY :VOID
((CLIENT :POINTER) (RESOURCE :POINTER)))
(DEFUN IMPLEMENT-XDG-POPUP (&KEY (DESTROY NIL))
(LET ((IMPLEMENTATION (FOREIGN-ALLOC '(:STRUCT XDG-POPUP-IMPLEMENTATION))))
(SETF (FOREIGN-SLOT-VALUE IMPLEMENTATION
'(:STRUCT XDG-POPUP-IMPLEMENTATION) 'DESTROY)
(IF DESTROY
DESTROY
(GET-CALLBACK 'EMPTY-XDG-POPUP-DESTROY)))
IMPLEMENTATION))
(DEFUN XDG-POPUP-SEND-POPUP-DONE (RESOURCE) (WL-RESOURCE-POST-EVENT RESOURCE 0))
(DEFPARAMETER XDG-SHELL-SERVER-TYPES NIL)
(DEFUN INITIALIZE-XDG-SHELL-SERVER-INTERFACES ()
(SETF XDG-SHELL-INTERFACE
(MAKE-WL-INTERFACE "xdg_shell" 1 5 (NULL-POINTER) 1 (NULL-POINTER)))
(SETF XDG-SURFACE-INTERFACE
(MAKE-WL-INTERFACE "xdg_surface" 1 14 (NULL-POINTER) 2
(NULL-POINTER)))
(SETF XDG-POPUP-INTERFACE
(MAKE-WL-INTERFACE "xdg_popup" 1 1 (NULL-POINTER) 1 (NULL-POINTER)))
(SETF XDG-SHELL-SERVER-TYPES
(MAKE-WL-TYPES (NULL-POINTER) (NULL-POINTER) XDG-SURFACE-INTERFACE
WL-SURFACE-INTERFACE XDG-POPUP-INTERFACE WL-SURFACE-INTERFACE
WL-SURFACE-INTERFACE WL-SEAT-INTERFACE (NULL-POINTER) (NULL-POINTER)
(NULL-POINTER) (NULL-POINTER) (NULL-POINTER) XDG-SURFACE-INTERFACE
(NULL-POINTER) (NULL-POINTER) WL-SEAT-INTERFACE (NULL-POINTER)
(NULL-POINTER) (NULL-POINTER) WL-SEAT-INTERFACE (NULL-POINTER)
WL-SEAT-INTERFACE (NULL-POINTER) (NULL-POINTER) (NULL-POINTER)
(NULL-POINTER) (NULL-POINTER) (NULL-POINTER) (NULL-POINTER)
WL-OUTPUT-INTERFACE (NULL-POINTER) (NULL-POINTER) (NULL-POINTER)
(NULL-POINTER)))
(SET-REQUESTS XDG-SHELL-INTERFACE
(MAKE-WL-MESSAGE (LIST "destroy" "" XDG-SHELL-SERVER-TYPES)
(LIST "use_unstable_version" "i" (OFFSET-TYPES XDG-SHELL-SERVER-TYPES 1))
(LIST "get_xdg_surface" "no" (OFFSET-TYPES XDG-SHELL-SERVER-TYPES 2))
(LIST "get_xdg_popup" "nooouii" (OFFSET-TYPES XDG-SHELL-SERVER-TYPES 4))
(LIST "pong" "u" (OFFSET-TYPES XDG-SHELL-SERVER-TYPES 11))))
(SET-EVENTS XDG-SHELL-INTERFACE
(MAKE-WL-MESSAGE
(LIST "ping" "u" (OFFSET-TYPES XDG-SHELL-SERVER-TYPES 12))))
(SET-REQUESTS XDG-SURFACE-INTERFACE
(MAKE-WL-MESSAGE (LIST "destroy" "" XDG-SHELL-SERVER-TYPES)
(LIST "set_parent" "?o" (OFFSET-TYPES XDG-SHELL-SERVER-TYPES 13))
(LIST "set_title" "s" (OFFSET-TYPES XDG-SHELL-SERVER-TYPES 14))
(LIST "set_app_id" "s" (OFFSET-TYPES XDG-SHELL-SERVER-TYPES 15))
(LIST "show_window_menu" "ouii" (OFFSET-TYPES XDG-SHELL-SERVER-TYPES 16))
(LIST "move" "ou" (OFFSET-TYPES XDG-SHELL-SERVER-TYPES 20))
(LIST "resize" "ouu" (OFFSET-TYPES XDG-SHELL-SERVER-TYPES 22))
(LIST "ack_configure" "u" (OFFSET-TYPES XDG-SHELL-SERVER-TYPES 25))
(LIST "set_window_geometry" "iiii"
(OFFSET-TYPES XDG-SHELL-SERVER-TYPES 26))
(LIST "set_maximized" "" XDG-SHELL-SERVER-TYPES)
(LIST "unset_maximized" "" XDG-SHELL-SERVER-TYPES)
(LIST "set_fullscreen" "?o" (OFFSET-TYPES XDG-SHELL-SERVER-TYPES 30))
(LIST "unset_fullscreen" "" XDG-SHELL-SERVER-TYPES)
(LIST "set_minimized" "" XDG-SHELL-SERVER-TYPES)))
(SET-EVENTS XDG-SURFACE-INTERFACE
(MAKE-WL-MESSAGE
(LIST "configure" "iiau" (OFFSET-TYPES XDG-SHELL-SERVER-TYPES 31))
(LIST "close" "" XDG-SHELL-SERVER-TYPES)))
(SET-REQUESTS XDG-POPUP-INTERFACE
(MAKE-WL-MESSAGE (LIST "destroy" "" XDG-SHELL-SERVER-TYPES)))
(SET-EVENTS XDG-POPUP-INTERFACE
(MAKE-WL-MESSAGE (LIST "popup_done" "" XDG-SHELL-SERVER-TYPES))))