euv-core 0.51.0

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
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
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
/// Wayland `wl_shm` 32-bit ARGB8888 pixel format code (little-endian `[B, G, R, A]`).
pub const WL_SHM_FORMAT_ARGB8888: u32 = 0;

/// Wayland `wl_shm` 32-bit XRGB8888 pixel format code (little-endian `[B, G, R, 0xFF]`).
pub const WL_SHM_FORMAT_XRGB8888: u32 = 1;

/// Shared library name for Linux X11 client runtime.
pub(crate) const LINUX_LIB_X11: &str = "libX11.so.6\0";

/// Shared library name for Linux Wayland client runtime.
pub(crate) const LINUX_LIB_WAYLAND: &str = "libwayland-client.so.0\0";

/// Shared library name for Linux XRandR extension runtime.
pub(crate) const LINUX_LIB_XRANDR: &str = "libXrandr.so.2\0";

/// Shared library name for Linux MIT-SHM Xext extension runtime.
pub(crate) const LINUX_LIB_XEXT: &str = "libXext.so.6\0";

/// Shared library name for Linux Vulkan loader (probed for `VK_KHR_wayland_surface` WSI).
pub(crate) const LINUX_LIB_VULKAN: &str = "libvulkan.so.1\0";

/// Environment variable detecting an active native Wayland compositor socket.
pub(crate) const LINUX_WAYLAND_DISPLAY_ENV: &str = "WAYLAND_DISPLAY";

/// Optional environment variable forcing legacy X11 over native Wayland when set to `"1"`.
pub(crate) const LINUX_FORCE_X11_ENV: &str = "EUV_LINUX_FORCE_X11";

/// Dynamic symbol for `XShmQueryExtension`.
pub(crate) const SYM_XSHM_QUERY_EXTENSION: &str = "XShmQueryExtension\0";

/// Dynamic symbol for `XShmCreateImage`.
pub(crate) const SYM_XSHM_CREATE_IMAGE: &str = "XShmCreateImage\0";

/// Dynamic symbol for `XShmAttach`.
pub(crate) const SYM_XSHM_ATTACH: &str = "XShmAttach\0";

/// Dynamic symbol for `XShmDetach`.
pub(crate) const SYM_XSHM_DETACH: &str = "XShmDetach\0";

/// Dynamic symbol for `XShmPutImage`.
pub(crate) const SYM_XSHM_PUT_IMAGE: &str = "XShmPutImage\0";

/// Dynamic symbol for `wl_display_dispatch_pending`.
pub(crate) const SYM_WL_DISPLAY_DISPATCH_PENDING: &str = "wl_display_dispatch_pending\0";

/// Dynamic symbol for `wl_display_dispatch`.
pub(crate) const SYM_WL_DISPLAY_DISPATCH: &str = "wl_display_dispatch\0";

/// Dynamic symbol for `wl_display_flush`.
pub(crate) const SYM_WL_DISPLAY_FLUSH: &str = "wl_display_flush\0";

/// Dynamic symbol for `wl_display_roundtrip`.
pub(crate) const SYM_WL_DISPLAY_ROUNDTRIP: &str = "wl_display_roundtrip\0";

/// Dynamic symbol for `wl_display_disconnect`.
pub(crate) const SYM_WL_DISPLAY_DISCONNECT: &str = "wl_display_disconnect\0";

/// Dynamic symbol for `vkCreateWaylandSurfaceKHR` in `libvulkan.so.1`.
pub(crate) const SYM_VK_CREATE_WAYLAND_SURFACE: &str = "vkCreateWaylandSurfaceKHR\0";

/// Dynamic symbol for `XRRGetScreenInfo`.
pub(crate) const SYM_XRR_GET_SCREEN_INFO: &str = "XRRGetScreenInfo\0";

/// Dynamic symbol for `XRRConfigCurrentRate`.
pub(crate) const SYM_XRR_CONFIG_CURRENT_RATE: &str = "XRRConfigCurrentRate\0";

/// Dynamic symbol for `XRRFreeScreenConfigInfo`.
pub(crate) const SYM_XRR_FREE_SCREEN_CONFIG_INFO: &str = "XRRFreeScreenConfigInfo\0";

/// Environment variable overriding detected display refresh rate in Hertz on Linux.
pub(crate) const LINUX_REFRESH_ENV_VAR: &str = "EUV_REFRESH_RATE_HZ";

/// Dynamic symbol for `XOpenDisplay`.
pub(crate) const SYM_X_OPEN_DISPLAY: &str = "XOpenDisplay\0";

/// Dynamic symbol for `XDefaultScreen`.
pub(crate) const SYM_X_DEFAULT_SCREEN: &str = "XDefaultScreen\0";

/// Dynamic symbol for `XRootWindow`.
pub(crate) const SYM_X_ROOT_WINDOW: &str = "XRootWindow\0";

/// Dynamic symbol for `XCreateSimpleWindow`.
pub(crate) const SYM_X_CREATE_SIMPLE_WINDOW: &str = "XCreateSimpleWindow\0";

/// Dynamic symbol for `XStoreName`.
pub(crate) const SYM_X_STORE_NAME: &str = "XStoreName\0";

