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