From: Stefan Csomor Date: Fri, 18 Feb 2005 16:47:07 +0000 (+0000) Subject: reintroducing direct access, cleanup X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/880f53691238fe11ae8d31c2c37b0ea0e39bf8ba reintroducing direct access, cleanup git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@32143 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/mac/carbon/dc.h b/include/wx/mac/carbon/dc.h index 835aa3a65f..62a3961fa2 100644 --- a/include/wx/mac/carbon/dc.h +++ b/include/wx/mac/carbon/dc.h @@ -316,15 +316,16 @@ protected: #if wxMAC_USE_CORE_GRAPHICS // CoreGraphics wxGraphicContext * m_graphicContext ; + wxPoint m_macLocalOriginInPort ; #else - mutable bool m_macFontInstalled ; - mutable bool m_macPenInstalled ; - mutable bool m_macBrushInstalled ; - - WXHRGN m_macBoundaryClipRgn ; - WXHRGN m_macCurrentClipRgn ; - void MacSetupPort( wxMacPortStateHelper* ph ) const ; - void MacCleanupPort( wxMacPortStateHelper* ph ) const ; + mutable bool m_macFontInstalled ; + mutable bool m_macPenInstalled ; + mutable bool m_macBrushInstalled ; + + WXHRGN m_macBoundaryClipRgn ; + WXHRGN m_macCurrentClipRgn ; + void MacSetupPort( wxMacPortStateHelper* ph ) const ; + void MacCleanupPort( wxMacPortStateHelper* ph ) const ; mutable wxMacPortStateHelper* m_macCurrentPortStateHelper ; mutable bool m_macFormerAliasState ; mutable short m_macFormerAliasSize ; diff --git a/src/mac/carbon/dccg.cpp b/src/mac/carbon/dccg.cpp index c610c95a4e..4a26beeb28 100755 --- a/src/mac/carbon/dccg.cpp +++ b/src/mac/carbon/dccg.cpp @@ -906,8 +906,17 @@ bool wxDC::DoFloodFill(wxCoord x, wxCoord y, bool wxDC::DoGetPixel( wxCoord x, wxCoord y, wxColour *col ) const { wxCHECK_MSG( Ok(), false, wxT("wxDC::DoGetPixel Invalid DC") ); - wxFAIL_MSG( wxT("GetPixel not implemented on Core Graphics") ) ; - return false ; + wxCHECK_MSG( Ok(), false, wxT("wxDC::DoGetPixel Invalid DC") ); + wxMacPortSaver helper((CGrafPtr)m_macPort) ; + RGBColor colour; + GetCPixel( + XLOG2DEVMAC(x) + m_macLocalOriginInPort.x - m_macLocalOrigin.x, + YLOG2DEVMAC(y) + m_macLocalOriginInPort.y - m_macLocalOrigin.y, &colour ); + // Convert from Mac colour to wx + col->Set( colour.red >> 8, + colour.green >> 8, + colour.blue >> 8); + return true ; } void wxDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )