#ifndef BW_WINDOW_H
#define BW_WINDOW_H
#ifdef __cplusplus
extern "C" {
#endif
#include "application.h"
#include "string.h"
#if defined(BW_WIN32)
#include "win32/window.h"
#elif defined(BW_GTK)
#include "window/gtk.h"
#else
#error Unsupported GUI implementation
#endif
#include <stdbool.h>
typedef struct bw_Window bw_Window;
typedef struct bw_WindowCallbacks {
void (*do_cleanup)( bw_Window* );
void (*on_close)( const bw_Window* );
void (*on_loaded)( const bw_Window* );
void (*on_resize)( const bw_Window*, unsigned int width, unsigned int height );
} bw_WindowCallbacks;
typedef struct bw_WindowOptions {
bool minimizable;
bool resizable;
bool closable;
bool borders;
} bw_WindowOptions;
typedef void (*bw_WindowDispatchFn)( bw_Window* window, void* data );
typedef struct bw_WindowDispatchData bw_WindowDispatchData;
struct bw_Window {
bw_Application* app; const bw_Window* parent; bw_WindowImpl impl; bool closed; bool dropped; bw_WindowCallbacks callbacks;
void* user_data;
};
bw_Window* bw_Window_new(
bw_Application* app,
const bw_Window* parent,
bw_CStrSlice _title,
int width, int height,
const bw_WindowOptions* options,
void* user_data
);
void bw_Window_close( bw_Window* window );
void bw_Window_drop( bw_Window* window );
bool bw_Window_isClosed( const bw_Window* window );
void bw_Window_open( bw_Window* window );
#ifdef __cplusplus
} #endif
#endif