Struct ori_core::EventContext
source · pub struct EventContext<'a> {
pub style: &'a Stylesheet,
pub state: &'a mut NodeState,
pub renderer: &'a dyn Renderer,
pub selectors: &'a StyleSelectors,
pub event_sink: &'a EventSink,
pub image_cache: &'a mut ImageCache,
}
Fields§
§style: &'a Stylesheet
§state: &'a mut NodeState
§renderer: &'a dyn Renderer
§selectors: &'a StyleSelectors
§event_sink: &'a EventSink
§image_cache: &'a mut ImageCache
Trait Implementations§
source§impl<'a> Context for EventContext<'a>
impl<'a> Context for EventContext<'a>
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
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)>
source§fn style<T: FromStyleAttribute + Default + 'static>(&mut self, key: &str) -> T
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.
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)>
source§fn style_range(&mut self, key: &str, range: Range<f32>) -> f32
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. Read more
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
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for EventContext<'a>
impl<'a> !Send for EventContext<'a>
impl<'a> !Sync for EventContext<'a>
impl<'a> Unpin for EventContext<'a>
impl<'a> !UnwindSafe for EventContext<'a>
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> Styleable<T> for T
impl<T> Styleable<T> for T
source§fn styled(self) -> Styled<T>
fn styled(self) -> Styled<T>
Converts the
self
into a Styled<Self>
value.source§fn attr_trans(
self,
key: &str,
value: impl Into<StyleAttributeValue>,
transition: impl Into<StyleTransition>
) -> Styled<T>
fn attr_trans( self, key: &str, value: impl Into<StyleAttributeValue>, transition: impl Into<StyleTransition> ) -> Styled<T>
Adds an attribute with a transition.