#ifndef BW_APPLICATION_H
#define BW_APPLICATION_H
#ifdef __cplusplus
extern "C" {
#endif
#include "bool.h"
#include "string.h"
struct bw_Application;
typedef void (*bw_ApplicationDispatchFn)( struct bw_Application* app, void* data );
typedef bw_ApplicationDispatchFn bw_ApplicationReadyFn;
#ifndef BW_BINDGEN
#if defined(BW_WIN32)
#include "application/win32.h"
#elif defined(BW_GTK)
#include "application/gtk.h"
#elif defined(BW_CEF_WINDOW)
#include "application/cef_window.h"
#else
#error Unsupported platform
#endif
#if defined(BW_CEF)
#include "application/cef.h"
#else
typedef struct {} bw_ApplicationEngineImpl;
#endif
#else
typedef struct {} bw_ApplicationImpl;
typedef struct {} bw_ApplicationEngineImpl;
#endif
struct bw_Application {
unsigned int windows_alive;
bw_ApplicationImpl impl;
bw_ApplicationEngineImpl engine_impl; };
typedef struct bw_Application bw_Application;
typedef struct bw_ApplicationEngineData bw_ApplicationEngineData;
typedef struct {
bw_ApplicationDispatchFn func;
void* data;
} bw_ApplicationDispatchData;
typedef struct {
bw_CStrSlice resource_dir;
} bw_ApplicationSettings;
void bw_Application_assertCorrectThread( const bw_Application* );
void bw_Application_exit( bw_Application* app, int exit_code );
void bw_Application_exitAsync( bw_Application* app, int exit_code );
BOOL bw_Application_dispatch( bw_Application* app, bw_ApplicationDispatchFn func, void* data );
void bw_Application_finish( bw_Application* app );
void bw_Application_free( bw_Application* app );
bw_Application* bw_Application_initialize( int argc, char** argv, const bw_ApplicationSettings* settings );
BOOL bw_Application_isRunning( const bw_Application* app );
int bw_Application_run( bw_Application* app, bw_ApplicationReadyFn on_ready, void* user_data );
#ifdef __cplusplus
} #endif
#endif