#ifndef WMWINDOW_H
#define WMWINDOW_H


#include "gui.h"


#define WIN_NONE      0
#define WIN_CLOSE     1
#define WIN_MAXIMIZE  2
#define WIN_MINIMIZE  4
#define WIN_RESIZE    8


typedef struct WindowS {
	WidgetT  base;
	char    *title;
	uint8_t  flags;
	RectT    close;
	RectT    titlebar;
	RectT    minimize;
	RectT    maximize;
	RectT    bounds;
} WindowT;


extern uint8_t   __MAGIC_WINDOW;


WindowT   *windowCreate(uint16_t x, uint16_t y, uint16_t w, uint16_t h, char *title, uint8_t flags, ...);
void       windowDestroy(struct WidgetS *widget, ...);
void       windowPaint(struct WidgetS *widget, ...);
RegisterT *windowRegister(uint8_t magic);


void wmPaint(EventT *event);
void wmShutdown(void);
void wmStartup(void);


#endif // WMWINDOW_H
