]> git.saurik.com Git - wxWidgets.git/blame - src/mac/dcclient.cpp
wxMac: wxUniversal integration steps
[wxWidgets.git] / src / mac / dcclient.cpp
CommitLineData
e9576ca5
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: dcclient.cpp
3// Purpose: wxClientDC class
4// Author: AUTHOR
5// Modified by:
6// Created: 01/02/97
7// RCS-ID: $Id$
8// Copyright: (c) AUTHOR
9// Licence: wxWindows licence
10/////////////////////////////////////////////////////////////////////////////
11
12#ifdef __GNUG__
13#pragma implementation "dcclient.h"
14#endif
15
16#include "wx/dcclient.h"
17#include "wx/dcmemory.h"
18#include "wx/region.h"
03e11df5 19#include "wx/window.h"
e9576ca5
SC
20#include <math.h>
21
22//-----------------------------------------------------------------------------
23// constants
24//-----------------------------------------------------------------------------
25
26#define RAD2DEG 57.2957795131
27
28//-----------------------------------------------------------------------------
29// wxPaintDC
30//-----------------------------------------------------------------------------
31
2f1ae414 32#if !USE_SHARED_LIBRARY
e9576ca5
SC
33IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
34IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
35IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC)
2f1ae414 36#endif
e9576ca5
SC
37
38/*
39 * wxWindowDC
40 */
41
519cb848
SC
42#include <wx/mac/uma.h>
43
2f1ae414 44wxWindowDC::wxWindowDC()
e9576ca5 45{
519cb848 46}
e9576ca5 47
2f1ae414 48wxWindowDC::wxWindowDC(wxWindow *the_canvas)
519cb848
SC
49{
50 WindowRef windowref ;
e766c8a9 51 wxWindowMac* rootwindow ;
519cb848
SC
52
53 // this time it is really the full window
54
55 the_canvas->MacGetPortParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow );
56 m_macPort = UMAGetWindowPort( windowref ) ;
2f1ae414
SC
57 m_minY = m_minX = 0;
58 wxSize size = the_canvas->GetSize() ;
59 m_maxX = size.x ;
60 m_maxY = size.y ;
61
519cb848 62 m_ok = TRUE ;
0a67a93b 63 SetBackground(wxBrush(the_canvas->GetBackgroundColour(), wxSOLID));
519cb848 64}
e9576ca5 65
2f1ae414 66wxWindowDC::~wxWindowDC()
e9576ca5 67{
519cb848 68}
e9576ca5 69
519cb848
SC
70/*
71 * wxClientDC
72 */
e9576ca5 73
2f1ae414 74wxClientDC::wxClientDC()
e9576ca5 75{
e9576ca5
SC
76}
77
519cb848 78wxClientDC::wxClientDC(wxWindow *window)
e9576ca5 79{
519cb848 80 WindowRef windowref ;
e766c8a9 81 wxWindowMac* rootwindow ;
519cb848
SC
82
83 window->MacGetPortClientParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow );
84 m_macPort = UMAGetWindowPort( windowref ) ;
2f1ae414
SC
85 m_minY = m_minX = 0;
86 wxSize size = window->GetSize() ;
87 m_maxX = size.x ;
88 m_maxY = size.y ;
519cb848 89 m_ok = TRUE ;
7c74e7fe
SC
90 SetBackground(wxBrush(window->GetBackgroundColour(), wxSOLID));
91 SetFont( window->GetFont() ) ;
e9576ca5
SC
92}
93
2f1ae414 94wxClientDC::~wxClientDC()
e9576ca5 95{
e9576ca5
SC
96}
97
519cb848
SC
98/*
99 * wxPaintDC
100 */
e9576ca5 101
2f1ae414 102wxPaintDC::wxPaintDC()
e9576ca5 103{
e9576ca5
SC
104}
105
519cb848 106wxPaintDC::wxPaintDC(wxWindow *window)
e9576ca5 107{
519cb848 108 WindowRef windowref ;
e766c8a9 109 wxWindowMac* rootwindow ;
519cb848
SC
110
111 window->MacGetPortClientParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow );
e9576ca5 112
519cb848 113 m_macPort = UMAGetWindowPort( windowref ) ;
519cb848 114 m_ok = TRUE ;
a8cd4a3a 115 /*
03e11df5 116 wxCoord x , y ,w , h ;
519cb848 117 window->GetUpdateRegion().GetBox( x , y , w , h ) ;
2f1ae414
SC
118 m_minY = m_minX = 0;
119 wxSize size = window->GetSize() ;
120 m_maxX = size.x ;
121 m_maxY = size.y ;
519cb848 122 SetClippingRegion( x , y , w , h ) ;
a8cd4a3a 123 */
519cb848 124 SetBackground(wxBrush(window->GetBackgroundColour(), wxSOLID));
7c74e7fe 125 SetFont(window->GetFont() ) ;
e9576ca5
SC
126}
127
519cb848 128wxPaintDC::~wxPaintDC()
e9576ca5 129{
519cb848 130}