]>
Commit | Line | Data |
---|---|---|
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 | ||
31 | #if !USE_SHARED_LIBRARY | |
32 | IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC) | |
33 | IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC) | |
34 | IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC) | |
35 | #endif | |
36 | ||
37 | /* | |
38 | * wxWindowDC | |
39 | */ | |
40 | ||
41 | #include <wx/mac/uma.h> | |
42 | ||
43 | wxWindowDC::wxWindowDC(void) | |
44 | { | |
45 | } | |
46 | ||
47 | wxWindowDC::wxWindowDC(wxWindow *the_canvas) | |
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 ) ; | |
56 | MacSetupPort() ; | |
57 | m_ok = TRUE ; | |
58 | } | |
59 | ||
60 | wxWindowDC::~wxWindowDC(void) | |
61 | { | |
62 | } | |
63 | ||
64 | /* | |
65 | * wxClientDC | |
66 | */ | |
67 | ||
68 | wxClientDC::wxClientDC(void) | |
69 | { | |
70 | } | |
71 | ||
72 | wxClientDC::wxClientDC(wxWindow *window) | |
73 | { | |
74 | WindowRef windowref ; | |
75 | wxWindow* rootwindow ; | |
76 | ||
77 | window->MacGetPortClientParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow ); | |
78 | m_macPort = UMAGetWindowPort( windowref ) ; | |
79 | MacSetupPort() ; | |
80 | m_ok = TRUE ; | |
81 | SetBackground(wxBrush(window->GetBackgroundColour(), wxSOLID)); | |
82 | SetFont( window->GetFont() ) ; | |
83 | } | |
84 | ||
85 | wxClientDC::~wxClientDC(void) | |
86 | { | |
87 | } | |
88 | ||
89 | /* | |
90 | * wxPaintDC | |
91 | */ | |
92 | ||
93 | wxPaintDC::wxPaintDC(void) | |
94 | { | |
95 | } | |
96 | ||
97 | wxPaintDC::wxPaintDC(wxWindow *window) | |
98 | { | |
99 | WindowRef windowref ; | |
100 | wxWindow* rootwindow ; | |
101 | ||
102 | window->MacGetPortClientParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow ); | |
103 | ||
104 | m_macPort = UMAGetWindowPort( windowref ) ; | |
105 | MacSetupPort() ; | |
106 | m_ok = TRUE ; | |
107 | long x , y ,w , h ; | |
108 | window->GetUpdateRegion().GetBox( x , y , w , h ) ; | |
109 | SetClippingRegion( x , y , w , h ) ; | |
110 | SetBackground(wxBrush(window->GetBackgroundColour(), wxSOLID)); | |
111 | SetFont(window->GetFont() ) ; | |
112 | } | |
113 | ||
114 | wxPaintDC::~wxPaintDC() | |
115 | { | |
116 | } |