pub struct ConsoleViewAssistant { /* private fields */ }Implementations§
Source§impl ConsoleViewAssistant
impl ConsoleViewAssistant
pub fn new(font_face: FontFace) -> Result<ConsoleViewAssistant, Error>
pub fn console_scene(&mut self, context: &ViewAssistantContext) -> SceneDetails
Trait Implementations§
Source§impl ViewAssistant for ConsoleViewAssistant
impl ViewAssistant for ConsoleViewAssistant
Source§fn resize(&mut self, _new_size: &Size) -> Result<(), Error>
fn resize(&mut self, _new_size: &Size) -> Result<(), Error>
Implement this method to to handle when a view is resized.
Source§fn render(
&mut self,
render_context: &mut RenderContext,
ready_event: Event,
context: &ViewAssistantContext,
) -> Result<(), Error>
fn render( &mut self, render_context: &mut RenderContext, ready_event: Event, context: &ViewAssistantContext, ) -> Result<(), Error>
This method is called when a view needs to
be rendered.
Source§fn setup(&mut self, context: &ViewAssistantContext) -> Result<(), Error>
fn setup(&mut self, context: &ViewAssistantContext) -> Result<(), Error>
This method is called once when a view is created.
Source§fn handle_message(&mut self, message: Message)
fn handle_message(&mut self, message: Message)
This method is called when
App::send_message is called with the associated
view controller’s ViewKey and the view controller does not handle the message. Read moreSource§fn get_scene(&mut self, size: Size2D<f32, UnknownUnit>) -> Option<&mut Scene>
fn get_scene(&mut self, size: Size2D<f32, UnknownUnit>) -> Option<&mut Scene>
Implement this method to return a mutable reference to the scene that
represents the view.
Source§fn get_scene_with_contexts(
&mut self,
render_context: &mut Context,
view_context: &ViewAssistantContext,
) -> Option<&mut Scene>
fn get_scene_with_contexts( &mut self, render_context: &mut Context, view_context: &ViewAssistantContext, ) -> Option<&mut Scene>
Implement this method to return a mutable reference to the scene that
represents the view. Implement this one if you’ll need the various
contexts to build a scene.
Source§fn handle_input_event(
&mut self,
context: &mut ViewAssistantContext,
event: &Event,
) -> Result<(), Error>
fn handle_input_event( &mut self, context: &mut ViewAssistantContext, event: &Event, ) -> Result<(), Error>
This method is called when input events come to this view. The default implementation
calls specific methods for the type of event, so usually one does not need to implement
this method. Since the default methods for touch and mouse handle the pointer abstraction,
make sure to call them in an implementation of this method if you wish to use that
abstraction.
Source§fn handle_mouse_event(
&mut self,
context: &mut ViewAssistantContext,
event: &Event,
mouse_event: &Event,
) -> Result<(), Error>
fn handle_mouse_event( &mut self, context: &mut ViewAssistantContext, event: &Event, mouse_event: &Event, ) -> Result<(), Error>
This method is called when mouse events come to this view. Read more
Source§fn handle_touch_event(
&mut self,
context: &mut ViewAssistantContext,
event: &Event,
touch_event: &Event,
) -> Result<(), Error>
fn handle_touch_event( &mut self, context: &mut ViewAssistantContext, event: &Event, touch_event: &Event, ) -> Result<(), Error>
This method is called when touch events come to this view. Read more
Source§fn handle_pointer_event(
&mut self,
context: &mut ViewAssistantContext,
event: &Event,
pointer_event: &Event,
) -> Result<(), Error>
fn handle_pointer_event( &mut self, context: &mut ViewAssistantContext, event: &Event, pointer_event: &Event, ) -> Result<(), Error>
This method is called when the view desires pointer events and a compatible
mouse or touch event comes to this view. Read more
Source§fn handle_keyboard_event(
&mut self,
context: &mut ViewAssistantContext,
event: &Event,
keyboard_event: &Event,
) -> Result<(), Error>
fn handle_keyboard_event( &mut self, context: &mut ViewAssistantContext, event: &Event, keyboard_event: &Event, ) -> Result<(), Error>
This method is called when keyboard events come to this view.
Source§fn handle_consumer_control_event(
&mut self,
context: &mut ViewAssistantContext,
event: &Event,
consumer_control_event: &Event,
) -> Result<(), Error>
fn handle_consumer_control_event( &mut self, context: &mut ViewAssistantContext, event: &Event, consumer_control_event: &Event, ) -> Result<(), Error>
This method is called when consumer control events come to this view.
Source§fn handle_focus_event(
&mut self,
context: &mut ViewAssistantContext,
focused: bool,
) -> Result<(), Error>
fn handle_focus_event( &mut self, context: &mut ViewAssistantContext, focused: bool, ) -> Result<(), Error>
This method is called when focus events come from Scenic to this view. It will be
called once when a Carnelian app is running directly on the frame buffer, as such
views are always focused. See the button sample for an one way to respond to focus.
Source§fn uses_pointer_events(&self) -> bool
fn uses_pointer_events(&self) -> bool
Whether this view wants touch and mouse events abstracted as
input::pointer::Event. Defaults to true.Source§fn ownership_changed(&mut self, _owned: bool) -> Result<(), Error>
fn ownership_changed(&mut self, _owned: bool) -> Result<(), Error>
This method is called when running directly on the display and the ownership
of the display changes.
Source§fn get_render_offset(&mut self) -> Option<i64>
fn get_render_offset(&mut self) -> Option<i64>
This method is called after setup to get an offset to use when calculating
render time. It is only called once.
Auto Trait Implementations§
impl Freeze for ConsoleViewAssistant
impl !RefUnwindSafe for ConsoleViewAssistant
impl !Send for ConsoleViewAssistant
impl !Sync for ConsoleViewAssistant
impl Unpin for ConsoleViewAssistant
impl UnsafeUnpin for ConsoleViewAssistant
impl !UnwindSafe for ConsoleViewAssistant
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
Mutably borrows from an owned value. Read more
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
Converts the given service transport handle of type
T to [Self]§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
impl<T, U> TryIntoExt<U> for Twhere
U: TryFromExt<T>,
type Error = <U as TryFromExt<T>>::Error
§fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
fn try_into_ext(self) -> Result<U, <T as TryIntoExt<U>>::Error>
Tries to perform the conversion.