]>
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 #if !USE_SHARED_LIBRARY
32 IMPLEMENT_DYNAMIC_CLASS(wxWindowDC
, wxDC
)
33 IMPLEMENT_DYNAMIC_CLASS(wxClientDC
, wxWindowDC
)
34 IMPLEMENT_DYNAMIC_CLASS(wxPaintDC
, wxWindowDC
)
41 #include <wx/mac/uma.h>
43 wxWindowDC::wxWindowDC(void)
47 wxWindowDC::wxWindowDC(wxWindow
*the_canvas
)
50 wxWindow
* rootwindow
;
52 // this time it is really the full window
54 the_canvas
->MacGetPortParams(&m_macLocalOrigin
, &m_macClipRect
, &windowref
, &rootwindow
);
55 m_macPort
= UMAGetWindowPort( windowref
) ;
60 wxWindowDC::~wxWindowDC(void)
68 wxClientDC::wxClientDC(void)
72 wxClientDC::wxClientDC(wxWindow
*window
)
75 wxWindow
* rootwindow
;
77 window
->MacGetPortClientParams(&m_macLocalOrigin
, &m_macClipRect
, &windowref
, &rootwindow
);
78 m_macPort
= UMAGetWindowPort( windowref
) ;
81 SetBackground(wxBrush(window
->GetBackgroundColour(), wxSOLID
));
82 SetFont( window
->GetFont() ) ;
85 wxClientDC::~wxClientDC(void)
93 wxPaintDC::wxPaintDC(void)
97 wxPaintDC::wxPaintDC(wxWindow
*window
)
100 wxWindow
* rootwindow
;
102 window
->MacGetPortClientParams(&m_macLocalOrigin
, &m_macClipRect
, &windowref
, &rootwindow
);
104 m_macPort
= UMAGetWindowPort( windowref
) ;
108 window
->GetUpdateRegion().GetBox( x
, y
, w
, h
) ;
109 SetClippingRegion( x
, y
, w
, h
) ;
110 SetBackground(wxBrush(window
->GetBackgroundColour(), wxSOLID
));
111 SetFont(window
->GetFont() ) ;
114 wxPaintDC::~wxPaintDC()