]>
git.saurik.com Git - wxWidgets.git/blob - src/mac/carbon/dcscreen.cpp
f5012952b9ff5049d449e203faa0d98d9589f788
   1 ///////////////////////////////////////////////////////////////////////////// 
   3 // Purpose:     wxScreenDC class 
   4 // Author:      Stefan Csomor 
   8 // Copyright:   (c) Stefan Csomor 
   9 // Licence:       wxWindows licence 
  10 ///////////////////////////////////////////////////////////////////////////// 
  12 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) 
  13 #pragma implementation "dcscreen.h" 
  16 #include "wx/wxprec.h" 
  18 #include "wx/dcscreen.h" 
  19 #include "wx/mac/uma.h" 
  21 #if !USE_SHARED_LIBRARY 
  22 IMPLEMENT_DYNAMIC_CLASS(wxScreenDC
, wxWindowDC
) 
  25 // Create a DC representing the whole screen 
  26 wxScreenDC::wxScreenDC() 
  28     m_macPort 
= CreateNewPort() ; 
  31     SetPort( (GrafPtr
) m_macPort 
) ; 
  33     LocalToGlobal( &pt 
) ;      
  35     m_macLocalOrigin
.x 
= -pt
.h 
; 
  36     m_macLocalOrigin
.y 
= -pt
.v 
; 
  37 #if wxMAC_USE_CORE_GRAPHICS 
  38     m_macLocalOriginInPort 
= m_macLocalOrigin 
; 
  42     GetQDGlobalsScreenBits( &screenBits 
); 
  43     m_minX 
= screenBits
.bounds
.left 
; 
  46     GetThemeMenuBarHeight( &height 
) ; 
  47     m_minY 
= screenBits
.bounds
.top 
+ height 
; 
  49     m_maxX 
= screenBits
.bounds
.right  
; 
  50     m_maxY 
= screenBits
.bounds
.bottom 
; 
  52 #if wxMAC_USE_CORE_GRAPHICS 
  53     m_graphicContext 
= new wxMacCGContext( port 
) ;     
  55     MacSetRectRgn( (RgnHandle
) m_macBoundaryClipRgn 
, m_minX 
, m_minY 
, m_maxX 
, m_maxY 
) ; 
  56     OffsetRgn( (RgnHandle
) m_macBoundaryClipRgn 
, m_macLocalOrigin
.x 
, m_macLocalOrigin
.y 
) ; 
  57     CopyRgn( (RgnHandle
) m_macBoundaryClipRgn 
, (RgnHandle
) m_macCurrentClipRgn 
) ; 
  62 wxScreenDC::~wxScreenDC() 
  64 #if wxMAC_USE_CORE_GRAPHICS 
  65     delete m_graphicContext 
; 
  66     m_graphicContext 
= NULL 
; 
  70         DisposePort( (CGrafPtr
) m_macPort 
) ;