//! A seat is a group of keyboards, pointer and touch devices. this object is
//! published as a global during start up, or when such a device is hot plugged. a
//! seat typically has a pointer and maintains a keyboard focus and a pointer focus.
//
//
// GENERATED BY OUR WAYLAND-SCANNER. DO NOT EDIT!
//
//
#![allow(unused)]
#![allow(clippy::from_over_into)]
#![allow(clippy::match_single_binding)]
use crate::wl::{
Array, Connection, Handle, Interface, Message, NewId, ObjectId, Opcode, Payload, PayloadType,
RawMessage, SendError,
};
use alloc::rc::Rc;
use alloc::string::String;
use core::cell::RefCell;
use smallvec::smallvec;
use crate::wl::protocols::common::wl_buffer::WlBuffer;
use crate::wl::protocols::common::wl_callback::WlCallback;
use crate::wl::protocols::common::wl_compositor::WlCompositor;
use crate::wl::protocols::common::wl_data_device::WlDataDevice;
use crate::wl::protocols::common::wl_data_device_manager::WlDataDeviceManager;
use crate::wl::protocols::common::wl_data_offer::WlDataOffer;
use crate::wl::protocols::common::wl_data_source::WlDataSource;
use crate::wl::protocols::common::wl_display::WlDisplay;
use crate::wl::protocols::common::wl_keyboard::WlKeyboard;
use crate::wl::protocols::common::wl_output::WlOutput;
use crate::wl::protocols::common::wl_pointer::WlPointer;
use crate::wl::protocols::common::wl_region::WlRegion;
use crate::wl::protocols::common::wl_registry::WlRegistry;
use crate::wl::protocols::common::wl_seat::*;
use crate::wl::protocols::common::wl_shell::WlShell;
use crate::wl::protocols::common::wl_shell_surface::WlShellSurface;
use crate::wl::protocols::common::wl_shm::WlShm;
use crate::wl::protocols::common::wl_shm_pool::WlShmPool;
use crate::wl::protocols::common::wl_subcompositor::WlSubcompositor;
use crate::wl::protocols::common::wl_subsurface::WlSubsurface;
use crate::wl::protocols::common::wl_surface::WlSurface;
use crate::wl::protocols::common::wl_touch::WlTouch;
use crate::wl::protocols::common::xdg_popup::XdgPopup;
use crate::wl::protocols::common::xdg_positioner::XdgPositioner;
use crate::wl::protocols::common::xdg_surface::XdgSurface;
use crate::wl::protocols::common::xdg_toplevel::XdgToplevel;
use crate::wl::protocols::common::xdg_wm_base::XdgWmBase;
pub trait WlSeatExt {
/// The id provided will be initialized to the wl_pointer interface for this seat.
/// this request only takes effect if the seat has the pointer capability, or has
/// had the pointer capability in the past. it is a protocol violation to issue this
/// request on a seat that has never had the pointer capability. the
/// missing_capability error will be sent in this case.
fn get_pointer(&self, id: NewId) -> Result<(), SendError>;
/// The id provided will be initialized to the wl_keyboard interface for this seat.
/// this request only takes effect if the seat has the keyboard capability, or has
/// had the keyboard capability in the past. it is a protocol violation to issue
/// this request on a seat that has never had the keyboard capability. the
/// missing_capability error will be sent in this case.
fn get_keyboard(&self, id: NewId) -> Result<(), SendError>;
/// The id provided will be initialized to the wl_touch interface for this seat.
/// this request only takes effect if the seat has the touch capability, or has had
/// the touch capability in the past. it is a protocol violation to issue this
/// request on a seat that has never had the touch capability. the
/// missing_capability error will be sent in this case.
fn get_touch(&self, id: NewId) -> Result<(), SendError>;
/// Using this request a client can tell the server that it is not going to use the
/// seat object anymore.
fn release(&self) -> Result<(), SendError>;
}
impl WlSeatExt for WlSeat {
/// The id provided will be initialized to the wl_pointer interface for this seat.
/// this request only takes effect if the seat has the pointer capability, or has
/// had the pointer capability in the past. it is a protocol violation to issue this
/// request on a seat that has never had the pointer capability. the
/// missing_capability error will be sent in this case.
fn get_pointer(&self, id: NewId) -> Result<(), SendError> {
self.connection()
.borrow_mut()
.send(Request::GetPointer { id }.into_raw(self.id()))
}
/// The id provided will be initialized to the wl_keyboard interface for this seat.
/// this request only takes effect if the seat has the keyboard capability, or has
/// had the keyboard capability in the past. it is a protocol violation to issue
/// this request on a seat that has never had the keyboard capability. the
/// missing_capability error will be sent in this case.
fn get_keyboard(&self, id: NewId) -> Result<(), SendError> {
self.connection()
.borrow_mut()
.send(Request::GetKeyboard { id }.into_raw(self.id()))
}
/// The id provided will be initialized to the wl_touch interface for this seat.
/// this request only takes effect if the seat has the touch capability, or has had
/// the touch capability in the past. it is a protocol violation to issue this
/// request on a seat that has never had the touch capability. the
/// missing_capability error will be sent in this case.
fn get_touch(&self, id: NewId) -> Result<(), SendError> {
self.connection()
.borrow_mut()
.send(Request::GetTouch { id }.into_raw(self.id()))
}
/// Using this request a client can tell the server that it is not going to use the
/// seat object anymore.
fn release(&self) -> Result<(), SendError> {
self.connection()
.borrow_mut()
.send(Request::Release {}.into_raw(self.id()))
}
}