Skip to main content

TopLevelImpl

Struct TopLevelImpl 

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

The state and behaviour every top-level of this backend shares.

Deviation (DEVIATIONS.md, Native backend): in the reference the top-level is its own software (framebuffer) render surface. Here that is TopLevelFramebufferSurface: a render surface is shared with the thread that renders, and the top-level is an object of the UI thread.

Implementations§

Source§

impl TopLevelImpl

Source

pub fn input_method(&self) -> Option<Rc<FerroNativeTextInputMethod>>

The text input method of the top-level.

Source

pub fn desktop_scaling(&self) -> f64

Source

pub fn native(&self) -> Option<ComPtr<IFrnTopLevel>>

The native top-level; None once it is disposed.

Source

pub fn mac_os_handle(&self) -> Option<Rc<MacOSTopLevelHandle>>

The platform handle with its concrete type.

Source

pub fn handle(&self) -> Option<Rc<dyn IPlatformHandle>>

Source

pub fn client_size(&self) -> Size

Source

pub fn render_scaling(&self) -> f64

Source

pub fn surfaces(&self) -> Vec<Arc<dyn IPlatformRenderSurface>>

Source

pub fn render_surfaces( &self, ) -> Arc<dyn Fn() -> Vec<Arc<dyn IPlatformRenderSurface>> + Send + Sync> ⓘ

The surfaces as the thread that renders asks for them: the function reads the cell the top-level publishes its surfaces in, and never reaches the top-level itself.

Deviation (DEVIATIONS.md, Native backend): Surfaces of the reference keeps returning the surfaces of a disposed top-level, whose native object then fails every call. Here the surfaces are gone once the top-level is disposed: they gave their native top-level back on the UI thread, and a render target can no longer be created for them.

Source

pub fn transparency_level(&self) -> WindowTransparencyLevel

Source

pub fn acrylic_compensation_levels(&self) -> AcrylicPlatformCompensationLevels

Source

pub fn get_automation_peer(&self) -> Option<Ref<AutomationPeer>>

The automation peer of the focus root of the top-level, if it is a control.

Source

pub fn raw_text_input_event(&self, time_stamp: u64, text: &str) -> bool

Source

pub fn raw_key_event( &self, type_: FrnRawKeyEventType, time_stamp: u64, modifiers: FrnInputModifiers, key: FrnKey, physical_key: FrnPhysicalKey, key_symbol: Option<String>, ) -> bool

Source

pub fn invalidate(&self)

Source

pub fn set_input_root(&self, input_root: Rc<dyn IInputRoot>)

Source

pub fn point_to_client(&self, point: PixelPoint) -> Point

Source

pub fn point_to_screen(&self, point: Point) -> PixelPoint

Source

pub fn set_cursor(&self, cursor: Option<Rc<dyn ICursorImpl>>)

Source

pub fn set_transparency_level_hint( &self, transparency_levels: &[WindowTransparencyLevel], )

Source

pub fn try_get_feature(&self, feature_type: TypeId) -> Option<Rc<dyn Any>>

The optional features of every top-level of this backend.

The features whose contracts are not ported yet (native control host, launcher) are absent.

Source

pub fn native_control_host(&self) -> Option<Rc<dyn INativeControlHostImpl>>

The host of native controls of the top-level; None once it is disposed.

Source§

impl TopLevelImpl

Source

pub fn input(&self) -> Option<Rc<dyn Fn(Rc<dyn IRawInputEventArgs>)>>

Source

pub fn set_input(&self, value: Option<Rc<dyn Fn(Rc<dyn IRawInputEventArgs>)>>)

Source

pub fn paint(&self) -> Option<Rc<dyn Fn(Rect)>>

Source

pub fn set_paint(&self, value: Option<Rc<dyn Fn(Rect)>>)

Source

pub fn resized(&self) -> Option<Rc<dyn Fn(Size, WindowResizeReason)>>

Source

pub fn set_resized(&self, value: Option<Rc<dyn Fn(Size, WindowResizeReason)>>)

Source

pub fn scaling_changed(&self) -> Option<Rc<dyn Fn(f64)>>

Source

pub fn set_scaling_changed(&self, value: Option<Rc<dyn Fn(f64)>>)

Source

pub fn transparency_level_changed( &self, ) -> Option<Rc<dyn Fn(WindowTransparencyLevel)>>

Source

pub fn set_transparency_level_changed( &self, value: Option<Rc<dyn Fn(WindowTransparencyLevel)>>, )

Source

pub fn closed(&self) -> Option<Rc<dyn Fn()>>

Source

pub fn set_closed(&self, value: Option<Rc<dyn Fn()>>)

Source

pub fn lost_focus(&self) -> Option<Rc<dyn Fn()>>

Source

pub fn set_lost_focus(&self, value: Option<Rc<dyn Fn()>>)

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> ClassDefaults for T
where T: ?Sized,

Source§

fn static_constructor()

The static constructor of a type: work done once per thread, after the properties of the type are registered and before its first instance exists (class handlers, affects_render, metadata overrides). Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.