]> git.saurik.com Git - wxWidgets.git/blob - utils/framelayout/src/antiflickpl.h
don't crash when invalid colour is set as fg/bg colour
[wxWidgets.git] / utils / framelayout / src / antiflickpl.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: No names yet.
3 // Purpose: Contrib. demo
4 // Author: Aleksandras Gluchovas (@Lithuania)
5 // Modified by:
6 // Created: 23/10/98
7 // RCS-ID: $Id$
8 // Copyright: (c) Aleksandras Gluchovas
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef __ANTIFLICKPL_G__
13 #define __ANTIFLICKPL_G__
14
15 #include "controlbar.h"
16
17 class cbAntiflickerPlugin : public cbPluginBase
18 {
19 DECLARE_DYNAMIC_CLASS( cbAntiflickerPlugin )
20 protected:
21 // double-buffers are shared "resource" among all instances of
22 // antiflicker plugin within the application
23 //
24 // TODO:: locking should be implemented, for multithreaded GUIs
25
26 static wxBitmap* mpVertBuf;
27 static wxBitmap* mpHorizBuf;
28 static wxMemoryDC* mpVertBufDc;
29 static wxMemoryDC* mpHorizBufDc;
30
31 static int mRefCount;
32
33 wxDC* mpLRUBufDc; // last-reacently-used buffer
34 wxRect mLRUArea; // last-reacently-used area
35
36 protected:
37 // returns NULL, if sutable buffer is not present
38 wxDC* FindSuitableBuffer( const wxRect& forArea );
39 wxDC* AllocNewBuffer( const wxRect& forArea );
40 wxDC& GetWindowDC();
41
42 wxDC& GetClientDC();
43 public:
44
45 cbAntiflickerPlugin(void);
46
47 cbAntiflickerPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES );
48
49 virtual ~cbAntiflickerPlugin();
50
51 // handlers for plugin events
52
53 void OnStartDrawInArea ( cbStartDrawInAreaEvent& event );
54 void OnFinishDrawInArea( cbFinishDrawInAreaEvent& event );
55
56 DECLARE_EVENT_TABLE()
57 };
58
59 #endif