//-----------------------------------------------------------------------------
// constants
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// constants
//-----------------------------------------------------------------------------
// get area including focus rect
CopyRgn( (RgnHandle) ((wxWindow*)win)->MacGetVisibleRegion(true).GetWXHRGN() , m_newClip ) ;
if ( !EmptyRgn( m_newClip ) )
OffsetRgn( m_newClip , x , y ) ;
}
// get area including focus rect
CopyRgn( (RgnHandle) ((wxWindow*)win)->MacGetVisibleRegion(true).GetWXHRGN() , m_newClip ) ;
if ( !EmptyRgn( m_newClip ) )
OffsetRgn( m_newClip , x , y ) ;
}
case wxAND_INVERT: // (NOT src) AND dst
dstColor.red = dstColor.red & ~srcColor.red ;
dstColor.green = dstColor.green & ~srcColor.green ;
dstColor.blue = dstColor.blue & ~srcColor.blue ;
break ;
case wxAND_INVERT: // (NOT src) AND dst
dstColor.red = dstColor.red & ~srcColor.red ;
dstColor.green = dstColor.green & ~srcColor.green ;
dstColor.blue = dstColor.blue & ~srcColor.blue ;
break ;
case wxAND_REVERSE:// src AND (NOT dst)
dstColor.red = ~dstColor.red & srcColor.red ;
dstColor.green = ~dstColor.green & srcColor.green ;
dstColor.blue = ~dstColor.blue & srcColor.blue ;
break ;
case wxAND_REVERSE:// src AND (NOT dst)
dstColor.red = ~dstColor.red & srcColor.red ;
dstColor.green = ~dstColor.green & srcColor.green ;
dstColor.blue = ~dstColor.blue & srcColor.blue ;
break ;
case wxCOPY: // src
dstColor.red = srcColor.red ;
dstColor.green = srcColor.green ;
dstColor.blue = srcColor.blue ;
break ;
case wxCOPY: // src
dstColor.red = srcColor.red ;
dstColor.green = srcColor.green ;
dstColor.blue = srcColor.blue ;
break ;
case wxEQUIV: // (NOT src) XOR dst
dstColor.red = dstColor.red ^ ~srcColor.red ;
dstColor.green = dstColor.green ^ ~srcColor.green ;
dstColor.blue = dstColor.blue ^ ~srcColor.blue ;
break ;
case wxEQUIV: // (NOT src) XOR dst
dstColor.red = dstColor.red ^ ~srcColor.red ;
dstColor.green = dstColor.green ^ ~srcColor.green ;
dstColor.blue = dstColor.blue ^ ~srcColor.blue ;
break ;
case wxINVERT: // NOT dst
dstColor.red = ~dstColor.red ;
dstColor.green = ~dstColor.green ;
dstColor.blue = ~dstColor.blue ;
break ;
case wxINVERT: // NOT dst
dstColor.red = ~dstColor.red ;
dstColor.green = ~dstColor.green ;
dstColor.blue = ~dstColor.blue ;
break ;
case wxNAND: // (NOT src) OR (NOT dst)
dstColor.red = ~dstColor.red | ~srcColor.red ;
dstColor.green = ~dstColor.green | ~srcColor.green ;
dstColor.blue = ~dstColor.blue | ~srcColor.blue ;
break ;
case wxNAND: // (NOT src) OR (NOT dst)
dstColor.red = ~dstColor.red | ~srcColor.red ;
dstColor.green = ~dstColor.green | ~srcColor.green ;
dstColor.blue = ~dstColor.blue | ~srcColor.blue ;
break ;
case wxNOR: // (NOT src) AND (NOT dst)
dstColor.red = ~dstColor.red & ~srcColor.red ;
dstColor.green = ~dstColor.green & ~srcColor.green ;
dstColor.blue = ~dstColor.blue & ~srcColor.blue ;
break ;
case wxNOR: // (NOT src) AND (NOT dst)
dstColor.red = ~dstColor.red & ~srcColor.red ;
dstColor.green = ~dstColor.green & ~srcColor.green ;
dstColor.blue = ~dstColor.blue & ~srcColor.blue ;
break ;
case wxOR: // src OR dst
dstColor.red = dstColor.red | srcColor.red ;
dstColor.green = dstColor.green | srcColor.green ;
dstColor.blue = dstColor.blue | srcColor.blue ;
break ;
case wxOR: // src OR dst
dstColor.red = dstColor.red | srcColor.red ;
dstColor.green = dstColor.green | srcColor.green ;
dstColor.blue = dstColor.blue | srcColor.blue ;
break ;
case wxOR_INVERT: // (NOT src) OR dst
dstColor.red = dstColor.red | ~srcColor.red ;
dstColor.green = dstColor.green | ~srcColor.green ;
dstColor.blue = dstColor.blue | ~srcColor.blue ;
break ;
case wxOR_INVERT: // (NOT src) OR dst
dstColor.red = dstColor.red | ~srcColor.red ;
dstColor.green = dstColor.green | ~srcColor.green ;
dstColor.blue = dstColor.blue | ~srcColor.blue ;
break ;
case wxOR_REVERSE: // src OR (NOT dst)
dstColor.red = ~dstColor.red | srcColor.red ;
dstColor.green = ~dstColor.green | srcColor.green ;
dstColor.blue = ~dstColor.blue | srcColor.blue ;
break ;
case wxOR_REVERSE: // src OR (NOT dst)
dstColor.red = ~dstColor.red | srcColor.red ;
dstColor.green = ~dstColor.green | srcColor.green ;
dstColor.blue = ~dstColor.blue | srcColor.blue ;
break ;
case wxSRC_INVERT: // (NOT src)
dstColor.red = ~srcColor.red ;
dstColor.green = ~srcColor.green ;
dstColor.blue = ~srcColor.blue ;
break ;
case wxSRC_INVERT: // (NOT src)
dstColor.red = ~srcColor.red ;
dstColor.green = ~srcColor.green ;
dstColor.blue = ~srcColor.blue ;
break ;
case wxXOR: // src XOR dst
dstColor.red = dstColor.red ^ srcColor.red ;
dstColor.green = dstColor.green ^ srcColor.green ;
dstColor.blue = dstColor.blue ^ srcColor.blue ;
break ;
case wxXOR: // src XOR dst
dstColor.red = dstColor.red ^ srcColor.red ;
dstColor.green = dstColor.green ^ srcColor.green ;
dstColor.blue = dstColor.blue ^ srcColor.blue ;
break ;
m_macFontInstalled = false ;
m_macBrushInstalled = false ;
m_macPenInstalled = false ;
m_macFontInstalled = false ;
m_macBrushInstalled = false ;
m_macPenInstalled = false ;
#ifdef __WXDEBUG__
// needed to debug possible errors with two active drawing methods at the same time on
// the same DC
m_macCurrentPortStateHelper = NULL ;
#endif
#ifdef __WXDEBUG__
// needed to debug possible errors with two active drawing methods at the same time on
// the same DC
m_macCurrentPortStateHelper = NULL ;
#endif
#if ! wxMAC_EXPERIMENTAL_DC
m_macFontInstalled = false ;
m_macBrushInstalled = false ;
m_macPenInstalled = false ;
#endif
}
#if ! wxMAC_EXPERIMENTAL_DC
m_macFontInstalled = false ;
m_macBrushInstalled = false ;
m_macPenInstalled = false ;
#endif
}
void wxDC::MacCleanupPort(wxMacPortStateHelper* help) const
{
#ifdef __WXDEBUG__
wxASSERT( m_macCurrentPortStateHelper == help ) ;
m_macCurrentPortStateHelper = NULL ;
#endif
void wxDC::MacCleanupPort(wxMacPortStateHelper* help) const
{
#ifdef __WXDEBUG__
wxASSERT( m_macCurrentPortStateHelper == help ) ;
m_macCurrentPortStateHelper = NULL ;
#endif
if ( m_macAliasWasEnabled )
{
SetAntiAliasedTextEnabled(m_macFormerAliasState, m_macFormerAliasSize);
m_macAliasWasEnabled = false ;
}
if ( m_macAliasWasEnabled )
{
SetAntiAliasedTextEnabled(m_macFormerAliasState, m_macFormerAliasSize);
m_macAliasWasEnabled = false ;
}
void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask )
{
void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask )
{
- wxCHECK_RET( Ok(), wxT("invalid window dc") );
- wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap") );
+ wxCHECK_RET( Ok(), wxT("wxDC::DoDrawBitmap - invalid DC") );
+ wxCHECK_RET( bmp.Ok(), wxT("wxDC::DoDrawBitmap - invalid bitmap") );
+
wxMacFastPortSetter helper(this) ;
wxCoord xx = XLOG2DEVMAC(x);
wxCoord yy = YLOG2DEVMAC(y);
wxMacFastPortSetter helper(this) ;
wxCoord xx = XLOG2DEVMAC(x);
wxCoord yy = YLOG2DEVMAC(y);
wxCoord h = bmp.GetHeight();
wxCoord ww = XLOG2DEVREL(w);
wxCoord hh = YLOG2DEVREL(h);
wxCoord h = bmp.GetHeight();
wxCoord ww = XLOG2DEVREL(w);
wxCoord hh = YLOG2DEVREL(h);
- GWorldPtr maskworld = NULL ;
- GWorldPtr bmapworld = MAC_WXHBITMAP( bmp.GetHBITMAP((WXHBITMAP*)&maskworld) );
+ GWorldPtr maskworld = NULL ;
+ GWorldPtr bmapworld = MAC_WXHBITMAP( bmp.GetHBITMAP((WXHBITMAP*)&maskworld) );
RGBColor fore = MAC_WXCOLORREF(m_textForegroundColour.GetPixel());
RGBColor back = MAC_WXCOLORREF(m_textBackgroundColour.GetPixel());
RGBForeColor(&fore);
RGBColor fore = MAC_WXCOLORREF(m_textForegroundColour.GetPixel());
RGBColor back = MAC_WXCOLORREF(m_textBackgroundColour.GetPixel());
RGBForeColor(&fore);
- RGBColor white = { 0xFFFF, 0xFFFF,0xFFFF} ;
- RGBColor black = { 0,0,0} ;
+ RGBColor white = { 0xFFFF, 0xFFFF, 0xFFFF } ;
+ RGBColor black = { 0, 0, 0 } ;
Rect source = { 0, 0, h, w };
Rect dest = { yy, xx, yy + hh, xx + ww };
if ( useMask && maskworld )
{
Rect source = { 0, 0, h, w };
Rect dest = { yy, xx, yy + hh, xx + ww };
if ( useMask && maskworld )
{
CopyBits( GetPortBitMapForCopyBits( bmapworld ),
GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ),
&source, &dest, mode, NULL ) ;
CopyBits( GetPortBitMapForCopyBits( bmapworld ),
GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ),
&source, &dest, mode, NULL ) ;
- wxCHECK_RET(Ok(), wxT("Invalid dc wxDC::DoDrawIcon"));
- wxCHECK_RET(icon.Ok(), wxT("Invalid icon wxDC::DoDrawIcon"));
+ wxCHECK_RET(Ok(), wxT("wxDC::DoDrawIcon - invalid DC"));
+ wxCHECK_RET(icon.Ok(), wxT("wxDC::DoDrawIcon - invalid icon"));
+
wxMacFastPortSetter helper(this) ;
wxCoord xx = XLOG2DEVMAC(x);
wxCoord yy = YLOG2DEVMAC(y);
wxMacFastPortSetter helper(this) ;
wxCoord xx = XLOG2DEVMAC(x);
wxCoord yy = YLOG2DEVMAC(y);
- Rect r = { yy , xx, yy + 32 , xx + 32 } ;
+ Rect r = { yy , xx, yy + hh, xx + ww } ;
PlotIconRef( &r , kAlignNone , kTransformNone , kPlotIconRefNormalFlags , MAC_WXHICON( icon.GetHICON() ) ) ;
}
void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
{
PlotIconRef( &r , kAlignNone , kTransformNone , kPlotIconRefNormalFlags , MAC_WXHICON( icon.GetHICON() ) ) ;
}
void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
{
SetRectRgn( (RgnHandle) m_macCurrentClipRgn , xx , yy , xx + ww , yy + hh ) ;
SectRgn( (RgnHandle) m_macCurrentClipRgn , (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
SetRectRgn( (RgnHandle) m_macCurrentClipRgn , xx , yy , xx + ww , yy + hh ) ;
SectRgn( (RgnHandle) m_macCurrentClipRgn , (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
{
m_clipX1 = wxMax( m_clipX1 , xx );
m_clipY1 = wxMax( m_clipY1 , yy );
{
m_clipX1 = wxMax( m_clipX1 , xx );
m_clipY1 = wxMax( m_clipY1 , yy );
- m_clipX2 = wxMin( m_clipX2, (xx + ww));
- m_clipY2 = wxMin( m_clipY2, (yy + hh));
+ m_clipX2 = wxMin( m_clipX2, (xx + ww) );
+ m_clipY2 = wxMin( m_clipY2, (yy + hh) );
wxMacFastPortSetter helper(this) ;
wxCoord x, y, w, h;
region.GetBox( x, y, w, h );
wxMacFastPortSetter helper(this) ;
wxCoord x, y, w, h;
region.GetBox( x, y, w, h );
{
CopyRgn( (RgnHandle) region.GetWXHRGN() , (RgnHandle) m_macCurrentClipRgn ) ;
if ( xx != x || yy != y )
{
CopyRgn( (RgnHandle) region.GetWXHRGN() , (RgnHandle) m_macCurrentClipRgn ) ;
if ( xx != x || yy != y )
SectRgn( (RgnHandle) m_macCurrentClipRgn , (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
SectRgn( (RgnHandle) m_macCurrentClipRgn , (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
{
m_clipX1 = wxMax( m_clipX1 , xx );
m_clipY1 = wxMax( m_clipY1 , yy );
{
m_clipX1 = wxMax( m_clipX1 , xx );
m_clipY1 = wxMax( m_clipY1 , yy );
- m_clipX2 = wxMin( m_clipX2, (xx + ww));
- m_clipY2 = wxMin( m_clipY2, (yy + hh));
+ m_clipX2 = wxMin( m_clipX2, (xx + ww) );
+ m_clipY2 = wxMin( m_clipY2, (yy + hh) );
CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
ResetClipping();
}
void wxDC::DoGetSizeMM( int* width, int* height ) const
{
CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
ResetClipping();
}
void wxDC::DoGetSizeMM( int* width, int* height ) const
{
- *width = long( double(w) / (m_scaleX*m_mm_to_pix_x) );
- *height = long( double(h) / (m_scaleY*m_mm_to_pix_y) );
+ if (width)
+ *width = long( double(w) / (m_scaleX * m_mm_to_pix_x) );
+ if (height)
+ *height = long( double(h) / (m_scaleY * m_mm_to_pix_y) );
m_textForegroundColour = col;
m_macFontInstalled = false ;
}
void wxDC::SetTextBackground( const wxColour &col )
{
m_textForegroundColour = col;
m_macFontInstalled = false ;
}
void wxDC::SetTextBackground( const wxColour &col )
{
m_scaleY = m_logicalScaleY * m_userScaleY;
m_deviceOriginX = m_internalDeviceOriginX + m_externalDeviceOriginX;
m_deviceOriginY = m_internalDeviceOriginY + m_externalDeviceOriginY;
m_scaleY = m_logicalScaleY * m_userScaleY;
m_deviceOriginX = m_internalDeviceOriginX + m_externalDeviceOriginX;
m_deviceOriginY = m_internalDeviceOriginY + m_externalDeviceOriginY;
// CMB: if scale has changed call SetPen to recalulate the line width
if (m_scaleX != origScaleX || m_scaleY != origScaleY)
{
// CMB: if scale has changed call SetPen to recalulate the line width
if (m_scaleX != origScaleX || m_scaleY != origScaleY)
{
m_logicalFunction = function ;
m_macFontInstalled = false ;
m_macBrushInstalled = false ;
m_logicalFunction = function ;
m_macFontInstalled = false ;
m_macBrushInstalled = false ;
return wxDoFloodFill(this, x, y, col, style);
}
return wxDoFloodFill(this, x, y, col, style);
}
- // Convert from Mac colour to wx
- col->Set( colour.red >> 8,
- colour.green >> 8,
- colour.blue >> 8);
+
+ // convert from Mac colour to wx
+ col->Set( colour.red >> 8, colour.green >> 8, colour.blue >> 8);
+
-void wxDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
+void wxDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
wxCoord xx1 = XLOG2DEVMAC(x1) - offset;
wxCoord yy1 = YLOG2DEVMAC(y1) - offset;
wxCoord xx2 = XLOG2DEVMAC(x2) - offset;
wxCoord yy2 = YLOG2DEVMAC(y2) - offset;
wxCoord xx1 = XLOG2DEVMAC(x1) - offset;
wxCoord yy1 = YLOG2DEVMAC(y1) - offset;
wxCoord xx2 = XLOG2DEVMAC(x2) - offset;
wxCoord yy2 = YLOG2DEVMAC(y2) - offset;
MacInstallPen();
::MoveTo( XLOG2DEVMAC(0), yy );
::LineTo( XLOG2DEVMAC(w), yy );
::MoveTo( xx, YLOG2DEVMAC(0) );
::LineTo( xx, YLOG2DEVMAC(h) );
CalcBoundingBox(x, y);
MacInstallPen();
::MoveTo( XLOG2DEVMAC(0), yy );
::LineTo( XLOG2DEVMAC(w), yy );
::MoveTo( xx, YLOG2DEVMAC(0) );
::LineTo( xx, YLOG2DEVMAC(h) );
CalcBoundingBox(x, y);
wxCoord xx1 = XLOG2DEVMAC(x1);
wxCoord yy1 = YLOG2DEVMAC(y1);
wxCoord xx2 = XLOG2DEVMAC(x2);
wxCoord yy2 = YLOG2DEVMAC(y2);
wxCoord xxc = XLOG2DEVMAC(xc);
wxCoord yyc = YLOG2DEVMAC(yc);
wxCoord xx1 = XLOG2DEVMAC(x1);
wxCoord yy1 = YLOG2DEVMAC(y1);
wxCoord xx2 = XLOG2DEVMAC(x2);
wxCoord yy2 = YLOG2DEVMAC(y2);
wxCoord xxc = XLOG2DEVMAC(xc);
wxCoord yyc = YLOG2DEVMAC(yc);
wxCoord alpha2 = wxCoord(radius2 - radius1);
wxCoord alpha1 = wxCoord(wxConvertWXangleToMACangle(radius1));
wxCoord alpha2 = wxCoord(radius2 - radius1);
wxCoord alpha1 = wxCoord(wxConvertWXangleToMACangle(radius1));
alpha2 = -alpha2 ;
Rect r = { yyc - rad, xxc - rad, yyc + rad, xxc + rad };
alpha2 = -alpha2 ;
Rect r = { yyc - rad, xxc - rad, yyc + rad, xxc + rad };
-void wxDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord w, wxCoord h,
+void wxDC::DoDrawEllipticArc( wxCoord x, wxCoord y, wxCoord w, wxCoord h,
wxCoord xx = XLOG2DEVMAC(x);
wxCoord yy = YLOG2DEVMAC(y);
wxCoord ww = m_signX * XLOG2DEVREL(w);
wxCoord hh = m_signY * YLOG2DEVREL(h);
wxCoord xx = XLOG2DEVMAC(x);
wxCoord yy = YLOG2DEVMAC(y);
wxCoord ww = m_signX * XLOG2DEVREL(w);
wxCoord hh = m_signY * YLOG2DEVREL(h);
if (m_pen.GetStyle() != wxTRANSPARENT)
{
wxCoord xx1 = XLOG2DEVMAC(x);
wxCoord yy1 = YLOG2DEVMAC(y);
RGBColor pencolor = MAC_WXCOLORREF( m_pen.GetColour().GetPixel());
if (m_pen.GetStyle() != wxTRANSPARENT)
{
wxCoord xx1 = XLOG2DEVMAC(x);
wxCoord yy1 = YLOG2DEVMAC(y);
RGBColor pencolor = MAC_WXCOLORREF( m_pen.GetColour().GetPixel());
- ::SetCPixel( xx1,yy1,&pencolor) ;
+
+ // NOTE: Get/SetCPixel are slow!
+ ::SetCPixel( xx1, yy1, &pencolor) ;
wxCoord x1, x2 , y1 , y2 ;
x1 = XLOG2DEVMAC(points[0].x + xoffset);
y1 = YLOG2DEVMAC(points[0].y + yoffset);
wxCoord x1, x2 , y1 , y2 ;
x1 = XLOG2DEVMAC(points[0].x + xoffset);
y1 = YLOG2DEVMAC(points[0].y + yoffset);
- wxCHECK_RET(Ok(), wxT("Invalid DC"));
- wxMacFastPortSetter helper(this) ;
- wxCoord x1, x2 , y1 , y2 ;
+ wxCHECK_RET(Ok(), wxT("wxDC::DoDrawPolygon - invalid DC"));
+
PolyHandle polygon = OpenPoly();
x2 = x1 = XLOG2DEVMAC(points[0].x + xoffset);
y2 = y1 = YLOG2DEVMAC(points[0].y + yoffset);
PolyHandle polygon = OpenPoly();
x2 = x1 = XLOG2DEVMAC(points[0].x + xoffset);
y2 = y1 = YLOG2DEVMAC(points[0].y + yoffset);
for (int i = 1; i < n; i++)
{
x2 = XLOG2DEVMAC(points[i].x + xoffset);
y2 = YLOG2DEVMAC(points[i].y + yoffset);
::LineTo(x2, y2);
}
for (int i = 1; i < n; i++)
{
x2 = XLOG2DEVMAC(points[i].x + xoffset);
y2 = YLOG2DEVMAC(points[i].y + yoffset);
::LineTo(x2, y2);
}
KillPoly( polygon );
}
void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
KillPoly( polygon );
}
void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{
wxCoord xx = XLOG2DEVMAC(x);
wxCoord yy = YLOG2DEVMAC(y);
wxCoord ww = m_signX * XLOG2DEVREL(width);
wxCoord hh = m_signY * YLOG2DEVREL(height);
wxCoord xx = XLOG2DEVMAC(x);
wxCoord yy = YLOG2DEVMAC(y);
wxCoord ww = m_signX * XLOG2DEVREL(width);
wxCoord hh = m_signY * YLOG2DEVREL(height);
Rect rect = { yy , xx , yy + hh , xx + ww } ;
Rect rect = { yy , xx , yy + hh , xx + ww } ;
wxCoord yy = YLOG2DEVMAC(y);
wxCoord ww = m_signX * XLOG2DEVREL(width);
wxCoord hh = m_signY * YLOG2DEVREL(height);
wxCoord yy = YLOG2DEVMAC(y);
wxCoord ww = m_signX * XLOG2DEVREL(width);
wxCoord hh = m_signY * YLOG2DEVREL(height);
Rect rect = { yy , xx , yy + hh , xx + ww } ;
Rect rect = { yy , xx , yy + hh , xx + ww } ;
if (m_brush.GetStyle() != wxTRANSPARENT)
{
MacInstallBrush() ;
::PaintRoundRect( &rect , int(radius * 2) , int(radius * 2) ) ;
}
if (m_brush.GetStyle() != wxTRANSPARENT)
{
MacInstallBrush() ;
::PaintRoundRect( &rect , int(radius * 2) , int(radius * 2) ) ;
}
-void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
+void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
wxCoord xx = XLOG2DEVMAC(x);
wxCoord yy = YLOG2DEVMAC(y);
wxCoord ww = m_signX * XLOG2DEVREL(width);
wxCoord hh = m_signY * YLOG2DEVREL(height);
wxCoord xx = XLOG2DEVMAC(x);
wxCoord yy = YLOG2DEVMAC(y);
wxCoord ww = m_signX * XLOG2DEVREL(width);
wxCoord hh = m_signY * YLOG2DEVREL(height);
Rect rect = { yy , xx , yy + hh , xx + ww } ;
Rect rect = { yy , xx , yy + hh , xx + ww } ;
-bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
+bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc, int logical_func , bool useMask,
wxDC *source, wxCoord xsrc, wxCoord ysrc, int logical_func , bool useMask,
- wxCHECK_MSG(Ok(), false, wxT("wxDC::DoBlit Illegal dc"));
- wxCHECK_MSG(source->Ok(), false, wxT("wxDC::DoBlit Illegal source DC"));
+ wxCHECK_MSG(Ok(), false, wxT("wxDC::DoBlit - invalid DC"));
+ wxCHECK_MSG(source->Ok(), false, wxT("wxDC::DoBlit - invalid source DC"));
+
// correct the parameter in case this dc does not have a mask at all
if ( useMask && !source->m_macMask )
useMask = false ;
// correct the parameter in case this dc does not have a mask at all
if ( useMask && !source->m_macMask )
useMask = false ;
dstrect.right = XLOG2DEVMAC(xdest + width ) ;
short mode = kUnsupportedMode ;
bool invertDestinationFirst = false ;
dstrect.right = XLOG2DEVMAC(xdest + width ) ;
short mode = kUnsupportedMode ;
bool invertDestinationFirst = false ;
CGrafPtr sourcePort = (CGrafPtr) source->m_macPort ;
PixMapHandle bmappixels = GetGWorldPixMap( sourcePort ) ;
if ( LockPixels(bmappixels) )
{
wxMacFastPortSetter helper(this) ;
CGrafPtr sourcePort = (CGrafPtr) source->m_macPort ;
PixMapHandle bmappixels = GetGWorldPixMap( sourcePort ) ;
if ( LockPixels(bmappixels) )
{
wxMacFastPortSetter helper(this) ;
- RGBColor white = { 0xFFFF, 0xFFFF,0xFFFF} ;
- RGBColor black = { 0,0,0} ;
+ RGBColor white = { 0xFFFF, 0xFFFF, 0xFFFF } ;
+ RGBColor black = { 0, 0, 0 } ;
+
BitMapToRegion( clipRgn , (BitMap*) *GetGWorldPixMap( MAC_WXHBITMAP(source->m_macMask) ) ) ;
UnlockPixels( GetGWorldPixMap( MAC_WXHBITMAP(source->m_macMask) ) ) ;
OffsetRgn( clipRgn , -srcrect.left + dstrect.left, -srcrect.top + dstrect.top ) ;
BitMapToRegion( clipRgn , (BitMap*) *GetGWorldPixMap( MAC_WXHBITMAP(source->m_macMask) ) ) ;
UnlockPixels( GetGWorldPixMap( MAC_WXHBITMAP(source->m_macMask) ) ) ;
OffsetRgn( clipRgn , -srcrect.left + dstrect.left, -srcrect.top + dstrect.top ) ;
Point srcPoint = { srcrect.top + y , srcrect.left + x } ;
if ( PtInRgn( dstPoint , clipRgn ) )
{
Point srcPoint = { srcrect.top + y , srcrect.left + x } ;
if ( PtInRgn( dstPoint , clipRgn ) )
{
SetPort( (GrafPtr) m_macPort ) ;
GetCPixel( dstPoint.h , dstPoint.v , &dstColor ) ;
SetPort( (GrafPtr) m_macPort ) ;
GetCPixel( dstPoint.h , dstPoint.v , &dstColor ) ;
CopyBits( GetPortBitMapForCopyBits( sourcePort ) ,
GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ) ,
&srcrect, &dstrect, mode, clipRgn ) ;
}
CopyBits( GetPortBitMapForCopyBits( sourcePort ) ,
GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ) ,
&srcrect, &dstrect, mode, clipRgn ) ;
}
{
RgnHandle clipRgn = NewRgn() ;
SetRectRgn( clipRgn , dstrect.left , dstrect.top , dstrect.right , dstrect.bottom ) ;
{
RgnHandle clipRgn = NewRgn() ;
SetRectRgn( clipRgn , dstrect.left , dstrect.top , dstrect.right , dstrect.bottom ) ;
Point dstPoint = { dstrect.top + y , dstrect.left + x } ;
Point srcPoint = { srcrect.top + y , srcrect.left + x } ;
{
Point dstPoint = { dstrect.top + y , dstrect.left + x } ;
Point srcPoint = { srcrect.top + y , srcrect.left + x } ;
{
SetPort( (GrafPtr) m_macPort ) ;
GetCPixel( dstPoint.h , dstPoint.v , &dstColor ) ;
SetPort( (GrafPtr) m_macPort ) ;
GetCPixel( dstPoint.h , dstPoint.v , &dstColor ) ;
CopyBits( GetPortBitMapForCopyBits( sourcePort ) ,
GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ) ,
&srcrect, &dstrect, mode, NULL ) ;
}
CopyBits( GetPortBitMapForCopyBits( sourcePort ) ,
GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ) ,
&srcrect, &dstrect, mode, NULL ) ;
}
m_macPenInstalled = false ;
m_macBrushInstalled = false ;
m_macFontInstalled = false ;
m_macPenInstalled = false ;
m_macBrushInstalled = false ;
m_macFontInstalled = false ;
-void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
+void wxDC::DoDrawRotatedText(const wxString& str, wxCoord x, wxCoord y,
- // TODO support text background color (only possible by hand, ATSUI does not support it)
- wxCHECK_RET( Ok(), wxT("wxDC::DoDrawRotatedText Invalid window dc") );
+ // TODO: support text background color (only possible by hand, ATSUI does not support it)
+ wxCHECK_RET( Ok(), wxT("wxDC::DoDrawRotatedText - invalid DC") );
if ( 0 )
{
m_macFormerAliasState = IsAntiAliasedTextEnabled(&m_macFormerAliasSize);
SetAntiAliasedTextEnabled(true, SInt16(m_scaleY * m_font.MacGetFontSize()));
m_macAliasWasEnabled = true ;
}
if ( 0 )
{
m_macFormerAliasState = IsAntiAliasedTextEnabled(&m_macFormerAliasSize);
SetAntiAliasedTextEnabled(true, SInt16(m_scaleY * m_font.MacGetFontSize()));
m_macAliasWasEnabled = true ;
}
OSStatus status = noErr ;
ATSUTextLayout atsuLayout ;
UniCharCount chars = str.Length() ;
UniChar* ubuf = NULL ;
OSStatus status = noErr ;
ATSUTextLayout atsuLayout ;
UniCharCount chars = str.Length() ;
UniChar* ubuf = NULL ;
#if wxUSE_UNICODE
size_t unicharlen = converter.WC2MB( NULL , str.wc_str() , 0 ) ;
ubuf = (UniChar*) malloc( unicharlen + 2 ) ;
converter.WC2MB( (char*) ubuf , str.wc_str(), unicharlen + 2 ) ;
#else
const wxWCharBuffer wchar = str.wc_str( wxConvLocal ) ;
#if wxUSE_UNICODE
size_t unicharlen = converter.WC2MB( NULL , str.wc_str() , 0 ) ;
ubuf = (UniChar*) malloc( unicharlen + 2 ) ;
converter.WC2MB( (char*) ubuf , str.wc_str(), unicharlen + 2 ) ;
#else
const wxWCharBuffer wchar = str.wc_str( wxConvLocal ) ;
ubuf = (UniChar*) malloc( unicharlen + 2 ) ;
converter.WC2MB( (char*) ubuf , wchar.data() , unicharlen + 2 ) ;
#endif
ubuf = (UniChar*) malloc( unicharlen + 2 ) ;
converter.WC2MB( (char*) ubuf , wchar.data() , unicharlen + 2 ) ;
#endif
- ATSUTextMeasurement textBefore ;
- ATSUTextMeasurement textAfter ;
- ATSUTextMeasurement ascent ;
- ATSUTextMeasurement descent ;
-
+ ATSUTextMeasurement textBefore, textAfter ;
+ ATSUTextMeasurement ascent, descent ;
status = ::ATSUSetLayoutControls(atsuLayout , sizeof(atsuTags)/sizeof(ATSUAttributeTag),
atsuTags, atsuSizes, atsuValues ) ;
}
status = ::ATSUSetLayoutControls(atsuLayout , sizeof(atsuTags)/sizeof(ATSUAttributeTag),
atsuTags, atsuSizes, atsuValues ) ;
}
status = ::ATSUMeasureText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
&textBefore , &textAfter, &ascent , &descent );
status = ::ATSUMeasureText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
&textBefore , &textAfter, &ascent , &descent );
- drawX += (int)(sin(angle/RAD2DEG) * FixedToInt(ascent));
- drawY += (int)(cos(angle/RAD2DEG) * FixedToInt(ascent));
+ drawX += (int)(sin(angle / RAD2DEG) * FixedToInt(ascent));
+ drawY += (int)(cos(angle / RAD2DEG) * FixedToInt(ascent));
status = ::ATSUDrawText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
IntToFixed(drawX) , IntToFixed(drawY) );
status = ::ATSUDrawText( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
IntToFixed(drawX) , IntToFixed(drawY) );
Rect rect ;
status = ::ATSUMeasureTextImage( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
IntToFixed(drawX) , IntToFixed(drawY) , &rect );
wxASSERT_MSG( status == noErr , wxT("couldn't measure the rotated text") );
Rect rect ;
status = ::ATSUMeasureTextImage( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
IntToFixed(drawX) , IntToFixed(drawY) , &rect );
wxASSERT_MSG( status == noErr , wxT("couldn't measure the rotated text") );
OffsetRect( &rect , -m_macLocalOrigin.x , -m_macLocalOrigin.y ) ;
CalcBoundingBox(XDEV2LOG(rect.left), YDEV2LOG(rect.top) );
CalcBoundingBox(XDEV2LOG(rect.right), YDEV2LOG(rect.bottom) );
::ATSUDisposeTextLayout(atsuLayout);
OffsetRect( &rect , -m_macLocalOrigin.x , -m_macLocalOrigin.y ) ;
CalcBoundingBox(XDEV2LOG(rect.left), YDEV2LOG(rect.top) );
CalcBoundingBox(XDEV2LOG(rect.right), YDEV2LOG(rect.bottom) );
::ATSUDisposeTextLayout(atsuLayout);
wxMacFastPortSetter helper(this) ;
long xx = XLOG2DEVMAC(x);
long yy = YLOG2DEVMAC(y);
wxMacFastPortSetter helper(this) ;
long xx = XLOG2DEVMAC(x);
long yy = YLOG2DEVMAC(y);
#if TARGET_CARBON
bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ;
if ( UMAGetSystemVersion() < 0x1000 || IsKindOf(CLASSINFO( wxPrinterDC ) ) || m_font.GetNoAntiAliasing() )
useDrawThemeText = false ;
#endif
#if TARGET_CARBON
bool useDrawThemeText = ( DrawThemeTextBox != (void*) kUnresolvedCFragSymbolAddress ) ;
if ( UMAGetSystemVersion() < 0x1000 || IsKindOf(CLASSINFO( wxPrinterDC ) ) || m_font.GetNoAntiAliasing() )
useDrawThemeText = false ;
#endif
- Rect frame = { yy + line*(fi.descent + fi.ascent + fi.leading) ,xx , yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ;
+ Rect frame = {
+ yy + line*(fi.descent + fi.ascent + fi.leading), xx ,
+ yy + (line+1)*(fi.descent + fi.ascent + fi.leading) , xx + 10000 } ;
wxMacCFStringHolder mString( linetext , m_font.GetEncoding()) ;
if ( m_backgroundMode != wxTRANSPARENT )
{
wxMacCFStringHolder mString( linetext , m_font.GetEncoding()) ;
if ( m_backgroundMode != wxTRANSPARENT )
{
Rect background = frame ;
SInt16 baseline ;
::GetThemeTextDimensions( mString,
Rect background = frame ;
SInt16 baseline ;
::GetThemeTextDimensions( mString,
::DrawThemeTextBox( mString,
m_font.MacGetThemeFontID() ,
kThemeStateActive,
false,
&frame,
teJustLeft,
::DrawThemeTextBox( mString,
m_font.MacGetThemeFontID() ,
kThemeStateActive,
false,
&frame,
teJustLeft,
-void wxDC::DoGetTextExtent( const wxString &strtext, wxCoord *width, wxCoord *height,
+void wxDC::DoGetTextExtent( const wxString &strtext, wxCoord *width, wxCoord *height,
#if TARGET_CARBON
bool useGetThemeText = ( GetThemeTextDimensions != (void*) kUnresolvedCFragSymbolAddress ) ;
if ( UMAGetSystemVersion() < 0x1000 || IsKindOf(CLASSINFO( wxPrinterDC ) ) || ((wxFont*)&m_font)->GetNoAntiAliasing() )
useGetThemeText = false ;
#endif
#if TARGET_CARBON
bool useGetThemeText = ( GetThemeTextDimensions != (void*) kUnresolvedCFragSymbolAddress ) ;
if ( UMAGetSystemVersion() < 0x1000 || IsKindOf(CLASSINFO( wxPrinterDC ) ) || ((wxFont*)&m_font)->GetNoAntiAliasing() )
useGetThemeText = false ;
#endif
SInt16 baseline ;
wxMacCFStringHolder mString( linetext , m_font.GetEncoding() ) ;
ThemeFontID themeFont = m_font.MacGetThemeFontID() ;
SInt16 baseline ;
wxMacCFStringHolder mString( linetext , m_font.GetEncoding() ) ;
ThemeFontID themeFont = m_font.MacGetThemeFontID() ;
wxCharBuffer text = linetext.mb_str(wxConvLocal) ;
curwidth = ::TextWidth( text , 0 , strlen(text) ) ;
}
wxCharBuffer text = linetext.mb_str(wxConvLocal) ;
curwidth = ::TextWidth( text , 0 , strlen(text) ) ;
}
#if TARGET_CARBON
bool useGetThemeText = ( GetThemeTextDimensions != (void*) kUnresolvedCFragSymbolAddress ) ;
if ( UMAGetSystemVersion() < 0x1000 || IsKindOf(CLASSINFO( wxPrinterDC ) ) || ((wxFont*)&m_font)->GetNoAntiAliasing() )
#if TARGET_CARBON
bool useGetThemeText = ( GetThemeTextDimensions != (void*) kUnresolvedCFragSymbolAddress ) ;
if ( UMAGetSystemVersion() < 0x1000 || IsKindOf(CLASSINFO( wxPrinterDC ) ) || ((wxFont*)&m_font)->GetNoAntiAliasing() )
// If anybody knows how to do this more efficiently yet still handle
// the fractional glyph widths that may be present when using AA
// fonts, please change it. Currently it is measuring from the
// If anybody knows how to do this more efficiently yet still handle
// the fractional glyph widths that may be present when using AA
// fonts, please change it. Currently it is measuring from the
::GetThemeTextDimensions( mString,
m_font.MacGetThemeFontID(),
kThemeStateActive,
::GetThemeTextDimensions( mString,
m_font.MacGetThemeFontID(),
kThemeStateActive,
// Copy to widths, starting at measurements[1]
// NOTE: this doesn't take into account any multi-byte characters
// Copy to widths, starting at measurements[1]
// NOTE: this doesn't take into account any multi-byte characters
#if TARGET_CARBON
bool useGetThemeText = ( GetThemeTextDimensions != (void*) kUnresolvedCFragSymbolAddress ) ;
if ( UMAGetSystemVersion() < 0x1000 || ((wxFont*)&m_font)->GetNoAntiAliasing() )
useGetThemeText = false ;
#if TARGET_CARBON
bool useGetThemeText = ( GetThemeTextDimensions != (void*) kUnresolvedCFragSymbolAddress ) ;
if ( UMAGetSystemVersion() < 0x1000 || ((wxFont*)&m_font)->GetNoAntiAliasing() )
useGetThemeText = false ;
SInt16 baseline ;
CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text , 1 , CFStringGetSystemEncoding(), false ) ;
::GetThemeTextDimensions( mString,
SInt16 baseline ;
CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text , 1 , CFStringGetSystemEncoding(), false ) ;
::GetThemeTextDimensions( mString,
wxMacFastPortSetter helper(this) ;
Rect rect = { -31000 , -31000 , 31000 , 31000 } ;
wxMacFastPortSetter helper(this) ;
Rect rect = { -31000 , -31000 , 31000 , 31000 } ;
void wxDC::MacInstallFont() const
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
void wxDC::MacInstallFont() const
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
// case wxSRC_OR: // source _bitmap_ OR destination
// case wxSRC_AND: // source _bitmap_ AND destination
break ;
// case wxSRC_OR: // source _bitmap_ OR destination
// case wxSRC_AND: // source _bitmap_ AND destination
break ;
::PenMode( mode ) ;
OSStatus status = noErr ;
status = ATSUCreateAndCopyStyle( (ATSUStyle) m_font.MacGetATSUStyle() , (ATSUStyle*) &m_macATSUIStyle ) ;
::PenMode( mode ) ;
OSStatus status = noErr ;
status = ATSUCreateAndCopyStyle( (ATSUStyle) m_font.MacGetATSUStyle() , (ATSUStyle*) &m_macATSUIStyle ) ;
status = ::ATSUSetAttributes((ATSUStyle)m_macATSUIStyle, sizeof(atsuTags)/sizeof(ATSUAttributeTag) ,
atsuTags, atsuSizes, atsuValues);
status = ::ATSUSetAttributes((ATSUStyle)m_macATSUIStyle, sizeof(atsuTags)/sizeof(ATSUAttributeTag) ,
atsuTags, atsuSizes, atsuValues);
{ { 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF } } ,
{ { 0x01 , 0x02 , 0x04 , 0x08 , 0x10 , 0x20 , 0x40 , 0x80 } } ,
{ { 0x80 , 0x40 , 0x20 , 0x10 , 0x08 , 0x04 , 0x02 , 0x01 } } ,
{ { 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF } } ,
{ { 0x01 , 0x02 , 0x04 , 0x08 , 0x10 , 0x20 , 0x40 , 0x80 } } ,
{ { 0x80 , 0x40 , 0x20 , 0x10 , 0x08 , 0x04 , 0x02 , 0x01 } } ,
{ { 0x00 , 0x00 , 0x00 , 0xFF , 0x00 , 0x00 , 0x00 , 0x00 } } ,
{ { 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 } } ,
{ { 0x81 , 0x42 , 0x24 , 0x18 , 0x18 , 0x24 , 0x42 , 0x81 } } ,
{ { 0x00 , 0x00 , 0x00 , 0xFF , 0x00 , 0x00 , 0x00 , 0x00 } } ,
{ { 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 , 0x10 } } ,
{ { 0x81 , 0x42 , 0x24 , 0x18 , 0x18 , 0x24 , 0x42 , 0x81 } } ,
// dash patterns
{ { 0xCC , 0x99 , 0x33 , 0x66 , 0xCC , 0x99 , 0x33 , 0x66 } } , // DOT
{ { 0xFE , 0xFD , 0xFB , 0xF7 , 0xEF , 0xDF , 0xBF , 0x7F } } , // LONG_DASH
// dash patterns
{ { 0xCC , 0x99 , 0x33 , 0x66 , 0xCC , 0x99 , 0x33 , 0x66 } } , // DOT
{ { 0xFE , 0xFD , 0xFB , 0xF7 , 0xEF , 0xDF , 0xBF , 0x7F } } , // LONG_DASH
static void wxMacGetPattern(int penStyle, Pattern *pattern)
{
int index = 0; // solid pattern by default
static void wxMacGetPattern(int penStyle, Pattern *pattern)
{
int index = 0; // solid pattern by default
case wxHORIZONTAL_HATCH: index = 4; break;
case wxVERTICAL_HATCH: index = 5; break;
case wxCROSSDIAG_HATCH: index = 6; break;
case wxHORIZONTAL_HATCH: index = 4; break;
case wxVERTICAL_HATCH: index = 5; break;
case wxCROSSDIAG_HATCH: index = 6; break;
// dashes
case wxDOT: index = 7; break;
case wxLONG_DASH: index = 8; break;
case wxSHORT_DASH: index = 9; break;
case wxDOT_DASH: index = 10; break;
// dashes
case wxDOT: index = 7; break;
case wxLONG_DASH: index = 8; break;
case wxSHORT_DASH: index = 9; break;
case wxDOT_DASH: index = 10; break;
RGBColor forecolor = MAC_WXCOLORREF( m_pen.GetColour().GetPixel());
RGBColor backcolor = MAC_WXCOLORREF( m_backgroundBrush.GetColour().GetPixel());
::RGBForeColor( &forecolor );
::RGBBackColor( &backcolor );
::PenNormal() ;
RGBColor forecolor = MAC_WXCOLORREF( m_pen.GetColour().GetPixel());
RGBColor backcolor = MAC_WXCOLORREF( m_backgroundBrush.GetColour().GetPixel());
::RGBForeColor( &forecolor );
::RGBBackColor( &backcolor );
::PenNormal() ;
// case wxSRC_OR: // source _bitmap_ OR destination
// case wxSRC_AND: // source _bitmap_ AND destination
break ;
// case wxSRC_OR: // source _bitmap_ OR destination
// case wxSRC_AND: // source _bitmap_ AND destination
break ;
case kwxMacBrushThemeBackground :
{
Rect extent ;
ThemeBackgroundKind bg = background.MacGetThemeBackground( &extent ) ;
case kwxMacBrushThemeBackground :
{
Rect extent ;
ThemeBackgroundKind bg = background.MacGetThemeBackground( &extent ) ;
- ::ApplyThemeBackground( bg , &extent ,kThemeStateActive , wxDisplayDepth() , true ) ;
- break ;
+ ::ApplyThemeBackground( bg , &extent, kThemeStateActive , wxDisplayDepth() , true ) ;
void wxDC::MacInstallBrush() const
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
void wxDC::MacInstallBrush() const
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
bool backgroundTransparent = (GetBackgroundMode() == wxTRANSPARENT) ;
::RGBForeColor( &MAC_WXCOLORREF( m_brush.GetColour().GetPixel()) );
::RGBBackColor( &MAC_WXCOLORREF( m_backgroundBrush.GetColour().GetPixel()) );
bool backgroundTransparent = (GetBackgroundMode() == wxTRANSPARENT) ;
::RGBForeColor( &MAC_WXCOLORREF( m_brush.GetColour().GetPixel()) );
::RGBBackColor( &MAC_WXCOLORREF( m_backgroundBrush.GetColour().GetPixel()) );
- ::PenPat(GetQDGlobalsBlack(&blackColor));
+ switch ( m_brush.MacGetBrushKind() )
+ {
+ case kwxMacBrushTheme :
+ {
+ Pattern whiteColor ;
+ ::BackPat(GetQDGlobalsWhite(&whiteColor));
+ ::SetThemePen( m_brush.MacGetTheme() , wxDisplayDepth() , true ) ;
+ }
+ break ;
+
+ default :
+ ::PenPat(GetQDGlobalsBlack(&blackColor));
+ break ;
+
+ }
// for these the text fore (and back for MASK_OPAQUE) colors are used
wxBitmap* bitmap = m_brush.GetStipple() ;
int width = bitmap->GetWidth() ;
int height = bitmap->GetHeight() ;
GWorldPtr gw = NULL ;
// for these the text fore (and back for MASK_OPAQUE) colors are used
wxBitmap* bitmap = m_brush.GetStipple() ;
int width = bitmap->GetWidth() ;
int height = bitmap->GetHeight() ;
GWorldPtr gw = NULL ;
if ( m_brush.GetStyle() == wxSTIPPLE )
gw = MAC_WXHBITMAP(bitmap->GetHBITMAP(NULL)) ;
else
gw = MAC_WXHBITMAP(bitmap->GetMask()->GetHBITMAP()) ;
if ( m_brush.GetStyle() == wxSTIPPLE )
gw = MAC_WXHBITMAP(bitmap->GetHBITMAP(NULL)) ;
else
gw = MAC_WXHBITMAP(bitmap->GetMask()->GetHBITMAP()) ;
PixMapHandle gwpixmaphandle = GetGWorldPixMap( gw ) ;
LockPixels( gwpixmaphandle ) ;
bool isMonochrome = !IsPortColor( gw ) ;
PixMapHandle gwpixmaphandle = GetGWorldPixMap( gw ) ;
LockPixels( gwpixmaphandle ) ;
bool isMonochrome = !IsPortColor( gw ) ;
if ( isMonochrome && width == 8 && height == 8 )
{
::RGBForeColor( &MAC_WXCOLORREF( m_textForegroundColour.GetPixel()) );
if ( isMonochrome && width == 8 && height == 8 )
{
::RGBForeColor( &MAC_WXCOLORREF( m_textForegroundColour.GetPixel()) );
PixPatHandle pixpat = NewPixPat() ;
CopyPixMap(gwpixmaphandle, (**pixpat).patMap);
imageSize = GetPixRowBytes((**pixpat).patMap) *
PixPatHandle pixpat = NewPixPat() ;
CopyPixMap(gwpixmaphandle, (**pixpat).patMap);
imageSize = GetPixRowBytes((**pixpat).patMap) *
(**(**pixpat).patMap).bounds.top);
PtrToHand( (**gwpixmaphandle).baseAddr, &image, imageSize );
(**pixpat).patData = image;
(**(**pixpat).patMap).bounds.top);
PtrToHand( (**gwpixmaphandle).baseAddr, &image, imageSize );
(**pixpat).patData = image;
// case wxSRC_OR: // source _bitmap_ OR destination
// case wxSRC_AND: // source _bitmap_ AND destination
break ;
// case wxSRC_OR: // source _bitmap_ OR destination
// case wxSRC_AND: // source _bitmap_ AND destination
break ;