#ifndef BW_APPLICATION_H
#define BW_APPLICATION_H
#ifdef __cplusplus
extern "C" {
#endif
#include "bool.h"
#include "string.h"
typedef struct bw_Application 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
#define BW_OTHER_IMPL
#endif
#if defined(BW_CEF)
#include "application/cef.h"
#elif defined(BW_EDGE2)
#include "application/edge2.h"
#else
#define BW_OTHER_ENGINE_IMPL
#endif
#endif
#if defined(BW_OTHER_IMPL) || defined(BW_BINDGEN)
typedef struct {} bw_ApplicationImpl;
#endif
#if defined(BW_OTHER_ENGINE_IMPL) || defined(BW_BINDGEN)
typedef struct {} bw_ApplicationEngineImpl;
#endif
#include "err.h"
#include <stdint.h>
struct bw_Application {
unsigned int windows_alive;
BOOL is_running;
BOOL is_done;
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 engine_seperate_executable_path;
uint16_t remote_debugging_port;
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_free( bw_Application* app );
bw_Err bw_Application_initialize( bw_Application** application, int argc, char** argv, const bw_ApplicationSettings* settings );
BOOL bw_Application_isRunning( const bw_Application* app );
void bw_Application_markAsDone(bw_Application* app);
int bw_Application_run( bw_Application* app, bw_ApplicationReadyFn on_ready, void* user_data );
BOOL bw_Application_dispatchDelayed(bw_Application* app, bw_ApplicationDispatchFn func, void* user_data, uint64_t milliseconds);
#ifdef __cplusplus
} #endif
#endif