| 1 | ///////////////////////////////////////////////////////////////////////////// |
| 2 | // Name: wx/palmos/dcclient.h |
| 3 | // Purpose: wxClientDC class |
| 4 | // Author: William Osborne - minimal working wxPalmOS port |
| 5 | // Modified by: |
| 6 | // Created: 10/13/04 |
| 7 | // RCS-ID: $Id$ |
| 8 | // Copyright: (c) William Osborne |
| 9 | // Licence: wxWindows licence |
| 10 | ///////////////////////////////////////////////////////////////////////////// |
| 11 | |
| 12 | #ifndef _WX_DCCLIENT_H_ |
| 13 | #define _WX_DCCLIENT_H_ |
| 14 | |
| 15 | // ---------------------------------------------------------------------------- |
| 16 | // headers |
| 17 | // ---------------------------------------------------------------------------- |
| 18 | |
| 19 | #include "wx/dc.h" |
| 20 | #include "wx/dynarray.h" |
| 21 | |
| 22 | // ---------------------------------------------------------------------------- |
| 23 | // array types |
| 24 | // ---------------------------------------------------------------------------- |
| 25 | |
| 26 | // this one if used by wxPaintDC only |
| 27 | struct WXDLLEXPORT wxPaintDCInfo; |
| 28 | |
| 29 | WX_DECLARE_EXPORTED_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo); |
| 30 | |
| 31 | // ---------------------------------------------------------------------------- |
| 32 | // DC classes |
| 33 | // ---------------------------------------------------------------------------- |
| 34 | |
| 35 | class WXDLLEXPORT wxWindowDC : public wxDC |
| 36 | { |
| 37 | public: |
| 38 | // default ctor |
| 39 | wxWindowDC(); |
| 40 | |
| 41 | // Create a DC corresponding to the whole window |
| 42 | wxWindowDC(wxWindow *win); |
| 43 | |
| 44 | protected: |
| 45 | // initialize the newly created DC |
| 46 | void InitDC(); |
| 47 | |
| 48 | // override some base class virtuals |
| 49 | virtual void DoGetSize(int *width, int *height) const; |
| 50 | |
| 51 | private: |
| 52 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxWindowDC) |
| 53 | }; |
| 54 | |
| 55 | class WXDLLEXPORT wxClientDC : public wxWindowDC |
| 56 | { |
| 57 | public: |
| 58 | // default ctor |
| 59 | wxClientDC(); |
| 60 | |
| 61 | // Create a DC corresponding to the client area of the window |
| 62 | wxClientDC(wxWindow *win); |
| 63 | |
| 64 | virtual ~wxClientDC(); |
| 65 | |
| 66 | protected: |
| 67 | void InitDC(); |
| 68 | |
| 69 | // override some base class virtuals |
| 70 | virtual void DoGetSize(int *width, int *height) const; |
| 71 | |
| 72 | private: |
| 73 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxClientDC) |
| 74 | }; |
| 75 | |
| 76 | class WXDLLEXPORT wxPaintDC : public wxClientDC |
| 77 | { |
| 78 | public: |
| 79 | wxPaintDC(); |
| 80 | |
| 81 | // Create a DC corresponding for painting the window in OnPaint() |
| 82 | wxPaintDC(wxWindow *win); |
| 83 | |
| 84 | virtual ~wxPaintDC(); |
| 85 | |
| 86 | // find the entry for this DC in the cache (keyed by the window) |
| 87 | static WXHDC FindDCInCache(wxWindow* win); |
| 88 | |
| 89 | protected: |
| 90 | static wxArrayDCInfo ms_cache; |
| 91 | |
| 92 | // find the entry for this DC in the cache (keyed by the window) |
| 93 | wxPaintDCInfo *FindInCache(size_t *index = NULL) const; |
| 94 | |
| 95 | private: |
| 96 | DECLARE_DYNAMIC_CLASS_NO_COPY(wxPaintDC) |
| 97 | }; |
| 98 | |
| 99 | /* |
| 100 | * wxPaintDCEx |
| 101 | * This class is used when an application sends an HDC with the WM_PAINT |
| 102 | * message. It is used in HandlePaint and need not be used by an application. |
| 103 | */ |
| 104 | |
| 105 | class WXDLLEXPORT wxPaintDCEx : public wxPaintDC |
| 106 | { |
| 107 | public: |
| 108 | wxPaintDCEx(wxWindow *canvas, WXHDC dc); |
| 109 | virtual ~wxPaintDCEx(); |
| 110 | private: |
| 111 | int saveState; |
| 112 | |
| 113 | DECLARE_CLASS(wxPaintDCEx) |
| 114 | DECLARE_NO_COPY_CLASS(wxPaintDCEx) |
| 115 | }; |
| 116 | |
| 117 | #endif |
| 118 | // _WX_DCCLIENT_H_ |