#ifndef GRAPHWINDOW_HPP
#define GRAPHWINDOW_HPP

#include "windows.h"
#include "graph.hpp"
#include "point.hpp"

typedef void (*TPaintProc)(TGraph *, void *, int *);

class TGraphWindow {

private:
HWND Handle;
HINSTANCE AppInst;
HDC WindowDC;
HANDLE RePaintEvent, MergePaintEvent, DieEvent;
TGraph *Graph;
TPaintProc PaintProc;
void *PaintProcParam;

public:
int PaintProgress;
TGraphWindow(HINSTANCE xAppInst, TPaintProc xPaintProc, void *xPaintProcParam, HANDLE xMergePaintEvent, HANDLE xRePaintEvent, int MaxModX, int MaxModY, int ShowCommand, char *Title);
~TGraphWindow();
static DWORD WINAPI GlobalPaintThread(LPVOID self);
static LRESULT CALLBACK GlobalWndProc(HWND hwnd, UINT MsgIdent, WPARAM wParam, LPARAM lParam);
DWORD WINAPI PaintThread();
LRESULT CALLBACK WndProc(HWND hwnd, UINT MsgIdent, WPARAM wParam, LPARAM lParam);
};

#endif
