aboutsummaryrefslogtreecommitdiff
path: root/Src/Wasabi/api/wndmgr/resize.h
blob: 2d67e14cd116c73603402f270718fc72f5ccd51f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef __RESIZE_H
#define __RESIZE_H
#ifdef _WIN32
LRESULT CALLBACK resizeWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
#endif

class resizeClass
{
#ifdef _WIN32
	friend LRESULT CALLBACK resizeWndProc(HWND wnd, UINT uMsg, WPARAM wParam, LPARAM lParam); // heh, i really need this one ;)
#endif
private:
	void drawFrame(void);
	void setResizeCursor(int action);
	int orientation(int a, int action);
	OSWINDOWHANDLE hWnd;
	OSWINDOWHANDLE resizedWindow;
	ifc_window *resizedWindowR;
	int resizeWay;
	RECT curRect;
	RECT originalRect;
	int cX, cY;
	int minWinWidth, minWinHeight;
	int maxWinWidth, maxWinHeight;
	int sugWinWidth, sugWinHeight;
	int screenHeight, screenWidth;
	bool cancelit;
	RECT snapAdjust;

#ifdef WIN32
	HBRUSH oldB, brush;
	HPEN oldP, pen;
#endif
	HDC dc;
	int mix;

public:
	resizeClass(ifc_window *wnd, int minx, int miny, int maxx, int maxy, int sugx, int sugy);
	~resizeClass();
	int resizeWindow(ifc_window *wnd, int way);
#ifdef _WIN32
	LRESULT wndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
#endif
	RECT getRect(void);
};

#endif