e2rcore/interface/
i_window.rs

1use std::ops::FnMut;
2
3pub trait IWindow {
4    
5    type EventType;
6    type SignalRequestType;
7    
8    fn new( dimx: u64, dimy: u64 ) -> Self;
9    fn make_current( & self ) -> Result< (), & 'static str >;
10    fn handle_events < F > ( & mut self, cb: F ) -> () where F: FnMut( Self::EventType ) -> ();
11    fn handle_events_pass_thru( & mut self ) -> Option< Self::EventType >;
12    fn swap_buf( & self ) -> ();
13    fn handle_signal_request( & mut self, & [ Self::SignalRequestType ] ) -> Result< (), & 'static str >;
14    fn per_frame_setup( & mut self ) -> Result< (), & 'static str >;
15    fn get_offset( & self ) -> Option<(i32,i32)>;
16    fn get_size( & self ) -> Option<(u32,u32)>;
17}