pub struct PureX11Client {
pub stream: UnixStream,
pub info: X11ServerInfo,
pub next_resource_id: u32,
pub mit_shm_opcode: Option<u8>,
pub read_buffer: Vec<u8>,
pub encoder: X11WireEncoder,
}Expand description
Pure-Rust X11 client connection manager communicating directly over UNIX domain sockets.
Fields§
§stream: UnixStream§info: X11ServerInfo§next_resource_id: u32§mit_shm_opcode: Option<u8>§read_buffer: Vec<u8>§encoder: X11WireEncoderImplementations§
Source§impl PureX11Client
impl PureX11Client
Sourcepub fn connect(socket_path: &str) -> Result<Self, String>
pub fn connect(socket_path: &str) -> Result<Self, String>
Establishes connection to the active X server and performs the protocol handshake.
Sourcepub fn allocate_id(&mut self) -> u32
pub fn allocate_id(&mut self) -> u32
Allocates a unique X11 resource ID.
Sourcepub fn flush_encoder(&mut self) -> Result<(), String>
pub fn flush_encoder(&mut self) -> Result<(), String>
Sends current encoder contents down the socket.
Sourcepub fn query_extension(&mut self, name: &str) -> Result<Option<u8>, String>
pub fn query_extension(&mut self, name: &str) -> Result<Option<u8>, String>
Queries the server for an extension by name.
Sourcepub fn create_window(
&mut self,
window_id: u32,
parent: u32,
width: u16,
height: u16,
) -> Result<(), String>
pub fn create_window( &mut self, window_id: u32, parent: u32, width: u16, height: u16, ) -> Result<(), String>
Sends a CreateWindow request.
Sourcepub fn map_window(&mut self, window_id: u32) -> Result<(), String>
pub fn map_window(&mut self, window_id: u32) -> Result<(), String>
Sends a MapWindow request to display the window on screen.
Sourcepub fn create_gc(&mut self, gc_id: u32, drawable_id: u32) -> Result<(), String>
pub fn create_gc(&mut self, gc_id: u32, drawable_id: u32) -> Result<(), String>
Sends a CreateGC request for software blitting.
Sourcepub fn set_wm_name(&mut self, window_id: u32, title: &str) -> Result<(), String>
pub fn set_wm_name(&mut self, window_id: u32, title: &str) -> Result<(), String>
Sets the window title via ChangeProperty (WM_NAME).
Sourcepub fn shm_attach(
&mut self,
shm_major: u8,
shmseg_id: u32,
shmid: c_int,
) -> Result<(), String>
pub fn shm_attach( &mut self, shm_major: u8, shmseg_id: u32, shmid: c_int, ) -> Result<(), String>
Attaches a shared memory segment with the X server via MIT-SHM ShmAttach.
Sourcepub fn shm_put_image(
&mut self,
shm_major: u8,
drawable: u32,
gc: u32,
shmseg: u32,
width: u16,
height: u16,
) -> Result<(), String>
pub fn shm_put_image( &mut self, shm_major: u8, drawable: u32, gc: u32, shmseg: u32, width: u16, height: u16, ) -> Result<(), String>
Dispatches a zero-copy blit from shared memory via MIT-SHM ShmPutImage.
Sourcepub fn put_image(
&mut self,
drawable: u32,
gc: u32,
width: u16,
height: u16,
pixels: &[u8],
) -> Result<(), String>
pub fn put_image( &mut self, drawable: u32, gc: u32, width: u16, height: u16, pixels: &[u8], ) -> Result<(), String>
Dispatches a streaming pixel blit via standard PutImage (ZPixmap).
Auto Trait Implementations§
impl Forget for PureX11Client
impl Freeze for PureX11Client
impl Move for PureX11Client
impl RefUnwindSafe for PureX11Client
impl Send for PureX11Client
impl Sync for PureX11Client
impl Unpin for PureX11Client
impl UnsafeUnpin for PureX11Client
impl UnwindSafe for PureX11Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more