pub struct ViewAssistantContext {
pub key: ViewKey,
pub size: Size,
pub metrics: Size,
pub presentation_time: MonotonicInstant,
pub buffer_count: Option<usize>,
pub image_id: ImageId,
pub image_index: u32,
pub mouse_cursor_position: Option<IntPoint>,
pub display_info: Option<DisplayInfo>,
/* private fields */
}
Expand description
parameter struct passed to setup and update trait methods.
Fields§
§key: ViewKey
A unique key representing this view.
size: Size
The actual number of pixels in the view.
metrics: Size
A factor representing pixel density. Use to calculate sizes for things like fonts.
presentation_time: MonotonicInstant
For render, the time the rendering will be presented. Currently not implemented correctly.
buffer_count: Option<usize>
When running in frame buffer mode, the number of buffers in the buffer collection
image_id: ImageId
The ID of the Image being rendered in a buffer in preparation for being displayed. Used to keep track of what content needs to be rendered for a particular image in double or triple buffering configurations.
image_index: u32
The index of the buffer in a buffer collection that is
being used as the contents of the image specified in
image_id
.
mouse_cursor_position: Option<IntPoint>
Position of the mouse cursor when running directly on the display coordinator.
display_info: Option<DisplayInfo>
information about the hosting display when running directly on the display coordinator.
Implementations§
Source§impl ViewAssistantContext
impl ViewAssistantContext
Sourcepub fn new_for_testing() -> Self
pub fn new_for_testing() -> Self
Returns an empty ViewAssistantContext to enable testing with mocks
Sourcepub fn queue_message(&mut self, message: Message)
pub fn queue_message(&mut self, message: Message)
Queue up a message for delivery
Sourcepub fn request_render(&self)
pub fn request_render(&self)
Request that a render occur for this view at the next appropriate time to render.