Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: third_party/wayland/protocol/wayland-protocol.c

Issue 1426583009: third_party: Add wayland library. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/wayland/include/src/wayland-version.h ('k') | third_party/wayland/wayland.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright © 2008-2011 Kristian Høgsberg
3 * Copyright © 2010-2011 Intel Corporation
4 * Copyright © 2012-2013 Collabora, Ltd.
5 *
6 * Permission is hereby granted, free of charge, to any person
7 * obtaining a copy of this software and associated documentation files
8 * (the "Software"), to deal in the Software without restriction,
9 * including without limitation the rights to use, copy, modify, merge,
10 * publish, distribute, sublicense, and/or sell copies of the Software,
11 * and to permit persons to whom the Software is furnished to do so,
12 * subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial
16 * portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
22 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
23 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE.
26 */
27
28 #include <stdlib.h>
29 #include <stdint.h>
30 #include "wayland-util.h"
31
32 extern const struct wl_interface wl_buffer_interface;
33 extern const struct wl_interface wl_callback_interface;
34 extern const struct wl_interface wl_data_device_interface;
35 extern const struct wl_interface wl_data_offer_interface;
36 extern const struct wl_interface wl_data_source_interface;
37 extern const struct wl_interface wl_keyboard_interface;
38 extern const struct wl_interface wl_output_interface;
39 extern const struct wl_interface wl_pointer_interface;
40 extern const struct wl_interface wl_region_interface;
41 extern const struct wl_interface wl_registry_interface;
42 extern const struct wl_interface wl_seat_interface;
43 extern const struct wl_interface wl_shell_surface_interface;
44 extern const struct wl_interface wl_shm_pool_interface;
45 extern const struct wl_interface wl_subsurface_interface;
46 extern const struct wl_interface wl_surface_interface;
47 extern const struct wl_interface wl_touch_interface;
48
49 static const struct wl_interface *types[] = {
50 NULL,
51 NULL,
52 NULL,
53 NULL,
54 NULL,
55 NULL,
56 NULL,
57 NULL,
58 &wl_callback_interface,
59 &wl_registry_interface,
60 &wl_surface_interface,
61 &wl_region_interface,
62 &wl_buffer_interface,
63 NULL,
64 NULL,
65 NULL,
66 NULL,
67 NULL,
68 &wl_shm_pool_interface,
69 NULL,
70 NULL,
71 &wl_data_source_interface,
72 &wl_surface_interface,
73 &wl_surface_interface,
74 NULL,
75 &wl_data_source_interface,
76 NULL,
77 &wl_data_offer_interface,
78 NULL,
79 &wl_surface_interface,
80 NULL,
81 NULL,
82 &wl_data_offer_interface,
83 &wl_data_offer_interface,
84 &wl_data_source_interface,
85 &wl_data_device_interface,
86 &wl_seat_interface,
87 &wl_shell_surface_interface,
88 &wl_surface_interface,
89 &wl_seat_interface,
90 NULL,
91 &wl_seat_interface,
92 NULL,
93 NULL,
94 &wl_surface_interface,
95 NULL,
96 NULL,
97 NULL,
98 NULL,
99 NULL,
100 &wl_output_interface,
101 &wl_seat_interface,
102 NULL,
103 &wl_surface_interface,
104 NULL,
105 NULL,
106 NULL,
107 &wl_output_interface,
108 &wl_buffer_interface,
109 NULL,
110 NULL,
111 &wl_callback_interface,
112 &wl_region_interface,
113 &wl_region_interface,
114 &wl_output_interface,
115 &wl_output_interface,
116 &wl_pointer_interface,
117 &wl_keyboard_interface,
118 &wl_touch_interface,
119 NULL,
120 &wl_surface_interface,
121 NULL,
122 NULL,
123 NULL,
124 &wl_surface_interface,
125 NULL,
126 NULL,
127 NULL,
128 &wl_surface_interface,
129 NULL,
130 &wl_surface_interface,
131 NULL,
132 NULL,
133 &wl_surface_interface,
134 NULL,
135 NULL,
136 &wl_surface_interface,
137 NULL,
138 NULL,
139 NULL,
140 &wl_subsurface_interface,
141 &wl_surface_interface,
142 &wl_surface_interface,
143 &wl_surface_interface,
144 &wl_surface_interface,
145 };
146
147 static const struct wl_message wl_display_requests[] = {
148 { "sync", "n", types + 8 },
149 { "get_registry", "n", types + 9 },
150 };
151
152 static const struct wl_message wl_display_events[] = {
153 { "error", "ous", types + 0 },
154 { "delete_id", "u", types + 0 },
155 };
156
157 WL_EXPORT const struct wl_interface wl_display_interface = {
158 "wl_display", 1,
159 2, wl_display_requests,
160 2, wl_display_events,
161 };
162
163 static const struct wl_message wl_registry_requests[] = {
164 { "bind", "usun", types + 0 },
165 };
166
167 static const struct wl_message wl_registry_events[] = {
168 { "global", "usu", types + 0 },
169 { "global_remove", "u", types + 0 },
170 };
171
172 WL_EXPORT const struct wl_interface wl_registry_interface = {
173 "wl_registry", 1,
174 1, wl_registry_requests,
175 2, wl_registry_events,
176 };
177
178 static const struct wl_message wl_callback_events[] = {
179 { "done", "u", types + 0 },
180 };
181
182 WL_EXPORT const struct wl_interface wl_callback_interface = {
183 "wl_callback", 1,
184 0, NULL,
185 1, wl_callback_events,
186 };
187
188 static const struct wl_message wl_compositor_requests[] = {
189 { "create_surface", "n", types + 10 },
190 { "create_region", "n", types + 11 },
191 };
192
193 WL_EXPORT const struct wl_interface wl_compositor_interface = {
194 "wl_compositor", 3,
195 2, wl_compositor_requests,
196 0, NULL,
197 };
198
199 static const struct wl_message wl_shm_pool_requests[] = {
200 { "create_buffer", "niiiiu", types + 12 },
201 { "destroy", "", types + 0 },
202 { "resize", "i", types + 0 },
203 };
204
205 WL_EXPORT const struct wl_interface wl_shm_pool_interface = {
206 "wl_shm_pool", 1,
207 3, wl_shm_pool_requests,
208 0, NULL,
209 };
210
211 static const struct wl_message wl_shm_requests[] = {
212 { "create_pool", "nhi", types + 18 },
213 };
214
215 static const struct wl_message wl_shm_events[] = {
216 { "format", "u", types + 0 },
217 };
218
219 WL_EXPORT const struct wl_interface wl_shm_interface = {
220 "wl_shm", 1,
221 1, wl_shm_requests,
222 1, wl_shm_events,
223 };
224
225 static const struct wl_message wl_buffer_requests[] = {
226 { "destroy", "", types + 0 },
227 };
228
229 static const struct wl_message wl_buffer_events[] = {
230 { "release", "", types + 0 },
231 };
232
233 WL_EXPORT const struct wl_interface wl_buffer_interface = {
234 "wl_buffer", 1,
235 1, wl_buffer_requests,
236 1, wl_buffer_events,
237 };
238
239 static const struct wl_message wl_data_offer_requests[] = {
240 { "accept", "u?s", types + 0 },
241 { "receive", "sh", types + 0 },
242 { "destroy", "", types + 0 },
243 };
244
245 static const struct wl_message wl_data_offer_events[] = {
246 { "offer", "s", types + 0 },
247 };
248
249 WL_EXPORT const struct wl_interface wl_data_offer_interface = {
250 "wl_data_offer", 1,
251 3, wl_data_offer_requests,
252 1, wl_data_offer_events,
253 };
254
255 static const struct wl_message wl_data_source_requests[] = {
256 { "offer", "s", types + 0 },
257 { "destroy", "", types + 0 },
258 };
259
260 static const struct wl_message wl_data_source_events[] = {
261 { "target", "?s", types + 0 },
262 { "send", "sh", types + 0 },
263 { "cancelled", "", types + 0 },
264 };
265
266 WL_EXPORT const struct wl_interface wl_data_source_interface = {
267 "wl_data_source", 1,
268 2, wl_data_source_requests,
269 3, wl_data_source_events,
270 };
271
272 static const struct wl_message wl_data_device_requests[] = {
273 { "start_drag", "?oo?ou", types + 21 },
274 { "set_selection", "?ou", types + 25 },
275 { "release", "2", types + 0 },
276 };
277
278 static const struct wl_message wl_data_device_events[] = {
279 { "data_offer", "n", types + 27 },
280 { "enter", "uoff?o", types + 28 },
281 { "leave", "", types + 0 },
282 { "motion", "uff", types + 0 },
283 { "drop", "", types + 0 },
284 { "selection", "?o", types + 33 },
285 };
286
287 WL_EXPORT const struct wl_interface wl_data_device_interface = {
288 "wl_data_device", 2,
289 3, wl_data_device_requests,
290 6, wl_data_device_events,
291 };
292
293 static const struct wl_message wl_data_device_manager_requests[] = {
294 { "create_data_source", "n", types + 34 },
295 { "get_data_device", "no", types + 35 },
296 };
297
298 WL_EXPORT const struct wl_interface wl_data_device_manager_interface = {
299 "wl_data_device_manager", 2,
300 2, wl_data_device_manager_requests,
301 0, NULL,
302 };
303
304 static const struct wl_message wl_shell_requests[] = {
305 { "get_shell_surface", "no", types + 37 },
306 };
307
308 WL_EXPORT const struct wl_interface wl_shell_interface = {
309 "wl_shell", 1,
310 1, wl_shell_requests,
311 0, NULL,
312 };
313
314 static const struct wl_message wl_shell_surface_requests[] = {
315 { "pong", "u", types + 0 },
316 { "move", "ou", types + 39 },
317 { "resize", "ouu", types + 41 },
318 { "set_toplevel", "", types + 0 },
319 { "set_transient", "oiiu", types + 44 },
320 { "set_fullscreen", "uu?o", types + 48 },
321 { "set_popup", "ouoiiu", types + 51 },
322 { "set_maximized", "?o", types + 57 },
323 { "set_title", "s", types + 0 },
324 { "set_class", "s", types + 0 },
325 };
326
327 static const struct wl_message wl_shell_surface_events[] = {
328 { "ping", "u", types + 0 },
329 { "configure", "uii", types + 0 },
330 { "popup_done", "", types + 0 },
331 };
332
333 WL_EXPORT const struct wl_interface wl_shell_surface_interface = {
334 "wl_shell_surface", 1,
335 10, wl_shell_surface_requests,
336 3, wl_shell_surface_events,
337 };
338
339 static const struct wl_message wl_surface_requests[] = {
340 { "destroy", "", types + 0 },
341 { "attach", "?oii", types + 58 },
342 { "damage", "iiii", types + 0 },
343 { "frame", "n", types + 61 },
344 { "set_opaque_region", "?o", types + 62 },
345 { "set_input_region", "?o", types + 63 },
346 { "commit", "", types + 0 },
347 { "set_buffer_transform", "2i", types + 0 },
348 { "set_buffer_scale", "3i", types + 0 },
349 };
350
351 static const struct wl_message wl_surface_events[] = {
352 { "enter", "o", types + 64 },
353 { "leave", "o", types + 65 },
354 };
355
356 WL_EXPORT const struct wl_interface wl_surface_interface = {
357 "wl_surface", 3,
358 9, wl_surface_requests,
359 2, wl_surface_events,
360 };
361
362 static const struct wl_message wl_seat_requests[] = {
363 { "get_pointer", "n", types + 66 },
364 { "get_keyboard", "n", types + 67 },
365 { "get_touch", "n", types + 68 },
366 };
367
368 static const struct wl_message wl_seat_events[] = {
369 { "capabilities", "u", types + 0 },
370 { "name", "2s", types + 0 },
371 };
372
373 WL_EXPORT const struct wl_interface wl_seat_interface = {
374 "wl_seat", 4,
375 3, wl_seat_requests,
376 2, wl_seat_events,
377 };
378
379 static const struct wl_message wl_pointer_requests[] = {
380 { "set_cursor", "u?oii", types + 69 },
381 { "release", "3", types + 0 },
382 };
383
384 static const struct wl_message wl_pointer_events[] = {
385 { "enter", "uoff", types + 73 },
386 { "leave", "uo", types + 77 },
387 { "motion", "uff", types + 0 },
388 { "button", "uuuu", types + 0 },
389 { "axis", "uuf", types + 0 },
390 };
391
392 WL_EXPORT const struct wl_interface wl_pointer_interface = {
393 "wl_pointer", 3,
394 2, wl_pointer_requests,
395 5, wl_pointer_events,
396 };
397
398 static const struct wl_message wl_keyboard_requests[] = {
399 { "release", "3", types + 0 },
400 };
401
402 static const struct wl_message wl_keyboard_events[] = {
403 { "keymap", "uhu", types + 0 },
404 { "enter", "uoa", types + 79 },
405 { "leave", "uo", types + 82 },
406 { "key", "uuuu", types + 0 },
407 { "modifiers", "uuuuu", types + 0 },
408 { "repeat_info", "4ii", types + 0 },
409 };
410
411 WL_EXPORT const struct wl_interface wl_keyboard_interface = {
412 "wl_keyboard", 4,
413 1, wl_keyboard_requests,
414 6, wl_keyboard_events,
415 };
416
417 static const struct wl_message wl_touch_requests[] = {
418 { "release", "3", types + 0 },
419 };
420
421 static const struct wl_message wl_touch_events[] = {
422 { "down", "uuoiff", types + 84 },
423 { "up", "uui", types + 0 },
424 { "motion", "uiff", types + 0 },
425 { "frame", "", types + 0 },
426 { "cancel", "", types + 0 },
427 };
428
429 WL_EXPORT const struct wl_interface wl_touch_interface = {
430 "wl_touch", 3,
431 1, wl_touch_requests,
432 5, wl_touch_events,
433 };
434
435 static const struct wl_message wl_output_events[] = {
436 { "geometry", "iiiiissi", types + 0 },
437 { "mode", "uiii", types + 0 },
438 { "done", "2", types + 0 },
439 { "scale", "2i", types + 0 },
440 };
441
442 WL_EXPORT const struct wl_interface wl_output_interface = {
443 "wl_output", 2,
444 0, NULL,
445 4, wl_output_events,
446 };
447
448 static const struct wl_message wl_region_requests[] = {
449 { "destroy", "", types + 0 },
450 { "add", "iiii", types + 0 },
451 { "subtract", "iiii", types + 0 },
452 };
453
454 WL_EXPORT const struct wl_interface wl_region_interface = {
455 "wl_region", 1,
456 3, wl_region_requests,
457 0, NULL,
458 };
459
460 static const struct wl_message wl_subcompositor_requests[] = {
461 { "destroy", "", types + 0 },
462 { "get_subsurface", "noo", types + 90 },
463 };
464
465 WL_EXPORT const struct wl_interface wl_subcompositor_interface = {
466 "wl_subcompositor", 1,
467 2, wl_subcompositor_requests,
468 0, NULL,
469 };
470
471 static const struct wl_message wl_subsurface_requests[] = {
472 { "destroy", "", types + 0 },
473 { "set_position", "ii", types + 0 },
474 { "place_above", "o", types + 93 },
475 { "place_below", "o", types + 94 },
476 { "set_sync", "", types + 0 },
477 { "set_desync", "", types + 0 },
478 };
479
480 WL_EXPORT const struct wl_interface wl_subsurface_interface = {
481 "wl_subsurface", 1,
482 6, wl_subsurface_requests,
483 0, NULL,
484 };
485
OLDNEW
« no previous file with comments | « third_party/wayland/include/src/wayland-version.h ('k') | third_party/wayland/wayland.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698