X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8e08b761b0c5ecb6df295785b78f1f3637331887..3f4f90c2a0c1f274d1918b320132ed0ca2922fe5:/contrib/include/wx/fl/antiflickpl.h diff --git a/contrib/include/wx/fl/antiflickpl.h b/contrib/include/wx/fl/antiflickpl.h index 9b44d8508c..0ede3dfce6 100644 --- a/contrib/include/wx/fl/antiflickpl.h +++ b/contrib/include/wx/fl/antiflickpl.h @@ -1,12 +1,12 @@ ///////////////////////////////////////////////////////////////////////////// -// Name: No names yet. -// Purpose: Contrib. demo +// Name: antiflickpl.h +// Purpose: Double-buffering plugin class for reducing flicker // Author: Aleksandras Gluchovas (@Lithuania) // Modified by: // Created: 23/10/98 // RCS-ID: $Id$ // Copyright: (c) Aleksandras Gluchovas -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __ANTIFLICKPL_G__ @@ -18,46 +18,68 @@ #include "wx/fl/controlbar.h" +/* +Implements double-buffering to reduce flicker. +Bitmap and memory DC buffers are shared 'resources' among all instances of +antiflicker plugins within the application. + +Locking for multithreaded applications is not yet implemented. +*/ + class cbAntiflickerPlugin : public cbPluginBase { - DECLARE_DYNAMIC_CLASS( cbAntiflickerPlugin ) + DECLARE_DYNAMIC_CLASS( cbAntiflickerPlugin ) protected: - // double-buffers are shared "resource" among all instances of - // antiflicker plugin within the application - // - // TODO:: locking should be implemented, for multithreaded GUIs - static wxBitmap* mpVertBuf; - static wxBitmap* mpHorizBuf; - static wxMemoryDC* mpVertBufDc; - static wxMemoryDC* mpHorizBufDc; + static wxBitmap* mpVertBuf; + static wxBitmap* mpHorizBuf; + static wxMemoryDC* mpVertBufDc; + static wxMemoryDC* mpHorizBufDc; - static int mRefCount; + static int mRefCount; - wxDC* mpLRUBufDc; // last-reacently-used buffer - wxRect mLRUArea; // last-reacently-used area + wxDC* mpLRUBufDc; // last-recently-used buffer + wxRect mLRUArea; // last-recently-used area protected: - // returns NULL, if sutable buffer is not present - wxDC* FindSuitableBuffer( const wxRect& forArea ); - wxDC* AllocNewBuffer( const wxRect& forArea ); - wxDC& GetWindowDC(); + // Finds a suitable buffer. Returns NULL if a suitable buffer is not present. + + wxDC* FindSuitableBuffer( const wxRect& forArea ); + + // Allocates a suitable buffer. + + wxDC* AllocNewBuffer( const wxRect& forArea ); + + // Gets the window device context. + + wxDC& GetWindowDC(); - wxDC& GetClientDC(); + // Gets the client device context. + + wxDC& GetClientDC(); public: - cbAntiflickerPlugin(void); + // Default constructor. + + cbAntiflickerPlugin(void); + + // Constructor taking frame layout panel, and pane mask. + + cbAntiflickerPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ); + + // Destructor. + + virtual ~cbAntiflickerPlugin(); - cbAntiflickerPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ); + // Handler for plugin event. - virtual ~cbAntiflickerPlugin(); + void OnStartDrawInArea ( cbStartDrawInAreaEvent& event ); - // handlers for plugin events + // Handler for plugin event. - void OnStartDrawInArea ( cbStartDrawInAreaEvent& event ); - void OnFinishDrawInArea( cbFinishDrawInAreaEvent& event ); + void OnFinishDrawInArea( cbFinishDrawInAreaEvent& event ); - DECLARE_EVENT_TABLE() + DECLARE_EVENT_TABLE() }; #endif /* __ANTIFLICKPL_G__ */