diff options
Diffstat (limited to 'vcl/aqua/source/gdi')
-rw-r--r-- | vcl/aqua/source/gdi/salatslayout.cxx | 126 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salatsuifontutils.cxx | 18 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salbmp.cxx | 108 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salcolorutils.cxx | 2 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salgdi.cxx | 102 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salgdiutils.cxx | 16 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salmathutils.cxx | 26 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salnativewidgets.cxx | 286 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salprn.cxx | 98 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salvd.cxx | 18 |
10 files changed, 400 insertions, 400 deletions
diff --git a/vcl/aqua/source/gdi/salatslayout.cxx b/vcl/aqua/source/gdi/salatslayout.cxx index f79da3559b35..d6abb0cf93dd 100644 --- a/vcl/aqua/source/gdi/salatslayout.cxx +++ b/vcl/aqua/source/gdi/salatslayout.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -43,11 +43,11 @@ public: ATSLayout( ATSUStyle&, float fFontScale ); virtual ~ATSLayout(); - virtual bool LayoutText( ImplLayoutArgs& ); - virtual void AdjustLayout( ImplLayoutArgs& ); - virtual void DrawText( SalGraphics& ) const; + virtual bool LayoutText( ImplLayoutArgs& ); + virtual void AdjustLayout( ImplLayoutArgs& ); + virtual void DrawText( SalGraphics& ) const; - virtual int GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, int&, + virtual int GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, int&, sal_Int32* pGlyphAdvances, int* pCharIndexes ) const; virtual long GetTextWidth() const; @@ -65,49 +65,49 @@ public: virtual void Simplify( bool bIsBase ); private: - ATSUStyle& mrATSUStyle; - ATSUTextLayout maATSULayout; - int mnCharCount; // ==mnEndCharPos-mnMinCharPos + ATSUStyle& mrATSUStyle; + ATSUTextLayout maATSULayout; + int mnCharCount; // ==mnEndCharPos-mnMinCharPos // to prevent ATS overflowing the Fixed16.16 values // ATS font requests get size limited by downscaling huge fonts // in these cases the font scale becomes something bigger than 1.0 - float mfFontScale; + float mfFontScale; private: - bool InitGIA( ImplLayoutArgs* pArgs = NULL ) const; - bool GetIdealX() const; - bool GetDeltaY() const; - void InvalidateMeasurements(); + bool InitGIA( ImplLayoutArgs* pArgs = NULL ) const; + bool GetIdealX() const; + bool GetDeltaY() const; + void InvalidateMeasurements(); - int Fixed2Vcl( Fixed ) const; // convert ATSU-Fixed units to VCL units - int AtsuPix2Vcl( int ) const; // convert ATSU-Pixel units to VCL units - Fixed Vcl2Fixed( int ) const; // convert VCL units to ATSU-Fixed units + int Fixed2Vcl( Fixed ) const; // convert ATSU-Fixed units to VCL units + int AtsuPix2Vcl( int ) const; // convert ATSU-Pixel units to VCL units + Fixed Vcl2Fixed( int ) const; // convert VCL units to ATSU-Fixed units // cached details about the resulting layout // mutable members since these details are all lazy initialized - mutable int mnGlyphCount; // glyph count - mutable Fixed mnCachedWidth; // cached value of resulting typographical width - int mnTrailingSpaceWidth; // in Pixels - - mutable ATSGlyphRef* mpGlyphIds; // ATSU glyph ids - mutable Fixed* mpCharWidths; // map relative charpos to charwidth - mutable int* mpChars2Glyphs; // map relative charpos to absolute glyphpos - mutable int* mpGlyphs2Chars; // map absolute glyphpos to absolute charpos - mutable bool* mpGlyphRTLFlags; // BiDi status for glyphs: true if RTL - mutable Fixed* mpGlyphAdvances; // contains glyph widths for the justified layout - mutable Fixed* mpGlyphOrigAdvs; // contains glyph widths for the unjustified layout - mutable Fixed* mpDeltaY; // vertical offset from the baseline + mutable int mnGlyphCount; // glyph count + mutable Fixed mnCachedWidth; // cached value of resulting typographical width + int mnTrailingSpaceWidth; // in Pixels + + mutable ATSGlyphRef* mpGlyphIds; // ATSU glyph ids + mutable Fixed* mpCharWidths; // map relative charpos to charwidth + mutable int* mpChars2Glyphs; // map relative charpos to absolute glyphpos + mutable int* mpGlyphs2Chars; // map absolute glyphpos to absolute charpos + mutable bool* mpGlyphRTLFlags; // BiDi status for glyphs: true if RTL + mutable Fixed* mpGlyphAdvances; // contains glyph widths for the justified layout + mutable Fixed* mpGlyphOrigAdvs; // contains glyph widths for the unjustified layout + mutable Fixed* mpDeltaY; // vertical offset from the baseline struct SubPortion { int mnMinCharPos, mnEndCharPos; Fixed mnXOffset; }; typedef std::vector<SubPortion> SubPortionVector; - mutable SubPortionVector maSubPortions; // Writer&ATSUI layouts can differ quite a bit... + mutable SubPortionVector maSubPortions; // Writer&ATSUI layouts can differ quite a bit... // storing details about fonts used in glyph-fallback for this layout - mutable class FallbackInfo* mpFallbackInfo; + mutable class FallbackInfo* mpFallbackInfo; // x-offset relative to layout origin // currently only used in RTL-layouts - mutable Fixed mnBaseAdv; + mutable Fixed mnBaseAdv; }; class FallbackInfo @@ -155,7 +155,7 @@ ATSLayout::~ATSLayout() if( maATSULayout ) ATSUDisposeTextLayout( maATSULayout ); - + delete[] mpGlyphRTLFlags; delete[] mpGlyphs2Chars; delete[] mpChars2Glyphs; @@ -181,7 +181,7 @@ inline int ATSLayout::Fixed2Vcl( Fixed nFixed ) const inline int ATSLayout::AtsuPix2Vcl( int nAtsuPixel) const { float fVclPixel = mfFontScale * nAtsuPixel; - fVclPixel += (fVclPixel>=0) ? +0.5 : -0.5; // prepare rounding to int + fVclPixel += (fVclPixel>=0) ? +0.5 : -0.5; // prepare rounding to int int nVclPixel = static_cast<int>( fVclPixel); return nVclPixel; } @@ -200,8 +200,8 @@ inline Fixed ATSLayout::Vcl2Fixed( int nPixel ) const * @param rArgs: contains array of char to be layouted, starting and ending position of the text to layout * * Typographic layout of text by using the style maATSUStyle - * - * @return : true if everything is ok + * + * @return : true if everything is ok **/ bool ATSLayout::LayoutText( ImplLayoutArgs& rArgs ) { @@ -211,7 +211,7 @@ bool ATSLayout::LayoutText( ImplLayoutArgs& rArgs ) maATSULayout = NULL; // Layout text - // set up our locals, verify parameters... + // set up our locals, verify parameters... DBG_ASSERT( (rArgs.mpStr!=NULL), "ATSLayout::LayoutText() with rArgs.mpStr==NULL !!!"); DBG_ASSERT( (mrATSUStyle!=NULL), "ATSLayout::LayoutText() with ATSUStyle==NULL !!!"); @@ -287,8 +287,8 @@ bool ATSLayout::LayoutText( ImplLayoutArgs& rArgs ) * @param rArgs: contains attributes relevant to do a text specific layout * * Adjust text layout by moving glyphs to match the requested logical widths - * - * @return : none + * + * @return : none **/ void ATSLayout::AdjustLayout( ImplLayoutArgs& rArgs ) { @@ -330,7 +330,7 @@ void ATSLayout::AdjustLayout( ImplLayoutArgs& rArgs ) // changing the layout will make all previous measurements invalid InvalidateMeasurements(); - + ATSUAttributeTag nTags[3]; ATSUAttributeValuePtr nVals[3]; ByteCount nBytes[3]; @@ -367,17 +367,17 @@ void ATSLayout::AdjustLayout( ImplLayoutArgs& rArgs ) * * Draw the layouted text to the CGContext * - * @return : none + * @return : none **/ void ATSLayout::DrawText( SalGraphics& rGraphics ) const { AquaSalGraphics& rAquaGraphics = static_cast<AquaSalGraphics&>(rGraphics); - - // short circuit if there is nothing to do + + // short circuit if there is nothing to do if( (mnCharCount <= 0) || !rAquaGraphics.CheckContext() ) return; - + // the view is vertically flipped => flipped glyphs // so apply a temporary transformation that it flips back // also compensate if the font was size limited @@ -469,7 +469,7 @@ void ATSLayout::DrawText( SalGraphics& rGraphics ) const * ATSLayout::GetNextGlyphs : Get info about next glyphs in the layout * * @param nLen: max number of char - * @param pGlyphs: returned array of glyph ids + * @param pGlyphs: returned array of glyph ids * @param rPos: returned x starting position * @param nStart: index of the first requested glyph * @param pGlyphAdvances: returned array of glyphs advances @@ -576,14 +576,14 @@ int ATSLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIDs, Point& rPos, int nCharPos = nStart + mnMinCharPos; *(pCharIndexes++) = nCharPos; } - + // stop at last glyph if( ++nStart >= mnGlyphCount ) break; // stop when next the x-position is unexpected if( !maSubPortions.empty() ) - break; // TODO: finish the complete sub-portion + break; // TODO: finish the complete sub-portion if( !pGlyphAdvances && mpGlyphOrigAdvs ) if( mpGlyphAdvances[nStart-1] != mpGlyphOrigAdvs[nStart-1] ) break; @@ -603,7 +603,7 @@ int ATSLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIDs, Point& rPos, int * * Get typographic bounds of the text * - * @return : text width + * @return : text width **/ long ATSLayout::GetTextWidth() const { @@ -680,7 +680,7 @@ long ATSLayout::FillDXArray( long* pDXArray ) const DBG_ASSERT( !mnTrailingSpaceWidth, "ATSLayout::FillDXArray() with nTSW!=0" ); // initialize details about the resulting layout - InitGIA(); + InitGIA(); // distribute the widths among the string elements int nPixWidth = 0; @@ -708,7 +708,7 @@ long ATSLayout::FillDXArray( long* pDXArray ) const * Measure the layouted text to find the typographical line break * the result is needed by the language specific line breaking * - * @return : string index corresponding to the suggested line break + * @return : string index corresponding to the suggested line break **/ int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) const { @@ -750,7 +750,7 @@ int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) cons // initial measurement of text break position UniCharArrayOffset nBreakPos = mnMinCharPos; - const ATSUTextMeasurement nATSUMaxWidth = Vcl2Fixed( nPixelWidth ); + const ATSUTextMeasurement nATSUMaxWidth = Vcl2Fixed( nPixelWidth ); if( nATSUMaxWidth <= 0xFFFF ) // #i108584# avoid ATSU rejecting the parameter return mnMinCharPos; // or do ATSUMaxWidth=0x10000; OSStatus eStatus = ATSUBreakLine( maATSULayout, mnMinCharPos, @@ -794,7 +794,7 @@ int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) cons * * Fill the array of positions of carets (for cursors and selections) * - * @return : none + * @return : none **/ void ATSLayout::GetCaretPositions( int nMaxIndex, long* pCaretXArray ) const { @@ -817,7 +817,7 @@ void ATSLayout::GetCaretPositions( int nMaxIndex, long* pCaretXArray ) const &aCaret0, &aCaret1, &bIsSplit ); if( eStatus != noErr ) continue; - const Fixed nFixedPos = mnBaseAdv + aCaret0.fX; + const Fixed nFixedPos = mnBaseAdv + aCaret0.fX; // convert the measurement to pixel units const int nPixelPos = Fixed2Vcl( nFixedPos ); // update previous trailing position @@ -838,7 +838,7 @@ void ATSLayout::GetCaretPositions( int nMaxIndex, long* pCaretXArray ) const * * Get ink bounds of the text * - * @return : measurement valid + * @return : measurement valid **/ bool ATSLayout::GetBoundRect( SalGraphics&, Rectangle& rVCLRect ) const { @@ -865,7 +865,7 @@ bool ATSLayout::GetBoundRect( SalGraphics&, Rectangle& rVCLRect ) const * ATSLayout::InitGIA() : get many informations about layouted text * * Fills arrays of information about the gylph layout previously done - * in ASTLayout::LayoutText() : glyph advance (width), glyph delta Y (from baseline), + * in ASTLayout::LayoutText() : glyph advance (width), glyph delta Y (from baseline), * mapping between glyph index and character index, chars widths * * @return : true if everything could be computed, otherwise false @@ -876,14 +876,14 @@ bool ATSLayout::InitGIA( ImplLayoutArgs* pArgs ) const if( mnGlyphCount >= 0 ) return true; mnGlyphCount = 0; - + // Workaround a bug in ATSUI with empty string if( mnCharCount <= 0 ) return false; // initialize character details - mpCharWidths = new Fixed[ mnCharCount ]; - mpChars2Glyphs = new int[ mnCharCount ]; + mpCharWidths = new Fixed[ mnCharCount ]; + mpChars2Glyphs = new int[ mnCharCount ]; for( int n = 0; n < mnCharCount; ++n ) { mpCharWidths[ n ] = 0; @@ -903,8 +903,8 @@ bool ATSLayout::InitGIA( ImplLayoutArgs* pArgs ) const // initialize glyph details mpGlyphIds = new ATSGlyphRef[ iLayoutDataCount ]; - mpGlyphAdvances = new Fixed[ iLayoutDataCount ]; - mpGlyphs2Chars = new int[ iLayoutDataCount ]; + mpGlyphAdvances = new Fixed[ iLayoutDataCount ]; + mpGlyphs2Chars = new int[ iLayoutDataCount ]; // measure details of the glyph layout Fixed nLeftPos = 0; @@ -916,7 +916,7 @@ bool ATSLayout::InitGIA( ImplLayoutArgs* pArgs ) const const int nRelativeIdx = (rALR.originalOffset / 2); if( i+1 < iLayoutDataCount ) mpCharWidths[ nRelativeIdx ] += pALR[i+1].realPos - rALR.realPos; - + // new glyph is available => finish measurement of old glyph if( mnGlyphCount > 0 ) mpGlyphAdvances[ mnGlyphCount-1 ] = rALR.realPos - nLeftPos; @@ -1058,17 +1058,17 @@ bool ATSLayout::GetDeltaY() const if( mpDeltaY == NULL ) return true; - + if( nDeltaCount != (ItemCount)mnGlyphCount ) { DBG_WARNING( "ATSLayout::GetDeltaY() : wrong deltaY count!" ); ATSUDirectReleaseLayoutDataArrayPtr( NULL, - kATSUDirectDataBaselineDeltaFixedArray, (void**)&mpDeltaY ); + kATSUDirectDataBaselineDeltaFixedArray, (void**)&mpDeltaY ); mpDeltaY = NULL; return false; } #endif - + return true; } diff --git a/vcl/aqua/source/gdi/salatsuifontutils.cxx b/vcl/aqua/source/gdi/salatsuifontutils.cxx index c11ca9764400..9884c4fb6486 100644 --- a/vcl/aqua/source/gdi/salatsuifontutils.cxx +++ b/vcl/aqua/source/gdi/salatsuifontutils.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -216,10 +216,10 @@ static bool GetDevFontAttributes( ATSUFontID nFontID, ImplDevFontAttributes& rDF return false; // all scalable fonts on this platform are subsettable - rDFA.mbSubsettable = true; - rDFA.mbEmbeddable = false; + rDFA.mbSubsettable = true; + rDFA.mbEmbeddable = false; - // prepare iterating over all name strings of the font + // prepare iterating over all name strings of the font ItemCount nFontNameCount = 0; rc = ATSUCountFontNames( nFontID, &nFontNameCount ); if( rc != noErr ) @@ -236,9 +236,9 @@ static bool GetDevFontAttributes( ATSUFontID nFontID, ImplDevFontAttributes& rDF { ByteCount nNameLength = 0; - FontNameCode eFontNameCode; - FontPlatformCode eFontNamePlatform; - FontScriptCode eFontNameScript; + FontNameCode eFontNameCode; + FontPlatformCode eFontNamePlatform; + FontScriptCode eFontNameScript; FontLanguageCode eFontNameLanguage; rc = ATSUGetIndFontName( nFontID, nNameIndex, 0, NULL, &nNameLength, &eFontNameCode, &eFontNamePlatform, &eFontNameScript, &eFontNameLanguage ); @@ -267,13 +267,13 @@ static bool GetDevFontAttributes( ATSUFontID nFontID, ImplDevFontAttributes& rDF case 0x30A: nNameValue += 0; // Win-UCS-4 eEncoding = RTL_TEXTENCODING_UCS4; break; - case 0x100: nNameValue += 21; // Mac Roman + case 0x100: nNameValue += 21; // Mac Roman eEncoding = RTL_TEXTENCODING_APPLE_ROMAN; break; case 0x300: nNameValue = 0; // Win Symbol encoded name! rDFA.mbSymbolFlag = true; // (often seen for symbol fonts) break; - default: nNameValue = 0; // ignore other encodings + default: nNameValue = 0; // ignore other encodings break; } diff --git a/vcl/aqua/source/gdi/salbmp.cxx b/vcl/aqua/source/gdi/salbmp.cxx index 3a37f6d32d39..9d14d686472f 100644 --- a/vcl/aqua/source/gdi/salbmp.cxx +++ b/vcl/aqua/source/gdi/salbmp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -136,7 +136,7 @@ bool AquaSalBitmap::Create( const SalBitmap& rSalBmp, USHORT nNewBitCount ) { const AquaSalBitmap& rSourceBitmap = static_cast<const AquaSalBitmap&>(rSalBmp); - if( isValidBitCount( nNewBitCount ) && rSourceBitmap.maUserBuffer.get() ) + if( isValidBitCount( nNewBitCount ) && rSourceBitmap.maUserBuffer.get() ) { mnBits = nNewBitCount; mnWidth = rSourceBitmap.mnWidth; @@ -258,17 +258,17 @@ bool AquaSalBitmap::AllocateUserData() switch( mnBits ) { - case 1: mnBytesPerRow = (mnWidth + 7) >> 3; break; - case 4: mnBytesPerRow = (mnWidth + 1) >> 1; break; - case 8: mnBytesPerRow = mnWidth; break; - case 16: mnBytesPerRow = mnWidth << 1; break; - case 24: mnBytesPerRow = (mnWidth << 1) + mnWidth; break; - case 32: mnBytesPerRow = mnWidth << 2; break; + case 1: mnBytesPerRow = (mnWidth + 7) >> 3; break; + case 4: mnBytesPerRow = (mnWidth + 1) >> 1; break; + case 8: mnBytesPerRow = mnWidth; break; + case 16: mnBytesPerRow = mnWidth << 1; break; + case 24: mnBytesPerRow = (mnWidth << 1) + mnWidth; break; + case 32: mnBytesPerRow = mnWidth << 2; break; default: DBG_ERROR("vcl::AquaSalBitmap::AllocateUserData(), illegal bitcount!"); } } - + try { if( mnBytesPerRow ) @@ -280,7 +280,7 @@ bool AquaSalBitmap::AllocateUserData() maUserBuffer.reset( NULL ); mnBytesPerRow = 0; } - + return maUserBuffer.get() != 0; } @@ -292,7 +292,7 @@ protected: sal_uInt8* pData; public: static ImplPixelFormat* GetFormat( sal_uInt16 nBits, const BitmapPalette& rPalette ); - + virtual void StartLine( sal_uInt8* pLine ) { pData = pLine; } virtual void SkipPixel( sal_uInt32 nPixel ) = 0; virtual ColorData ReadPixel() = 0; @@ -350,7 +350,7 @@ class ImplPixelFormat16 : public ImplPixelFormat protected: sal_uInt16* pData16; public: - + virtual void StartLine( sal_uInt8* pLine ) { pData16 = (sal_uInt16*)pLine; @@ -367,7 +367,7 @@ public: } virtual void WritePixel( ColorData nColor ) { - *pData++ = ((COLORDATA_RED( nColor ) & 0xf8 ) << 7 ) || + *pData++ = ((COLORDATA_RED( nColor ) & 0xf8 ) << 7 ) || ((COLORDATA_GREEN( nColor ) & 0xf8 ) << 2 ) || ((COLORDATA_BLUE( nColor ) & 0xf8 ) >> 3 ); } @@ -424,14 +424,14 @@ public: } virtual ColorData ReadPixel() { - const BitmapColor& rColor = mrPalette[( pData[mnX >> 1] >> mnShift) & 0x0f]; + const BitmapColor& rColor = mrPalette[( pData[mnX >> 1] >> mnShift) & 0x0f]; mnX++; mnShift ^= 4; return rColor.operator Color().GetColor(); } virtual void WritePixel( ColorData nColor ) { - const BitmapColor aColor( COLORDATA_RED( nColor ), COLORDATA_GREEN( nColor ), COLORDATA_BLUE( nColor ) ); + const BitmapColor aColor( COLORDATA_RED( nColor ), COLORDATA_GREEN( nColor ), COLORDATA_BLUE( nColor ) ); pData[mnX>>1] &= (0xf0 >> mnShift); pData[mnX>>1] |= (static_cast< sal_uInt8 >( mrPalette.GetBestIndex( aColor ) ) & 0x0f); mnX++; @@ -461,13 +461,13 @@ public: } virtual ColorData ReadPixel() { - const BitmapColor& rColor = mrPalette[ (pData[mnX >> 3 ] >> ( 7 - ( mnX & 7 ) )) & 1]; + const BitmapColor& rColor = mrPalette[ (pData[mnX >> 3 ] >> ( 7 - ( mnX & 7 ) )) & 1]; mnX++; return rColor.operator Color().GetColor(); } virtual void WritePixel( ColorData nColor ) { - const BitmapColor aColor( COLORDATA_RED( nColor ), COLORDATA_GREEN( nColor ), COLORDATA_BLUE( nColor ) ); + const BitmapColor aColor( COLORDATA_RED( nColor ), COLORDATA_GREEN( nColor ), COLORDATA_BLUE( nColor ) ); if( mrPalette.GetBestIndex( aColor ) & 1 ) pData[ mnX >> 3 ] |= 1 << ( 7 - ( mnX & 7 ) ); else @@ -487,7 +487,7 @@ ImplPixelFormat* ImplPixelFormat::GetFormat( sal_uInt16 nBits, const BitmapPalet case 24: return new ImplPixelFormat24; case 32: return new ImplPixelFormat32; } - + return 0; } @@ -549,7 +549,7 @@ void AquaSalBitmap::ConvertBitmapData( sal_uInt32 nWidth, sal_uInt32 nHeight, sal_uInt32 nX = nWidth; while( nX-- ) pD->WritePixel( pS->ReadPixel() ); - + pSrcData += nSrcBytesPerRow; pDestData += nDestBytesPerRow; } @@ -583,21 +583,21 @@ static struct pal_entry } const aImplSalSysPalEntryAry[ 16 ] = { -{ 0, 0, 0 }, -{ 0, 0, 0x80 }, -{ 0, 0x80, 0 }, -{ 0, 0x80, 0x80 }, -{ 0x80, 0, 0 }, +{ 0, 0, 0 }, +{ 0, 0, 0x80 }, +{ 0, 0x80, 0 }, +{ 0, 0x80, 0x80 }, +{ 0x80, 0, 0 }, { 0x80, 0, 0x80 }, -{ 0x80, 0x80, 0 }, +{ 0x80, 0x80, 0 }, { 0x80, 0x80, 0x80 }, { 0xC0, 0xC0, 0xC0 }, -{ 0, 0, 0xFF }, -{ 0, 0xFF, 0 }, -{ 0, 0xFF, 0xFF }, -{ 0xFF, 0, 0 }, +{ 0, 0, 0xFF }, +{ 0, 0xFF, 0 }, +{ 0, 0xFF, 0xFF }, +{ 0xFF, 0, 0 }, { 0xFF, 0, 0xFF }, -{ 0xFF, 0xFF, 0 }, +{ 0xFF, 0xFF, 0 }, { 0xFF, 0xFF, 0xFF } }; @@ -618,7 +618,7 @@ const BitmapPalette& GetDefaultPalette( int mnBits, bool bMonochrome ) aDefPalette256.SetEntryCount( 256 ); aDefPalette16.SetEntryCount( 16 ); aDefPalette2.SetEntryCount( 2 ); - + // Standard colors unsigned int i; for( i = 0; i < 16; i++ ) @@ -666,7 +666,7 @@ const BitmapPalette& GetDefaultPalette( int mnBits, bool bMonochrome ) BitmapBuffer* AquaSalBitmap::AcquireBuffer( bool bReadOnly ) { if( !maUserBuffer.get() ) -// || maContextBuffer.get() && (maUserBuffer.get() != maContextBuffer.get()) ) +// || maContextBuffer.get() && (maUserBuffer.get() != maContextBuffer.get()) ) { fprintf(stderr,"ASB::Acq(%dx%d,d=%d)\n",mnWidth,mnHeight,mnBits); // TODO: AllocateUserData(); @@ -682,14 +682,14 @@ BitmapBuffer* AquaSalBitmap::AcquireBuffer( bool bReadOnly ) pBuffer->mnBitCount = mnBits; switch( mnBits ) { - case 1: pBuffer->mnFormat = BMP_FORMAT_1BIT_MSB_PAL; break; - case 4: pBuffer->mnFormat = BMP_FORMAT_4BIT_MSN_PAL; break; - case 8: pBuffer->mnFormat = BMP_FORMAT_8BIT_PAL; break; - case 16: pBuffer->mnFormat = BMP_FORMAT_16BIT_TC_MSB_MASK; + case 1: pBuffer->mnFormat = BMP_FORMAT_1BIT_MSB_PAL; break; + case 4: pBuffer->mnFormat = BMP_FORMAT_4BIT_MSN_PAL; break; + case 8: pBuffer->mnFormat = BMP_FORMAT_8BIT_PAL; break; + case 16: pBuffer->mnFormat = BMP_FORMAT_16BIT_TC_MSB_MASK; pBuffer->maColorMask = ColorMask( k16BitRedColorMask, k16BitGreenColorMask, k16BitBlueColorMask ); break; - case 24: pBuffer->mnFormat = BMP_FORMAT_24BIT_TC_BGR; break; - case 32: pBuffer->mnFormat = BMP_FORMAT_32BIT_TC_ARGB; + case 24: pBuffer->mnFormat = BMP_FORMAT_24BIT_TC_BGR; break; + case 32: pBuffer->mnFormat = BMP_FORMAT_32BIT_TC_ARGB; pBuffer->maColorMask = ColorMask( k32BitRedColorMask, k32BitGreenColorMask, k32BitBlueColorMask ); break; } @@ -713,7 +713,7 @@ void AquaSalBitmap::ReleaseBuffer( BitmapBuffer* pBuffer, bool bReadOnly ) if( mxGraphicContext ) DestroyContext(); } - + delete pBuffer; } @@ -770,7 +770,7 @@ CGImageRef AquaSalBitmap::CreateWithMask( const AquaSalBitmap& rMask, if( !CGImageIsMask(xMask) || (CGImageGetColorSpace(xMask) != GetSalData()->mxGraySpace) ) { const CGRect xImageRect=CGRectMake( 0, 0, nWidth, nHeight );//the rect has no offset - + // create the alpha mask image fitting our image // TODO: is caching the full mask or the subimage mask worth it? int nMaskBytesPerRow = ((nWidth + 3) & ~3); @@ -785,13 +785,13 @@ CGImageRef AquaSalBitmap::CreateWithMask( const AquaSalBitmap& rMask, xMask = CGImageMaskCreate( nWidth, nHeight, 8, 8, nMaskBytesPerRow, xDataProvider, pDecode, false ); CFRelease( xDataProvider ); CFRelease( xMaskContext ); - } - + } + if( !xMask ) return xImage; // combine image and alpha mask - CGImageRef xMaskedImage = CGImageCreateWithMask( xImage, xMask ); + CGImageRef xMaskedImage = CGImageCreateWithMask( xImage, xMask ); CFRelease( xMask ); CFRelease( xImage ); return xMaskedImage; @@ -822,7 +822,7 @@ CGImageRef AquaSalBitmap::CreateColorMask( int nX, int nY, int nWidth, int nHeig sal_uInt8* pSource = maUserBuffer.get(); if( nY ) pSource += nY * mnBytesPerRow; - + int y = nHeight; while( y-- ) { @@ -853,7 +853,7 @@ CGImageRef AquaSalBitmap::CreateColorMask( int nX, int nY, int nWidth, int nHeig // ======================================================================= /** AquaSalBitmap::GetSystemData Get platform native image data from existing image - * + * * @param rData struct BitmapSystemData, defined in vcl/inc/bitmap.hxx * @return true if successful **/ @@ -863,7 +863,7 @@ bool AquaSalBitmap::GetSystemData( BitmapSystemData& rData ) if( !mxGraphicContext ) CreateContext(); - + if ( mxGraphicContext ) { bRet = true; @@ -875,9 +875,9 @@ bool AquaSalBitmap::GetSystemData( BitmapSystemData& rData ) * We need to hack things because VCL does not use kCGBitmapByteOrder32Host, while Cairo requires it. */ OSL_TRACE("AquaSalBitmap::%s(): kCGBitmapByteOrder32Host not found => inserting it.",__func__); - + CGImageRef xImage = CGBitmapContextCreateImage (mxGraphicContext); - + // re-create the context with single change: include kCGBitmapByteOrder32Host flag. CGContextRef mxGraphicContextNew = CGBitmapContextCreate( CGBitmapContextGetData(mxGraphicContext), CGBitmapContextGetWidth(mxGraphicContext), @@ -887,27 +887,27 @@ bool AquaSalBitmap::GetSystemData( BitmapSystemData& rData ) CGBitmapContextGetColorSpace(mxGraphicContext), CGBitmapContextGetBitmapInfo(mxGraphicContext) | kCGBitmapByteOrder32Host); CFRelease(mxGraphicContext); - + // Needs to be flipped CGContextSaveGState( mxGraphicContextNew ); CGContextTranslateCTM (mxGraphicContextNew, 0, CGBitmapContextGetHeight(mxGraphicContextNew)); CGContextScaleCTM (mxGraphicContextNew, 1.0, -1.0); - + CGContextDrawImage(mxGraphicContextNew, CGRectMake( 0, 0, CGImageGetWidth(xImage), CGImageGetHeight(xImage)), xImage); - + // Flip back CGContextRestoreGState( mxGraphicContextNew ); - + CGImageRelease( xImage ); mxGraphicContext = mxGraphicContextNew; - } + } #endif rData.rImageContext = (void *) mxGraphicContext; rData.mnWidth = mnWidth; rData.mnHeight = mnHeight; } - + return bRet; } diff --git a/vcl/aqua/source/gdi/salcolorutils.cxx b/vcl/aqua/source/gdi/salcolorutils.cxx index 664011b2684d..1c5408e7a981 100644 --- a/vcl/aqua/source/gdi/salcolorutils.cxx +++ b/vcl/aqua/source/gdi/salcolorutils.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx index 5061a90d41e2..4585699d12ee 100644 --- a/vcl/aqua/source/gdi/salgdi.cxx +++ b/vcl/aqua/source/gdi/salgdi.cxx @@ -68,11 +68,11 @@ typedef std::vector<unsigned char> ByteVector; ImplMacFontData::ImplMacFontData( const ImplDevFontAttributes& rDFA, ATSUFontID nFontId ) : ImplFontData( rDFA, 0 ) , mnFontId( nFontId ) -, mpCharMap( NULL ) -, mbOs2Read( false ) -, mbHasOs2Table( false ) -, mbCmapEncodingRead( false ) -, mbHasCJKSupport( false ) +, mpCharMap( NULL ) +, mbOs2Read( false ) +, mbHasOs2Table( false ) +, mbCmapEncodingRead( false ) +, mbHasCJKSupport( false ) {} // ----------------------------------------------------------------------- @@ -510,9 +510,9 @@ static void AddPolygonToPath( CGMutablePathRef xPath, bPendingCurve |= rPolygon.isPrevControlPointUsed( nClosedIdx ); } - if( !bPendingCurve ) // line segment + if( !bPendingCurve ) // line segment CGPathAddLineToPoint( xPath, pTransform, aPoint.getX(), aPoint.getY() ); - else // cubic bezier segment + else // cubic bezier segment { basegfx::B2DPoint aCP1 = rPolygon.getNextControlPoint( nPrevIdx ); basegfx::B2DPoint aCP2 = rPolygon.getPrevControlPoint( nClosedIdx ); @@ -1012,11 +1012,11 @@ bool AquaSalGraphics::drawPolyLine( const ::basegfx::B2DPolygon& rPolyLine, // setup line attributes CGLineJoin aCGLineJoin = kCGLineJoinMiter; switch( eLineJoin ) { - case ::basegfx::B2DLINEJOIN_NONE: aCGLineJoin = /*TODO?*/kCGLineJoinMiter; break; - case ::basegfx::B2DLINEJOIN_MIDDLE: aCGLineJoin = /*TODO?*/kCGLineJoinMiter; break; - case ::basegfx::B2DLINEJOIN_BEVEL: aCGLineJoin = kCGLineJoinBevel; break; - case ::basegfx::B2DLINEJOIN_MITER: aCGLineJoin = kCGLineJoinMiter; break; - case ::basegfx::B2DLINEJOIN_ROUND: aCGLineJoin = kCGLineJoinRound; break; + case ::basegfx::B2DLINEJOIN_NONE: aCGLineJoin = /*TODO?*/kCGLineJoinMiter; break; + case ::basegfx::B2DLINEJOIN_MIDDLE: aCGLineJoin = /*TODO?*/kCGLineJoinMiter; break; + case ::basegfx::B2DLINEJOIN_BEVEL: aCGLineJoin = kCGLineJoinBevel; break; + case ::basegfx::B2DLINEJOIN_MITER: aCGLineJoin = kCGLineJoinMiter; break; + case ::basegfx::B2DLINEJOIN_ROUND: aCGLineJoin = kCGLineJoinRound; break; } // setup poly-polygon path @@ -1167,7 +1167,7 @@ void AquaSalGraphics::copyArea( long nDstX, long nDstY,long nSrcX, long nSrcY, l // drawing a layer onto its own context causes trouble on OSX => copy it first // TODO: is it possible to get rid of this unneeded copy more often? // e.g. on OSX>=10.5 only this situation causes problems: - // mnBitmapDepth && (aDstPoint.x + pSrc->mnWidth) > mnWidth + // mnBitmapDepth && (aDstPoint.x + pSrc->mnWidth) > mnWidth CGLayerRef xSrcLayer = mxLayer; // TODO: if( mnBitmapDepth > 0 ) { @@ -1431,7 +1431,7 @@ BOOL AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, // NOTE: flip drawing, else the nsimage would be drawn upside down CGContextSaveGState( mrContext ); -// CGContextTranslateCTM( mrContext, 0, +mnHeight ); +// CGContextTranslateCTM( mrContext, 0, +mnHeight ); CGContextScaleCTM( mrContext, +1, -1 ); nY = /*mnHeight*/ - (nY + nHeight); @@ -1707,7 +1707,7 @@ bool AquaSalGraphics::AddTempDevFont( ImplDevFontList* pFontList, #else FSSpec aFontFSSpec; eStatus = ::FSGetCatalogInfo( &aNewRef, kFSCatInfoNone, - NULL, NULL, &aFontFSSpec, NULL ); + NULL, NULL, &aFontFSSpec, NULL ); if( eStatus != noErr ) return false; @@ -1773,7 +1773,7 @@ BOOL AquaSalGraphics::GetGlyphOutline( long nGlyphId, basegfx::B2DPolyPolygon& r aGgoData.mpPolyPoly = &rPolyPoly; rPolyPoly.clear(); - ATSUStyle rATSUStyle = maATSUStyle; // TODO: handle glyph fallback when CWS pdffix02 is integrated + ATSUStyle rATSUStyle = maATSUStyle; // TODO: handle glyph fallback when CWS pdffix02 is integrated OSStatus eGgoStatus = noErr; OSStatus eStatus = ATSUGlyphGetCubicPaths( rATSUStyle, nGlyphId, GgoMoveToProc, GgoLineToProc, GgoCurveToProc, GgoClosePathProc, @@ -1811,7 +1811,7 @@ long AquaSalGraphics::GetGraphicsWidth() const BOOL AquaSalGraphics::GetGlyphBoundRect( long nGlyphId, Rectangle& rRect ) { - ATSUStyle rATSUStyle = maATSUStyle; // TODO: handle glyph fallback + ATSUStyle rATSUStyle = maATSUStyle; // TODO: handle glyph fallback GlyphID aGlyphId = nGlyphId; ATSGlyphScreenMetrics aGlyphMetrics; OSStatus eStatus = ATSUGlyphGetScreenMetrics( rATSUStyle, @@ -1997,8 +1997,8 @@ static void FakeDirEntry( FourCharCode eFCC, ByteCount nOfs, ByteCount nLen, rpDest[ 2] = (char)(eFCC >> 8); rpDest[ 3] = (char)(eFCC >> 0); // TODO: get entry checksum and write it - // not too important since the subsetter doesn't care currently - // for( pData+nOfs ... pData+nOfs+nLen ) + // not too important since the subsetter doesn't care currently + // for( pData+nOfs ... pData+nOfs+nLen ) // write entry offset rpDest[ 8] = (char)(nOfs >> 24); rpDest[ 9] = (char)(nOfs >> 16); @@ -2036,34 +2036,34 @@ static bool GetRawFontData( const ImplFontData* pFontData, } // get font table availability and size in bytes - ByteCount nHeadLen = 0; + ByteCount nHeadLen = 0; eStatus = ATSFontGetTable( rFont, GetTag("head"), 0, 0, NULL, &nHeadLen); if( (eStatus != noErr) || (nHeadLen <= 0) ) return false; - ByteCount nMaxpLen = 0; + ByteCount nMaxpLen = 0; eStatus = ATSFontGetTable( rFont, GetTag("maxp"), 0, 0, NULL, &nMaxpLen); if( (eStatus != noErr) || (nMaxpLen <= 0) ) return false; - ByteCount nCmapLen = 0; + ByteCount nCmapLen = 0; eStatus = ATSFontGetTable( rFont, GetTag("cmap"), 0, 0, NULL, &nCmapLen); if( (eStatus != noErr) || (nCmapLen <= 0) ) return false; - ByteCount nNameLen = 0; + ByteCount nNameLen = 0; eStatus = ATSFontGetTable( rFont, GetTag("name"), 0, 0, NULL, &nNameLen); if( (eStatus != noErr) || (nNameLen <= 0) ) return false; - ByteCount nHheaLen = 0; + ByteCount nHheaLen = 0; eStatus = ATSFontGetTable( rFont, GetTag("hhea"), 0, 0, NULL, &nHheaLen); if( (eStatus != noErr) || (nHheaLen <= 0) ) return false; - ByteCount nHmtxLen = 0; + ByteCount nHmtxLen = 0; eStatus = ATSFontGetTable( rFont, GetTag("hmtx"), 0, 0, NULL, &nHmtxLen); if( (eStatus != noErr) || (nHmtxLen <= 0) ) return false; // get the glyph outline tables - ByteCount nLocaLen = 0; - ByteCount nGlyfLen = 0; + ByteCount nLocaLen = 0; + ByteCount nGlyfLen = 0; if( (eStatus != noErr) || (nCffLen <= 0) ) { eStatus = ATSFontGetTable( rFont, GetTag("loca"), 0, 0, NULL, &nLocaLen); @@ -2075,7 +2075,7 @@ static bool GetRawFontData( const ImplFontData* pFontData, } ByteCount nPrepLen=0, nCvtLen=0, nFpgmLen=0; - if( nGlyfLen ) // TODO: reduce PDF size by making hint subsetting optional + if( nGlyfLen ) // TODO: reduce PDF size by making hint subsetting optional { eStatus = ATSFontGetTable( rFont, GetTag("prep"), 0, 0, NULL, &nPrepLen); eStatus = ATSFontGetTable( rFont, GetTag("cvt "), 0, 0, NULL, &nCvtLen); @@ -2101,11 +2101,11 @@ static bool GetRawFontData( const ImplFontData* pFontData, { int nLog2 = 0; while( (nTableCount >> nLog2) > 1 ) ++nLog2; - rBuffer[ 1] = 1; // Win-TTF style scaler - rBuffer[ 5] = nTableCount; // table count - rBuffer[ 7] = nLog2*16; // searchRange - rBuffer[ 9] = nLog2; // entrySelector - rBuffer[11] = (nTableCount-nLog2)*16; // rangeShift + rBuffer[ 1] = 1; // Win-TTF style scaler + rBuffer[ 5] = nTableCount; // table count + rBuffer[ 7] = nLog2*16; // searchRange + rBuffer[ 9] = nLog2; // entrySelector + rBuffer[11] = (nTableCount-nLog2)*16; // rangeShift } // get font table raw data and update the fake directory entries @@ -2213,17 +2213,17 @@ BOOL AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile, ::GetTTGlobalFontInfo( pSftFont, &aTTInfo ); rInfo.m_nFontType = FontSubsetInfo::SFNT_TTF; rInfo.m_aPSName = String( aTTInfo.psname, RTL_TEXTENCODING_UTF8 ); - rInfo.m_aFontBBox = Rectangle( Point( aTTInfo.xMin, aTTInfo.yMin ), + rInfo.m_aFontBBox = Rectangle( Point( aTTInfo.xMin, aTTInfo.yMin ), Point( aTTInfo.xMax, aTTInfo.yMax ) ); - rInfo.m_nCapHeight = aTTInfo.yMax; // Well ... - rInfo.m_nAscent = +aTTInfo.winAscent; + rInfo.m_nCapHeight = aTTInfo.yMax; // Well ... + rInfo.m_nAscent = +aTTInfo.winAscent; rInfo.m_nDescent = -aTTInfo.winDescent; // mac fonts usually do not have an OS2-table // => get valid ascent/descent values from other tables if( !rInfo.m_nAscent ) - rInfo.m_nAscent = +aTTInfo.typoAscender; + rInfo.m_nAscent = +aTTInfo.typoAscender; if( !rInfo.m_nAscent ) - rInfo.m_nAscent = +aTTInfo.ascender; + rInfo.m_nAscent = +aTTInfo.ascender; if( !rInfo.m_nDescent ) rInfo.m_nDescent = +aTTInfo.typoDescender; if( !rInfo.m_nDescent ) @@ -2281,9 +2281,9 @@ BOOL AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile, ::GetTTSimpleGlyphMetrics( pSftFont, aShortIDs, nGlyphCount, bVertical ); if( !pGlyphMetrics ) return FALSE; - sal_uInt16 nNotDefAdv = pGlyphMetrics[0].adv; - pGlyphMetrics[0].adv = pGlyphMetrics[nNotDef].adv; - pGlyphMetrics[nNotDef].adv = nNotDefAdv; + sal_uInt16 nNotDefAdv = pGlyphMetrics[0].adv; + pGlyphMetrics[0].adv = pGlyphMetrics[nNotDef].adv; + pGlyphMetrics[nNotDef].adv = nNotDefAdv; for( int i = 0; i < nOrigCount; ++i ) pGlyphWidths[i] = pGlyphMetrics[i].adv; free( pGlyphMetrics ); @@ -2372,7 +2372,7 @@ const Ucs2SIntMap* AquaSalGraphics::GetFontEncodingVector( // ----------------------------------------------------------------------- -const void* AquaSalGraphics::GetEmbedFontData( const ImplFontData* pFontData, +const void* AquaSalGraphics::GetEmbedFontData( const ImplFontData* pFontData, const sal_Ucs* pUnicodes, sal_Int32* pWidths, FontSubsetInfo& rInfo, @@ -2386,7 +2386,7 @@ const void* AquaSalGraphics::GetEmbedFontData( const ImplFontData* pFontData, void AquaSalGraphics::FreeEmbedFontData( const void* pData, long nDataLen ) { // TODO: implementing this only makes sense when the implementation of - // AquaSalGraphics::GetEmbedFontData() returns non-NULL + // AquaSalGraphics::GetEmbedFontData() returns non-NULL DBG_ASSERT( (pData!=NULL), "AquaSalGraphics::FreeEmbedFontData() is not implemented\n"); } @@ -2502,14 +2502,14 @@ void AquaSalGraphics::ApplyXorContext() // ====================================================================== XorEmulation::XorEmulation() -: mxTargetLayer( NULL ) -, mxTargetContext( NULL ) -, mxMaskContext( NULL ) -, mxTempContext( NULL ) -, mpMaskBuffer( NULL ) -, mpTempBuffer( NULL ) -, mnBufferLongs( 0 ) -, mbIsEnabled( false ) +: mxTargetLayer( NULL ) +, mxTargetContext( NULL ) +, mxMaskContext( NULL ) +, mxTempContext( NULL ) +, mpMaskBuffer( NULL ) +, mpTempBuffer( NULL ) +, mnBufferLongs( 0 ) +, mbIsEnabled( false ) {} // ---------------------------------------------------------------------- diff --git a/vcl/aqua/source/gdi/salgdiutils.cxx b/vcl/aqua/source/gdi/salgdiutils.cxx index 56d40d3c7e72..6dd8317b8827 100644 --- a/vcl/aqua/source/gdi/salgdiutils.cxx +++ b/vcl/aqua/source/gdi/salgdiutils.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -60,7 +60,7 @@ void AquaSalGraphics::SetPrinterGraphics( CGContextRef xContext, long nDPIX, lon mbWindow = false; mbPrinter = true; mbVirDev = false; - + mrContext = xContext; mfFakeDPIScale = fScale; mnRealDPIX = nDPIX; @@ -90,7 +90,7 @@ void AquaSalGraphics::SetVirDevGraphics( CGLayerRef xLayer, CGContextRef xContex mbVirDev = true; // set graphics properties - mxLayer = xLayer; + mxLayer = xLayer; mrContext = xContext; mnBitmapDepth = nBitmapDepth; @@ -248,7 +248,7 @@ void AquaSalGraphics::RefreshRect(float lX, float lY, float lWidth, float lHeigh // this helps with antialiased rendering const Rectangle aVclRect(Point(static_cast<long int>(lX-1), static_cast<long int>(lY-1) ), - Size( static_cast<long int>(lWidth+2), + Size( static_cast<long int>(lWidth+2), static_cast<long int>(lHeight+2) ) ); mpFrame->maInvalidRect.Union( aVclRect ); } @@ -257,14 +257,14 @@ void AquaSalGraphics::RefreshRect(float lX, float lY, float lWidth, float lHeigh CGPoint* AquaSalGraphics::makeCGptArray(ULONG nPoints, const SalPoint* pPtAry) { CGPoint *CGpoints = new (CGPoint[nPoints]); - if ( CGpoints ) + if ( CGpoints ) { for(ULONG i=0;i<nPoints;i++) { - CGpoints[i].x = (float)(pPtAry[i].mnX); - CGpoints[i].y = (float)(pPtAry[i].mnY); + CGpoints[i].x = (float)(pPtAry[i].mnX); + CGpoints[i].y = (float)(pPtAry[i].mnY); } - } + } return CGpoints; } diff --git a/vcl/aqua/source/gdi/salmathutils.cxx b/vcl/aqua/source/gdi/salmathutils.cxx index 26516902c5c1..8a5612788429 100644 --- a/vcl/aqua/source/gdi/salmathutils.cxx +++ b/vcl/aqua/source/gdi/salmathutils.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -102,7 +102,7 @@ void ULSwap ( unsigned long &rX, unsigned long &rY ) // ----------------------------------------------------------------------- // // This way of measuring distance is also called the "Manhattan distance." -// Manhattan distance takes advantage of the fact that the sum of the +// Manhattan distance takes advantage of the fact that the sum of the // lengths of the three components of a 3D vector is a rough approxima- // tion of the vector's length. // @@ -111,7 +111,7 @@ void ULSwap ( unsigned long &rX, unsigned long &rY ) unsigned long Euclidian2Norm ( const LRectCoorVector pVec ) { unsigned long ndist = 0; - + if ( pVec ) { long nDX = 0; @@ -120,29 +120,29 @@ unsigned long Euclidian2Norm ( const LRectCoorVector pVec ) unsigned long nMax = 0; unsigned long nMed = 0; unsigned long nMin = 0; - + // Find |x'-x|, |y'-y|, and |z'-z| from (x,y,z) and (x',y',z') - + nDX = pVec[1].x - pVec[0].x; nDY = pVec[1].y - pVec[0].y; nDZ = pVec[1].z - pVec[0].z; - + nMax = (unsigned long)abs( nDX ); nMed = (unsigned long)abs( nDY ); nMin = (unsigned long)abs( nDZ ); - + // Sort them (3 compares, 0-3 swaps) - + if ( nMax < nMed ) { Swap( nMax, nMed ); } // if - + if ( nMax < nMin ) { Swap( nMax, nMin ); } // if - + // Approximate Euclidian distance: // // d = max + (11/32)*med + (1/4)*min @@ -150,11 +150,11 @@ unsigned long Euclidian2Norm ( const LRectCoorVector pVec ) // with +/- 8% error, where the exact formulae for d is // // || (x',y',z') - (x,y,z) || = { |x'-x|^2 + |y'-y|^2 + |z'-z|^2 }^(1/2) - - ndist = nMax + ( nMin >> 2UL ) + + ndist = nMax + ( nMin >> 2UL ) + ( ( ( nMed << 3UL ) + ( nMed << 1UL ) + nMed ) >> 5UL ); } // if - + return ndist; } // RGBDistance diff --git a/vcl/aqua/source/gdi/salnativewidgets.cxx b/vcl/aqua/source/gdi/salnativewidgets.cxx index 4e40bfa7077d..9d62a87dfdd5 100644 --- a/vcl/aqua/source/gdi/salnativewidgets.cxx +++ b/vcl/aqua/source/gdi/salnativewidgets.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -51,11 +51,11 @@ class AquaBlinker : public Timer { mpFrame->maBlinkers.push_back( this ); } - + public: - + static void Blink( AquaSalFrame*, const Rectangle&, int nTimeout = 80 ); - + virtual void Timeout() { Stop(); @@ -219,7 +219,7 @@ static bool AquaGetScrollRect( /* TODO: int nScreen, */ ControlPart nPart, if( GetSalData()->mbIsScrollbarDoubleMax ) rResultRect.Bottom() += 8; else - rResultRect.Bottom() += 4; + rResultRect.Bottom() += 4; break; case PART_TRACK_VERT_LOWER: if( GetSalData()->mbIsScrollbarDoubleMax ) @@ -267,25 +267,25 @@ BOOL AquaSalGraphics::IsNativeControlSupported( ControlType nType, ControlPart n nPart == HAS_THREE_BUTTONS ) return true; break; - + case CTRL_SLIDER: if( nPart == PART_TRACK_HORZ_AREA || nPart == PART_TRACK_VERT_AREA ) return true; break; - case CTRL_EDITBOX: + case CTRL_EDITBOX: if( nPart == PART_ENTIRE_CONTROL || nPart == HAS_BACKGROUND_TEXTURE ) return true; break; - case CTRL_MULTILINE_EDITBOX: + case CTRL_MULTILINE_EDITBOX: if( nPart == PART_ENTIRE_CONTROL || nPart == HAS_BACKGROUND_TEXTURE ) return true; break; - case CTRL_SPINBOX: + case CTRL_SPINBOX: if( nPart == PART_ENTIRE_CONTROL || nPart == PART_ALL_BUTTONS || nPart == HAS_BACKGROUND_TEXTURE ) @@ -420,14 +420,14 @@ BOOL AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart kThemeStatePressedUp = 2, kThemeStatePressedDown = 3 -#define CTRL_STATE_ENABLED 0x0001 -#define CTRL_STATE_FOCUSED 0x0002 -#define CTRL_STATE_PRESSED 0x0004 -#define CTRL_STATE_ROLLOVER 0x0008 -#define CTRL_STATE_HIDDEN 0x0010 -#define CTRL_STATE_DEFAULT 0x0020 -#define CTRL_STATE_SELECTED 0x0040 -#define CTRL_CACHING_ALLOWED 0x8000 // set when the control is completely visible (i.e. not clipped) +#define CTRL_STATE_ENABLED 0x0001 +#define CTRL_STATE_FOCUSED 0x0002 +#define CTRL_STATE_PRESSED 0x0004 +#define CTRL_STATE_ROLLOVER 0x0008 +#define CTRL_STATE_HIDDEN 0x0010 +#define CTRL_STATE_DEFAULT 0x0020 +#define CTRL_STATE_SELECTED 0x0040 +#define CTRL_CACHING_ALLOWED 0x8000 // set when the control is completely visible (i.e. not clipped) */ UInt32 AquaSalGraphics::getState( ControlState nState ) { @@ -463,9 +463,9 @@ UInt32 AquaSalGraphics::getTrackState( ControlState nState ) * * Draws the requested control described by nPart/nState. * - * rControlRegion: The bounding region of the complete control in VCL frame coordinates. - * aValue: An optional value (tristate/numerical/string) - * aCaption: A caption or title string (like button text etc) + * rControlRegion: The bounding region of the complete control in VCL frame coordinates. + * aValue: An optional value (tristate/numerical/string) + * aCaption: A caption or title string (like button text etc) */ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, ControlPart nPart, @@ -584,22 +584,22 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, if( nState & CTRL_STATE_PRESSED ) {//checked, else it is not displayed (see vcl/source/window/menu.cxx) HIThemeTextInfo aTextInfo; aTextInfo.version = 0; - aTextInfo.state = ((nState & CTRL_STATE_ENABLED)==0) ? kThemeStateInactive: kThemeStateActive; + aTextInfo.state = ((nState & CTRL_STATE_ENABLED)==0) ? kThemeStateInactive: kThemeStateActive; aTextInfo.fontID = kThemeMenuItemMarkFont; aTextInfo.horizontalFlushness=kHIThemeTextHorizontalFlushCenter; aTextInfo.verticalFlushness=kHIThemeTextVerticalFlushTop; aTextInfo.options=kHIThemeTextBoxOptionNone; aTextInfo.truncationPosition=kHIThemeTextTruncationNone; //aTextInfo.truncationMaxLines unused because of kHIThemeTextTruncationNone - + if( nState & CTRL_STATE_SELECTED) aTextInfo.state = kThemeStatePressed; //item highlighted - + UniChar mark=( nPart == PART_MENU_ITEM_CHECK_MARK ) ? kCheckUnicode: kBulletUnicode;//0x2713; CFStringRef cfString = CFStringCreateWithCharactersNoCopy(kCFAllocatorDefault, &mark, 1, kCFAllocatorNull); - HIThemeDrawTextBox(cfString, &rc, &aTextInfo, mrContext, kHIThemeOrientationNormal); + HIThemeDrawTextBox(cfString, &rc, &aTextInfo, mrContext, kHIThemeOrientationNormal); if (cfString) CFRelease(cfString); - + bOK = true; } } @@ -620,7 +620,7 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, aPushInfo.animation.time.current = 0; PushButtonValue* pPBVal = aValue.getType() == CTRL_PUSHBUTTON ? (PushButtonValue*)&aValue : NULL; int nPaintHeight = static_cast<int>(rc.size.height); - + if( pPBVal && pPBVal->mbBevelButton ) { aPushInfo.kind = kThemeRoundedBevelButton; @@ -634,7 +634,7 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, { aPushInfo.kind = kThemePushButtonNormal; nPaintHeight = PB_Norm_Height; - + // avoid clipping when focused rc.origin.x += FOCUS_RING_WIDTH/2; rc.size.width -= FOCUS_RING_WIDTH; @@ -697,11 +697,11 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, bOK = true; } break; - + case CTRL_LISTNODE: { ButtonValue aButtonValue = aValue.getTristateVal(); - + if( Application::GetSettings().GetLayoutRTL() && aButtonValue == BUTTONVALUE_OFF ) { // FIXME: a value of kThemeDisclosureLeft @@ -709,7 +709,7 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, // sadly this does not seem to work, so we'll draw a left // grey equilateral triangle here ourselves. // Perhaps some other HIThemeButtonDrawInfo setting would do the trick ? - + CGContextSetShouldAntialias( mrContext, true ); float aGrey[] = { 0.45, 0.45, 0.45, 1.0 }; CGContextSetFillColor( mrContext, aGrey ); @@ -731,9 +731,9 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, aInfo.kind = kThemeDisclosureTriangle; aInfo.value = kThemeDisclosureRight; aInfo.state = getState( nState ); - + aInfo.adornment = kThemeAdornmentNone; - + switch( aButtonValue ) { case BUTTONVALUE_ON: aInfo.value = kThemeDisclosureDown;//expanded break; @@ -749,13 +749,13 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, default: break; } - + HIThemeDrawButton( &rc, &aInfo, mrContext, kHIThemeOrientationNormal, NULL ); } bOK = true; } break; - + case CTRL_PROGRESS: case CTRL_INTROPROGRESS: { @@ -779,12 +779,12 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, aTrackInfo.enableState = kThemeTrackActive; aTrackInfo.filler1 = 0; aTrackInfo.trackInfo.progress.phase = static_cast<UInt8>(CFAbsoluteTimeGetCurrent()*10.0); - + HIThemeDrawTrack( &aTrackInfo, NULL, mrContext, kHIThemeOrientationNormal ); bOK = true; } break; - + case CTRL_SLIDER: { SliderValue* pSLVal = (SliderValue*)&aValue; @@ -869,8 +869,8 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, } } break; - -//#define OLD_TAB_STYLE + +//#define OLD_TAB_STYLE #ifdef OLD_TAB_STYLE case CTRL_TAB_PANE: { @@ -879,17 +879,17 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, aTabPaneDrawInfo.state = kThemeStateActive; aTabPaneDrawInfo.direction=kThemeTabNorth; aTabPaneDrawInfo.size=kHIThemeTabSizeNormal; - + //the border is outside the rect rc for Carbon //but for VCL it should be inside rc.origin.x+=1; rc.size.width-=2; - + HIThemeDrawTabPane(&rc, &aTabPaneDrawInfo, mrContext, kHIThemeOrientationNormal); bOK = true; } break; - + case CTRL_TAB_ITEM: { HIThemeTabDrawInfo aTabItemDrawInfo; @@ -898,25 +898,25 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, aTabItemDrawInfo.direction=kThemeTabNorth; aTabItemDrawInfo.size=kHIThemeTabSizeNormal; aTabItemDrawInfo.adornment=kHIThemeTabAdornmentNone; - + if(nState & CTRL_STATE_SELECTED) { aTabItemDrawInfo.style=kThemeTabFront; } if(nState & CTRL_STATE_FOCUSED) { aTabItemDrawInfo.adornment=kHIThemeTabAdornmentFocus; } - + /*if(rc.size.height>=TAB_HEIGHT_NORMAL) rc.size.height=TAB_HEIGHT_NORMAL; else if(rc.size.height>=TAB_HEIGHT_SMALL) rc.size.height=TAB_HEIGHT_SMALL; else rc.size.height=TAB_HEIGHT_MINI;*/ //now we only use the default size rc.size.height=TAB_HEIGHT_NORMAL; - + HIThemeDrawTab(&rc, &aTabItemDrawInfo, mrContext, kHIThemeOrientationNormal, &rc ); - + bOK=true; } - break; + break; #else case CTRL_TAB_PANE: { @@ -926,20 +926,20 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, aTabPaneDrawInfo.direction=kThemeTabNorth; aTabPaneDrawInfo.size=kHIThemeTabSizeNormal; aTabPaneDrawInfo.kind=kHIThemeTabKindNormal; - + //the border is outside the rect rc for Carbon //but for VCL it should be inside rc.origin.x+=1; rc.origin.y-=TAB_HEIGHT_NORMAL/2; rc.size.height+=TAB_HEIGHT_NORMAL/2; rc.size.width-=2; - + HIThemeDrawTabPane(&rc, &aTabPaneDrawInfo, mrContext, kHIThemeOrientationNormal); - + bOK = true; } break; - + case CTRL_TAB_ITEM: { HIThemeTabDrawInfo aTabItemDrawInfo; @@ -948,22 +948,22 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, aTabItemDrawInfo.direction=kThemeTabNorth; aTabItemDrawInfo.size=kHIThemeTabSizeNormal; aTabItemDrawInfo.adornment=kHIThemeTabAdornmentTrailingSeparator; - //State + //State if(nState & CTRL_STATE_SELECTED) { aTabItemDrawInfo.style=kThemeTabFront; } if(nState & CTRL_STATE_FOCUSED) { aTabItemDrawInfo.adornment|=kHIThemeTabAdornmentFocus; } - + //first, last or middle tab aTabItemDrawInfo.position=kHIThemeTabPositionMiddle; - + TabitemValue* pTabValue = (TabitemValue *) &aValue; unsigned int nAlignment = pTabValue->mnAlignment; //TABITEM_LEFTALIGNED (and TABITEM_RIGHTALIGNED) for the leftmost (or rightmost) tab - //when there are several lines of tabs because there is only one first tab and one - //last tab and TABITEM_FIRST_IN_GROUP (and TABITEM_LAST_IN_GROUP) because when the + //when there are several lines of tabs because there is only one first tab and one + //last tab and TABITEM_FIRST_IN_GROUP (and TABITEM_LAST_IN_GROUP) because when the //line width is different from window width, there may not be TABITEM_RIGHTALIGNED if( ( (nAlignment & TABITEM_LEFTALIGNED)&&(nAlignment & TABITEM_RIGHTALIGNED) ) || ( (nAlignment & TABITEM_FIRST_IN_GROUP)&&(nAlignment & TABITEM_LAST_IN_GROUP) ) @@ -971,26 +971,26 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, aTabItemDrawInfo.position=kHIThemeTabPositionOnly; else if((nAlignment & TABITEM_LEFTALIGNED)||(nAlignment & TABITEM_FIRST_IN_GROUP)) aTabItemDrawInfo.position=kHIThemeTabPositionFirst; - else if((nAlignment & TABITEM_RIGHTALIGNED)||(nAlignment & TABITEM_LAST_IN_GROUP)) + else if((nAlignment & TABITEM_RIGHTALIGNED)||(nAlignment & TABITEM_LAST_IN_GROUP)) aTabItemDrawInfo.position=kHIThemeTabPositionLast; - + //support for RTL //see issue 79748 if( Application::GetSettings().GetLayoutRTL() ) { - if( aTabItemDrawInfo.position == kHIThemeTabPositionFirst ) + if( aTabItemDrawInfo.position == kHIThemeTabPositionFirst ) aTabItemDrawInfo.position = kHIThemeTabPositionLast; - else if( aTabItemDrawInfo.position == kHIThemeTabPositionLast ) + else if( aTabItemDrawInfo.position == kHIThemeTabPositionLast ) aTabItemDrawInfo.position = kHIThemeTabPositionFirst; } - + rc.size.width+=2;//because VCL has 2 empty pixels between 2 tabs rc.origin.x-=1; - + HIThemeDrawTab(&rc, &aTabItemDrawInfo, mrContext, kHIThemeOrientationNormal, &rc ); - + bOK=true; } - break; + break; #endif case CTRL_LISTBOX: @@ -1008,7 +1008,7 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, aListInfo.adornment = kThemeAdornmentDefault; if( (nState & CTRL_STATE_FOCUSED) != 0 ) aListInfo.adornment |= kThemeAdornmentFocus; - + HIThemeDrawButton(&rc, &aListInfo, mrContext, kHIThemeOrientationNormal,&rc); bOK = true; break; @@ -1020,19 +1020,19 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, aTextDrawInfo.kind=kHIThemeFrameTextFieldSquare; aTextDrawInfo.state=getState( nState ); aTextDrawInfo.isFocused=false; - + rc.size.width+=1;//else there's a white space because aqua theme hasn't a 3D border rc.size.height+=1; HIThemeDrawFrame(&rc, &aTextDrawInfo, mrContext, kHIThemeOrientationNormal); - + if(nState & CTRL_STATE_FOCUSED) HIThemeDrawFocusRect(&rc, true, mrContext, kHIThemeOrientationNormal); - + bOK=true; break; } } break; - + case CTRL_EDITBOX: case CTRL_MULTILINE_EDITBOX: { @@ -1041,11 +1041,11 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, aTextDrawInfo.kind=kHIThemeFrameTextFieldSquare; aTextDrawInfo.state=getState( nState ); aTextDrawInfo.isFocused=false; - + rc.size.width += 1; // else there may be a white space because aqua theme hasn't a 3D border // change rc so that the frame will encompass only the content region // see counterpart in GetNativeControlRegion - rc.size.width += 2; + rc.size.width += 2; rc.size.height += 2; //CGContextSetFillColorWithColor @@ -1053,13 +1053,13 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, //fill a white background, because drawFrame only draws the border HIThemeDrawFrame(&rc, &aTextDrawInfo, mrContext, kHIThemeOrientationNormal); - + if(nState & CTRL_STATE_FOCUSED) HIThemeDrawFocusRect(&rc, true, mrContext, kHIThemeOrientationNormal); - + bOK=true; } break; - + case CTRL_SPINBOX: { if(nPart == PART_ENTIRE_CONTROL) @@ -1070,7 +1070,7 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, aTextDrawInfo.kind=kHIThemeFrameTextFieldSquare; aTextDrawInfo.state=getState( nState ); aTextDrawInfo.isFocused=false; - + //rc.size.width contains the full size of the spinbox ie textfield + button //so we remove the button width and the space between the button and the textfield rc.size.width -= SPIN_BUTTON_SPACE + SPIN_BUTTON_WIDTH + 2*FOCUS_RING_WIDTH; @@ -1082,9 +1082,9 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, //fill a white background, because drawFrame only draws the border HIThemeDrawFrame(&rc, &aTextDrawInfo, mrContext, kHIThemeOrientationNormal); - + if(nState & CTRL_STATE_FOCUSED) HIThemeDrawFocusRect(&rc, true, mrContext, kHIThemeOrientationNormal); - + //buttons: SpinbuttonValue* pSpinButtonVal = (SpinbuttonValue *)&aValue; ControlState nUpperState = CTRL_STATE_ENABLED;//state of the upper button @@ -1107,17 +1107,17 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, aSpinInfo.state = kThemeStateInactive; else if((nUpperState & CTRL_STATE_ROLLOVER)||(nLowerState & CTRL_STATE_ROLLOVER)) aSpinInfo.state = kThemeStateRollover; - + Rectangle aSpinRect( pSpinButtonVal->maUpperRect ); aSpinRect.Union( pSpinButtonVal->maLowerRect ); HIRect buttonRc = ImplGetHIRectFromRectangle(aSpinRect); - + // FIXME: without this fuzz factor there is some unwanted clipping if( Application::GetSettings().GetLayoutRTL() ) buttonRc.origin.x -= FOCUS_RING_WIDTH - CLIP_FUZZ; else buttonRc.origin.x += FOCUS_RING_WIDTH + CLIP_FUZZ; - + switch( aValue.getTristateVal() ) { case BUTTONVALUE_ON: aSpinInfo.value = kThemeButtonOn; @@ -1125,27 +1125,27 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, case BUTTONVALUE_OFF: aSpinInfo.value = kThemeButtonOff; break; case BUTTONVALUE_MIXED: - case BUTTONVALUE_DONTKNOW: + case BUTTONVALUE_DONTKNOW: default: aSpinInfo.value = kThemeButtonMixed; break; } - + aSpinInfo.adornment = ( ((nUpperState & CTRL_STATE_DEFAULT) != 0 ) || ((nLowerState & CTRL_STATE_DEFAULT) != 0 )) ? - kThemeAdornmentDefault : + kThemeAdornmentDefault : kThemeAdornmentNone; if( ((nUpperState & CTRL_STATE_FOCUSED) != 0 ) || ((nLowerState & CTRL_STATE_FOCUSED) != 0 )) aSpinInfo.adornment |= kThemeAdornmentFocus; - + HIThemeDrawButton( &buttonRc, &aSpinInfo, mrContext, kHIThemeOrientationNormal, NULL ); } - + bOK=true; } - + } break; - + case CTRL_FRAME: { USHORT nStyle = aValue.getNumericVal(); @@ -1159,38 +1159,38 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, { CGMutablePathRef rPath = CGPathCreateMutable(); CGPathAddRect( rPath, NULL, CGRectMake( 0, 0, mpFrame->maGeometry.nWidth-1, mpFrame->maGeometry.nHeight-1 ) ); - + CGContextBeginPath( mrContext ); CGContextAddPath( mrContext, rPath ); - CGContextClip( mrContext ); + CGContextClip( mrContext ); CGPathRelease( rPath ); } - + HIThemeFrameDrawInfo aTextDrawInfo; aTextDrawInfo.version=0; aTextDrawInfo.kind=kHIThemeFrameListBox; aTextDrawInfo.state=kThemeStateActive; aTextDrawInfo.isFocused=false; - + HIThemeDrawFrame(&rc, &aTextDrawInfo, mrContext, kHIThemeOrientationNormal); - + bOK=true; } } } break; - + case CTRL_LISTNET: { //do nothing as there isn't net for listviews on macos bOK=true; } break; - + } CGContextRestoreGState( mrContext ); - + /* #i90291# in most cases invalidating the whole control region instead of just the unclipped part of it is sufficient (and probably faster). However for the window background we should not unnecessarily enlarge @@ -1206,10 +1206,10 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, if( aRect.size.width != 0 && aRect.size.height != 0 ) buttonRect.Intersection( Rectangle( Point( static_cast<long int>(aRect.origin.x), static_cast<long int>(aRect.origin.y) ), - Size( static_cast<long int>(aRect.size.width), + Size( static_cast<long int>(aRect.size.width), static_cast<long int>(aRect.size.height) ) ) ); } - + RefreshRect( buttonRect.Left(), buttonRect.Top(), buttonRect.GetWidth(), buttonRect.GetHeight() ); return bOK; @@ -1221,9 +1221,9 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType, * OPTIONAL. Draws the requested text for the control described by nPart/nState. * Used if text not drawn by DrawNativeControl(). * - * rControlRegion: The bounding region of the complete control in VCL frame coordinates. - * aValue: An optional value (tristate/numerical/string) - * aCaption: A caption or title string (like button text etc) + * rControlRegion: The bounding region of the complete control in VCL frame coordinates. + * aValue: An optional value (tristate/numerical/string) + * aCaption: A caption or title string (like button text etc) */ BOOL AquaSalGraphics::drawNativeControlText( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState, const ImplControlValue& aValue, @@ -1242,9 +1242,9 @@ BOOL AquaSalGraphics::drawNativeControlText( ControlType nType, ControlPart nPar * within the control that can be safely drawn into without drawing over * the borders of the control. * - * rControlRegion: The bounding region of the control in VCL frame coordinates. - * aValue: An optional value (tristate/numerical/string) - * aCaption: A caption or title string (like button text etc) + * rControlRegion: The bounding region of the control in VCL frame coordinates. + * aValue: An optional value (tristate/numerical/string) + * aCaption: A caption or title string (like button text etc) */ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPart, const Rectangle& rControlRegion, ControlState nState, const ImplControlValue& aValue, const rtl::OUString& aCaption, @@ -1257,7 +1257,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa short x = aCtrlBoundRect.Left(); short y = aCtrlBoundRect.Top(); short w, h; - + sal_uInt8 nBorderCleanup = 0; switch (nType) @@ -1280,7 +1280,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa } } break; - + case CTRL_SCROLLBAR: { Rectangle aRect; @@ -1306,16 +1306,16 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa { // checkbox and radio borders need cleanup after unchecking them nBorderCleanup = 4; - + // TEXT_SEPARATOR to respect Aqua HIG w = BUTTON_WIDTH + TEXT_SEPARATOR; h = BUTTON_HEIGHT; - + } - + rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h + nBorderCleanup) ); rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) ); - + toReturn = TRUE; } break; @@ -1331,7 +1331,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa toReturn = TRUE; } break; - + case CTRL_INTROPROGRESS: { Rectangle aRect( aCtrlBoundRect ); @@ -1341,11 +1341,11 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa toReturn = TRUE; } break; - + case CTRL_TAB_ITEM: - + w = aCtrlBoundRect.GetWidth() + 2*TAB_TEXT_OFFSET - 2*VCL_TAB_TEXT_OFFSET; - + #ifdef OLD_TAB_STYLE h = TAB_HEIGHT_NORMAL; #else @@ -1355,9 +1355,9 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) ); toReturn = TRUE; - + break; - + case CTRL_EDITBOX: { w = aCtrlBoundRect.GetWidth(); @@ -1369,7 +1369,7 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa rNativeContentRegion = Rectangle( Point( x+FOCUS_RING_WIDTH, y+FOCUS_RING_WIDTH ), Size( w-2*(FOCUS_RING_WIDTH+1), h-2*(FOCUS_RING_WIDTH+1) ) ); rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) ); - + toReturn = TRUE; } break; @@ -1380,10 +1380,10 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa { w = aCtrlBoundRect.GetWidth(); h = COMBOBOX_HEIGHT_NORMAL;//listboxes and comboxes have the same height - + rNativeContentRegion = Rectangle( Point( x+FOCUS_RING_WIDTH, y+FOCUS_RING_WIDTH ), Size( w-2*FOCUS_RING_WIDTH, h ) ); rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h+2*FOCUS_RING_WIDTH ) ); - + toReturn = TRUE; } else if( nPart == PART_BUTTON_DOWN ) @@ -1392,14 +1392,14 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa if( w < 3+2*FOCUS_RING_WIDTH ) w = 3+2*FOCUS_RING_WIDTH; h = COMBOBOX_HEIGHT_NORMAL;//listboxes and comboxes have the same height - + x += w-DROPDOWN_BUTTON_WIDTH - FOCUS_RING_WIDTH; y += FOCUS_RING_WIDTH; w = DROPDOWN_BUTTON_WIDTH; - + rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) ); rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w+FOCUS_RING_WIDTH, h+2*FOCUS_RING_WIDTH ) ); - + toReturn = true; } else if( nPart == PART_SUB_EDIT ) @@ -1415,10 +1415,10 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa if( nType == CTRL_LISTBOX ) w -= 9; // HIG specifies 9 units distance between dropdown button area and content h -= 4; // don't draw into lower border - + rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) ); rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w+FOCUS_RING_WIDTH, h+2*FOCUS_RING_WIDTH ) ); - + toReturn = true; } } @@ -1429,10 +1429,10 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa if( w < 3+2*FOCUS_RING_WIDTH+SPIN_BUTTON_SPACE+SPIN_BUTTON_WIDTH ) w = 3+2*FOCUS_RING_WIDTH+SPIN_BUTTON_SPACE+SPIN_BUTTON_WIDTH; h = TEXT_EDIT_HEIGHT_NORMAL; - + rNativeContentRegion = Rectangle( Point( x+FOCUS_RING_WIDTH, y ), Size( w-2*FOCUS_RING_WIDTH, h ) ); rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h+2*FOCUS_RING_WIDTH ) ); - + toReturn = TRUE; } else if( nPart == PART_SUB_EDIT ) { @@ -1442,10 +1442,10 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa y += 2; // don't draw into upper border w -= 8; // offset for left and right rounded border h -= 4; // don't draw into upper or ower border - + rNativeContentRegion = Rectangle( Point( x + FOCUS_RING_WIDTH, y + FOCUS_RING_WIDTH ), Size( w - 2* FOCUS_RING_WIDTH, h ) ); rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h+2*FOCUS_RING_WIDTH ) ); - + toReturn = TRUE; } else if( nPart == PART_BUTTON_UP ) { @@ -1456,10 +1456,10 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa y += FOCUS_RING_WIDTH - CLIP_FUZZ; w = SPIN_BUTTON_WIDTH + 2*CLIP_FUZZ; h = SPIN_UPPER_BUTTON_HEIGHT + 2*CLIP_FUZZ; - + rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) ); rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) ); - + toReturn = TRUE; } else if( nPart == PART_BUTTON_DOWN ) { @@ -1467,10 +1467,10 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa y += SPIN_UPPER_BUTTON_HEIGHT + FOCUS_RING_WIDTH - CLIP_FUZZ; w = SPIN_BUTTON_WIDTH + 2*CLIP_FUZZ; h = SPIN_LOWER_BUTTON_HEIGHT + 2*CLIP_FUZZ; - + rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) ); rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) ); - + toReturn = TRUE; } break; @@ -1483,38 +1483,38 @@ BOOL AquaSalGraphics::getNativeControlRegion( ControlType nType, ControlPart nPa Rectangle aRect(aCtrlBoundRect); if( nStyle & FRAME_DRAW_DOUBLEIN ) { - aRect.Left() += 1; - aRect.Top() += 1; - //rRect.Right() -= 1; - //rRect.Bottom() -= 1; + aRect.Left() += 1; + aRect.Top() += 1; + //rRect.Right() -= 1; + //rRect.Bottom() -= 1; } else { - aRect.Left() += 1; - aRect.Top() += 1; - aRect.Right() -= 1; - aRect.Bottom() -= 1; + aRect.Left() += 1; + aRect.Top() += 1; + aRect.Right() -= 1; + aRect.Bottom() -= 1; } rNativeContentRegion = aRect; rNativeBoundingRegion = aRect; - + toReturn = TRUE; } } break; - + case CTRL_MENUBAR: case CTRL_MENU_POPUP: { if(( nPart == PART_MENU_ITEM_CHECK_MARK )||( nPart == PART_MENU_ITEM_RADIO_MARK )) { - + w=10; h=10;//dimensions of the mark (10px font) - + rNativeContentRegion = Rectangle( Point( x, y ), Size( w, h ) ); rNativeBoundingRegion = Rectangle( Point( x, y ), Size( w, h ) ); - + toReturn = TRUE; } } diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx index 28d554ba9054..686fdb2cba3b 100644 --- a/vcl/aqua/source/gdi/salprn.cxx +++ b/vcl/aqua/source/gdi/salprn.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -74,7 +74,7 @@ AquaSalInfoPrinter::AquaSalInfoPrinter( const SalPrinterQueueInfo& i_rQueue ) : NSString* pStr = CreateNSString( i_rQueue.maPrinterName ); mpPrinter = [NSPrinter printerWithName: pStr]; [pStr release]; - + NSPrintInfo* pShared = [NSPrintInfo sharedPrintInfo]; if( pShared ) { @@ -83,13 +83,13 @@ AquaSalInfoPrinter::AquaSalInfoPrinter( const SalPrinterQueueInfo& i_rQueue ) : mePageOrientation = ([mpPrintInfo orientation] == NSLandscapeOrientation) ? ORIENTATION_LANDSCAPE : ORIENTATION_PORTRAIT; [mpPrintInfo setOrientation: NSPortraitOrientation]; } - + mpGraphics = new AquaSalGraphics(); - + const int nWidth = 100, nHeight = 100; maContextMemory.reset( reinterpret_cast<sal_uInt8*>( rtl_allocateMemory( nWidth * 4 * nHeight ) ), boost::bind( rtl_freeMemory, _1 ) ); - + if( maContextMemory ) { mrContext = CGBitmapContextCreate( maContextMemory.get(), nWidth, nHeight, 8, nWidth * 4, GetSalData()->mxRGBSpace, kCGImageAlphaNoneSkipFirst ); @@ -120,7 +120,7 @@ void AquaSalInfoPrinter::SetupPrinterGraphics( CGContextRef i_rContext ) const // FIXME: get printer resolution long nDPIX = 720, nDPIY = 720; NSSize aPaperSize = [mpPrintInfo paperSize]; - + NSRect aImageRect = [mpPrintInfo imageablePageBounds]; if( mePageOrientation == ORIENTATION_PORTRAIT ) { @@ -228,7 +228,7 @@ static Paper recognizePaper( double i_fWidth, double i_fHeight ) aPaper = PAPER_USER; break; } - + if( aPaper == PAPER_USER ) { // search with fuzz factor @@ -243,7 +243,7 @@ static Paper recognizePaper( double i_fWidth, double i_fHeight ) } } } - + return aPaper; } @@ -253,9 +253,9 @@ BOOL AquaSalInfoPrinter::SetPrinterData( ImplJobSetup* io_pSetupData ) if( io_pSetupData && io_pSetupData->mpDriverData ) return SetData( ~0, io_pSetupData ); - + BOOL bSuccess = TRUE; - + // set system type io_pSetupData->mnSystem = JOBSETUP_SYSTEM_MAC; @@ -277,17 +277,17 @@ BOOL AquaSalInfoPrinter::SetPrinterData( ImplJobSetup* io_pSetupData ) io_pSetupData->mnPaperHeight = 0; } - // set orientation + // set orientation io_pSetupData->meOrientation = mePageOrientation; - + io_pSetupData->mnPaperBin = 0; io_pSetupData->mpDriverData = reinterpret_cast<BYTE*>(rtl_allocateMemory( 4 )); io_pSetupData->mnDriverDataLen = 4; } else bSuccess = FALSE; - - + + return bSuccess; } @@ -295,10 +295,10 @@ BOOL AquaSalInfoPrinter::SetPrinterData( ImplJobSetup* io_pSetupData ) void AquaSalInfoPrinter::setPaperSize( long i_nWidth, long i_nHeight, Orientation i_eSetOrientation ) { - + Orientation ePaperOrientation = ORIENTATION_PORTRAIT; const PaperInfo* pPaper = matchPaper( i_nWidth, i_nHeight, ePaperOrientation ); - + if( pPaper ) { NSString* pPaperName = [CreateNSString( rtl::OStringToOUString(PaperInfo::toPSName(pPaper->getPaper()), RTL_TEXTENCODING_ASCII_US) ) autorelease]; @@ -320,7 +320,7 @@ BOOL AquaSalInfoPrinter::SetData( ULONG i_nFlags, ImplJobSetup* io_pSetupData ) if( ! io_pSetupData || io_pSetupData->mnSystem != JOBSETUP_SYSTEM_MAC ) return FALSE; - + if( mpPrintInfo ) { if( (i_nFlags & SAL_JOBSET_ORIENTATION) != 0 ) @@ -346,11 +346,11 @@ BOOL AquaSalInfoPrinter::SetData( ULONG i_nFlags, ImplJobSetup* io_pSetupData ) width = static_cast<long>(PtTo10Mu( w )); height = static_cast<long>(PtTo10Mu( h )); } - + setPaperSize( width, height, mePageOrientation ); - } + } } - + return mpPrintInfo != nil; } @@ -484,7 +484,7 @@ void AquaSalInfoPrinter::GetPageInfo( const ImplJobSetup*, o_rPageOffY = static_cast<long>( (aPaperSize.height - aImageRect.size.height - aImageRect.origin.y) * fYScaling ); o_rOutWidth = static_cast<long>( aImageRect.size.width * fXScaling ); o_rOutHeight = static_cast<long>( aImageRect.size.height * fYScaling ); - + if( mePageOrientation == ORIENTATION_LANDSCAPE ) { std::swap( o_rOutWidth, o_rOutHeight ); @@ -521,20 +521,20 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName, { if( mbJob ) return FALSE; - + BOOL bSuccess = FALSE; bool bWasAborted = false; AquaSalInstance* pInst = GetSalData()->mpFirstInstance; PrintAccessoryViewState aAccViewState; sal_Int32 nAllPages = 0; - + // reset IsLastPage i_rController.setLastPage( sal_False ); // update job data if( i_pSetupData ) SetData( ~0, i_pSetupData ); - + // do we want a progress panel ? sal_Bool bShowProgressPanel = sal_True; beans::PropertyValue* pMonitor = i_rController.getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MonitorVisible" ) ) ); @@ -575,21 +575,21 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName, mnCurPageRangeCount = 0; nAllPages = i_rController.getFilteredPageCount(); } - + aAccViewState.bNeedRestart = false; - + Size aCurSize( 21000, 29700 ); if( nAllPages > 0 ) { mnCurPageRangeCount = 1; aCurSize = getPageSize( i_rController, mnCurPageRangeStart ); Size aNextSize( aCurSize ); - + // print pages up to a different size while( mnCurPageRangeCount + mnCurPageRangeStart < nAllPages ) { aNextSize = getPageSize( i_rController, mnCurPageRangeStart + mnCurPageRangeCount ); - if( aCurSize == aNextSize // same page size + if( aCurSize == aNextSize // same page size || (aCurSize.Width() == aNextSize.Height() && aCurSize.Height() == aNextSize.Width()) // same size, but different orientation ) @@ -602,7 +602,7 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName, } else mnCurPageRangeCount = 0; - + // now for the current run mnStartPageOffsetX = mnStartPageOffsetY = 0; // setup the paper size and orientation @@ -614,12 +614,12 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName, boost::shared_ptr<Printer> pPrinter( i_rController.getPrinter() ); pPrinter->SetMapMode( MapMode( MAP_100TH_MM ) ); pPrinter->SetPaperSizeUser( aCurSize, true ); - + // create view NSView* pPrintView = [[AquaPrintView alloc] initWithController: &i_rController withInfoPrinter: this]; - + NSMutableDictionary* pPrintDict = [mpPrintInfo dictionary]; - + // set filename if( i_pFileName ) { @@ -628,7 +628,7 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName, [pPrintDict setObject: pPath forKey: NSPrintSavePath]; [pPath release]; } - + [pPrintDict setObject: [[NSNumber numberWithInt: nCopies] autorelease] forKey: NSPrintCopies]; if( nCopies > 1 ) [pPrintDict setObject: [[NSNumber numberWithBool: pPrinter->IsCollateCopy()] autorelease] forKey: NSPrintMustCollate]; @@ -638,25 +638,25 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName, // leads do a double free malloc error. Why this value should behave differently from all the others // is a mystery. [pPrintDict setObject: [NSNumber numberWithInt: mnCurPageRangeCount] forKey: NSPrintLastPage]; - - + + // create print operation NSPrintOperation* pPrintOperation = [NSPrintOperation printOperationWithView: pPrintView printInfo: mpPrintInfo]; - + if( pPrintOperation ) { NSObject* pReleaseAfterUse = nil; bool bShowPanel = (! i_rController.isDirectPrint() && getUseNativeDialog() && i_rController.isShowDialogs() ); [pPrintOperation setShowsPrintPanel: bShowPanel ? YES : NO ]; [pPrintOperation setShowsProgressPanel: bShowProgressPanel ? YES : NO]; - + // set job title (since MacOSX 10.5) if( [pPrintOperation respondsToSelector: @selector(setJobTitle:)] ) [pPrintOperation performSelector: @selector(setJobTitle:) withObject: [CreateNSString( i_rJobName ) autorelease]]; - + if( bShowPanel && mnCurPageRangeStart == 0 && nCurJob == 0) // only the first range of pages (in the first job) gets the accesory view pReleaseAfterUse = [AquaPrintAccessoryView setupPrinterPanel: pPrintOperation withController: &i_rController withState: &aAccViewState]; - + bSuccess = TRUE; mbJob = true; pInst->startedPrintJob(); @@ -667,12 +667,12 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName, if( pReleaseAfterUse ) [pReleaseAfterUse release]; } - + mnCurPageRangeStart += mnCurPageRangeCount; mnCurPageRangeCount = 1; } while( aAccViewState.bNeedRestart || mnCurPageRangeStart + mnCurPageRangeCount < nAllPages ); } - + // inform application that it can release its data // this is awkward, but the XRenderable interface has no method for this, // so we need to call XRenderadble::render one last time with IsLastPage = TRUE @@ -681,11 +681,11 @@ BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName, if( mrContext ) SetupPrinterGraphics( mrContext ); i_rController.getFilteredPageFile( 0, aPageFile ); - + i_rController.setJobState( bWasAborted ? view::PrintableState_JOB_ABORTED : view::PrintableState_JOB_SPOOLED ); - + mnCurPageRangeStart = mnCurPageRangeCount = 0; return bSuccess; @@ -705,7 +705,7 @@ BOOL AquaSalInfoPrinter::EndJob() BOOL AquaSalInfoPrinter::AbortJob() { mbJob = false; - + // FIXME: implementation return FALSE; } @@ -716,11 +716,11 @@ SalGraphics* AquaSalInfoPrinter::StartPage( ImplJobSetup* i_pSetupData, BOOL i_b { if( i_bNewJobData && i_pSetupData ) SetPrinterData( i_pSetupData ); - + CGContextRef rContext = reinterpret_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]); - + SetupPrinterGraphics( rContext ); - + return mpGraphics; } @@ -816,7 +816,7 @@ void AquaSalInfoPrinter::InitPaperFormats( const ImplJobSetup* i_pSetupData ) { m_aPaperFormats.clear(); m_bPapersInit = true; - + if( mpPrinter ) { if( [mpPrinter statusForTable: @"PPD"] == NSPrinterTableOK ) @@ -845,7 +845,7 @@ const PaperInfo* AquaSalInfoPrinter::matchPaper( long i_nWidth, long i_nHeight, { if( ! m_bPapersInit ) const_cast<AquaSalInfoPrinter*>(this)->InitPaperFormats( NULL ); - + const PaperInfo* pMatch = NULL; o_rOrientation = ORIENTATION_PORTRAIT; for( int n = 0; n < 2 ; n++ ) diff --git a/vcl/aqua/source/gdi/salvd.cxx b/vcl/aqua/source/gdi/salvd.cxx index de09867e4071..d67aea8d3657 100644 --- a/vcl/aqua/source/gdi/salvd.cxx +++ b/vcl/aqua/source/gdi/salvd.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,7 +44,7 @@ SalVirtualDevice* AquaSalInstance::CreateVirtualDevice( SalGraphics* pGraphics, { // #i92075# can be called first in a thread SalData::ensureThreadAutoreleasePool(); - + return new AquaSalVirtualDevice( static_cast< AquaSalGraphics* >( pGraphics ), nDX, nDY, nBitCount, pData ); } @@ -58,10 +58,10 @@ void AquaSalInstance::DestroyVirtualDevice( SalVirtualDevice* pDevice ) // ======================================================================= AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long nDX, long nDY, USHORT nBitCount, const SystemGraphicsData *pData ) -: mbGraphicsUsed( false ) -, mxBitmapContext( NULL ) -, mnBitmapDepth( 0 ) -, mxLayer( NULL ) +: mbGraphicsUsed( false ) +, mxBitmapContext( NULL ) +, mnBitmapDepth( 0 ) +, mxLayer( NULL ) { if( pGraphic && pData && pData->rCGContext ) { @@ -91,7 +91,7 @@ AquaSalVirtualDevice::AquaSalVirtualDevice( AquaSalGraphics* pGraphic, long nDX, if( nDX && nDY ) SetSize( nDX, nDY ); - + // NOTE: if SetSize does not succeed, we just ignore the nDX and nDY } } @@ -203,9 +203,9 @@ BOOL AquaSalVirtualDevice::SetSize( long nDX, long nDY ) xCGContext = reinterpret_cast<CGContextRef>([pNSContext graphicsPort]); } } - + DBG_ASSERT( xCGContext, "no context" ); - + const CGSize aNewSize = { nDX, nDY }; mxLayer = CGLayerCreateWithContext( xCGContext, aNewSize, NULL ); |