m_internalDeviceOriginX = 0;
m_internalDeviceOriginY = 0;
m_externalDeviceOriginX = 0;
m_externalDeviceOriginY = 0;
m_internalDeviceOriginX = 0;
m_internalDeviceOriginY = 0;
m_externalDeviceOriginX = 0;
m_externalDeviceOriginY = 0;
m_macFontInstalled = false ;
m_macBrushInstalled = false ;
m_macPenInstalled = false ;
m_macFontInstalled = false ;
m_macBrushInstalled = false ;
m_macPenInstalled = false ;
m_macLocalOrigin.x = m_macLocalOrigin.y = 0 ;
m_macBoundaryClipRgn = NewRgn() ;
m_macCurrentClipRgn = NewRgn() ;
m_macLocalOrigin.x = m_macLocalOrigin.y = 0 ;
m_macBoundaryClipRgn = NewRgn() ;
m_macCurrentClipRgn = NewRgn() ;
void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
void wxDC::DoDrawBitmap( const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask )
{
wxCHECK_RET( Ok(), wxT("invalid window dc") );
wxCoord xx = XLOG2DEVMAC(x);
wxCoord yy = YLOG2DEVMAC(y);
wxCoord w = bmp.GetWidth();
wxCoord h = bmp.GetHeight();
wxCoord ww = XLOG2DEVREL(w);
wxCoord hh = YLOG2DEVREL(h);
wxCoord xx = XLOG2DEVMAC(x);
wxCoord yy = YLOG2DEVMAC(y);
wxCoord w = bmp.GetWidth();
wxCoord h = bmp.GetHeight();
wxCoord ww = XLOG2DEVREL(w);
wxCoord hh = YLOG2DEVREL(h);
if ( bmp.GetBitmapType() == kMacBitmapTypePict ) {
Rect bitmaprect = { 0 , 0 , hh, ww };
::OffsetRect( &bitmaprect, xx, yy ) ;
if ( bmp.GetBitmapType() == kMacBitmapTypePict ) {
Rect bitmaprect = { 0 , 0 , hh, ww };
::OffsetRect( &bitmaprect, xx, yy ) ;
wxCHECK_RET(LockPixels(bmappixels),
wxT("DoDrawBitmap: Unable to lock pixels"));
wxCHECK_RET(LockPixels(bmappixels),
wxT("DoDrawBitmap: Unable to lock pixels"));
Rect source = { 0, 0, h, w };
Rect dest = { yy, xx, yy + hh, xx + ww };
Rect source = { 0, 0, h, w };
Rect dest = { yy, xx, yy + hh, xx + ww };
if ( useMask && bmp.GetMask() )
{
if( LockPixels(GetGWorldPixMap(MAC_WXHBITMAP(bmp.GetMask()->GetMaskBitmap()))))
if ( useMask && bmp.GetMask() )
{
if( LockPixels(GetGWorldPixMap(MAC_WXHBITMAP(bmp.GetMask()->GetMaskBitmap()))))
void wxDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y )
{
wxCHECK_RET(Ok(), wxT("Invalid dc wxDC::DoDrawIcon"));
void wxDC::DoDrawIcon( const wxIcon &icon, wxCoord x, wxCoord y )
{
wxCHECK_RET(Ok(), wxT("Invalid dc wxDC::DoDrawIcon"));
DoDrawBitmap( icon , x , y , icon.GetMask() != NULL ) ;
}
void wxDC::DoSetClippingRegion( wxCoord x, wxCoord y, wxCoord width, wxCoord height )
DoDrawBitmap( icon , x , y , icon.GetMask() != NULL ) ;
}
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 ) ;
wxMacPortSetter helper(this) ;
CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
m_clipping = FALSE;
wxMacPortSetter helper(this) ;
CopyRgn( (RgnHandle) m_macBoundaryClipRgn , (RgnHandle) m_macCurrentClipRgn ) ;
m_clipping = FALSE;
m_deviceOriginX = m_internalDeviceOriginX + m_externalDeviceOriginX;
m_deviceOriginY = m_internalDeviceOriginY + m_externalDeviceOriginY;
m_deviceOriginX = m_internalDeviceOriginX + m_externalDeviceOriginX;
m_deviceOriginY = m_internalDeviceOriginY + m_externalDeviceOriginY;
if (m_scaleX != origScaleX || m_scaleY != origScaleY)
{
// this is a bit artificial, but we need to force wxDC to think
if (m_scaleX != origScaleX || m_scaleY != origScaleY)
{
// this is a bit artificial, but we need to force wxDC to think
-extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y,
+extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y,
const wxColour & col, int style);
bool wxDC::DoFloodFill(wxCoord x, wxCoord y,
const wxColour & col, int style);
bool wxDC::DoFloodFill(wxCoord x, wxCoord y,
return wxDoFloodFill(this, x, y, col, style);
}
return wxDoFloodFill(this, x, y, col, style);
}
{
wxCHECK_MSG( Ok(), false, wxT("wxDC::DoGetPixel Invalid DC") );
wxMacPortSetter helper(this) ;
{
wxCHECK_MSG( Ok(), false, wxT("wxDC::DoGetPixel Invalid DC") );
wxMacPortSetter helper(this) ;
void wxDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
void wxDC::DoDrawLine( wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2 )
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
wxCoord xx = XLOG2DEVMAC(x);
wxCoord yy = YLOG2DEVMAC(y);
wxCoord ww = m_signX * XLOG2DEVREL(w);
wxCoord xx = XLOG2DEVMAC(x);
wxCoord yy = YLOG2DEVMAC(y);
wxCoord ww = m_signX * XLOG2DEVREL(w);
void wxDC::DoDrawPoint( wxCoord x, wxCoord y )
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
void wxDC::DoDrawPoint( wxCoord x, wxCoord y )
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
wxCoord yy1 = YLOG2DEVMAC(y);
RGBColor pencolor = MAC_WXCOLORREF( m_pen.GetColour().GetPixel());
::SetCPixel( xx1,yy1,&pencolor) ;
wxCoord yy1 = YLOG2DEVMAC(y);
RGBColor pencolor = MAC_WXCOLORREF( m_pen.GetColour().GetPixel());
::SetCPixel( xx1,yy1,&pencolor) ;
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
wxMacPortSetter helper(this) ;
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
wxMacPortSetter helper(this) ;
wxCoord offset = ( (m_pen.GetWidth() == 0 ? 1 :
m_pen.GetWidth() ) * (wxCoord)m_scaleX - 1) / 2 ;
wxCoord x1, x2 , y1 , y2 ;
x1 = XLOG2DEVMAC(points[0].x + xoffset);
wxCoord offset = ( (m_pen.GetWidth() == 0 ? 1 :
m_pen.GetWidth() ) * (wxCoord)m_scaleX - 1) / 2 ;
wxCoord x1, x2 , y1 , y2 ;
x1 = XLOG2DEVMAC(points[0].x + xoffset);
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
wxMacPortSetter helper(this) ;
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
wxMacPortSetter helper(this) ;
wxCoord x1, x2 , y1 , y2 ;
wxCoord x1, x2 , y1 , y2 ;
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 } ;
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
wxMacPortSetter helper(this) ;
{
wxCHECK_RET(Ok(), wxT("Invalid DC"));
wxMacPortSetter helper(this) ;
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 } ;
{
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 Illegal dc"));
wxCHECK_MSG(source->Ok(), false, wxT("wxDC::DoBlit Illegal source DC"));
- CopyMask( GetPortBitMapForCopyBits( sourcePort ) ,
- GetPortBitMapForCopyBits( MAC_WXHBITMAP(source->m_macMask) ) ,
+ CopyMask( GetPortBitMapForCopyBits( sourcePort ) ,
+ GetPortBitMapForCopyBits( MAC_WXHBITMAP(source->m_macMask) ) ,
GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ) ,
&srcrect, &srcrect , &dstrect ) ;
UnlockPixels( GetGWorldPixMap( MAC_WXHBITMAP(source->m_macMask) ) ) ;
GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ) ,
&srcrect, &srcrect , &dstrect ) ;
UnlockPixels( GetGWorldPixMap( MAC_WXHBITMAP(source->m_macMask) ) ) ;
SetPort( (GrafPtr) sourcePort ) ;
GetCPixel( srcPoint.h , srcPoint.v , &srcColor) ;
SetPort( (GrafPtr) m_macPort ) ;
GetCPixel( dstPoint.h , dstPoint.v , &dstColor ) ;
SetPort( (GrafPtr) sourcePort ) ;
GetCPixel( srcPoint.h , srcPoint.v , &srcColor) ;
SetPort( (GrafPtr) m_macPort ) ;
GetCPixel( dstPoint.h , dstPoint.v , &dstColor ) ;
wxMacCalculateColour( logical_func , srcColor , dstColor ) ;
SetCPixel( dstPoint.h , dstPoint.v , &dstColor ) ;
}
wxMacCalculateColour( logical_func , srcColor , dstColor ) ;
SetCPixel( dstPoint.h , dstPoint.v , &dstColor ) ;
}
GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ) ,
&srcrect, &dstrect, mode, clipRgn ) ;
}
GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ) ,
&srcrect, &dstrect, mode, clipRgn ) ;
}
SetPort( (GrafPtr) sourcePort ) ;
GetCPixel( srcPoint.h , srcPoint.v , &srcColor) ;
SetPort( (GrafPtr) m_macPort ) ;
GetCPixel( dstPoint.h , dstPoint.v , &dstColor ) ;
SetPort( (GrafPtr) sourcePort ) ;
GetCPixel( srcPoint.h , srcPoint.v , &srcColor) ;
SetPort( (GrafPtr) m_macPort ) ;
GetCPixel( dstPoint.h , dstPoint.v , &dstColor ) ;
wxMacCalculateColour( logical_func , srcColor , dstColor ) ;
SetCPixel( dstPoint.h , dstPoint.v , &dstColor ) ;
}
wxMacCalculateColour( logical_func , srcColor , dstColor ) ;
SetCPixel( dstPoint.h , dstPoint.v , &dstColor ) ;
}
GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ) ,
&srcrect, &dstrect, mode, NULL ) ;
}
DisposeRgn( clipRgn ) ;
}
UnlockPixels( bmappixels ) ;
GetPortBitMapForCopyBits( MAC_WXHBITMAP(m_macPort) ) ,
&srcrect, &dstrect, mode, NULL ) ;
}
DisposeRgn( clipRgn ) ;
}
UnlockPixels( bmappixels ) ;
m_macPenInstalled = false ;
m_macBrushInstalled = false ;
m_macFontInstalled = false ;
m_macPenInstalled = false ;
m_macBrushInstalled = false ;
m_macFontInstalled = false ;
SetAntiAliasedTextEnabled(true, m_scaleY * font->m_macFontSize);
m_macAliasWasEnabled = true ;
}
SetAntiAliasedTextEnabled(true, m_scaleY * font->m_macFontSize);
m_macAliasWasEnabled = true ;
}
TECObjectRef ec;
status = TECCreateConverter(&ec, kTextEncodingMacRoman, kTextEncodingUnicodeDefault);
wxASSERT_MSG( status == noErr , "couldn't start converter" ) ;
TECObjectRef ec;
status = TECCreateConverter(&ec, kTextEncodingMacRoman, kTextEncodingUnicodeDefault);
wxASSERT_MSG( status == noErr , "couldn't start converter" ) ;
ByteCount byteOutLen ;
ByteCount byteInLen = text.Length() ;
ByteCount byteBufferLen = byteInLen *2 ;
char* buf = new char[byteBufferLen] ;
ByteCount byteOutLen ;
ByteCount byteInLen = text.Length() ;
ByteCount byteBufferLen = byteInLen *2 ;
char* buf = new char[byteBufferLen] ;
-
- status = TECConvertText(ec, (ConstTextPtr)text.c_str() , byteInLen, &byteInLen,
+
+ status = TECConvertText(ec, (ConstTextPtr)text.c_str() , byteInLen, &byteInLen,
wxASSERT_MSG( status == noErr , "couldn't convert text" ) ;
status = TECDisposeConverter(ec);
wxASSERT_MSG( status == noErr , "couldn't dispose converter" ) ;
wxASSERT_MSG( status == noErr , "couldn't convert text" ) ;
status = TECDisposeConverter(ec);
wxASSERT_MSG( status == noErr , "couldn't dispose converter" ) ;
ATSUTextLayout atsuLayout ;
UniCharCount chars = byteOutLen / 2 ;
status = ::ATSUCreateTextLayoutWithTextPtr( (UniCharArrayPtr) buf , 0 , byteOutLen / 2 , byteOutLen / 2 , 1 ,
ATSUTextLayout atsuLayout ;
UniCharCount chars = byteOutLen / 2 ;
status = ::ATSUCreateTextLayoutWithTextPtr( (UniCharArrayPtr) buf , 0 , byteOutLen / 2 , byteOutLen / 2 , 1 ,
status = ::ATSUMeasureTextImage( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
IntToFixed(XLOG2DEVMAC(x) ) , IntToFixed(YLOG2DEVMAC(y) ) , &rect );
wxASSERT_MSG( status == noErr , "couldn't measure the rotated text" );
status = ::ATSUMeasureTextImage( atsuLayout, kATSUFromTextBeginning, kATSUToTextEnd,
IntToFixed(XLOG2DEVMAC(x) ) , IntToFixed(YLOG2DEVMAC(y) ) , &rect );
wxASSERT_MSG( status == noErr , "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) );
OffsetRect( &rect , -m_macLocalOrigin.x , -m_macLocalOrigin.y ) ;
CalcBoundingBox(XDEV2LOG(rect.left), YDEV2LOG(rect.top) );
CalcBoundingBox(XDEV2LOG(rect.right), YDEV2LOG(rect.bottom) );
wxCHECK_RET(Ok(), wxT("wxDC::DoDrawText Invalid DC"));
wxMacPortSetter helper(this) ;
long xx = XLOG2DEVMAC(x);
long yy = YLOG2DEVMAC(y);
wxCHECK_RET(Ok(), wxT("wxDC::DoDrawText Invalid DC"));
wxMacPortSetter helper(this) ;
long xx = XLOG2DEVMAC(x);
long yy = YLOG2DEVMAC(y);
{
m_macFormerAliasState = IsAntiAliasedTextEnabled(&m_macFormerAliasSize);
SetAntiAliasedTextEnabled(true, 8);
m_macAliasWasEnabled = true ;
}
{
m_macFormerAliasState = IsAntiAliasedTextEnabled(&m_macFormerAliasSize);
SetAntiAliasedTextEnabled(true, 8);
m_macAliasWasEnabled = true ;
}
wxCHECK_RET(Ok(), wxT("Invalid DC"));
wxMacPortSetter helper(this) ;
wxCHECK_RET(Ok(), wxT("Invalid DC"));
wxMacPortSetter helper(this) ;
- wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ;
-
- if ( font )
- {
- ::TextFont( font->m_macFontNum ) ;
- ::TextSize( YLOG2DEVREL( font->m_macFontSize) ) ;
- ::TextFace( font->m_macFontStyle ) ;
- }
- }
- else
- {
- MacInstallFont() ;
+ // work around the constness
+ *((wxFont*)(&m_font)) = *theFont ;
- curwidth = ::TextWidth( text , laststop , i - laststop ) ;
+#if TARGET_CARBON
+ if ( useGetThemeText )
+ {
+ Point bounds={0,0} ;
+ SInt16 baseline ;
+ CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text + laststop , i - laststop , CFStringGetSystemEncoding(), false ) ;
+ ::GetThemeTextDimensions( mString,
+ kThemeCurrentPortFont,
+ kThemeStateActive,
+ false,
+ &bounds,
+ &baseline );
+ CFRelease( mString ) ;
+ curwidth = bounds.h ;
+ }
+ else
+#endif
+ {
+ curwidth = ::TextWidth( text , laststop , i - laststop ) ;
+ }
- curwidth = ::TextWidth( text , laststop , i - laststop ) ;
+#if TARGET_CARBON
+ if ( useGetThemeText )
+ {
+ Point bounds={0,0} ;
+ SInt16 baseline ;
+ CFStringRef mString = CFStringCreateWithBytes( NULL , (UInt8*) text + laststop , i - laststop , CFStringGetSystemEncoding(), false ) ;
+ ::GetThemeTextDimensions( mString,
+ kThemeCurrentPortFont,
+ kThemeStateActive,
+ false,
+ &bounds,
+ &baseline );
+ CFRelease( mString ) ;
+ curwidth = bounds.h ;
+ }
+ else
+#endif
+ {
+ curwidth = ::TextWidth( text , laststop , i - laststop ) ;
+ }
wxCoord wxDC::GetCharWidth(void) const
{
wxCHECK_MSG(Ok(), 1, wxT("Invalid DC"));
wxCoord wxDC::GetCharWidth(void) const
{
wxCHECK_MSG(Ok(), 1, wxT("Invalid DC"));
wxCoord wxDC::GetCharHeight(void) const
{
wxCHECK_MSG(Ok(), 1, wxT("Invalid DC"));
wxCoord wxDC::GetCharHeight(void) const
{
wxCHECK_MSG(Ok(), 1, wxT("Invalid DC"));
wxMacPortSetter helper(this) ;
Rect rect = { -31000 , -31000 , 31000 , 31000 } ;
wxMacPortSetter helper(this) ;
Rect rect = { -31000 , -31000 , 31000 , 31000 } ;
::TextFont( font->m_macFontNum ) ;
::TextSize( short(m_scaleY * font->m_macFontSize) ) ;
::TextFace( font->m_macFontStyle ) ;
::TextFont( font->m_macFontNum ) ;
::TextSize( short(m_scaleY * font->m_macFontSize) ) ;
::TextFace( font->m_macFontStyle ) ;
m_macFontInstalled = true ;
m_macBrushInstalled = false ;
m_macPenInstalled = false ;
m_macFontInstalled = true ;
m_macBrushInstalled = false ;
m_macPenInstalled = false ;
Style fontStyle ;
GetThemeFont(kThemeSmallSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ;
GetFNum( fontName, &fontId );
Style fontStyle ;
GetThemeFont(kThemeSmallSystemFont , GetApplicationScript() , fontName , &fontSize , &fontStyle ) ;
GetFNum( fontName, &fontId );
m_macFontInstalled = true ;
m_macBrushInstalled = false ;
m_macPenInstalled = false ;
m_macFontInstalled = true ;
m_macBrushInstalled = false ;
m_macPenInstalled = false ;
status = ::ATSUCreateStyle(&(ATSUStyle)m_macATSUIStyle) ;
wxASSERT_MSG( status == noErr , "couldn't create ATSU style" ) ;
status = ::ATSUCreateStyle(&(ATSUStyle)m_macATSUIStyle) ;
wxASSERT_MSG( status == noErr , "couldn't create ATSU style" ) ;
// sizeof( RGBColor ) ,
sizeof( BslnBaselineClass ) ,
sizeof( ATSUVerticalCharacterType),
// sizeof( RGBColor ) ,
sizeof( BslnBaselineClass ) ,
sizeof( ATSUVerticalCharacterType),
(qdStyle & condense) ? &kTrue : &kFalse ,
(qdStyle & extend) ? &kTrue : &kFalse ,
} ;
(qdStyle & condense) ? &kTrue : &kFalse ,
(qdStyle & extend) ? &kTrue : &kFalse ,
} ;
-
- status = ::ATSUSetAttributes((ATSUStyle)m_macATSUIStyle, sizeof(atsuTags)/sizeof(ATSUAttributeTag),
+
+ status = ::ATSUSetAttributes((ATSUStyle)m_macATSUIStyle, sizeof(atsuTags)/sizeof(ATSUAttributeTag),
atsuTags, atsuSizes, atsuValues);
wxASSERT_MSG( status == noErr , "couldn't set create ATSU style" ) ;
}
Pattern gHatchPatterns[] =
atsuTags, atsuSizes, atsuValues);
wxASSERT_MSG( status == noErr , "couldn't set create ATSU style" ) ;
}
Pattern gHatchPatterns[] =
{ 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 } ,
RGBColor backcolor = MAC_WXCOLORREF( m_backgroundBrush.GetColour().GetPixel());
::RGBForeColor( &forecolor );
::RGBBackColor( &backcolor );
RGBColor backcolor = MAC_WXCOLORREF( m_backgroundBrush.GetColour().GetPixel());
::RGBForeColor( &forecolor );
::RGBBackColor( &backcolor );
::PenNormal() ;
int penWidth = m_pen.GetWidth() * (int) m_scaleX ;
// null means only one pixel, at whatever resolution
if ( penWidth == 0 )
::PenNormal() ;
int penWidth = m_pen.GetWidth() * (int) m_scaleX ;
// null means only one pixel, at whatever resolution
if ( penWidth == 0 )
::PenSize(penWidth, penWidth);
int penStyle = m_pen.GetStyle();
::PenSize(penWidth, penWidth);
int penStyle = m_pen.GetStyle();
switch( m_logicalFunction )
{
case wxCOPY: // only foreground color, leave background (thus not patCopy)
switch( m_logicalFunction )
{
case wxCOPY: // only foreground color, leave background (thus not patCopy)
bool backgroundTransparent = (GetBackgroundMode() == wxTRANSPARENT) ;
::RGBForeColor( &MAC_WXCOLORREF( m_brush.GetColour().GetPixel()) );
bool backgroundTransparent = (GetBackgroundMode() == wxTRANSPARENT) ;
::RGBForeColor( &MAC_WXCOLORREF( m_brush.GetColour().GetPixel()) );
imageSize = GetPixRowBytes((**pixpat).patMap) *
((**(**pixpat).patMap).bounds.bottom -
(**(**pixpat).patMap).bounds.top);
imageSize = GetPixRowBytes((**pixpat).patMap) *
((**(**pixpat).patMap).bounds.bottom -
(**(**pixpat).patMap).bounds.top);
PtrToHand( (**gwpixmaphandle).baseAddr, &image, imageSize );
(**pixpat).patData = image;
if ( isMonochrome )
PtrToHand( (**gwpixmaphandle).baseAddr, &image, imageSize );
(**pixpat).patData = image;
if ( isMonochrome )