]>
git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/fl/antiflickpl.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Double-buffering plugin class for reducing flicker
4 // Author: Aleksandras Gluchovas (@Lithuania)
8 // Copyright: (c) Aleksandras Gluchovas
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef __ANTIFLICKPL_G__
13 #define __ANTIFLICKPL_G__
16 #pragma interface "antiflickpl.h"
19 #include "wx/fl/controlbar.h"
22 Implements double-buffering to reduce flicker.
23 Bitmap and memory DC buffers are shared "resources" among all instances of
24 antiflicker plugins within the application.
26 Locking for multithreaded applications is not yet implemented.
29 class cbAntiflickerPlugin
: public cbPluginBase
31 DECLARE_DYNAMIC_CLASS( cbAntiflickerPlugin
)
34 static wxBitmap
* mpVertBuf
;
35 static wxBitmap
* mpHorizBuf
;
36 static wxMemoryDC
* mpVertBufDc
;
37 static wxMemoryDC
* mpHorizBufDc
;
41 wxDC
* mpLRUBufDc
; // last-recently-used buffer
42 wxRect mLRUArea
; // last-recently-used area
45 // Finds a suitable buffer. Returns NULL if a suitable buffer is not present.
46 wxDC
* FindSuitableBuffer( const wxRect
& forArea
);
47 // Allocates a suitable buffer.
48 wxDC
* AllocNewBuffer( const wxRect
& forArea
);
54 cbAntiflickerPlugin(void);
56 cbAntiflickerPlugin( wxFrameLayout
* pPanel
, int paneMask
= wxALL_PANES
);
58 virtual ~cbAntiflickerPlugin();
60 // Handler for plugin event.
61 void OnStartDrawInArea ( cbStartDrawInAreaEvent
& event
);
63 // Handler for plugin event.
64 void OnFinishDrawInArea( cbFinishDrawInAreaEvent
& event
);
69 #endif /* __ANTIFLICKPL_G__ */