Trait ori_core::Context

source ·
pub trait Context {
Show 33 methods // Required methods fn stylesheet(&self) -> &Stylesheet; fn state(&self) -> &NodeState; fn state_mut(&mut self) -> &mut NodeState; fn renderer(&self) -> &dyn Renderer; fn selectors(&self) -> &StyleSelectors; fn event_sink(&self) -> &EventSink; fn image_cache(&self) -> &ImageCache; fn image_cache_mut(&mut self) -> &mut ImageCache; // Provided methods fn get_style_attribute(&self, key: &str) -> Option<StyleAttribute> { ... } fn get_style_attribute_specificity( &self, key: &str ) -> Option<(StyleAttribute, StyleSpecificity)> { ... } fn get_style<T: FromStyleAttribute + 'static>( &mut self, key: &str ) -> Option<T> { ... } fn get_style_specificity<T: FromStyleAttribute + 'static>( &mut self, key: &str ) -> Option<(T, StyleSpecificity)> { ... } fn style<T: FromStyleAttribute + Default + 'static>( &mut self, key: &str ) -> T { ... } fn style_group<T: FromStyleAttribute + Default + 'static>( &mut self, primary_key: &str, secondary_key: &str ) -> T { ... } fn get_style_range(&mut self, key: &str, range: Range<f32>) -> Option<f32> { ... } fn get_style_range_specificity( &mut self, key: &str, range: Range<f32> ) -> Option<(f32, StyleSpecificity)> { ... } fn style_range(&mut self, key: &str, range: Range<f32>) -> f32 { ... } fn style_range_group( &mut self, primary_key: &str, secondary_key: &str, range: Range<f32> ) -> f32 { ... } fn downcast_renderer<T: Renderer>(&self) -> Option<&T> { ... } fn load_image(&mut self, source: &ImageSource) -> ImageHandle { ... } fn active(&self) -> bool { ... } fn hovered(&self) -> bool { ... } fn focused(&self) -> bool { ... } fn focus(&mut self) { ... } fn unfocus(&mut self) { ... } fn activate(&mut self) { ... } fn deactivate(&mut self) { ... } fn local_rect(&self) -> Rect { ... } fn rect(&self) -> Rect { ... } fn size(&self) -> Vec2 { ... } fn request_redraw(&mut self) { ... } fn send_event(&self, event: impl Any + SendSync) { ... } fn delta_time(&self) -> f32 { ... }
}

Required Methods§

source

fn stylesheet(&self) -> &Stylesheet

source

fn state(&self) -> &NodeState

source

fn state_mut(&mut self) -> &mut NodeState

source

fn renderer(&self) -> &dyn Renderer

source

fn selectors(&self) -> &StyleSelectors

source

fn event_sink(&self) -> &EventSink

source

fn image_cache(&self) -> &ImageCache

source

fn image_cache_mut(&mut self) -> &mut ImageCache

Provided Methods§

source

fn get_style_attribute(&self, key: &str) -> Option<StyleAttribute>

source

fn get_style_attribute_specificity( &self, key: &str ) -> Option<(StyleAttribute, StyleSpecificity)>

source

fn get_style<T: FromStyleAttribute + 'static>(&mut self, key: &str) -> Option<T>

source

fn get_style_specificity<T: FromStyleAttribute + 'static>( &mut self, key: &str ) -> Option<(T, StyleSpecificity)>

source

fn style<T: FromStyleAttribute + Default + 'static>(&mut self, key: &str) -> T

Get the value of a style attribute, if it has a transition, the value will be interpolated between the current value and the new value.

source

fn style_group<T: FromStyleAttribute + Default + 'static>( &mut self, primary_key: &str, secondary_key: &str ) -> T

source

fn get_style_range(&mut self, key: &str, range: Range<f32>) -> Option<f32>

source

fn get_style_range_specificity( &mut self, key: &str, range: Range<f32> ) -> Option<(f32, StyleSpecificity)>

source

fn style_range(&mut self, key: &str, range: Range<f32>) -> f32

Get the value of a style attribute, if it has a transition, the value will be interpolated between the current value and the new value.

This is a convenience method for getting a value in pixels, as opposed to style which returns a Unit.

source

fn style_range_group( &mut self, primary_key: &str, secondary_key: &str, range: Range<f32> ) -> f32

source

fn downcast_renderer<T: Renderer>(&self) -> Option<&T>

source

fn load_image(&mut self, source: &ImageSource) -> ImageHandle

source

fn active(&self) -> bool

source

fn hovered(&self) -> bool

source

fn focused(&self) -> bool

source

fn focus(&mut self)

source

fn unfocus(&mut self)

source

fn activate(&mut self)

source

fn deactivate(&mut self)

source

fn local_rect(&self) -> Rect

source

fn rect(&self) -> Rect

source

fn size(&self) -> Vec2

source

fn request_redraw(&mut self)

source

fn send_event(&self, event: impl Any + SendSync)

source

fn delta_time(&self) -> f32

Implementors§

source§

impl<'a> Context for DrawContext<'a>

source§

impl<'a> Context for EventContext<'a>

source§

impl<'a> Context for LayoutContext<'a>