pub mod c;
pub use c::ApplicationImpl;
use crate::error::CbwResult;
use std::{
path::PathBuf,
os::raw::{c_char, c_int},
time::Duration
};
pub trait ApplicationExt: Copy {
fn assert_correct_thread( &self );
fn dispatch( &self, work: unsafe fn(ApplicationImpl, *mut ()), data: *mut () ) -> bool;
fn dispatch_delayed(&self, work: unsafe fn(ApplicationImpl, *mut ()), data: *mut (), delay: Duration ) -> bool;
fn exit( &self, exit_code: i32 );
fn exit_threadsafe( self: &Self, exit_code: i32 );
fn finish( &self ) {}
fn initialize( argc: c_int, argv: *mut *mut c_char, settings: &ApplicationSettings ) -> CbwResult<ApplicationImpl>;
fn mark_as_done(&self);
fn run( &self, on_ready: unsafe fn(ApplicationImpl, *mut ()), data: *mut () ) -> i32;
}
pub struct ApplicationSettings {
pub engine_seperate_executable_path: Option<PathBuf>,
pub resource_dir: Option<String>
}
impl Default for ApplicationSettings {
fn default() -> Self {
Self {
engine_seperate_executable_path: None,
resource_dir: None
}
}
}