]>
Commit | Line | Data |
---|---|---|
8e08b761 | 1 | ///////////////////////////////////////////////////////////////////////////// |
e598303a JS |
2 | // Name: antiflickpl.h |
3 | // Purpose: Double-buffering plugin class for reducing flicker | |
8e08b761 JS |
4 | // Author: Aleksandras Gluchovas (@Lithuania) |
5 | // Modified by: | |
6 | // Created: 23/10/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Aleksandras Gluchovas | |
4cbc57f0 | 9 | // Licence: wxWindows licence |
8e08b761 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef __ANTIFLICKPL_G__ | |
13 | #define __ANTIFLICKPL_G__ | |
14 | ||
ab7ce33c | 15 | #if defined(__GNUG__) && !defined(__APPLE__) |
8e08b761 JS |
16 | #pragma interface "antiflickpl.h" |
17 | #endif | |
18 | ||
19 | #include "wx/fl/controlbar.h" | |
20 | ||
e598303a JS |
21 | /* |
22 | Implements double-buffering to reduce flicker. | |
4cbc57f0 | 23 | Bitmap and memory DC buffers are shared 'resources' among all instances of |
e598303a JS |
24 | antiflicker plugins within the application. |
25 | ||
4cbc57f0 | 26 | Locking for multithreaded applications is not yet implemented. |
e598303a JS |
27 | */ |
28 | ||
2b5f62a0 | 29 | class WXFL_DECLSPEC cbAntiflickerPlugin : public cbPluginBase |
8e08b761 | 30 | { |
4cbc57f0 | 31 | DECLARE_DYNAMIC_CLASS( cbAntiflickerPlugin ) |
8e08b761 | 32 | protected: |
8e08b761 | 33 | |
4cbc57f0 JS |
34 | static wxBitmap* mpVertBuf; |
35 | static wxBitmap* mpHorizBuf; | |
36 | static wxMemoryDC* mpVertBufDc; | |
37 | static wxMemoryDC* mpHorizBufDc; | |
8e08b761 | 38 | |
4cbc57f0 | 39 | static int mRefCount; |
8e08b761 | 40 | |
4cbc57f0 JS |
41 | wxDC* mpLRUBufDc; // last-recently-used buffer |
42 | wxRect mLRUArea; // last-recently-used area | |
8e08b761 JS |
43 | |
44 | protected: | |
4cbc57f0 | 45 | // Finds a suitable buffer. Returns NULL if a suitable buffer is not present. |
8e08b761 | 46 | |
4cbc57f0 JS |
47 | wxDC* FindSuitableBuffer( const wxRect& forArea ); |
48 | ||
49 | // Allocates a suitable buffer. | |
50 | ||
51 | wxDC* AllocNewBuffer( const wxRect& forArea ); | |
52 | ||
53 | // Gets the window device context. | |
54 | ||
55 | wxDC& GetWindowDC(); | |
56 | ||
57 | // Gets the client device context. | |
58 | ||
59 | wxDC& GetClientDC(); | |
8e08b761 JS |
60 | public: |
61 | ||
4cbc57f0 JS |
62 | // Default constructor. |
63 | ||
64 | cbAntiflickerPlugin(void); | |
65 | ||
66 | // Constructor taking frame layout panel, and pane mask. | |
67 | ||
68 | cbAntiflickerPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES ); | |
69 | ||
70 | // Destructor. | |
71 | ||
72 | virtual ~cbAntiflickerPlugin(); | |
8e08b761 | 73 | |
4cbc57f0 | 74 | // Handler for plugin event. |
8e08b761 | 75 | |
4cbc57f0 | 76 | void OnStartDrawInArea ( cbStartDrawInAreaEvent& event ); |
8e08b761 | 77 | |
4cbc57f0 | 78 | // Handler for plugin event. |
e598303a | 79 | |
4cbc57f0 | 80 | void OnFinishDrawInArea( cbFinishDrawInAreaEvent& event ); |
8e08b761 | 81 | |
4cbc57f0 | 82 | DECLARE_EVENT_TABLE() |
8e08b761 JS |
83 | }; |
84 | ||
85 | #endif /* __ANTIFLICKPL_G__ */ | |
86 |