use {super::super::all_types::*, crate::builder::prelude::*};
static INTERFACE: wl_interface = wl_interface {
name: c"wl_surface".as_ptr(),
version: 1,
method_count: 0,
methods: ptr::null(),
event_count: 0,
events: ptr::null(),
};
#[derive(Clone, Eq, PartialEq)]
#[repr(transparent)]
pub struct WlSurface {
proxy: UntypedOwnedProxy,
}
#[derive(Eq, PartialEq)]
#[repr(transparent)]
pub struct WlSurfaceRef {
proxy: UntypedBorrowedProxy,
}
unsafe impl UntypedOwnedProxyWrapper for WlSurface {}
unsafe impl OwnedProxy for WlSurface {
const INTERFACE: &'static str = "wl_surface";
const WL_INTERFACE: &'static wl_interface = &INTERFACE;
const NO_OP_EVENT_HANDLER: Self::NoOpEventHandler =
private::EventHandler(private::NoOpEventHandler);
const MAX_VERSION: u32 = 1;
type Borrowed = WlSurfaceRef;
type Api = private::ProxyApi;
type NoOpEventHandler = private::EventHandler<private::NoOpEventHandler>;
}
unsafe impl UntypedBorrowedProxyWrapper for WlSurfaceRef {}
unsafe impl BorrowedProxy for WlSurfaceRef {
type Owned = WlSurface;
}
impl Deref for WlSurface {
type Target = WlSurfaceRef;
fn deref(&self) -> &Self::Target {
proxy::low_level::deref(self)
}
}
mod private {
pub struct ProxyApi;
#[allow(dead_code)]
pub struct EventHandler<H>(pub(super) H);
#[allow(dead_code)]
pub struct NoOpEventHandler;
}
impl Debug for WlSurface {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "wl_surface#{}", self.proxy.id())
}
}
impl Debug for WlSurfaceRef {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "wl_surface#{}", self.proxy.id())
}
}
impl PartialEq<WlSurfaceRef> for WlSurface {
fn eq(&self, other: &WlSurfaceRef) -> bool {
self.proxy == other.proxy
}
}
impl PartialEq<WlSurface> for WlSurfaceRef {
fn eq(&self, other: &WlSurface) -> bool {
self.proxy == other.proxy
}
}
#[allow(dead_code)]
pub trait WlSurfaceEventHandler {}
impl WlSurfaceEventHandler for private::NoOpEventHandler {}
unsafe impl<H> EventHandler for private::EventHandler<H>
where
H: WlSurfaceEventHandler,
{
const WL_INTERFACE: &'static wl_interface = &INTERFACE;
#[allow(unused_variables)]
unsafe fn handle_event(
&self,
queue: &Queue,
data: *mut u8,
slf: &UntypedBorrowedProxy,
opcode: u32,
args: *mut wl_argument,
) {
invalid_opcode("wl_surface", opcode);
}
}
impl<H> CreateEventHandler<H> for private::ProxyApi
where
H: WlSurfaceEventHandler,
{
type EventHandler = private::EventHandler<H>;
#[inline]
fn create_event_handler(handler: H) -> Self::EventHandler {
private::EventHandler(handler)
}
}
pub mod event_handlers {
use super::*;
impl WlSurface {}
}