summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/hdr/modern_layered_window_engine.h
blob: 918bfabf37d8319099b37d5cba1209665e2b225c (plain)
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
49
50
51
#pragma once
#include "../m_api/m_skin_eng.h"

// typedef int (/*__stdcall*/ *tPaintCallbackProc)(HWND hWnd, HDC hDC, RECT * rcPaint, HRGN rgnUpdate, DWORD dFlags, void * CallBackData);

class CLayeredWindowEngine
{
private:
	/*class CLweInfo
	{
		HWND hWnd;
		HRGN hInvalidRgn;
	};
	  */
	//typedef std::map<HWND, CLweInfo> WndInfos;

	enum { state_invalid, state_normal };

	//WndInfos			m_infos;
	DWORD				m_hValidatorThread;
	CRITICAL_SECTION	m_cs;
	int					m_state;
	volatile bool		m_invalid;

public:
	CLayeredWindowEngine(void);
	~CLayeredWindowEngine(void);

	void _init();
	void _deinit();

	void lock() { EnterCriticalSection( &m_cs ); }
	void unlock() { LeaveCriticalSection( &m_cs ); }

	int get_state();

public:
	static void __cdecl LweValidatorProc();
	
	void LweValidatorProcWorker();

	void LweValidatorWorker();
	int LweInvalidateRect( HWND hWnd, const RECT * rect, BOOL bErase );
	// int LweValidateWindowRect( HWND hWnd, RECT * rect );
	// int RegisterWindow( HWND hwnd, tPaintCallbackProc pPaintCallBackProc );

};

extern CLayeredWindowEngine _lwe;

#define _InvalidateRect _lwe.LweInvalidateRect