Skip to main content

PureX11Client

Struct PureX11Client 

Source
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: X11WireEncoder

Implementations§

Source§

impl PureX11Client

Source

pub fn connect(socket_path: &str) -> Result<Self, String>

Establishes connection to the active X server and performs the protocol handshake.

Source

pub fn allocate_id(&mut self) -> u32

Allocates a unique X11 resource ID.

Source

pub fn flush_encoder(&mut self) -> Result<(), String>

Sends current encoder contents down the socket.

Source

pub fn query_extension(&mut self, name: &str) -> Result<Option<u8>, String>

Queries the server for an extension by name.

Source

pub fn create_window( &mut self, window_id: u32, parent: u32, width: u16, height: u16, ) -> Result<(), String>

Sends a CreateWindow request.

Source

pub fn map_window(&mut self, window_id: u32) -> Result<(), String>

Sends a MapWindow request to display the window on screen.

Source

pub fn create_gc(&mut self, gc_id: u32, drawable_id: u32) -> Result<(), String>

Sends a CreateGC request for software blitting.

Source

pub fn set_wm_name(&mut self, window_id: u32, title: &str) -> Result<(), String>

Sets the window title via ChangeProperty (WM_NAME).

Source

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.

Source

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.

Source

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).

Source

pub fn intern_atom( &mut self, name: &str, only_if_exists: bool, ) -> Result<u32, String>

Queries or registers an interned atom by name.

Source

pub fn send_client_message( &mut self, dest_window: u32, event_mask: u32, target_window: u32, message_type: u32, data: [u32; 5], ) -> Result<(), String>

Sends a synthetic 32-bit ClientMessage event to a destination window.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoInitialState<T> for T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,