get_registry/common/protocols/wayland/wl_touch.rs
1//! touchscreen input device
2//!
3//! The wl_touch interface represents a touchscreen
4//! associated with a seat.
5//!
6//! Touch interactions can consist of one or more contacts.
7//! For each contact, a series of events is generated, starting
8//! with a down event, followed by zero or more motion events,
9//! and ending with an up event. Events relating to the same
10//! contact point can be identified by the ID of the sequence.
11
12use super::super::all_types::*;
13use ::wl_client::builder::prelude::*;
14
15static INTERFACE: wl_interface = wl_interface {
16 name: c"wl_touch".as_ptr(),
17 version: 10,
18 method_count: 1,
19 methods: {
20 static MESSAGES: [wl_message; 1] = [wl_message {
21 name: c"release".as_ptr(),
22 signature: c"".as_ptr(),
23 types: {
24 static TYPES: [Option<&'static wl_interface>; 0] = [];
25 TYPES.as_ptr().cast()
26 },
27 }];
28 MESSAGES.as_ptr()
29 },
30 event_count: 7,
31 events: {
32 static MESSAGES: [wl_message; 7] = [
33 wl_message {
34 name: c"down".as_ptr(),
35 signature: c"uuoiff".as_ptr(),
36 types: {
37 static TYPES: [Option<&'static wl_interface>; 6] =
38 [None, None, Some(WlSurface::WL_INTERFACE), None, None, None];
39 TYPES.as_ptr().cast()
40 },
41 },
42 wl_message {
43 name: c"up".as_ptr(),
44 signature: c"uui".as_ptr(),
45 types: {
46 static TYPES: [Option<&'static wl_interface>; 3] = [None, None, None];
47 TYPES.as_ptr().cast()
48 },
49 },
50 wl_message {
51 name: c"motion".as_ptr(),
52 signature: c"uiff".as_ptr(),
53 types: {
54 static TYPES: [Option<&'static wl_interface>; 4] = [None, None, None, None];
55 TYPES.as_ptr().cast()
56 },
57 },
58 wl_message {
59 name: c"frame".as_ptr(),
60 signature: c"".as_ptr(),
61 types: {
62 static TYPES: [Option<&'static wl_interface>; 0] = [];
63 TYPES.as_ptr().cast()
64 },
65 },
66 wl_message {
67 name: c"cancel".as_ptr(),
68 signature: c"".as_ptr(),
69 types: {
70 static TYPES: [Option<&'static wl_interface>; 0] = [];
71 TYPES.as_ptr().cast()
72 },
73 },
74 wl_message {
75 name: c"shape".as_ptr(),
76 signature: c"iff".as_ptr(),
77 types: {
78 static TYPES: [Option<&'static wl_interface>; 3] = [None, None, None];
79 TYPES.as_ptr().cast()
80 },
81 },
82 wl_message {
83 name: c"orientation".as_ptr(),
84 signature: c"if".as_ptr(),
85 types: {
86 static TYPES: [Option<&'static wl_interface>; 2] = [None, None];
87 TYPES.as_ptr().cast()
88 },
89 },
90 ];
91 MESSAGES.as_ptr()
92 },
93};
94
95/// An owned wl_touch proxy.
96///
97/// See the documentation of [the module][self] for the interface description.
98#[derive(Clone, Eq, PartialEq)]
99#[repr(transparent)]
100pub struct WlTouch {
101 /// This proxy has the interface INTERFACE.
102 proxy: UntypedOwnedProxy,
103}
104
105/// A borrowed wl_touch proxy.
106///
107/// See the documentation of [the module][self] for the interface description.
108#[derive(Eq, PartialEq)]
109#[repr(transparent)]
110pub struct WlTouchRef {
111 /// This proxy has the interface INTERFACE.
112 proxy: UntypedBorrowedProxy,
113}
114
115// SAFETY: WlTouch is a transparent wrapper around UntypedOwnedProxy
116unsafe impl UntypedOwnedProxyWrapper for WlTouch {}
117
118// SAFETY: - INTERFACE is a valid wl_interface
119// - The only invariant is that self.proxy has a compatible interface
120unsafe impl OwnedProxy for WlTouch {
121 const INTERFACE: &'static str = "wl_touch";
122 const WL_INTERFACE: &'static wl_interface = &INTERFACE;
123 const NO_OP_EVENT_HANDLER: Self::NoOpEventHandler =
124 private::EventHandler(private::NoOpEventHandler);
125 const MAX_VERSION: u32 = 10;
126
127 type Borrowed = WlTouchRef;
128 type Api = private::ProxyApi;
129 type NoOpEventHandler = private::EventHandler<private::NoOpEventHandler>;
130}
131
132// SAFETY: WlTouchRef is a transparent wrapper around UntypedBorrowedProxy
133unsafe impl UntypedBorrowedProxyWrapper for WlTouchRef {}
134
135// SAFETY: - The only invariant is that self.proxy has a compatible interface
136unsafe impl BorrowedProxy for WlTouchRef {
137 type Owned = WlTouch;
138}
139
140impl Deref for WlTouch {
141 type Target = WlTouchRef;
142
143 fn deref(&self) -> &Self::Target {
144 proxy::low_level::deref(self)
145 }
146}
147
148mod private {
149 pub struct ProxyApi;
150
151 #[allow(dead_code)]
152 pub struct EventHandler<H>(pub(super) H);
153
154 #[allow(dead_code)]
155 pub struct NoOpEventHandler;
156}
157
158impl Debug for WlTouch {
159 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
160 write!(f, "wl_touch#{}", self.proxy.id())
161 }
162}
163
164impl Debug for WlTouchRef {
165 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
166 write!(f, "wl_touch#{}", self.proxy.id())
167 }
168}
169
170impl PartialEq<WlTouchRef> for WlTouch {
171 fn eq(&self, other: &WlTouchRef) -> bool {
172 self.proxy == other.proxy
173 }
174}
175
176impl PartialEq<WlTouch> for WlTouchRef {
177 fn eq(&self, other: &WlTouch) -> bool {
178 self.proxy == other.proxy
179 }
180}
181
182#[allow(dead_code)]
183impl WlTouch {
184 /// Since when the release request is available.
185 #[allow(dead_code)]
186 pub const REQ__RELEASE__SINCE: u32 = 3;
187}
188
189#[allow(dead_code)]
190impl WlTouch {
191 /// release the touch object
192 #[inline]
193 pub fn release(&self) {
194 let mut args = [];
195 // SAFETY: - self.proxy has the interface INTERFACE
196 // - 0 < INTERFACE.method_count = 1
197 // - the request signature is ``
198 unsafe {
199 self.proxy.send_destructor(0, &mut args);
200 }
201 }
202}
203
204impl WlTouch {
205 /// Since when the down event is available.
206 #[allow(dead_code)]
207 pub const EVT__DOWN__SINCE: u32 = 1;
208
209 /// Since when the up event is available.
210 #[allow(dead_code)]
211 pub const EVT__UP__SINCE: u32 = 1;
212
213 /// Since when the motion event is available.
214 #[allow(dead_code)]
215 pub const EVT__MOTION__SINCE: u32 = 1;
216
217 /// Since when the frame event is available.
218 #[allow(dead_code)]
219 pub const EVT__FRAME__SINCE: u32 = 1;
220
221 /// Since when the cancel event is available.
222 #[allow(dead_code)]
223 pub const EVT__CANCEL__SINCE: u32 = 1;
224
225 /// Since when the shape event is available.
226 #[allow(dead_code)]
227 pub const EVT__SHAPE__SINCE: u32 = 6;
228
229 /// Since when the orientation event is available.
230 #[allow(dead_code)]
231 pub const EVT__ORIENTATION__SINCE: u32 = 6;
232}
233
234/// An event handler for [WlTouch] proxies.
235#[allow(dead_code)]
236pub trait WlTouchEventHandler {
237 /// touch down event and beginning of a touch sequence
238 ///
239 /// A new touch point has appeared on the surface. This touch point is
240 /// assigned a unique ID. Future events from this touch point reference
241 /// this ID. The ID ceases to be valid after a touch up event and may be
242 /// reused in the future.
243 ///
244 /// # Arguments
245 ///
246 /// - `serial`: serial number of the touch down event
247 /// - `time`: timestamp with millisecond granularity
248 /// - `surface`: surface touched
249 /// - `id`: the unique ID of this touch point
250 /// - `x`: surface-local x coordinate
251 /// - `y`: surface-local y coordinate
252 ///
253 /// All borrowed proxies passed to this function are guaranteed to be
254 /// immutable and non-null.
255 #[inline]
256 fn down(
257 &self,
258 _slf: &WlTouchRef,
259 serial: u32,
260 time: u32,
261 surface: Option<&WlSurfaceRef>,
262 id: i32,
263 x: Fixed,
264 y: Fixed,
265 ) {
266 let _ = serial;
267 let _ = time;
268 let _ = surface;
269 let _ = id;
270 let _ = x;
271 let _ = y;
272 }
273
274 /// end of a touch event sequence
275 ///
276 /// The touch point has disappeared. No further events will be sent for
277 /// this touch point and the touch point's ID is released and may be
278 /// reused in a future touch down event.
279 ///
280 /// # Arguments
281 ///
282 /// - `serial`: serial number of the touch up event
283 /// - `time`: timestamp with millisecond granularity
284 /// - `id`: the unique ID of this touch point
285 #[inline]
286 fn up(&self, _slf: &WlTouchRef, serial: u32, time: u32, id: i32) {
287 let _ = serial;
288 let _ = time;
289 let _ = id;
290 }
291
292 /// update of touch point coordinates
293 ///
294 /// A touch point has changed coordinates.
295 ///
296 /// # Arguments
297 ///
298 /// - `time`: timestamp with millisecond granularity
299 /// - `id`: the unique ID of this touch point
300 /// - `x`: surface-local x coordinate
301 /// - `y`: surface-local y coordinate
302 #[inline]
303 fn motion(&self, _slf: &WlTouchRef, time: u32, id: i32, x: Fixed, y: Fixed) {
304 let _ = time;
305 let _ = id;
306 let _ = x;
307 let _ = y;
308 }
309
310 /// end of touch frame event
311 ///
312 /// Indicates the end of a set of events that logically belong together.
313 /// A client is expected to accumulate the data in all events within the
314 /// frame before proceeding.
315 ///
316 /// A wl_touch.frame terminates at least one event but otherwise no
317 /// guarantee is provided about the set of events within a frame. A client
318 /// must assume that any state not updated in a frame is unchanged from the
319 /// previously known state.
320 #[inline]
321 fn frame(&self, _slf: &WlTouchRef) {}
322
323 /// touch session cancelled
324 ///
325 /// Sent if the compositor decides the touch stream is a global
326 /// gesture. No further events are sent to the clients from that
327 /// particular gesture. Touch cancellation applies to all touch points
328 /// currently active on this client's surface. The client is
329 /// responsible for finalizing the touch points, future touch points on
330 /// this surface may reuse the touch point ID.
331 ///
332 /// No frame event is required after the cancel event.
333 #[inline]
334 fn cancel(&self, _slf: &WlTouchRef) {}
335
336 /// update shape of touch point
337 ///
338 /// Sent when a touchpoint has changed its shape.
339 ///
340 /// This event does not occur on its own. It is sent before a
341 /// wl_touch.frame event and carries the new shape information for
342 /// any previously reported, or new touch points of that frame.
343 ///
344 /// Other events describing the touch point such as wl_touch.down,
345 /// wl_touch.motion or wl_touch.orientation may be sent within the
346 /// same wl_touch.frame. A client should treat these events as a single
347 /// logical touch point update. The order of wl_touch.shape,
348 /// wl_touch.orientation and wl_touch.motion is not guaranteed.
349 /// A wl_touch.down event is guaranteed to occur before the first
350 /// wl_touch.shape event for this touch ID but both events may occur within
351 /// the same wl_touch.frame.
352 ///
353 /// A touchpoint shape is approximated by an ellipse through the major and
354 /// minor axis length. The major axis length describes the longer diameter
355 /// of the ellipse, while the minor axis length describes the shorter
356 /// diameter. Major and minor are orthogonal and both are specified in
357 /// surface-local coordinates. The center of the ellipse is always at the
358 /// touchpoint location as reported by wl_touch.down or wl_touch.move.
359 ///
360 /// This event is only sent by the compositor if the touch device supports
361 /// shape reports. The client has to make reasonable assumptions about the
362 /// shape if it did not receive this event.
363 ///
364 /// # Arguments
365 ///
366 /// - `id`: the unique ID of this touch point
367 /// - `major`: length of the major axis in surface-local coordinates
368 /// - `minor`: length of the minor axis in surface-local coordinates
369 #[inline]
370 fn shape(&self, _slf: &WlTouchRef, id: i32, major: Fixed, minor: Fixed) {
371 let _ = id;
372 let _ = major;
373 let _ = minor;
374 }
375
376 /// update orientation of touch point
377 ///
378 /// Sent when a touchpoint has changed its orientation.
379 ///
380 /// This event does not occur on its own. It is sent before a
381 /// wl_touch.frame event and carries the new shape information for
382 /// any previously reported, or new touch points of that frame.
383 ///
384 /// Other events describing the touch point such as wl_touch.down,
385 /// wl_touch.motion or wl_touch.shape may be sent within the
386 /// same wl_touch.frame. A client should treat these events as a single
387 /// logical touch point update. The order of wl_touch.shape,
388 /// wl_touch.orientation and wl_touch.motion is not guaranteed.
389 /// A wl_touch.down event is guaranteed to occur before the first
390 /// wl_touch.orientation event for this touch ID but both events may occur
391 /// within the same wl_touch.frame.
392 ///
393 /// The orientation describes the clockwise angle of a touchpoint's major
394 /// axis to the positive surface y-axis and is normalized to the -180 to
395 /// +180 degree range. The granularity of orientation depends on the touch
396 /// device, some devices only support binary rotation values between 0 and
397 /// 90 degrees.
398 ///
399 /// This event is only sent by the compositor if the touch device supports
400 /// orientation reports.
401 ///
402 /// # Arguments
403 ///
404 /// - `id`: the unique ID of this touch point
405 /// - `orientation`: angle between major axis and positive surface y-axis in degrees
406 #[inline]
407 fn orientation(&self, _slf: &WlTouchRef, id: i32, orientation: Fixed) {
408 let _ = id;
409 let _ = orientation;
410 }
411}
412
413impl WlTouchEventHandler for private::NoOpEventHandler {}
414
415// SAFETY: - INTERFACE is a valid wl_interface
416unsafe impl<H> EventHandler for private::EventHandler<H>
417where
418 H: WlTouchEventHandler,
419{
420 const WL_INTERFACE: &'static wl_interface = &INTERFACE;
421
422 #[allow(unused_variables)]
423 unsafe fn handle_event(
424 &self,
425 queue: &Queue,
426 data: *mut u8,
427 slf: &UntypedBorrowedProxy,
428 opcode: u32,
429 args: *mut wl_argument,
430 ) {
431 // SAFETY: This function requires that slf has the interface INTERFACE
432 let slf = unsafe { proxy::low_level::from_untyped_borrowed::<WlTouchRef>(slf) };
433 match opcode {
434 0 => {
435 // SAFETY: INTERFACE requires that there are 6 arguments
436 let args = unsafe { &*args.cast::<[wl_argument; 6]>() };
437 // SAFETY: - INTERFACE requires that args[0] contains a uint
438 let arg0 = unsafe { args[0].u };
439 // SAFETY: - INTERFACE requires that args[1] contains a uint
440 let arg1 = unsafe { args[1].u };
441 // SAFETY: - INTERFACE requires that args[2] contains an object
442 let arg2 = unsafe {
443 if let Some(p) = NonNull::new(args[2].o.cast()) {
444 Some(UntypedBorrowedProxy::new_immutable(queue.libwayland(), p))
445 } else {
446 None
447 }
448 };
449 // SAFETY: - INTERFACE requires that the object has the interface WlSurface::WL_INTERFACE
450 let arg2 = arg2.as_ref().map(|arg2| unsafe {
451 proxy::low_level::from_untyped_borrowed::<WlSurfaceRef>(arg2)
452 });
453 // SAFETY: - INTERFACE requires that args[3] contains an int
454 let arg3 = unsafe { args[3].i };
455 // SAFETY: - INTERFACE requires that args[4] contains a fixed
456 let arg4 = unsafe { Fixed::from_wire(args[4].f) };
457 // SAFETY: - INTERFACE requires that args[5] contains a fixed
458 let arg5 = unsafe { Fixed::from_wire(args[5].f) };
459 self.0.down(slf, arg0, arg1, arg2, arg3, arg4, arg5);
460 }
461 1 => {
462 // SAFETY: INTERFACE requires that there are 3 arguments
463 let args = unsafe { &*args.cast::<[wl_argument; 3]>() };
464 // SAFETY: - INTERFACE requires that args[0] contains a uint
465 let arg0 = unsafe { args[0].u };
466 // SAFETY: - INTERFACE requires that args[1] contains a uint
467 let arg1 = unsafe { args[1].u };
468 // SAFETY: - INTERFACE requires that args[2] contains an int
469 let arg2 = unsafe { args[2].i };
470 self.0.up(slf, arg0, arg1, arg2);
471 }
472 2 => {
473 // SAFETY: INTERFACE requires that there are 4 arguments
474 let args = unsafe { &*args.cast::<[wl_argument; 4]>() };
475 // SAFETY: - INTERFACE requires that args[0] contains a uint
476 let arg0 = unsafe { args[0].u };
477 // SAFETY: - INTERFACE requires that args[1] contains an int
478 let arg1 = unsafe { args[1].i };
479 // SAFETY: - INTERFACE requires that args[2] contains a fixed
480 let arg2 = unsafe { Fixed::from_wire(args[2].f) };
481 // SAFETY: - INTERFACE requires that args[3] contains a fixed
482 let arg3 = unsafe { Fixed::from_wire(args[3].f) };
483 self.0.motion(slf, arg0, arg1, arg2, arg3);
484 }
485 3 => {
486 self.0.frame(slf);
487 }
488 4 => {
489 self.0.cancel(slf);
490 }
491 5 => {
492 // SAFETY: INTERFACE requires that there are 3 arguments
493 let args = unsafe { &*args.cast::<[wl_argument; 3]>() };
494 // SAFETY: - INTERFACE requires that args[0] contains an int
495 let arg0 = unsafe { args[0].i };
496 // SAFETY: - INTERFACE requires that args[1] contains a fixed
497 let arg1 = unsafe { Fixed::from_wire(args[1].f) };
498 // SAFETY: - INTERFACE requires that args[2] contains a fixed
499 let arg2 = unsafe { Fixed::from_wire(args[2].f) };
500 self.0.shape(slf, arg0, arg1, arg2);
501 }
502 6 => {
503 // SAFETY: INTERFACE requires that there are 2 arguments
504 let args = unsafe { &*args.cast::<[wl_argument; 2]>() };
505 // SAFETY: - INTERFACE requires that args[0] contains an int
506 let arg0 = unsafe { args[0].i };
507 // SAFETY: - INTERFACE requires that args[1] contains a fixed
508 let arg1 = unsafe { Fixed::from_wire(args[1].f) };
509 self.0.orientation(slf, arg0, arg1);
510 }
511 _ => {
512 invalid_opcode("wl_touch", opcode);
513 }
514 }
515 }
516}
517
518impl<H> CreateEventHandler<H> for private::ProxyApi
519where
520 H: WlTouchEventHandler,
521{
522 type EventHandler = private::EventHandler<H>;
523
524 #[inline]
525 fn create_event_handler(handler: H) -> Self::EventHandler {
526 private::EventHandler(handler)
527 }
528}
529
530/// Functional event handlers.
531pub mod event_handlers {
532 use super::*;
533
534 /// Event handler for down events.
535 pub struct Down<F>(F);
536 impl<F> WlTouchEventHandler for Down<F>
537 where
538 F: Fn(&WlTouchRef, u32, u32, Option<&WlSurfaceRef>, i32, Fixed, Fixed),
539 {
540 #[inline]
541 fn down(
542 &self,
543 _slf: &WlTouchRef,
544 serial: u32,
545 time: u32,
546 surface: Option<&WlSurfaceRef>,
547 id: i32,
548 x: Fixed,
549 y: Fixed,
550 ) {
551 self.0(_slf, serial, time, surface, id, x, y)
552 }
553 }
554
555 /// Event handler for up events.
556 pub struct Up<F>(F);
557 impl<F> WlTouchEventHandler for Up<F>
558 where
559 F: Fn(&WlTouchRef, u32, u32, i32),
560 {
561 #[inline]
562 fn up(&self, _slf: &WlTouchRef, serial: u32, time: u32, id: i32) {
563 self.0(_slf, serial, time, id)
564 }
565 }
566
567 /// Event handler for motion events.
568 pub struct Motion<F>(F);
569 impl<F> WlTouchEventHandler for Motion<F>
570 where
571 F: Fn(&WlTouchRef, u32, i32, Fixed, Fixed),
572 {
573 #[inline]
574 fn motion(&self, _slf: &WlTouchRef, time: u32, id: i32, x: Fixed, y: Fixed) {
575 self.0(_slf, time, id, x, y)
576 }
577 }
578
579 /// Event handler for frame events.
580 pub struct Frame<F>(F);
581 impl<F> WlTouchEventHandler for Frame<F>
582 where
583 F: Fn(&WlTouchRef),
584 {
585 #[inline]
586 fn frame(&self, _slf: &WlTouchRef) {
587 self.0(_slf)
588 }
589 }
590
591 /// Event handler for cancel events.
592 pub struct Cancel<F>(F);
593 impl<F> WlTouchEventHandler for Cancel<F>
594 where
595 F: Fn(&WlTouchRef),
596 {
597 #[inline]
598 fn cancel(&self, _slf: &WlTouchRef) {
599 self.0(_slf)
600 }
601 }
602
603 /// Event handler for shape events.
604 pub struct Shape<F>(F);
605 impl<F> WlTouchEventHandler for Shape<F>
606 where
607 F: Fn(&WlTouchRef, i32, Fixed, Fixed),
608 {
609 #[inline]
610 fn shape(&self, _slf: &WlTouchRef, id: i32, major: Fixed, minor: Fixed) {
611 self.0(_slf, id, major, minor)
612 }
613 }
614
615 /// Event handler for orientation events.
616 pub struct Orientation<F>(F);
617 impl<F> WlTouchEventHandler for Orientation<F>
618 where
619 F: Fn(&WlTouchRef, i32, Fixed),
620 {
621 #[inline]
622 fn orientation(&self, _slf: &WlTouchRef, id: i32, orientation: Fixed) {
623 self.0(_slf, id, orientation)
624 }
625 }
626
627 impl WlTouch {
628 /// Creates an event handler for down events.
629 ///
630 /// The event handler ignores all other events.
631 #[allow(dead_code)]
632 pub fn on_down<F>(f: F) -> Down<F>
633 where
634 F: Fn(&WlTouchRef, u32, u32, Option<&WlSurfaceRef>, i32, Fixed, Fixed),
635 {
636 Down(f)
637 }
638
639 /// Creates an event handler for up events.
640 ///
641 /// The event handler ignores all other events.
642 #[allow(dead_code)]
643 pub fn on_up<F>(f: F) -> Up<F>
644 where
645 F: Fn(&WlTouchRef, u32, u32, i32),
646 {
647 Up(f)
648 }
649
650 /// Creates an event handler for motion events.
651 ///
652 /// The event handler ignores all other events.
653 #[allow(dead_code)]
654 pub fn on_motion<F>(f: F) -> Motion<F>
655 where
656 F: Fn(&WlTouchRef, u32, i32, Fixed, Fixed),
657 {
658 Motion(f)
659 }
660
661 /// Creates an event handler for frame events.
662 ///
663 /// The event handler ignores all other events.
664 #[allow(dead_code)]
665 pub fn on_frame<F>(f: F) -> Frame<F>
666 where
667 F: Fn(&WlTouchRef),
668 {
669 Frame(f)
670 }
671
672 /// Creates an event handler for cancel events.
673 ///
674 /// The event handler ignores all other events.
675 #[allow(dead_code)]
676 pub fn on_cancel<F>(f: F) -> Cancel<F>
677 where
678 F: Fn(&WlTouchRef),
679 {
680 Cancel(f)
681 }
682
683 /// Creates an event handler for shape events.
684 ///
685 /// The event handler ignores all other events.
686 #[allow(dead_code)]
687 pub fn on_shape<F>(f: F) -> Shape<F>
688 where
689 F: Fn(&WlTouchRef, i32, Fixed, Fixed),
690 {
691 Shape(f)
692 }
693
694 /// Creates an event handler for orientation events.
695 ///
696 /// The event handler ignores all other events.
697 #[allow(dead_code)]
698 pub fn on_orientation<F>(f: F) -> Orientation<F>
699 where
700 F: Fn(&WlTouchRef, i32, Fixed),
701 {
702 Orientation(f)
703 }
704 }
705}