| 1 | mod client; |
| 2 | mod clipboard; |
| 3 | mod cursor; |
| 4 | mod display; |
| 5 | mod serial; |
| 6 | mod window; |
| 7 | |
| 8 | pub(crate) use client::*; |
| 9 | |
| 10 | use wayland_protocols::wp::cursor_shape::v1::client::wp_cursor_shape_device_v1::Shape; |
| 11 | |
| 12 | use crate::CursorStyle; |
| 13 | |
| 14 | impl CursorStyle { |
| 15 | pub(super) fn to_shape(self) -> Shape { |
| 16 | match self { |
| 17 | CursorStyle::Arrow => Shape::Default, |
| 18 | CursorStyle::IBeam => Shape::Text, |
| 19 | CursorStyle::Crosshair => Shape::Crosshair, |
| 20 | CursorStyle::ClosedHand => Shape::Grabbing, |
| 21 | CursorStyle::OpenHand => Shape::Grab, |
| 22 | CursorStyle::PointingHand => Shape::Pointer, |
| 23 | CursorStyle::ResizeLeft => Shape::WResize, |
| 24 | CursorStyle::ResizeRight => Shape::EResize, |
| 25 | CursorStyle::ResizeLeftRight => Shape::EwResize, |
| 26 | CursorStyle::ResizeUp => Shape::NResize, |
| 27 | CursorStyle::ResizeDown => Shape::SResize, |
| 28 | CursorStyle::ResizeUpDown => Shape::NsResize, |
| 29 | CursorStyle::ResizeUpLeftDownRight => Shape::NwseResize, |
| 30 | CursorStyle::ResizeUpRightDownLeft => Shape::NeswResize, |
| 31 | CursorStyle::ResizeColumn => Shape::ColResize, |
| 32 | CursorStyle::ResizeRow => Shape::RowResize, |
| 33 | CursorStyle::IBeamCursorForVerticalLayout => Shape::VerticalText, |
| 34 | CursorStyle::OperationNotAllowed => Shape::NotAllowed, |
| 35 | CursorStyle::DragLink => Shape::Alias, |
| 36 | CursorStyle::DragCopy => Shape::Copy, |
| 37 | CursorStyle::ContextualMenu => Shape::ContextMenu, |
| 38 | CursorStyle::None => { |
| 39 | #[cfg(debug_assertions)] |
| 40 | panic!("CursorStyle::None should be handled separately in the client"); |
| 41 | #[cfg(not(debug_assertions))] |
| 42 | Shape::Default |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | } |