]> git.saurik.com Git - wxWidgets.git/blame - src/mac/carbon/dcscreen.cpp
compile fix
[wxWidgets.git] / src / mac / carbon / dcscreen.cpp
CommitLineData
e9576ca5
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: dcscreen.cpp
3// Purpose: wxScreenDC class
a31a5f85 4// Author: Stefan Csomor
e9576ca5 5// Modified by:
a31a5f85 6// Created: 1998-01-01
e9576ca5 7// RCS-ID: $Id$
a31a5f85 8// Copyright: (c) Stefan Csomor
65571936 9// Licence: wxWindows licence
e9576ca5
SC
10/////////////////////////////////////////////////////////////////////////////
11
3d1a4878 12#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
e9576ca5
SC
13#pragma implementation "dcscreen.h"
14#endif
15
3d1a4878
SC
16#include "wx/wxprec.h"
17
e9576ca5 18#include "wx/dcscreen.h"
2f1ae414 19#include "wx/mac/uma.h"
e9576ca5 20
2f1ae414 21#if !USE_SHARED_LIBRARY
e9576ca5 22IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC)
2f1ae414 23#endif
e9576ca5
SC
24
25// Create a DC representing the whole screen
26wxScreenDC::wxScreenDC()
27{
20b69855
SC
28#if wxMAC_USE_CORE_GRAPHICS
29#else
fa9666fb 30 m_macPort = CreateNewPort() ;
e40298d5
JS
31 GrafPtr port ;
32 GetPort( &port ) ;
33 SetPort( (GrafPtr) m_macPort ) ;
34 Point pt = { 0,0 } ;
35 LocalToGlobal( &pt ) ;
36 SetPort( port ) ;
37 m_macLocalOrigin.x = -pt.h ;
38 m_macLocalOrigin.y = -pt.v ;
20b69855 39
e40298d5
JS
40 m_ok = TRUE ;
41 BitMap screenBits;
42 GetQDGlobalsScreenBits( &screenBits );
43 m_minX = screenBits.bounds.left ;
20b69855 44
e40298d5
JS
45 SInt16 height ;
46 GetThemeMenuBarHeight( &height ) ;
47 m_minY = screenBits.bounds.top + height ;
20b69855 48
e40298d5
JS
49 m_maxX = screenBits.bounds.right ;
50 m_maxY = screenBits.bounds.bottom ;
51 MacSetRectRgn( (RgnHandle) m_macBoundaryClipRgn , m_minX , m_minY , m_maxX , m_maxY ) ;
52 OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , m_macLocalOrigin.x , m_macLocalOrigin.y ) ;
53 CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
20b69855 54#endif
e9576ca5
SC
55}
56
57wxScreenDC::~wxScreenDC()
fa9666fb 58{
20b69855
SC
59#if wxMAC_USE_CORE_GRAPHICS
60#else
fa9666fb 61 DisposePort( (CGrafPtr) m_macPort ) ;
20b69855 62#endif
e9576ca5
SC
63}
64