1use {super::super::all_types::*, ::wl_client::builder::prelude::*};
14
15static INTERFACE: wl_interface = wl_interface {
16 name: c"wl_shm".as_ptr(),
17 version: 2,
18 method_count: 2,
19 methods: {
20 static MESSAGES: [wl_message; 2] = [
21 wl_message {
22 name: c"create_pool".as_ptr(),
23 signature: c"nhi".as_ptr(),
24 types: {
25 static TYPES: [Option<&'static wl_interface>; 3] =
26 [Some(WlShmPool::WL_INTERFACE), None, None];
27 TYPES.as_ptr().cast()
28 },
29 },
30 wl_message {
31 name: c"release".as_ptr(),
32 signature: c"".as_ptr(),
33 types: {
34 static TYPES: [Option<&'static wl_interface>; 0] = [];
35 TYPES.as_ptr().cast()
36 },
37 },
38 ];
39 MESSAGES.as_ptr()
40 },
41 event_count: 1,
42 events: {
43 static MESSAGES: [wl_message; 1] = [wl_message {
44 name: c"format".as_ptr(),
45 signature: c"u".as_ptr(),
46 types: {
47 static TYPES: [Option<&'static wl_interface>; 1] = [None];
48 TYPES.as_ptr().cast()
49 },
50 }];
51 MESSAGES.as_ptr()
52 },
53};
54
55#[derive(Clone, Eq, PartialEq)]
59#[repr(transparent)]
60pub struct WlShm {
61 proxy: UntypedOwnedProxy,
63}
64
65#[derive(Eq, PartialEq)]
69#[repr(transparent)]
70pub struct WlShmRef {
71 proxy: UntypedBorrowedProxy,
73}
74
75unsafe impl UntypedOwnedProxyWrapper for WlShm {}
77
78unsafe impl OwnedProxy for WlShm {
81 const INTERFACE: &'static str = "wl_shm";
82 const WL_INTERFACE: &'static wl_interface = &INTERFACE;
83 const NO_OP_EVENT_HANDLER: Self::NoOpEventHandler =
84 private::EventHandler(private::NoOpEventHandler);
85 const MAX_VERSION: u32 = 2;
86
87 type Borrowed = WlShmRef;
88 type Api = private::ProxyApi;
89 type NoOpEventHandler = private::EventHandler<private::NoOpEventHandler>;
90}
91
92unsafe impl UntypedBorrowedProxyWrapper for WlShmRef {}
94
95unsafe impl BorrowedProxy for WlShmRef {
97 type Owned = WlShm;
98}
99
100impl Deref for WlShm {
101 type Target = WlShmRef;
102
103 fn deref(&self) -> &Self::Target {
104 proxy::low_level::deref(self)
105 }
106}
107
108mod private {
109 pub struct ProxyApi;
110
111 #[allow(dead_code)]
112 pub struct EventHandler<H>(pub(super) H);
113
114 #[allow(dead_code)]
115 pub struct NoOpEventHandler;
116}
117
118impl Debug for WlShm {
119 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
120 write!(f, "wl_shm#{}", self.proxy.id())
121 }
122}
123
124impl Debug for WlShmRef {
125 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
126 write!(f, "wl_shm#{}", self.proxy.id())
127 }
128}
129
130impl PartialEq<WlShmRef> for WlShm {
131 fn eq(&self, other: &WlShmRef) -> bool {
132 self.proxy == other.proxy
133 }
134}
135
136impl PartialEq<WlShm> for WlShmRef {
137 fn eq(&self, other: &WlShm) -> bool {
138 self.proxy == other.proxy
139 }
140}
141
142#[allow(dead_code)]
143impl WlShm {
144 #[allow(dead_code)]
146 pub const REQ__CREATE_POOL__SINCE: u32 = 1;
147
148 #[inline]
161 pub fn create_pool(&self, fd: BorrowedFd<'_>, size: i32) -> WlShmPool {
162 let (arg1, arg2) = (fd, size);
163 let mut args = [
164 wl_argument { n: 0 },
165 wl_argument {
166 h: arg1.as_raw_fd(),
167 },
168 wl_argument { i: arg2 },
169 ];
170 let data = unsafe {
175 self.proxy
176 .send_constructor::<false>(0, &mut args, WlShmPool::WL_INTERFACE, None)
177 };
178 unsafe { proxy::low_level::from_untyped_owned(data) }
180 }
181
182 #[allow(dead_code)]
184 pub const REQ__RELEASE__SINCE: u32 = 2;
185
186 #[inline]
193 pub fn release(&self) {
194 let mut args = [];
195 unsafe {
199 self.proxy.send_destructor(1, &mut args);
200 }
201 }
202}
203
204#[allow(dead_code)]
205impl WlShmRef {
206 #[inline]
220 pub fn create_pool(&self, _queue: &Queue, fd: BorrowedFd<'_>, size: i32) -> WlShmPool {
221 let (arg1, arg2) = (fd, size);
222 let mut args = [
223 wl_argument { n: 0 },
224 wl_argument {
225 h: arg1.as_raw_fd(),
226 },
227 wl_argument { i: arg2 },
228 ];
229 let data = unsafe {
234 self.proxy
235 .send_constructor(_queue, 0, &mut args, WlShmPool::WL_INTERFACE, None)
236 };
237 unsafe { proxy::low_level::from_untyped_owned(data) }
239 }
240}
241
242impl WlShm {
243 #[allow(dead_code)]
245 pub const EVT__FORMAT__SINCE: u32 = 1;
246}
247
248#[allow(dead_code)]
250pub trait WlShmEventHandler {
251 type Data: 'static;
252
253 #[inline]
263 fn format(&self, _data: &mut Self::Data, _slf: &WlShmRef, format: WlShmFormat) {
264 let _ = format;
265 }
266}
267
268impl WlShmEventHandler for private::NoOpEventHandler {
269 type Data = ();
270}
271
272unsafe impl<H> EventHandler for private::EventHandler<H>
275where
276 H: WlShmEventHandler,
277{
278 const WL_INTERFACE: &'static wl_interface = &INTERFACE;
279
280 #[inline]
281 fn mutable_type() -> Option<(TypeId, &'static str)> {
282 let id = TypeId::of::<H::Data>();
283 let name = std::any::type_name::<H::Data>();
284 Some((id, name))
285 }
286
287 #[allow(unused_variables)]
288 unsafe fn handle_event(
289 &self,
290 queue: &Queue,
291 data: *mut u8,
292 slf: &UntypedBorrowedProxy,
293 opcode: u32,
294 args: *mut wl_argument,
295 ) {
296 let slf = unsafe { proxy::low_level::from_untyped_borrowed::<WlShmRef>(slf) };
298 let data: &mut H::Data = unsafe { &mut *data.cast() };
302 match opcode {
303 0 => {
304 let args = unsafe { &*args.cast::<[wl_argument; 1]>() };
306 let arg0 = unsafe { WlShmFormat(args[0].u) };
308 self.0.format(data, slf, arg0);
309 }
310 _ => {
311 invalid_opcode("wl_shm", opcode);
312 }
313 }
314 }
315}
316
317impl<H> CreateEventHandler<H> for private::ProxyApi
318where
319 H: WlShmEventHandler,
320{
321 type EventHandler = private::EventHandler<H>;
322
323 #[inline]
324 fn create_event_handler(handler: H) -> Self::EventHandler {
325 private::EventHandler(handler)
326 }
327}
328
329impl WlShm {
330 #[allow(dead_code)]
332 pub const ENM__ERROR_INVALID_FORMAT__SINCE: u32 = 1;
333 #[allow(dead_code)]
335 pub const ENM__ERROR_INVALID_STRIDE__SINCE: u32 = 1;
336 #[allow(dead_code)]
338 pub const ENM__ERROR_INVALID_FD__SINCE: u32 = 1;
339
340 #[allow(dead_code)]
342 pub const ENM__FORMAT_ARGB8888__SINCE: u32 = 1;
343 #[allow(dead_code)]
345 pub const ENM__FORMAT_XRGB8888__SINCE: u32 = 1;
346 #[allow(dead_code)]
348 pub const ENM__FORMAT_C8__SINCE: u32 = 1;
349 #[allow(dead_code)]
351 pub const ENM__FORMAT_RGB332__SINCE: u32 = 1;
352 #[allow(dead_code)]
354 pub const ENM__FORMAT_BGR233__SINCE: u32 = 1;
355 #[allow(dead_code)]
357 pub const ENM__FORMAT_XRGB4444__SINCE: u32 = 1;
358 #[allow(dead_code)]
360 pub const ENM__FORMAT_XBGR4444__SINCE: u32 = 1;
361 #[allow(dead_code)]
363 pub const ENM__FORMAT_RGBX4444__SINCE: u32 = 1;
364 #[allow(dead_code)]
366 pub const ENM__FORMAT_BGRX4444__SINCE: u32 = 1;
367 #[allow(dead_code)]
369 pub const ENM__FORMAT_ARGB4444__SINCE: u32 = 1;
370 #[allow(dead_code)]
372 pub const ENM__FORMAT_ABGR4444__SINCE: u32 = 1;
373 #[allow(dead_code)]
375 pub const ENM__FORMAT_RGBA4444__SINCE: u32 = 1;
376 #[allow(dead_code)]
378 pub const ENM__FORMAT_BGRA4444__SINCE: u32 = 1;
379 #[allow(dead_code)]
381 pub const ENM__FORMAT_XRGB1555__SINCE: u32 = 1;
382 #[allow(dead_code)]
384 pub const ENM__FORMAT_XBGR1555__SINCE: u32 = 1;
385 #[allow(dead_code)]
387 pub const ENM__FORMAT_RGBX5551__SINCE: u32 = 1;
388 #[allow(dead_code)]
390 pub const ENM__FORMAT_BGRX5551__SINCE: u32 = 1;
391 #[allow(dead_code)]
393 pub const ENM__FORMAT_ARGB1555__SINCE: u32 = 1;
394 #[allow(dead_code)]
396 pub const ENM__FORMAT_ABGR1555__SINCE: u32 = 1;
397 #[allow(dead_code)]
399 pub const ENM__FORMAT_RGBA5551__SINCE: u32 = 1;
400 #[allow(dead_code)]
402 pub const ENM__FORMAT_BGRA5551__SINCE: u32 = 1;
403 #[allow(dead_code)]
405 pub const ENM__FORMAT_RGB565__SINCE: u32 = 1;
406 #[allow(dead_code)]
408 pub const ENM__FORMAT_BGR565__SINCE: u32 = 1;
409 #[allow(dead_code)]
411 pub const ENM__FORMAT_RGB888__SINCE: u32 = 1;
412 #[allow(dead_code)]
414 pub const ENM__FORMAT_BGR888__SINCE: u32 = 1;
415 #[allow(dead_code)]
417 pub const ENM__FORMAT_XBGR8888__SINCE: u32 = 1;
418 #[allow(dead_code)]
420 pub const ENM__FORMAT_RGBX8888__SINCE: u32 = 1;
421 #[allow(dead_code)]
423 pub const ENM__FORMAT_BGRX8888__SINCE: u32 = 1;
424 #[allow(dead_code)]
426 pub const ENM__FORMAT_ABGR8888__SINCE: u32 = 1;
427 #[allow(dead_code)]
429 pub const ENM__FORMAT_RGBA8888__SINCE: u32 = 1;
430 #[allow(dead_code)]
432 pub const ENM__FORMAT_BGRA8888__SINCE: u32 = 1;
433 #[allow(dead_code)]
435 pub const ENM__FORMAT_XRGB2101010__SINCE: u32 = 1;
436 #[allow(dead_code)]
438 pub const ENM__FORMAT_XBGR2101010__SINCE: u32 = 1;
439 #[allow(dead_code)]
441 pub const ENM__FORMAT_RGBX1010102__SINCE: u32 = 1;
442 #[allow(dead_code)]
444 pub const ENM__FORMAT_BGRX1010102__SINCE: u32 = 1;
445 #[allow(dead_code)]
447 pub const ENM__FORMAT_ARGB2101010__SINCE: u32 = 1;
448 #[allow(dead_code)]
450 pub const ENM__FORMAT_ABGR2101010__SINCE: u32 = 1;
451 #[allow(dead_code)]
453 pub const ENM__FORMAT_RGBA1010102__SINCE: u32 = 1;
454 #[allow(dead_code)]
456 pub const ENM__FORMAT_BGRA1010102__SINCE: u32 = 1;
457 #[allow(dead_code)]
459 pub const ENM__FORMAT_YUYV__SINCE: u32 = 1;
460 #[allow(dead_code)]
462 pub const ENM__FORMAT_YVYU__SINCE: u32 = 1;
463 #[allow(dead_code)]
465 pub const ENM__FORMAT_UYVY__SINCE: u32 = 1;
466 #[allow(dead_code)]
468 pub const ENM__FORMAT_VYUY__SINCE: u32 = 1;
469 #[allow(dead_code)]
471 pub const ENM__FORMAT_AYUV__SINCE: u32 = 1;
472 #[allow(dead_code)]
474 pub const ENM__FORMAT_NV12__SINCE: u32 = 1;
475 #[allow(dead_code)]
477 pub const ENM__FORMAT_NV21__SINCE: u32 = 1;
478 #[allow(dead_code)]
480 pub const ENM__FORMAT_NV16__SINCE: u32 = 1;
481 #[allow(dead_code)]
483 pub const ENM__FORMAT_NV61__SINCE: u32 = 1;
484 #[allow(dead_code)]
486 pub const ENM__FORMAT_YUV410__SINCE: u32 = 1;
487 #[allow(dead_code)]
489 pub const ENM__FORMAT_YVU410__SINCE: u32 = 1;
490 #[allow(dead_code)]
492 pub const ENM__FORMAT_YUV411__SINCE: u32 = 1;
493 #[allow(dead_code)]
495 pub const ENM__FORMAT_YVU411__SINCE: u32 = 1;
496 #[allow(dead_code)]
498 pub const ENM__FORMAT_YUV420__SINCE: u32 = 1;
499 #[allow(dead_code)]
501 pub const ENM__FORMAT_YVU420__SINCE: u32 = 1;
502 #[allow(dead_code)]
504 pub const ENM__FORMAT_YUV422__SINCE: u32 = 1;
505 #[allow(dead_code)]
507 pub const ENM__FORMAT_YVU422__SINCE: u32 = 1;
508 #[allow(dead_code)]
510 pub const ENM__FORMAT_YUV444__SINCE: u32 = 1;
511 #[allow(dead_code)]
513 pub const ENM__FORMAT_YVU444__SINCE: u32 = 1;
514 #[allow(dead_code)]
516 pub const ENM__FORMAT_R8__SINCE: u32 = 1;
517 #[allow(dead_code)]
519 pub const ENM__FORMAT_R16__SINCE: u32 = 1;
520 #[allow(dead_code)]
522 pub const ENM__FORMAT_RG88__SINCE: u32 = 1;
523 #[allow(dead_code)]
525 pub const ENM__FORMAT_GR88__SINCE: u32 = 1;
526 #[allow(dead_code)]
528 pub const ENM__FORMAT_RG1616__SINCE: u32 = 1;
529 #[allow(dead_code)]
531 pub const ENM__FORMAT_GR1616__SINCE: u32 = 1;
532 #[allow(dead_code)]
534 pub const ENM__FORMAT_XRGB16161616F__SINCE: u32 = 1;
535 #[allow(dead_code)]
537 pub const ENM__FORMAT_XBGR16161616F__SINCE: u32 = 1;
538 #[allow(dead_code)]
540 pub const ENM__FORMAT_ARGB16161616F__SINCE: u32 = 1;
541 #[allow(dead_code)]
543 pub const ENM__FORMAT_ABGR16161616F__SINCE: u32 = 1;
544 #[allow(dead_code)]
546 pub const ENM__FORMAT_XYUV8888__SINCE: u32 = 1;
547 #[allow(dead_code)]
549 pub const ENM__FORMAT_VUY888__SINCE: u32 = 1;
550 #[allow(dead_code)]
552 pub const ENM__FORMAT_VUY101010__SINCE: u32 = 1;
553 #[allow(dead_code)]
555 pub const ENM__FORMAT_Y210__SINCE: u32 = 1;
556 #[allow(dead_code)]
558 pub const ENM__FORMAT_Y212__SINCE: u32 = 1;
559 #[allow(dead_code)]
561 pub const ENM__FORMAT_Y216__SINCE: u32 = 1;
562 #[allow(dead_code)]
564 pub const ENM__FORMAT_Y410__SINCE: u32 = 1;
565 #[allow(dead_code)]
567 pub const ENM__FORMAT_Y412__SINCE: u32 = 1;
568 #[allow(dead_code)]
570 pub const ENM__FORMAT_Y416__SINCE: u32 = 1;
571 #[allow(dead_code)]
573 pub const ENM__FORMAT_XVYU2101010__SINCE: u32 = 1;
574 #[allow(dead_code)]
576 pub const ENM__FORMAT_XVYU12_16161616__SINCE: u32 = 1;
577 #[allow(dead_code)]
579 pub const ENM__FORMAT_XVYU16161616__SINCE: u32 = 1;
580 #[allow(dead_code)]
582 pub const ENM__FORMAT_Y0L0__SINCE: u32 = 1;
583 #[allow(dead_code)]
585 pub const ENM__FORMAT_X0L0__SINCE: u32 = 1;
586 #[allow(dead_code)]
588 pub const ENM__FORMAT_Y0L2__SINCE: u32 = 1;
589 #[allow(dead_code)]
591 pub const ENM__FORMAT_X0L2__SINCE: u32 = 1;
592 #[allow(dead_code)]
594 pub const ENM__FORMAT_YUV420_8BIT__SINCE: u32 = 1;
595 #[allow(dead_code)]
597 pub const ENM__FORMAT_YUV420_10BIT__SINCE: u32 = 1;
598 #[allow(dead_code)]
600 pub const ENM__FORMAT_XRGB8888_A8__SINCE: u32 = 1;
601 #[allow(dead_code)]
603 pub const ENM__FORMAT_XBGR8888_A8__SINCE: u32 = 1;
604 #[allow(dead_code)]
606 pub const ENM__FORMAT_RGBX8888_A8__SINCE: u32 = 1;
607 #[allow(dead_code)]
609 pub const ENM__FORMAT_BGRX8888_A8__SINCE: u32 = 1;
610 #[allow(dead_code)]
612 pub const ENM__FORMAT_RGB888_A8__SINCE: u32 = 1;
613 #[allow(dead_code)]
615 pub const ENM__FORMAT_BGR888_A8__SINCE: u32 = 1;
616 #[allow(dead_code)]
618 pub const ENM__FORMAT_RGB565_A8__SINCE: u32 = 1;
619 #[allow(dead_code)]
621 pub const ENM__FORMAT_BGR565_A8__SINCE: u32 = 1;
622 #[allow(dead_code)]
624 pub const ENM__FORMAT_NV24__SINCE: u32 = 1;
625 #[allow(dead_code)]
627 pub const ENM__FORMAT_NV42__SINCE: u32 = 1;
628 #[allow(dead_code)]
630 pub const ENM__FORMAT_P210__SINCE: u32 = 1;
631 #[allow(dead_code)]
633 pub const ENM__FORMAT_P010__SINCE: u32 = 1;
634 #[allow(dead_code)]
636 pub const ENM__FORMAT_P012__SINCE: u32 = 1;
637 #[allow(dead_code)]
639 pub const ENM__FORMAT_P016__SINCE: u32 = 1;
640 #[allow(dead_code)]
642 pub const ENM__FORMAT_AXBXGXRX106106106106__SINCE: u32 = 1;
643 #[allow(dead_code)]
645 pub const ENM__FORMAT_NV15__SINCE: u32 = 1;
646 #[allow(dead_code)]
648 pub const ENM__FORMAT_Q410__SINCE: u32 = 1;
649 #[allow(dead_code)]
651 pub const ENM__FORMAT_Q401__SINCE: u32 = 1;
652 #[allow(dead_code)]
654 pub const ENM__FORMAT_XRGB16161616__SINCE: u32 = 1;
655 #[allow(dead_code)]
657 pub const ENM__FORMAT_XBGR16161616__SINCE: u32 = 1;
658 #[allow(dead_code)]
660 pub const ENM__FORMAT_ARGB16161616__SINCE: u32 = 1;
661 #[allow(dead_code)]
663 pub const ENM__FORMAT_ABGR16161616__SINCE: u32 = 1;
664 #[allow(dead_code)]
666 pub const ENM__FORMAT_C1__SINCE: u32 = 1;
667 #[allow(dead_code)]
669 pub const ENM__FORMAT_C2__SINCE: u32 = 1;
670 #[allow(dead_code)]
672 pub const ENM__FORMAT_C4__SINCE: u32 = 1;
673 #[allow(dead_code)]
675 pub const ENM__FORMAT_D1__SINCE: u32 = 1;
676 #[allow(dead_code)]
678 pub const ENM__FORMAT_D2__SINCE: u32 = 1;
679 #[allow(dead_code)]
681 pub const ENM__FORMAT_D4__SINCE: u32 = 1;
682 #[allow(dead_code)]
684 pub const ENM__FORMAT_D8__SINCE: u32 = 1;
685 #[allow(dead_code)]
687 pub const ENM__FORMAT_R1__SINCE: u32 = 1;
688 #[allow(dead_code)]
690 pub const ENM__FORMAT_R2__SINCE: u32 = 1;
691 #[allow(dead_code)]
693 pub const ENM__FORMAT_R4__SINCE: u32 = 1;
694 #[allow(dead_code)]
696 pub const ENM__FORMAT_R10__SINCE: u32 = 1;
697 #[allow(dead_code)]
699 pub const ENM__FORMAT_R12__SINCE: u32 = 1;
700 #[allow(dead_code)]
702 pub const ENM__FORMAT_AVUY8888__SINCE: u32 = 1;
703 #[allow(dead_code)]
705 pub const ENM__FORMAT_XVUY8888__SINCE: u32 = 1;
706 #[allow(dead_code)]
708 pub const ENM__FORMAT_P030__SINCE: u32 = 1;
709}
710
711#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
715#[allow(dead_code)]
716pub struct WlShmError(pub u32);
717
718impl WlShmError {
719 #[allow(dead_code)]
721 pub const INVALID_FORMAT: Self = Self(0);
722
723 #[allow(dead_code)]
725 pub const INVALID_STRIDE: Self = Self(1);
726
727 #[allow(dead_code)]
729 pub const INVALID_FD: Self = Self(2);
730}
731
732impl Debug for WlShmError {
733 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
734 let name = match *self {
735 Self::INVALID_FORMAT => "INVALID_FORMAT",
736 Self::INVALID_STRIDE => "INVALID_STRIDE",
737 Self::INVALID_FD => "INVALID_FD",
738 _ => return Debug::fmt(&self.0, f),
739 };
740 f.write_str(name)
741 }
742}
743
744#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
759#[allow(dead_code)]
760pub struct WlShmFormat(pub u32);
761
762impl WlShmFormat {
763 #[allow(dead_code)]
765 pub const ARGB8888: Self = Self(0);
766
767 #[allow(dead_code)]
769 pub const XRGB8888: Self = Self(1);
770
771 #[allow(dead_code)]
773 pub const C8: Self = Self(0x20203843);
774
775 #[allow(dead_code)]
777 pub const RGB332: Self = Self(0x38424752);
778
779 #[allow(dead_code)]
781 pub const BGR233: Self = Self(0x38524742);
782
783 #[allow(dead_code)]
785 pub const XRGB4444: Self = Self(0x32315258);
786
787 #[allow(dead_code)]
789 pub const XBGR4444: Self = Self(0x32314258);
790
791 #[allow(dead_code)]
793 pub const RGBX4444: Self = Self(0x32315852);
794
795 #[allow(dead_code)]
797 pub const BGRX4444: Self = Self(0x32315842);
798
799 #[allow(dead_code)]
801 pub const ARGB4444: Self = Self(0x32315241);
802
803 #[allow(dead_code)]
805 pub const ABGR4444: Self = Self(0x32314241);
806
807 #[allow(dead_code)]
809 pub const RGBA4444: Self = Self(0x32314152);
810
811 #[allow(dead_code)]
813 pub const BGRA4444: Self = Self(0x32314142);
814
815 #[allow(dead_code)]
817 pub const XRGB1555: Self = Self(0x35315258);
818
819 #[allow(dead_code)]
821 pub const XBGR1555: Self = Self(0x35314258);
822
823 #[allow(dead_code)]
825 pub const RGBX5551: Self = Self(0x35315852);
826
827 #[allow(dead_code)]
829 pub const BGRX5551: Self = Self(0x35315842);
830
831 #[allow(dead_code)]
833 pub const ARGB1555: Self = Self(0x35315241);
834
835 #[allow(dead_code)]
837 pub const ABGR1555: Self = Self(0x35314241);
838
839 #[allow(dead_code)]
841 pub const RGBA5551: Self = Self(0x35314152);
842
843 #[allow(dead_code)]
845 pub const BGRA5551: Self = Self(0x35314142);
846
847 #[allow(dead_code)]
849 pub const RGB565: Self = Self(0x36314752);
850
851 #[allow(dead_code)]
853 pub const BGR565: Self = Self(0x36314742);
854
855 #[allow(dead_code)]
857 pub const RGB888: Self = Self(0x34324752);
858
859 #[allow(dead_code)]
861 pub const BGR888: Self = Self(0x34324742);
862
863 #[allow(dead_code)]
865 pub const XBGR8888: Self = Self(0x34324258);
866
867 #[allow(dead_code)]
869 pub const RGBX8888: Self = Self(0x34325852);
870
871 #[allow(dead_code)]
873 pub const BGRX8888: Self = Self(0x34325842);
874
875 #[allow(dead_code)]
877 pub const ABGR8888: Self = Self(0x34324241);
878
879 #[allow(dead_code)]
881 pub const RGBA8888: Self = Self(0x34324152);
882
883 #[allow(dead_code)]
885 pub const BGRA8888: Self = Self(0x34324142);
886
887 #[allow(dead_code)]
889 pub const XRGB2101010: Self = Self(0x30335258);
890
891 #[allow(dead_code)]
893 pub const XBGR2101010: Self = Self(0x30334258);
894
895 #[allow(dead_code)]
897 pub const RGBX1010102: Self = Self(0x30335852);
898
899 #[allow(dead_code)]
901 pub const BGRX1010102: Self = Self(0x30335842);
902
903 #[allow(dead_code)]
905 pub const ARGB2101010: Self = Self(0x30335241);
906
907 #[allow(dead_code)]
909 pub const ABGR2101010: Self = Self(0x30334241);
910
911 #[allow(dead_code)]
913 pub const RGBA1010102: Self = Self(0x30334152);
914
915 #[allow(dead_code)]
917 pub const BGRA1010102: Self = Self(0x30334142);
918
919 #[allow(dead_code)]
921 pub const YUYV: Self = Self(0x56595559);
922
923 #[allow(dead_code)]
925 pub const YVYU: Self = Self(0x55595659);
926
927 #[allow(dead_code)]
929 pub const UYVY: Self = Self(0x59565955);
930
931 #[allow(dead_code)]
933 pub const VYUY: Self = Self(0x59555956);
934
935 #[allow(dead_code)]
937 pub const AYUV: Self = Self(0x56555941);
938
939 #[allow(dead_code)]
941 pub const NV12: Self = Self(0x3231564e);
942
943 #[allow(dead_code)]
945 pub const NV21: Self = Self(0x3132564e);
946
947 #[allow(dead_code)]
949 pub const NV16: Self = Self(0x3631564e);
950
951 #[allow(dead_code)]
953 pub const NV61: Self = Self(0x3136564e);
954
955 #[allow(dead_code)]
957 pub const YUV410: Self = Self(0x39565559);
958
959 #[allow(dead_code)]
961 pub const YVU410: Self = Self(0x39555659);
962
963 #[allow(dead_code)]
965 pub const YUV411: Self = Self(0x31315559);
966
967 #[allow(dead_code)]
969 pub const YVU411: Self = Self(0x31315659);
970
971 #[allow(dead_code)]
973 pub const YUV420: Self = Self(0x32315559);
974
975 #[allow(dead_code)]
977 pub const YVU420: Self = Self(0x32315659);
978
979 #[allow(dead_code)]
981 pub const YUV422: Self = Self(0x36315559);
982
983 #[allow(dead_code)]
985 pub const YVU422: Self = Self(0x36315659);
986
987 #[allow(dead_code)]
989 pub const YUV444: Self = Self(0x34325559);
990
991 #[allow(dead_code)]
993 pub const YVU444: Self = Self(0x34325659);
994
995 #[allow(dead_code)]
997 pub const R8: Self = Self(0x20203852);
998
999 #[allow(dead_code)]
1001 pub const R16: Self = Self(0x20363152);
1002
1003 #[allow(dead_code)]
1005 pub const RG88: Self = Self(0x38384752);
1006
1007 #[allow(dead_code)]
1009 pub const GR88: Self = Self(0x38385247);
1010
1011 #[allow(dead_code)]
1013 pub const RG1616: Self = Self(0x32334752);
1014
1015 #[allow(dead_code)]
1017 pub const GR1616: Self = Self(0x32335247);
1018
1019 #[allow(dead_code)]
1021 pub const XRGB16161616F: Self = Self(0x48345258);
1022
1023 #[allow(dead_code)]
1025 pub const XBGR16161616F: Self = Self(0x48344258);
1026
1027 #[allow(dead_code)]
1029 pub const ARGB16161616F: Self = Self(0x48345241);
1030
1031 #[allow(dead_code)]
1033 pub const ABGR16161616F: Self = Self(0x48344241);
1034
1035 #[allow(dead_code)]
1037 pub const XYUV8888: Self = Self(0x56555958);
1038
1039 #[allow(dead_code)]
1041 pub const VUY888: Self = Self(0x34325556);
1042
1043 #[allow(dead_code)]
1045 pub const VUY101010: Self = Self(0x30335556);
1046
1047 #[allow(dead_code)]
1049 pub const Y210: Self = Self(0x30313259);
1050
1051 #[allow(dead_code)]
1053 pub const Y212: Self = Self(0x32313259);
1054
1055 #[allow(dead_code)]
1057 pub const Y216: Self = Self(0x36313259);
1058
1059 #[allow(dead_code)]
1061 pub const Y410: Self = Self(0x30313459);
1062
1063 #[allow(dead_code)]
1065 pub const Y412: Self = Self(0x32313459);
1066
1067 #[allow(dead_code)]
1069 pub const Y416: Self = Self(0x36313459);
1070
1071 #[allow(dead_code)]
1073 pub const XVYU2101010: Self = Self(0x30335658);
1074
1075 #[allow(dead_code)]
1077 pub const XVYU12_16161616: Self = Self(0x36335658);
1078
1079 #[allow(dead_code)]
1081 pub const XVYU16161616: Self = Self(0x38345658);
1082
1083 #[allow(dead_code)]
1085 pub const Y0L0: Self = Self(0x304c3059);
1086
1087 #[allow(dead_code)]
1089 pub const X0L0: Self = Self(0x304c3058);
1090
1091 #[allow(dead_code)]
1093 pub const Y0L2: Self = Self(0x324c3059);
1094
1095 #[allow(dead_code)]
1097 pub const X0L2: Self = Self(0x324c3058);
1098
1099 #[allow(dead_code)]
1100 pub const YUV420_8BIT: Self = Self(0x38305559);
1101
1102 #[allow(dead_code)]
1103 pub const YUV420_10BIT: Self = Self(0x30315559);
1104
1105 #[allow(dead_code)]
1106 pub const XRGB8888_A8: Self = Self(0x38415258);
1107
1108 #[allow(dead_code)]
1109 pub const XBGR8888_A8: Self = Self(0x38414258);
1110
1111 #[allow(dead_code)]
1112 pub const RGBX8888_A8: Self = Self(0x38415852);
1113
1114 #[allow(dead_code)]
1115 pub const BGRX8888_A8: Self = Self(0x38415842);
1116
1117 #[allow(dead_code)]
1118 pub const RGB888_A8: Self = Self(0x38413852);
1119
1120 #[allow(dead_code)]
1121 pub const BGR888_A8: Self = Self(0x38413842);
1122
1123 #[allow(dead_code)]
1124 pub const RGB565_A8: Self = Self(0x38413552);
1125
1126 #[allow(dead_code)]
1127 pub const BGR565_A8: Self = Self(0x38413542);
1128
1129 #[allow(dead_code)]
1131 pub const NV24: Self = Self(0x3432564e);
1132
1133 #[allow(dead_code)]
1135 pub const NV42: Self = Self(0x3234564e);
1136
1137 #[allow(dead_code)]
1139 pub const P210: Self = Self(0x30313250);
1140
1141 #[allow(dead_code)]
1143 pub const P010: Self = Self(0x30313050);
1144
1145 #[allow(dead_code)]
1147 pub const P012: Self = Self(0x32313050);
1148
1149 #[allow(dead_code)]
1151 pub const P016: Self = Self(0x36313050);
1152
1153 #[allow(dead_code)]
1155 pub const AXBXGXRX106106106106: Self = Self(0x30314241);
1156
1157 #[allow(dead_code)]
1159 pub const NV15: Self = Self(0x3531564e);
1160
1161 #[allow(dead_code)]
1162 pub const Q410: Self = Self(0x30313451);
1163
1164 #[allow(dead_code)]
1165 pub const Q401: Self = Self(0x31303451);
1166
1167 #[allow(dead_code)]
1169 pub const XRGB16161616: Self = Self(0x38345258);
1170
1171 #[allow(dead_code)]
1173 pub const XBGR16161616: Self = Self(0x38344258);
1174
1175 #[allow(dead_code)]
1177 pub const ARGB16161616: Self = Self(0x38345241);
1178
1179 #[allow(dead_code)]
1181 pub const ABGR16161616: Self = Self(0x38344241);
1182
1183 #[allow(dead_code)]
1185 pub const C1: Self = Self(0x20203143);
1186
1187 #[allow(dead_code)]
1189 pub const C2: Self = Self(0x20203243);
1190
1191 #[allow(dead_code)]
1193 pub const C4: Self = Self(0x20203443);
1194
1195 #[allow(dead_code)]
1197 pub const D1: Self = Self(0x20203144);
1198
1199 #[allow(dead_code)]
1201 pub const D2: Self = Self(0x20203244);
1202
1203 #[allow(dead_code)]
1205 pub const D4: Self = Self(0x20203444);
1206
1207 #[allow(dead_code)]
1209 pub const D8: Self = Self(0x20203844);
1210
1211 #[allow(dead_code)]
1213 pub const R1: Self = Self(0x20203152);
1214
1215 #[allow(dead_code)]
1217 pub const R2: Self = Self(0x20203252);
1218
1219 #[allow(dead_code)]
1221 pub const R4: Self = Self(0x20203452);
1222
1223 #[allow(dead_code)]
1225 pub const R10: Self = Self(0x20303152);
1226
1227 #[allow(dead_code)]
1229 pub const R12: Self = Self(0x20323152);
1230
1231 #[allow(dead_code)]
1233 pub const AVUY8888: Self = Self(0x59555641);
1234
1235 #[allow(dead_code)]
1237 pub const XVUY8888: Self = Self(0x59555658);
1238
1239 #[allow(dead_code)]
1241 pub const P030: Self = Self(0x30333050);
1242}
1243
1244impl Debug for WlShmFormat {
1245 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
1246 let name = match *self {
1247 Self::ARGB8888 => "ARGB8888",
1248 Self::XRGB8888 => "XRGB8888",
1249 Self::C8 => "C8",
1250 Self::RGB332 => "RGB332",
1251 Self::BGR233 => "BGR233",
1252 Self::XRGB4444 => "XRGB4444",
1253 Self::XBGR4444 => "XBGR4444",
1254 Self::RGBX4444 => "RGBX4444",
1255 Self::BGRX4444 => "BGRX4444",
1256 Self::ARGB4444 => "ARGB4444",
1257 Self::ABGR4444 => "ABGR4444",
1258 Self::RGBA4444 => "RGBA4444",
1259 Self::BGRA4444 => "BGRA4444",
1260 Self::XRGB1555 => "XRGB1555",
1261 Self::XBGR1555 => "XBGR1555",
1262 Self::RGBX5551 => "RGBX5551",
1263 Self::BGRX5551 => "BGRX5551",
1264 Self::ARGB1555 => "ARGB1555",
1265 Self::ABGR1555 => "ABGR1555",
1266 Self::RGBA5551 => "RGBA5551",
1267 Self::BGRA5551 => "BGRA5551",
1268 Self::RGB565 => "RGB565",
1269 Self::BGR565 => "BGR565",
1270 Self::RGB888 => "RGB888",
1271 Self::BGR888 => "BGR888",
1272 Self::XBGR8888 => "XBGR8888",
1273 Self::RGBX8888 => "RGBX8888",
1274 Self::BGRX8888 => "BGRX8888",
1275 Self::ABGR8888 => "ABGR8888",
1276 Self::RGBA8888 => "RGBA8888",
1277 Self::BGRA8888 => "BGRA8888",
1278 Self::XRGB2101010 => "XRGB2101010",
1279 Self::XBGR2101010 => "XBGR2101010",
1280 Self::RGBX1010102 => "RGBX1010102",
1281 Self::BGRX1010102 => "BGRX1010102",
1282 Self::ARGB2101010 => "ARGB2101010",
1283 Self::ABGR2101010 => "ABGR2101010",
1284 Self::RGBA1010102 => "RGBA1010102",
1285 Self::BGRA1010102 => "BGRA1010102",
1286 Self::YUYV => "YUYV",
1287 Self::YVYU => "YVYU",
1288 Self::UYVY => "UYVY",
1289 Self::VYUY => "VYUY",
1290 Self::AYUV => "AYUV",
1291 Self::NV12 => "NV12",
1292 Self::NV21 => "NV21",
1293 Self::NV16 => "NV16",
1294 Self::NV61 => "NV61",
1295 Self::YUV410 => "YUV410",
1296 Self::YVU410 => "YVU410",
1297 Self::YUV411 => "YUV411",
1298 Self::YVU411 => "YVU411",
1299 Self::YUV420 => "YUV420",
1300 Self::YVU420 => "YVU420",
1301 Self::YUV422 => "YUV422",
1302 Self::YVU422 => "YVU422",
1303 Self::YUV444 => "YUV444",
1304 Self::YVU444 => "YVU444",
1305 Self::R8 => "R8",
1306 Self::R16 => "R16",
1307 Self::RG88 => "RG88",
1308 Self::GR88 => "GR88",
1309 Self::RG1616 => "RG1616",
1310 Self::GR1616 => "GR1616",
1311 Self::XRGB16161616F => "XRGB16161616F",
1312 Self::XBGR16161616F => "XBGR16161616F",
1313 Self::ARGB16161616F => "ARGB16161616F",
1314 Self::ABGR16161616F => "ABGR16161616F",
1315 Self::XYUV8888 => "XYUV8888",
1316 Self::VUY888 => "VUY888",
1317 Self::VUY101010 => "VUY101010",
1318 Self::Y210 => "Y210",
1319 Self::Y212 => "Y212",
1320 Self::Y216 => "Y216",
1321 Self::Y410 => "Y410",
1322 Self::Y412 => "Y412",
1323 Self::Y416 => "Y416",
1324 Self::XVYU2101010 => "XVYU2101010",
1325 Self::XVYU12_16161616 => "XVYU12_16161616",
1326 Self::XVYU16161616 => "XVYU16161616",
1327 Self::Y0L0 => "Y0L0",
1328 Self::X0L0 => "X0L0",
1329 Self::Y0L2 => "Y0L2",
1330 Self::X0L2 => "X0L2",
1331 Self::YUV420_8BIT => "YUV420_8BIT",
1332 Self::YUV420_10BIT => "YUV420_10BIT",
1333 Self::XRGB8888_A8 => "XRGB8888_A8",
1334 Self::XBGR8888_A8 => "XBGR8888_A8",
1335 Self::RGBX8888_A8 => "RGBX8888_A8",
1336 Self::BGRX8888_A8 => "BGRX8888_A8",
1337 Self::RGB888_A8 => "RGB888_A8",
1338 Self::BGR888_A8 => "BGR888_A8",
1339 Self::RGB565_A8 => "RGB565_A8",
1340 Self::BGR565_A8 => "BGR565_A8",
1341 Self::NV24 => "NV24",
1342 Self::NV42 => "NV42",
1343 Self::P210 => "P210",
1344 Self::P010 => "P010",
1345 Self::P012 => "P012",
1346 Self::P016 => "P016",
1347 Self::AXBXGXRX106106106106 => "AXBXGXRX106106106106",
1348 Self::NV15 => "NV15",
1349 Self::Q410 => "Q410",
1350 Self::Q401 => "Q401",
1351 Self::XRGB16161616 => "XRGB16161616",
1352 Self::XBGR16161616 => "XBGR16161616",
1353 Self::ARGB16161616 => "ARGB16161616",
1354 Self::ABGR16161616 => "ABGR16161616",
1355 Self::C1 => "C1",
1356 Self::C2 => "C2",
1357 Self::C4 => "C4",
1358 Self::D1 => "D1",
1359 Self::D2 => "D2",
1360 Self::D4 => "D4",
1361 Self::D8 => "D8",
1362 Self::R1 => "R1",
1363 Self::R2 => "R2",
1364 Self::R4 => "R4",
1365 Self::R10 => "R10",
1366 Self::R12 => "R12",
1367 Self::AVUY8888 => "AVUY8888",
1368 Self::XVUY8888 => "XVUY8888",
1369 Self::P030 => "P030",
1370 _ => return Debug::fmt(&self.0, f),
1371 };
1372 f.write_str(name)
1373 }
1374}
1375
1376pub mod event_handlers {
1378 use super::*;
1379
1380 pub struct Format<T, F>(F, PhantomData<fn(&mut T)>);
1382 impl<T, F> WlShmEventHandler for Format<T, F>
1383 where
1384 T: 'static,
1385 F: Fn(&mut T, &WlShmRef, WlShmFormat),
1386 {
1387 type Data = T;
1388
1389 #[inline]
1390 fn format(&self, _data: &mut T, _slf: &WlShmRef, format: WlShmFormat) {
1391 self.0(_data, _slf, format)
1392 }
1393 }
1394
1395 impl WlShm {
1396 #[allow(dead_code)]
1400 pub fn on_format<T, F>(f: F) -> Format<T, F>
1401 where
1402 T: 'static,
1403 F: Fn(&mut T, &WlShmRef, WlShmFormat),
1404 {
1405 Format(f, PhantomData)
1406 }
1407 }
1408}