Go to index / Go to protocols

agl_screenshooter ↗

agl_screenshooter
agl_screenshooter

Version 1

agl screenshooter

agl compositor extension that performs a screenshot of the output, which is represented by a 'wl_output' object.

A client would call 'take_shot' request and wait until the compositor finishes to write the data to a wayland buffer, moment in which signals back the client with the help of the 'done' event. Clients should wait until the 'done' event is received, if they want to take another screenshot, or take another screnshot of a different output.

The client must provide a wl_shm-based wl_buffer of the correct size when taking a shot. The compositor will write the shot into the wl_buffer and then send the 'done' event that signals completion of writing the data.

Once the compositor has finished to transfer the data back into the supplied wayland buffer, the client should be able to transfer it to a popular file format on the disk.

agl_screenshooter
enum done_status {
    success = 0,
    no_memory = 1,
    bad_buffer = 2,
}
    agl_screenshooter
    request take_shot(
        output: object<wl_output>,
        buffer: object<wl_buffer>,
    )

      performs a screenshot

      Takes a screenshot of the wayland output represented by a 'wl_output' object. Clients should first retrieve it using global registry, as well as the 'wl_shm' object in order to create a wayland buffer type of object ('wl_buffer').

      Clients can derive the stride and size from the 'wl_output' object, and later on use those when creating shm-based 'wl_buffer', as well as supplying the pixel format.

      agl_screenshooter
      event done(
          status: uint<done_status>,
      )

        sent when 'take_shot' finished

        Even sent back to notify client 'take_shot' request has completed.

        agl_screenshooter
        request destroy()
        Destructor

          destroy main object

          Destroys the 'weston_screenshooter' interface.