#ifndef BW_WINDOW_H
#define BW_WINDOW_H
#ifdef __cplusplus
extern "C" {
#endif
#include "application.h"
#include "common.h"
#include "string.h"
#include <stdbool.h>
#include <stdint.h>
typedef struct bw_Window bw_Window;
typedef struct bw_WindowOptions {
bool borders;
bool minimizable;
bool resizable;
} bw_WindowOptions;
typedef void (*bw_WindowDispatchFn)( bw_Window* window, void* data );
typedef struct bw_WindowDispatchData bw_WindowDispatchData;
#if defined(BW_WIN32)
#include "window/win32.h"
#elif defined(BW_GTK)
#include "window/gtk.h"
#elif defined(BW_CEF_WINDOW)
#include "window/cef.h"
#else
typedef struct {} bw_WindowImpl;
#endif
typedef struct bw_BrowserWindow bw_BrowserWindow;
struct bw_Window {
bw_Application* app; const bw_Window* parent; bool closed; bool dropped; void* user_data; bw_BrowserWindow* browser;
bw_WindowImpl impl; };
void bw_Window_close(bw_Window* window);
void bw_Window_free(bw_Window* window);
void bw_Window_freeUserData(bw_Window* window);
bw_Dims2D bw_Window_getContentDimensions( bw_Window* window );
uint8_t bw_Window_getOpacity( bw_Window* window );
bw_Pos2D bw_Window_getPosition( bw_Window* window );
size_t bw_Window_getTitle( bw_Window* window, char** title );
bw_Dims2D bw_Window_getWindowDimensions( bw_Window* window );
void bw_Window_hide( bw_Window* window );
bool bw_Window_isVisible( const bw_Window* window );
bw_Window* bw_Window_new(
bw_Application* app,
const bw_Window* parent,
bw_CStrSlice _title,
int width, int height,
const bw_WindowOptions* options
);
void bw_Window_setContentDimensions( bw_Window* window, bw_Dims2D dimensions );
void bw_Window_setOpacity( bw_Window* window, uint8_t opacity );
void bw_Window_setPosition( bw_Window* window, bw_Pos2D position );
void bw_Window_setUserData(bw_Window* bw, void* user_data);
void bw_Window_setTitle( bw_Window* window, bw_CStrSlice title );
void bw_Window_setWindowDimensions( bw_Window* window, bw_Dims2D dimensions );
void bw_Window_show( bw_Window* window );
void bw_Window_triggerClose( bw_Window* window );
void _bw_Window_onResize( const bw_Window* window, unsigned int width, unsigned int height );
#ifdef __cplusplus
} #endif
#endif