/// Dynamic symbol for `XMapWindow`.
pub(crate) const SYM_X_MAP_WINDOW: &str = "XMapWindow\0";

/// Dynamic symbol for `XResizeWindow`.
pub(crate) const SYM_X_RESIZE_WINDOW: &str = "XResizeWindow\0";

/// Dynamic symbol for `XDestroyWindow`.
pub(crate) const SYM_X_DESTROY_WINDOW: &str = "XDestroyWindow\0";

/// Dynamic symbol for `XFlush`.
pub(crate) const SYM_X_FLUSH: &str = "XFlush\0";

/// Dynamic symbol for `XDefaultGC`.
pub(crate) const SYM_X_DEFAULT_GC: &str = "XDefaultGC\0";

/// Dynamic symbol for `XDefaultVisual`.
pub(crate) const SYM_X_DEFAULT_VISUAL: &str = "XDefaultVisual\0";

/// Dynamic symbol for `XDefaultDepth`.
pub(crate) const SYM_X_DEFAULT_DEPTH: &str = "XDefaultDepth\0";

/// Dynamic symbol for `XCreateImage`.
pub(crate) const SYM_X_CREATE_IMAGE: &str = "XCreateImage\0";

/// Dynamic symbol for `XPutImage`.
pub(crate) const SYM_X_PUT_IMAGE: &str = "XPutImage\0";

/// Dynamic symbol for `XFree`.
pub(crate) const SYM_X_FREE: &str = "XFree\0";

/// Dynamic symbol for `XSelectInput`.
pub(crate) const SYM_X_SELECT_INPUT: &str = "XSelectInput\0";

/// Dynamic symbol for `XInternAtom`.
pub(crate) const SYM_X_INTERN_ATOM: &str = "XInternAtom\0";

/// Dynamic symbol for `XSetWMProtocols`.
pub(crate) const SYM_X_SET_WM_PROTOCOLS: &str = "XSetWMProtocols\0";

/// Dynamic symbol for `XPending`.
pub(crate) const SYM_X_PENDING: &str = "XPending\0";

/// Dynamic symbol for `XNextEvent`.
pub(crate) const SYM_X_NEXT_EVENT: &str = "XNextEvent\0";

/// Dynamic symbol for `XLookupString`.
pub(crate) const SYM_X_LOOKUP_STRING: &str = "XLookupString\0";

/// Dynamic symbol for `XResourceManagerString`.
pub(crate) const SYM_X_RESOURCE_MANAGER_STRING: &str = "XResourceManagerString\0";

/// Dynamic symbol for `wl_display_connect`.
pub(crate) const SYM_WL_DISPLAY_CONNECT: &str = "wl_display_connect\0";

/// ICCCM atom name for window manager close requests.
pub(crate) const ATOM_WM_DELETE_WINDOW: &str = "WM_DELETE_WINDOW\0";

/// Environment variable names inspected for HiDPI scale overrides on Linux.
pub(crate) const LINUX_DPI_ENV_VARS: [&str; 3] =
    ["EUV_SCALE_FACTOR", "GDK_SCALE", "QT_SCALE_FACTOR"];

/// Xrdb resource key specifying logical DPI on Linux X11 desktops.
pub(crate) const XFT_DPI_PREFIX: &str = "Xft.dpi:";

/// Standard 96 DPI baseline for X11 scale conversion.
pub(crate) const X11_DEFAULT_DPI: f32 = 96.0;

/// POSIX `RTLD_LAZY` flag for `dlopen`.
pub(crate) const RTLD_LAZY: i32 = 1;

/// X11 `ZPixmap` image format identifier.
pub(crate) const X11_Z_PIXMAP: i32 = 2;

/// Combined X11 input mask (`KeyPress | KeyRelease | ButtonPress | ButtonRelease | PointerMotion | Exposure | VisibilityChange | StructureNotify | FocusChange`).
pub(crate) const X11_EVENT_MASK: isize = 0x0023_804F;

/// X11 `KeyPress` event type.
pub(crate) const X11_KEY_PRESS: i32 = 2;

/// X11 `KeyRelease` event type.
pub(crate) const X11_KEY_RELEASE: i32 = 3;

/// X11 `ButtonPress` event type.
pub(crate) const X11_BUTTON_PRESS: i32 = 4;

/// X11 `ButtonRelease` event type.
pub(crate) const X11_BUTTON_RELEASE: i32 = 5;

/// X11 `MotionNotify` event type.
pub(crate) const X11_MOTION_NOTIFY: i32 = 6;

/// X11 `FocusIn` event type.
pub(crate) const X11_FOCUS_IN: i32 = 9;

/// X11 `FocusOut` event type.
pub(crate) const X11_FOCUS_OUT: i32 = 10;

/// X11 `Expose` event type.
pub(crate) const X11_EXPOSE: i32 = 12;

/// X11 `DestroyNotify` event type.
pub(crate) const X11_DESTROY_NOTIFY: i32 = 17;

/// X11 `UnmapNotify` event type.
pub(crate) const X11_UNMAP_NOTIFY: i32 = 18;

/// X11 `MapNotify` event type.
pub(crate) const X11_MAP_NOTIFY: i32 = 19;

