pub struct Surface { /* private fields */ }
Expand description
A Surface is the object backing wl_surface protocol objects.
A Surface alone is not of much use until it’s been assigned a role. Surface roles are assigned implicitly when binding the role object to the surface.
For example, the request wl_shell::get_shell_surface(new_id, object<wl_surface>)
will create a new wl_shell_surface object for the provided surface. When
this happens we assign the wl_shell_surface
role to the underlying
wl_surface
object. Once a surface has been assigned a role, it is an error
to attempt to assign it a different role.
Implementations§
Source§impl Surface
impl Surface
Sourcepub fn enqueue(&mut self, command: SurfaceCommand)
pub fn enqueue(&mut self, command: SurfaceCommand)
Enqueues a command for this surface to take effect on the next call to wl_surface::commit.
pub fn detach_subsurface(&mut self, subsurface_ref: ObjectRef<Subsurface>)
Sourcepub fn set_role(&mut self, role: SurfaceRole) -> Result<(), Error>
pub fn set_role(&mut self, role: SurfaceRole) -> Result<(), Error>
Assigns a role to this surface.
The role can be updated as long as the type of role remains the same, it is an error to set a different type of role for that same surface.
pub fn set_parent_and_offset( &mut self, parent: Option<ObjectRef<Surface>>, x: i32, y: i32, )
pub fn window_geometry(&self) -> Rect
pub fn offset(&self) -> Option<(i32, i32)>
pub fn hit_test( &self, x: f32, y: f32, client: &Client, ) -> Option<(ObjectRef<Self>, (i32, i32))>
Sourcepub fn set_flatland(&mut self, flatland: FlatlandPtr) -> Result<(), Error>
pub fn set_flatland(&mut self, flatland: FlatlandPtr) -> Result<(), Error>
Assigns the Flatland instance for this surface.
When a surface is initially created, it has no Flatland instance. Since the instance is used to create the Flatland resources backing the surface, a wl_surface must have an assigned an instance before it is committed.
Ex: for xdg_toplevel surfaces, the a new instance will be created for each toplevel.
It is an error to call set_flatland
multiple times for the same
surface.
pub fn clear_flatland(&mut self)
pub fn flatland(&self) -> Option<FlatlandPtr>
Sourcepub fn transform(&self) -> Option<&TransformId>
pub fn transform(&self) -> Option<&TransformId>
Returns a reference to the TransformId
for this surface.