use crate::command::ExitDir;
use crate::doc::Document;
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Rect {
pub x: f64,
pub y: f64,
pub width: f64,
pub height: f64,
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Metrics {
pub width: f64,
pub height: f64,
pub baseline: f64,
}
pub struct RenderOutput {
pub ir: mathtex_ir::Fragment,
pub caret: Rect,
pub selection: Vec<Rect>,
pub placeholders: Vec<Rect>,
pub metrics: Metrics,
pub menu: Option<crate::menu::MenuView>,
}
pub trait Host {
fn typeset(&self, latex: &str) -> mathtex_ir::Fragment;
fn on_change(&self, doc: &Document);
fn on_exit(&self, dir: ExitDir);
fn request_close(&self);
fn on_render(&self);
}