/// X11 `ConfigureNotify` event type.
pub(crate) const X11_CONFIGURE_NOTIFY: i32 = 22;

/// X11 `ClientMessage` event type.
pub(crate) const X11_CLIENT_MESSAGE: i32 = 33;

/// X11 modifier mask for Shift.
pub(crate) const X11_SHIFT_MASK: u32 = 1;

/// X11 modifier mask for Control.
pub(crate) const X11_CTRL_MASK: u32 = 4;

/// X11 modifier mask for Alt (`Mod1`).
pub(crate) const X11_ALT_MASK: u32 = 8;

/// X11 modifier mask for Super/Meta (`Mod4`).
pub(crate) const X11_META_MASK: u32 = 64;

/// Error message when neither Wayland nor X11 display server is reachable.
pub(crate) const ERR_LINUX_NO_DISPLAY: &str = "neither X11 nor Wayland display server available";

/// Dynamic symbol for `wl_display_get_error`.
pub(crate) const SYM_WL_DISPLAY_GET_ERROR: &str = "wl_display_get_error\0";

/// Dynamic symbol for `wl_proxy_marshal_flags`.
pub(crate) const SYM_WL_PROXY_MARSHAL_FLAGS: &str = "wl_proxy_marshal_flags\0";

/// Dynamic symbol for `wl_proxy_add_listener`.
pub(crate) const SYM_WL_PROXY_ADD_LISTENER: &str = "wl_proxy_add_listener\0";

/// Dynamic symbol for `wl_proxy_destroy`.
pub(crate) const SYM_WL_PROXY_DESTROY: &str = "wl_proxy_destroy\0";

/// Dynamic symbol for `wl_proxy_get_version`.
pub(crate) const SYM_WL_PROXY_GET_VERSION: &str = "wl_proxy_get_version\0";

/// Exported Wayland protocol descriptor symbol for `wl_registry_interface`.
pub(crate) const SYM_WL_REGISTRY_INTERFACE: &str = "wl_registry_interface\0";

/// Exported Wayland protocol descriptor symbol for `wl_compositor_interface`.
pub(crate) const SYM_WL_COMPOSITOR_INTERFACE: &str = "wl_compositor_interface\0";

/// Exported Wayland protocol descriptor symbol for `wl_surface_interface`.
pub(crate) const SYM_WL_SURFACE_INTERFACE: &str = "wl_surface_interface\0";

/// Exported Wayland protocol descriptor symbol for `wl_shm_interface`.
pub(crate) const SYM_WL_SHM_INTERFACE: &str = "wl_shm_interface\0";

/// Exported Wayland protocol descriptor symbol for `wl_shm_pool_interface`.
pub(crate) const SYM_WL_SHM_POOL_INTERFACE: &str = "wl_shm_pool_interface\0";

/// Exported Wayland protocol descriptor symbol for `wl_buffer_interface`.
pub(crate) const SYM_WL_BUFFER_INTERFACE: &str = "wl_buffer_interface\0";

/// Dynamic symbol for `vkCreateXlibSurfaceKHR` in `libvulkan.so.1`.
pub(crate) const SYM_VK_CREATE_XLIB_SURFACE: &str = "vkCreateXlibSurfaceKHR\0";

/// Dynamic libc symbol for anonymous Linux shared memory (`memfd_create`).
pub(crate) const SYM_MEMFD_CREATE: &str = "memfd_create\0";

/// Wayland registry global interface name for `wl_compositor`.
pub(crate) const WL_IFACE_COMPOSITOR: &str = "wl_compositor";

/// Wayland registry global interface name for `wl_shm`.
pub(crate) const WL_IFACE_SHM: &str = "wl_shm";

/// Anonymous `memfd_create` buffer name for Wayland software presentation.
pub(crate) const WL_MEMFD_NAME: &str = "euv-wayland-shm\0";

/// Fallback `/dev/shm` directory prefix when `memfd_create` is unavailable.
pub(crate) const LINUX_DEV_SHM_PREFIX: &str = "/dev/shm/euv-wl-shm";

/// Wayland `wl_display.get_registry` request opcode.
pub(crate) const WL_OPCODE_DISPLAY_GET_REGISTRY: u32 = 1;

/// Wayland `wl_registry.bind` request opcode.
pub(crate) const WL_OPCODE_REGISTRY_BIND: u32 = 0;

/// Wayland `wl_compositor.create_surface` request opcode.
pub(crate) const WL_OPCODE_COMPOSITOR_CREATE_SURFACE: u32 = 0;

/// Wayland `wl_shm.create_pool` request opcode.
pub(crate) const WL_OPCODE_SHM_CREATE_POOL: u32 = 0;

/// Wayland `wl_shm_pool.create_buffer` request opcode.
pub(crate) const WL_OPCODE_SHM_POOL_CREATE_BUFFER: u32 = 0;

/// Wayland `wl_shm_pool.destroy` request opcode.
pub(crate) const WL_OPCODE_SHM_POOL_DESTROY: u32 = 1;

/// Wayland `wl_buffer.destroy` request opcode.
pub(crate) const WL_OPCODE_BUFFER_DESTROY: u32 = 0;

