use alloc::rc::Rc;
use core::cell::RefCell;
use crate::WidgetNode;
use crate::event::Event;
pub struct AppInfo {
pub name: &'static str,
pub version: &'static str,
pub preferred_width: u32,
pub preferred_height: u32,
}
pub trait Application {
fn info(&self) -> AppInfo;
fn build(&mut self, width: u32, height: u32) -> WidgetNode;
fn after_event(&mut self, root: &Rc<RefCell<WidgetNode>>, event: &Event);
fn tick(&mut self, _root: &Rc<RefCell<WidgetNode>>) {}
fn destroy(&mut self) {}
}
pub const CREATE_APP_SYMBOL: &[u8] = b"rlvgl_create_app";
pub const DESTROY_APP_SYMBOL: &[u8] = b"rlvgl_destroy_app";