1use std::borrow::Cow;
2use std::path::PathBuf;
34use crate::message_bar::Message;
5use crate::term::SizeInfo;
67#[derive(Clone, Debug, PartialEq)]
8pub enum Event {
9 DPRChanged(f64, (u32, u32)),
10 ConfigReload(PathBuf),
11 MouseCursorDirty,
12 Message(Message),
13 Title(String),
14 Wakeup,
15 Urgent,
16 Exit,
17}
1819/// Byte sequences are sent to a `Notify` in response to some events
20pub trait Notify {
21/// Notify that an escape sequence should be written to the pty
22 ///
23 /// TODO this needs to be able to error somehow
24fn notify<B: Into<Cow<'static, [u8]>>>(&mut self, _: B);
25}
2627/// Types that are interested in when the display is resized
28pub trait OnResize {
29fn on_resize(&mut self, size: &SizeInfo);
30}
3132/// Event Loop for notifying the renderer about terminal events
33pub trait EventListener {
34fn send_event(&self, event: Event);
35}