/// Wayland `wl_surface.attach` request opcode.
pub(crate) const WL_OPCODE_SURFACE_ATTACH: u32 = 1;

/// Wayland `wl_surface.damage` request opcode (surface version < 4 fallback).
pub(crate) const WL_OPCODE_SURFACE_DAMAGE: u32 = 2;

/// Wayland `wl_surface.commit` request opcode.
pub(crate) const WL_OPCODE_SURFACE_COMMIT: u32 = 6;

/// Wayland `wl_surface.set_buffer_scale` request opcode (surface version >= 3).
pub(crate) const WL_OPCODE_SURFACE_SET_BUFFER_SCALE: u32 = 8;

/// Wayland `wl_surface.damage_buffer` request opcode (surface version >= 4).
pub(crate) const WL_OPCODE_SURFACE_DAMAGE_BUFFER: u32 = 9;

/// Minimum `wl_surface` interface version required for `wl_surface.set_buffer_scale`.
pub(crate) const WL_SURFACE_BUFFER_SCALE_MIN_VERSION: u32 = 3;

/// Wayland `WL_MARSHAL_FLAG_DESTROY` flag destroying a client proxy on marshal.
pub(crate) const WL_MARSHAL_FLAG_DESTROY: u32 = 1;

/// Maximum `wl_compositor` protocol version bound for `wl_surface.damage_buffer` support.
pub(crate) const WL_COMPOSITOR_MAX_VERSION: u32 = 4;

/// Maximum `wl_shm` protocol version bound for software pool creation.
pub(crate) const WL_SHM_MAX_VERSION: u32 = 1;

/// POSIX `PROT_READ | PROT_WRITE` protection mask for `mmap`.
pub(crate) const LINUX_MMAP_PROT_RW: i32 = 3;

/// POSIX `MAP_SHARED` flag for `mmap`.
pub(crate) const LINUX_MMAP_SHARED: i32 = 1;

/// Linux `MFD_CLOEXEC` flag for `memfd_create`.
pub(crate) const LINUX_MFD_CLOEXEC: u32 = 1;

/// POSIX `O_RDWR | O_CREAT | O_EXCL | O_CLOEXEC` open flags on Linux (`2 | 64 | 128 | 524288`).
pub(crate) const LINUX_SHM_OPEN_FLAGS: i32 = 524_482;

/// POSIX file mode `0o600` for fallback `/dev/shm` files.
pub(crate) const LINUX_SHM_FILE_MODE: u32 = 0o600;

/// Number of double-buffered Wayland `wl_shm` slots per window.
pub(crate) const WL_SHM_SLOT_COUNT: usize = 2;

/// Error message when Wayland software presentation lacks a live display, surface, or `wl_shm` global.
pub(crate) const ERR_LINUX_WL_SURFACE_MISSING: &str =
    "wayland software presentation missing wl_display, wl_surface, or wl_shm";

/// Error message when POSIX shared-memory allocation (`memfd_create` / `mmap`) fails.
pub(crate) const ERR_LINUX_WL_SHM_ALLOC: &str = "failed to allocate Wayland wl_shm memory mapping";

/// Error message when `wl_shm_pool` or `wl_buffer` creation fails.
pub(crate) const ERR_LINUX_WL_BUFFER_CREATE: &str =
    "failed to create Wayland wl_shm_pool or wl_buffer";

/// Error message when all double-buffered Wayland shm slots are still busy awaiting `wl_buffer.release`.
pub(crate) const ERR_LINUX_WL_NO_FREE_BUFFER: &str =
    "no free Wayland wl_shm buffer slot available (all buffers busy)";

/// Error message when `wl_display_flush` or `wl_display_get_error` reports a compositor failure.
pub(crate) const ERR_LINUX_WL_DISPLAY_FLUSH: &str =
    "wayland surface commit or wl_display_flush failed";

/// Error message when framebuffer pixel dimensions or backing slice are invalid for presentation.
pub(crate) const ERR_LINUX_INVALID_FRAMEBUFFER: &str =
    "invalid framebuffer dimensions or truncated pixel buffer";

/// Error message when X11 presentation lacks a valid `Display*`, `Window`, `GC`, or `Visual*`.
pub(crate) const ERR_LINUX_X11_SURFACE_MISSING: &str =
    "X11 presentation missing Display, Window, GC, Visual, or XPutImage symbols";

/// Error message when direct GPU presentation is requested without available Vulkan WSI surface support.
pub(crate) const ERR_LINUX_GPU_DIRECT_UNAVAILABLE: &str =
    "Linux direct GPU presentation requires active Vulkan WSI or EGL/GLES3 surface support";

/// Error message when Linux dynamic EGL/GLES3 initialization or swap fails.
pub(crate) const ERR_LINUX_EGL_UNAVAILABLE: &str =
    "Linux dynamic libEGL.so.1 / libGLESv2.so.2 presentation unavailable";

/// Shared library name for dynamic EGL loading on Linux.
pub(crate) const LINUX_LIB_EGL: &str = "libEGL.so.1\0";

