1
0
Fork 0
forked from wry/wry

wayland: add jay_pointer

This commit is contained in:
Julian Orth 2022-07-30 11:14:16 +02:00
parent 3e3bc38920
commit b3c20c5309
8 changed files with 115 additions and 4 deletions

View file

@ -13,6 +13,7 @@ use {
bstr::{BStr, BString, ByteSlice, ByteVec},
byteorder::{LittleEndian, ReadBytesExt},
isnt::std_1::primitive::IsntSliceExt,
num_derive::FromPrimitive,
std::{
cell::Cell,
convert::TryInto,
@ -56,6 +57,7 @@ pub trait Cursor {
pub struct ServerCursors {
pub default: ServerCursorTemplate,
pub pointer: ServerCursorTemplate,
pub resize_right: ServerCursorTemplate,
pub resize_left: ServerCursorTemplate,
pub resize_top: ServerCursorTemplate,
@ -68,9 +70,10 @@ pub struct ServerCursors {
pub resize_bottom_right: ServerCursorTemplate,
}
#[derive(Copy, Clone, Debug, Eq, PartialEq)]
#[derive(Copy, Clone, Debug, Eq, PartialEq, FromPrimitive)]
pub enum KnownCursor {
Default,
Pointer,
ResizeLeftRight,
ResizeTopBottom,
ResizeTopLeft,
@ -92,6 +95,7 @@ impl ServerCursors {
|name: &str| ServerCursorTemplate::load(name, None, &scales, &sizes, &paths, ctx);
Ok(Some(Self {
default: load("left_ptr")?,
pointer: load("hand2")?,
// default: load("left_ptr_watch")?,
resize_right: load("right_side")?,
resize_left: load("left_side")?,