pub use { formatter::Formatter, parser::Parser, wire_type::{Message, Request, SendEvent, XEvent}, }; use { bstr::BString, jay_bufio::BufIoError, jay_io_uring::IoUringError, jay_utils::oserror::OsError, std::rc::Rc, thiserror::Error, }; pub mod consts; mod formatter; mod parser; mod wire_type; pub 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), #[error("The server does not support the `{0}` extension")] ExtensionUnavailable(&'static str), #[error("The server returned error {0}")] CoreError(u8), #[error("The extension `{0}` returned error {1}")] ExtensionError(&'static str, u8), #[error("The connection to the server has already been closed")] Dead, #[error("Could not query the `{0}` extension")] QueryExtension(BString, #[source] Box), #[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), #[error("The server does not support the picture format for cursors")] CursorFormatNotSupported, #[error("Could not create a pixmap")] CreatePixmap(#[source] Box), #[error("Could not create a graphics context")] CreateGc(#[source] Box), #[error("Could not upload an image")] PutImage(#[source] Box), #[error("Could not create a picture")] CreatePicture(#[source] Box), #[error("Could not create a cursor")] CreateCursor(#[source] Box), #[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, }