slowly approaching dcscreen...
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32060 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -25,8 +25,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC)
|
|||||||
// Create a DC representing the whole screen
|
// Create a DC representing the whole screen
|
||||||
wxScreenDC::wxScreenDC()
|
wxScreenDC::wxScreenDC()
|
||||||
{
|
{
|
||||||
#if wxMAC_USE_CORE_GRAPHICS
|
|
||||||
#else
|
|
||||||
m_macPort = CreateNewPort() ;
|
m_macPort = CreateNewPort() ;
|
||||||
GrafPtr port ;
|
GrafPtr port ;
|
||||||
GetPort( &port ) ;
|
GetPort( &port ) ;
|
||||||
@@ -37,28 +35,35 @@ wxScreenDC::wxScreenDC()
|
|||||||
m_macLocalOrigin.x = -pt.h ;
|
m_macLocalOrigin.x = -pt.h ;
|
||||||
m_macLocalOrigin.y = -pt.v ;
|
m_macLocalOrigin.y = -pt.v ;
|
||||||
|
|
||||||
m_ok = TRUE ;
|
|
||||||
BitMap screenBits;
|
BitMap screenBits;
|
||||||
GetQDGlobalsScreenBits( &screenBits );
|
GetQDGlobalsScreenBits( &screenBits );
|
||||||
m_minX = screenBits.bounds.left ;
|
m_minX = screenBits.bounds.left ;
|
||||||
|
|
||||||
SInt16 height ;
|
SInt16 height ;
|
||||||
GetThemeMenuBarHeight( &height ) ;
|
GetThemeMenuBarHeight( &height ) ;
|
||||||
m_minY = screenBits.bounds.top + height ;
|
m_minY = screenBits.bounds.top + height ;
|
||||||
|
|
||||||
m_maxX = screenBits.bounds.right ;
|
m_maxX = screenBits.bounds.right ;
|
||||||
m_maxY = screenBits.bounds.bottom ;
|
m_maxY = screenBits.bounds.bottom ;
|
||||||
|
|
||||||
|
#if wxMAC_USE_CORE_GRAPHICS
|
||||||
|
m_graphicContext = new wxMacCGContext( port ) ;
|
||||||
|
#else
|
||||||
MacSetRectRgn( (RgnHandle) m_macBoundaryClipRgn , m_minX , m_minY , m_maxX , m_maxY ) ;
|
MacSetRectRgn( (RgnHandle) m_macBoundaryClipRgn , m_minX , m_minY , m_maxX , m_maxY ) ;
|
||||||
OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , m_macLocalOrigin.x , m_macLocalOrigin.y ) ;
|
OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , m_macLocalOrigin.x , m_macLocalOrigin.y ) ;
|
||||||
CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
|
CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
|
||||||
#endif
|
#endif
|
||||||
|
m_ok = TRUE ;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxScreenDC::~wxScreenDC()
|
wxScreenDC::~wxScreenDC()
|
||||||
{
|
{
|
||||||
#if wxMAC_USE_CORE_GRAPHICS
|
#if wxMAC_USE_CORE_GRAPHICS
|
||||||
#else
|
delete m_graphicContext ;
|
||||||
DisposePort( (CGrafPtr) m_macPort ) ;
|
m_graphicContext = NULL ;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if ( m_macPort )
|
||||||
|
DisposePort( (CGrafPtr) m_macPort ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user