]> git.saurik.com Git - wxWidgets.git/blame - src/mac/classic/dcscreen.cpp
use GTK-specific GUI lock
[wxWidgets.git] / src / mac / classic / dcscreen.cpp
CommitLineData
2646f485 1/////////////////////////////////////////////////////////////////////////////
11dbb4bf 2// Name: src/mac/classic/dcscreen.cpp
2646f485
SC
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
11dbb4bf 9// Licence: wxWindows licence
2646f485
SC
10/////////////////////////////////////////////////////////////////////////////
11
11dbb4bf
WS
12#include "wx/wxprec.h"
13
2646f485 14#include "wx/dcscreen.h"
11dbb4bf 15
2646f485
SC
16#include "wx/mac/uma.h"
17
2646f485 18IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC)
2646f485
SC
19
20// Create a DC representing the whole screen
21wxScreenDC::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 } ;
11dbb4bf 29 LocalToGlobal( &pt ) ;
2646f485
SC
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
11dbb4bf 38 m_ok = true ;
2646f485
SC
39 BitMap screenBits;
40 GetQDGlobalsScreenBits( &screenBits );
11dbb4bf
WS
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
2646f485
SC
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
56wxScreenDC::~wxScreenDC()
57{
58 // TODO
59}