use std::fmt::Debug;
use super::{ComponentRegistryMap, EventPropagation, GlobalData, HasFocus};
use crate::{CommonResult, InputEvent, RenderPipeline};
pub trait App {
type S: Debug + Default + Clone + Sync + Send;
type AS: Debug + Default + Clone + Sync + Send;
fn app_init(
&mut self,
component_registry_map: &mut ComponentRegistryMap<Self::S, Self::AS>,
has_focus: &mut HasFocus,
);
fn app_handle_input_event(
&mut self,
input_event: InputEvent,
global_data: &mut GlobalData<Self::S, Self::AS>,
component_registry_map: &mut ComponentRegistryMap<Self::S, Self::AS>,
has_focus: &mut HasFocus,
) -> CommonResult<EventPropagation>;
fn app_handle_signal(
&mut self,
signal: &Self::AS,
global_data: &mut GlobalData<Self::S, Self::AS>,
component_registry_map: &mut ComponentRegistryMap<Self::S, Self::AS>,
has_focus: &mut HasFocus,
) -> CommonResult<EventPropagation>;
fn app_render(
&mut self,
global_data: &mut GlobalData<Self::S, Self::AS>,
component_registry_map: &mut ComponentRegistryMap<Self::S, Self::AS>,
has_focus: &mut HasFocus,
) -> CommonResult<RenderPipeline>;
}