1
0
Fork 0
forked from wry/wry

refactor: split cargo workspace

This commit is contained in:
kossLAN 2026-06-05 11:56:21 -04:00
parent 5db14936e7
commit 1c21bd1259
695 changed files with 32023 additions and 44964 deletions

View file

@ -6,7 +6,7 @@ use {
AxisSource, Backend, BackendConnectorState, BackendEvent, ButtonState, Connector,
ConnectorEvent, ConnectorId, ConnectorKernelId, DrmDeviceId, InputDevice,
InputDeviceAccelProfile, InputDeviceCapability, InputDeviceClickMethod, InputDeviceId,
InputEvent, KeyState, Mode, MonitorInfo, ScrollAxis, TransformMatrix,
InputEvent, KeyState, Mode, MonitorInfo, OutputId, ScrollAxis, TransformMatrix,
transaction::{
BackendAppliedConnectorTransaction, BackendConnectorTransaction,
BackendConnectorTransactionError, BackendConnectorTransactionType,
@ -20,7 +20,6 @@ use {
format::XRGB8888,
gfx_api::GfxError,
gfx_apis::create_vulkan_allocator,
ifs::wl_output::OutputId,
it::{
test_error::TestResult, test_gfx_api::TestGfxCtx, test_utils::test_expected_event::TEEH,
},

View file

@ -6,12 +6,11 @@ use {
tree::OutputNode,
utils::{copyhashmap::CopyHashMap, stack::Stack},
},
bincode::Options,
isnt::std_1::primitive::IsntConstPtrExt,
jay_config::{
_private::{
ConfigEntry, VERSION, bincode_ops,
ipc::{ClientMessage, Response, ServerMessage},
protocol::{
ClientMessage, ConfigEntry, InitMessage, Response, ServerHandler, ServerMessage, Unref,
VERSION,
},
Axis, Direction,
input::{InputDevice, Seat},
@ -53,12 +52,11 @@ where
res
}
unsafe extern "C" fn init(
unsafe fn init(
srv_data: *const u8,
srv_unref: unsafe extern "C" fn(data: *const u8),
srv_handler: unsafe extern "C" fn(data: *const u8, msg: *const u8, size: usize),
_msg: *const u8,
_size: usize,
srv_unref: Unref,
srv_handler: ServerHandler,
_msg: InitMessage,
) -> *const u8 {
let tc = CONFIG.get();
assert!(tc.is_not_null());
@ -76,23 +74,15 @@ unsafe extern "C" fn init(
}
}
unsafe extern "C" fn unref(data: *const u8) {
unsafe fn unref(data: *const u8) {
unsafe {
Rc::decrement_strong_count(data.cast::<TestConfig>());
}
}
unsafe extern "C" fn handle_msg(data: *const u8, msg: *const u8, size: usize) {
unsafe fn handle_msg(data: *const u8, msg: &ServerMessage) {
let tc = unsafe { &*data.cast::<TestConfig>() };
let msg = unsafe { std::slice::from_raw_parts(msg, size) };
let res = bincode_ops().deserialize::<ServerMessage>(msg);
let msg = match res {
Ok(msg) => msg,
Err(e) => {
log::error!("could not deserialize message: {}", e);
return;
}
};
let msg = msg.clone();
match msg {
ServerMessage::Configure { .. } => {}
ServerMessage::Response { response } => {
@ -138,8 +128,8 @@ unsafe extern "C" fn handle_msg(data: *const u8, msg: *const u8, size: usize) {
#[derive(Copy, Clone)]
struct ServerData {
srv_data: *const u8,
srv_unref: unsafe extern "C" fn(data: *const u8),
srv_handler: unsafe extern "C" fn(data: *const u8, msg: *const u8, size: usize),
srv_unref: Unref,
srv_handler: ServerHandler,
}
pub struct TestConfig {
@ -170,10 +160,8 @@ impl TestConfig {
Some(srv) => srv,
_ => bail!("srv not set"),
};
let mut buf = vec![];
bincode_ops().serialize_into(&mut buf, msg).unwrap();
unsafe {
(srv.srv_handler)(srv.srv_data, buf.as_ptr(), buf.len());
(srv.srv_handler)(srv.srv_data, msg);
}
Ok(())
}

View file

@ -2,10 +2,10 @@ use {
crate::{
backend::{
BackendConnectorState, BackendEvent, ConnectorEvent, ConnectorKernelId, MonitorInfo,
OutputId,
},
cmm::cmm_primaries::Primaries,
format::XRGB8888,
ifs::wl_output::OutputId,
it::{test_backend::TestConnector, test_error::TestResult, testrun::TestRun},
utils::numcell::NumCell,
video::drm::ConnectorType,