]>
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"
21 //-----------------------------------------------------------------------------
23 //-----------------------------------------------------------------------------
25 #define RAD2DEG 57.2957795131
27 //-----------------------------------------------------------------------------
29 //-----------------------------------------------------------------------------
31 IMPLEMENT_DYNAMIC_CLASS(wxWindowDC
, wxDC
)
32 IMPLEMENT_DYNAMIC_CLASS(wxClientDC
, wxWindowDC
)
33 IMPLEMENT_DYNAMIC_CLASS(wxPaintDC
, wxWindowDC
)
39 #include <wx/mac/uma.h>
41 wxWindowDC::wxWindowDC(void)
45 wxWindowDC::wxWindowDC(wxWindow
*the_canvas
)
48 wxWindow
* rootwindow
;
50 // this time it is really the full window
52 the_canvas
->MacGetPortParams(&m_macLocalOrigin
, &m_macClipRect
, &windowref
, &rootwindow
);
53 m_macPort
= UMAGetWindowPort( windowref
) ;
58 wxWindowDC::~wxWindowDC(void)
66 wxClientDC::wxClientDC(void)
70 wxClientDC::wxClientDC(wxWindow
*window
)
73 wxWindow
* rootwindow
;
75 window
->MacGetPortClientParams(&m_macLocalOrigin
, &m_macClipRect
, &windowref
, &rootwindow
);
76 m_macPort
= UMAGetWindowPort( windowref
) ;
79 SetBackground(wxBrush(window
->GetBackgroundColour(), wxSOLID
));
80 SetFont( window
->GetFont() ) ;
83 wxClientDC::~wxClientDC(void)
91 wxPaintDC::wxPaintDC(void)
95 wxPaintDC::wxPaintDC(wxWindow
*window
)
98 wxWindow
* rootwindow
;
100 window
->MacGetPortClientParams(&m_macLocalOrigin
, &m_macClipRect
, &windowref
, &rootwindow
);
102 m_macPort
= UMAGetWindowPort( windowref
) ;
106 window
->GetUpdateRegion().GetBox( x
, y
, w
, h
) ;
107 SetClippingRegion( x
, y
, w
, h
) ;
108 SetBackground(wxBrush(window
->GetBackgroundColour(), wxSOLID
));
109 SetFont(window
->GetFont() ) ;
112 wxPaintDC::~wxPaintDC()