]>
Commit | Line | Data |
---|---|---|
e9576ca5 SC |
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 <math.h> | |
20 | ||
21 | //----------------------------------------------------------------------------- | |
22 | // constants | |
23 | //----------------------------------------------------------------------------- | |
24 | ||
25 | #define RAD2DEG 57.2957795131 | |
26 | ||
27 | //----------------------------------------------------------------------------- | |
28 | // wxPaintDC | |
29 | //----------------------------------------------------------------------------- | |
30 | ||
2f1ae414 | 31 | #if !USE_SHARED_LIBRARY |
e9576ca5 SC |
32 | IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC) |
33 | IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC) | |
34 | IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC) | |
2f1ae414 | 35 | #endif |
e9576ca5 SC |
36 | |
37 | /* | |
38 | * wxWindowDC | |
39 | */ | |
40 | ||
519cb848 SC |
41 | #include <wx/mac/uma.h> |
42 | ||
2f1ae414 | 43 | wxWindowDC::wxWindowDC() |
e9576ca5 | 44 | { |
519cb848 | 45 | } |
e9576ca5 | 46 | |
2f1ae414 | 47 | wxWindowDC::wxWindowDC(wxWindow *the_canvas) |
519cb848 SC |
48 | { |
49 | WindowRef windowref ; | |
50 | wxWindow* rootwindow ; | |
51 | ||
52 | // this time it is really the full window | |
53 | ||
54 | the_canvas->MacGetPortParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow ); | |
55 | m_macPort = UMAGetWindowPort( windowref ) ; | |
2f1ae414 SC |
56 | m_minY = m_minX = 0; |
57 | wxSize size = the_canvas->GetSize() ; | |
58 | m_maxX = size.x ; | |
59 | m_maxY = size.y ; | |
60 | ||
519cb848 SC |
61 | MacSetupPort() ; |
62 | m_ok = TRUE ; | |
63 | } | |
e9576ca5 | 64 | |
2f1ae414 | 65 | wxWindowDC::~wxWindowDC() |
e9576ca5 | 66 | { |
519cb848 | 67 | } |
e9576ca5 | 68 | |
519cb848 SC |
69 | /* |
70 | * wxClientDC | |
71 | */ | |
e9576ca5 | 72 | |
2f1ae414 | 73 | wxClientDC::wxClientDC() |
e9576ca5 | 74 | { |
e9576ca5 SC |
75 | } |
76 | ||
519cb848 | 77 | wxClientDC::wxClientDC(wxWindow *window) |
e9576ca5 | 78 | { |
519cb848 SC |
79 | WindowRef windowref ; |
80 | wxWindow* rootwindow ; | |
81 | ||
82 | window->MacGetPortClientParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow ); | |
83 | m_macPort = UMAGetWindowPort( windowref ) ; | |
84 | MacSetupPort() ; | |
2f1ae414 SC |
85 | m_minY = m_minX = 0; |
86 | wxSize size = window->GetSize() ; | |
87 | m_maxX = size.x ; | |
88 | m_maxY = size.y ; | |
519cb848 | 89 | m_ok = TRUE ; |
7c74e7fe SC |
90 | SetBackground(wxBrush(window->GetBackgroundColour(), wxSOLID)); |
91 | SetFont( window->GetFont() ) ; | |
e9576ca5 SC |
92 | } |
93 | ||
2f1ae414 | 94 | wxClientDC::~wxClientDC() |
e9576ca5 | 95 | { |
e9576ca5 SC |
96 | } |
97 | ||
519cb848 SC |
98 | /* |
99 | * wxPaintDC | |
100 | */ | |
e9576ca5 | 101 | |
2f1ae414 | 102 | wxPaintDC::wxPaintDC() |
e9576ca5 | 103 | { |
e9576ca5 SC |
104 | } |
105 | ||
519cb848 | 106 | wxPaintDC::wxPaintDC(wxWindow *window) |
e9576ca5 | 107 | { |
519cb848 SC |
108 | WindowRef windowref ; |
109 | wxWindow* rootwindow ; | |
110 | ||
111 | window->MacGetPortClientParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow ); | |
e9576ca5 | 112 | |
519cb848 SC |
113 | m_macPort = UMAGetWindowPort( windowref ) ; |
114 | MacSetupPort() ; | |
115 | m_ok = TRUE ; | |
116 | long x , y ,w , h ; | |
117 | window->GetUpdateRegion().GetBox( x , y , w , h ) ; | |
2f1ae414 SC |
118 | m_minY = m_minX = 0; |
119 | wxSize size = window->GetSize() ; | |
120 | m_maxX = size.x ; | |
121 | m_maxY = size.y ; | |
519cb848 SC |
122 | SetClippingRegion( x , y , w , h ) ; |
123 | SetBackground(wxBrush(window->GetBackgroundColour(), wxSOLID)); | |
7c74e7fe | 124 | SetFont(window->GetFont() ) ; |
e9576ca5 SC |
125 | } |
126 | ||
519cb848 | 127 | wxPaintDC::~wxPaintDC() |
e9576ca5 | 128 | { |
519cb848 | 129 | } |