/// Shared library name for dynamic OpenGL ES 3 loading on Linux.
pub(crate) const LINUX_LIB_GLESV2: &str = "libGLESv2.so.2\0";

/// Shared library name for dynamic Wayland EGL window bindings on Linux.
pub(crate) const LINUX_LIB_WAYLAND_EGL: &str = "libwayland-egl.so.1\0";

/// Dynamic Xlib symbol returning the underlying socket file descriptor for `poll()`.
pub(crate) const SYM_X_CONNECTION_NUMBER: &str = "XConnectionNumber\0";

/// Dynamic Wayland symbol returning the compositor socket file descriptor for `poll()`.
pub(crate) const SYM_WL_DISPLAY_GET_FD: &str = "wl_display_get_fd\0";

/// Dynamic Wayland symbol preparing a thread-safe `poll()` read on `wl_display`.
pub(crate) const SYM_WL_DISPLAY_PREPARE_READ: &str = "wl_display_prepare_read\0";

/// Dynamic Wayland symbol reading events from the Wayland socket after `poll()`.
pub(crate) const SYM_WL_DISPLAY_READ_EVENTS: &str = "wl_display_read_events\0";

/// Dynamic Wayland symbol canceling a prepared read when `poll()` woke on another fd.
pub(crate) const SYM_WL_DISPLAY_CANCEL_READ: &str = "wl_display_cancel_read\0";

/// Exported Wayland protocol descriptor symbol for `wl_callback_interface`.
pub(crate) const SYM_WL_CALLBACK_INTERFACE: &str = "wl_callback_interface\0";

/// Wayland `wl_surface.frame` request opcode (`3`) for compositor VSync pacing.
pub(crate) const WL_OPCODE_SURFACE_FRAME: u32 = 3;

/// POSIX `POLLIN` event bit (`0x0001`).
pub(crate) const LINUX_POLLIN: i16 = 0x0001;

/// Linux `O_NONBLOCK | O_CLOEXEC` flags (`0x0008_0800`) for `pipe2`.
pub(crate) const LINUX_PIPE_NONBLOCK_CLOEXEC: i32 = 0x0008_0800;

/// Dynamic EGL symbol `eglGetDisplay`.
pub(crate) const SYM_EGL_GET_DISPLAY: &str = "eglGetDisplay\0";

/// Dynamic EGL symbol `eglInitialize`.
pub(crate) const SYM_EGL_INITIALIZE: &str = "eglInitialize\0";

/// Dynamic EGL symbol `eglBindAPI`.
pub(crate) const SYM_EGL_BIND_API: &str = "eglBindAPI\0";

/// Dynamic EGL symbol `eglChooseConfig`.
pub(crate) const SYM_EGL_CHOOSE_CONFIG: &str = "eglChooseConfig\0";

/// Dynamic EGL symbol `eglCreateContext`.
pub(crate) const SYM_EGL_CREATE_CONTEXT: &str = "eglCreateContext\0";

/// Dynamic EGL symbol `eglCreateWindowSurface`.
pub(crate) const SYM_EGL_CREATE_WINDOW_SURFACE: &str = "eglCreateWindowSurface\0";

/// Dynamic EGL symbol `eglMakeCurrent`.
pub(crate) const SYM_EGL_MAKE_CURRENT: &str = "eglMakeCurrent\0";

/// Dynamic EGL symbol `eglSwapInterval`.
pub(crate) const SYM_EGL_SWAP_INTERVAL: &str = "eglSwapInterval\0";

/// Dynamic EGL symbol `eglSwapBuffers`.
pub(crate) const SYM_EGL_SWAP_BUFFERS: &str = "eglSwapBuffers\0";

/// Dynamic EGL symbol `eglDestroySurface`.
pub(crate) const SYM_EGL_DESTROY_SURFACE: &str = "eglDestroySurface\0";

/// Dynamic EGL symbol `eglDestroyContext`.
pub(crate) const SYM_EGL_DESTROY_CONTEXT: &str = "eglDestroyContext\0";

/// Dynamic EGL symbol `eglTerminate`.
pub(crate) const SYM_EGL_TERMINATE: &str = "eglTerminate\0";

/// Dynamic Wayland-EGL symbol `wl_egl_window_create`.
pub(crate) const SYM_WL_EGL_WINDOW_CREATE: &str = "wl_egl_window_create\0";

/// Dynamic Wayland-EGL symbol `wl_egl_window_resize`.
pub(crate) const SYM_WL_EGL_WINDOW_RESIZE: &str = "wl_egl_window_resize\0";

/// Dynamic Wayland-EGL symbol `wl_egl_window_destroy`.
pub(crate) const SYM_WL_EGL_WINDOW_DESTROY: &str = "wl_egl_window_destroy\0";

/// Dynamic GLES3 symbol `glCreateShader`.
pub(crate) const SYM_GL_CREATE_SHADER: &str = "glCreateShader\0";

/// Dynamic GLES3 symbol `glShaderSource`.
pub(crate) const SYM_GL_SHADER_SOURCE: &str = "glShaderSource\0";

/// Dynamic GLES3 symbol `glCompileShader`.
pub(crate) const SYM_GL_COMPILE_SHADER: &str = "glCompileShader\0";

