autocommit 2022-02-14 21:47:35 CET
This commit is contained in:
parent
da6b29f138
commit
290225190a
11 changed files with 191 additions and 19 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use crate::_private::ipc::{InitMessage, Request, Response};
|
||||
use crate::_private::{bincode_ops, logging, Config, ConfigEntry, ConfigEntryGen, VERSION};
|
||||
use crate::{Direction, InputDevice, LogLevel, ModifiedKeySym, Seat};
|
||||
use crate::{Axis, Direction, InputDevice, LogLevel, ModifiedKeySym, Seat};
|
||||
use std::cell::{Cell, RefCell};
|
||||
use std::collections::hash_map::Entry;
|
||||
use std::collections::HashMap;
|
||||
|
|
@ -171,6 +171,21 @@ impl Client {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn split(&self, seat: Seat) -> Axis {
|
||||
let res = self.with_response(|| self.send(&Request::GetSplit { seat }));
|
||||
match res {
|
||||
Response::GetSplit { axis } => axis,
|
||||
_ => {
|
||||
log::error!("Server did not send a response to a get_split request");
|
||||
Axis::Horizontal
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
pub fn set_split(&self, seat: Seat, axis: Axis) {
|
||||
self.send(&Request::SetSplit { seat, axis });
|
||||
}
|
||||
|
||||
pub fn create_seat(&self, name: &str) -> Seat {
|
||||
let response = self.with_response(|| self.send(&Request::CreateSeat { name }));
|
||||
match response {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use crate::keyboard::mods::Modifiers;
|
||||
use crate::keyboard::syms::KeySym;
|
||||
use crate::{Direction, InputDevice, LogLevel, Seat};
|
||||
use crate::{Axis, Direction, InputDevice, LogLevel, Seat};
|
||||
use bincode::{BorrowDecode, Decode, Encode};
|
||||
use crate::keyboard::keymap::Keymap;
|
||||
|
||||
|
|
@ -38,6 +38,13 @@ pub enum Request<'a> {
|
|||
rate: i32,
|
||||
delay: i32,
|
||||
},
|
||||
GetSplit {
|
||||
seat: Seat,
|
||||
},
|
||||
SetSplit {
|
||||
seat: Seat,
|
||||
axis: Axis,
|
||||
},
|
||||
RemoveSeat {
|
||||
seat: Seat,
|
||||
},
|
||||
|
|
@ -81,6 +88,7 @@ pub enum Request<'a> {
|
|||
pub enum Response {
|
||||
None,
|
||||
GetSeats { seats: Vec<Seat> },
|
||||
GetSplit { axis: Axis },
|
||||
GetRepeatRate { rate: i32, delay: i32 },
|
||||
ParseKeymap { keymap: Keymap, },
|
||||
CreateSeat { seat: Seat },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue