]> git.saurik.com Git - wxWidgets.git/blob - src/mac/classic/dcscreen.cpp
Unicode compilation fixes
[wxWidgets.git] / src / mac / classic / dcscreen.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/mac/classic/dcscreen.cpp
3 // Purpose: wxScreenDC class
4 // Author: Stefan Csomor
5 // Modified by:
6 // Created: 1998-01-01
7 // RCS-ID: $Id$
8 // Copyright: (c) Stefan Csomor
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #include "wx/wxprec.h"
13
14 #include "wx/dcscreen.h"
15
16 #include "wx/mac/uma.h"
17
18 IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC)
19
20 // Create a DC representing the whole screen
21 wxScreenDC::wxScreenDC()
22 {
23 #if TARGET_CARBON
24 m_macPort = GetQDGlobalsThePort() ;
25 GrafPtr port ;
26 GetPort( &port ) ;
27 SetPort( (GrafPtr) m_macPort ) ;
28 Point pt = { 0,0 } ;
29 LocalToGlobal( &pt ) ;
30 SetPort( port ) ;
31 m_macLocalOrigin.x = -pt.h ;
32 m_macLocalOrigin.y = -pt.v ;
33 #else
34 m_macPort = LMGetWMgrPort() ;
35 m_macLocalOrigin.x = 0 ;
36 m_macLocalOrigin.y = 0 ;
37 #endif
38 m_ok = true ;
39 BitMap screenBits;
40 GetQDGlobalsScreenBits( &screenBits );
41 m_minX = screenBits.bounds.left ;
42 #if TARGET_CARBON
43 SInt16 height ;
44 GetThemeMenuBarHeight( &height ) ;
45 m_minY = screenBits.bounds.top + height ;
46 #else
47 m_minY = screenBits.bounds.top + LMGetMBarHeight() ;
48 #endif
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 ) ;
54 }
55
56 wxScreenDC::~wxScreenDC()
57 {
58 // TODO
59 }