extern crate remarkable; use remarkable::fb; use remarkable::uix::{self, UIConstraintRefresh, UIElement}; use remarkable::unifiedinput; #[macro_use] extern crate log; extern crate env_logger; #[allow(unused_variables)] fn on_touch_handler(framebuffer: &mut fb::Framebuffer, input: unifiedinput::MultitouchEvent) { } fn on_wacom_input(_fb: &mut fb::Framebuffer, _input: unifiedinput::WacomEvent) { } fn on_button_press(_fb: &mut fb::Framebuffer, _input: unifiedinput::GPIOEvent) { } fn on_touch_exit_button(_fb: &mut fb::Framebuffer, app: &mut uix::ApplicationContext) { info!("Exiting gracefully now..."); app.stop(); } fn main() { env_logger::init(); let mut app = uix::ApplicationContext::new( on_button_press, on_wacom_input, on_touch_handler, ); app.clear(true); app.draw_elements(&vec!( UIElement::Text { text: "Touch me to exit!".to_owned(), y: 100, x: 850, scale: 70, onclick: Some(uix::ActiveRegionHandler(on_touch_exit_button)), refresh: UIConstraintRefresh::Refresh, }, )); info!("Init complete. Beginning event dispatch..."); app.dispatch_events(8192, 1); }