Struct smithay_client_toolkit::shell::xdg::XdgShellSurface
source · pub struct XdgShellSurface { /* private fields */ }
Expand description
A surface role for functionality common in desktop-like surfaces.
Implementations§
source§impl XdgShellSurface
impl XdgShellSurface
sourcepub fn new<U, D>(
wm_base: &impl ProvidesBoundGlobal<XdgWmBase, { XdgShell::API_VERSION_MAX }>,
qh: &QueueHandle<D>,
surface: impl Into<Surface>,
udata: U,
) -> Result<XdgShellSurface, GlobalError>
pub fn new<U, D>( wm_base: &impl ProvidesBoundGlobal<XdgWmBase, { XdgShell::API_VERSION_MAX }>, qh: &QueueHandle<D>, surface: impl Into<Surface>, udata: U, ) -> Result<XdgShellSurface, GlobalError>
Creates an XdgShellSurface
.
This function is generally intended to be called in a higher level abstraction, such as
XdgShell::create_window
.
The created XdgShellSurface
will destroy the underlying XdgSurface
or WlSurface
when
dropped. Higher level abstractions are responsible for ensuring the destruction order of protocol
objects is correct. Since this function consumes the WlSurface
, it may be accessed using
XdgShellSurface::wl_surface
.
§Protocol errors
If the surface already has a role object, the compositor will raise a protocol error.
A surface is considered to have a role object if some other type of surface was created using the surface. For example, creating a window, popup, layer, subsurface or some other type of surface object all assign a role object to a surface.
pub fn xdg_surface(&self) -> &XdgSurface
pub fn wl_surface(&self) -> &WlSurface
Trait Implementations§
source§impl Debug for XdgShellSurface
impl Debug for XdgShellSurface
source§impl Drop for XdgShellSurface
impl Drop for XdgShellSurface
source§impl WaylandSurface for XdgShellSurface
impl WaylandSurface for XdgShellSurface
source§fn wl_surface(&self) -> &WlSurface
fn wl_surface(&self) -> &WlSurface
WlSurface
.fn attach(&self, buffer: Option<&WlBuffer>, x: u32, y: u32)
fn set_opaque_region(&self, region: Option<&WlRegion>)
fn set_input_region(&self, region: Option<&WlRegion>)
fn set_buffer_transform(&self, transform: Transform) -> Result<(), Unsupported>
fn set_buffer_scale(&self, scale: u32) -> Result<(), Unsupported>
fn offset(&self, x: u32, y: u32) -> Result<(), Unsupported>
source§impl XdgSurface for XdgShellSurface
impl XdgSurface for XdgShellSurface
source§fn xdg_surface(&self) -> &XdgSurface
fn xdg_surface(&self) -> &XdgSurface
XdgSurface
.fn set_window_geometry(&self, x: u32, y: u32, width: u32, height: u32)
Auto Trait Implementations§
impl Freeze for XdgShellSurface
impl !RefUnwindSafe for XdgShellSurface
impl Send for XdgShellSurface
impl Sync for XdgShellSurface
impl Unpin for XdgShellSurface
impl !UnwindSafe for XdgShellSurface
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.