]> git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/dcclient.cpp
Bumped version and soname for 2.3.3
[wxWidgets.git] / src / mac / carbon / dcclient.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: dcclient.cpp
3 // Purpose: wxClientDC class
4 // Author: AUTHOR
5 // Modified by:
6 // Created: 01/02/97
7 // RCS-ID: $Id$
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifdef __GNUG__
13 #pragma implementation "dcclient.h"
14 #endif
15
16 #include "wx/dcclient.h"
17 #include "wx/dcmemory.h"
18 #include "wx/region.h"
19 #include "wx/window.h"
20 #include <math.h>
21
22 //-----------------------------------------------------------------------------
23 // constants
24 //-----------------------------------------------------------------------------
25
26 #define RAD2DEG 57.2957795131
27
28 //-----------------------------------------------------------------------------
29 // wxPaintDC
30 //-----------------------------------------------------------------------------
31
32 #if !USE_SHARED_LIBRARY
33 IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
34 IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
35 IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC)
36 #endif
37
38 /*
39 * wxWindowDC
40 */
41
42 #include "wx/mac/uma.h"
43
44 wxWindowDC::wxWindowDC()
45 {
46 }
47
48 wxWindowDC::wxWindowDC(wxWindow *the_canvas)
49 {
50 WindowRef windowref ;
51 wxWindowMac* rootwindow ;
52
53 // this time it is really the full window
54 Rect clipRect ;
55 the_canvas->MacGetPortParams(&m_macLocalOrigin, &clipRect , &windowref , &rootwindow );
56 SetRectRgn( m_macBoundaryClipRgn , clipRect.left , clipRect.top , clipRect.right , clipRect.bottom ) ;
57 m_macPort = UMAGetWindowPort( windowref ) ;
58 m_minY = m_minX = 0;
59 wxSize size = the_canvas->GetSize() ;
60 m_maxX = size.x ;
61 m_maxY = size.y ;
62
63 m_ok = TRUE ;
64 SetBackground(wxBrush(the_canvas->GetBackgroundColour(), wxSOLID));
65 }
66
67 wxWindowDC::~wxWindowDC()
68 {
69 }
70
71 /*
72 * wxClientDC
73 */
74
75 wxClientDC::wxClientDC()
76 {
77 }
78
79 wxClientDC::wxClientDC(wxWindow *window)
80 {
81 WindowRef windowref ;
82 wxWindowMac* rootwindow ;
83
84 Rect clipRect ;
85 window->MacGetPortClientParams(&m_macLocalOrigin, &clipRect , &windowref , &rootwindow );
86 SetRectRgn( m_macBoundaryClipRgn , clipRect.left , clipRect.top , clipRect.right , clipRect.bottom ) ;
87 m_macPort = UMAGetWindowPort( windowref ) ;
88 m_minY = m_minX = 0;
89 wxSize size = window->GetSize() ;
90 m_maxX = size.x ;
91 m_maxY = size.y ;
92 m_ok = TRUE ;
93 SetBackground(wxBrush(window->GetBackgroundColour(), wxSOLID));
94 SetFont( window->GetFont() ) ;
95 }
96
97 wxClientDC::~wxClientDC()
98 {
99 }
100
101 /*
102 * wxPaintDC
103 */
104
105 wxPaintDC::wxPaintDC()
106 {
107 }
108
109 wxPaintDC::wxPaintDC(wxWindow *window)
110 {
111 WindowRef windowref ;
112 wxWindowMac* rootwindow ;
113
114 Rect clipRect ;
115 window->MacGetPortClientParams(&m_macLocalOrigin, &clipRect , &windowref , &rootwindow );
116 CopyRgn( window->GetUpdateRegion().GetWXHRGN() , m_macBoundaryClipRgn ) ;
117 m_macPort = UMAGetWindowPort( windowref ) ;
118 m_ok = TRUE ;
119 /*
120 wxCoord x , y ,w , h ;
121 window->GetUpdateRegion().GetBox( x , y , w , h ) ;
122 m_minY = m_minX = 0;
123 wxSize size = window->GetSize() ;
124 m_maxX = size.x ;
125 m_maxY = size.y ;
126 SetClippingRegion( x , y , w , h ) ;
127 */
128 SetBackground(wxBrush(window->GetBackgroundColour(), wxSOLID));
129 SetFont(window->GetFont() ) ;
130 }
131
132 wxPaintDC::~wxPaintDC()
133 {
134 }