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