use crate::protocol_helpers::prelude::*;
use super::super::all_types::*;
pub struct RiverLibinputDeviceV1 {
core: ObjectCore,
handler: HandlerHolder<dyn RiverLibinputDeviceV1Handler>,
}
struct DefaultHandler;
impl RiverLibinputDeviceV1Handler for DefaultHandler { }
impl ConcreteObject for RiverLibinputDeviceV1 {
const XML_VERSION: u32 = 1;
const INTERFACE: ObjectInterface = ObjectInterface::RiverLibinputDeviceV1;
const INTERFACE_NAME: &str = "river_libinput_device_v1";
}
impl RiverLibinputDeviceV1 {
pub fn set_handler(&self, handler: impl RiverLibinputDeviceV1Handler) {
self.set_boxed_handler(Box::new(handler));
}
pub fn set_boxed_handler(&self, handler: Box<dyn RiverLibinputDeviceV1Handler>) {
if self.core.state.destroyed.get() {
return;
}
self.handler.set(Some(handler));
}
}
impl Debug for RiverLibinputDeviceV1 {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
f.debug_struct("RiverLibinputDeviceV1")
.field("server_obj_id", &self.core.server_obj_id.get())
.field("client_id", &self.core.client_id.get())
.field("client_obj_id", &self.core.client_obj_id.get())
.finish()
}
}
impl RiverLibinputDeviceV1 {
pub const MSG__DESTROY__SINCE: u32 = 1;
#[inline]
pub fn try_send_destroy(
&self,
) -> Result<(), ObjectError> {
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.destroy()\n", id);
state.log(args);
}
log(&self.core.state, id);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
0,
]);
self.core.handle_server_destroy();
Ok(())
}
#[inline]
pub fn send_destroy(
&self,
) {
let res = self.try_send_destroy(
);
if let Err(e) = res {
log_send("river_libinput_device_v1.destroy", &e);
}
}
pub const MSG__REMOVED__SINCE: u32 = 1;
#[inline]
pub fn try_send_removed(
&self,
) -> Result<(), ObjectError> {
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.removed()\n", client_id, id);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
0,
]);
Ok(())
}
#[inline]
pub fn send_removed(
&self,
) {
let res = self.try_send_removed(
);
if let Err(e) = res {
log_send("river_libinput_device_v1.removed", &e);
}
}
pub const MSG__INPUT_DEVICE__SINCE: u32 = 1;
#[inline]
pub fn try_send_input_device(
&self,
device: &Rc<RiverInputDeviceV1>,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
device,
);
let arg0 = arg0.core();
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
if arg0.client_id.get() != Some(client.endpoint.id) {
return Err(ObjectError(ObjectErrorKind::ArgNoClientId("device", client.endpoint.id)));
}
let arg0_id = arg0.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.input_device(device: river_input_device_v1#{})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0_id);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
1,
arg0_id,
]);
Ok(())
}
#[inline]
pub fn send_input_device(
&self,
device: &Rc<RiverInputDeviceV1>,
) {
let res = self.try_send_input_device(
device,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.input_device", &e);
}
}
pub const MSG__SEND_EVENTS_SUPPORT__SINCE: u32 = 1;
#[inline]
pub fn try_send_send_events_support(
&self,
modes: RiverLibinputDeviceV1SendEventsModes,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
modes,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1SendEventsModes) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.send_events_support(modes: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
2,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_send_events_support(
&self,
modes: RiverLibinputDeviceV1SendEventsModes,
) {
let res = self.try_send_send_events_support(
modes,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.send_events_support", &e);
}
}
pub const MSG__SEND_EVENTS_DEFAULT__SINCE: u32 = 1;
#[inline]
pub fn try_send_send_events_default(
&self,
mode: RiverLibinputDeviceV1SendEventsModes,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
mode,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1SendEventsModes) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.send_events_default(mode: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
3,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_send_events_default(
&self,
mode: RiverLibinputDeviceV1SendEventsModes,
) {
let res = self.try_send_send_events_default(
mode,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.send_events_default", &e);
}
}
pub const MSG__SEND_EVENTS_CURRENT__SINCE: u32 = 1;
#[inline]
pub fn try_send_send_events_current(
&self,
mode: RiverLibinputDeviceV1SendEventsModes,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
mode,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1SendEventsModes) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.send_events_current(mode: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
4,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_send_events_current(
&self,
mode: RiverLibinputDeviceV1SendEventsModes,
) {
let res = self.try_send_send_events_current(
mode,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.send_events_current", &e);
}
}
pub const MSG__SET_SEND_EVENTS__SINCE: u32 = 1;
#[inline]
pub fn try_send_set_send_events(
&self,
result: &Rc<RiverLibinputResultV1>,
mode: RiverLibinputDeviceV1SendEventsModes,
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
mode,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1SendEventsModes) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.set_send_events(result: river_libinput_result_v1#{}, mode: {:?})\n", id, arg0, arg1);
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
1,
arg0_id,
arg1.0,
]);
Ok(())
}
#[inline]
pub fn send_set_send_events(
&self,
result: &Rc<RiverLibinputResultV1>,
mode: RiverLibinputDeviceV1SendEventsModes,
) {
let res = self.try_send_set_send_events(
result,
mode,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.set_send_events", &e);
}
}
#[inline]
pub fn new_try_send_set_send_events(
&self,
mode: RiverLibinputDeviceV1SendEventsModes,
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_set_send_events(
&result,
mode,
)?;
Ok(result)
}
#[inline]
pub fn new_send_set_send_events(
&self,
mode: RiverLibinputDeviceV1SendEventsModes,
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_set_send_events(
&result,
mode,
);
result
}
pub const MSG__TAP_SUPPORT__SINCE: u32 = 1;
#[inline]
pub fn try_send_tap_support(
&self,
finger_count: i32,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
finger_count,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: i32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.tap_support(finger_count: {})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
5,
arg0 as u32,
]);
Ok(())
}
#[inline]
pub fn send_tap_support(
&self,
finger_count: i32,
) {
let res = self.try_send_tap_support(
finger_count,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.tap_support", &e);
}
}
pub const MSG__TAP_DEFAULT__SINCE: u32 = 1;
#[inline]
pub fn try_send_tap_default(
&self,
state: RiverLibinputDeviceV1TapState,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
state,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1TapState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.tap_default(state: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
6,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_tap_default(
&self,
state: RiverLibinputDeviceV1TapState,
) {
let res = self.try_send_tap_default(
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.tap_default", &e);
}
}
pub const MSG__TAP_CURRENT__SINCE: u32 = 1;
#[inline]
pub fn try_send_tap_current(
&self,
state: RiverLibinputDeviceV1TapState,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
state,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1TapState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.tap_current(state: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
7,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_tap_current(
&self,
state: RiverLibinputDeviceV1TapState,
) {
let res = self.try_send_tap_current(
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.tap_current", &e);
}
}
pub const MSG__SET_TAP__SINCE: u32 = 1;
#[inline]
pub fn try_send_set_tap(
&self,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1TapState,
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
state,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1TapState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.set_tap(result: river_libinput_result_v1#{}, state: {:?})\n", id, arg0, arg1);
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
2,
arg0_id,
arg1.0,
]);
Ok(())
}
#[inline]
pub fn send_set_tap(
&self,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1TapState,
) {
let res = self.try_send_set_tap(
result,
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.set_tap", &e);
}
}
#[inline]
pub fn new_try_send_set_tap(
&self,
state: RiverLibinputDeviceV1TapState,
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_set_tap(
&result,
state,
)?;
Ok(result)
}
#[inline]
pub fn new_send_set_tap(
&self,
state: RiverLibinputDeviceV1TapState,
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_set_tap(
&result,
state,
);
result
}
pub const MSG__TAP_BUTTON_MAP_DEFAULT__SINCE: u32 = 1;
#[inline]
pub fn try_send_tap_button_map_default(
&self,
button_map: RiverLibinputDeviceV1TapButtonMap,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
button_map,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1TapButtonMap) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.tap_button_map_default(button_map: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
8,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_tap_button_map_default(
&self,
button_map: RiverLibinputDeviceV1TapButtonMap,
) {
let res = self.try_send_tap_button_map_default(
button_map,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.tap_button_map_default", &e);
}
}
pub const MSG__TAP_BUTTON_MAP_CURRENT__SINCE: u32 = 1;
#[inline]
pub fn try_send_tap_button_map_current(
&self,
button_map: RiverLibinputDeviceV1TapButtonMap,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
button_map,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1TapButtonMap) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.tap_button_map_current(button_map: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
9,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_tap_button_map_current(
&self,
button_map: RiverLibinputDeviceV1TapButtonMap,
) {
let res = self.try_send_tap_button_map_current(
button_map,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.tap_button_map_current", &e);
}
}
pub const MSG__SET_TAP_BUTTON_MAP__SINCE: u32 = 1;
#[inline]
pub fn try_send_set_tap_button_map(
&self,
result: &Rc<RiverLibinputResultV1>,
button_map: RiverLibinputDeviceV1TapButtonMap,
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
button_map,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1TapButtonMap) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.set_tap_button_map(result: river_libinput_result_v1#{}, button_map: {:?})\n", id, arg0, arg1);
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
3,
arg0_id,
arg1.0,
]);
Ok(())
}
#[inline]
pub fn send_set_tap_button_map(
&self,
result: &Rc<RiverLibinputResultV1>,
button_map: RiverLibinputDeviceV1TapButtonMap,
) {
let res = self.try_send_set_tap_button_map(
result,
button_map,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.set_tap_button_map", &e);
}
}
#[inline]
pub fn new_try_send_set_tap_button_map(
&self,
button_map: RiverLibinputDeviceV1TapButtonMap,
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_set_tap_button_map(
&result,
button_map,
)?;
Ok(result)
}
#[inline]
pub fn new_send_set_tap_button_map(
&self,
button_map: RiverLibinputDeviceV1TapButtonMap,
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_set_tap_button_map(
&result,
button_map,
);
result
}
pub const MSG__DRAG_DEFAULT__SINCE: u32 = 1;
#[inline]
pub fn try_send_drag_default(
&self,
state: RiverLibinputDeviceV1DragState,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
state,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1DragState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.drag_default(state: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
10,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_drag_default(
&self,
state: RiverLibinputDeviceV1DragState,
) {
let res = self.try_send_drag_default(
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.drag_default", &e);
}
}
pub const MSG__DRAG_CURRENT__SINCE: u32 = 1;
#[inline]
pub fn try_send_drag_current(
&self,
state: RiverLibinputDeviceV1DragState,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
state,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1DragState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.drag_current(state: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
11,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_drag_current(
&self,
state: RiverLibinputDeviceV1DragState,
) {
let res = self.try_send_drag_current(
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.drag_current", &e);
}
}
pub const MSG__SET_DRAG__SINCE: u32 = 1;
#[inline]
pub fn try_send_set_drag(
&self,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1DragState,
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
state,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1DragState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.set_drag(result: river_libinput_result_v1#{}, state: {:?})\n", id, arg0, arg1);
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
4,
arg0_id,
arg1.0,
]);
Ok(())
}
#[inline]
pub fn send_set_drag(
&self,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1DragState,
) {
let res = self.try_send_set_drag(
result,
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.set_drag", &e);
}
}
#[inline]
pub fn new_try_send_set_drag(
&self,
state: RiverLibinputDeviceV1DragState,
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_set_drag(
&result,
state,
)?;
Ok(result)
}
#[inline]
pub fn new_send_set_drag(
&self,
state: RiverLibinputDeviceV1DragState,
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_set_drag(
&result,
state,
);
result
}
pub const MSG__DRAG_LOCK_DEFAULT__SINCE: u32 = 1;
#[inline]
pub fn try_send_drag_lock_default(
&self,
state: RiverLibinputDeviceV1DragLockState,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
state,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1DragLockState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.drag_lock_default(state: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
12,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_drag_lock_default(
&self,
state: RiverLibinputDeviceV1DragLockState,
) {
let res = self.try_send_drag_lock_default(
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.drag_lock_default", &e);
}
}
pub const MSG__DRAG_LOCK_CURRENT__SINCE: u32 = 1;
#[inline]
pub fn try_send_drag_lock_current(
&self,
state: RiverLibinputDeviceV1DragLockState,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
state,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1DragLockState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.drag_lock_current(state: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
13,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_drag_lock_current(
&self,
state: RiverLibinputDeviceV1DragLockState,
) {
let res = self.try_send_drag_lock_current(
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.drag_lock_current", &e);
}
}
pub const MSG__SET_DRAG_LOCK__SINCE: u32 = 1;
#[inline]
pub fn try_send_set_drag_lock(
&self,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1DragLockState,
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
state,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1DragLockState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.set_drag_lock(result: river_libinput_result_v1#{}, state: {:?})\n", id, arg0, arg1);
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
5,
arg0_id,
arg1.0,
]);
Ok(())
}
#[inline]
pub fn send_set_drag_lock(
&self,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1DragLockState,
) {
let res = self.try_send_set_drag_lock(
result,
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.set_drag_lock", &e);
}
}
#[inline]
pub fn new_try_send_set_drag_lock(
&self,
state: RiverLibinputDeviceV1DragLockState,
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_set_drag_lock(
&result,
state,
)?;
Ok(result)
}
#[inline]
pub fn new_send_set_drag_lock(
&self,
state: RiverLibinputDeviceV1DragLockState,
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_set_drag_lock(
&result,
state,
);
result
}
pub const MSG__THREE_FINGER_DRAG_SUPPORT__SINCE: u32 = 1;
#[inline]
pub fn try_send_three_finger_drag_support(
&self,
finger_count: i32,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
finger_count,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: i32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.three_finger_drag_support(finger_count: {})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
14,
arg0 as u32,
]);
Ok(())
}
#[inline]
pub fn send_three_finger_drag_support(
&self,
finger_count: i32,
) {
let res = self.try_send_three_finger_drag_support(
finger_count,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.three_finger_drag_support", &e);
}
}
pub const MSG__THREE_FINGER_DRAG_DEFAULT__SINCE: u32 = 1;
#[inline]
pub fn try_send_three_finger_drag_default(
&self,
state: RiverLibinputDeviceV1ThreeFingerDragState,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
state,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1ThreeFingerDragState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.three_finger_drag_default(state: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
15,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_three_finger_drag_default(
&self,
state: RiverLibinputDeviceV1ThreeFingerDragState,
) {
let res = self.try_send_three_finger_drag_default(
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.three_finger_drag_default", &e);
}
}
pub const MSG__THREE_FINGER_DRAG_CURRENT__SINCE: u32 = 1;
#[inline]
pub fn try_send_three_finger_drag_current(
&self,
state: RiverLibinputDeviceV1ThreeFingerDragState,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
state,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1ThreeFingerDragState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.three_finger_drag_current(state: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
16,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_three_finger_drag_current(
&self,
state: RiverLibinputDeviceV1ThreeFingerDragState,
) {
let res = self.try_send_three_finger_drag_current(
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.three_finger_drag_current", &e);
}
}
pub const MSG__SET_THREE_FINGER_DRAG__SINCE: u32 = 1;
#[inline]
pub fn try_send_set_three_finger_drag(
&self,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1ThreeFingerDragState,
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
state,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1ThreeFingerDragState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.set_three_finger_drag(result: river_libinput_result_v1#{}, state: {:?})\n", id, arg0, arg1);
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
6,
arg0_id,
arg1.0,
]);
Ok(())
}
#[inline]
pub fn send_set_three_finger_drag(
&self,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1ThreeFingerDragState,
) {
let res = self.try_send_set_three_finger_drag(
result,
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.set_three_finger_drag", &e);
}
}
#[inline]
pub fn new_try_send_set_three_finger_drag(
&self,
state: RiverLibinputDeviceV1ThreeFingerDragState,
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_set_three_finger_drag(
&result,
state,
)?;
Ok(result)
}
#[inline]
pub fn new_send_set_three_finger_drag(
&self,
state: RiverLibinputDeviceV1ThreeFingerDragState,
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_set_three_finger_drag(
&result,
state,
);
result
}
pub const MSG__CALIBRATION_MATRIX_SUPPORT__SINCE: u32 = 1;
#[inline]
pub fn try_send_calibration_matrix_support(
&self,
supported: i32,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
supported,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: i32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.calibration_matrix_support(supported: {})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
17,
arg0 as u32,
]);
Ok(())
}
#[inline]
pub fn send_calibration_matrix_support(
&self,
supported: i32,
) {
let res = self.try_send_calibration_matrix_support(
supported,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.calibration_matrix_support", &e);
}
}
pub const MSG__CALIBRATION_MATRIX_DEFAULT__SINCE: u32 = 1;
#[inline]
pub fn try_send_calibration_matrix_default(
&self,
matrix: &[u8],
) -> Result<(), ObjectError> {
let (
arg0,
) = (
matrix,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: &[u8]) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.calibration_matrix_default(matrix: {})\n", client_id, id, debug_array(arg0));
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
18,
]);
fmt.array(arg0);
Ok(())
}
#[inline]
pub fn send_calibration_matrix_default(
&self,
matrix: &[u8],
) {
let res = self.try_send_calibration_matrix_default(
matrix,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.calibration_matrix_default", &e);
}
}
pub const MSG__CALIBRATION_MATRIX_CURRENT__SINCE: u32 = 1;
#[inline]
pub fn try_send_calibration_matrix_current(
&self,
matrix: &[u8],
) -> Result<(), ObjectError> {
let (
arg0,
) = (
matrix,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: &[u8]) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.calibration_matrix_current(matrix: {})\n", client_id, id, debug_array(arg0));
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
19,
]);
fmt.array(arg0);
Ok(())
}
#[inline]
pub fn send_calibration_matrix_current(
&self,
matrix: &[u8],
) {
let res = self.try_send_calibration_matrix_current(
matrix,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.calibration_matrix_current", &e);
}
}
pub const MSG__SET_CALIBRATION_MATRIX__SINCE: u32 = 1;
#[inline]
pub fn try_send_set_calibration_matrix(
&self,
result: &Rc<RiverLibinputResultV1>,
matrix: &[u8],
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
matrix,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: &[u8]) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.set_calibration_matrix(result: river_libinput_result_v1#{}, matrix: {})\n", id, arg0, debug_array(arg1));
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
7,
arg0_id,
]);
fmt.array(arg1);
Ok(())
}
#[inline]
pub fn send_set_calibration_matrix(
&self,
result: &Rc<RiverLibinputResultV1>,
matrix: &[u8],
) {
let res = self.try_send_set_calibration_matrix(
result,
matrix,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.set_calibration_matrix", &e);
}
}
#[inline]
pub fn new_try_send_set_calibration_matrix(
&self,
matrix: &[u8],
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_set_calibration_matrix(
&result,
matrix,
)?;
Ok(result)
}
#[inline]
pub fn new_send_set_calibration_matrix(
&self,
matrix: &[u8],
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_set_calibration_matrix(
&result,
matrix,
);
result
}
pub const MSG__ACCEL_PROFILES_SUPPORT__SINCE: u32 = 1;
#[inline]
pub fn try_send_accel_profiles_support(
&self,
profiles: RiverLibinputDeviceV1AccelProfiles,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
profiles,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1AccelProfiles) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.accel_profiles_support(profiles: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
20,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_accel_profiles_support(
&self,
profiles: RiverLibinputDeviceV1AccelProfiles,
) {
let res = self.try_send_accel_profiles_support(
profiles,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.accel_profiles_support", &e);
}
}
pub const MSG__ACCEL_PROFILE_DEFAULT__SINCE: u32 = 1;
#[inline]
pub fn try_send_accel_profile_default(
&self,
profile: RiverLibinputDeviceV1AccelProfile,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
profile,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1AccelProfile) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.accel_profile_default(profile: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
21,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_accel_profile_default(
&self,
profile: RiverLibinputDeviceV1AccelProfile,
) {
let res = self.try_send_accel_profile_default(
profile,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.accel_profile_default", &e);
}
}
pub const MSG__ACCEL_PROFILE_CURRENT__SINCE: u32 = 1;
#[inline]
pub fn try_send_accel_profile_current(
&self,
profile: RiverLibinputDeviceV1AccelProfile,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
profile,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1AccelProfile) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.accel_profile_current(profile: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
22,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_accel_profile_current(
&self,
profile: RiverLibinputDeviceV1AccelProfile,
) {
let res = self.try_send_accel_profile_current(
profile,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.accel_profile_current", &e);
}
}
pub const MSG__SET_ACCEL_PROFILE__SINCE: u32 = 1;
#[inline]
pub fn try_send_set_accel_profile(
&self,
result: &Rc<RiverLibinputResultV1>,
profile: RiverLibinputDeviceV1AccelProfile,
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
profile,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1AccelProfile) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.set_accel_profile(result: river_libinput_result_v1#{}, profile: {:?})\n", id, arg0, arg1);
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
8,
arg0_id,
arg1.0,
]);
Ok(())
}
#[inline]
pub fn send_set_accel_profile(
&self,
result: &Rc<RiverLibinputResultV1>,
profile: RiverLibinputDeviceV1AccelProfile,
) {
let res = self.try_send_set_accel_profile(
result,
profile,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.set_accel_profile", &e);
}
}
#[inline]
pub fn new_try_send_set_accel_profile(
&self,
profile: RiverLibinputDeviceV1AccelProfile,
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_set_accel_profile(
&result,
profile,
)?;
Ok(result)
}
#[inline]
pub fn new_send_set_accel_profile(
&self,
profile: RiverLibinputDeviceV1AccelProfile,
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_set_accel_profile(
&result,
profile,
);
result
}
pub const MSG__ACCEL_SPEED_DEFAULT__SINCE: u32 = 1;
#[inline]
pub fn try_send_accel_speed_default(
&self,
speed: &[u8],
) -> Result<(), ObjectError> {
let (
arg0,
) = (
speed,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: &[u8]) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.accel_speed_default(speed: {})\n", client_id, id, debug_array(arg0));
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
23,
]);
fmt.array(arg0);
Ok(())
}
#[inline]
pub fn send_accel_speed_default(
&self,
speed: &[u8],
) {
let res = self.try_send_accel_speed_default(
speed,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.accel_speed_default", &e);
}
}
pub const MSG__ACCEL_SPEED_CURRENT__SINCE: u32 = 1;
#[inline]
pub fn try_send_accel_speed_current(
&self,
speed: &[u8],
) -> Result<(), ObjectError> {
let (
arg0,
) = (
speed,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: &[u8]) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.accel_speed_current(speed: {})\n", client_id, id, debug_array(arg0));
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
24,
]);
fmt.array(arg0);
Ok(())
}
#[inline]
pub fn send_accel_speed_current(
&self,
speed: &[u8],
) {
let res = self.try_send_accel_speed_current(
speed,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.accel_speed_current", &e);
}
}
pub const MSG__SET_ACCEL_SPEED__SINCE: u32 = 1;
#[inline]
pub fn try_send_set_accel_speed(
&self,
result: &Rc<RiverLibinputResultV1>,
speed: &[u8],
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
speed,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: &[u8]) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.set_accel_speed(result: river_libinput_result_v1#{}, speed: {})\n", id, arg0, debug_array(arg1));
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
9,
arg0_id,
]);
fmt.array(arg1);
Ok(())
}
#[inline]
pub fn send_set_accel_speed(
&self,
result: &Rc<RiverLibinputResultV1>,
speed: &[u8],
) {
let res = self.try_send_set_accel_speed(
result,
speed,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.set_accel_speed", &e);
}
}
#[inline]
pub fn new_try_send_set_accel_speed(
&self,
speed: &[u8],
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_set_accel_speed(
&result,
speed,
)?;
Ok(result)
}
#[inline]
pub fn new_send_set_accel_speed(
&self,
speed: &[u8],
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_set_accel_speed(
&result,
speed,
);
result
}
pub const MSG__APPLY_ACCEL_CONFIG__SINCE: u32 = 1;
#[inline]
pub fn try_send_apply_accel_config(
&self,
result: &Rc<RiverLibinputResultV1>,
config: &Rc<RiverLibinputAccelConfigV1>,
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
config,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let arg1 = arg1.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
let arg1_id = match arg1.server_obj_id.get() {
None => return Err(ObjectError(ObjectErrorKind::ArgNoServerId("config"))),
Some(id) => id,
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: u32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.apply_accel_config(result: river_libinput_result_v1#{}, config: river_libinput_accel_config_v1#{})\n", id, arg0, arg1);
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1_id);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
10,
arg0_id,
arg1_id,
]);
Ok(())
}
#[inline]
pub fn send_apply_accel_config(
&self,
result: &Rc<RiverLibinputResultV1>,
config: &Rc<RiverLibinputAccelConfigV1>,
) {
let res = self.try_send_apply_accel_config(
result,
config,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.apply_accel_config", &e);
}
}
#[inline]
pub fn new_try_send_apply_accel_config(
&self,
config: &Rc<RiverLibinputAccelConfigV1>,
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_apply_accel_config(
&result,
config,
)?;
Ok(result)
}
#[inline]
pub fn new_send_apply_accel_config(
&self,
config: &Rc<RiverLibinputAccelConfigV1>,
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_apply_accel_config(
&result,
config,
);
result
}
pub const MSG__NATURAL_SCROLL_SUPPORT__SINCE: u32 = 1;
#[inline]
pub fn try_send_natural_scroll_support(
&self,
supported: i32,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
supported,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: i32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.natural_scroll_support(supported: {})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
25,
arg0 as u32,
]);
Ok(())
}
#[inline]
pub fn send_natural_scroll_support(
&self,
supported: i32,
) {
let res = self.try_send_natural_scroll_support(
supported,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.natural_scroll_support", &e);
}
}
pub const MSG__NATURAL_SCROLL_DEFAULT__SINCE: u32 = 1;
#[inline]
pub fn try_send_natural_scroll_default(
&self,
state: RiverLibinputDeviceV1NaturalScrollState,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
state,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1NaturalScrollState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.natural_scroll_default(state: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
26,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_natural_scroll_default(
&self,
state: RiverLibinputDeviceV1NaturalScrollState,
) {
let res = self.try_send_natural_scroll_default(
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.natural_scroll_default", &e);
}
}
pub const MSG__NATURAL_SCROLL_CURRENT__SINCE: u32 = 1;
#[inline]
pub fn try_send_natural_scroll_current(
&self,
state: RiverLibinputDeviceV1NaturalScrollState,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
state,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1NaturalScrollState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.natural_scroll_current(state: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
27,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_natural_scroll_current(
&self,
state: RiverLibinputDeviceV1NaturalScrollState,
) {
let res = self.try_send_natural_scroll_current(
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.natural_scroll_current", &e);
}
}
pub const MSG__SET_NATURAL_SCROLL__SINCE: u32 = 1;
#[inline]
pub fn try_send_set_natural_scroll(
&self,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1NaturalScrollState,
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
state,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1NaturalScrollState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.set_natural_scroll(result: river_libinput_result_v1#{}, state: {:?})\n", id, arg0, arg1);
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
11,
arg0_id,
arg1.0,
]);
Ok(())
}
#[inline]
pub fn send_set_natural_scroll(
&self,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1NaturalScrollState,
) {
let res = self.try_send_set_natural_scroll(
result,
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.set_natural_scroll", &e);
}
}
#[inline]
pub fn new_try_send_set_natural_scroll(
&self,
state: RiverLibinputDeviceV1NaturalScrollState,
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_set_natural_scroll(
&result,
state,
)?;
Ok(result)
}
#[inline]
pub fn new_send_set_natural_scroll(
&self,
state: RiverLibinputDeviceV1NaturalScrollState,
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_set_natural_scroll(
&result,
state,
);
result
}
pub const MSG__LEFT_HANDED_SUPPORT__SINCE: u32 = 1;
#[inline]
pub fn try_send_left_handed_support(
&self,
supported: i32,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
supported,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: i32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.left_handed_support(supported: {})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
28,
arg0 as u32,
]);
Ok(())
}
#[inline]
pub fn send_left_handed_support(
&self,
supported: i32,
) {
let res = self.try_send_left_handed_support(
supported,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.left_handed_support", &e);
}
}
pub const MSG__LEFT_HANDED_DEFAULT__SINCE: u32 = 1;
#[inline]
pub fn try_send_left_handed_default(
&self,
state: RiverLibinputDeviceV1LeftHandedState,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
state,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1LeftHandedState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.left_handed_default(state: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
29,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_left_handed_default(
&self,
state: RiverLibinputDeviceV1LeftHandedState,
) {
let res = self.try_send_left_handed_default(
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.left_handed_default", &e);
}
}
pub const MSG__LEFT_HANDED_CURRENT__SINCE: u32 = 1;
#[inline]
pub fn try_send_left_handed_current(
&self,
state: RiverLibinputDeviceV1LeftHandedState,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
state,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1LeftHandedState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.left_handed_current(state: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
30,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_left_handed_current(
&self,
state: RiverLibinputDeviceV1LeftHandedState,
) {
let res = self.try_send_left_handed_current(
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.left_handed_current", &e);
}
}
pub const MSG__SET_LEFT_HANDED__SINCE: u32 = 1;
#[inline]
pub fn try_send_set_left_handed(
&self,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1LeftHandedState,
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
state,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1LeftHandedState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.set_left_handed(result: river_libinput_result_v1#{}, state: {:?})\n", id, arg0, arg1);
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
12,
arg0_id,
arg1.0,
]);
Ok(())
}
#[inline]
pub fn send_set_left_handed(
&self,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1LeftHandedState,
) {
let res = self.try_send_set_left_handed(
result,
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.set_left_handed", &e);
}
}
#[inline]
pub fn new_try_send_set_left_handed(
&self,
state: RiverLibinputDeviceV1LeftHandedState,
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_set_left_handed(
&result,
state,
)?;
Ok(result)
}
#[inline]
pub fn new_send_set_left_handed(
&self,
state: RiverLibinputDeviceV1LeftHandedState,
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_set_left_handed(
&result,
state,
);
result
}
pub const MSG__CLICK_METHOD_SUPPORT__SINCE: u32 = 1;
#[inline]
pub fn try_send_click_method_support(
&self,
methods: RiverLibinputDeviceV1ClickMethods,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
methods,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1ClickMethods) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.click_method_support(methods: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
31,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_click_method_support(
&self,
methods: RiverLibinputDeviceV1ClickMethods,
) {
let res = self.try_send_click_method_support(
methods,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.click_method_support", &e);
}
}
pub const MSG__CLICK_METHOD_DEFAULT__SINCE: u32 = 1;
#[inline]
pub fn try_send_click_method_default(
&self,
method: RiverLibinputDeviceV1ClickMethod,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
method,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1ClickMethod) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.click_method_default(method: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
32,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_click_method_default(
&self,
method: RiverLibinputDeviceV1ClickMethod,
) {
let res = self.try_send_click_method_default(
method,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.click_method_default", &e);
}
}
pub const MSG__CLICK_METHOD_CURRENT__SINCE: u32 = 1;
#[inline]
pub fn try_send_click_method_current(
&self,
method: RiverLibinputDeviceV1ClickMethod,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
method,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1ClickMethod) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.click_method_current(method: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
33,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_click_method_current(
&self,
method: RiverLibinputDeviceV1ClickMethod,
) {
let res = self.try_send_click_method_current(
method,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.click_method_current", &e);
}
}
pub const MSG__SET_CLICK_METHOD__SINCE: u32 = 1;
#[inline]
pub fn try_send_set_click_method(
&self,
result: &Rc<RiverLibinputResultV1>,
method: RiverLibinputDeviceV1ClickMethod,
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
method,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1ClickMethod) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.set_click_method(result: river_libinput_result_v1#{}, method: {:?})\n", id, arg0, arg1);
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
13,
arg0_id,
arg1.0,
]);
Ok(())
}
#[inline]
pub fn send_set_click_method(
&self,
result: &Rc<RiverLibinputResultV1>,
method: RiverLibinputDeviceV1ClickMethod,
) {
let res = self.try_send_set_click_method(
result,
method,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.set_click_method", &e);
}
}
#[inline]
pub fn new_try_send_set_click_method(
&self,
method: RiverLibinputDeviceV1ClickMethod,
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_set_click_method(
&result,
method,
)?;
Ok(result)
}
#[inline]
pub fn new_send_set_click_method(
&self,
method: RiverLibinputDeviceV1ClickMethod,
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_set_click_method(
&result,
method,
);
result
}
pub const MSG__CLICKFINGER_BUTTON_MAP_DEFAULT__SINCE: u32 = 1;
#[inline]
pub fn try_send_clickfinger_button_map_default(
&self,
button_map: RiverLibinputDeviceV1ClickfingerButtonMap,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
button_map,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1ClickfingerButtonMap) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.clickfinger_button_map_default(button_map: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
34,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_clickfinger_button_map_default(
&self,
button_map: RiverLibinputDeviceV1ClickfingerButtonMap,
) {
let res = self.try_send_clickfinger_button_map_default(
button_map,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.clickfinger_button_map_default", &e);
}
}
pub const MSG__CLICKFINGER_BUTTON_MAP_CURRENT__SINCE: u32 = 1;
#[inline]
pub fn try_send_clickfinger_button_map_current(
&self,
button_map: RiverLibinputDeviceV1ClickfingerButtonMap,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
button_map,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1ClickfingerButtonMap) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.clickfinger_button_map_current(button_map: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
35,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_clickfinger_button_map_current(
&self,
button_map: RiverLibinputDeviceV1ClickfingerButtonMap,
) {
let res = self.try_send_clickfinger_button_map_current(
button_map,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.clickfinger_button_map_current", &e);
}
}
pub const MSG__SET_CLICKFINGER_BUTTON_MAP__SINCE: u32 = 1;
#[inline]
pub fn try_send_set_clickfinger_button_map(
&self,
result: &Rc<RiverLibinputResultV1>,
button_map: RiverLibinputDeviceV1ClickfingerButtonMap,
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
button_map,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1ClickfingerButtonMap) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.set_clickfinger_button_map(result: river_libinput_result_v1#{}, button_map: {:?})\n", id, arg0, arg1);
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
14,
arg0_id,
arg1.0,
]);
Ok(())
}
#[inline]
pub fn send_set_clickfinger_button_map(
&self,
result: &Rc<RiverLibinputResultV1>,
button_map: RiverLibinputDeviceV1ClickfingerButtonMap,
) {
let res = self.try_send_set_clickfinger_button_map(
result,
button_map,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.set_clickfinger_button_map", &e);
}
}
#[inline]
pub fn new_try_send_set_clickfinger_button_map(
&self,
button_map: RiverLibinputDeviceV1ClickfingerButtonMap,
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_set_clickfinger_button_map(
&result,
button_map,
)?;
Ok(result)
}
#[inline]
pub fn new_send_set_clickfinger_button_map(
&self,
button_map: RiverLibinputDeviceV1ClickfingerButtonMap,
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_set_clickfinger_button_map(
&result,
button_map,
);
result
}
pub const MSG__MIDDLE_EMULATION_SUPPORT__SINCE: u32 = 1;
#[inline]
pub fn try_send_middle_emulation_support(
&self,
supported: i32,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
supported,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: i32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.middle_emulation_support(supported: {})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
36,
arg0 as u32,
]);
Ok(())
}
#[inline]
pub fn send_middle_emulation_support(
&self,
supported: i32,
) {
let res = self.try_send_middle_emulation_support(
supported,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.middle_emulation_support", &e);
}
}
pub const MSG__MIDDLE_EMULATION_DEFAULT__SINCE: u32 = 1;
#[inline]
pub fn try_send_middle_emulation_default(
&self,
state: RiverLibinputDeviceV1MiddleEmulationState,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
state,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1MiddleEmulationState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.middle_emulation_default(state: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
37,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_middle_emulation_default(
&self,
state: RiverLibinputDeviceV1MiddleEmulationState,
) {
let res = self.try_send_middle_emulation_default(
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.middle_emulation_default", &e);
}
}
pub const MSG__MIDDLE_EMULATION_CURRENT__SINCE: u32 = 1;
#[inline]
pub fn try_send_middle_emulation_current(
&self,
state: RiverLibinputDeviceV1MiddleEmulationState,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
state,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1MiddleEmulationState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.middle_emulation_current(state: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
38,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_middle_emulation_current(
&self,
state: RiverLibinputDeviceV1MiddleEmulationState,
) {
let res = self.try_send_middle_emulation_current(
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.middle_emulation_current", &e);
}
}
pub const MSG__SET_MIDDLE_EMULATION__SINCE: u32 = 1;
#[inline]
pub fn try_send_set_middle_emulation(
&self,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1MiddleEmulationState,
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
state,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1MiddleEmulationState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.set_middle_emulation(result: river_libinput_result_v1#{}, state: {:?})\n", id, arg0, arg1);
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
15,
arg0_id,
arg1.0,
]);
Ok(())
}
#[inline]
pub fn send_set_middle_emulation(
&self,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1MiddleEmulationState,
) {
let res = self.try_send_set_middle_emulation(
result,
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.set_middle_emulation", &e);
}
}
#[inline]
pub fn new_try_send_set_middle_emulation(
&self,
state: RiverLibinputDeviceV1MiddleEmulationState,
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_set_middle_emulation(
&result,
state,
)?;
Ok(result)
}
#[inline]
pub fn new_send_set_middle_emulation(
&self,
state: RiverLibinputDeviceV1MiddleEmulationState,
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_set_middle_emulation(
&result,
state,
);
result
}
pub const MSG__SCROLL_METHOD_SUPPORT__SINCE: u32 = 1;
#[inline]
pub fn try_send_scroll_method_support(
&self,
methods: RiverLibinputDeviceV1ScrollMethods,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
methods,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1ScrollMethods) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.scroll_method_support(methods: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
39,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_scroll_method_support(
&self,
methods: RiverLibinputDeviceV1ScrollMethods,
) {
let res = self.try_send_scroll_method_support(
methods,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.scroll_method_support", &e);
}
}
pub const MSG__SCROLL_METHOD_DEFAULT__SINCE: u32 = 1;
#[inline]
pub fn try_send_scroll_method_default(
&self,
method: RiverLibinputDeviceV1ScrollMethod,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
method,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1ScrollMethod) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.scroll_method_default(method: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
40,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_scroll_method_default(
&self,
method: RiverLibinputDeviceV1ScrollMethod,
) {
let res = self.try_send_scroll_method_default(
method,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.scroll_method_default", &e);
}
}
pub const MSG__SCROLL_METHOD_CURRENT__SINCE: u32 = 1;
#[inline]
pub fn try_send_scroll_method_current(
&self,
method: RiverLibinputDeviceV1ScrollMethod,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
method,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1ScrollMethod) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.scroll_method_current(method: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
41,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_scroll_method_current(
&self,
method: RiverLibinputDeviceV1ScrollMethod,
) {
let res = self.try_send_scroll_method_current(
method,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.scroll_method_current", &e);
}
}
pub const MSG__SET_SCROLL_METHOD__SINCE: u32 = 1;
#[inline]
pub fn try_send_set_scroll_method(
&self,
result: &Rc<RiverLibinputResultV1>,
method: RiverLibinputDeviceV1ScrollMethod,
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
method,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1ScrollMethod) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.set_scroll_method(result: river_libinput_result_v1#{}, method: {:?})\n", id, arg0, arg1);
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
16,
arg0_id,
arg1.0,
]);
Ok(())
}
#[inline]
pub fn send_set_scroll_method(
&self,
result: &Rc<RiverLibinputResultV1>,
method: RiverLibinputDeviceV1ScrollMethod,
) {
let res = self.try_send_set_scroll_method(
result,
method,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.set_scroll_method", &e);
}
}
#[inline]
pub fn new_try_send_set_scroll_method(
&self,
method: RiverLibinputDeviceV1ScrollMethod,
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_set_scroll_method(
&result,
method,
)?;
Ok(result)
}
#[inline]
pub fn new_send_set_scroll_method(
&self,
method: RiverLibinputDeviceV1ScrollMethod,
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_set_scroll_method(
&result,
method,
);
result
}
pub const MSG__SCROLL_BUTTON_DEFAULT__SINCE: u32 = 1;
#[inline]
pub fn try_send_scroll_button_default(
&self,
button: u32,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
button,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.scroll_button_default(button: {})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
42,
arg0,
]);
Ok(())
}
#[inline]
pub fn send_scroll_button_default(
&self,
button: u32,
) {
let res = self.try_send_scroll_button_default(
button,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.scroll_button_default", &e);
}
}
pub const MSG__SCROLL_BUTTON_CURRENT__SINCE: u32 = 1;
#[inline]
pub fn try_send_scroll_button_current(
&self,
button: u32,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
button,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.scroll_button_current(button: {})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
43,
arg0,
]);
Ok(())
}
#[inline]
pub fn send_scroll_button_current(
&self,
button: u32,
) {
let res = self.try_send_scroll_button_current(
button,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.scroll_button_current", &e);
}
}
pub const MSG__SET_SCROLL_BUTTON__SINCE: u32 = 1;
#[inline]
pub fn try_send_set_scroll_button(
&self,
result: &Rc<RiverLibinputResultV1>,
button: u32,
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
button,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: u32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.set_scroll_button(result: river_libinput_result_v1#{}, button: {})\n", id, arg0, arg1);
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
17,
arg0_id,
arg1,
]);
Ok(())
}
#[inline]
pub fn send_set_scroll_button(
&self,
result: &Rc<RiverLibinputResultV1>,
button: u32,
) {
let res = self.try_send_set_scroll_button(
result,
button,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.set_scroll_button", &e);
}
}
#[inline]
pub fn new_try_send_set_scroll_button(
&self,
button: u32,
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_set_scroll_button(
&result,
button,
)?;
Ok(result)
}
#[inline]
pub fn new_send_set_scroll_button(
&self,
button: u32,
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_set_scroll_button(
&result,
button,
);
result
}
pub const MSG__SCROLL_BUTTON_LOCK_DEFAULT__SINCE: u32 = 1;
#[inline]
pub fn try_send_scroll_button_lock_default(
&self,
state: RiverLibinputDeviceV1ScrollButtonLockState,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
state,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1ScrollButtonLockState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.scroll_button_lock_default(state: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
44,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_scroll_button_lock_default(
&self,
state: RiverLibinputDeviceV1ScrollButtonLockState,
) {
let res = self.try_send_scroll_button_lock_default(
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.scroll_button_lock_default", &e);
}
}
pub const MSG__SCROLL_BUTTON_LOCK_CURRENT__SINCE: u32 = 1;
#[inline]
pub fn try_send_scroll_button_lock_current(
&self,
state: RiverLibinputDeviceV1ScrollButtonLockState,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
state,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1ScrollButtonLockState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.scroll_button_lock_current(state: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
45,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_scroll_button_lock_current(
&self,
state: RiverLibinputDeviceV1ScrollButtonLockState,
) {
let res = self.try_send_scroll_button_lock_current(
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.scroll_button_lock_current", &e);
}
}
pub const MSG__SET_SCROLL_BUTTON_LOCK__SINCE: u32 = 1;
#[inline]
pub fn try_send_set_scroll_button_lock(
&self,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1ScrollButtonLockState,
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
state,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1ScrollButtonLockState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.set_scroll_button_lock(result: river_libinput_result_v1#{}, state: {:?})\n", id, arg0, arg1);
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
18,
arg0_id,
arg1.0,
]);
Ok(())
}
#[inline]
pub fn send_set_scroll_button_lock(
&self,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1ScrollButtonLockState,
) {
let res = self.try_send_set_scroll_button_lock(
result,
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.set_scroll_button_lock", &e);
}
}
#[inline]
pub fn new_try_send_set_scroll_button_lock(
&self,
state: RiverLibinputDeviceV1ScrollButtonLockState,
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_set_scroll_button_lock(
&result,
state,
)?;
Ok(result)
}
#[inline]
pub fn new_send_set_scroll_button_lock(
&self,
state: RiverLibinputDeviceV1ScrollButtonLockState,
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_set_scroll_button_lock(
&result,
state,
);
result
}
pub const MSG__DWT_SUPPORT__SINCE: u32 = 1;
#[inline]
pub fn try_send_dwt_support(
&self,
supported: i32,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
supported,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: i32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.dwt_support(supported: {})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
46,
arg0 as u32,
]);
Ok(())
}
#[inline]
pub fn send_dwt_support(
&self,
supported: i32,
) {
let res = self.try_send_dwt_support(
supported,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.dwt_support", &e);
}
}
pub const MSG__DWT_DEFAULT__SINCE: u32 = 1;
#[inline]
pub fn try_send_dwt_default(
&self,
state: RiverLibinputDeviceV1DwtState,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
state,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1DwtState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.dwt_default(state: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
47,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_dwt_default(
&self,
state: RiverLibinputDeviceV1DwtState,
) {
let res = self.try_send_dwt_default(
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.dwt_default", &e);
}
}
pub const MSG__DWT_CURRENT__SINCE: u32 = 1;
#[inline]
pub fn try_send_dwt_current(
&self,
state: RiverLibinputDeviceV1DwtState,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
state,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1DwtState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.dwt_current(state: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
48,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_dwt_current(
&self,
state: RiverLibinputDeviceV1DwtState,
) {
let res = self.try_send_dwt_current(
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.dwt_current", &e);
}
}
pub const MSG__SET_DWT__SINCE: u32 = 1;
#[inline]
pub fn try_send_set_dwt(
&self,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1DwtState,
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
state,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1DwtState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.set_dwt(result: river_libinput_result_v1#{}, state: {:?})\n", id, arg0, arg1);
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
19,
arg0_id,
arg1.0,
]);
Ok(())
}
#[inline]
pub fn send_set_dwt(
&self,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1DwtState,
) {
let res = self.try_send_set_dwt(
result,
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.set_dwt", &e);
}
}
#[inline]
pub fn new_try_send_set_dwt(
&self,
state: RiverLibinputDeviceV1DwtState,
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_set_dwt(
&result,
state,
)?;
Ok(result)
}
#[inline]
pub fn new_send_set_dwt(
&self,
state: RiverLibinputDeviceV1DwtState,
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_set_dwt(
&result,
state,
);
result
}
pub const MSG__DWTP_SUPPORT__SINCE: u32 = 1;
#[inline]
pub fn try_send_dwtp_support(
&self,
supported: i32,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
supported,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: i32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.dwtp_support(supported: {})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
49,
arg0 as u32,
]);
Ok(())
}
#[inline]
pub fn send_dwtp_support(
&self,
supported: i32,
) {
let res = self.try_send_dwtp_support(
supported,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.dwtp_support", &e);
}
}
pub const MSG__DWTP_DEFAULT__SINCE: u32 = 1;
#[inline]
pub fn try_send_dwtp_default(
&self,
state: RiverLibinputDeviceV1DwtpState,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
state,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1DwtpState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.dwtp_default(state: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
50,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_dwtp_default(
&self,
state: RiverLibinputDeviceV1DwtpState,
) {
let res = self.try_send_dwtp_default(
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.dwtp_default", &e);
}
}
pub const MSG__DWTP_CURRENT__SINCE: u32 = 1;
#[inline]
pub fn try_send_dwtp_current(
&self,
state: RiverLibinputDeviceV1DwtpState,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
state,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: RiverLibinputDeviceV1DwtpState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.dwtp_current(state: {:?})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
51,
arg0.0,
]);
Ok(())
}
#[inline]
pub fn send_dwtp_current(
&self,
state: RiverLibinputDeviceV1DwtpState,
) {
let res = self.try_send_dwtp_current(
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.dwtp_current", &e);
}
}
pub const MSG__SET_DWTP__SINCE: u32 = 1;
#[inline]
pub fn try_send_set_dwtp(
&self,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1DwtpState,
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
state,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1DwtpState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.set_dwtp(result: river_libinput_result_v1#{}, state: {:?})\n", id, arg0, arg1);
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
20,
arg0_id,
arg1.0,
]);
Ok(())
}
#[inline]
pub fn send_set_dwtp(
&self,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1DwtpState,
) {
let res = self.try_send_set_dwtp(
result,
state,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.set_dwtp", &e);
}
}
#[inline]
pub fn new_try_send_set_dwtp(
&self,
state: RiverLibinputDeviceV1DwtpState,
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_set_dwtp(
&result,
state,
)?;
Ok(result)
}
#[inline]
pub fn new_send_set_dwtp(
&self,
state: RiverLibinputDeviceV1DwtpState,
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_set_dwtp(
&result,
state,
);
result
}
pub const MSG__ROTATION_SUPPORT__SINCE: u32 = 1;
#[inline]
pub fn try_send_rotation_support(
&self,
supported: i32,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
supported,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: i32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.rotation_support(supported: {})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
52,
arg0 as u32,
]);
Ok(())
}
#[inline]
pub fn send_rotation_support(
&self,
supported: i32,
) {
let res = self.try_send_rotation_support(
supported,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.rotation_support", &e);
}
}
pub const MSG__ROTATION_DEFAULT__SINCE: u32 = 1;
#[inline]
pub fn try_send_rotation_default(
&self,
angle: u32,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
angle,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.rotation_default(angle: {})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
53,
arg0,
]);
Ok(())
}
#[inline]
pub fn send_rotation_default(
&self,
angle: u32,
) {
let res = self.try_send_rotation_default(
angle,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.rotation_default", &e);
}
}
pub const MSG__ROTATION_CURRENT__SINCE: u32 = 1;
#[inline]
pub fn try_send_rotation_current(
&self,
angle: u32,
) -> Result<(), ObjectError> {
let (
arg0,
) = (
angle,
);
let core = self.core();
let client_ref = core.client.borrow();
let Some(client) = &*client_ref else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoClient));
};
let id = core.client_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} <= river_libinput_device_v1#{}.rotation_current(angle: {})\n", client_id, id, arg0);
state.log(args);
}
log(&self.core.state, client.endpoint.id, id, arg0);
}
let endpoint = &client.endpoint;
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, Some(client));
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
54,
arg0,
]);
Ok(())
}
#[inline]
pub fn send_rotation_current(
&self,
angle: u32,
) {
let res = self.try_send_rotation_current(
angle,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.rotation_current", &e);
}
}
pub const MSG__SET_ROTATION__SINCE: u32 = 1;
#[inline]
pub fn try_send_set_rotation(
&self,
result: &Rc<RiverLibinputResultV1>,
angle: u32,
) -> Result<(), ObjectError> {
let (
arg0,
arg1,
) = (
result,
angle,
);
let arg0_obj = arg0;
let arg0 = arg0_obj.core();
let core = self.core();
let Some(id) = core.server_obj_id.get() else {
return Err(ObjectError(ObjectErrorKind::ReceiverNoServerId));
};
arg0.generate_server_id(arg0_obj.clone())
.map_err(|e| ObjectError(ObjectErrorKind::GenerateServerId("result", e)))?;
let arg0_id = arg0.server_obj_id.get().unwrap_or(0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32, arg1: u32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server <= river_libinput_device_v1#{}.set_rotation(result: river_libinput_result_v1#{}, angle: {})\n", id, arg0, arg1);
state.log(args);
}
log(&self.core.state, id, arg0_id, arg1);
}
let Some(endpoint) = &self.core.state.server else {
return Ok(());
};
if !endpoint.flush_queued.replace(true) {
self.core.state.add_flushable_endpoint(endpoint, None);
}
let mut outgoing_ref = endpoint.outgoing.borrow_mut();
let outgoing = &mut *outgoing_ref;
let mut fmt = outgoing.formatter();
fmt.words([
id,
21,
arg0_id,
arg1,
]);
Ok(())
}
#[inline]
pub fn send_set_rotation(
&self,
result: &Rc<RiverLibinputResultV1>,
angle: u32,
) {
let res = self.try_send_set_rotation(
result,
angle,
);
if let Err(e) = res {
log_send("river_libinput_device_v1.set_rotation", &e);
}
}
#[inline]
pub fn new_try_send_set_rotation(
&self,
angle: u32,
) -> Result<Rc<RiverLibinputResultV1>, ObjectError> {
let result = self.core.create_child();
self.try_send_set_rotation(
&result,
angle,
)?;
Ok(result)
}
#[inline]
pub fn new_send_set_rotation(
&self,
angle: u32,
) -> Rc<RiverLibinputResultV1> {
let result = self.core.create_child();
self.send_set_rotation(
&result,
angle,
);
result
}
}
pub trait RiverLibinputDeviceV1Handler: Any {
#[inline]
fn delete_id(&mut self, slf: &Rc<RiverLibinputDeviceV1>) {
slf.core.delete_id();
}
#[inline]
fn handle_destroy(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_destroy(
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.destroy", &e);
}
}
#[inline]
fn handle_removed(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_removed(
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.removed", &e);
}
}
#[inline]
fn handle_input_device(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
device: &Rc<RiverInputDeviceV1>,
) {
if !slf.core.forward_to_client.get() {
return;
}
if let Some(client_id) = slf.core.client_id.get() {
if let Some(client_id_2) = device.core().client_id.get() {
if client_id != client_id_2 {
return;
}
}
}
let res = slf.try_send_input_device(
device,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.input_device", &e);
}
}
#[inline]
fn handle_send_events_support(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
modes: RiverLibinputDeviceV1SendEventsModes,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_send_events_support(
modes,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.send_events_support", &e);
}
}
#[inline]
fn handle_send_events_default(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
mode: RiverLibinputDeviceV1SendEventsModes,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_send_events_default(
mode,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.send_events_default", &e);
}
}
#[inline]
fn handle_send_events_current(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
mode: RiverLibinputDeviceV1SendEventsModes,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_send_events_current(
mode,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.send_events_current", &e);
}
}
#[inline]
fn handle_set_send_events(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
mode: RiverLibinputDeviceV1SendEventsModes,
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_set_send_events(
result,
mode,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.set_send_events", &e);
}
}
#[inline]
fn handle_tap_support(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
finger_count: i32,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_tap_support(
finger_count,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.tap_support", &e);
}
}
#[inline]
fn handle_tap_default(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
state: RiverLibinputDeviceV1TapState,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_tap_default(
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.tap_default", &e);
}
}
#[inline]
fn handle_tap_current(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
state: RiverLibinputDeviceV1TapState,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_tap_current(
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.tap_current", &e);
}
}
#[inline]
fn handle_set_tap(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1TapState,
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_set_tap(
result,
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.set_tap", &e);
}
}
#[inline]
fn handle_tap_button_map_default(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
button_map: RiverLibinputDeviceV1TapButtonMap,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_tap_button_map_default(
button_map,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.tap_button_map_default", &e);
}
}
#[inline]
fn handle_tap_button_map_current(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
button_map: RiverLibinputDeviceV1TapButtonMap,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_tap_button_map_current(
button_map,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.tap_button_map_current", &e);
}
}
#[inline]
fn handle_set_tap_button_map(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
button_map: RiverLibinputDeviceV1TapButtonMap,
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_set_tap_button_map(
result,
button_map,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.set_tap_button_map", &e);
}
}
#[inline]
fn handle_drag_default(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
state: RiverLibinputDeviceV1DragState,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_drag_default(
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.drag_default", &e);
}
}
#[inline]
fn handle_drag_current(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
state: RiverLibinputDeviceV1DragState,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_drag_current(
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.drag_current", &e);
}
}
#[inline]
fn handle_set_drag(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1DragState,
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_set_drag(
result,
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.set_drag", &e);
}
}
#[inline]
fn handle_drag_lock_default(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
state: RiverLibinputDeviceV1DragLockState,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_drag_lock_default(
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.drag_lock_default", &e);
}
}
#[inline]
fn handle_drag_lock_current(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
state: RiverLibinputDeviceV1DragLockState,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_drag_lock_current(
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.drag_lock_current", &e);
}
}
#[inline]
fn handle_set_drag_lock(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1DragLockState,
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_set_drag_lock(
result,
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.set_drag_lock", &e);
}
}
#[inline]
fn handle_three_finger_drag_support(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
finger_count: i32,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_three_finger_drag_support(
finger_count,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.three_finger_drag_support", &e);
}
}
#[inline]
fn handle_three_finger_drag_default(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
state: RiverLibinputDeviceV1ThreeFingerDragState,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_three_finger_drag_default(
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.three_finger_drag_default", &e);
}
}
#[inline]
fn handle_three_finger_drag_current(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
state: RiverLibinputDeviceV1ThreeFingerDragState,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_three_finger_drag_current(
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.three_finger_drag_current", &e);
}
}
#[inline]
fn handle_set_three_finger_drag(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1ThreeFingerDragState,
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_set_three_finger_drag(
result,
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.set_three_finger_drag", &e);
}
}
#[inline]
fn handle_calibration_matrix_support(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
supported: i32,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_calibration_matrix_support(
supported,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.calibration_matrix_support", &e);
}
}
#[inline]
fn handle_calibration_matrix_default(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
matrix: &[u8],
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_calibration_matrix_default(
matrix,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.calibration_matrix_default", &e);
}
}
#[inline]
fn handle_calibration_matrix_current(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
matrix: &[u8],
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_calibration_matrix_current(
matrix,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.calibration_matrix_current", &e);
}
}
#[inline]
fn handle_set_calibration_matrix(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
matrix: &[u8],
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_set_calibration_matrix(
result,
matrix,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.set_calibration_matrix", &e);
}
}
#[inline]
fn handle_accel_profiles_support(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
profiles: RiverLibinputDeviceV1AccelProfiles,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_accel_profiles_support(
profiles,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.accel_profiles_support", &e);
}
}
#[inline]
fn handle_accel_profile_default(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
profile: RiverLibinputDeviceV1AccelProfile,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_accel_profile_default(
profile,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.accel_profile_default", &e);
}
}
#[inline]
fn handle_accel_profile_current(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
profile: RiverLibinputDeviceV1AccelProfile,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_accel_profile_current(
profile,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.accel_profile_current", &e);
}
}
#[inline]
fn handle_set_accel_profile(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
profile: RiverLibinputDeviceV1AccelProfile,
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_set_accel_profile(
result,
profile,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.set_accel_profile", &e);
}
}
#[inline]
fn handle_accel_speed_default(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
speed: &[u8],
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_accel_speed_default(
speed,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.accel_speed_default", &e);
}
}
#[inline]
fn handle_accel_speed_current(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
speed: &[u8],
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_accel_speed_current(
speed,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.accel_speed_current", &e);
}
}
#[inline]
fn handle_set_accel_speed(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
speed: &[u8],
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_set_accel_speed(
result,
speed,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.set_accel_speed", &e);
}
}
#[inline]
fn handle_apply_accel_config(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
config: &Rc<RiverLibinputAccelConfigV1>,
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_apply_accel_config(
result,
config,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.apply_accel_config", &e);
}
}
#[inline]
fn handle_natural_scroll_support(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
supported: i32,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_natural_scroll_support(
supported,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.natural_scroll_support", &e);
}
}
#[inline]
fn handle_natural_scroll_default(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
state: RiverLibinputDeviceV1NaturalScrollState,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_natural_scroll_default(
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.natural_scroll_default", &e);
}
}
#[inline]
fn handle_natural_scroll_current(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
state: RiverLibinputDeviceV1NaturalScrollState,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_natural_scroll_current(
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.natural_scroll_current", &e);
}
}
#[inline]
fn handle_set_natural_scroll(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1NaturalScrollState,
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_set_natural_scroll(
result,
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.set_natural_scroll", &e);
}
}
#[inline]
fn handle_left_handed_support(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
supported: i32,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_left_handed_support(
supported,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.left_handed_support", &e);
}
}
#[inline]
fn handle_left_handed_default(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
state: RiverLibinputDeviceV1LeftHandedState,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_left_handed_default(
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.left_handed_default", &e);
}
}
#[inline]
fn handle_left_handed_current(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
state: RiverLibinputDeviceV1LeftHandedState,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_left_handed_current(
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.left_handed_current", &e);
}
}
#[inline]
fn handle_set_left_handed(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1LeftHandedState,
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_set_left_handed(
result,
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.set_left_handed", &e);
}
}
#[inline]
fn handle_click_method_support(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
methods: RiverLibinputDeviceV1ClickMethods,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_click_method_support(
methods,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.click_method_support", &e);
}
}
#[inline]
fn handle_click_method_default(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
method: RiverLibinputDeviceV1ClickMethod,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_click_method_default(
method,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.click_method_default", &e);
}
}
#[inline]
fn handle_click_method_current(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
method: RiverLibinputDeviceV1ClickMethod,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_click_method_current(
method,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.click_method_current", &e);
}
}
#[inline]
fn handle_set_click_method(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
method: RiverLibinputDeviceV1ClickMethod,
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_set_click_method(
result,
method,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.set_click_method", &e);
}
}
#[inline]
fn handle_clickfinger_button_map_default(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
button_map: RiverLibinputDeviceV1ClickfingerButtonMap,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_clickfinger_button_map_default(
button_map,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.clickfinger_button_map_default", &e);
}
}
#[inline]
fn handle_clickfinger_button_map_current(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
button_map: RiverLibinputDeviceV1ClickfingerButtonMap,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_clickfinger_button_map_current(
button_map,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.clickfinger_button_map_current", &e);
}
}
#[inline]
fn handle_set_clickfinger_button_map(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
button_map: RiverLibinputDeviceV1ClickfingerButtonMap,
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_set_clickfinger_button_map(
result,
button_map,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.set_clickfinger_button_map", &e);
}
}
#[inline]
fn handle_middle_emulation_support(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
supported: i32,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_middle_emulation_support(
supported,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.middle_emulation_support", &e);
}
}
#[inline]
fn handle_middle_emulation_default(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
state: RiverLibinputDeviceV1MiddleEmulationState,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_middle_emulation_default(
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.middle_emulation_default", &e);
}
}
#[inline]
fn handle_middle_emulation_current(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
state: RiverLibinputDeviceV1MiddleEmulationState,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_middle_emulation_current(
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.middle_emulation_current", &e);
}
}
#[inline]
fn handle_set_middle_emulation(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1MiddleEmulationState,
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_set_middle_emulation(
result,
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.set_middle_emulation", &e);
}
}
#[inline]
fn handle_scroll_method_support(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
methods: RiverLibinputDeviceV1ScrollMethods,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_scroll_method_support(
methods,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.scroll_method_support", &e);
}
}
#[inline]
fn handle_scroll_method_default(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
method: RiverLibinputDeviceV1ScrollMethod,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_scroll_method_default(
method,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.scroll_method_default", &e);
}
}
#[inline]
fn handle_scroll_method_current(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
method: RiverLibinputDeviceV1ScrollMethod,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_scroll_method_current(
method,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.scroll_method_current", &e);
}
}
#[inline]
fn handle_set_scroll_method(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
method: RiverLibinputDeviceV1ScrollMethod,
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_set_scroll_method(
result,
method,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.set_scroll_method", &e);
}
}
#[inline]
fn handle_scroll_button_default(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
button: u32,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_scroll_button_default(
button,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.scroll_button_default", &e);
}
}
#[inline]
fn handle_scroll_button_current(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
button: u32,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_scroll_button_current(
button,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.scroll_button_current", &e);
}
}
#[inline]
fn handle_set_scroll_button(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
button: u32,
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_set_scroll_button(
result,
button,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.set_scroll_button", &e);
}
}
#[inline]
fn handle_scroll_button_lock_default(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
state: RiverLibinputDeviceV1ScrollButtonLockState,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_scroll_button_lock_default(
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.scroll_button_lock_default", &e);
}
}
#[inline]
fn handle_scroll_button_lock_current(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
state: RiverLibinputDeviceV1ScrollButtonLockState,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_scroll_button_lock_current(
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.scroll_button_lock_current", &e);
}
}
#[inline]
fn handle_set_scroll_button_lock(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1ScrollButtonLockState,
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_set_scroll_button_lock(
result,
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.set_scroll_button_lock", &e);
}
}
#[inline]
fn handle_dwt_support(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
supported: i32,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_dwt_support(
supported,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.dwt_support", &e);
}
}
#[inline]
fn handle_dwt_default(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
state: RiverLibinputDeviceV1DwtState,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_dwt_default(
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.dwt_default", &e);
}
}
#[inline]
fn handle_dwt_current(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
state: RiverLibinputDeviceV1DwtState,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_dwt_current(
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.dwt_current", &e);
}
}
#[inline]
fn handle_set_dwt(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1DwtState,
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_set_dwt(
result,
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.set_dwt", &e);
}
}
#[inline]
fn handle_dwtp_support(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
supported: i32,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_dwtp_support(
supported,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.dwtp_support", &e);
}
}
#[inline]
fn handle_dwtp_default(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
state: RiverLibinputDeviceV1DwtpState,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_dwtp_default(
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.dwtp_default", &e);
}
}
#[inline]
fn handle_dwtp_current(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
state: RiverLibinputDeviceV1DwtpState,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_dwtp_current(
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.dwtp_current", &e);
}
}
#[inline]
fn handle_set_dwtp(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
state: RiverLibinputDeviceV1DwtpState,
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_set_dwtp(
result,
state,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.set_dwtp", &e);
}
}
#[inline]
fn handle_rotation_support(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
supported: i32,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_rotation_support(
supported,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.rotation_support", &e);
}
}
#[inline]
fn handle_rotation_default(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
angle: u32,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_rotation_default(
angle,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.rotation_default", &e);
}
}
#[inline]
fn handle_rotation_current(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
angle: u32,
) {
if !slf.core.forward_to_client.get() {
return;
}
let res = slf.try_send_rotation_current(
angle,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.rotation_current", &e);
}
}
#[inline]
fn handle_set_rotation(
&mut self,
slf: &Rc<RiverLibinputDeviceV1>,
result: &Rc<RiverLibinputResultV1>,
angle: u32,
) {
if !slf.core.forward_to_server.get() {
return;
}
let res = slf.try_send_set_rotation(
result,
angle,
);
if let Err(e) = res {
log_forward("river_libinput_device_v1.set_rotation", &e);
}
}
}
impl ObjectPrivate for RiverLibinputDeviceV1 {
fn new(state: &Rc<State>, version: u32) -> Rc<Self> {
Rc::<Self>::new_cyclic(|slf| Self {
core: ObjectCore::new(state, slf.clone(), ObjectInterface::RiverLibinputDeviceV1, version),
handler: Default::default(),
})
}
fn delete_id(self: Rc<Self>) -> Result<(), (ObjectError, Rc<dyn Object>)> {
let Some(mut handler) = self.handler.try_borrow_mut() else {
return Err((ObjectError(ObjectErrorKind::HandlerBorrowed), self));
};
if let Some(handler) = &mut *handler {
handler.delete_id(&self);
} else {
self.core.delete_id();
}
Ok(())
}
fn handle_request(self: Rc<Self>, client: &Rc<Client>, msg: &[u32], fds: &mut VecDeque<Rc<OwnedFd>>) -> Result<(), ObjectError> {
let Some(mut handler) = self.handler.try_borrow_mut() else {
return Err(ObjectError(ObjectErrorKind::HandlerBorrowed));
};
let handler = &mut *handler;
match msg[1] & 0xffff {
0 => {
if msg.len() != 2 {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 8)));
}
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.destroy()\n", client_id, id);
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0]);
}
self.core.handle_client_destroy();
if let Some(handler) = handler {
(**handler).handle_destroy(&self);
} else {
DefaultHandler.handle_destroy(&self);
}
}
1 => {
let [
arg0,
arg1,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 16)));
};
let arg1 = RiverLibinputDeviceV1SendEventsModes(arg1);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1SendEventsModes) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.set_send_events(result: river_libinput_result_v1#{}, mode: {:?})\n", client_id, id, arg0, arg1);
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_set_send_events(&self, arg0, arg1);
} else {
DefaultHandler.handle_set_send_events(&self, arg0, arg1);
}
}
2 => {
let [
arg0,
arg1,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 16)));
};
let arg1 = RiverLibinputDeviceV1TapState(arg1);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1TapState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.set_tap(result: river_libinput_result_v1#{}, state: {:?})\n", client_id, id, arg0, arg1);
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_set_tap(&self, arg0, arg1);
} else {
DefaultHandler.handle_set_tap(&self, arg0, arg1);
}
}
3 => {
let [
arg0,
arg1,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 16)));
};
let arg1 = RiverLibinputDeviceV1TapButtonMap(arg1);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1TapButtonMap) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.set_tap_button_map(result: river_libinput_result_v1#{}, button_map: {:?})\n", client_id, id, arg0, arg1);
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_set_tap_button_map(&self, arg0, arg1);
} else {
DefaultHandler.handle_set_tap_button_map(&self, arg0, arg1);
}
}
4 => {
let [
arg0,
arg1,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 16)));
};
let arg1 = RiverLibinputDeviceV1DragState(arg1);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1DragState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.set_drag(result: river_libinput_result_v1#{}, state: {:?})\n", client_id, id, arg0, arg1);
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_set_drag(&self, arg0, arg1);
} else {
DefaultHandler.handle_set_drag(&self, arg0, arg1);
}
}
5 => {
let [
arg0,
arg1,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 16)));
};
let arg1 = RiverLibinputDeviceV1DragLockState(arg1);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1DragLockState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.set_drag_lock(result: river_libinput_result_v1#{}, state: {:?})\n", client_id, id, arg0, arg1);
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_set_drag_lock(&self, arg0, arg1);
} else {
DefaultHandler.handle_set_drag_lock(&self, arg0, arg1);
}
}
6 => {
let [
arg0,
arg1,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 16)));
};
let arg1 = RiverLibinputDeviceV1ThreeFingerDragState(arg1);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1ThreeFingerDragState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.set_three_finger_drag(result: river_libinput_result_v1#{}, state: {:?})\n", client_id, id, arg0, arg1);
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_set_three_finger_drag(&self, arg0, arg1);
} else {
DefaultHandler.handle_set_three_finger_drag(&self, arg0, arg1);
}
}
7 => {
let mut offset = 2;
let Some(&arg0) = msg.get(offset) else {
return Err(ObjectError(ObjectErrorKind::MissingArgument("result")));
};
offset += 1;
let arg1;
(arg1, offset) = parse_array(msg, offset, "matrix")?;
if offset != msg.len() {
return Err(ObjectError(ObjectErrorKind::TrailingBytes));
}
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: &[u8]) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.set_calibration_matrix(result: river_libinput_result_v1#{}, matrix: {})\n", client_id, id, arg0, debug_array(arg1));
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_set_calibration_matrix(&self, arg0, arg1);
} else {
DefaultHandler.handle_set_calibration_matrix(&self, arg0, arg1);
}
}
8 => {
let [
arg0,
arg1,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 16)));
};
let arg1 = RiverLibinputDeviceV1AccelProfile(arg1);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1AccelProfile) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.set_accel_profile(result: river_libinput_result_v1#{}, profile: {:?})\n", client_id, id, arg0, arg1);
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_set_accel_profile(&self, arg0, arg1);
} else {
DefaultHandler.handle_set_accel_profile(&self, arg0, arg1);
}
}
9 => {
let mut offset = 2;
let Some(&arg0) = msg.get(offset) else {
return Err(ObjectError(ObjectErrorKind::MissingArgument("result")));
};
offset += 1;
let arg1;
(arg1, offset) = parse_array(msg, offset, "speed")?;
if offset != msg.len() {
return Err(ObjectError(ObjectErrorKind::TrailingBytes));
}
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: &[u8]) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.set_accel_speed(result: river_libinput_result_v1#{}, speed: {})\n", client_id, id, arg0, debug_array(arg1));
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_set_accel_speed(&self, arg0, arg1);
} else {
DefaultHandler.handle_set_accel_speed(&self, arg0, arg1);
}
}
10 => {
let [
arg0,
arg1,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 16)));
};
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: u32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.apply_accel_config(result: river_libinput_result_v1#{}, config: river_libinput_accel_config_v1#{})\n", client_id, id, arg0, arg1);
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg1_id = arg1;
let Some(arg1) = client.endpoint.lookup(arg1_id) else {
return Err(ObjectError(ObjectErrorKind::NoClientObject(client.endpoint.id, arg1_id)));
};
let Ok(arg1) = (arg1 as Rc<dyn Any>).downcast::<RiverLibinputAccelConfigV1>() else {
let o = client.endpoint.lookup(arg1_id).unwrap();
return Err(ObjectError(ObjectErrorKind::WrongObjectType("config", o.core().interface, ObjectInterface::RiverLibinputAccelConfigV1)));
};
let arg0 = &arg0;
let arg1 = &arg1;
if let Some(handler) = handler {
(**handler).handle_apply_accel_config(&self, arg0, arg1);
} else {
DefaultHandler.handle_apply_accel_config(&self, arg0, arg1);
}
}
11 => {
let [
arg0,
arg1,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 16)));
};
let arg1 = RiverLibinputDeviceV1NaturalScrollState(arg1);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1NaturalScrollState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.set_natural_scroll(result: river_libinput_result_v1#{}, state: {:?})\n", client_id, id, arg0, arg1);
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_set_natural_scroll(&self, arg0, arg1);
} else {
DefaultHandler.handle_set_natural_scroll(&self, arg0, arg1);
}
}
12 => {
let [
arg0,
arg1,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 16)));
};
let arg1 = RiverLibinputDeviceV1LeftHandedState(arg1);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1LeftHandedState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.set_left_handed(result: river_libinput_result_v1#{}, state: {:?})\n", client_id, id, arg0, arg1);
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_set_left_handed(&self, arg0, arg1);
} else {
DefaultHandler.handle_set_left_handed(&self, arg0, arg1);
}
}
13 => {
let [
arg0,
arg1,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 16)));
};
let arg1 = RiverLibinputDeviceV1ClickMethod(arg1);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1ClickMethod) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.set_click_method(result: river_libinput_result_v1#{}, method: {:?})\n", client_id, id, arg0, arg1);
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_set_click_method(&self, arg0, arg1);
} else {
DefaultHandler.handle_set_click_method(&self, arg0, arg1);
}
}
14 => {
let [
arg0,
arg1,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 16)));
};
let arg1 = RiverLibinputDeviceV1ClickfingerButtonMap(arg1);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1ClickfingerButtonMap) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.set_clickfinger_button_map(result: river_libinput_result_v1#{}, button_map: {:?})\n", client_id, id, arg0, arg1);
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_set_clickfinger_button_map(&self, arg0, arg1);
} else {
DefaultHandler.handle_set_clickfinger_button_map(&self, arg0, arg1);
}
}
15 => {
let [
arg0,
arg1,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 16)));
};
let arg1 = RiverLibinputDeviceV1MiddleEmulationState(arg1);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1MiddleEmulationState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.set_middle_emulation(result: river_libinput_result_v1#{}, state: {:?})\n", client_id, id, arg0, arg1);
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_set_middle_emulation(&self, arg0, arg1);
} else {
DefaultHandler.handle_set_middle_emulation(&self, arg0, arg1);
}
}
16 => {
let [
arg0,
arg1,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 16)));
};
let arg1 = RiverLibinputDeviceV1ScrollMethod(arg1);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1ScrollMethod) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.set_scroll_method(result: river_libinput_result_v1#{}, method: {:?})\n", client_id, id, arg0, arg1);
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_set_scroll_method(&self, arg0, arg1);
} else {
DefaultHandler.handle_set_scroll_method(&self, arg0, arg1);
}
}
17 => {
let [
arg0,
arg1,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 16)));
};
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: u32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.set_scroll_button(result: river_libinput_result_v1#{}, button: {})\n", client_id, id, arg0, arg1);
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_set_scroll_button(&self, arg0, arg1);
} else {
DefaultHandler.handle_set_scroll_button(&self, arg0, arg1);
}
}
18 => {
let [
arg0,
arg1,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 16)));
};
let arg1 = RiverLibinputDeviceV1ScrollButtonLockState(arg1);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1ScrollButtonLockState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.set_scroll_button_lock(result: river_libinput_result_v1#{}, state: {:?})\n", client_id, id, arg0, arg1);
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_set_scroll_button_lock(&self, arg0, arg1);
} else {
DefaultHandler.handle_set_scroll_button_lock(&self, arg0, arg1);
}
}
19 => {
let [
arg0,
arg1,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 16)));
};
let arg1 = RiverLibinputDeviceV1DwtState(arg1);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1DwtState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.set_dwt(result: river_libinput_result_v1#{}, state: {:?})\n", client_id, id, arg0, arg1);
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_set_dwt(&self, arg0, arg1);
} else {
DefaultHandler.handle_set_dwt(&self, arg0, arg1);
}
}
20 => {
let [
arg0,
arg1,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 16)));
};
let arg1 = RiverLibinputDeviceV1DwtpState(arg1);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: RiverLibinputDeviceV1DwtpState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.set_dwtp(result: river_libinput_result_v1#{}, state: {:?})\n", client_id, id, arg0, arg1);
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_set_dwtp(&self, arg0, arg1);
} else {
DefaultHandler.handle_set_dwtp(&self, arg0, arg1);
}
}
21 => {
let [
arg0,
arg1,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 16)));
};
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, client_id: u64, id: u32, arg0: u32, arg1: u32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}client#{:<4} -> river_libinput_device_v1#{}.set_rotation(result: river_libinput_result_v1#{}, angle: {})\n", client_id, id, arg0, arg1);
state.log(args);
}
log(&self.core.state, client.endpoint.id, msg[0], arg0, arg1);
}
let arg0_id = arg0;
let arg0 = RiverLibinputResultV1::new(&self.core.state, self.core.version);
arg0.core().set_client_id(client, arg0_id, arg0.clone())
.map_err(|e| ObjectError(ObjectErrorKind::SetClientId(arg0_id, "result", e)))?;
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_set_rotation(&self, arg0, arg1);
} else {
DefaultHandler.handle_set_rotation(&self, arg0, arg1);
}
}
n => {
let _ = client;
let _ = msg;
let _ = fds;
let _ = handler;
return Err(ObjectError(ObjectErrorKind::UnknownMessageId(n)));
}
}
Ok(())
}
fn handle_event(self: Rc<Self>, server: &Endpoint, msg: &[u32], fds: &mut VecDeque<Rc<OwnedFd>>) -> Result<(), ObjectError> {
let Some(mut handler) = self.handler.try_borrow_mut() else {
return Err(ObjectError(ObjectErrorKind::HandlerBorrowed));
};
let handler = &mut *handler;
match msg[1] & 0xffff {
0 => {
if msg.len() != 2 {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 8)));
}
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.removed()\n", id);
state.log(args);
}
log(&self.core.state, msg[0]);
}
if let Some(handler) = handler {
(**handler).handle_removed(&self);
} else {
DefaultHandler.handle_removed(&self);
}
}
1 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.input_device(device: river_input_device_v1#{})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
let arg0_id = arg0;
let Some(arg0) = server.lookup(arg0_id) else {
return Err(ObjectError(ObjectErrorKind::NoServerObject(arg0_id)));
};
let Ok(arg0) = (arg0 as Rc<dyn Any>).downcast::<RiverInputDeviceV1>() else {
let o = server.lookup(arg0_id).unwrap();
return Err(ObjectError(ObjectErrorKind::WrongObjectType("device", o.core().interface, ObjectInterface::RiverInputDeviceV1)));
};
let arg0 = &arg0;
if let Some(handler) = handler {
(**handler).handle_input_device(&self, arg0);
} else {
DefaultHandler.handle_input_device(&self, arg0);
}
}
2 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1SendEventsModes(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1SendEventsModes) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.send_events_support(modes: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_send_events_support(&self, arg0);
} else {
DefaultHandler.handle_send_events_support(&self, arg0);
}
}
3 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1SendEventsModes(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1SendEventsModes) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.send_events_default(mode: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_send_events_default(&self, arg0);
} else {
DefaultHandler.handle_send_events_default(&self, arg0);
}
}
4 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1SendEventsModes(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1SendEventsModes) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.send_events_current(mode: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_send_events_current(&self, arg0);
} else {
DefaultHandler.handle_send_events_current(&self, arg0);
}
}
5 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = arg0 as i32;
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: i32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.tap_support(finger_count: {})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_tap_support(&self, arg0);
} else {
DefaultHandler.handle_tap_support(&self, arg0);
}
}
6 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1TapState(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1TapState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.tap_default(state: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_tap_default(&self, arg0);
} else {
DefaultHandler.handle_tap_default(&self, arg0);
}
}
7 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1TapState(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1TapState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.tap_current(state: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_tap_current(&self, arg0);
} else {
DefaultHandler.handle_tap_current(&self, arg0);
}
}
8 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1TapButtonMap(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1TapButtonMap) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.tap_button_map_default(button_map: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_tap_button_map_default(&self, arg0);
} else {
DefaultHandler.handle_tap_button_map_default(&self, arg0);
}
}
9 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1TapButtonMap(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1TapButtonMap) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.tap_button_map_current(button_map: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_tap_button_map_current(&self, arg0);
} else {
DefaultHandler.handle_tap_button_map_current(&self, arg0);
}
}
10 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1DragState(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1DragState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.drag_default(state: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_drag_default(&self, arg0);
} else {
DefaultHandler.handle_drag_default(&self, arg0);
}
}
11 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1DragState(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1DragState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.drag_current(state: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_drag_current(&self, arg0);
} else {
DefaultHandler.handle_drag_current(&self, arg0);
}
}
12 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1DragLockState(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1DragLockState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.drag_lock_default(state: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_drag_lock_default(&self, arg0);
} else {
DefaultHandler.handle_drag_lock_default(&self, arg0);
}
}
13 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1DragLockState(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1DragLockState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.drag_lock_current(state: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_drag_lock_current(&self, arg0);
} else {
DefaultHandler.handle_drag_lock_current(&self, arg0);
}
}
14 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = arg0 as i32;
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: i32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.three_finger_drag_support(finger_count: {})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_three_finger_drag_support(&self, arg0);
} else {
DefaultHandler.handle_three_finger_drag_support(&self, arg0);
}
}
15 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1ThreeFingerDragState(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1ThreeFingerDragState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.three_finger_drag_default(state: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_three_finger_drag_default(&self, arg0);
} else {
DefaultHandler.handle_three_finger_drag_default(&self, arg0);
}
}
16 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1ThreeFingerDragState(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1ThreeFingerDragState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.three_finger_drag_current(state: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_three_finger_drag_current(&self, arg0);
} else {
DefaultHandler.handle_three_finger_drag_current(&self, arg0);
}
}
17 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = arg0 as i32;
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: i32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.calibration_matrix_support(supported: {})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_calibration_matrix_support(&self, arg0);
} else {
DefaultHandler.handle_calibration_matrix_support(&self, arg0);
}
}
18 => {
let mut offset = 2;
let arg0;
(arg0, offset) = parse_array(msg, offset, "matrix")?;
if offset != msg.len() {
return Err(ObjectError(ObjectErrorKind::TrailingBytes));
}
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: &[u8]) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.calibration_matrix_default(matrix: {})\n", id, debug_array(arg0));
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_calibration_matrix_default(&self, arg0);
} else {
DefaultHandler.handle_calibration_matrix_default(&self, arg0);
}
}
19 => {
let mut offset = 2;
let arg0;
(arg0, offset) = parse_array(msg, offset, "matrix")?;
if offset != msg.len() {
return Err(ObjectError(ObjectErrorKind::TrailingBytes));
}
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: &[u8]) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.calibration_matrix_current(matrix: {})\n", id, debug_array(arg0));
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_calibration_matrix_current(&self, arg0);
} else {
DefaultHandler.handle_calibration_matrix_current(&self, arg0);
}
}
20 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1AccelProfiles(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1AccelProfiles) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.accel_profiles_support(profiles: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_accel_profiles_support(&self, arg0);
} else {
DefaultHandler.handle_accel_profiles_support(&self, arg0);
}
}
21 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1AccelProfile(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1AccelProfile) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.accel_profile_default(profile: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_accel_profile_default(&self, arg0);
} else {
DefaultHandler.handle_accel_profile_default(&self, arg0);
}
}
22 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1AccelProfile(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1AccelProfile) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.accel_profile_current(profile: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_accel_profile_current(&self, arg0);
} else {
DefaultHandler.handle_accel_profile_current(&self, arg0);
}
}
23 => {
let mut offset = 2;
let arg0;
(arg0, offset) = parse_array(msg, offset, "speed")?;
if offset != msg.len() {
return Err(ObjectError(ObjectErrorKind::TrailingBytes));
}
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: &[u8]) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.accel_speed_default(speed: {})\n", id, debug_array(arg0));
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_accel_speed_default(&self, arg0);
} else {
DefaultHandler.handle_accel_speed_default(&self, arg0);
}
}
24 => {
let mut offset = 2;
let arg0;
(arg0, offset) = parse_array(msg, offset, "speed")?;
if offset != msg.len() {
return Err(ObjectError(ObjectErrorKind::TrailingBytes));
}
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: &[u8]) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.accel_speed_current(speed: {})\n", id, debug_array(arg0));
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_accel_speed_current(&self, arg0);
} else {
DefaultHandler.handle_accel_speed_current(&self, arg0);
}
}
25 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = arg0 as i32;
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: i32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.natural_scroll_support(supported: {})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_natural_scroll_support(&self, arg0);
} else {
DefaultHandler.handle_natural_scroll_support(&self, arg0);
}
}
26 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1NaturalScrollState(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1NaturalScrollState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.natural_scroll_default(state: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_natural_scroll_default(&self, arg0);
} else {
DefaultHandler.handle_natural_scroll_default(&self, arg0);
}
}
27 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1NaturalScrollState(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1NaturalScrollState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.natural_scroll_current(state: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_natural_scroll_current(&self, arg0);
} else {
DefaultHandler.handle_natural_scroll_current(&self, arg0);
}
}
28 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = arg0 as i32;
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: i32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.left_handed_support(supported: {})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_left_handed_support(&self, arg0);
} else {
DefaultHandler.handle_left_handed_support(&self, arg0);
}
}
29 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1LeftHandedState(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1LeftHandedState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.left_handed_default(state: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_left_handed_default(&self, arg0);
} else {
DefaultHandler.handle_left_handed_default(&self, arg0);
}
}
30 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1LeftHandedState(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1LeftHandedState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.left_handed_current(state: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_left_handed_current(&self, arg0);
} else {
DefaultHandler.handle_left_handed_current(&self, arg0);
}
}
31 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1ClickMethods(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1ClickMethods) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.click_method_support(methods: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_click_method_support(&self, arg0);
} else {
DefaultHandler.handle_click_method_support(&self, arg0);
}
}
32 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1ClickMethod(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1ClickMethod) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.click_method_default(method: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_click_method_default(&self, arg0);
} else {
DefaultHandler.handle_click_method_default(&self, arg0);
}
}
33 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1ClickMethod(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1ClickMethod) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.click_method_current(method: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_click_method_current(&self, arg0);
} else {
DefaultHandler.handle_click_method_current(&self, arg0);
}
}
34 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1ClickfingerButtonMap(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1ClickfingerButtonMap) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.clickfinger_button_map_default(button_map: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_clickfinger_button_map_default(&self, arg0);
} else {
DefaultHandler.handle_clickfinger_button_map_default(&self, arg0);
}
}
35 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1ClickfingerButtonMap(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1ClickfingerButtonMap) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.clickfinger_button_map_current(button_map: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_clickfinger_button_map_current(&self, arg0);
} else {
DefaultHandler.handle_clickfinger_button_map_current(&self, arg0);
}
}
36 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = arg0 as i32;
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: i32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.middle_emulation_support(supported: {})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_middle_emulation_support(&self, arg0);
} else {
DefaultHandler.handle_middle_emulation_support(&self, arg0);
}
}
37 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1MiddleEmulationState(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1MiddleEmulationState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.middle_emulation_default(state: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_middle_emulation_default(&self, arg0);
} else {
DefaultHandler.handle_middle_emulation_default(&self, arg0);
}
}
38 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1MiddleEmulationState(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1MiddleEmulationState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.middle_emulation_current(state: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_middle_emulation_current(&self, arg0);
} else {
DefaultHandler.handle_middle_emulation_current(&self, arg0);
}
}
39 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1ScrollMethods(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1ScrollMethods) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.scroll_method_support(methods: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_scroll_method_support(&self, arg0);
} else {
DefaultHandler.handle_scroll_method_support(&self, arg0);
}
}
40 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1ScrollMethod(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1ScrollMethod) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.scroll_method_default(method: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_scroll_method_default(&self, arg0);
} else {
DefaultHandler.handle_scroll_method_default(&self, arg0);
}
}
41 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1ScrollMethod(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1ScrollMethod) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.scroll_method_current(method: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_scroll_method_current(&self, arg0);
} else {
DefaultHandler.handle_scroll_method_current(&self, arg0);
}
}
42 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.scroll_button_default(button: {})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_scroll_button_default(&self, arg0);
} else {
DefaultHandler.handle_scroll_button_default(&self, arg0);
}
}
43 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.scroll_button_current(button: {})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_scroll_button_current(&self, arg0);
} else {
DefaultHandler.handle_scroll_button_current(&self, arg0);
}
}
44 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1ScrollButtonLockState(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1ScrollButtonLockState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.scroll_button_lock_default(state: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_scroll_button_lock_default(&self, arg0);
} else {
DefaultHandler.handle_scroll_button_lock_default(&self, arg0);
}
}
45 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1ScrollButtonLockState(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1ScrollButtonLockState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.scroll_button_lock_current(state: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_scroll_button_lock_current(&self, arg0);
} else {
DefaultHandler.handle_scroll_button_lock_current(&self, arg0);
}
}
46 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = arg0 as i32;
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: i32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.dwt_support(supported: {})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_dwt_support(&self, arg0);
} else {
DefaultHandler.handle_dwt_support(&self, arg0);
}
}
47 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1DwtState(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1DwtState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.dwt_default(state: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_dwt_default(&self, arg0);
} else {
DefaultHandler.handle_dwt_default(&self, arg0);
}
}
48 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1DwtState(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1DwtState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.dwt_current(state: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_dwt_current(&self, arg0);
} else {
DefaultHandler.handle_dwt_current(&self, arg0);
}
}
49 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = arg0 as i32;
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: i32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.dwtp_support(supported: {})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_dwtp_support(&self, arg0);
} else {
DefaultHandler.handle_dwtp_support(&self, arg0);
}
}
50 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1DwtpState(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1DwtpState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.dwtp_default(state: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_dwtp_default(&self, arg0);
} else {
DefaultHandler.handle_dwtp_default(&self, arg0);
}
}
51 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = RiverLibinputDeviceV1DwtpState(arg0);
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: RiverLibinputDeviceV1DwtpState) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.dwtp_current(state: {:?})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_dwtp_current(&self, arg0);
} else {
DefaultHandler.handle_dwtp_current(&self, arg0);
}
}
52 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
let arg0 = arg0 as i32;
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: i32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.rotation_support(supported: {})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_rotation_support(&self, arg0);
} else {
DefaultHandler.handle_rotation_support(&self, arg0);
}
}
53 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.rotation_default(angle: {})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_rotation_default(&self, arg0);
} else {
DefaultHandler.handle_rotation_default(&self, arg0);
}
}
54 => {
let [
arg0,
] = msg[2..] else {
return Err(ObjectError(ObjectErrorKind::WrongMessageSize(msg.len() as u32 * 4, 12)));
};
#[cfg(feature = "logging")]
if self.core.state.log {
#[cold]
fn log(state: &State, id: u32, arg0: u32) {
let (millis, micros) = time_since_epoch();
let prefix = &state.log_prefix;
let args = format_args!("[{millis:7}.{micros:03}] {prefix}server -> river_libinput_device_v1#{}.rotation_current(angle: {})\n", id, arg0);
state.log(args);
}
log(&self.core.state, msg[0], arg0);
}
if let Some(handler) = handler {
(**handler).handle_rotation_current(&self, arg0);
} else {
DefaultHandler.handle_rotation_current(&self, arg0);
}
}
n => {
let _ = server;
let _ = msg;
let _ = fds;
let _ = handler;
return Err(ObjectError(ObjectErrorKind::UnknownMessageId(n)));
}
}
Ok(())
}
fn get_request_name(&self, id: u32) -> Option<&'static str> {
let name = match id {
0 => "destroy",
1 => "set_send_events",
2 => "set_tap",
3 => "set_tap_button_map",
4 => "set_drag",
5 => "set_drag_lock",
6 => "set_three_finger_drag",
7 => "set_calibration_matrix",
8 => "set_accel_profile",
9 => "set_accel_speed",
10 => "apply_accel_config",
11 => "set_natural_scroll",
12 => "set_left_handed",
13 => "set_click_method",
14 => "set_clickfinger_button_map",
15 => "set_middle_emulation",
16 => "set_scroll_method",
17 => "set_scroll_button",
18 => "set_scroll_button_lock",
19 => "set_dwt",
20 => "set_dwtp",
21 => "set_rotation",
_ => return None,
};
Some(name)
}
fn get_event_name(&self, id: u32) -> Option<&'static str> {
let name = match id {
0 => "removed",
1 => "input_device",
2 => "send_events_support",
3 => "send_events_default",
4 => "send_events_current",
5 => "tap_support",
6 => "tap_default",
7 => "tap_current",
8 => "tap_button_map_default",
9 => "tap_button_map_current",
10 => "drag_default",
11 => "drag_current",
12 => "drag_lock_default",
13 => "drag_lock_current",
14 => "three_finger_drag_support",
15 => "three_finger_drag_default",
16 => "three_finger_drag_current",
17 => "calibration_matrix_support",
18 => "calibration_matrix_default",
19 => "calibration_matrix_current",
20 => "accel_profiles_support",
21 => "accel_profile_default",
22 => "accel_profile_current",
23 => "accel_speed_default",
24 => "accel_speed_current",
25 => "natural_scroll_support",
26 => "natural_scroll_default",
27 => "natural_scroll_current",
28 => "left_handed_support",
29 => "left_handed_default",
30 => "left_handed_current",
31 => "click_method_support",
32 => "click_method_default",
33 => "click_method_current",
34 => "clickfinger_button_map_default",
35 => "clickfinger_button_map_current",
36 => "middle_emulation_support",
37 => "middle_emulation_default",
38 => "middle_emulation_current",
39 => "scroll_method_support",
40 => "scroll_method_default",
41 => "scroll_method_current",
42 => "scroll_button_default",
43 => "scroll_button_current",
44 => "scroll_button_lock_default",
45 => "scroll_button_lock_current",
46 => "dwt_support",
47 => "dwt_default",
48 => "dwt_current",
49 => "dwtp_support",
50 => "dwtp_default",
51 => "dwtp_current",
52 => "rotation_support",
53 => "rotation_default",
54 => "rotation_current",
_ => return None,
};
Some(name)
}
}
impl Object for RiverLibinputDeviceV1 {
fn core(&self) -> &ObjectCore {
&self.core
}
fn unset_handler(&self) {
self.handler.set(None);
}
fn get_handler_any_ref(&self) -> Result<HandlerRef<'_, dyn Any>, HandlerAccessError> {
let borrowed = self.handler.try_borrow().ok_or(HandlerAccessError::AlreadyBorrowed)?;
if borrowed.is_none() {
return Err(HandlerAccessError::NoHandler);
}
Ok(HandlerRef::map(borrowed, |handler| &**handler.as_ref().unwrap() as &dyn Any))
}
fn get_handler_any_mut(&self) -> Result<HandlerMut<'_, dyn Any>, HandlerAccessError> {
let borrowed = self.handler.try_borrow_mut().ok_or(HandlerAccessError::AlreadyBorrowed)?;
if borrowed.is_none() {
return Err(HandlerAccessError::NoHandler);
}
Ok(HandlerMut::map(borrowed, |handler| &mut **handler.as_mut().unwrap() as &mut dyn Any))
}
}
impl RiverLibinputDeviceV1 {
pub const ENM__ERROR_INVALID_ARG__SINCE: u32 = 1;
pub const ENM__SEND_EVENTS_MODES_ENABLED__SINCE: u32 = 1;
pub const ENM__SEND_EVENTS_MODES_DISABLED__SINCE: u32 = 1;
pub const ENM__SEND_EVENTS_MODES_DISABLED_ON_EXTERNAL_MOUSE__SINCE: u32 = 1;
pub const ENM__TAP_STATE_DISABLED__SINCE: u32 = 1;
pub const ENM__TAP_STATE_ENABLED__SINCE: u32 = 1;
pub const ENM__TAP_BUTTON_MAP_LRM__SINCE: u32 = 1;
pub const ENM__TAP_BUTTON_MAP_LMR__SINCE: u32 = 1;
pub const ENM__DRAG_STATE_DISABLED__SINCE: u32 = 1;
pub const ENM__DRAG_STATE_ENABLED__SINCE: u32 = 1;
pub const ENM__DRAG_LOCK_STATE_DISABLED__SINCE: u32 = 1;
pub const ENM__DRAG_LOCK_STATE_ENABLED_TIMEOUT__SINCE: u32 = 1;
pub const ENM__DRAG_LOCK_STATE_ENABLED_STICKY__SINCE: u32 = 1;
pub const ENM__THREE_FINGER_DRAG_STATE_DISABLED__SINCE: u32 = 1;
pub const ENM__THREE_FINGER_DRAG_STATE_ENABLED_3FG__SINCE: u32 = 1;
pub const ENM__THREE_FINGER_DRAG_STATE_ENABLED_4FG__SINCE: u32 = 1;
pub const ENM__ACCEL_PROFILE_NONE__SINCE: u32 = 1;
pub const ENM__ACCEL_PROFILE_FLAT__SINCE: u32 = 1;
pub const ENM__ACCEL_PROFILE_ADAPTIVE__SINCE: u32 = 1;
pub const ENM__ACCEL_PROFILE_CUSTOM__SINCE: u32 = 1;
pub const ENM__ACCEL_PROFILES_NONE__SINCE: u32 = 1;
pub const ENM__ACCEL_PROFILES_FLAT__SINCE: u32 = 1;
pub const ENM__ACCEL_PROFILES_ADAPTIVE__SINCE: u32 = 1;
pub const ENM__ACCEL_PROFILES_CUSTOM__SINCE: u32 = 1;
pub const ENM__NATURAL_SCROLL_STATE_DISABLED__SINCE: u32 = 1;
pub const ENM__NATURAL_SCROLL_STATE_ENABLED__SINCE: u32 = 1;
pub const ENM__LEFT_HANDED_STATE_DISABLED__SINCE: u32 = 1;
pub const ENM__LEFT_HANDED_STATE_ENABLED__SINCE: u32 = 1;
pub const ENM__CLICK_METHOD_NONE__SINCE: u32 = 1;
pub const ENM__CLICK_METHOD_BUTTON_AREAS__SINCE: u32 = 1;
pub const ENM__CLICK_METHOD_CLICKFINGER__SINCE: u32 = 1;
pub const ENM__CLICK_METHODS_NONE__SINCE: u32 = 1;
pub const ENM__CLICK_METHODS_BUTTON_AREAS__SINCE: u32 = 1;
pub const ENM__CLICK_METHODS_CLICKFINGER__SINCE: u32 = 1;
pub const ENM__CLICKFINGER_BUTTON_MAP_LRM__SINCE: u32 = 1;
pub const ENM__CLICKFINGER_BUTTON_MAP_LMR__SINCE: u32 = 1;
pub const ENM__MIDDLE_EMULATION_STATE_DISABLED__SINCE: u32 = 1;
pub const ENM__MIDDLE_EMULATION_STATE_ENABLED__SINCE: u32 = 1;
pub const ENM__SCROLL_METHOD_NO_SCROLL__SINCE: u32 = 1;
pub const ENM__SCROLL_METHOD_TWO_FINGER__SINCE: u32 = 1;
pub const ENM__SCROLL_METHOD_EDGE__SINCE: u32 = 1;
pub const ENM__SCROLL_METHOD_ON_BUTTON_DOWN__SINCE: u32 = 1;
pub const ENM__SCROLL_METHODS_NO_SCROLL__SINCE: u32 = 1;
pub const ENM__SCROLL_METHODS_TWO_FINGER__SINCE: u32 = 1;
pub const ENM__SCROLL_METHODS_EDGE__SINCE: u32 = 1;
pub const ENM__SCROLL_METHODS_ON_BUTTON_DOWN__SINCE: u32 = 1;
pub const ENM__SCROLL_BUTTON_LOCK_STATE_DISABLED__SINCE: u32 = 1;
pub const ENM__SCROLL_BUTTON_LOCK_STATE_ENABLED__SINCE: u32 = 1;
pub const ENM__DWT_STATE_DISABLED__SINCE: u32 = 1;
pub const ENM__DWT_STATE_ENABLED__SINCE: u32 = 1;
pub const ENM__DWTP_STATE_DISABLED__SINCE: u32 = 1;
pub const ENM__DWTP_STATE_ENABLED__SINCE: u32 = 1;
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RiverLibinputDeviceV1Error(pub u32);
impl RiverLibinputDeviceV1Error {
pub const INVALID_ARG: Self = Self(0);
}
impl Debug for RiverLibinputDeviceV1Error {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let name = match *self {
Self::INVALID_ARG => "INVALID_ARG",
_ => return Debug::fmt(&self.0, f),
};
f.write_str(name)
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Default)]
pub struct RiverLibinputDeviceV1SendEventsModes(pub u32);
#[derive(Clone, Debug)]
pub struct RiverLibinputDeviceV1SendEventsModesIter(pub u32);
impl RiverLibinputDeviceV1SendEventsModes {
pub const ENABLED: Self = Self(0);
pub const DISABLED: Self = Self(1);
pub const DISABLED_ON_EXTERNAL_MOUSE: Self = Self(2);
}
impl RiverLibinputDeviceV1SendEventsModes {
#[inline]
pub const fn empty() -> Self {
Self(0)
}
#[inline]
#[must_use]
pub const fn is_empty(self) -> bool {
self.0 == 0
}
#[inline]
#[must_use]
pub const fn contains(self, other: Self) -> bool {
self.0 & other.0 == other.0
}
#[inline]
#[must_use]
pub const fn intersects(self, other: Self) -> bool {
self.0 & other.0 != 0
}
#[inline]
pub const fn insert(&mut self, other: Self) {
*self = self.union(other);
}
#[inline]
pub const fn remove(&mut self, other: Self) {
*self = self.difference(other);
}
#[inline]
pub const fn toggle(&mut self, other: Self) {
*self = self.symmetric_difference(other);
}
#[inline]
pub const fn set(&mut self, other: Self, value: bool) {
if value {
self.insert(other);
} else {
self.remove(other);
}
}
#[inline]
#[must_use]
pub const fn intersection(self, other: Self) -> Self {
Self(self.0 & other.0)
}
#[inline]
#[must_use]
pub const fn union(self, other: Self) -> Self {
Self(self.0 | other.0)
}
#[inline]
#[must_use]
pub const fn difference(self, other: Self) -> Self {
Self(self.0 & !other.0)
}
#[inline]
#[must_use]
pub const fn complement(self) -> Self {
Self(!self.0)
}
#[inline]
#[must_use]
pub const fn symmetric_difference(self, other: Self) -> Self {
Self(self.0 ^ other.0)
}
#[inline]
pub const fn all_known() -> Self {
#[allow(clippy::eq_op, clippy::identity_op)]
Self(0 | 0 | 1 | 2)
}
}
impl Iterator for RiverLibinputDeviceV1SendEventsModesIter {
type Item = RiverLibinputDeviceV1SendEventsModes;
fn next(&mut self) -> Option<Self::Item> {
if self.0 == 0 {
return None;
}
let bit = 1 << self.0.trailing_zeros();
self.0 &= !bit;
Some(RiverLibinputDeviceV1SendEventsModes(bit))
}
}
impl IntoIterator for RiverLibinputDeviceV1SendEventsModes {
type Item = RiverLibinputDeviceV1SendEventsModes;
type IntoIter = RiverLibinputDeviceV1SendEventsModesIter;
fn into_iter(self) -> Self::IntoIter {
RiverLibinputDeviceV1SendEventsModesIter(self.0)
}
}
impl BitAnd for RiverLibinputDeviceV1SendEventsModes {
type Output = Self;
fn bitand(self, rhs: Self) -> Self::Output {
self.intersection(rhs)
}
}
impl BitAndAssign for RiverLibinputDeviceV1SendEventsModes {
fn bitand_assign(&mut self, rhs: Self) {
*self = self.intersection(rhs);
}
}
impl BitOr for RiverLibinputDeviceV1SendEventsModes {
type Output = Self;
fn bitor(self, rhs: Self) -> Self::Output {
self.union(rhs)
}
}
impl BitOrAssign for RiverLibinputDeviceV1SendEventsModes {
fn bitor_assign(&mut self, rhs: Self) {
*self = self.union(rhs);
}
}
impl BitXor for RiverLibinputDeviceV1SendEventsModes {
type Output = Self;
fn bitxor(self, rhs: Self) -> Self::Output {
self.symmetric_difference(rhs)
}
}
impl BitXorAssign for RiverLibinputDeviceV1SendEventsModes {
fn bitxor_assign(&mut self, rhs: Self) {
*self = self.symmetric_difference(rhs);
}
}
impl Sub for RiverLibinputDeviceV1SendEventsModes {
type Output = Self;
fn sub(self, rhs: Self) -> Self::Output {
self.difference(rhs)
}
}
impl SubAssign for RiverLibinputDeviceV1SendEventsModes {
fn sub_assign(&mut self, rhs: Self) {
*self = self.difference(rhs);
}
}
impl Not for RiverLibinputDeviceV1SendEventsModes {
type Output = Self;
fn not(self) -> Self::Output {
self.complement()
}
}
impl Debug for RiverLibinputDeviceV1SendEventsModes {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let mut v = self.0;
let mut first = true;
if v & 1 == 1 {
v &= !1;
if first {
first = false;
} else {
f.write_str(" | ")?;
}
f.write_str("DISABLED")?;
}
if v & 2 == 2 {
v &= !2;
if first {
first = false;
} else {
f.write_str(" | ")?;
}
f.write_str("DISABLED_ON_EXTERNAL_MOUSE")?;
}
if v != 0 {
if first {
first = false;
} else {
f.write_str(" | ")?;
}
write!(f, "0x{v:032x}")?;
}
if first {
f.write_str("ENABLED")?;
}
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RiverLibinputDeviceV1TapState(pub u32);
impl RiverLibinputDeviceV1TapState {
pub const DISABLED: Self = Self(0);
pub const ENABLED: Self = Self(1);
}
impl Debug for RiverLibinputDeviceV1TapState {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let name = match *self {
Self::DISABLED => "DISABLED",
Self::ENABLED => "ENABLED",
_ => return Debug::fmt(&self.0, f),
};
f.write_str(name)
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RiverLibinputDeviceV1TapButtonMap(pub u32);
impl RiverLibinputDeviceV1TapButtonMap {
pub const LRM: Self = Self(0);
pub const LMR: Self = Self(1);
}
impl Debug for RiverLibinputDeviceV1TapButtonMap {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let name = match *self {
Self::LRM => "LRM",
Self::LMR => "LMR",
_ => return Debug::fmt(&self.0, f),
};
f.write_str(name)
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RiverLibinputDeviceV1DragState(pub u32);
impl RiverLibinputDeviceV1DragState {
pub const DISABLED: Self = Self(0);
pub const ENABLED: Self = Self(1);
}
impl Debug for RiverLibinputDeviceV1DragState {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let name = match *self {
Self::DISABLED => "DISABLED",
Self::ENABLED => "ENABLED",
_ => return Debug::fmt(&self.0, f),
};
f.write_str(name)
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RiverLibinputDeviceV1DragLockState(pub u32);
impl RiverLibinputDeviceV1DragLockState {
pub const DISABLED: Self = Self(0);
pub const ENABLED_TIMEOUT: Self = Self(1);
pub const ENABLED_STICKY: Self = Self(2);
}
impl Debug for RiverLibinputDeviceV1DragLockState {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let name = match *self {
Self::DISABLED => "DISABLED",
Self::ENABLED_TIMEOUT => "ENABLED_TIMEOUT",
Self::ENABLED_STICKY => "ENABLED_STICKY",
_ => return Debug::fmt(&self.0, f),
};
f.write_str(name)
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RiverLibinputDeviceV1ThreeFingerDragState(pub u32);
impl RiverLibinputDeviceV1ThreeFingerDragState {
pub const DISABLED: Self = Self(0);
pub const ENABLED_3FG: Self = Self(1);
pub const ENABLED_4FG: Self = Self(2);
}
impl Debug for RiverLibinputDeviceV1ThreeFingerDragState {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let name = match *self {
Self::DISABLED => "DISABLED",
Self::ENABLED_3FG => "ENABLED_3FG",
Self::ENABLED_4FG => "ENABLED_4FG",
_ => return Debug::fmt(&self.0, f),
};
f.write_str(name)
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RiverLibinputDeviceV1AccelProfile(pub u32);
impl RiverLibinputDeviceV1AccelProfile {
pub const NONE: Self = Self(0);
pub const FLAT: Self = Self(1);
pub const ADAPTIVE: Self = Self(2);
pub const CUSTOM: Self = Self(4);
}
impl Debug for RiverLibinputDeviceV1AccelProfile {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let name = match *self {
Self::NONE => "NONE",
Self::FLAT => "FLAT",
Self::ADAPTIVE => "ADAPTIVE",
Self::CUSTOM => "CUSTOM",
_ => return Debug::fmt(&self.0, f),
};
f.write_str(name)
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Default)]
pub struct RiverLibinputDeviceV1AccelProfiles(pub u32);
#[derive(Clone, Debug)]
pub struct RiverLibinputDeviceV1AccelProfilesIter(pub u32);
impl RiverLibinputDeviceV1AccelProfiles {
pub const NONE: Self = Self(0);
pub const FLAT: Self = Self(1);
pub const ADAPTIVE: Self = Self(2);
pub const CUSTOM: Self = Self(4);
}
impl RiverLibinputDeviceV1AccelProfiles {
#[inline]
pub const fn empty() -> Self {
Self(0)
}
#[inline]
#[must_use]
pub const fn is_empty(self) -> bool {
self.0 == 0
}
#[inline]
#[must_use]
pub const fn contains(self, other: Self) -> bool {
self.0 & other.0 == other.0
}
#[inline]
#[must_use]
pub const fn intersects(self, other: Self) -> bool {
self.0 & other.0 != 0
}
#[inline]
pub const fn insert(&mut self, other: Self) {
*self = self.union(other);
}
#[inline]
pub const fn remove(&mut self, other: Self) {
*self = self.difference(other);
}
#[inline]
pub const fn toggle(&mut self, other: Self) {
*self = self.symmetric_difference(other);
}
#[inline]
pub const fn set(&mut self, other: Self, value: bool) {
if value {
self.insert(other);
} else {
self.remove(other);
}
}
#[inline]
#[must_use]
pub const fn intersection(self, other: Self) -> Self {
Self(self.0 & other.0)
}
#[inline]
#[must_use]
pub const fn union(self, other: Self) -> Self {
Self(self.0 | other.0)
}
#[inline]
#[must_use]
pub const fn difference(self, other: Self) -> Self {
Self(self.0 & !other.0)
}
#[inline]
#[must_use]
pub const fn complement(self) -> Self {
Self(!self.0)
}
#[inline]
#[must_use]
pub const fn symmetric_difference(self, other: Self) -> Self {
Self(self.0 ^ other.0)
}
#[inline]
pub const fn all_known() -> Self {
#[allow(clippy::eq_op, clippy::identity_op)]
Self(0 | 0 | 1 | 2 | 4)
}
}
impl Iterator for RiverLibinputDeviceV1AccelProfilesIter {
type Item = RiverLibinputDeviceV1AccelProfiles;
fn next(&mut self) -> Option<Self::Item> {
if self.0 == 0 {
return None;
}
let bit = 1 << self.0.trailing_zeros();
self.0 &= !bit;
Some(RiverLibinputDeviceV1AccelProfiles(bit))
}
}
impl IntoIterator for RiverLibinputDeviceV1AccelProfiles {
type Item = RiverLibinputDeviceV1AccelProfiles;
type IntoIter = RiverLibinputDeviceV1AccelProfilesIter;
fn into_iter(self) -> Self::IntoIter {
RiverLibinputDeviceV1AccelProfilesIter(self.0)
}
}
impl BitAnd for RiverLibinputDeviceV1AccelProfiles {
type Output = Self;
fn bitand(self, rhs: Self) -> Self::Output {
self.intersection(rhs)
}
}
impl BitAndAssign for RiverLibinputDeviceV1AccelProfiles {
fn bitand_assign(&mut self, rhs: Self) {
*self = self.intersection(rhs);
}
}
impl BitOr for RiverLibinputDeviceV1AccelProfiles {
type Output = Self;
fn bitor(self, rhs: Self) -> Self::Output {
self.union(rhs)
}
}
impl BitOrAssign for RiverLibinputDeviceV1AccelProfiles {
fn bitor_assign(&mut self, rhs: Self) {
*self = self.union(rhs);
}
}
impl BitXor for RiverLibinputDeviceV1AccelProfiles {
type Output = Self;
fn bitxor(self, rhs: Self) -> Self::Output {
self.symmetric_difference(rhs)
}
}
impl BitXorAssign for RiverLibinputDeviceV1AccelProfiles {
fn bitxor_assign(&mut self, rhs: Self) {
*self = self.symmetric_difference(rhs);
}
}
impl Sub for RiverLibinputDeviceV1AccelProfiles {
type Output = Self;
fn sub(self, rhs: Self) -> Self::Output {
self.difference(rhs)
}
}
impl SubAssign for RiverLibinputDeviceV1AccelProfiles {
fn sub_assign(&mut self, rhs: Self) {
*self = self.difference(rhs);
}
}
impl Not for RiverLibinputDeviceV1AccelProfiles {
type Output = Self;
fn not(self) -> Self::Output {
self.complement()
}
}
impl Debug for RiverLibinputDeviceV1AccelProfiles {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let mut v = self.0;
let mut first = true;
if v & 1 == 1 {
v &= !1;
if first {
first = false;
} else {
f.write_str(" | ")?;
}
f.write_str("FLAT")?;
}
if v & 2 == 2 {
v &= !2;
if first {
first = false;
} else {
f.write_str(" | ")?;
}
f.write_str("ADAPTIVE")?;
}
if v & 4 == 4 {
v &= !4;
if first {
first = false;
} else {
f.write_str(" | ")?;
}
f.write_str("CUSTOM")?;
}
if v != 0 {
if first {
first = false;
} else {
f.write_str(" | ")?;
}
write!(f, "0x{v:032x}")?;
}
if first {
f.write_str("NONE")?;
}
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RiverLibinputDeviceV1NaturalScrollState(pub u32);
impl RiverLibinputDeviceV1NaturalScrollState {
pub const DISABLED: Self = Self(0);
pub const ENABLED: Self = Self(1);
}
impl Debug for RiverLibinputDeviceV1NaturalScrollState {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let name = match *self {
Self::DISABLED => "DISABLED",
Self::ENABLED => "ENABLED",
_ => return Debug::fmt(&self.0, f),
};
f.write_str(name)
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RiverLibinputDeviceV1LeftHandedState(pub u32);
impl RiverLibinputDeviceV1LeftHandedState {
pub const DISABLED: Self = Self(0);
pub const ENABLED: Self = Self(1);
}
impl Debug for RiverLibinputDeviceV1LeftHandedState {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let name = match *self {
Self::DISABLED => "DISABLED",
Self::ENABLED => "ENABLED",
_ => return Debug::fmt(&self.0, f),
};
f.write_str(name)
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RiverLibinputDeviceV1ClickMethod(pub u32);
impl RiverLibinputDeviceV1ClickMethod {
pub const NONE: Self = Self(0);
pub const BUTTON_AREAS: Self = Self(1);
pub const CLICKFINGER: Self = Self(2);
}
impl Debug for RiverLibinputDeviceV1ClickMethod {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let name = match *self {
Self::NONE => "NONE",
Self::BUTTON_AREAS => "BUTTON_AREAS",
Self::CLICKFINGER => "CLICKFINGER",
_ => return Debug::fmt(&self.0, f),
};
f.write_str(name)
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Default)]
pub struct RiverLibinputDeviceV1ClickMethods(pub u32);
#[derive(Clone, Debug)]
pub struct RiverLibinputDeviceV1ClickMethodsIter(pub u32);
impl RiverLibinputDeviceV1ClickMethods {
pub const NONE: Self = Self(0);
pub const BUTTON_AREAS: Self = Self(1);
pub const CLICKFINGER: Self = Self(2);
}
impl RiverLibinputDeviceV1ClickMethods {
#[inline]
pub const fn empty() -> Self {
Self(0)
}
#[inline]
#[must_use]
pub const fn is_empty(self) -> bool {
self.0 == 0
}
#[inline]
#[must_use]
pub const fn contains(self, other: Self) -> bool {
self.0 & other.0 == other.0
}
#[inline]
#[must_use]
pub const fn intersects(self, other: Self) -> bool {
self.0 & other.0 != 0
}
#[inline]
pub const fn insert(&mut self, other: Self) {
*self = self.union(other);
}
#[inline]
pub const fn remove(&mut self, other: Self) {
*self = self.difference(other);
}
#[inline]
pub const fn toggle(&mut self, other: Self) {
*self = self.symmetric_difference(other);
}
#[inline]
pub const fn set(&mut self, other: Self, value: bool) {
if value {
self.insert(other);
} else {
self.remove(other);
}
}
#[inline]
#[must_use]
pub const fn intersection(self, other: Self) -> Self {
Self(self.0 & other.0)
}
#[inline]
#[must_use]
pub const fn union(self, other: Self) -> Self {
Self(self.0 | other.0)
}
#[inline]
#[must_use]
pub const fn difference(self, other: Self) -> Self {
Self(self.0 & !other.0)
}
#[inline]
#[must_use]
pub const fn complement(self) -> Self {
Self(!self.0)
}
#[inline]
#[must_use]
pub const fn symmetric_difference(self, other: Self) -> Self {
Self(self.0 ^ other.0)
}
#[inline]
pub const fn all_known() -> Self {
#[allow(clippy::eq_op, clippy::identity_op)]
Self(0 | 0 | 1 | 2)
}
}
impl Iterator for RiverLibinputDeviceV1ClickMethodsIter {
type Item = RiverLibinputDeviceV1ClickMethods;
fn next(&mut self) -> Option<Self::Item> {
if self.0 == 0 {
return None;
}
let bit = 1 << self.0.trailing_zeros();
self.0 &= !bit;
Some(RiverLibinputDeviceV1ClickMethods(bit))
}
}
impl IntoIterator for RiverLibinputDeviceV1ClickMethods {
type Item = RiverLibinputDeviceV1ClickMethods;
type IntoIter = RiverLibinputDeviceV1ClickMethodsIter;
fn into_iter(self) -> Self::IntoIter {
RiverLibinputDeviceV1ClickMethodsIter(self.0)
}
}
impl BitAnd for RiverLibinputDeviceV1ClickMethods {
type Output = Self;
fn bitand(self, rhs: Self) -> Self::Output {
self.intersection(rhs)
}
}
impl BitAndAssign for RiverLibinputDeviceV1ClickMethods {
fn bitand_assign(&mut self, rhs: Self) {
*self = self.intersection(rhs);
}
}
impl BitOr for RiverLibinputDeviceV1ClickMethods {
type Output = Self;
fn bitor(self, rhs: Self) -> Self::Output {
self.union(rhs)
}
}
impl BitOrAssign for RiverLibinputDeviceV1ClickMethods {
fn bitor_assign(&mut self, rhs: Self) {
*self = self.union(rhs);
}
}
impl BitXor for RiverLibinputDeviceV1ClickMethods {
type Output = Self;
fn bitxor(self, rhs: Self) -> Self::Output {
self.symmetric_difference(rhs)
}
}
impl BitXorAssign for RiverLibinputDeviceV1ClickMethods {
fn bitxor_assign(&mut self, rhs: Self) {
*self = self.symmetric_difference(rhs);
}
}
impl Sub for RiverLibinputDeviceV1ClickMethods {
type Output = Self;
fn sub(self, rhs: Self) -> Self::Output {
self.difference(rhs)
}
}
impl SubAssign for RiverLibinputDeviceV1ClickMethods {
fn sub_assign(&mut self, rhs: Self) {
*self = self.difference(rhs);
}
}
impl Not for RiverLibinputDeviceV1ClickMethods {
type Output = Self;
fn not(self) -> Self::Output {
self.complement()
}
}
impl Debug for RiverLibinputDeviceV1ClickMethods {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let mut v = self.0;
let mut first = true;
if v & 1 == 1 {
v &= !1;
if first {
first = false;
} else {
f.write_str(" | ")?;
}
f.write_str("BUTTON_AREAS")?;
}
if v & 2 == 2 {
v &= !2;
if first {
first = false;
} else {
f.write_str(" | ")?;
}
f.write_str("CLICKFINGER")?;
}
if v != 0 {
if first {
first = false;
} else {
f.write_str(" | ")?;
}
write!(f, "0x{v:032x}")?;
}
if first {
f.write_str("NONE")?;
}
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RiverLibinputDeviceV1ClickfingerButtonMap(pub u32);
impl RiverLibinputDeviceV1ClickfingerButtonMap {
pub const LRM: Self = Self(0);
pub const LMR: Self = Self(1);
}
impl Debug for RiverLibinputDeviceV1ClickfingerButtonMap {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let name = match *self {
Self::LRM => "LRM",
Self::LMR => "LMR",
_ => return Debug::fmt(&self.0, f),
};
f.write_str(name)
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RiverLibinputDeviceV1MiddleEmulationState(pub u32);
impl RiverLibinputDeviceV1MiddleEmulationState {
pub const DISABLED: Self = Self(0);
pub const ENABLED: Self = Self(1);
}
impl Debug for RiverLibinputDeviceV1MiddleEmulationState {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let name = match *self {
Self::DISABLED => "DISABLED",
Self::ENABLED => "ENABLED",
_ => return Debug::fmt(&self.0, f),
};
f.write_str(name)
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RiverLibinputDeviceV1ScrollMethod(pub u32);
impl RiverLibinputDeviceV1ScrollMethod {
pub const NO_SCROLL: Self = Self(0);
pub const TWO_FINGER: Self = Self(1);
pub const EDGE: Self = Self(2);
pub const ON_BUTTON_DOWN: Self = Self(4);
}
impl Debug for RiverLibinputDeviceV1ScrollMethod {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let name = match *self {
Self::NO_SCROLL => "NO_SCROLL",
Self::TWO_FINGER => "TWO_FINGER",
Self::EDGE => "EDGE",
Self::ON_BUTTON_DOWN => "ON_BUTTON_DOWN",
_ => return Debug::fmt(&self.0, f),
};
f.write_str(name)
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[derive(Default)]
pub struct RiverLibinputDeviceV1ScrollMethods(pub u32);
#[derive(Clone, Debug)]
pub struct RiverLibinputDeviceV1ScrollMethodsIter(pub u32);
impl RiverLibinputDeviceV1ScrollMethods {
pub const NO_SCROLL: Self = Self(0);
pub const TWO_FINGER: Self = Self(1);
pub const EDGE: Self = Self(2);
pub const ON_BUTTON_DOWN: Self = Self(4);
}
impl RiverLibinputDeviceV1ScrollMethods {
#[inline]
pub const fn empty() -> Self {
Self(0)
}
#[inline]
#[must_use]
pub const fn is_empty(self) -> bool {
self.0 == 0
}
#[inline]
#[must_use]
pub const fn contains(self, other: Self) -> bool {
self.0 & other.0 == other.0
}
#[inline]
#[must_use]
pub const fn intersects(self, other: Self) -> bool {
self.0 & other.0 != 0
}
#[inline]
pub const fn insert(&mut self, other: Self) {
*self = self.union(other);
}
#[inline]
pub const fn remove(&mut self, other: Self) {
*self = self.difference(other);
}
#[inline]
pub const fn toggle(&mut self, other: Self) {
*self = self.symmetric_difference(other);
}
#[inline]
pub const fn set(&mut self, other: Self, value: bool) {
if value {
self.insert(other);
} else {
self.remove(other);
}
}
#[inline]
#[must_use]
pub const fn intersection(self, other: Self) -> Self {
Self(self.0 & other.0)
}
#[inline]
#[must_use]
pub const fn union(self, other: Self) -> Self {
Self(self.0 | other.0)
}
#[inline]
#[must_use]
pub const fn difference(self, other: Self) -> Self {
Self(self.0 & !other.0)
}
#[inline]
#[must_use]
pub const fn complement(self) -> Self {
Self(!self.0)
}
#[inline]
#[must_use]
pub const fn symmetric_difference(self, other: Self) -> Self {
Self(self.0 ^ other.0)
}
#[inline]
pub const fn all_known() -> Self {
#[allow(clippy::eq_op, clippy::identity_op)]
Self(0 | 0 | 1 | 2 | 4)
}
}
impl Iterator for RiverLibinputDeviceV1ScrollMethodsIter {
type Item = RiverLibinputDeviceV1ScrollMethods;
fn next(&mut self) -> Option<Self::Item> {
if self.0 == 0 {
return None;
}
let bit = 1 << self.0.trailing_zeros();
self.0 &= !bit;
Some(RiverLibinputDeviceV1ScrollMethods(bit))
}
}
impl IntoIterator for RiverLibinputDeviceV1ScrollMethods {
type Item = RiverLibinputDeviceV1ScrollMethods;
type IntoIter = RiverLibinputDeviceV1ScrollMethodsIter;
fn into_iter(self) -> Self::IntoIter {
RiverLibinputDeviceV1ScrollMethodsIter(self.0)
}
}
impl BitAnd for RiverLibinputDeviceV1ScrollMethods {
type Output = Self;
fn bitand(self, rhs: Self) -> Self::Output {
self.intersection(rhs)
}
}
impl BitAndAssign for RiverLibinputDeviceV1ScrollMethods {
fn bitand_assign(&mut self, rhs: Self) {
*self = self.intersection(rhs);
}
}
impl BitOr for RiverLibinputDeviceV1ScrollMethods {
type Output = Self;
fn bitor(self, rhs: Self) -> Self::Output {
self.union(rhs)
}
}
impl BitOrAssign for RiverLibinputDeviceV1ScrollMethods {
fn bitor_assign(&mut self, rhs: Self) {
*self = self.union(rhs);
}
}
impl BitXor for RiverLibinputDeviceV1ScrollMethods {
type Output = Self;
fn bitxor(self, rhs: Self) -> Self::Output {
self.symmetric_difference(rhs)
}
}
impl BitXorAssign for RiverLibinputDeviceV1ScrollMethods {
fn bitxor_assign(&mut self, rhs: Self) {
*self = self.symmetric_difference(rhs);
}
}
impl Sub for RiverLibinputDeviceV1ScrollMethods {
type Output = Self;
fn sub(self, rhs: Self) -> Self::Output {
self.difference(rhs)
}
}
impl SubAssign for RiverLibinputDeviceV1ScrollMethods {
fn sub_assign(&mut self, rhs: Self) {
*self = self.difference(rhs);
}
}
impl Not for RiverLibinputDeviceV1ScrollMethods {
type Output = Self;
fn not(self) -> Self::Output {
self.complement()
}
}
impl Debug for RiverLibinputDeviceV1ScrollMethods {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let mut v = self.0;
let mut first = true;
if v & 1 == 1 {
v &= !1;
if first {
first = false;
} else {
f.write_str(" | ")?;
}
f.write_str("TWO_FINGER")?;
}
if v & 2 == 2 {
v &= !2;
if first {
first = false;
} else {
f.write_str(" | ")?;
}
f.write_str("EDGE")?;
}
if v & 4 == 4 {
v &= !4;
if first {
first = false;
} else {
f.write_str(" | ")?;
}
f.write_str("ON_BUTTON_DOWN")?;
}
if v != 0 {
if first {
first = false;
} else {
f.write_str(" | ")?;
}
write!(f, "0x{v:032x}")?;
}
if first {
f.write_str("NO_SCROLL")?;
}
Ok(())
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RiverLibinputDeviceV1ScrollButtonLockState(pub u32);
impl RiverLibinputDeviceV1ScrollButtonLockState {
pub const DISABLED: Self = Self(0);
pub const ENABLED: Self = Self(1);
}
impl Debug for RiverLibinputDeviceV1ScrollButtonLockState {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let name = match *self {
Self::DISABLED => "DISABLED",
Self::ENABLED => "ENABLED",
_ => return Debug::fmt(&self.0, f),
};
f.write_str(name)
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RiverLibinputDeviceV1DwtState(pub u32);
impl RiverLibinputDeviceV1DwtState {
pub const DISABLED: Self = Self(0);
pub const ENABLED: Self = Self(1);
}
impl Debug for RiverLibinputDeviceV1DwtState {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let name = match *self {
Self::DISABLED => "DISABLED",
Self::ENABLED => "ENABLED",
_ => return Debug::fmt(&self.0, f),
};
f.write_str(name)
}
}
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
pub struct RiverLibinputDeviceV1DwtpState(pub u32);
impl RiverLibinputDeviceV1DwtpState {
pub const DISABLED: Self = Self(0);
pub const ENABLED: Self = Self(1);
}
impl Debug for RiverLibinputDeviceV1DwtpState {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let name = match *self {
Self::DISABLED => "DISABLED",
Self::ENABLED => "ENABLED",
_ => return Debug::fmt(&self.0, f),
};
f.write_str(name)
}
}