ltk/platform/wayland/
cursor.rsuse smithay_client_toolkit::reexports::protocols::wp::cursor_shape::v1::client::wp_cursor_shape_device_v1::Shape;
use crate::app::App;
use crate::types::CursorShape;
use super::WaylandPlatform;
pub( super ) fn set_shape<A: App>( platform: &WaylandPlatform<A>, shape: CursorShape ) -> bool
{
let Some( device ) = platform.cursor_shape_device.as_ref() else { return false };
device.set_shape( platform.last_pointer_enter_serial, wp_shape( shape ) );
true
}
fn wp_shape( shape: CursorShape ) -> Shape
{
use CursorShape as C;
match shape
{
C::Default => Shape::Default,
C::ContextMenu => Shape::ContextMenu,
C::Help => Shape::Help,
C::Pointer => Shape::Pointer,
C::Progress => Shape::Progress,
C::Wait => Shape::Wait,
C::Cell => Shape::Cell,
C::Crosshair => Shape::Crosshair,
C::Text => Shape::Text,
C::VerticalText => Shape::VerticalText,
C::Alias => Shape::Alias,
C::Copy => Shape::Copy,
C::Move => Shape::Move,
C::NoDrop => Shape::NoDrop,
C::NotAllowed => Shape::NotAllowed,
C::Grab => Shape::Grab,
C::Grabbing => Shape::Grabbing,
C::EResize => Shape::EResize,
C::NResize => Shape::NResize,
C::NeResize => Shape::NeResize,
C::NwResize => Shape::NwResize,
C::SResize => Shape::SResize,
C::SeResize => Shape::SeResize,
C::SwResize => Shape::SwResize,
C::WResize => Shape::WResize,
C::EwResize => Shape::EwResize,
C::NsResize => Shape::NsResize,
C::NeswResize => Shape::NeswResize,
C::NwseResize => Shape::NwseResize,
C::ColResize => Shape::ColResize,
C::RowResize => Shape::RowResize,
C::AllScroll => Shape::AllScroll,
C::ZoomIn => Shape::ZoomIn,
C::ZoomOut => Shape::ZoomOut,
}
}