]> git.saurik.com Git - wxWidgets.git/blame - contrib/include/wx/fl/antiflickpl.h
wxPalette unified. Source cleaning.
[wxWidgets.git] / contrib / include / wx / fl / antiflickpl.h
CommitLineData
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
8e08b761
JS
15#include "wx/fl/controlbar.h"
16
e598303a
JS
17/*
18Implements double-buffering to reduce flicker.
4cbc57f0 19Bitmap and memory DC buffers are shared 'resources' among all instances of
e598303a
JS
20antiflicker plugins within the application.
21
4cbc57f0 22Locking for multithreaded applications is not yet implemented.
e598303a
JS
23*/
24
510b9edb 25class WXDLLIMPEXP_FL cbAntiflickerPlugin : public cbPluginBase
8e08b761 26{
4cbc57f0 27 DECLARE_DYNAMIC_CLASS( cbAntiflickerPlugin )
8e08b761 28protected:
8e08b761 29
4cbc57f0
JS
30 static wxBitmap* mpVertBuf;
31 static wxBitmap* mpHorizBuf;
32 static wxMemoryDC* mpVertBufDc;
33 static wxMemoryDC* mpHorizBufDc;
8e08b761 34
4cbc57f0 35 static int mRefCount;
8e08b761 36
4cbc57f0
JS
37 wxDC* mpLRUBufDc; // last-recently-used buffer
38 wxRect mLRUArea; // last-recently-used area
8e08b761
JS
39
40protected:
4cbc57f0 41 // Finds a suitable buffer. Returns NULL if a suitable buffer is not present.
8e08b761 42
4cbc57f0
JS
43 wxDC* FindSuitableBuffer( const wxRect& forArea );
44
45 // Allocates a suitable buffer.
46
47 wxDC* AllocNewBuffer( const wxRect& forArea );
48
49 // Gets the window device context.
50
51 wxDC& GetWindowDC();
52
53 // Gets the client device context.
54
55 wxDC& GetClientDC();
8e08b761
JS
56public:
57
4cbc57f0
JS
58 // Default constructor.
59
60 cbAntiflickerPlugin(void);
61
62 // Constructor taking frame layout panel, and pane mask.
63
64 cbAntiflickerPlugin( wxFrameLayout* pPanel, int paneMask = wxALL_PANES );
65
66 // Destructor.
67
68 virtual ~cbAntiflickerPlugin();
8e08b761 69
4cbc57f0 70 // Handler for plugin event.
8e08b761 71
4cbc57f0 72 void OnStartDrawInArea ( cbStartDrawInAreaEvent& event );
8e08b761 73
4cbc57f0 74 // Handler for plugin event.
e598303a 75
4cbc57f0 76 void OnFinishDrawInArea( cbFinishDrawInAreaEvent& event );
8e08b761 77
4cbc57f0 78 DECLARE_EVENT_TABLE()
8e08b761
JS
79};
80
81#endif /* __ANTIFLICKPL_G__ */
82