all: add Linearize impls
This commit is contained in:
parent
89c8692c94
commit
60e9a33a57
3 changed files with 11 additions and 10 deletions
|
|
@ -268,7 +268,7 @@ pub trait InputDevice {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq)]
|
#[derive(Debug, Copy, Clone, Hash, Eq, PartialEq, Linearize)]
|
||||||
pub enum InputDeviceCapability {
|
pub enum InputDeviceCapability {
|
||||||
Keyboard,
|
Keyboard,
|
||||||
Pointer,
|
Pointer,
|
||||||
|
|
@ -308,7 +308,7 @@ impl InputDeviceCapability {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone, PartialEq, Linearize)]
|
||||||
pub enum InputDeviceAccelProfile {
|
pub enum InputDeviceAccelProfile {
|
||||||
Flat,
|
Flat,
|
||||||
Adaptive,
|
Adaptive,
|
||||||
|
|
@ -323,7 +323,7 @@ impl StaticText for InputDeviceAccelProfile {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone, PartialEq, Linearize)]
|
||||||
pub enum InputDeviceClickMethod {
|
pub enum InputDeviceClickMethod {
|
||||||
None,
|
None,
|
||||||
ButtonAreas,
|
ButtonAreas,
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
use {
|
use {
|
||||||
crate::{
|
crate::{
|
||||||
backend::{self, InputDeviceAccelProfile, InputDeviceClickMethod, InputDeviceId},
|
backend::{
|
||||||
|
InputDeviceAccelProfile, InputDeviceCapability, InputDeviceClickMethod, InputDeviceId,
|
||||||
|
},
|
||||||
client::{Client, ClientError},
|
client::{Client, ClientError},
|
||||||
clientmem::{ClientMem, ClientMemError},
|
clientmem::{ClientMem, ClientMemError},
|
||||||
ifs::wl_seat::WlSeatGlobal,
|
ifs::wl_seat::WlSeatGlobal,
|
||||||
|
|
@ -16,6 +18,8 @@ use {
|
||||||
utils::errorfmt::ErrorFmt,
|
utils::errorfmt::ErrorFmt,
|
||||||
wire::{JayInputId, jay_input::*},
|
wire::{JayInputId, jay_input::*},
|
||||||
},
|
},
|
||||||
|
arrayvec::ArrayVec,
|
||||||
|
linearize::{Linearize, LinearizeExt},
|
||||||
std::rc::Rc,
|
std::rc::Rc,
|
||||||
thiserror::Error,
|
thiserror::Error,
|
||||||
uapi::OwnedFd,
|
uapi::OwnedFd,
|
||||||
|
|
@ -84,11 +88,8 @@ impl JayInput {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn send_input_device(&self, data: &InputDeviceData) {
|
fn send_input_device(&self, data: &InputDeviceData) {
|
||||||
use backend::InputDeviceCapability::*;
|
let mut caps = ArrayVec::<_, { InputDeviceCapability::LENGTH }>::new();
|
||||||
let mut caps = vec![];
|
for cap in InputDeviceCapability::variants() {
|
||||||
for cap in [
|
|
||||||
Keyboard, Pointer, Touch, TabletTool, TabletPad, Gesture, Switch,
|
|
||||||
] {
|
|
||||||
if data.data.device.has_capability(cap) {
|
if data.data.device.has_capability(cap) {
|
||||||
caps.push(cap.to_libinput().raw());
|
caps.push(cap.to_libinput().raw());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -499,7 +499,7 @@ macro_rules! sizes {
|
||||||
)*
|
)*
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug)]
|
#[derive(Copy, Clone, Debug, Linearize)]
|
||||||
#[expect(non_camel_case_types)]
|
#[expect(non_camel_case_types)]
|
||||||
pub enum ThemeSized {
|
pub enum ThemeSized {
|
||||||
$(
|
$(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue