]> git.saurik.com Git - wxWidgets.git/blame - src/mac/dcclient.cpp
some != NULL checks
[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"
19#include <math.h>
20
21//-----------------------------------------------------------------------------
22// constants
23//-----------------------------------------------------------------------------
24
25#define RAD2DEG 57.2957795131
26
27//-----------------------------------------------------------------------------
28// wxPaintDC
29//-----------------------------------------------------------------------------
30
e9576ca5
SC
31IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
32IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
33IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC)
e9576ca5
SC
34
35/*
36 * wxWindowDC
37 */
38
519cb848
SC
39#include <wx/mac/uma.h>
40
e9576ca5
SC
41wxWindowDC::wxWindowDC(void)
42{
519cb848 43}
e9576ca5 44
519cb848
SC
45wxWindowDC::wxWindowDC(wxWindow *the_canvas)
46{
47 WindowRef windowref ;
48 wxWindow* rootwindow ;
49
50 // this time it is really the full window
51
52 the_canvas->MacGetPortParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow );
53 m_macPort = UMAGetWindowPort( windowref ) ;
54 MacSetupPort() ;
55 m_ok = TRUE ;
56}
e9576ca5
SC
57
58wxWindowDC::~wxWindowDC(void)
59{
519cb848 60}
e9576ca5 61
519cb848
SC
62/*
63 * wxClientDC
64 */
e9576ca5 65
519cb848 66wxClientDC::wxClientDC(void)
e9576ca5 67{
e9576ca5
SC
68}
69
519cb848 70wxClientDC::wxClientDC(wxWindow *window)
e9576ca5 71{
519cb848
SC
72 WindowRef windowref ;
73 wxWindow* rootwindow ;
74
75 window->MacGetPortClientParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow );
76 m_macPort = UMAGetWindowPort( windowref ) ;
77 MacSetupPort() ;
78 m_ok = TRUE ;
7c74e7fe
SC
79 SetBackground(wxBrush(window->GetBackgroundColour(), wxSOLID));
80 SetFont( window->GetFont() ) ;
e9576ca5
SC
81}
82
519cb848 83wxClientDC::~wxClientDC(void)
e9576ca5 84{
e9576ca5
SC
85}
86
519cb848
SC
87/*
88 * wxPaintDC
89 */
e9576ca5 90
519cb848 91wxPaintDC::wxPaintDC(void)
e9576ca5 92{
e9576ca5
SC
93}
94
519cb848 95wxPaintDC::wxPaintDC(wxWindow *window)
e9576ca5 96{
519cb848
SC
97 WindowRef windowref ;
98 wxWindow* rootwindow ;
99
100 window->MacGetPortClientParams(&m_macLocalOrigin, &m_macClipRect , &windowref , &rootwindow );
e9576ca5 101
519cb848
SC
102 m_macPort = UMAGetWindowPort( windowref ) ;
103 MacSetupPort() ;
104 m_ok = TRUE ;
105 long x , y ,w , h ;
106 window->GetUpdateRegion().GetBox( x , y , w , h ) ;
107 SetClippingRegion( x , y , w , h ) ;
108 SetBackground(wxBrush(window->GetBackgroundColour(), wxSOLID));
7c74e7fe 109 SetFont(window->GetFont() ) ;
e9576ca5
SC
110}
111
519cb848 112wxPaintDC::~wxPaintDC()
e9576ca5 113{
519cb848 114}