]> git.saurik.com Git - wxWidgets.git/blob - src/mac/classic/dcscreen.cpp
centralized the handling of border styles; added borders support for wxListBox and...
[wxWidgets.git] / src / mac / classic / dcscreen.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: 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/dcscreen.h"
13 #include "wx/mac/uma.h"
14
15 IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC)
16
17 // Create a DC representing the whole screen
18 wxScreenDC::wxScreenDC()
19 {
20 #if TARGET_CARBON
21 m_macPort = GetQDGlobalsThePort() ;
22 GrafPtr port ;
23 GetPort( &port ) ;
24 SetPort( (GrafPtr) m_macPort ) ;
25 Point pt = { 0,0 } ;
26 LocalToGlobal( &pt ) ;
27 SetPort( port ) ;
28 m_macLocalOrigin.x = -pt.h ;
29 m_macLocalOrigin.y = -pt.v ;
30 #else
31 m_macPort = LMGetWMgrPort() ;
32 m_macLocalOrigin.x = 0 ;
33 m_macLocalOrigin.y = 0 ;
34 #endif
35 m_ok = TRUE ;
36 BitMap screenBits;
37 GetQDGlobalsScreenBits( &screenBits );
38 m_minX = screenBits.bounds.left ;
39 #if TARGET_CARBON
40 SInt16 height ;
41 GetThemeMenuBarHeight( &height ) ;
42 m_minY = screenBits.bounds.top + height ;
43 #else
44 m_minY = screenBits.bounds.top + LMGetMBarHeight() ;
45 #endif
46 m_maxX = screenBits.bounds.right ;
47 m_maxY = screenBits.bounds.bottom ;
48 MacSetRectRgn( (RgnHandle) m_macBoundaryClipRgn , m_minX , m_minY , m_maxX , m_maxY ) ;
49 OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , m_macLocalOrigin.x , m_macLocalOrigin.y ) ;
50 CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
51 }
52
53 wxScreenDC::~wxScreenDC()
54 {
55 // TODO
56 }
57