]> git.saurik.com Git - wxWidgets.git/blob - include/wx/msw/dcclient.h
native apple event support for osx cocoa
[wxWidgets.git] / include / wx / msw / dcclient.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: dcclient.h
3 // Purpose: wxClientDC class
4 // Author: Julian Smart
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) Julian Smart
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/msw/dc.h"
21 #include "wx/dcclient.h"
22 #include "wx/dynarray.h"
23
24 // ----------------------------------------------------------------------------
25 // array types
26 // ----------------------------------------------------------------------------
27
28 // this one if used by wxPaintDC only
29 struct WXDLLIMPEXP_FWD_CORE wxPaintDCInfo;
30
31 WX_DECLARE_EXPORTED_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo);
32
33 // ----------------------------------------------------------------------------
34 // DC classes
35 // ----------------------------------------------------------------------------
36
37 class WXDLLIMPEXP_CORE wxWindowDCImpl : public wxMSWDCImpl
38 {
39 public:
40 // default ctor
41 wxWindowDCImpl( wxDC *owner );
42
43 // Create a DC corresponding to the whole window
44 wxWindowDCImpl( wxDC *owner, wxWindow *win );
45
46 virtual void DoGetSize(int *width, int *height) const;
47
48 protected:
49 // initialize the newly created DC
50 void InitDC();
51
52 DECLARE_CLASS(wxWindowDCImpl)
53 DECLARE_NO_COPY_CLASS(wxWindowDCImpl)
54 };
55
56 class WXDLLIMPEXP_CORE wxClientDCImpl : public wxWindowDCImpl
57 {
58 public:
59 // default ctor
60 wxClientDCImpl( wxDC *owner );
61
62 // Create a DC corresponding to the client area of the window
63 wxClientDCImpl( wxDC *owner, wxWindow *win );
64
65 virtual ~wxClientDCImpl();
66
67 virtual void DoGetSize(int *width, int *height) const;
68
69 protected:
70 void InitDC();
71
72 DECLARE_CLASS(wxClientDCImpl)
73 DECLARE_NO_COPY_CLASS(wxClientDCImpl)
74 };
75
76 class WXDLLIMPEXP_CORE wxPaintDCImpl : public wxClientDCImpl
77 {
78 public:
79 wxPaintDCImpl( wxDC *owner );
80
81 // Create a DC corresponding for painting the window in OnPaint()
82 wxPaintDCImpl( wxDC *owner, wxWindow *win );
83
84 virtual ~wxPaintDCImpl();
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 DECLARE_CLASS(wxPaintDCImpl)
96 DECLARE_NO_COPY_CLASS(wxPaintDCImpl)
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 WXDLLIMPEXP_CORE wxPaintDCEx : public wxPaintDC
106 {
107 public:
108 wxPaintDCEx(wxWindow *canvas, WXHDC dc);
109
110 DECLARE_CLASS(wxPaintDCEx)
111 DECLARE_NO_COPY_CLASS(wxPaintDCEx)
112 };
113
114 #endif
115 // _WX_DCCLIENT_H_