Skip to main content

Compositor

Struct Compositor 

Source
pub struct Compositor { /* private fields */ }
Expand description

Scene compositor that attaches to native host windows and routes browser surfaces into a declarative composition tree.

Implementations§

Source§

impl Compositor

Source

pub fn new() -> Self

Create an empty compositor with no attached windows.

Source

pub fn attach_window<W, E>( &mut self, window: W, options: AttachWindowOptions, emit: E, ) -> Result<CompositorWindowId, CompositorError>
where W: WindowHost + 'static, E: FnMut(BackendCommand) + 'static,

Attach a host-native window and return its compositor window id.

Source

pub fn detach_window( &mut self, window_id: CompositorWindowId, emit: impl FnMut(BackendCommand), ) -> Result<(), CompositorError>

Detach a previously attached compositor window.

Source

pub fn apply( &mut self, command: CompositionCommand, emit: impl FnMut(BackendCommand), ) -> Result<(), CompositorError>

Apply a declarative scene update to one attached window.

Source

pub fn update_browser_event( &mut self, event: &BrowserEvent, emit: impl FnMut(BrowserCommand), ) -> Result<(), CompositorError>

Feed browser-generic backend events into the compositor state machine.

Source

pub fn update_chrome_event( &mut self, event: &ChromeEvent, ) -> Result<(), CompositorError>

Feed Chrome-specific events into the compositor.

Source

pub fn surface_target_for_item( &self, item_id: CompositionItemId, ) -> Option<SurfaceTarget>

Return the scene target currently displayed by an item.

Source

pub fn item_ids_for_target( &self, target: SurfaceTarget, ) -> Vec<CompositionItemId>

Return every item currently showing the given target.

Source

pub fn window_id_for_item( &self, item_id: CompositionItemId, ) -> Option<CompositorWindowId>

Return the compositor window that owns the given item.

Source

pub fn set_active_item( &mut self, item_id: CompositionItemId, ) -> Result<(), CompositorError>

Programmatically move the active input target to one visible input-receiving item.

Source

pub fn transient_preferred_size( &self, transient_browsing_context_id: TransientBrowsingContextId, ) -> Option<(u32, u32)>

Return the last preferred size hint reported for a transient popup.

Source

pub fn show_context_menu( &mut self, target: SurfaceTarget, menu: ContextMenu, ) -> Result<(), CompositorError>

Present a host-owned context menu for the given surface target.

Source

pub fn show_choice_menu( &mut self, target: SurfaceTarget, menu: ChromeChoiceMenu, ) -> Result<(), CompositorError>

Present a host-owned choice menu for the given surface target.

Source

pub fn start_native_drag( &mut self, request: DragStartRequest, ) -> Result<bool, CompositorError>

Start a host-owned native drag session from a browsing-context target.

Trait Implementations§

Source§

impl Default for Compositor

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,

Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,