]> git.saurik.com Git - wxWidgets.git/blame - src/mac/dcscreen.cpp
WinCE project and wxDC corrections
[wxWidgets.git] / src / mac / 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
e40298d5 9// Licence: wxWindows licence
e9576ca5
SC
10/////////////////////////////////////////////////////////////////////////////
11
12#ifdef __GNUG__
13#pragma implementation "dcscreen.h"
14#endif
15
16#include "wx/dcscreen.h"
2f1ae414 17#include "wx/mac/uma.h"
e9576ca5 18
2f1ae414 19#if !USE_SHARED_LIBRARY
e9576ca5 20IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC)
2f1ae414 21#endif
e9576ca5
SC
22
23// Create a DC representing the whole screen
24wxScreenDC::wxScreenDC()
25{
2f1ae414 26#if TARGET_CARBON
e40298d5
JS
27 m_macPort = GetQDGlobalsThePort() ;
28 GrafPtr port ;
29 GetPort( &port ) ;
30 SetPort( (GrafPtr) m_macPort ) ;
31 Point pt = { 0,0 } ;
32 LocalToGlobal( &pt ) ;
33 SetPort( port ) ;
34 m_macLocalOrigin.x = -pt.h ;
35 m_macLocalOrigin.y = -pt.v ;
2f1ae414 36#else
e40298d5
JS
37 m_macPort = LMGetWMgrPort() ;
38 m_macLocalOrigin.x = 0 ;
39 m_macLocalOrigin.y = 0 ;
2f1ae414 40#endif
e40298d5
JS
41 m_ok = TRUE ;
42 BitMap screenBits;
43 GetQDGlobalsScreenBits( &screenBits );
44 m_minX = screenBits.bounds.left ;
2f1ae414 45 #if TARGET_CARBON
e40298d5
JS
46 SInt16 height ;
47 GetThemeMenuBarHeight( &height ) ;
48 m_minY = screenBits.bounds.top + height ;
2f1ae414 49 #else
e40298d5 50 m_minY = screenBits.bounds.top + LMGetMBarHeight() ;
2f1ae414 51 #endif
e40298d5
JS
52 m_maxX = screenBits.bounds.right ;
53 m_maxY = screenBits.bounds.bottom ;
54 MacSetRectRgn( (RgnHandle) m_macBoundaryClipRgn , m_minX , m_minY , m_maxX , m_maxY ) ;
55 OffsetRgn( (RgnHandle) m_macBoundaryClipRgn , m_macLocalOrigin.x , m_macLocalOrigin.y ) ;
56 CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
e9576ca5
SC
57}
58
59wxScreenDC::~wxScreenDC()
60{
61 // TODO
62}
63