use dioxus_core::Template;
use torin::prelude::CursorPoint;
use uuid::Uuid;
use winit::window::{
CursorIcon,
Window,
};
pub struct TextGroupMeasurement {
pub text_id: Uuid,
pub cursor_id: usize,
pub cursor_position: Option<CursorPoint>,
pub cursor_selection: Option<(CursorPoint, CursorPoint)>,
}
pub enum EventMessage {
UpdateTemplate(Template),
PollVDOM,
RequestRerender,
RemeasureTextGroup(TextGroupMeasurement),
SetCursorIcon(CursorIcon),
Accessibility(accesskit_winit::WindowEvent),
FocusAccessibilityNode(accesskit::NodeId),
QueueFocusAccessibilityNode(accesskit::NodeId),
FocusNextAccessibilityNode,
FocusPrevAccessibilityNode,
ExitApp,
WithWindow(Box<dyn FnOnce(&Window) + Send + Sync>),
}
impl From<accesskit_winit::Event> for EventMessage {
fn from(value: accesskit_winit::Event) -> Self {
Self::Accessibility(value.window_event)
}
}