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

@ -1,21 +1,18 @@
pub use crate::xcon::{
formatter::Formatter,
parser::Parser,
wire_type::{Message, Request, XEvent},
pub use jay_xcon::{
consts, xauthority, Formatter, Message, Parser, Request, SendEvent, XEvent, XconError,
};
use {
crate::{
async_engine::{Phase, SpawnedFuture},
compositor::DISPLAY,
io_uring::IoUringError,
state::State,
utils::{
buf::DynamicBuf,
bufio::{BufIo, BufIoError, BufIoMessage},
bufio::{BufIo, BufIoMessage},
clonecell::CloneCell,
errorfmt::ErrorFmt,
numcell::NumCell,
oserror::{OsError, OsErrorExt2},
oserror::OsErrorExt2,
queue::AsyncQueue,
stack::Stack,
vec_ext::VecExt,
@ -29,7 +26,6 @@ use {
consts::{IMAGE_FORMAT_Z_PIXMAP, RENDER_PICT_TYPE_DIRECT},
incoming::handle_incoming,
outgoing::handle_outgoing,
wire_type::SendEvent,
xauthority::{LOCAL, MIT_MAGIC_COOKIE, XAuthority},
},
},
@ -49,93 +45,11 @@ use {
rc::{Rc, Weak},
task::{Context, Poll, Waker},
},
thiserror::Error,
uapi::{OwnedFd, c},
};
pub mod consts;
mod formatter;
mod incoming;
mod outgoing;
mod parser;
mod wire_type;
mod xauthority;
#[derive(Debug, Error)]
pub enum XconError {
#[error("Unexpected EOF")]
UnexpectedEof,
#[error("Buffer slice is not properly aligned")]
UnalignedSlice,
#[error("Neither XAUTHORITY nor HOME is set")]
HomeNotSet,
#[error("Could not read Xauthority file")]
ReadXAuthority(#[source] std::io::Error),
#[error("Display field in Xauthority could not be parsed")]
InvalidAuthorityDisplay,
#[error("The DISPLAY is not set")]
DisplayNotSet,
#[error("DISPLAY contains an invalid value")]
InvalidDisplayFormat,
#[error("Could not create a unix socket")]
CreateSocket(#[source] OsError),
#[error("Could not connect to Xserver")]
ConnectSocket(#[source] IoUringError),
#[error("Could not retrive the hostname")]
Hostname(#[source] OsError),
#[error("Server did not send enough fds")]
NotEnoughFds,
#[error("Server rejected our connection attempt: {0}")]
Connect(BString),
#[error("Server requires additional authentication: {0}")]
Authenticate(BString),
#[error(transparent)]
BufIoError(#[from] BufIoError),
#[error("The server did not send a reply to a request")]
MissingReply,
#[error("The server did not send fds with a reply")]
MissingFds,
#[error("The server sent a message with an excessive size")]
ExcessiveMessageSize,
#[error(transparent)]
XconError(Rc<XconError>),
#[error("The server does not support the `{0}` extension")]
ExtensionUnavailable(&'static str),
#[error("The server returned error {0}")]
CoreError(u8),
#[error("The extension `{}` returned error {}", .0.name(), .1)]
ExtensionError(Extension, u8),
#[error("The connection to the server has already been closed")]
Dead,
#[error("Could not query the `{0}` extension")]
QueryExtension(BString, #[source] Box<XconError>),
#[error("All available xids have been used")]
XidExhausted,
#[error("Enum contains an unknown variant")]
UnknownEnumVariant,
#[error("Could not query the render pict formats")]
QueryPictFormats(#[source] Box<XconError>),
#[error("The server does not support the picture format for cursors")]
CursorFormatNotSupported,
#[error("Could not create a pixmap")]
CreatePixmap(#[source] Box<XconError>),
#[error("Could not create a graphics context")]
CreateGc(#[source] Box<XconError>),
#[error("Could not upload an image")]
PutImage(#[source] Box<XconError>),
#[error("Could not create a picture")]
CreatePicture(#[source] Box<XconError>),
#[error("Could not create a cursor")]
CreateCursor(#[source] Box<XconError>),
#[error("Property has an invalid type")]
InvalidPropertyType,
#[error("Property has an invalid format. Expected: {0}; Actual: {1}")]
InvalidPropertyFormat(u8, u8),
#[error("Length of the property data is not a multiple of its format")]
IrregularPropertyLength,
#[error("The property is not set")]
PropertyUnavailable,
}
#[derive(Debug)]
struct ExtensionIdRange {