Trait x11rb::protocol::shm::ConnectionExt

source ·
pub trait ConnectionExt: RequestConnection {
    // Provided methods
    fn shm_query_version(
        &self
    ) -> Result<Cookie<'_, Self, QueryVersionReply>, ConnectionError> { ... }
    fn shm_attach(
        &self,
        shmseg: Seg,
        shmid: u32,
        read_only: bool
    ) -> Result<VoidCookie<'_, Self>, ConnectionError> { ... }
    fn shm_detach(
        &self,
        shmseg: Seg
    ) -> Result<VoidCookie<'_, Self>, ConnectionError> { ... }
    fn shm_put_image(
        &self,
        drawable: Drawable,
        gc: Gcontext,
        total_width: u16,
        total_height: u16,
        src_x: u16,
        src_y: u16,
        src_width: u16,
        src_height: u16,
        dst_x: i16,
        dst_y: i16,
        depth: u8,
        format: u8,
        send_event: bool,
        shmseg: Seg,
        offset: u32
    ) -> Result<VoidCookie<'_, Self>, ConnectionError> { ... }
    fn shm_get_image(
        &self,
        drawable: Drawable,
        x: i16,
        y: i16,
        width: u16,
        height: u16,
        plane_mask: u32,
        format: u8,
        shmseg: Seg,
        offset: u32
    ) -> Result<Cookie<'_, Self, GetImageReply>, ConnectionError> { ... }
    fn shm_create_pixmap(
        &self,
        pid: Pixmap,
        drawable: Drawable,
        width: u16,
        height: u16,
        depth: u8,
        shmseg: Seg,
        offset: u32
    ) -> Result<VoidCookie<'_, Self>, ConnectionError> { ... }
    fn shm_attach_fd<A>(
        &self,
        shmseg: Seg,
        shm_fd: A,
        read_only: bool
    ) -> Result<VoidCookie<'_, Self>, ConnectionError>
       where A: Into<RawFdContainer> { ... }
    fn shm_create_segment(
        &self,
        shmseg: Seg,
        size: u32,
        read_only: bool
    ) -> Result<CookieWithFds<'_, Self, CreateSegmentReply>, ConnectionError> { ... }
}
Expand description

Extension trait defining the requests of this extension.

Provided Methods§

source

fn shm_query_version( &self ) -> Result<Cookie<'_, Self, QueryVersionReply>, ConnectionError>

Query the version of the MIT-SHM extension..

This is used to determine the version of the MIT-SHM extension supported by the X server. Clients MUST NOT make other requests in this extension until a reply to this requests indicates the X server supports them.

source

