]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/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()
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
) ;
57 wxSize size
= the_canvas
->GetSize() ;
65 wxWindowDC::~wxWindowDC()
73 wxClientDC::wxClientDC()
77 wxClientDC::wxClientDC(wxWindow
*window
)
80 wxWindow
* rootwindow
;
82 window
->MacGetPortClientParams(&m_macLocalOrigin
, &m_macClipRect
, &windowref
, &rootwindow
);
83 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 wxWindow
* rootwindow
;
111 window
->MacGetPortClientParams(&m_macLocalOrigin
, &m_macClipRect
, &windowref
, &rootwindow
);
113 m_macPort
= UMAGetWindowPort( windowref
) ;
117 window
->GetUpdateRegion().GetBox( x
, y
, w
, h
) ;
119 wxSize size
= window
->GetSize() ;
122 SetClippingRegion( x
, y
, w
, h
) ;
123 SetBackground(wxBrush(window
->GetBackgroundColour(), wxSOLID
));
124 SetFont(window
->GetFont() ) ;
127 wxPaintDC::~wxPaintDC()