/// Dynamic GLES3 symbol `glGetShaderiv`.
pub(crate) const SYM_GL_GET_SHADERIV: &str = "glGetShaderiv\0";

/// Dynamic GLES3 symbol `glDeleteShader`.
pub(crate) const SYM_GL_DELETE_SHADER: &str = "glDeleteShader\0";

/// Dynamic GLES3 symbol `glCreateProgram`.
pub(crate) const SYM_GL_CREATE_PROGRAM: &str = "glCreateProgram\0";

/// Dynamic GLES3 symbol `glAttachShader`.
pub(crate) const SYM_GL_ATTACH_SHADER: &str = "glAttachShader\0";

/// Dynamic GLES3 symbol `glLinkProgram`.
pub(crate) const SYM_GL_LINK_PROGRAM: &str = "glLinkProgram\0";

/// Dynamic GLES3 symbol `glGetProgramiv`.
pub(crate) const SYM_GL_GET_PROGRAMIV: &str = "glGetProgramiv\0";

/// Dynamic GLES3 symbol `glDeleteProgram`.
pub(crate) const SYM_GL_DELETE_PROGRAM: &str = "glDeleteProgram\0";

/// Dynamic GLES3 symbol `glUseProgram`.
pub(crate) const SYM_GL_USE_PROGRAM: &str = "glUseProgram\0";

/// Dynamic GLES3 symbol `glGetUniformLocation`.
pub(crate) const SYM_GL_GET_UNIFORM_LOCATION: &str = "glGetUniformLocation\0";

/// Dynamic GLES3 symbol `glUniform1i`.
pub(crate) const SYM_GL_UNIFORM1I: &str = "glUniform1i\0";

/// Dynamic GLES3 symbol `glUniform2f`.
pub(crate) const SYM_GL_UNIFORM2F: &str = "glUniform2f\0";

/// Dynamic GLES3 symbol `glGenVertexArrays`.
pub(crate) const SYM_GL_GEN_VERTEX_ARRAYS: &str = "glGenVertexArrays\0";

/// Dynamic GLES3 symbol `glBindVertexArray`.
pub(crate) const SYM_GL_BIND_VERTEX_ARRAY: &str = "glBindVertexArray\0";

/// Dynamic GLES3 symbol `glDeleteVertexArrays`.
pub(crate) const SYM_GL_DELETE_VERTEX_ARRAYS: &str = "glDeleteVertexArrays\0";

/// Dynamic GLES3 symbol `glGenBuffers`.
pub(crate) const SYM_GL_GEN_BUFFERS: &str = "glGenBuffers\0";

/// Dynamic GLES3 symbol `glBindBuffer`.
pub(crate) const SYM_GL_BIND_BUFFER: &str = "glBindBuffer\0";

/// Dynamic GLES3 symbol `glBufferData`.
pub(crate) const SYM_GL_BUFFER_DATA: &str = "glBufferData\0";

/// Dynamic GLES3 symbol `glBufferSubData`.
pub(crate) const SYM_GL_BUFFER_SUB_DATA: &str = "glBufferSubData\0";

/// Dynamic GLES3 symbol `glDeleteBuffers`.
pub(crate) const SYM_GL_DELETE_BUFFERS: &str = "glDeleteBuffers\0";

/// Dynamic GLES3 symbol `glEnableVertexAttribArray`.
pub(crate) const SYM_GL_ENABLE_VERTEX_ATTRIB_ARRAY: &str = "glEnableVertexAttribArray\0";

/// Dynamic GLES3 symbol `glVertexAttribPointer`.
pub(crate) const SYM_GL_VERTEX_ATTRIB_POINTER: &str = "glVertexAttribPointer\0";

/// Dynamic GLES3 symbol `glVertexAttribIPointer`.
pub(crate) const SYM_GL_VERTEX_ATTRIB_IPOINTER: &str = "glVertexAttribIPointer\0";

/// Dynamic GLES3 symbol `glVertexAttribDivisor`.
pub(crate) const SYM_GL_VERTEX_ATTRIB_DIVISOR: &str = "glVertexAttribDivisor\0";

/// Dynamic GLES3 symbol `glGenTextures`.
pub(crate) const SYM_GL_GEN_TEXTURES: &str = "glGenTextures\0";

/// Dynamic GLES3 symbol `glBindTexture`.
pub(crate) const SYM_GL_BIND_TEXTURE: &str = "glBindTexture\0";

/// Dynamic GLES3 symbol `glTexParameteri`.
pub(crate) const SYM_GL_TEX_PARAMETERI: &str = "glTexParameteri\0";

/// Dynamic GLES3 symbol `glTexStorage2D`.
pub(crate) const SYM_GL_TEX_STORAGE_2D: &str = "glTexStorage2D\0";

/// Dynamic GLES3 symbol `glTexImage2D`.
pub(crate) const SYM_GL_TEX_IMAGE_2D: &str = "glTexImage2D\0";

/// Dynamic GLES3 symbol `glTexSubImage2D`.
pub(crate) const SYM_GL_TEX_SUB_IMAGE_2D: &str = "glTexSubImage2D\0";

