diff options
author | Tor Lillqvist <tml@iki.fi> | 2012-09-20 00:54:36 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2012-09-20 00:54:52 +0300 |
commit | 25f935bfb44b87271eb11e719c4d1fb8624bdd02 (patch) | |
tree | 8dd499945234e89ad6f3eb46966ee899147542d4 /vcl/aqua/source | |
parent | 591e23d03c27e2658889d913626fdcb2837d9064 (diff) |
64-bit fixes
Change-Id: I268ccab01e030535f04ef1256dc702b07cbc6611
Diffstat (limited to 'vcl/aqua/source')
-rw-r--r-- | vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm | 2 | ||||
-rw-r--r-- | vcl/aqua/source/dtrans/DropTarget.cxx | 9 | ||||
-rw-r--r-- | vcl/aqua/source/dtrans/PictToBmpFlt.cxx | 16 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/atsui/salatslayout.cxx | 8 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/coretext/salcoretextlayout.cxx | 4 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/coretext/salgdi.cxx | 2 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salbmp.cxx | 2 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salgdicommon.cxx | 30 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salnativewidgets.cxx | 2 | ||||
-rw-r--r-- | vcl/aqua/source/gdi/salprn.cxx | 2 | ||||
-rw-r--r-- | vcl/aqua/source/window/salframe.cxx | 6 | ||||
-rw-r--r-- | vcl/aqua/source/window/salframeview.mm | 6 |
12 files changed, 59 insertions, 30 deletions
diff --git a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm index 31978a67882d..4b38b15b66b1 100644 --- a/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm +++ b/vcl/aqua/source/a11y/aqua11ytextattributeswrapper.mm @@ -107,7 +107,7 @@ using namespace ::rtl; +(void)addColor:(sal_Int32)salColor forAttribute:(NSString *)attribute andRange:(NSRange)range toString:(NSMutableAttributedString *)string { if ( salColor != -1 ) { - float elements[] = { salColor & 0x00ff0000, salColor & 0x0000ff00, salColor & 0x000000ff }; + CGFloat elements[] = { salColor & 0x00ff0000, salColor & 0x0000ff00, salColor & 0x000000ff }; CGColorRef color = CGColorCreate ( CGColorSpaceCreateWithName ( kCGColorSpaceGenericRGB ), elements ); [ string addAttribute: attribute value: (id) color range: range ]; CGColorRelease ( color ); diff --git a/vcl/aqua/source/dtrans/DropTarget.cxx b/vcl/aqua/source/dtrans/DropTarget.cxx index bb46e21d6a83..c799d9298a3b 100644 --- a/vcl/aqua/source/dtrans/DropTarget.cxx +++ b/vcl/aqua/source/dtrans/DropTarget.cxx @@ -296,6 +296,7 @@ NSDragOperation DropTarget::draggingUpdated(id sender) //NSLog(@"Drag update: Source actions: %x proposed action %x selected action %x", mDragSourceSupportedActions, currentAction, mSelectedDropAction); } +#ifndef __LP64__ // Weird but it appears as if there is no method in Cocoa // to create a kThemeCopyArrowCursor hence we have to use // Carbon to do it @@ -305,7 +306,9 @@ NSDragOperation DropTarget::draggingUpdated(id sender) SetThemeCursor(kThemeCopyArrowCursor); else SetThemeCursor(kThemeArrowCursor); - +#else + // FIXME: SetThemeCursor replacement? +#endif return dragOp; } @@ -316,7 +319,9 @@ void DropTarget::draggingExited(id /*sender*/) fire_dragExit(dte); mDragSourceSupportedActions = DNDConstants::ACTION_NONE; mSelectedDropAction = DNDConstants::ACTION_NONE; +#ifndef __LP64__ SetThemeCursor(kThemeArrowCursor); +#endif } @@ -370,7 +375,9 @@ void DropTarget::concludeDragOperation(id /*sender*/) mDragSourceSupportedActions = DNDConstants::ACTION_NONE; mSelectedDropAction = DNDConstants::ACTION_NONE; mXCurrentDragClipboard = uno::Reference<XClipboard>(); +#ifndef __LP64__ SetThemeCursor(kThemeArrowCursor); +#endif } diff --git a/vcl/aqua/source/dtrans/PictToBmpFlt.cxx b/vcl/aqua/source/dtrans/PictToBmpFlt.cxx index 8a545daa4731..0bbb33ba51a3 100644 --- a/vcl/aqua/source/dtrans/PictToBmpFlt.cxx +++ b/vcl/aqua/source/dtrans/PictToBmpFlt.cxx @@ -39,6 +39,11 @@ bool PICTtoBMP(com::sun::star::uno::Sequence<sal_Int8>& aPict, bool result = false; +#ifdef __LP64__ + // FIXME + (void) aPict; + (void) aBmp; +#else ComponentInstance bmpExporter; if (OpenADefaultComponent(GraphicsExporterComponentType, kQTFileTypeBMP, @@ -78,7 +83,7 @@ bool PICTtoBMP(com::sun::star::uno::Sequence<sal_Int8>& aPict, DisposeHandle(hPict); DisposeHandle(hBmp); CloseComponent(bmpExporter); - +#endif return result; } @@ -103,12 +108,17 @@ bool BMPtoPICT(com::sun::star::uno::Sequence<sal_Int8>& aBmp, bool result = false; Handle hBmp; - ComponentInstance pictExporter; if ((PtrToHand(aBmp.getArray(), &hBmp, aBmp.getLength()) != noErr)) { return result; } +#ifdef __LP64__ + // FIXME + (void) aPict; +#else + ComponentInstance pictExporter; + if (OpenADefaultComponent(GraphicsImporterComponentType, kQTFileTypeBMP, &pictExporter) != noErr) @@ -145,7 +155,7 @@ bool BMPtoPICT(com::sun::star::uno::Sequence<sal_Int8>& aBmp, DisposeHandle(hBmp); CloseComponent(pictExporter); - +#endif return result; } diff --git a/vcl/aqua/source/gdi/atsui/salatslayout.cxx b/vcl/aqua/source/gdi/atsui/salatslayout.cxx index 84e6ff248065..4145dbf91342 100644 --- a/vcl/aqua/source/gdi/atsui/salatslayout.cxx +++ b/vcl/aqua/source/gdi/atsui/salatslayout.cxx @@ -63,9 +63,9 @@ public: sal_Int32* pGlyphAdvances, int* pCharIndexes ) const; virtual long GetTextWidth() const; - virtual long FillDXArray( long* pDXArray ) const; + virtual long FillDXArray( sal_Int32* pDXArray ) const; virtual int GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) const; - virtual void GetCaretPositions( int nArraySize, long* pCaretXArray ) const; + virtual void GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray ) const; virtual bool GetGlyphOutlines( SalGraphics&, PolyPolyVector& ) const; virtual bool GetBoundRect( SalGraphics&, Rectangle& ) const; @@ -683,7 +683,7 @@ long ATSLayout::GetTextWidth() const * * @return : typographical width of the complete text layout **/ -long ATSLayout::FillDXArray( long* pDXArray ) const +long ATSLayout::FillDXArray( sal_Int32* pDXArray ) const { // short circuit requests which don't need full details if( !pDXArray ) @@ -809,7 +809,7 @@ int ATSLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) cons * * @return : none **/ -void ATSLayout::GetCaretPositions( int nMaxIndex, long* pCaretXArray ) const +void ATSLayout::GetCaretPositions( int nMaxIndex, sal_Int32* pCaretXArray ) const { DBG_ASSERT( ((nMaxIndex>0)&&!(nMaxIndex&1)), "ATSLayout::GetCaretPositions() : invalid number of caret pairs requested"); diff --git a/vcl/aqua/source/gdi/coretext/salcoretextlayout.cxx b/vcl/aqua/source/gdi/coretext/salcoretextlayout.cxx index 07ff28974ed7..ff642076325d 100644 --- a/vcl/aqua/source/gdi/coretext/salcoretextlayout.cxx +++ b/vcl/aqua/source/gdi/coretext/salcoretextlayout.cxx @@ -134,7 +134,7 @@ void CoreTextLayout::DrawText( SalGraphics& rGraphics ) const // not needed. CoreText manage fallback directly void CoreTextLayout::DropGlyph( int /*nStart*/ ) {} -long CoreTextLayout::FillDXArray( long* pDXArray ) const +long CoreTextLayout::FillDXArray( sal_Int32* pDXArray ) const { msgs_debug(layout,"-->"); // short circuit requests which don't need full details @@ -188,7 +188,7 @@ bool CoreTextLayout::GetBoundRect( SalGraphics& rGraphics, Rectangle& rVCLRect ) return true; } -void CoreTextLayout::GetCaretPositions( int max_index, long* caret_position) const +void CoreTextLayout::GetCaretPositions( int max_index, sal_Int32* caret_position) const { msgs_debug(layout,"max_index %d -->", max_index); int local_max = max_index < m_chars_count * 2 ? max_index : m_chars_count; diff --git a/vcl/aqua/source/gdi/coretext/salgdi.cxx b/vcl/aqua/source/gdi/coretext/salgdi.cxx index 7e822e0d47b8..57f72bd1ed1a 100644 --- a/vcl/aqua/source/gdi/coretext/salgdi.cxx +++ b/vcl/aqua/source/gdi/coretext/salgdi.cxx @@ -167,7 +167,7 @@ const ImplFontCharMap* AquaSalGraphics::GetImplFontCharMap() const { if( !m_style ) { - return false; + return NULL; } CoreTextPhysicalFontFace* font_face = m_style->GetFontFace(); if( !font_face) diff --git a/vcl/aqua/source/gdi/salbmp.cxx b/vcl/aqua/source/gdi/salbmp.cxx index 5323fb7f2930..f14e1d54a66c 100644 --- a/vcl/aqua/source/gdi/salbmp.cxx +++ b/vcl/aqua/source/gdi/salbmp.cxx @@ -781,7 +781,7 @@ CGImageRef AquaSalBitmap::CreateWithMask( const AquaSalBitmap& rMask, CFRelease( xMask ); CGDataProviderRef xDataProvider( CGDataProviderCreateWithData( NULL, pMaskMem, nHeight * nMaskBytesPerRow, &CFRTLFree ) ); - static const float* pDecode = NULL; + static const CGFloat* pDecode = NULL; xMask = CGImageMaskCreate( nWidth, nHeight, 8, 8, nMaskBytesPerRow, xDataProvider, pDecode, false ); CFRelease( xDataProvider ); CFRelease( xMaskContext ); diff --git a/vcl/aqua/source/gdi/salgdicommon.cxx b/vcl/aqua/source/gdi/salgdicommon.cxx index 72f97ed0e4ca..8ae6c9c91a2a 100644 --- a/vcl/aqua/source/gdi/salgdicommon.cxx +++ b/vcl/aqua/source/gdi/salgdicommon.cxx @@ -1,3 +1,5 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + #include <sal/types.h> #include <osl/file.hxx> @@ -118,7 +120,7 @@ static void AddPolyPolygonToPath( CGMutablePathRef xPath, sal_Bool AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile, const PhysicalFontFace* pFontData, - long* pGlyphIDs, sal_uInt8* pEncoding, + sal_Int32* pGlyphIDs, sal_uInt8* pEncoding, sal_Int32* pGlyphWidths, int nGlyphCount, FontSubsetInfo& rInfo ) { @@ -148,8 +150,16 @@ sal_Bool AquaSalGraphics::CreateFontSubset( const rtl::OUString& rToFile, // make the subsetter provide the requested subset FILE* pOutFile = fopen( aToFile.getStr(), "wb" ); +#ifdef __LP64__ + long *pLongGlyphIDs = (long*)alloca(nGlyphCount * sizeof(long)); + for (int i = 0; i < nGlyphCount; i++) + pLongGlyphIDs[i] = pGlyphIDs[i]; + bool bRC = rInfo.CreateFontSubset( FontSubsetInfo::TYPE1_PFB, pOutFile, NULL, + pLongGlyphIDs, pEncoding, nGlyphCount, pGlyphWidths ); +#else bool bRC = rInfo.CreateFontSubset( FontSubsetInfo::TYPE1_PFB, pOutFile, NULL, pGlyphIDs, pEncoding, nGlyphCount, pGlyphWidths ); +#endif fclose( pOutFile ); return bRC; } @@ -798,7 +808,7 @@ bool AquaSalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPol return true; } -void AquaSalGraphics::drawPolyPolygon( sal_uLong nPolyCount, const sal_uLong *pPoints, PCONSTSALPOINT *ppPtAry ) +void AquaSalGraphics::drawPolyPolygon( sal_uInt32 nPolyCount, const sal_uInt32 *pPoints, PCONSTSALPOINT *ppPtAry ) { if( nPolyCount <= 0 ) return; @@ -957,7 +967,7 @@ sal_Bool AquaSalGraphics::drawPolygonBezier( sal_uLong, const SalPoint*, const s return sal_False; } -sal_Bool AquaSalGraphics::drawPolyPolygonBezier( sal_uLong, const sal_uLong*, +sal_Bool AquaSalGraphics::drawPolyPolygonBezier( sal_uInt32, const sal_uInt32*, const SalPoint* const*, const sal_uInt8* const* ) { return sal_False; @@ -1106,15 +1116,15 @@ SalColor AquaSalGraphics::getPixel( long nX, long nY ) return nSalColor; } -void AquaSalGraphics::GetResolution( long& rDPIX, long& rDPIY ) +void AquaSalGraphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY ) { if( !mnRealDPIY ) { initResolution( (mbWindow && mpFrame) ? mpFrame->mpWindow : nil ); } - rDPIX = static_cast<long>(mfFakeDPIScale * mnRealDPIX); - rDPIY = static_cast<long>(mfFakeDPIScale * mnRealDPIY); + rDPIX = static_cast<sal_Int32>(mfFakeDPIScale * mnRealDPIX); + rDPIY = static_cast<sal_Int32>(mfFakeDPIScale * mnRealDPIY); } void AquaSalGraphics::ImplDrawPixel( long nX, long nY, const RGBAColor& rColor ) @@ -1234,7 +1244,7 @@ void AquaSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalIn if ( nFlags & SAL_INVERT_TRACKFRAME ) { - const float dashLengths[2] = { 4.0, 4.0 }; // for drawing dashed line + const CGFloat dashLengths[2] = { 4.0, 4.0 }; // for drawing dashed line CGContextSetBlendMode( mrContext, kCGBlendModeDifference ); CGContextSetRGBStrokeColor ( mrContext, 1.0, 1.0, 1.0, 1.0 ); CGContextSetLineDash ( mrContext, 0, dashLengths, 2 ); @@ -1269,7 +1279,7 @@ void AquaSalGraphics::invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInv CGContextAddLines ( mrContext, CGpoints, nPoints ); if ( nSalFlags & SAL_INVERT_TRACKFRAME ) { - const float dashLengths[2] = { 4.0, 4.0 }; // for drawing dashed line + const CGFloat dashLengths[2] = { 4.0, 4.0 }; // for drawing dashed line CGContextSetBlendMode( mrContext, kCGBlendModeDifference ); CGContextSetRGBStrokeColor ( mrContext, 1.0, 1.0, 1.0, 1.0 ); CGContextSetLineDash ( mrContext, 0, dashLengths, 2 ); @@ -1296,7 +1306,7 @@ void AquaSalGraphics::invert( sal_uLong nPoints, const SalPoint* pPtAry, SalInv void AquaSalGraphics::Pattern50Fill() { - static const float aFillCol[4] = { 1,1,1,1 }; + static const CGFloat aFillCol[4] = { 1,1,1,1 }; static const CGPatternCallbacks aCallback = { 0, &DrawPattern50, NULL }; if( ! GetSalData()->mxP50Space ) { @@ -1647,3 +1657,5 @@ bool XorEmulation::UpdateTarget() // TODO: return FALSE if target was not changed return true; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/aqua/source/gdi/salnativewidgets.cxx b/vcl/aqua/source/gdi/salnativewidgets.cxx index bb7392e557c6..b21cf2bdd313 100644 --- a/vcl/aqua/source/gdi/salnativewidgets.cxx +++ b/vcl/aqua/source/gdi/salnativewidgets.cxx @@ -709,7 +709,7 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType, // Perhaps some other HIThemeButtonDrawInfo setting would do the trick ? CGContextSetShouldAntialias( mrContext, true ); - float aGrey[] = { 0.45, 0.45, 0.45, 1.0 }; + CGFloat aGrey[] = { 0.45, 0.45, 0.45, 1.0 }; CGContextSetFillColor( mrContext, aGrey ); CGContextBeginPath( mrContext ); float x = rc.origin.x + rc.size.width; diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx index 384cf3a45a67..f7ddea8dce88 100644 --- a/vcl/aqua/source/gdi/salprn.cxx +++ b/vcl/aqua/source/gdi/salprn.cxx @@ -343,7 +343,7 @@ void AquaSalInfoPrinter::GetPageInfo( const ImplJobSetup*, { if( mpPrintInfo ) { - long nDPIX = 72, nDPIY = 72; + sal_Int32 nDPIX = 72, nDPIY = 72; mpGraphics->GetResolution( nDPIX, nDPIY ); const double fXScaling = static_cast<double>(nDPIX)/72.0, fYScaling = static_cast<double>(nDPIY)/72.0; diff --git a/vcl/aqua/source/window/salframe.cxx b/vcl/aqua/source/window/salframe.cxx index b427e2e20165..924210d56911 100644 --- a/vcl/aqua/source/window/salframe.cxx +++ b/vcl/aqua/source/window/salframe.cxx @@ -1199,7 +1199,7 @@ static Color getColor( NSColor* pSysColor, const Color& rDefault, NSWindow* pWin NSColor* pRBGColor = [pSysColor colorUsingColorSpaceName: NSDeviceRGBColorSpace device: [pWin deviceDescription]]; if( pRBGColor ) { - float r = 0, g = 0, b = 0, a = 0; + CGFloat r = 0, g = 0, b = 0, a = 0; [pRBGColor getRed: &r green: &g blue: &b alpha: &a]; aRet = Color( int(r*255.999), int(g*255.999), int(b*255.999) ); /* @@ -1227,7 +1227,7 @@ static Font getFont( NSFont* pFont, long nDPIY, const Font& rDefault ) return aResult; } -void AquaSalFrame::getResolution( long& o_rDPIX, long& o_rDPIY ) +void AquaSalFrame::getResolution( sal_Int32& o_rDPIX, sal_Int32& o_rDPIY ) { if( ! mpGraphics ) { @@ -1271,7 +1271,7 @@ void AquaSalFrame::UpdateSettings( AllSettings& rSettings ) // get the system font settings Font aAppFont = aStyleSettings.GetAppFont(); - long nDPIX = 72, nDPIY = 72; + sal_Int32 nDPIX = 72, nDPIY = 72; getResolution( nDPIX, nDPIY ); aAppFont = getFont( [NSFont systemFontOfSize: 0], nDPIY, aAppFont ); diff --git a/vcl/aqua/source/window/salframeview.mm b/vcl/aqua/source/window/salframeview.mm index 74f1685af2a7..b20635718e57 100644 --- a/vcl/aqua/source/window/salframeview.mm +++ b/vcl/aqua/source/window/salframeview.mm @@ -133,9 +133,9 @@ static const struct ExceptionalKey static AquaSalFrame* getMouseContainerFrame() { - int nWindows = 0; + NSInteger nWindows = 0; NSCountWindows( &nWindows ); - int* pWindows = (int*)alloca( nWindows * sizeof(int) ); + NSInteger* pWindows = (NSInteger*)alloca( nWindows * sizeof(NSInteger) ); // note: NSWindowList is supposed to be in z-order front to back NSWindowList( nWindows, pWindows ); AquaSalFrame* pDispatchFrame = NULL; @@ -1589,7 +1589,7 @@ private: return nil; } -- (unsigned int)characterIndexForPoint:(NSPoint)thePoint +- (NSUInteger)characterIndexForPoint:(NSPoint)thePoint { (void)thePoint; // FIXME |