[][src]Trait wayland_server::protocol::wl_shm_pool::RequestHandler

pub trait RequestHandler {
    fn create_buffer(
        &mut self,
        object: WlShmPool,
        id: NewResource<WlBuffer>,
        offset: i32,
        width: i32,
        height: i32,
        stride: i32,
        format: Format
    ) { ... }
fn destroy(&mut self, object: WlShmPool) { ... }
fn resize(&mut self, object: WlShmPool, size: i32) { ... } }

An interface for handling requests.

Provided methods

fn create_buffer(
    &mut self,
    object: WlShmPool,
    id: NewResource<WlBuffer>,
    offset: i32,
    width: i32,
    height: i32,
    stride: i32,
    format: Format
)

create a buffer from the pool

Create a wl_buffer object from the pool.

The buffer is created offset bytes into the pool and has width and height as specified. The stride argument specifies the number of bytes from the beginning of one row to the beginning of the next. The format is the pixel format of the buffer and must be one of those advertised through the wl_shm.format event.

A buffer will keep a reference to the pool it was created from so it is valid to destroy the pool immediately after creating a buffer from it.

fn destroy(&mut self, object: WlShmPool)

destroy the pool

Destroy the shared memory pool.

The mmapped memory will be released when all buffers that have been created from this pool are gone.

This is a destructor, you cannot send requests to this object any longer once this method is called.

fn resize(&mut self, object: WlShmPool, size: i32)

change the size of the pool mapping

This request will cause the server to remap the backing memory for the pool from the file descriptor passed when the pool was created, but using the new size. This request can only be used to make the pool bigger.

Loading content...

Implementors

Loading content...