]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/dcclient.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxClientDC class
8 // Copyright: (c) AUTHOR
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "dcclient.h"
16 #include "wx/dcclient.h"
17 #include "wx/dcmemory.h"
18 #include "wx/region.h"
19 #include "wx/window.h"
22 //-----------------------------------------------------------------------------
24 //-----------------------------------------------------------------------------
26 #define RAD2DEG 57.2957795131
28 //-----------------------------------------------------------------------------
30 //-----------------------------------------------------------------------------
32 #if !USE_SHARED_LIBRARY
33 IMPLEMENT_DYNAMIC_CLASS(wxWindowDC
, wxDC
)
34 IMPLEMENT_DYNAMIC_CLASS(wxClientDC
, wxWindowDC
)
35 IMPLEMENT_DYNAMIC_CLASS(wxPaintDC
, wxWindowDC
)
42 #include <wx/mac/uma.h>
44 wxWindowDC::wxWindowDC()
48 wxWindowDC::wxWindowDC(wxWindow
*the_canvas
)
51 wxWindowMac
* rootwindow
;
53 // this time it is really the full window
55 the_canvas
->MacGetPortParams(&m_macLocalOrigin
, &m_macClipRect
, &windowref
, &rootwindow
);
56 m_macPort
= UMAGetWindowPort( windowref
) ;
58 wxSize size
= the_canvas
->GetSize() ;
63 SetBackground(wxBrush(the_canvas
->GetBackgroundColour(), wxSOLID
));
66 wxWindowDC::~wxWindowDC()
74 wxClientDC::wxClientDC()
78 wxClientDC::wxClientDC(wxWindow
*window
)
81 wxWindowMac
* rootwindow
;
83 window
->MacGetPortClientParams(&m_macLocalOrigin
, &m_macClipRect
, &windowref
, &rootwindow
);
84 m_macPort
= UMAGetWindowPort( windowref
) ;
86 wxSize size
= window
->GetSize() ;
90 SetBackground(wxBrush(window
->GetBackgroundColour(), wxSOLID
));
91 SetFont( window
->GetFont() ) ;
94 wxClientDC::~wxClientDC()
102 wxPaintDC::wxPaintDC()
106 wxPaintDC::wxPaintDC(wxWindow
*window
)
108 WindowRef windowref
;
109 wxWindowMac
* rootwindow
;
111 window
->MacGetPortClientParams(&m_macLocalOrigin
, &m_macClipRect
, &windowref
, &rootwindow
);
113 m_macPort
= UMAGetWindowPort( windowref
) ;
116 wxCoord x , y ,w , h ;
117 window->GetUpdateRegion().GetBox( x , y , w , h ) ;
119 wxSize size = window->GetSize() ;
122 SetClippingRegion( x , y , w , h ) ;
124 SetBackground(wxBrush(window
->GetBackgroundColour(), wxSOLID
));
125 SetFont(window
->GetFont() ) ;
128 wxPaintDC::~wxPaintDC()