]> git.saurik.com Git - wxWidgets.git/blame - src/mac/dc.cpp
removed duplicated friend declaration
[wxWidgets.git] / src / mac / dc.cpp
CommitLineData
e9576ca5
SC
1/////////////////////////////////////////////////////////////////////////////
2// Name: dc.cpp
3// Purpose: wxDC 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 "dc.h"
14#endif
15
16#include "wx/dc.h"
03e11df5 17#include "wx/app.h"
2f1ae414 18#include "wx/mac/uma.h"
e9576ca5 19
5b781a67
SC
20#if __MSL__ >= 0x6000
21#include "math.h"
22#endif
23
2f1ae414 24#if !USE_SHARED_LIBRARY
e9576ca5 25IMPLEMENT_ABSTRACT_CLASS(wxDC, wxObject)
2f1ae414 26#endif
e9576ca5
SC
27
28//-----------------------------------------------------------------------------
29// constants
30//-----------------------------------------------------------------------------
31
32#define mm2inches 0.0393700787402
33#define inches2mm 25.4
34#define mm2twips 56.6929133859
35#define twips2mm 0.0176388888889
36#define mm2pt 2.83464566929
37#define pt2mm 0.352777777778
38
519cb848
SC
39long wxDC::m_macCurrentPortId = 1 ;
40
e9576ca5
SC
41//-----------------------------------------------------------------------------
42// wxDC
43//-----------------------------------------------------------------------------
44
2f1ae414 45wxDC::wxDC()
e9576ca5
SC
46{
47 m_ok = FALSE;
e9576ca5 48 m_colour = TRUE;
e9576ca5 49
2f1ae414
SC
50 m_mm_to_pix_x = mm2pt;
51 m_mm_to_pix_y = mm2pt;
e9576ca5 52
e9576ca5
SC
53 m_internalDeviceOriginX = 0;
54 m_internalDeviceOriginY = 0;
55 m_externalDeviceOriginX = 0;
56 m_externalDeviceOriginY = 0;
57
58 m_logicalScaleX = 1.0;
59 m_logicalScaleY = 1.0;
60 m_userScaleX = 1.0;
61 m_userScaleY = 1.0;
62 m_scaleX = 1.0;
63 m_scaleY = 1.0;
64
e9576ca5
SC
65 m_needComputeScaleX = FALSE;
66 m_needComputeScaleY = FALSE;
67
e9576ca5
SC
68 m_maxX = m_maxY = -100000;
69 m_minY = m_minY = 100000;
70
519cb848 71 m_macPort = NULL ;
8208e181 72 m_macMask = NULL ;
519cb848
SC
73 m_ok = FALSE ;
74
75 m_macFontInstalled = false ;
76 m_macBrushInstalled = false ;
77 m_macPenInstalled = false ;
78
79 m_macPortId = 0 ;
80 m_macLocalOrigin.h = m_macLocalOrigin.v = 0 ;
81 m_macClipRect.left = -32000 ;
82 m_macClipRect.top = -32000 ;
83 m_macClipRect.right = 32000 ;
84 m_macClipRect.bottom = 32000 ;
85 ::GetPort( &m_macOrigPort ) ;
9ff647cf
SC
86
87 m_pen = *wxBLACK_PEN;
88 m_font = *wxNORMAL_FONT;
89 m_brush = *wxWHITE_BRUSH;
e9576ca5
SC
90};
91
92wxDC::~wxDC(void)
93{
2f1ae414
SC
94 if ( !m_macPortHelper.IsCleared() )
95 {
96 GrafPtr port ;
97 GetPort( &port ) ;
98 SetPort( m_macPortHelper.GetCurrentPort() ) ;
99 SetOrigin( 0 , 0 ) ;
100 SetPort( port ) ;
101 }
102 /*
519cb848
SC
103 if ( m_macPort )
104 {
2f1ae414 105 ::SetPort( m_macPort ) ;
519cb848
SC
106 ::SetOrigin( 0 , 0 ) ;
107 ::ClipRect( &m_macPort->portRect ) ;
108 ::PenNormal() ;
109 ::SetPort( m_macOrigPort ) ;
110 }
2f1ae414 111 */
519cb848 112 ++m_macCurrentPortId ;
e9576ca5
SC
113};
114
519cb848
SC
115void wxDC::MacSetupPort() const
116{
5b781a67 117 AGAPortHelper* help = (AGAPortHelper*) &m_macPortHelper ;
2f1ae414 118 help->Setup( m_macPort ) ;
519cb848 119 m_macPortId = ++m_macCurrentPortId ;
519cb848
SC
120 ::SetOrigin(-m_macLocalOrigin.h, -m_macLocalOrigin.v);
121 ::ClipRect(&m_macClipRect);
122
123 m_macFontInstalled = false ;
124 m_macBrushInstalled = false ;
125 m_macPenInstalled = false ;
126}
127
2f1ae414 128void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask )
519cb848 129{
2f1ae414
SC
130 float scale = 1.0 ;
131
519cb848
SC
132 if (!Ok())
133 return;
134 MacVerifySetup() ;
135
136 long xx1 = XLOG2DEV(x);
137 long yy1 = YLOG2DEV(y);
138
139 {
140 wxBitmapRefData * bmap = (wxBitmapRefData*) ( bmp.GetRefData()) ;
141
142 if ( bmap )
143 {
144 if ( bmap->m_bitmapType == kMacBitmapTypePict )
145 {
03e11df5 146 Rect bitmaprect = { 0 , 0 , int(bmap->m_height * scale) , int(bmap->m_width * scale)} ;
519cb848
SC
147 ::OffsetRect( &bitmaprect , xx1 , yy1 ) ;
148 ::DrawPicture( bmap->m_hPict , &bitmaprect ) ;
149 }
150 else if ( bmap->m_bitmapType == kMacBitmapTypeGrafWorld )
151 {
152 if ( bmap->m_hBitmap )
153 {
154 GWorldPtr bmapworld = bmap->m_hBitmap ;
155 PixMapHandle bmappixels ;
156 RGBColor white = { 0xFFFF, 0xFFFF,0xFFFF} ;
157 RGBColor black = { 0,0,0} ;
158 RGBForeColor( &black ) ;
159 RGBBackColor( &white ) ;
519cb848
SC
160
161 bmappixels = GetGWorldPixMap( bmapworld ) ;
162 if ( LockPixels(bmappixels) )
163 {
164 Rect source , dest ;
165 source.top = 0 ;
166 source.left = 0 ;
167 source.right = bmap->m_width ;
168 source.bottom = bmap->m_height ;
169 dest.top = YLOG2DEV(y) ;
170 dest.left = XLOG2DEV(x) ;
2f1ae414
SC
171 dest.bottom = YLOG2DEV(y + bmap->m_height * scale) ;
172 dest.right = XLOG2DEV(x + bmap->m_width * scale ) ;
519cb848 173
8208e181
SC
174 if ( useMask && bmp.GetMask() )
175 {
176 if ( LockPixels( GetGWorldPixMap( bmp.GetMask()->GetMaskBitmap( ) ) ) )
177 {
2f1ae414
SC
178 CopyMask( GetPortBitMapForCopyBits( bmapworld ) , GetPortBitMapForCopyBits( bmp.GetMask()->GetMaskBitmap( ) ) ,
179 GetPortBitMapForCopyBits( m_macPort ) ,
8208e181
SC
180 &source, &source , &dest ) ;
181 UnlockPixels( GetGWorldPixMap( bmp.GetMask()->GetMaskBitmap( ) ) ) ;
182 }
519cb848 183 }
8208e181 184 else
2f1ae414 185 CopyBits( GetPortBitMapForCopyBits( bmapworld ) , GetPortBitMapForCopyBits( m_macPort ),
8208e181
SC
186 &source, &dest, srcCopy, NULL ) ;
187
519cb848
SC
188 UnlockPixels( bmappixels ) ;
189 }
190 m_macPenInstalled = false ;
191 m_macBrushInstalled = false ;
192 m_macFontInstalled = false ;
193 }
194 }
195 }
196 }
197}
198
2f1ae414 199void wxDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y )
e9576ca5 200{
519cb848
SC
201 if (!Ok())
202 return;
203 MacVerifySetup() ;
204
205 long xx1 = XLOG2DEV(x);
206 long yy1 = YLOG2DEV(y);
207
208 {
209 wxIconRefData * iconref = (wxIconRefData*) ( icon.GetRefData()) ;
210
211 if ( iconref && iconref->m_ok && iconref->m_hIcon )
212 {
213 Rect bitmaprect = { 0 , 0 , iconref->m_height , iconref->m_width } ;
214 OffsetRect( &bitmaprect , xx1 , yy1 ) ;
215 PlotCIconHandle( &bitmaprect , atNone , ttNone , iconref->m_hIcon ) ;
216 }
217 }
e9576ca5
SC
218};
219
2f1ae414 220void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
e9576ca5 221{
2f1ae414 222 MacVerifySetup() ;
519cb848
SC
223 if( m_clipping )
224 {
225 m_clipX1 = wxMax( m_clipX1 , x ) ;
226 m_clipY1 = wxMax( m_clipY1 ,y );
227 m_clipX2 = wxMin( m_clipX2, (x + width));
228 m_clipY2 = wxMin( m_clipY2,(y + height));
229
230 }
231 else
232 {
233 m_clipping = TRUE;
234 m_clipX1 = x;
235 m_clipY1 = y;
236 m_clipX2 = x + width;
237 m_clipY2 = y + height;
238 }
239
240 long x1 = XLOG2DEV(m_clipX1);
241 long y1 = YLOG2DEV(m_clipY1);
242 long x2 = XLOG2DEV(m_clipX2);
7c74e7fe 243 long y2 = YLOG2DEV(m_clipY2);
519cb848
SC
244
245 Rect clip = { y1 , x1 , y2 , x2 } ;
246
2f1ae414 247 ::ClipRect( &clip ) ;
519cb848 248
e9576ca5
SC
249};
250
2f1ae414
SC
251void wxDC::DoSetClippingRegionAsRegion( const wxRegion &region )
252{
253 wxCHECK_RET( Ok(), wxT("invalid window dc") );
254
255 MacVerifySetup() ;
256 if (region.Empty())
257 {
258 DestroyClippingRegion();
259 return;
260 }
261
262 wxCoord xx, yy, ww, hh;
263 region.GetBox( xx, yy, ww, hh );
264 wxDC::DoSetClippingRegion( xx, yy, ww, hh );
ee41971c
UJ
265}
266
e9576ca5
SC
267void wxDC::DestroyClippingRegion(void)
268{
519cb848 269 MacVerifySetup() ;
e9576ca5 270 m_clipping = FALSE;
519cb848
SC
271// Rect clip = { -32000 , -32000 , 32000 , 32000 } ;
272 ::ClipRect(&m_macClipRect);
e9576ca5 273};
ee41971c 274
2f1ae414 275void wxDC::DoGetSize( int* width, int* height ) const
e9576ca5
SC
276{
277 *width = m_maxX-m_minX;
278 *height = m_maxY-m_minY;
279};
280
2f1ae414 281void wxDC::DoGetSizeMM( int* width, int* height ) const
e9576ca5
SC
282{
283 int w = 0;
284 int h = 0;
285 GetSize( &w, &h );
286 *width = long( double(w) / (m_scaleX*m_mm_to_pix_x) );
287 *height = long( double(h) / (m_scaleY*m_mm_to_pix_y) );
288};
289
290void wxDC::SetTextForeground( const wxColour &col )
291{
292 if (!Ok()) return;
293 m_textForegroundColour = col;
519cb848 294 m_macFontInstalled = false ;
e9576ca5
SC
295};
296
297void wxDC::SetTextBackground( const wxColour &col )
298{
299 if (!Ok()) return;
300 m_textBackgroundColour = col;
519cb848 301 m_macFontInstalled = false ;
e9576ca5
SC
302};
303
304void wxDC::SetMapMode( int mode )
305{
306 switch (mode)
307 {
e3065973 308 case wxMM_TWIPS:
e9576ca5
SC
309 SetLogicalScale( twips2mm*m_mm_to_pix_x, twips2mm*m_mm_to_pix_y );
310 break;
e3065973 311 case wxMM_POINTS:
e9576ca5
SC
312 SetLogicalScale( pt2mm*m_mm_to_pix_x, pt2mm*m_mm_to_pix_y );
313 break;
e3065973 314 case wxMM_METRIC:
e9576ca5
SC
315 SetLogicalScale( m_mm_to_pix_x, m_mm_to_pix_y );
316 break;
e3065973 317 case wxMM_LOMETRIC:
e9576ca5
SC
318 SetLogicalScale( m_mm_to_pix_x/10.0, m_mm_to_pix_y/10.0 );
319 break;
320 default:
e3065973 321 case wxMM_TEXT:
e9576ca5
SC
322 SetLogicalScale( 1.0, 1.0 );
323 break;
324 };
e3065973 325 if (mode != wxMM_TEXT)
e9576ca5
SC
326 {
327 m_needComputeScaleX = TRUE;
328 m_needComputeScaleY = TRUE;
329 };
330};
331
332void wxDC::SetUserScale( double x, double y )
333{
334 // allow negative ? -> no
335 m_userScaleX = x;
336 m_userScaleY = y;
337 ComputeScaleAndOrigin();
338};
339
e9576ca5
SC
340void wxDC::SetLogicalScale( double x, double y )
341{
342 // allow negative ?
343 m_logicalScaleX = x;
344 m_logicalScaleY = y;
345 ComputeScaleAndOrigin();
346};
347
2f1ae414 348void wxDC::SetLogicalOrigin( wxCoord x, wxCoord y )
e9576ca5
SC
349{
350 m_logicalOriginX = x * m_signX; // is this still correct ?
351 m_logicalOriginY = y * m_signY;
352 ComputeScaleAndOrigin();
353};
354
2f1ae414 355void wxDC::SetDeviceOrigin( wxCoord x, wxCoord y )
e9576ca5
SC
356{
357 m_externalDeviceOriginX = x;
358 m_externalDeviceOriginY = y;
359 ComputeScaleAndOrigin();
360};
2f1ae414 361/*
e9576ca5
SC
362void wxDC::SetInternalDeviceOrigin( long x, long y )
363{
364 m_internalDeviceOriginX = x;
365 m_internalDeviceOriginY = y;
366 ComputeScaleAndOrigin();
367};
368
369void wxDC::GetInternalDeviceOrigin( long *x, long *y )
370{
371 if (x) *x = m_internalDeviceOriginX;
372 if (y) *y = m_internalDeviceOriginY;
373};
2f1ae414 374*/
e9576ca5
SC
375void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
376{
377 m_signX = (xLeftRight ? 1 : -1);
378 m_signY = (yBottomUp ? -1 : 1);
379 ComputeScaleAndOrigin();
380};
2f1ae414 381/*
e9576ca5
SC
382
383void wxDC::CalcBoundingBox( long x, long y )
384{
385 if (x < m_minX) m_minX = x;
386 if (y < m_minY) m_minY = y;
387 if (x > m_maxX) m_maxX = x;
388 if (y > m_maxY) m_maxY = y;
389};
2f1ae414
SC
390*/
391wxSize wxDC::GetPPI() const
392{
393 return wxSize(72, 72);
394}
395
396int wxDC::GetDepth() const
397{
398 return wxDisplayDepth() ;
399}
e9576ca5
SC
400
401void wxDC::ComputeScaleAndOrigin(void)
402{
403 // CMB: copy scale to see if it changes
404 double origScaleX = m_scaleX;
405 double origScaleY = m_scaleY;
406
407 m_scaleX = m_logicalScaleX * m_userScaleX;
408 m_scaleY = m_logicalScaleY * m_userScaleY;
409
410 m_deviceOriginX = m_internalDeviceOriginX + m_externalDeviceOriginX;
411 m_deviceOriginY = m_internalDeviceOriginY + m_externalDeviceOriginY;
412
413 // CMB: if scale has changed call SetPen to recalulate the line width
414 if (m_scaleX != origScaleX || m_scaleY != origScaleY)
415 {
5b781a67
SC
416 // this is a bit artificial, but we need to force wxDC to think
417 // the pen has changed
418 wxPen* pen = & GetPen();
419 wxPen tempPen;
420 m_pen = tempPen;
421 SetPen(* pen);
e9576ca5
SC
422 }
423};
424
519cb848
SC
425void wxDC::SetPalette( const wxPalette& palette )
426{
427}
428
429void wxDC::SetBackgroundMode( int mode )
430{
431 m_backgroundMode = mode ;
432}
433
434void wxDC::SetFont( const wxFont &font )
435{
436 if (!Ok())
437 return;
438
439 MacVerifySetup() ;
440
441 m_font = font;
442 m_macFontInstalled = false ;
443}
444
445void wxDC::SetPen( const wxPen &pen )
446{
447 if (!Ok() )
448 return;
449
450 MacVerifySetup() ;
451
452 if ( m_pen == pen )
453 return ;
454
455 m_pen = pen;
456/*
457 if (!m_pen.Ok())
458 return;
459*/
460 m_macPenInstalled = false ;
461}
462
463void wxDC::SetBrush( const wxBrush &brush )
464{
465 if (!Ok() )
466 return;
467 MacVerifySetup() ;
468
469 if (m_brush == brush)
470 return;
471
472 m_brush = brush;
473 m_macBrushInstalled = false ;
474}
475
476void wxDC::SetBackground( const wxBrush &brush )
477{
478 if (!Ok())
479 return;
480 MacVerifySetup() ;
481
482 if (m_backgroundBrush == brush)
483 return;
484
485 m_backgroundBrush = brush;
486
487 if (!m_backgroundBrush.Ok())
488 return;
489 m_macBrushInstalled = false ;
490}
491
492void wxDC::SetLogicalFunction( int function )
493{
494 if (m_logicalFunction == function)
495 return;
496
497 m_logicalFunction = function ;
498 m_macFontInstalled = false ;
499 m_macBrushInstalled = false ;
500 m_macPenInstalled = false ;
501}
502
2f1ae414
SC
503void wxDC::DoFloodFill( wxCoord x, wxCoord y, const wxColour& col,
504 int style )
519cb848
SC
505{
506}
507
2f1ae414 508bool wxDC::DoGetPixel( wxCoord x, wxCoord y, wxColour *col ) const
519cb848
SC
509{
510 return true ;
511}
512
2f1ae414 513void wxDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
519cb848
SC
514{
515 if (!Ok())
516 return;
517
518 MacVerifySetup() ;
519
520 if (m_pen.GetStyle() != wxTRANSPARENT)
521 {
522 MacInstallPen() ;
0b014ec7 523 int offset = ( (m_pen.GetWidth() == 0 ? 1 : m_pen.GetWidth() ) * m_scaleX - 1) / 2 ;
519cb848
SC
524 long xx1 = XLOG2DEV(x1);
525 long yy1 = YLOG2DEV(y1);
526 long xx2 = XLOG2DEV(x2);
527 long yy2 = YLOG2DEV(y2);
528
529 ::MoveTo(xx1 - offset ,yy1 - offset);
530 ::LineTo(xx2 - offset , yy2 - offset );
531 };
532}
533
2f1ae414 534void wxDC::DoCrossHair( wxCoord x, wxCoord y )
519cb848
SC
535{
536}
537
2f1ae414
SC
538void wxDC::DoDrawArc( wxCoord x1, wxCoord y1,
539 wxCoord x2, wxCoord y2,
540 wxCoord xc, wxCoord yc )
519cb848
SC
541{
542}
543
2f1ae414
SC
544void wxDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord w, wxCoord h,
545 double sa, double ea )
519cb848
SC
546{
547}
548
2f1ae414 549void wxDC::DoDrawPoint( wxCoord x, wxCoord y )
519cb848
SC
550{
551 if (!Ok())
552 return;
553
554 MacVerifySetup() ;
555
556 if (m_pen.GetStyle() != wxTRANSPARENT)
557 {
558 MacInstallPen() ;
559 long xx1 = XLOG2DEV(x);
560 long yy1 = YLOG2DEV(y);
561
562 ::MoveTo(xx1,yy1);
563 ::LineTo(xx1+1, yy1+1);
564 };
565}
566
2f1ae414
SC
567void wxDC::DoDrawLines(int n, wxPoint points[],
568 wxCoord xoffset, wxCoord yoffset)
519cb848
SC
569{
570 if (!Ok())
571 return;
572 MacVerifySetup() ;
573
574 if (m_pen.GetStyle() == wxTRANSPARENT)
575 return;
576
03e11df5 577 MacInstallPen() ;
519cb848 578
03e11df5 579 int offset = (m_pen.GetWidth() - 1 ) / 2 ;
519cb848
SC
580 long x1, x2 , y1 , y2 ;
581 x1 = XLOG2DEV(points[0].x + xoffset);
03e11df5
GD
582 y1 = YLOG2DEV(points[0].y + yoffset);
583 ::MoveTo(x1 - offset ,y1 - offset );
519cb848
SC
584
585 for (int i = 0; i < n-1; i++)
586 {
03e11df5
GD
587 x2 = XLOG2DEV(points[i+1].x + xoffset);
588 y2 = YLOG2DEV(points[i+1].y + yoffset);
589 ::LineTo(x2 - offset , y2 - offset );
519cb848
SC
590 }
591}
592
2f1ae414
SC
593void wxDC::DoDrawPolygon(int n, wxPoint points[],
594 wxCoord xoffset, wxCoord yoffset,
595 int fillStyle )
519cb848
SC
596{
597 if (!Ok())
598 return;
599 MacVerifySetup() ;
600
601 PolyHandle polygon = OpenPoly() ;
602 long x1, x2 , y1 , y2 ;
603 x1 = XLOG2DEV(points[0].x + xoffset);
03e11df5
GD
604 y1 = YLOG2DEV(points[0].y + yoffset);
605 ::MoveTo(x1,y1);
519cb848
SC
606
607 for (int i = 0; i < n-1; i++)
608 {
03e11df5
GD
609 x2 = XLOG2DEV(points[i+1].x + xoffset);
610 y2 = YLOG2DEV(points[i+1].y + yoffset);
611 ::LineTo(x2, y2);
519cb848
SC
612 }
613
614 ClosePoly() ;
615 if (m_brush.GetStyle() != wxTRANSPARENT)
616 {
617 MacInstallBrush() ;
618 ::PaintPoly( polygon ) ;
619 };
620
621 if (m_pen.GetStyle() != wxTRANSPARENT)
622 {
623 MacInstallPen() ;
624 ::FramePoly( polygon ) ;
625 };
626 KillPoly( polygon ) ;
627}
628
2f1ae414 629void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
519cb848
SC
630{
631 if (!Ok())
632 return;
633 MacVerifySetup() ;
634
635 long xx = XLOG2DEV(x);
636 long yy = YLOG2DEV(y);
637 long ww = m_signX * XLOG2DEVREL(width);
638 long hh = m_signY * YLOG2DEVREL(height);
639
640 // CMB: draw nothing if transformed w or h is 0
641 if (ww == 0 || hh == 0)
642 return;
643
644 // CMB: handle -ve width and/or height
645 if (ww < 0)
646 {
647 ww = -ww;
648 xx = xx - ww;
649 }
650
651 if (hh < 0)
652 {
653 hh = -hh;
654 yy = yy - hh;
655 }
656
657 Rect rect = { yy , xx , yy + hh , xx + ww } ;
658
659 if (m_brush.GetStyle() != wxTRANSPARENT)
660 {
661 MacInstallBrush() ;
662 ::PaintRect( &rect ) ;
663 };
664
665 if (m_pen.GetStyle() != wxTRANSPARENT)
666 {
667 MacInstallPen() ;
668 ::FrameRect( &rect ) ;
669 };
670}
671
2f1ae414
SC
672void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y,
673 wxCoord width, wxCoord height,
674 double radius)
519cb848
SC
675{
676 if (!Ok())
677 return;
678 MacVerifySetup() ;
679
680 if (radius < 0.0)
681 radius = - radius * ((width < height) ? width : height);
682
683 long xx = XLOG2DEV(x);
684 long yy = YLOG2DEV(y);
685 long ww = m_signX * XLOG2DEVREL(width);
686 long hh = m_signY * YLOG2DEVREL(height);
687
688 // CMB: draw nothing if transformed w or h is 0
689 if (ww == 0 || hh == 0)
690 return;
691
692 // CMB: handle -ve width and/or height
693 if (ww < 0)
694 {
695 ww = -ww;
696 xx = xx - ww;
697 }
698
699 if (hh < 0)
700 {
701 hh = -hh;
702 yy = yy - hh;
703 }
704
705 Rect rect = { yy , xx , yy + hh , xx + ww } ;
706
707 if (m_brush.GetStyle() != wxTRANSPARENT)
708 {
709 MacInstallBrush() ;
03e11df5 710 ::PaintRoundRect( &rect , int(radius * 2) , int(radius * 2) ) ;
519cb848
SC
711 };
712
713 if (m_pen.GetStyle() != wxTRANSPARENT)
714 {
715 MacInstallPen() ;
03e11df5 716 ::FrameRoundRect( &rect , int(radius * 2) , int(radius * 2) ) ;
519cb848
SC
717 };
718}
719
2f1ae414 720void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
519cb848
SC
721{
722 if (!Ok())
723 return;
724 MacVerifySetup() ;
725
726 long xx = XLOG2DEV(x);
727 long yy = YLOG2DEV(y);
728 long ww = m_signX * XLOG2DEVREL(width);
729 long hh = m_signY * YLOG2DEVREL(height);
730
731 // CMB: draw nothing if transformed w or h is 0
732 if (ww == 0 || hh == 0)
733 return;
734
735 // CMB: handle -ve width and/or height
736 if (ww < 0)
737 {
738 ww = -ww;
739 xx = xx - ww;
740 }
741
742 if (hh < 0)
743 {
744 hh = -hh;
745 yy = yy - hh;
746 }
747
748 Rect rect = { yy , xx , yy + hh , xx + ww } ;
749
750 if (m_brush.GetStyle() != wxTRANSPARENT)
751 {
752 MacInstallBrush() ;
753 ::PaintOval( &rect ) ;
754 };
755
756 if (m_pen.GetStyle() != wxTRANSPARENT)
757 {
758 MacInstallPen() ;
759 ::FrameOval( &rect ) ;
760 };
761}
762
519cb848
SC
763
764
765bool wxDC::CanDrawBitmap(void) const
766{
767 return true ;
768}
769
770
2f1ae414
SC
771bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
772 wxDC *source, wxCoord xsrc, wxCoord ysrc, int logical_func , bool useMask )
519cb848
SC
773{
774 if (!Ok()) return FALSE;
775 MacVerifySetup() ;
776
777 CGrafPtr sourcePort = (CGrafPtr) source->m_macPort ;
778 PixMapHandle bmappixels = GetGWorldPixMap( sourcePort ) ;
03e11df5
GD
779 RGBColor white = { 0xFFFF, 0xFFFF,0xFFFF} ;
780 RGBColor black = { 0,0,0} ;
781 RGBColor forecolor = m_textForegroundColour.GetPixel();
782 RGBColor backcolor = m_textBackgroundColour.GetPixel();
783 RGBForeColor( &forecolor ) ;
784 RGBBackColor( &backcolor ) ;
519cb848
SC
785
786 if ( LockPixels(bmappixels) )
787 {
788 Rect srcrect , dstrect ;
789 srcrect.top = source->YLOG2DEV(ysrc) ;
790 srcrect.left = source->XLOG2DEV(xsrc) ;
791 srcrect.right = source->XLOG2DEV(xsrc + width ) ;
792 srcrect.bottom = source->YLOG2DEV(ysrc + height) ;
793 dstrect.top = YLOG2DEV(ydest) ;
794 dstrect.left = XLOG2DEV(xdest) ;
795 dstrect.bottom = YLOG2DEV(ydest + height ) ;
796 dstrect.right = XLOG2DEV(xdest + width ) ;
8208e181
SC
797
798 short mode = (logical_func == wxCOPY ? srcCopy :
799 // logical_func == wxCLEAR ? WHITENESS :
800 // logical_func == wxSET ? BLACKNESS :
801 logical_func == wxINVERT ? hilite :
802 // logical_func == wxAND ? MERGECOPY :
803 logical_func == wxOR ? srcOr :
804 logical_func == wxSRC_INVERT ? notSrcCopy :
805 logical_func == wxXOR ? srcXor :
806 // logical_func == wxOR_REVERSE ? MERGEPAINT :
807 // logical_func == wxAND_REVERSE ? SRCERASE :
2f1ae414 808 // logical_func == wxSRC_OR ? srcOr :
8208e181
SC
809 // logical_func == wxSRC_AND ? SRCAND :
810 srcCopy );
811
812 if ( useMask && source->m_macMask )
813 {
814 wxASSERT( mode == srcCopy ) ;
815 if ( LockPixels( GetGWorldPixMap( source->m_macMask ) ) )
816 {
2f1ae414
SC
817 CopyMask( GetPortBitMapForCopyBits( sourcePort ) , GetPortBitMapForCopyBits( source->m_macMask ) ,
818 GetPortBitMapForCopyBits( m_macPort ) ,
8208e181
SC
819 &srcrect, &srcrect , &dstrect ) ;
820 UnlockPixels( GetGWorldPixMap( source->m_macMask ) ) ;
821 }
822 }
823 else
824 {
2f1ae414 825 CopyBits( GetPortBitMapForCopyBits( sourcePort ) , GetPortBitMapForCopyBits( m_macPort ) ,
8208e181
SC
826 &srcrect, &dstrect, mode, NULL ) ;
827 }
519cb848
SC
828 UnlockPixels( bmappixels ) ;
829 }
830
831 m_macPenInstalled = false ;
832 m_macBrushInstalled = false ;
833 m_macFontInstalled = false ;
834
835 return TRUE;
836}
837
2f1ae414
SC
838void wxDC::DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y,
839 double angle)
840{
841}
842void wxDC::DoDrawText(const wxString& strtext, wxCoord x, wxCoord y)
519cb848
SC
843{
844 if (!Ok())
845 return;
846 MacVerifySetup() ;
847
848 long xx = XLOG2DEV(x);
849 long yy = YLOG2DEV(y);
850
851// if (m_pen.GetStyle() != wxTRANSPARENT)
852 {
853 MacInstallFont() ;
854 /*
855 Rect clip = { -32000 , -32000 , 32000 , 32000 } ;
856
857 ::ClipRect( &clip ) ;
858 */
859
860 FontInfo fi ;
861 ::GetFontInfo( &fi ) ;
862
863 yy += fi.ascent ;
864 ::MoveTo( xx , yy );
865 if ( m_backgroundMode == wxTRANSPARENT )
866 {
867 ::TextMode( srcOr) ;
868 }
869 else
870 {
871 ::TextMode( srcCopy ) ;
872 }
873
874 const char *text = NULL ;
875 int length = 0 ;
876 wxString macText ;
877
878 if ( wxApp::s_macDefaultEncodingIsPC )
879 {
2f1ae414 880 macText = wxMacMakeMacStringFromPC( strtext ) ;
519cb848
SC
881 text = macText ;
882 length = macText.Length() ;
883 }
884 else
885 {
2f1ae414
SC
886 text = strtext ;
887 length = strtext.Length() ;
519cb848
SC
888 }
889
890 int laststop = 0 ;
891 int i = 0 ;
892 int line = 0 ;
893
894 while( i < length )
895 {
896 if( text[i] == 13 || text[i] == 10)
897 {
898 ::DrawText( text , laststop , i - laststop ) ;
899 line++ ;
900 ::MoveTo( xx , yy + line*(fi.descent + fi.ascent + fi.leading) );
901 laststop = i+1 ;
902 }
903 i++ ;
904 }
905
906 ::DrawText( text , laststop , i - laststop ) ;
907 ::TextMode( srcOr ) ;
908 }
909}
910
911bool wxDC::CanGetTextExtent(void) const
912{
913 if ( !Ok() )
914 return false ;
915
916 return true ;
917}
918
2f1ae414
SC
919void wxDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *height,
920 wxCoord *descent, wxCoord *externalLeading ,
921 wxFont *theFont ) const
519cb848
SC
922{
923 if (!Ok())
924 return;
925
926 MacVerifySetup() ;
927
928 wxFont formerFont = m_font ;
929
930 if ( theFont )
931 {
932 wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ;
933
934 if ( font )
935 {
519cb848 936 ::TextFont( font->m_macFontNum ) ;
2f1ae414 937 ::TextSize( YLOG2DEVREL( font->m_macFontSize) ) ;
519cb848
SC
938 ::TextFace( font->m_macFontStyle ) ;
939 }
940 }
941 else
942 {
943 MacInstallFont() ;
944 }
945
946 FontInfo fi ;
947 ::GetFontInfo( &fi ) ;
948
2f1ae414
SC
949 if ( height )
950 *height = YDEV2LOGREL( fi.descent + fi.ascent ) ;
951 if ( descent )
952 *descent =YDEV2LOGREL( fi.descent );
953 if ( externalLeading )
954 *externalLeading = YDEV2LOGREL( fi.leading ) ;
519cb848
SC
955
956 const char *text = NULL ;
957 int length = 0 ;
958 wxString macText ;
959 if ( wxApp::s_macDefaultEncodingIsPC )
960 {
961 macText = wxMacMakeMacStringFromPC( string ) ;
962 text = macText ;
963 length = macText.Length() ;
964 }
965 else
966 {
967 text = string ;
968 length = string.Length() ;
969 }
970
971 int laststop = 0 ;
972 int i = 0 ;
973 int curwidth = 0 ;
2f1ae414 974 if ( width )
519cb848 975 {
2f1ae414
SC
976 *width = 0 ;
977
978 while( i < length )
519cb848 979 {
2f1ae414
SC
980 if( text[i] == 13 || text[i] == 10)
981 {
982 if ( height )
983 *height += YDEV2LOGREL( fi.descent + fi.ascent + fi.leading ) ;
984 curwidth = ::TextWidth( text , laststop , i - laststop ) ;
985 if ( curwidth > *width )
986 *width = XDEV2LOGREL( curwidth ) ;
987 laststop = i+1 ;
988 }
989 i++ ;
519cb848 990 }
2f1ae414
SC
991
992 curwidth = ::TextWidth( text , laststop , i - laststop ) ;
993 if ( curwidth > *width )
994 *width = XDEV2LOGREL( curwidth ) ;
519cb848 995 }
519cb848
SC
996
997 if ( theFont )
998 {
999 m_macFontInstalled = false ;
1000 }
1001}
1002
ee41971c 1003wxCoord wxDC::GetCharWidth(void) const
519cb848
SC
1004{
1005 if (!Ok())
1006 return 1;
1007
1008 MacVerifySetup() ;
1009
1010 MacInstallFont() ;
1011
1012 FontInfo fi ;
1013 ::GetFontInfo( &fi ) ;
1014
2f1ae414 1015 return YDEV2LOGREL((fi.descent + fi.ascent) / 2) ;
519cb848
SC
1016}
1017
ee41971c 1018wxCoord wxDC::GetCharHeight(void) const
519cb848
SC
1019{
1020 if (!Ok())
1021 return 1;
1022
1023 MacVerifySetup() ;
1024
1025 MacInstallFont() ;
1026
1027 FontInfo fi ;
1028 ::GetFontInfo( &fi ) ;
1029
2f1ae414 1030 return YDEV2LOGREL( fi.descent + fi.ascent );
519cb848
SC
1031}
1032
1033void wxDC::Clear(void)
1034{
1035 if (!Ok())
1036 return;
1037 MacVerifySetup() ;
1038 Rect rect = { -32767 , -32767 , 32767 , 32767 } ;
1039
1040 if (m_backgroundBrush.GetStyle() != wxTRANSPARENT)
1041 {
1042 MacInstallBrush() ;
1043 ::EraseRect( &rect ) ;
1044 };
1045}
1046
1047void wxDC::MacInstallFont() const
1048{
1049 if (!Ok())
1050 return;
1051 MacVerifySetup() ;
1052
1053 if ( m_macFontInstalled )
1054 return ;
2f1ae414
SC
1055 Pattern blackColor ;
1056
519cb848
SC
1057 wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ;
1058
1059 if ( font )
1060 {
1061 ::TextFont( font->m_macFontNum ) ;
03e11df5 1062 ::TextSize( short(m_scaleY * font->m_macFontSize) ) ;
519cb848
SC
1063 ::TextFace( font->m_macFontStyle ) ;
1064
1065 m_macFontInstalled = true ;
1066 m_macBrushInstalled = false ;
1067 m_macPenInstalled = false ;
03e11df5
GD
1068
1069 RGBColor forecolor = m_textForegroundColour.GetPixel();
1070 RGBColor backcolor = m_textBackgroundColour.GetPixel();
1071 ::RGBForeColor( &forecolor );
1072 ::RGBBackColor( &backcolor );
519cb848
SC
1073 }
1074 else
1075 {
1076 short fontnum ;
1077
1078 GetFNum( "\pGeneva" , &fontnum ) ;
1079 ::TextFont( fontnum ) ;
03e11df5 1080 ::TextSize( short(m_scaleY * 10) ) ;
519cb848
SC
1081 ::TextFace( 0 ) ;
1082
1083 // todo reset after spacing changes - or store the current spacing somewhere
1084
1085 m_macFontInstalled = true ;
1086 m_macBrushInstalled = false ;
1087 m_macPenInstalled = false ;
519cb848 1088
03e11df5
GD
1089 RGBColor forecolor = m_textForegroundColour.GetPixel();
1090 RGBColor backcolor = m_textBackgroundColour.GetPixel();
1091 ::RGBForeColor( &forecolor );
1092 ::RGBBackColor( &backcolor );
1093 }
519cb848
SC
1094
1095 short mode = patCopy ;
1096
1097 // todo :
1098
1099 switch( m_logicalFunction )
1100 {
1101 case wxCOPY: // src
1102 mode = patCopy ;
1103 break ;
1104 case wxINVERT: // NOT dst
2f1ae414 1105 ::PenPat(GetQDGlobalsBlack(&blackColor));
519cb848
SC
1106 mode = patXor ;
1107 break ;
1108 case wxXOR: // src XOR dst
1109 mode = patXor ;
1110 break ;
1111 case wxOR_REVERSE: // src OR (NOT dst)
1112 mode = notPatOr ;
1113 break ;
1114 case wxSRC_INVERT: // (NOT src)
1115 mode = notPatCopy ;
1116 break ;
1117
1118 // unsupported TODO
1119
1120 case wxCLEAR: // 0
1121 case wxAND_REVERSE:// src AND (NOT dst)
1122 case wxAND: // src AND dst
1123 case wxAND_INVERT: // (NOT src) AND dst
1124 case wxNO_OP: // dst
1125 case wxNOR: // (NOT src) AND (NOT dst)
1126 case wxEQUIV: // (NOT src) XOR dst
1127 case wxOR_INVERT: // (NOT src) OR dst
1128 case wxNAND: // (NOT src) OR (NOT dst)
1129 case wxOR: // src OR dst
1130 case wxSET: // 1
2f1ae414
SC
1131// case wxSRC_OR: // source _bitmap_ OR destination
1132// case wxSRC_AND: // source _bitmap_ AND destination
519cb848
SC
1133 break ;
1134 }
1135 ::PenMode( mode ) ;
1136}
1137
1138static void wxMacGetHatchPattern(int hatchStyle, Pattern *pattern)
1139{
1140 int thePatListID = sysPatListID;
1141 int theIndex;
1142 switch(hatchStyle)
1143 {
1144 case wxBDIAGONAL_HATCH:
1145 theIndex = 34; // WCH: this is not good
1146 break;
1147 case wxFDIAGONAL_HATCH:
1148 theIndex = 26;
1149 break;
1150 case wxCROSS_HATCH:
1151 theIndex = 5;
1152 break;
1153 case wxHORIZONTAL_HATCH:
1154 theIndex = 25;
1155 break;
1156 case wxVERTICAL_HATCH:
1157 theIndex = 6;
1158 break;
1159 case wxCROSSDIAG_HATCH:
1160 theIndex = 4; // WCH: this is not good
1161 break;
1162 default:
1163 theIndex = 1; // solid pattern
1164 break;
1165 }
1166 GetIndPattern( pattern, thePatListID, theIndex);
1167}
1168
1169void wxDC::MacInstallPen() const
1170{
1171 if (!Ok())
1172 return;
1173 MacVerifySetup() ;
1174
2f1ae414
SC
1175 Pattern blackColor;
1176
519cb848
SC
1177 if ( m_macPenInstalled )
1178 return ;
1179
03e11df5
GD
1180 RGBColor forecolor = m_pen.GetColour().GetPixel();
1181 RGBColor backcolor = m_backgroundBrush.GetColour().GetPixel();
1182 ::RGBForeColor( &forecolor );
1183 ::RGBBackColor( &backcolor );
519cb848
SC
1184
1185 ::PenNormal() ;
0b014ec7
SC
1186 int penWidth = m_pen.GetWidth() * m_scaleX ;
1187
1188 // null means only one pixel, at whatever resolution
1189 if ( penWidth == 0 )
1190 penWidth = 1 ;
519cb848
SC
1191 ::PenSize(penWidth, penWidth);
1192
1193 int penStyle = m_pen.GetStyle();
1194
1195 if (penStyle == wxSOLID)
03e11df5 1196 {
2f1ae414 1197 ::PenPat(GetQDGlobalsBlack(&blackColor));
03e11df5 1198 }
519cb848
SC
1199 else if (IS_HATCH(penStyle))
1200 {
1201 Pattern pat ;
1202 wxMacGetHatchPattern(penStyle, &pat);
1203 ::PenPat(&pat);
1204 }
1205 else
1206 {
2f1ae414 1207 ::PenPat(GetQDGlobalsBlack(&blackColor));
519cb848
SC
1208 }
1209
1210 short mode = patCopy ;
1211
1212 // todo :
1213
1214 switch( m_logicalFunction )
1215 {
1216 case wxCOPY: // src
1217 mode = patCopy ;
1218 break ;
1219 case wxINVERT: // NOT dst
2f1ae414 1220 ::PenPat(GetQDGlobalsBlack(&blackColor));
519cb848
SC
1221 mode = patXor ;
1222 break ;
1223 case wxXOR: // src XOR dst
1224 mode = patXor ;
1225 break ;
1226 case wxOR_REVERSE: // src OR (NOT dst)
1227 mode = notPatOr ;
1228 break ;
1229 case wxSRC_INVERT: // (NOT src)
1230 mode = notPatCopy ;
1231 break ;
1232
1233 // unsupported TODO
1234
1235 case wxCLEAR: // 0
1236 case wxAND_REVERSE:// src AND (NOT dst)
1237 case wxAND: // src AND dst
1238 case wxAND_INVERT: // (NOT src) AND dst
1239 case wxNO_OP: // dst
1240 case wxNOR: // (NOT src) AND (NOT dst)
1241 case wxEQUIV: // (NOT src) XOR dst
1242 case wxOR_INVERT: // (NOT src) OR dst
1243 case wxNAND: // (NOT src) OR (NOT dst)
1244 case wxOR: // src OR dst
1245 case wxSET: // 1
2f1ae414
SC
1246// case wxSRC_OR: // source _bitmap_ OR destination
1247// case wxSRC_AND: // source _bitmap_ AND destination
519cb848
SC
1248 break ;
1249 }
1250 ::PenMode( mode ) ;
1251 m_macPenInstalled = true ;
1252 m_macBrushInstalled = false ;
1253 m_macFontInstalled = false ;
1254}
1255
1256void wxDC::MacInstallBrush() const
1257{
1258 if (!Ok())
1259 return;
1260 MacVerifySetup() ;
2f1ae414 1261 Pattern blackColor, whiteColor ;
519cb848
SC
1262 if ( m_macBrushInstalled )
1263 return ;
1264
1265 // foreground
1266
03e11df5
GD
1267 RGBColor forecolor = m_brush.GetColour().GetPixel();
1268 RGBColor backcolor = m_backgroundBrush.GetColour().GetPixel();
1269 ::RGBForeColor( &forecolor );
1270 ::RGBBackColor( &backcolor );
519cb848
SC
1271
1272 int brushStyle = m_brush.GetStyle();
1273 if (brushStyle == wxSOLID)
2f1ae414 1274 ::PenPat(GetQDGlobalsBlack(&blackColor));
519cb848
SC
1275 else if (IS_HATCH(brushStyle))
1276 {
1277 Pattern pat ;
1278 wxMacGetHatchPattern(brushStyle, &pat);
1279 ::PenPat(&pat);
1280 }
1281 else
1282 {
2f1ae414 1283 ::PenPat(GetQDGlobalsBlack(&blackColor));
519cb848
SC
1284 }
1285
1286
1287 // background
1288
1289 brushStyle = m_backgroundBrush.GetStyle();
1290 if (brushStyle == wxSOLID)
2f1ae414 1291 ::BackPat(GetQDGlobalsWhite(&whiteColor));
519cb848
SC
1292 else if (IS_HATCH(brushStyle))
1293 {
1294 Pattern pat ;
1295 wxMacGetHatchPattern(brushStyle, &pat);
1296 ::BackPat(&pat);
1297 }
1298 else
1299 {
2f1ae414 1300 ::BackPat(GetQDGlobalsWhite(&whiteColor));
519cb848
SC
1301 }
1302
1303 short mode = patCopy ;
1304
1305 // todo :
1306
1307 switch( m_logicalFunction )
1308 {
1309 case wxCOPY: // src
1310 mode = patCopy ;
1311 break ;
1312 case wxINVERT: // NOT dst
2f1ae414 1313 ::PenPat(GetQDGlobalsBlack(&blackColor));
519cb848
SC
1314 mode = patXor ;
1315 break ;
1316 case wxXOR: // src XOR dst
1317 mode = patXor ;
1318 break ;
1319 case wxOR_REVERSE: // src OR (NOT dst)
1320 mode = notPatOr ;
1321 break ;
1322 case wxSRC_INVERT: // (NOT src)
1323 mode = notPatCopy ;
1324 break ;
1325
1326 // unsupported TODO
1327
1328 case wxCLEAR: // 0
1329 case wxAND_REVERSE:// src AND (NOT dst)
1330 case wxAND: // src AND dst
1331 case wxAND_INVERT: // (NOT src) AND dst
1332 case wxNO_OP: // dst
1333 case wxNOR: // (NOT src) AND (NOT dst)
1334 case wxEQUIV: // (NOT src) XOR dst
1335 case wxOR_INVERT: // (NOT src) OR dst
1336 case wxNAND: // (NOT src) OR (NOT dst)
1337 case wxOR: // src OR dst
1338 case wxSET: // 1
2f1ae414
SC
1339// case wxSRC_OR: // source _bitmap_ OR destination
1340// case wxSRC_AND: // source _bitmap_ AND destination
519cb848
SC
1341 break ;
1342 }
1343 ::PenMode( mode ) ;
1344 m_macBrushInstalled = true ;
1345 m_macPenInstalled = false ;
1346 m_macFontInstalled = false ;
1347}
1348
2f1ae414
SC
1349// ---------------------------------------------------------------------------
1350// coordinates transformations
1351// ---------------------------------------------------------------------------
519cb848 1352
2f1ae414
SC
1353
1354wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const
1355{
1356 return ((wxDC *)this)->XDEV2LOG(x);
1357}
1358
1359wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const
1360{
1361 return ((wxDC *)this)->YDEV2LOG(y);
1362}
1363
1364wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const
1365{
1366 return ((wxDC *)this)->XDEV2LOGREL(x);
1367}
1368
1369wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const
1370{
1371 return ((wxDC *)this)->YDEV2LOGREL(y);
1372}
1373
1374wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const
1375{
1376 return ((wxDC *)this)->XLOG2DEV(x);
1377}
1378
1379wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const
1380{
1381 return ((wxDC *)this)->YLOG2DEV(y);
1382}
1383
1384wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const
1385{
1386 return ((wxDC *)this)->XLOG2DEVREL(x);
1387}
1388
1389wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const
1390{
1391 return ((wxDC *)this)->YLOG2DEVREL(y);
1392}