/// Dynamic GLES3 symbol `glDeleteTextures`.
pub(crate) const SYM_GL_DELETE_TEXTURES: &str = "glDeleteTextures\0";

/// Dynamic GLES3 symbol `glActiveTexture`.
pub(crate) const SYM_GL_ACTIVE_TEXTURE: &str = "glActiveTexture\0";

/// Dynamic GLES3 symbol `glPixelStorei`.
pub(crate) const SYM_GL_PIXEL_STOREI: &str = "glPixelStorei\0";

/// Dynamic GLES3 symbol `glViewport`.
pub(crate) const SYM_GL_VIEWPORT: &str = "glViewport\0";

/// Dynamic GLES3 symbol `glEnable`.
pub(crate) const SYM_GL_ENABLE: &str = "glEnable\0";

/// Dynamic GLES3 symbol `glDisable`.
pub(crate) const SYM_GL_DISABLE: &str = "glDisable\0";

/// Dynamic GLES3 symbol `glBlendFuncSeparate`.
pub(crate) const SYM_GL_BLEND_FUNC_SEPARATE: &str = "glBlendFuncSeparate\0";

/// Dynamic GLES3 symbol `glScissor`.
pub(crate) const SYM_GL_SCISSOR: &str = "glScissor\0";

/// Dynamic GLES3 symbol `glClearColor`.
pub(crate) const SYM_GL_CLEAR_COLOR: &str = "glClearColor\0";

/// Dynamic GLES3 symbol `glClear`.
pub(crate) const SYM_GL_CLEAR: &str = "glClear\0";

/// Dynamic GLES3 symbol `glDrawArraysInstanced`.
pub(crate) const SYM_GL_DRAW_ARRAYS_INSTANCED: &str = "glDrawArraysInstanced\0";

/// GLSL ES3 uniform name `u_viewport`.
pub(crate) const LINUX_GL_UNIFORM_VIEWPORT: &str = "u_viewport\0";

/// GLSL ES3 uniform name `u_scroll_offset`.
pub(crate) const LINUX_GL_UNIFORM_SCROLL_OFFSET: &str = "u_scroll_offset\0";

/// GLSL ES3 sampler uniform `u_glyph_r8`.
pub(crate) const LINUX_GL_UNIFORM_GLYPH_R8: &str = "u_glyph_r8\0";

/// GLSL ES3 sampler uniform `u_glyph_rgba8`.
pub(crate) const LINUX_GL_UNIFORM_GLYPH_RGBA8: &str = "u_glyph_rgba8\0";

/// GLSL ES3 sampler uniform `u_image_tex`.
pub(crate) const LINUX_GL_UNIFORM_IMAGE_TEX: &str = "u_image_tex\0";

/// GLSL ES3 sampler uniform `u_external_tex`.
pub(crate) const LINUX_GL_UNIFORM_EXTERNAL_TEX: &str = "u_external_tex\0";

/// `EGL_OPENGL_ES_API` (`0x30A0`).
pub(crate) const LINUX_EGL_OPENGL_ES_API: u32 = 0x30A0;

/// `EGL_SURFACE_TYPE` (`0x3033`).
pub(crate) const LINUX_EGL_SURFACE_TYPE: i32 = 0x3033;

/// `EGL_WINDOW_BIT` (`0x0004`).
pub(crate) const LINUX_EGL_WINDOW_BIT: i32 = 0x0004;

/// `EGL_RENDERABLE_TYPE` (`0x3040`).
pub(crate) const LINUX_EGL_RENDERABLE_TYPE: i32 = 0x3040;

/// `EGL_OPENGL_ES3_BIT` (`0x0040`).
pub(crate) const LINUX_EGL_OPENGL_ES3_BIT: i32 = 0x0040;

/// `EGL_RED_SIZE` (`0x3024`).
pub(crate) const LINUX_EGL_RED_SIZE: i32 = 0x3024;

/// `EGL_GREEN_SIZE` (`0x3023`).
pub(crate) const LINUX_EGL_GREEN_SIZE: i32 = 0x3023;

/// `EGL_BLUE_SIZE` (`0x3022`).
pub(crate) const LINUX_EGL_BLUE_SIZE: i32 = 0x3022;

/// `EGL_ALPHA_SIZE` (`0x3021`).
pub(crate) const LINUX_EGL_ALPHA_SIZE: i32 = 0x3021;

/// `EGL_NONE` (`0x3038`).
pub(crate) const LINUX_EGL_NONE: i32 = 0x3038;

/// `EGL_CONTEXT_CLIENT_VERSION` (`0x3098`).
pub(crate) const LINUX_EGL_CONTEXT_CLIENT_VERSION: i32 = 0x3098;

/// `GL_VERTEX_SHADER` (`0x8B31`).
pub(crate) const LINUX_GL_VERTEX_SHADER: u32 = 0x8B31;

/// `GL_FRAGMENT_SHADER` (`0x8B30`).
pub(crate) const LINUX_GL_FRAGMENT_SHADER: u32 = 0x8B30;

/// `GL_COMPILE_STATUS` (`0x8B81`).
pub(crate) const LINUX_GL_COMPILE_STATUS: u32 = 0x8B81;

