fixing the screen dc, non 64 bit solution however
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42176 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -21,23 +21,23 @@ IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC)
|
|||||||
wxScreenDC::wxScreenDC()
|
wxScreenDC::wxScreenDC()
|
||||||
{
|
{
|
||||||
#if wxMAC_USE_CORE_GRAPHICS
|
#if wxMAC_USE_CORE_GRAPHICS
|
||||||
CGDirectDisplayID display = CGMainDisplayID();
|
CGrafPtr grafptr = CreateNewPort() ;
|
||||||
m_displayId = (UInt32) display;
|
m_displayId = (UInt32) grafptr;
|
||||||
CGError err = CGDisplayCaptureWithOptions(display,kCGCaptureNoFill);
|
CGContextRef cg = NULL;
|
||||||
wxASSERT( err == kCGErrorSuccess );
|
OSStatus status = QDBeginCGContext( grafptr , &cg );
|
||||||
CGContextRef cg = CGDisplayGetDrawingContext(display);
|
|
||||||
CGRect bounds ;
|
CGRect bounds ;
|
||||||
bounds = CGDisplayBounds(display);
|
bounds = CGDisplayBounds(CGMainDisplayID());
|
||||||
/*
|
|
||||||
m_macLocalOrigin.x = 0;
|
|
||||||
m_macLocalOrigin.y = 0;
|
|
||||||
*/ // TODO
|
|
||||||
SInt16 height;
|
SInt16 height;
|
||||||
GetThemeMenuBarHeight( &height );
|
GetThemeMenuBarHeight( &height );
|
||||||
m_minY = height;
|
m_minY = height;
|
||||||
m_minX = 0;
|
m_minX = 0;
|
||||||
m_maxX = bounds.size.width;
|
m_maxX = bounds.size.width;
|
||||||
m_maxY = bounds.size.height - height;
|
m_maxY = bounds.size.height - height;
|
||||||
|
CGContextTranslateCTM( cg , 0 , bounds.size.height );
|
||||||
|
CGContextScaleCTM( cg , 1 , -1 );
|
||||||
|
|
||||||
SetGraphicsContext( wxGraphicsContext::CreateFromNative( cg ) );
|
SetGraphicsContext( wxGraphicsContext::CreateFromNative( cg ) );
|
||||||
m_width = bounds.size.width;
|
m_width = bounds.size.width;
|
||||||
m_height = bounds.size.height - height;
|
m_height = bounds.size.height - height;
|
||||||
@@ -73,10 +73,13 @@ wxScreenDC::wxScreenDC()
|
|||||||
wxScreenDC::~wxScreenDC()
|
wxScreenDC::~wxScreenDC()
|
||||||
{
|
{
|
||||||
#if wxMAC_USE_CORE_GRAPHICS
|
#if wxMAC_USE_CORE_GRAPHICS
|
||||||
|
CGrafPtr grafptr = (CGrafPtr) m_displayId;
|
||||||
|
m_displayId = (UInt32) grafptr;
|
||||||
|
CGContextRef cg = (CGContextRef) m_graphicContext->GetNativeContext();
|
||||||
|
QDEndCGContext(grafptr, &cg );
|
||||||
|
|
||||||
delete m_graphicContext;
|
delete m_graphicContext;
|
||||||
m_graphicContext = NULL;
|
m_graphicContext = NULL;
|
||||||
CGDirectDisplayID display = (CGDirectDisplayID) m_displayId;
|
|
||||||
CGDisplayRelease( display );
|
|
||||||
#else
|
#else
|
||||||
if ( m_macPort )
|
if ( m_macPort )
|
||||||
DisposePort( (CGrafPtr) m_macPort ) ;
|
DisposePort( (CGrafPtr) m_macPort ) ;
|
||||||
|
Reference in New Issue
Block a user