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"
22 // ==============================================================
23 // Double buffering helper.
24 // --------------------------------------------------------------
26 class WXDLLEXPORT wxBufferedDC
: public wxMemoryDC
30 // Without the existence of a wxNullDC, this must be
31 // a pointer, else it could probably be a reference.
38 // Default ctor, must subsequently call Init for
39 // two stage construction.
45 // Construct a wxBufferedDC using a user supplied buffer.
47 wxBufferedDC( wxDC
*dc
, const wxBitmap
&buffer
);
49 // Construct a wxBufferedDC with an internal buffer of 'area'
50 // (where area is usually something like the size of the window
53 wxBufferedDC( wxDC
*dc
, const wxSize
&area
);
55 // default copy ctor ok.
57 // The usually desired action in the dtor is to blit the buffer.
61 // These reimplement the actions of the ctors for
62 // two stage creation, but are not used by the ctors
63 // themselves to save a few cpu cycles.
65 void Init( wxDC
*dc
, const wxBitmap
&bitmap
);
66 void Init( wxDC
*dc
, const wxSize
&area
);
68 // Blits the buffer to the dc, and detaches the dc from
69 // the buffer. Usually called in the dtor or by the dtor
70 // of derived classes if the BufferedDC must blit before
71 // the derived class (which may own the dc it's blitting
76 DECLARE_NO_COPY_CLASS(wxBufferedDC
)
80 // ==============================================================
81 // Double buffered PaintDC.
82 // --------------------------------------------------------------
84 // Creates a double buffered wxPaintDC, optionally allowing the
85 // user to specify their own buffer to use.
87 class WXDLLEXPORT wxBufferedPaintDC
: public wxBufferedDC
95 wxBufferedPaintDC( wxWindow
*window
, const wxBitmap
&buffer
= wxNullBitmap
);
97 // default copy ctor ok.
103 #endif // _WX_DCBUFFER_H_