/// `GL_LINK_STATUS` (`0x8B82`).
pub(crate) const LINUX_GL_LINK_STATUS: u32 = 0x8B82;

/// `GL_ARRAY_BUFFER` (`0x8892`).
pub(crate) const LINUX_GL_ARRAY_BUFFER: u32 = 0x8892;

/// `GL_STATIC_DRAW` (`0x88E4`).
pub(crate) const LINUX_GL_STATIC_DRAW: u32 = 0x88E4;

/// `GL_STREAM_DRAW` (`0x88E0`).
pub(crate) const LINUX_GL_STREAM_DRAW: u32 = 0x88E0;

/// `GL_TRIANGLES` (`0x0004`).
pub(crate) const LINUX_GL_TRIANGLES: u32 = 0x0004;

/// `GL_FLOAT` (`0x1406`).
pub(crate) const LINUX_GL_FLOAT: u32 = 0x1406;

/// `GL_UNSIGNED_INT` (`0x1405`).
pub(crate) const LINUX_GL_UNSIGNED_INT: u32 = 0x1405;

/// `GL_UNSIGNED_BYTE` (`0x1401`).
pub(crate) const LINUX_GL_UNSIGNED_BYTE: u32 = 0x1401;

/// `GL_TEXTURE_2D` (`0x0DE1`).
pub(crate) const LINUX_GL_TEXTURE_2D: u32 = 0x0DE1;

/// `GL_TEXTURE0` (`0x84C0`).
pub(crate) const LINUX_GL_TEXTURE0: u32 = 0x84C0;

/// `GL_TEXTURE1` (`0x84C1`).
pub(crate) const LINUX_GL_TEXTURE1: u32 = 0x84C1;

/// `GL_TEXTURE2` (`0x84C2`).
pub(crate) const LINUX_GL_TEXTURE2: u32 = 0x84C2;

/// `GL_TEXTURE3` (`0x84C3`).
pub(crate) const LINUX_GL_TEXTURE3: u32 = 0x84C3;

/// `GL_TEXTURE_MIN_FILTER` (`0x2801`).
pub(crate) const LINUX_GL_TEXTURE_MIN_FILTER: u32 = 0x2801;

/// `GL_TEXTURE_MAG_FILTER` (`0x2800`).
pub(crate) const LINUX_GL_TEXTURE_MAG_FILTER: u32 = 0x2800;

/// `GL_TEXTURE_WRAP_S` (`0x2802`).
pub(crate) const LINUX_GL_TEXTURE_WRAP_S: u32 = 0x2802;

/// `GL_TEXTURE_WRAP_T` (`0x2803`).
pub(crate) const LINUX_GL_TEXTURE_WRAP_T: u32 = 0x2803;

/// `GL_LINEAR` (`0x2601`).
pub(crate) const LINUX_GL_LINEAR: i32 = 0x2601;

/// `GL_CLAMP_TO_EDGE` (`0x812F`).
pub(crate) const LINUX_GL_CLAMP_TO_EDGE: i32 = 0x812F;

/// `GL_R8` (`0x8229`).
pub(crate) const LINUX_GL_R8: u32 = 0x8229;

/// `GL_RED` (`0x1903`).
pub(crate) const LINUX_GL_RED: u32 = 0x1903;

/// `GL_RGBA8` (`0x8058`).
pub(crate) const LINUX_GL_RGBA8: u32 = 0x8058;

/// `GL_RGBA` (`0x1908`).
pub(crate) const LINUX_GL_RGBA: u32 = 0x1908;

/// `GL_UNPACK_ALIGNMENT` (`0x0CF5`).
pub(crate) const LINUX_GL_UNPACK_ALIGNMENT: u32 = 0x0CF5;

/// `GL_UNPACK_ROW_LENGTH` (`0x0CF2`).
pub(crate) const LINUX_GL_UNPACK_ROW_LENGTH: u32 = 0x0CF2;

/// `GL_BLEND` (`0x0BE2`).
pub(crate) const LINUX_GL_BLEND: u32 = 0x0BE2;

/// `GL_SCISSOR_TEST` (`0x0C11`).
pub(crate) const LINUX_GL_SCISSOR_TEST: u32 = 0x0C11;

/// `GL_SRC_ALPHA` (`0x0302`).
pub(crate) const LINUX_GL_SRC_ALPHA: u32 = 0x0302;

/// `GL_ONE_MINUS_SRC_ALPHA` (`0x0303`).
pub(crate) const LINUX_GL_ONE_MINUS_SRC_ALPHA: u32 = 0x0303;

/// `GL_ONE` (`1`).
pub(crate) const LINUX_GL_ONE: u32 = 1;

/// `GL_COLOR_BUFFER_BIT` (`0x4000`).
pub(crate) const LINUX_GL_COLOR_BUFFER_BIT: u32 = 0x4000;

/// Unit quad triangle corners matching `GLSL_ES3_UI_VERTEX_SHADER` attribute location `0`.
pub(crate) const LINUX_GL_UNIT_QUAD: [f32; 12] =
    [0.0, 0.0, 1.0, 0.0, 0.0, 1.0, 1.0, 0.0, 1.0, 1.0, 0.0, 1.0];