pub struct Processor {
wayland_event_queue: Option<EventQueue>,
windows: HashMap<WindowId, WindowContext>,
cli_options: CliOptions,
config: Rc<UiConfig>,
}
Expand description
The event processor.
Stores some state from received events and dispatches actions when they are triggered.
Fields§
§wayland_event_queue: Option<EventQueue>
§windows: HashMap<WindowId, WindowContext>
§cli_options: CliOptions
§config: Rc<UiConfig>
Implementations§
source§impl Processor
impl Processor
sourcepub fn new(
config: UiConfig,
cli_options: CliOptions,
_event_loop: &EventLoop<Event>
) -> Processor
pub fn new( config: UiConfig, cli_options: CliOptions, _event_loop: &EventLoop<Event> ) -> Processor
Create a new event processor.
Takes a writer which is expected to be hooked up to the write end of a PTY.
sourcepub fn create_initial_window(
&mut self,
event_loop: &EventLoopWindowTarget<Event>,
proxy: EventLoopProxy<Event>,
options: WindowOptions
) -> Result<(), Box<dyn Error>>
pub fn create_initial_window( &mut self, event_loop: &EventLoopWindowTarget<Event>, proxy: EventLoopProxy<Event>, options: WindowOptions ) -> Result<(), Box<dyn Error>>
Create initial window and load GL platform.
This will initialize the OpenGL Api and pick a config that will be used for the rest of the windows.
sourcepub fn create_window(
&mut self,
event_loop: &EventLoopWindowTarget<Event>,
proxy: EventLoopProxy<Event>,
options: WindowOptions
) -> Result<(), Box<dyn Error>>
pub fn create_window( &mut self, event_loop: &EventLoopWindowTarget<Event>, proxy: EventLoopProxy<Event>, options: WindowOptions ) -> Result<(), Box<dyn Error>>
Create a new terminal window.
sourcepub fn run(
&mut self,
event_loop: EventLoop<Event>,
initial_window_options: WindowOptions
) -> Result<(), Box<dyn Error>>
pub fn run( &mut self, event_loop: EventLoop<Event>, initial_window_options: WindowOptions ) -> Result<(), Box<dyn Error>>
Run the event loop.
The result is exit code generate from the loop.
sourcefn skip_event(event: &WinitEvent<'_, Event>) -> bool
fn skip_event(event: &WinitEvent<'_, Event>) -> bool
Check if an event is irrelevant and can be skipped.