pub struct WindowComposition<'a> { /* private fields */ }Expand description
Controls the surface tree composited into a window.
Implementations§
Source§impl WindowComposition<'_>
impl WindowComposition<'_>
Sourcepub fn on_input(
&self,
surface: CompositionSurfaceId,
handler: impl FnMut(&PlatformInput) -> DispatchEventResult + 'static,
) -> Result<()>
pub fn on_input( &self, surface: CompositionSurfaceId, handler: impl FnMut(&PlatformInput) -> DispatchEventResult + 'static, ) -> Result<()>
Registers a cooperating windowless producer’s mouse/wheel consumer. Capture runs first; coordinates are in window-content logical pixels. OS-managed child views need no handler and keep their platform input path.
Sourcepub fn base_surface(&self) -> CompositionSurfaceId
pub fn base_surface(&self) -> CompositionSurfaceId
Returns the GPUI surface initially rendered below native content.
Sourcepub fn overlay_surface(&self) -> CompositionSurfaceId
pub fn overlay_surface(&self) -> CompositionSurfaceId
Returns the GPUI surface initially rendered above native content.
Sourcepub fn create_native_surface(&self) -> Result<WindowCompositionSurface>
pub fn create_native_surface(&self) -> Result<WindowCompositionSurface>
Creates a platform-native surface as a root of the composition tree, below the overlay surface.
Sourcepub fn create_external_gpu_surface(
&self,
platform_surface: Rc<dyn PlatformSurfaceAttachment>,
) -> Result<WindowCompositionSurface>
pub fn create_external_gpu_surface( &self, platform_surface: Rc<dyn PlatformSurfaceAttachment>, ) -> Result<WindowCompositionSurface>
Registers an externally produced GPU surface as a root of the composition tree, below the overlay surface.
The producer owns the platform attachment and its synchronization. GPUI owns its placement in the window composition tree.
Sourcepub fn create_gpui_surface(
&self,
parent: Option<CompositionSurfaceId>,
) -> Result<WindowCompositionSurface>
pub fn create_gpui_surface( &self, parent: Option<CompositionSurfaceId>, ) -> Result<WindowCompositionSurface>
Creates another GPUI-rendered surface in the composition tree. Paint
onto it with Window::with_composition_surface.
Sourcepub fn place_above(
&self,
surface: CompositionSurfaceId,
sibling: CompositionSurfaceId,
) -> Result<()>
pub fn place_above( &self, surface: CompositionSurfaceId, sibling: CompositionSurfaceId, ) -> Result<()>
Places surface immediately above sibling.
Sourcepub fn place_below(
&self,
surface: CompositionSurfaceId,
sibling: CompositionSurfaceId,
) -> Result<()>
pub fn place_below( &self, surface: CompositionSurfaceId, sibling: CompositionSurfaceId, ) -> Result<()>
Places surface immediately below sibling.
Sourcepub fn reparent(
&self,
surface: CompositionSurfaceId,
parent: Option<CompositionSurfaceId>,
) -> Result<()>
pub fn reparent( &self, surface: CompositionSurfaceId, parent: Option<CompositionSurfaceId>, ) -> Result<()>
Moves surface under a new parent, placing it above existing children.
Sourcepub fn remove_surface(&self, surface: CompositionSurfaceId) -> Result<()>
pub fn remove_surface(&self, surface: CompositionSurfaceId) -> Result<()>
Removes a surface while preserving its children at the removed surface’s previous position.
Sourcepub fn surface_kind(
&self,
surface: CompositionSurfaceId,
) -> Result<CompositionSurfaceKind>
pub fn surface_kind( &self, surface: CompositionSurfaceId, ) -> Result<CompositionSurfaceKind>
Returns the renderer kind for a surface.
Sourcepub fn parent(
&self,
surface: CompositionSurfaceId,
) -> Result<Option<CompositionSurfaceId>>
pub fn parent( &self, surface: CompositionSurfaceId, ) -> Result<Option<CompositionSurfaceId>>
Returns a surface’s parent.
Sourcepub fn children(
&self,
parent: Option<CompositionSurfaceId>,
) -> Result<Vec<CompositionSurfaceId>>
pub fn children( &self, parent: Option<CompositionSurfaceId>, ) -> Result<Vec<CompositionSurfaceId>>
Returns the ordered children of a surface, or the root surfaces when
parent is None.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for WindowComposition<'a>
impl<'a> !Send for WindowComposition<'a>
impl<'a> !Sync for WindowComposition<'a>
impl<'a> !UnwindSafe for WindowComposition<'a>
impl<'a> Freeze for WindowComposition<'a>
impl<'a> Unpin for WindowComposition<'a>
impl<'a> UnsafeUnpin for WindowComposition<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more