fn shm_attach( &self, shmseg: Seg, shmid: u32, read_only: bool ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Attach a System V shared memory segment..

Attach a System V shared memory segment to the server. This will fail unless the server has permission to map the segment. The client may destroy the segment as soon as it receives a XCB_SHM_COMPLETION event with the shmseg value in this request and with the appropriate serial number.

§Fields
  • shmseg - A shared memory segment ID created with xcb_generate_id().
  • shmid - The System V shared memory segment the server should map.
  • read_only - True if the segment shall be mapped read only by the X11 server, otherwise false.
source

fn shm_detach( &self, shmseg: Seg ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Destroys the specified shared memory segment..

Destroys the specified shared memory segment. This will never fail unless the segment number is incorrect.

§Fields
  • shmseg - The segment to be destroyed.
source

fn shm_put_image( &self, drawable: Drawable, gc: Gcontext, total_width: u16, total_height: u16, src_x: u16, src_y: u16, src_width: u16, src_height: u16, dst_x: i16, dst_y: i16, depth: u8, format: u8, send_event: bool, shmseg: Seg, offset: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Copy data from the shared memory to the specified drawable..

Copy data from the shared memory to the specified drawable. The amount of bytes written to the destination image is always equal to the number of bytes read from the shared memory segment.

§Fields
  • drawable - The drawable to draw to.
  • gc - The graphics context to use.
  • total_width - The total width of the source image.
  • total_height - The total height of the source image.
  • src_x - The source X coordinate of the sub-image to copy.
  • src_y - The source Y coordinate of the sub-image to copy.
  • src_width - The width, in source image coordinates, of the data to copy from the source. The X server will use this to determine the amount of data to copy. The amount of the destination image that is overwritten is determined automatically.
  • src_height - The height, in source image coordinates, of the data to copy from the source. The X server will use this to determine the amount of data to copy. The amount of the destination image that is overwritten is determined automatically.
  • dst_x - The X coordinate on the destination drawable to copy to.
  • dst_y - The Y coordinate on the destination drawable to copy to.
  • depth - The depth to use.
  • format - The format of the image being drawn. If it is XYBitmap, depth must be 1, or a “BadMatch” error results. The foreground pixel in the GC determines the source for the one bits in the image, and the background pixel determines the source for the zero bits. For XYPixmap and ZPixmap, the depth must match the depth of the drawable, or a “BadMatch” error results.
  • send_event - True if the server should send an XCB_SHM_COMPLETION event when the blit completes.
  • offset - The offset that the source image starts at.
source

fn shm_get_image( &self, drawable: Drawable, x: i16, y: i16, width: u16, height: u16, plane_mask: u32, format: u8, shmseg: Seg, offset: u32 ) -> Result<Cookie<'_, Self, GetImageReply>, ConnectionError>

Copies data from the specified drawable to the shared memory segment..

Copy data from the specified drawable to the shared memory segment. The amount of bytes written to the destination image is always equal to the number of bytes read from the shared memory segment.

§Fields
  • drawable - The drawable to copy the image out of.
  • x - The X coordinate in the drawable to begin copying at.
  • y - The Y coordinate in the drawable to begin copying at.
  • width - The width of the image to copy.
  • height - The height of the image to copy.
  • plane_mask - A mask that determines which planes are used.
  • format - The format to use for the copy (???).
  • shmseg - The destination shared memory segment.
  • offset - The offset in the shared memory segment to copy data to.
source

fn shm_create_pixmap( &self, pid: Pixmap, drawable: Drawable, width: u16, height: u16, depth: u8, shmseg: Seg, offset: u32 ) -> Result<VoidCookie<'_, Self>, ConnectionError>

Create a pixmap backed by shared memory..

Create a pixmap backed by shared memory. Writes to the shared memory will be reflected in the contents of the pixmap, and writes to the pixmap will be reflected in the contents of the shared memory.

§Fields
  • pid - A pixmap ID created with xcb_generate_id().
  • drawable - The drawable to create the pixmap in.
  • width - The width of the pixmap to create. Must be nonzero, or a Value error results.
  • height - The height of the pixmap to create. Must be nonzero, or a Value error results.
  • depth - The depth of the pixmap to create. Must be nonzero, or a Value error results.
  • shmseg - The shared memory segment to use to create the pixmap.
  • offset - The offset in the segment to create the pixmap at.
source

fn shm_attach_fd<A>( &self, shmseg: Seg, shm_fd: A, read_only: bool ) -> Result<VoidCookie<'_, Self>, ConnectionError>
where A: Into<RawFdContainer>,

Create a shared memory segment.

Create a shared memory segment. The file descriptor will be mapped at offset zero, and the size will be obtained using fstat(). A zero size will result in a Value error.

§Fields
  • shmseg - A shared memory segment ID created with xcb_generate_id().
  • shm_fd - The file descriptor the server should mmap().
  • read_only - True if the segment shall be mapped read only by the X11 server, otherwise false.
source

fn shm_create_segment( &self, shmseg: Seg, size: u32, read_only: bool ) -> Result<CookieWithFds<'_, Self, CreateSegmentReply>, ConnectionError>

Asks the server to allocate a shared memory segment..

Asks the server to allocate a shared memory segment. The server’s reply will include a file descriptor for the client to pass to mmap().

§Fields
  • shmseg - A shared memory segment ID created with xcb_generate_id().
  • size - The size of the segment to create.
  • read_only - True if the server should map the segment read-only; otherwise false.

Object Safety§

This trait is not object safe.

Implementors§