Skip to main content

RendererBinding

Struct RendererBinding 

Source
pub struct RendererBinding { /* private fields */ }

Implementations§

Source§

impl RendererBinding

Source

pub fn instance(app: &mut App) -> Handle<RendererBinding>

The current binding, initialized on first access (Flutter’s initInstances).

Source

pub fn mouse_tracker(self: Handle<Self>, app: &App) -> Handle<MouseTracker>

The object that manages state about currently connected mice, for hover notification.

Source

pub fn init_mouse_tracker( self: Handle<Self>, app: &mut App, tracker: Option<Handle<MouseTracker>>, )

Creates a MouseTracker which manages state about currently connected mice, for hover notification.

Used by testing framework to reinitialize the mouse tracker between tests.

Source

pub fn root_pipeline_owner( self: Handle<Self>, app: &App, ) -> Handle<PipelineOwner>

The PipelineOwner that is the root of the pipeline owner tree.

Typically, this owner has no root render object (a RenderView is attached to the owners the widget layer adds as children). Until then, init_render_view attaches the implicit view here.

Source

pub fn pipeline_owner( self: Handle<Self>, app: &mut App, ) -> Handle<PipelineOwner>

The PipelineOwner Flutter’s binding keeps for the implicit view.

Source

pub fn render_view( self: Handle<Self>, app: &mut App, ) -> RenderHandle<RenderView>

The RenderView for the platform’s implicit view, created on first access.

§Panics

If the platform has no implicit view.

Source

pub fn render_views( self: Handle<Self>, app: &App, ) -> Vec<RenderHandle<RenderView>>

The RenderViews managed by this binding.

Source

pub fn add_render_view( self: Handle<Self>, app: &mut App, view: RenderHandle<RenderView>, )

Adds a RenderView to this binding.

The binding will interact with the RenderView in the following ways:

Source

pub fn remove_render_view( self: Handle<Self>, app: &mut App, view: RenderHandle<RenderView>, )

Removes a RenderView previously added with add_render_view.

Source

pub fn create_view_configuration_for( self: Handle<Self>, app: &App, render_view: RenderHandle<RenderView>, ) -> ViewConfiguration

Returns a ViewConfiguration configured for the provided RenderView based on the current environment.

Source

pub fn handle_metrics_changed(self: Handle<Self>, app: &mut App)

Called when the system metrics change.

See View::metrics.

Source

pub fn send_frames_to_engine(self: Handle<Self>, app: &App) -> bool

Whether frames produced by draw_frame are sent to the host.

If false the framework will do all the work to produce a frame, but the frame is never sent to the host to actually appear on screen.

Source

pub fn defer_first_frame(self: Handle<Self>, app: &mut App)

Tell the framework to not send the first frames to the host until there is a corresponding call to allow_first_frame.

Source

pub fn allow_first_frame(self: Handle<Self>, app: &mut App)

Called after defer_first_frame to tell the framework that it is ok to send the first frame to the host now.

Source

pub fn reset_first_frame_sent(self: Handle<Self>, app: &mut App)

Call this to pretend that no frames have been sent to the host yet.

Source

pub fn set_overrides( self: Handle<Self>, app: &mut App, overrides: Rc<dyn RendererBindingOverrides>, )

Pump the rendering pipeline to generate a frame.

This method is called by handle_draw_frame, which itself is called automatically by the host when it is time to lay out and paint a frame.

Each frame consists of the following phases: layout, paint, then compositing (for each registered RenderView). Registers the binding layered above this one, as Flutter’s WidgetsBinding does by overriding drawFrame.

Source

pub fn draw_frame(self: Handle<Self>, app: &mut App)

Source

pub fn init_render_view( self: Handle<Self>, app: &mut App, ) -> RenderHandle<RenderView>

Flutter’s TestRenderingFlutterBinding.initRenderView: makes the implicit view’s RenderView the root of root_pipeline_owner, registers it, and prepares its first frame. Idempotent, as _ReusableRenderView is.

Trait Implementations§

Source§

impl Default for RendererBinding

Source§

fn default() -> Self

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

impl GestureBindingOverridesObject for RendererBinding

Flutter’s RendererBinding.hitTestInView override: the render view for view_id hit-tests first; GestureBinding then adds itself. Flutter’s RendererBinding overrides of GestureBinding: hitTestInView walks the render trees, dispatchEvent updates the mouse tracker before routing.

Source§

fn hit_test( self: Handle<Self>, app: &mut App, result: &mut HitTestResult, position: Offset, )

Source§

fn hit_test_in_view( self: Handle<Self>, app: &mut App, result: &mut HitTestResult, position: Offset, view_id: ViewId, )

Source§

fn will_dispatch_event( self: Handle<Self>, app: &mut App, event: &PointerEvent, hit_test_result: Option<&HitTestResult>, )

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>