1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxBufferedDC class
4 // Author: Ron Lee <ron@debian.org>
8 // Copyright: (c) Ron Lee
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_DCBUFFER_H_
13 #define _WX_DCBUFFER_H_
15 #if defined(__GNUG__) && !defined(__APPLE__)
16 #pragma interface "dcbuffer.h"
19 #include "wx/dcmemory.h"
20 #include "wx/dcclient.h"
23 // ==============================================================
24 // Double buffering helper.
25 // --------------------------------------------------------------
27 class WXDLLEXPORT wxBufferedDC
: public wxMemoryDC
31 // Without the existence of a wxNullDC, this must be
32 // a pointer, else it could probably be a reference.
39 // Default ctor, must subsequently call Init for
40 // two stage construction.
46 // Construct a wxBufferedDC using a user supplied buffer.
48 wxBufferedDC( wxDC
*dc
, const wxBitmap
&buffer
);
50 // Construct a wxBufferedDC with an internal buffer of 'area'
51 // (where area is usually something like the size of the window
54 wxBufferedDC( wxDC
*dc
, const wxSize
&area
);
56 // default copy ctor ok.
58 // The usually desired action in the dtor is to blit the buffer.
62 // These reimplement the actions of the ctors for
63 // two stage creation, but are not used by the ctors
64 // themselves to save a few cpu cycles.
66 void Init( wxDC
*dc
, const wxBitmap
&bitmap
);
67 void Init( wxDC
*dc
, const wxSize
&area
);
69 // Blits the buffer to the dc, and detaches the dc from
70 // the buffer. Usually called in the dtor or by the dtor
71 // of derived classes if the BufferedDC must blit before
72 // the derived class (which may own the dc it's blitting
77 DECLARE_NO_COPY_CLASS(wxBufferedDC
)
81 // ==============================================================
82 // Double buffered PaintDC.
83 // --------------------------------------------------------------
85 // Creates a double buffered wxPaintDC, optionally allowing the
86 // user to specify their own buffer to use.
88 class WXDLLEXPORT wxBufferedPaintDC
: public wxBufferedDC
96 wxBufferedPaintDC( wxWindow
*window
, const wxBitmap
&buffer
= wxNullBitmap
);
98 // default copy ctor ok.
100 ~wxBufferedPaintDC();
104 #endif // _WX_DCBUFFER_H_